/* wAve design conventions: dark theme, primary #3B82F6, wAve gray scale — with depth + motion. */
:root {
  --bg: #16191f; --card: #1f2227; --elev: #2c3036; --line: #363b43;
  --ink: #f9fafb; --ink-2: #d2d5d9; --muted: #a5a9b0;
  --accent: #3b82f6; --accent-h: #60a5fa; --accent-d: #2563eb;
  --ok: #34d399; --okbg: #0c2a22; --warn: #fbbf24; --warnbg: #2c2410; --err: #f87171; --errbg: #2c1618;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.28);
  --ease: cubic-bezier(.22,.61,.36,1);
}
* { box-sizing: border-box; }
/* the [hidden] attr must beat author display rules (flex/block) that would otherwise show it */
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 460px at 78% -8%, rgba(59,130,246,.10), transparent 60%),
    radial-gradient(900px 420px at 8% 0%, rgba(96,165,250,.06), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

.accent { height: 3px; background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent-h) 70%, transparent);
  box-shadow: 0 0 12px rgba(59,130,246,.55); }
header { background: linear-gradient(180deg, #23272f 0%, #1d2026 100%); border-bottom: 1px solid var(--line);
  padding: 15px 26px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  animation: fadeDown .5s var(--ease) both; }
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand .logo { height: 34px; width: auto; max-width: 160px; display: block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.brand-txt { display: flex; flex-direction: column; }
.eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--accent-h); margin-bottom: 2px; }
.brand h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.02em; color: #fff; line-height: 1.15; }
.brand .sub { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

.header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logout { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px;
  padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; transition: color .18s, border-color .18s; }
.logout:hover { color: var(--ink); border-color: #454b53; }

/* login */
.login-layout { position: fixed; inset: 0; overflow-x: hidden; overflow-y: auto; padding: 24px;
  background: radial-gradient(ellipse 100% 80% at 50% -10%, #232936 0%, var(--bg) 60%);
  display: flex; justify-content: center; align-items: center; animation: loginFade .35s var(--ease) both; }
.login-card { width: 100%; max-width: 412px; box-sizing: border-box; position: relative;
  background: linear-gradient(180deg, #22262f 0%, #1b1e24 100%);
  border: 1px solid var(--line); border-radius: 18px; padding: 40px 38px 30px;
  box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 24px 60px -12px rgba(0,0,0,.6);
  display: flex; flex-direction: column; align-items: center;
  animation: loginRise .5s var(--ease) both; }
.login-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, transparent, rgba(96,165,250,.55), transparent); }
.login-card > div { display: flex; flex-direction: column; align-items: center; width: 100%; }
.login-card > div[hidden] { display: none; }
.login-badge { width: 62px; height: 62px; border-radius: 16px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, rgba(59,130,246,.22), transparent 70%);
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.45)); }
.login-icon { width: 46px; height: 46px; object-fit: contain; }
.login-eyebrow { margin-top: 14px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.login-head { display: flex; flex-direction: column; align-items: center; gap: 7px; margin-top: 10px; margin-bottom: 26px; }
.login-title { color: var(--ink); font-size: 22px; font-weight: 700; letter-spacing: -.01em; text-align: center; line-height: 1.25; text-wrap: balance; }
.login-sub { color: var(--muted); font-size: 13.5px; text-align: center; line-height: 1.5; max-width: 300px; }
.login-card form { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.login-input { width: 100%; height: 46px; padding: 0 14px; box-sizing: border-box; text-align: center;
  font-size: 15.5px; font-weight: 500; border-radius: 11px; border: 1px solid var(--line);
  color: var(--ink); background: #14171c; transition: border-color .15s, box-shadow .15s; }
.login-input::placeholder { font-weight: 500; color: #6b7078; }
.login-input:hover { border-color: #454b53; }
.login-input:focus { outline: none; border-color: var(--accent); background: #14171c; color: var(--ink);
  box-shadow: 0 0 0 3px rgba(59,130,246,.22); }
.code-input { letter-spacing: .55em; padding-left: .55em; font-size: 20px; }
.login-btn { width: 100%; height: 46px; border: 0; border-radius: 11px; color: #fff; font-size: 15px; font-weight: 600;
  background: linear-gradient(180deg, var(--accent-h), var(--accent-d)); cursor: pointer;
  transition: filter .15s, box-shadow .15s, transform .05s; display: inline-flex; align-items: center; justify-content: center; }
.login-btn:hover:enabled { filter: brightness(1.08); box-shadow: 0 6px 20px rgba(59,130,246,.4); }
.login-btn:active:enabled { transform: translateY(1px); }
.login-btn:disabled { background: #2c3036; color: #6b7078; cursor: default; box-shadow: none; }
.login-back { position: absolute; left: 14px; top: 14px; width: 34px; height: 34px; border-radius: 9px;
  background: none; border: 0; color: var(--ink-2); font-size: 26px; line-height: 1; cursor: pointer; z-index: 2;
  display: grid; place-items: center; transition: background .15s, color .15s; }
.login-back:hover { background: var(--elev); color: #fff; }
.login-resend { margin-top: 4px; background: none; border: 0; color: var(--accent-h); font-size: 13px; font-weight: 500;
  cursor: pointer; padding: 6px; align-self: center; }
.login-resend:hover:enabled { text-decoration: underline; }
.login-resend:disabled { opacity: .5; cursor: default; }
.login-msg { margin-top: 16px; width: 100%; text-align: center; font-size: 13px; padding: 9px 12px; border-radius: 9px; box-sizing: border-box; }
.login-msg.err { background: rgba(248,113,113,.12); color: #fca5a5; border: 1px solid rgba(248,113,113,.3); }
.login-msg.ok  { background: rgba(52,211,153,.12); color: #6ee7b7; border: 1px solid rgba(52,211,153,.3); }
.login-msg.warn { background: rgba(251,191,36,.12); color: #fcd34d; border: 1px solid rgba(251,191,36,.3); }
.login-foot { margin-top: 22px; font-size: 11px; letter-spacing: .06em; color: #5b616b; }
@keyframes loginFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes loginRise { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@media (max-width: 700px) {
  .login-card { padding: 34px 26px 26px; }
  .login-title { font-size: 21px; }
  header { padding: 12px 16px; gap: 10px; }
  .header-right { width: 100%; justify-content: space-between; }
  main { margin: 16px auto; padding: 0 14px; }
  .panel { padding: 20px 16px; }
  .status-bar input[type=search] { max-width: none; }
}

/* segmented pill tabs */
.tabs { display: inline-flex; background: var(--elev); border-radius: 11px; padding: 4px; gap: 2px; border: 1px solid var(--line); }
.tab { border: 0; background: none; padding: 8px 22px; font-size: 14px; font-weight: 600; color: var(--muted);
  cursor: pointer; border-radius: 8px; transition: background .25s var(--ease), color .2s, box-shadow .25s; }
.tab:hover { color: var(--ink); }
.tab.active { background: linear-gradient(180deg,#434a54,#3a4049); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }

main { max-width: 1040px; margin: 26px auto; padding: 0 24px; }
.panel { position: relative; background: linear-gradient(180deg,#212530,#1d2026); border: 1px solid var(--line);
  border-radius: 14px; padding: 26px; box-shadow: var(--shadow); }
.panel::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; border-radius: 14px 14px 0 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent); }
.panel:not([hidden]) { animation: fadeInUp .5s var(--ease) both; }
#panel-send { max-width: 500px; margin: 0 auto; }

form { display: flex; flex-direction: column; gap: 16px; width: 100%; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em; }
input, select { padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; font-size: 15px;
  color: var(--ink); background: #191c22; font-weight: 400; text-transform: none; letter-spacing: 0;
  transition: border-color .2s, box-shadow .2s, background .2s; }
input::placeholder { color: #6b7078; }
input:hover, select:hover { border-color: #454b53; }
input:focus, select:focus { outline: none; border-color: var(--accent); background: #1b1f26; box-shadow: 0 0 0 3px rgba(59,130,246,.25); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a5a9b0' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 32px; }
.opt { color: var(--muted); font-weight: 400; text-transform: none; }

button[type=submit], .status-bar button { background: linear-gradient(180deg, var(--accent-h), var(--accent-d));
  color: #fff; border: 0; border-radius: 9px; padding: 12px 18px; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 2px 8px rgba(37,99,235,.28); transition: filter .2s, transform .1s var(--ease), box-shadow .25s; }
button[type=submit]:hover:not(:disabled), .status-bar button:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 4px 18px rgba(59,130,246,.5); }
button[type=submit]:active:not(:disabled), .status-bar button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: default; }
button .spin { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 6px; }

.result { margin-top: 18px; padding: 13px 15px; border-radius: 9px; font-size: 14px; border: 1px solid transparent; animation: slideDown .4s var(--ease) both; }
.result.ok { background: var(--okbg); color: var(--ok); border-color: #17553f; }
.result.warn { background: var(--warnbg); color: var(--warn); border-color: #4d3d13; }
.result.err { background: var(--errbg); color: var(--err); border-color: #5a2529; }

.status-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.status-bar .btn-2 { background: var(--elev); color: var(--ink-2); border: 1px solid var(--line); box-shadow: none; }
.status-bar .btn-2:hover:not(:disabled) { filter: none; background: #343a43; box-shadow: none; border-color: #454b53; }
.status-bar input[type=search] { flex: 1; min-width: 180px; max-width: 300px; padding: 9px 13px; }
.void-link { color: var(--muted) !important; font-weight: 500 !important; }
.void-link:hover { color: var(--err) !important; }
.status-bar button.loading .ico { display: inline-block; animation: spin .7s linear infinite; }
.chips { display: flex; gap: 6px; }
.chip { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--elev); color: var(--muted); border: 1px solid var(--line); }
.chip.has { background: #16305c; color: #93c5fd; border-color: #1e447e; }
.chip.stored { background: var(--okbg); color: var(--ok); border-color: #17553f; }
.live { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; animation: pulse 2.4s ease-in-out infinite; }
.meta { color: var(--muted); font-size: 13px; }

.status-note { margin: 0 0 14px; padding: 10px 14px; font-size: 13px; line-height: 1.5; color: var(--ink-2);
  background: rgba(59,130,246,.08); border: 1px solid rgba(59,130,246,.22); border-radius: 10px; }
.status-note strong { color: var(--ink); font-weight: 600; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--ink-2); }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
tbody tr { transition: background .18s; }
tbody tr:hover { background: #23272e; }
tbody tr.row-in { animation: fadeInUp .45s var(--ease) both; }
.muted { color: var(--muted); }
.err-cell { color: var(--err); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.s-sent { background: #16305c; color: #93c5fd; }
.s-signed { background: #3a2f0c; color: #fcd34d; }
.s-stored { background: var(--okbg); color: var(--ok); }
.s-bad { background: var(--errbg); color: var(--err); }
td a { color: var(--accent-h); font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }
td time { cursor: default; }

.skel td { border-bottom: 1px solid var(--line); }
.skel .bar { height: 12px; border-radius: 6px; background: linear-gradient(90deg,#2c3036 25%,#3a4049 37%,#2c3036 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }

.toast { position: fixed; top: 20px; right: 20px; z-index: 50; max-width: 380px; padding: 14px 17px;
  border-radius: 11px; box-shadow: 0 10px 30px rgba(0,0,0,.45); font-size: 14px; color: #06231a;
  background: var(--ok); font-weight: 600; animation: toastIn .42s var(--ease) both; }
.toast.warn { background: var(--warn); color: #2a1e00; } .toast.err { background: var(--err); color: #2a0c0e; }
.toast.hide { animation: toastOut .3s ease forwards; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(52,211,153,.5); } 50% { opacity: .45; box-shadow: 0 0 0 6px rgba(52,211,153,0); } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(28px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(28px); } }

@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
