/* LabelVault — brand red + white, with dark/light themes. Vanilla CSS.
   Class names match app.js exactly. Colors are tokenized; light overrides live
   in :root[data-theme="light"]. */
:root, :root[data-theme="dark"] {
  --bg: #0b0c11;
  --bg-2: #15171f;               /* inputs / inset surfaces */
  --text: #f2f4f8;
  --muted: #a3a9b8;
  --muted-2: #6f7688;

  --surface: rgba(23, 25, 33, 0.62);
  --surface-2: rgba(33, 36, 46, 0.6);
  --surface-solid: #16181f;
  --sidebar-bg: rgba(9, 10, 15, 0.92);
  --topbar-bg: rgba(9, 10, 15, 0.55);
  --border: rgba(255, 255, 255, 0.09);
  --border-2: rgba(255, 255, 255, 0.17);
  --hair: rgba(255, 255, 255, 0.07);
  --inset-bg: rgba(0, 0, 0, 0.28);
  --btn-bg: rgba(255, 255, 255, 0.04);
  --row-hover: rgba(255, 255, 255, 0.03);
  --edge: rgba(255, 255, 255, 0.16);   /* card top highlight */
  --grid: rgba(255, 255, 255, 0.04);
  --scrim: rgba(3, 5, 10, 0.72);
  --stat-grad: linear-gradient(180deg, #ffffff, #c6cad6);
  --wm-l: #f3f6ff;
  --shadow-card: 0 24px 60px -34px rgba(0,0,0,.85);
  --shadow: 0 30px 80px -30px rgba(0,0,0,.8);

  /* Brand: red + white */
  --accent: #e5484d;
  --accent-2: #ff5b6b;
  --accent-3: #ff8a92;
  --brand-red: #e5484d;
  --grad: linear-gradient(135deg, #ff6b78 0%, #e5484d 55%, #c92336 100%);
  --grad-soft: linear-gradient(135deg, rgba(255,107,120,.16), rgba(229,72,77,.16));
  --accent-weak: rgba(229, 72, 77, 0.12);
  --on-accent: #ffffff;
  --ring: rgba(229, 72, 77, 0.22);
  --glow: rgba(229, 72, 77, 0.55);
  --amb1: rgba(229, 72, 77, 0.16);
  --amb2: rgba(255, 120, 130, 0.09);
  --amb3: rgba(150, 20, 35, 0.12);

  --green: #34e2b4; --green-bg: rgba(52,226,180,.12); --green-bd: rgba(52,226,180,.35);
  --amber: #ffcf5a; --amber-bg: rgba(255,207,90,.12); --amber-bd: rgba(255,207,90,.35);
  --red: #ff6b81;   --red-bg: rgba(255,107,129,.12); --red-bd: rgba(255,107,129,.4);

  --radius: 16px;
  --radius-sm: 11px;
  --ease: cubic-bezier(.22, .68, .26, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Space Grotesk", "Inter", var(--font);
  --mono: "SF Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
}

/* ── Light theme ── */
:root[data-theme="light"] {
  --bg: #f5f6f9;
  --bg-2: #ffffff;
  --text: #191c24;
  --muted: #5a6273;
  --muted-2: #8a93a6;

  --surface: rgba(255, 255, 255, 0.78);
  --surface-2: rgba(248, 249, 252, 0.9);
  --surface-solid: #ffffff;
  --sidebar-bg: rgba(255, 255, 255, 0.82);
  --topbar-bg: rgba(255, 255, 255, 0.7);
  --border: rgba(18, 24, 40, 0.10);
  --border-2: rgba(18, 24, 40, 0.18);
  --hair: rgba(18, 24, 40, 0.08);
  --inset-bg: rgba(18, 24, 40, 0.04);
  --btn-bg: rgba(18, 24, 40, 0.03);
  --row-hover: rgba(18, 24, 40, 0.035);
  --edge: rgba(229, 72, 77, 0.28);
  --grid: rgba(18, 24, 40, 0.05);
  --scrim: rgba(30, 35, 55, 0.4);
  --stat-grad: linear-gradient(180deg, #1a1d24, #4a5262);
  --wm-l: #191c24;
  --shadow-card: 0 20px 50px -30px rgba(30, 40, 70, 0.28);
  --shadow: 0 30px 70px -28px rgba(30, 40, 70, 0.3);

  --grad-soft: linear-gradient(135deg, rgba(229,72,77,.10), rgba(255,107,120,.10));
  --accent-weak: rgba(229, 72, 77, 0.08);
  --ring: rgba(229, 72, 77, 0.20);
  --glow: rgba(229, 72, 77, 0.38);
  --amb1: rgba(229, 72, 77, 0.10);
  --amb2: rgba(255, 130, 140, 0.07);
  --amb3: rgba(255, 190, 195, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow-x: clip; max-width: 100%; }
body {
  font-family: var(--font); color: var(--text); font-size: 15px; line-height: 1.55;
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; overflow-x: hidden; scroll-behavior: smooth;
  transition: background-color .3s ease, color .3s ease;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 600px at 82% -8%, var(--amb1), transparent 60%),
    radial-gradient(800px 600px at 8% 12%, var(--amb2), transparent 55%),
    radial-gradient(700px 700px at 60% 108%, var(--amb3), transparent 60%);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(1200px 800px at 70% 0%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(1200px 800px at 70% 0%, #000 20%, transparent 80%);
}

a { color: var(--accent); text-decoration: none; transition: color .16s ease, opacity .16s ease; font-weight: 500; }
a:hover { color: var(--accent-2); text-decoration: none; }
.navlink, .navlink:hover, .brand, .brand:hover, .btn, .btn:hover { text-decoration: none !important; }
h1, h2, h3 { margin: 0 0 .4em; font-family: var(--display); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; letter-spacing: -.025em; }
h2 { font-size: 1.12rem; }
code, .mono { font-family: var(--mono); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 20px; border: 2px solid transparent; background-clip: padding-box; }
::selection { background: rgba(229,72,77,.28); color: #fff; }

/* ── Buttons ── */
.btn {
  appearance: none; border: 1px solid var(--border-2); color: var(--text); background: var(--btn-bg);
  padding: 10px 17px; border-radius: var(--radius-sm); font-size: .9rem; font-weight: 600; font-family: inherit;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px; justify-content: center; white-space: nowrap;
  /* Spring easing on transform → a weighty settle when the press releases */
  transition: transform .3s cubic-bezier(.2, 1.3, .45, 1), background .18s, border-color .18s, box-shadow .24s var(--ease), filter .18s;
  box-shadow: 0 2px 5px -2px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.05) inset;
  backdrop-filter: blur(6px); -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:hover { border-color: var(--accent); background: var(--accent-weak); transform: translateY(-2px); box-shadow: 0 12px 26px -12px var(--glow), 0 4px 10px -4px rgba(0,0,0,.4); }
/* Heavy press: pushes down + into the surface with an inner shadow, snaps on press, springs back on release */
.btn:active { transform: translateY(2px) scale(.955); transition-duration: .04s; box-shadow: 0 1px 2px rgba(0,0,0,.5), inset 0 3px 9px rgba(0,0,0,.32); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary { background: var(--grad); border-color: transparent; color: var(--on-accent); font-weight: 700; box-shadow: 0 10px 26px -10px var(--glow), 0 4px 10px -3px rgba(0,0,0,.42), 0 0 0 1px rgba(255,255,255,.06) inset; }
.btn.primary:hover { filter: brightness(1.06) saturate(1.03); transform: translateY(-2px); box-shadow: 0 18px 40px -10px var(--glow), 0 0 24px -6px var(--glow); }
.btn.primary:active { transform: translateY(2px) scale(.955); box-shadow: 0 2px 8px -4px var(--glow), inset 0 3px 12px rgba(0,0,0,.34); }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.ghost:hover { background: var(--accent-weak); }
.btn.danger { color: var(--red); border-color: var(--red-bd); background: var(--red-bg); }
.btn.danger:hover { background: rgba(255,107,129,.18); }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 12px; font-size: .8rem; }

/* Icon button (theme toggle) */
.icon-btn { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--border-2); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: color .16s var(--ease), border-color .16s var(--ease), background .16s var(--ease), box-shadow .2s var(--ease), transform .28s cubic-bezier(.2, 1.3, .45, 1); backdrop-filter: blur(10px); box-shadow: 0 2px 5px -2px rgba(0,0,0,.4); }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 22px -12px var(--glow); }
.icon-btn:active { transform: translateY(1px) scale(.92); transition-duration: .04s; box-shadow: inset 0 3px 8px rgba(0,0,0,.3); }
.icon-btn svg { width: 18px; height: 18px; }

/* ── Inputs ── */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
input, select, textarea { width: 100%; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); padding: 11px 14px; border-radius: var(--radius-sm); font-size: .93rem; font-family: inherit; transition: .16s; }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:hover, select:hover, textarea:hover { border-color: var(--border-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
textarea { resize: vertical; min-height: 90px; font-family: var(--mono); font-size: .85rem; }
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 24 24' fill='none' stroke='%23a3a9b8' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

/* ── Dropzone ── */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 34px 20px; border: 2px dashed var(--border-2); border-radius: var(--radius-sm); background: var(--bg-2); color: var(--muted); cursor: pointer; transition: border-color .16s, background .16s, color .16s; }
.dropzone:hover, .dropzone:focus-visible { outline: none; border-color: var(--accent); color: var(--text); }
.dropzone.dragging { border-color: var(--accent); background: var(--accent-weak); color: var(--text); }
.dropzone.has-file { border-style: solid; border-color: var(--accent); color: var(--text); }
.dropzone .dz-icon { width: 34px; height: 34px; margin-bottom: 4px; opacity: .85; }
.dropzone .dz-title { font-weight: 600; font-size: .95rem; color: var(--text); word-break: break-all; }
.dropzone .dz-sub { font-size: .82rem; color: var(--muted); }

/* ── Cards ── */
.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; backdrop-filter: blur(18px) saturate(1.1); box-shadow: var(--shadow-card); }
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; border-radius: var(--radius) var(--radius) 0 0; background: linear-gradient(90deg, transparent, var(--edge), transparent); opacity: .8; }
.card + .card { margin-top: 18px; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.row { display: flex; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.divider { height: 1px; background: var(--hair); margin: 18px 0; border: 0; }

/* ── Pills ── */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border: 1px solid transparent; }
.pill.green { color: var(--green); background: var(--green-bg); border-color: var(--green-bd); }
.pill.amber { color: #b8860b; background: var(--amber-bg); border-color: var(--amber-bd); }
.pill.red { color: var(--red); background: var(--red-bg); border-color: var(--red-bd); }
.pill.gray { color: var(--muted); background: var(--inset-bg); border-color: var(--border); }

/* ── Auth ── */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { position: relative; width: 100%; max-width: 430px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 22px; padding: 36px; backdrop-filter: blur(22px) saturate(1.1); box-shadow: var(--shadow), 0 0 60px -22px var(--glow); }
.auth-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, var(--edge), transparent); }
.auth-toggle { position: absolute; top: 18px; right: 18px; }
.brand-lg { display: flex; align-items: center; gap: 13px; margin-bottom: 12px; }
.brand-lg .lv-mark { width: 46px; height: 41px; flex: none; filter: drop-shadow(0 4px 14px rgba(229,72,77,.4)); }
.auth-tabs { display: flex; gap: 5px; background: var(--inset-bg); padding: 5px; border-radius: 13px; margin: 20px 0; border: 1px solid var(--border); }
.auth-tabs button { flex: 1; padding: 9px; border: none; background: transparent; color: var(--muted); font-weight: 600; border-radius: 9px; cursor: pointer; font-size: .9rem; transition: .15s; font-family: inherit; }
.auth-tabs button.active { background: var(--grad-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-2); }
.auth-card .eyebrow { color: var(--accent); margin-top: 4px; margin-bottom: 6px; }
.auth-h { font-size: 1.5rem; line-height: 1.1; font-weight: 700; margin: 0 0 8px; letter-spacing: -.01em; }
.field .req { color: var(--accent); }
.field > .field-hint { display: block; font-size: .76rem; color: var(--muted-2); margin: 6px 0 0; font-weight: 400; line-height: 1.4; }
.input-bad, .input-bad:hover { border-color: var(--red) !important; box-shadow: 0 0 0 3px var(--red-bg); }

/* ── App shell ── */
.app { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar-bg); border-right: 1px solid var(--border); padding: 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; backdrop-filter: blur(14px); }
.sidebar .brand { display: flex; align-items: center; gap: 11px; padding: 19px 20px; border-bottom: 1px solid var(--border); cursor: pointer; }
.sidebar .brand .lv-mark { width: 34px; height: 30px; flex: none; filter: drop-shadow(0 3px 10px rgba(229,72,77,.45)); }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em; }
.wordmark .l { color: var(--wm-l); }
.wordmark .v { color: var(--brand-red); }
.nav-section { padding: 20px 22px 9px; font-size: .66rem; letter-spacing: .18em; color: var(--muted-2); font-weight: 700; text-transform: uppercase; }
.nav-list { padding: 0 12px; display: flex; flex-direction: column; gap: 3px; }
.navlink { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; color: var(--text); cursor: pointer; transition: background .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease); border: 1px solid transparent; }
.navlink .nav-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--btn-bg); border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted); flex: none; transition: .14s; }
.navlink .nav-ic svg { width: 17px; height: 17px; }
.navlink .nav-tt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.navlink .nav-tt .t { font-weight: 600; font-size: .9rem; color: var(--text); }
.navlink .nav-tt .s { font-size: .72rem; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navlink:hover { background: var(--row-hover); }
.navlink:hover .nav-ic { color: var(--text); border-color: var(--border-2); }
.navlink { transition: background .18s var(--ease), border-color .18s var(--ease), transform .28s cubic-bezier(.2, 1.3, .45, 1); }
.navlink:active { transform: translateY(1px) scale(.965); transition-duration: .04s; }
.navlink.active { background: var(--grad-soft); border-color: var(--border-2); box-shadow: 0 8px 26px -18px var(--glow); }
.navlink.active::before { content: ""; position: absolute; left: -1px; top: 50%; transform: translateY(-50%); width: 3px; height: 20px; border-radius: 3px; background: var(--grad); box-shadow: 0 0 12px 1px var(--glow); }
.navlink.active .nav-ic { background: var(--grad); border-color: transparent; color: var(--on-accent); box-shadow: 0 0 18px -4px var(--glow); }
.navlink.active .nav-tt .t { color: var(--text); }
.nav-spacer { flex: 1; min-height: 12px; }
.sidebar .sidefoot { padding: 12px; border-top: 1px solid var(--border); margin-top: auto; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 15px 30px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--topbar-bg); backdrop-filter: blur(16px); z-index: 5; }
.topbar-mark { display: none; }
.topbar-mark .lv-mark { width: 27px; height: 24px; }
/* Mobile side-drawer nav */
.nav-toggle { display: none; width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); cursor: pointer; place-items: center; flex: none; padding: 0; }
.nav-toggle svg { width: 20px; height: 20px; }
.nav-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 45; backdrop-filter: blur(2px); }
.app.nav-open .nav-backdrop { display: block; }
.balance-chip { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border-2); padding: 8px 15px; border-radius: 13px; box-shadow: 0 0 20px -12px var(--glow); }
.balance-chip .amt { font-family: var(--display); font-weight: 700; font-size: 1.05rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.content { padding: 30px; max-width: 1120px; width: 100%; }
.page-head { margin-bottom: 22px; }
.page-head p { color: var(--muted); margin: 0; }

/* ── Stat tiles ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; backdrop-filter: blur(16px); box-shadow: var(--shadow-card); }
.stat::after { content: ""; position: absolute; top: -40%; right: -20%; width: 140px; height: 140px; background: radial-gradient(circle, var(--amb1), transparent 70%); pointer-events: none; }
.stat .k { color: var(--muted); font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.stat .v { font-family: var(--display); font-size: 1.7rem; font-weight: 700; margin-top: 8px; letter-spacing: -.02em; background: var(--stat-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ── Tabs ── */
.tabs { display: inline-flex; gap: 4px; background: var(--inset-bg); padding: 5px; border-radius: 13px; margin-bottom: 18px; border: 1px solid var(--border); }
.tab { padding: 8px 18px; border: none; background: transparent; color: var(--muted); font-weight: 600; border-radius: 9px; cursor: pointer; font-size: .9rem; font-family: inherit; transition: background .16s, color .16s, box-shadow .16s, transform .28s cubic-bezier(.2, 1.3, .45, 1); }
.tab:active { transform: scale(.94); transition-duration: .04s; }
.tab.active { background: var(--grad-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-2); }

/* ── Cart badge ── */
.nav-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 7px; border-radius: 9px; background: var(--grad); color: var(--on-accent); font-size: .68rem; font-weight: 800; vertical-align: middle; box-shadow: 0 0 12px -2px var(--glow); }
.nav-badge.bump { animation: badgeBump .32s var(--ease); }
@keyframes badgeBump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.btn.btn-loading { opacity: .85; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--hair); font-size: .88rem; }
th { color: var(--muted-2); font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--row-hover); }
.table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }

/* ── Copy field ── */
.copy-field { display: flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 8px 8px 13px; }
.copy-field code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }

/* ── Toast ── */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--surface-2); border: 1px solid var(--border-2); padding: 12px 18px; border-radius: 13px; box-shadow: var(--shadow); font-size: .9rem; animation: pop .22s ease; max-width: 90vw; backdrop-filter: blur(16px); color: var(--text); }
.toast.ok { border-color: var(--green-bd); }
.toast.err { border-color: var(--red-bd); }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } }

/* ── Notices ── */
.notice { padding: 13px 16px; border-radius: var(--radius-sm); font-size: .88rem; border: 1px solid var(--border); background: var(--surface-2); }
.notice.amber { border-color: var(--amber-bd); background: var(--amber-bg); }
.notice.green { border-color: var(--green-bd); background: var(--green-bg); }
.notice.red { border-color: var(--red-bd); background: var(--red-bg); }

/* ── Misc ── */
.spinner { width: 16px; height: 16px; border: 2px solid var(--border-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .big { font-size: 2.2rem; margin-bottom: 8px; }
.qr { background: #fff; padding: 10px; border-radius: 14px; width: 200px; height: 200px; box-shadow: 0 0 30px -10px var(--glow); }
.addr-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.mobile-nav { display: none; }

/* ── Add Funds ── */
.fund-layout { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: start; }
.amount-input { display: flex; align-items: center; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: .16s; }
.amount-input .cur { padding: 0 2px 0 14px; color: var(--muted); font-weight: 700; }
.amount-input input { border: none !important; background: transparent !important; box-shadow: none !important; font-size: 1.05rem; }
.amount-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.howbox { background: var(--inset-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 15px 17px; }
.pay-method { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); transition: .16s; }
.pay-method:hover { border-color: var(--border-2); transform: translateY(-1px); }
.pay-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.05rem; flex: none; box-shadow: 0 6px 16px -6px rgba(0,0,0,.5); }
.pay-ic.venmo { background: linear-gradient(160deg, #4aa3d8, #2f7fbf); }
.pay-ic.zelle { background: linear-gradient(160deg, #7b34e0, #5a10c0); }
.pay-ic.cashapp { background: linear-gradient(160deg, #12e04a, #00b82c); }
.code-chip { display: inline-block; margin: 10px 0; padding: 10px 20px; border-radius: 12px; background: var(--inset-bg); border: 1px dashed var(--border-2); font-family: var(--mono); font-size: 1.4rem; font-weight: 700; letter-spacing: .2em; color: var(--accent); }

/* ── Addresses ── */
.icon-tile { width: 40px; height: 40px; border-radius: 12px; background: var(--grad-soft); border: 1px solid var(--border-2); display: grid; place-items: center; color: var(--accent); flex: none; box-shadow: 0 0 18px -8px var(--glow); }
.eyebrow { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); font-weight: 700; margin-bottom: 8px; }

/* ── Single-label layout ── */
.check-row { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--row-hover); margin-bottom: 16px; cursor: pointer; font-size: .9rem; font-weight: 500; transition: border-color .16s var(--ease); }
.check-row:hover { border-color: var(--border-2); }
.check-row input { width: auto; margin: 0; accent-color: var(--accent); }
.addr-preview { margin: -4px 0 4px; padding: 14px 16px; border: 1px solid var(--accent); border-radius: var(--radius-sm); background: var(--accent-weak); }
.addr-preview[hidden] { display: none; }
.addr-preview .ap-name { font-weight: 650; font-size: .98rem; margin-bottom: 4px; }
.addr-preview .ap-line { color: var(--muted); font-size: .86rem; line-height: 1.45; }
.addr-preview .ap-edit { display: inline-block; margin-top: 10px; font-size: .82rem; color: var(--accent); font-weight: 600; }
.action-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.action-bar .row { flex-wrap: wrap; }

/* ── Extensions ── */
.sec-title { display: flex; align-items: center; gap: 10px; }
.sec-title svg { width: 18px; height: 18px; color: var(--accent); }
.ext-card { text-align: center; }
.ext-ic { width: 48px; height: 48px; margin: 0 auto; border-radius: 14px; background: var(--grad-soft); border: 1px solid var(--border-2); display: grid; place-items: center; color: var(--accent); box-shadow: 0 0 20px -8px var(--glow); }
.ext-ic svg { width: 22px; height: 22px; }
.guide-h { font-size: 1.02rem; margin: 6px 0 10px; font-family: var(--display); color: var(--text); }
.guide-steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.guide-steps li { position: relative; padding: 9px 0 9px 42px; color: var(--muted); font-size: .9rem; border-bottom: 1px solid var(--hair); }
.guide-steps li:last-child { border-bottom: 0; }
.guide-steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 7px; width: 26px; height: 26px; border-radius: 8px; background: var(--grad-soft); border: 1px solid var(--border-2); color: var(--accent); font-size: .78rem; font-weight: 700; display: grid; place-items: center; }
.guide-sub { margin: 4px 0 0; padding-left: 20px; color: var(--muted); line-height: 2; font-size: .9rem; }
.guide-box { background: var(--inset-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px 16px; margin-top: 14px; overflow-x: auto; }
.guide-box .lbl { font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted-2); font-weight: 700; margin-bottom: 7px; }
.guide-box code { font-family: var(--mono); font-size: .8rem; color: var(--accent); white-space: pre-wrap; word-break: break-word; display: block; line-height: 1.6; }
.inline-code { font-family: var(--mono); font-size: .82rem; background: var(--inset-bg); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; color: var(--accent); }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 400; padding: 20px; animation: fade .16s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { position: relative; width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 20px; padding: 24px; box-shadow: var(--shadow), 0 0 60px -24px var(--glow); max-height: 90vh; overflow-y: auto; animation: pop .2s ease; backdrop-filter: blur(24px); }
.modal::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; border-radius: 20px 20px 0 0; background: linear-gradient(90deg, transparent, var(--edge), transparent); }
.modal-x { border: none; background: transparent; color: var(--muted); font-size: 1.15rem; cursor: pointer; line-height: 1; }
.modal-x:hover { color: var(--text); }

/* ── Motion ── */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.page-head { animation: rise .2s var(--ease) both; }
.content > .card, .content > .grid > .card, .content > .stats > .stat, .content > .fund-layout > .card, .content > .fund-center > .card, .content > .grid { animation: rise .24s var(--ease) both; }
.content > .stats > .stat:nth-child(2) { animation-delay: .03s; }
.content > .stats > .stat:nth-child(3) { animation-delay: .06s; }
.content > .stats > .stat:nth-child(4) { animation-delay: .09s; }
.content > .grid > .card:nth-child(2) { animation-delay: .04s; }
.nav-list .navlink { animation: fadein .4s ease both; }
/* Smooth page transitions on navigation — kept short so nav feels instant */
.content { transition: opacity .1s var(--ease); }
.content.is-leaving { opacity: .6; }
.content.route-enter { animation: fadein .13s var(--ease); }
:focus-visible { outline: none; }
.navlink, .brand, .tab, .auth-tabs button, .icon-btn { -webkit-tap-highlight-color: transparent; user-select: none; }

/* ── Responsive ── */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-grid; }
  /* Sidebar becomes an off-canvas drawer that slides in from the left */
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 50;
    width: 268px; max-width: 82vw; height: 100vh; height: 100dvh;
    transform: translateX(-100%);
    transition: transform .26s var(--ease);
    box-shadow: 0 0 44px -8px rgba(0,0,0,.55);
  }
  .app.nav-open .sidebar { transform: translateX(0); }
  .topbar-mark { display: block; }
  .grid.cols-2, .grid.cols-3, .addr-grid, .fund-layout { grid-template-columns: 1fr; }
  .content { padding: 20px 16px; max-width: 100%; }
  .topbar { padding: 12px 14px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none !important; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Admin toggle switch */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .82rem; color: var(--muted); user-select: none; }
.switch input { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--inset-bg); border: 1px solid var(--border-2); position: relative; cursor: pointer; transition: .18s var(--ease); flex: none; margin: 0; }
.switch input:checked { background: var(--grad); border-color: transparent; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .18s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.switch input:checked::after { transform: translateX(16px); }

/* Order details modal */
.modal.wide { max-width: 640px; }
.modal.xwide { max-width: 880px; }
.det-card { background: var(--inset-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 12px; }
.det-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; }
.det-grid > div > .small { margin-bottom: 3px; }
@media (max-width: 560px) { .det-grid { grid-template-columns: 1fr; } }

/* Add Funds — method selector */
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.method-opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; transition: .15s var(--ease); text-align: left; font-family: inherit; color: var(--text); }
.method-opt:hover { border-color: var(--border-2); transform: translateY(-1px); }
.method-opt.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.method-opt .mo-name { display: block; font-weight: 600; }
.method-opt .mo-sub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pay-ic.crypto { background: linear-gradient(160deg, #f7931a, #c76e12); }
@media (max-width: 560px) { .method-grid { grid-template-columns: 1fr; } }

/* Mapbox address autofill dropdown */
.addr-suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; margin-top: 4px; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius-sm); box-shadow: var(--shadow), 0 0 0 1px var(--border) inset; max-height: 244px; overflow-y: auto; backdrop-filter: blur(16px); }
.addr-suggest[hidden] { display: none; }
.addr-suggest .as-item { padding: 10px 13px; font-size: .86rem; color: var(--text); cursor: pointer; border-bottom: 1px solid var(--border); line-height: 1.35; }
.addr-suggest .as-item:last-child { border-bottom: none; }
.addr-suggest .as-item:hover, .addr-suggest .as-item.active { background: var(--accent-weak); }

/* Dashboard chart */
.dash-chart { position: relative; overflow-x: auto; }
.dash-chart .chb { cursor: crosshair; }

/* Add Funds — centered payment card */
.fund-center { max-width: 680px; margin: 0 auto; }
.tabs.fund-tabs { display: flex; width: 100%; margin-bottom: 20px; }
.tabs.fund-tabs .tab { flex: 1; text-align: center; }
.howto { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; margin: 2px 0 16px; }
.howto h3 { font-size: .98rem; margin: 0 0 10px; }
.howto ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: .88rem; line-height: 1.95; }
.pay-method { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: 10px; }
.pay-method .pm-name { display: block; font-weight: 600; }
.pay-method .pm-handle { display: block; }
.crypto-chips { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; margin: 2px 0 16px; }
.crypto-chips h3 { font-size: .98rem; margin: 0 0 12px; }
.coin-chip { display: inline-block; font-family: var(--mono); font-size: .74rem; font-weight: 600; color: var(--muted); background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 5px 9px; margin: 0 6px 6px 0; letter-spacing: .04em; }
.imp-list { margin: 8px 0 0; padding-left: 18px; line-height: 1.75; font-size: .85rem; }
.imp-list li { margin: 2px 0; }

/* Tracking-numbers modal */
.track-box { background: var(--inset-bg); border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 16px; min-height: 150px; max-height: 320px; overflow-y: auto; font-family: var(--mono); font-size: .85rem; line-height: 1.9; color: var(--text); white-space: pre-wrap; word-break: break-word; }

/* Select cryptocurrency grid */
.coin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.coin-card { display: flex; align-items: center; gap: 13px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; transition: .15s var(--ease); text-align: left; font-family: inherit; color: var(--text); }
.coin-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 14px 34px -18px var(--glow); }
.coin-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; box-shadow: 0 6px 16px -6px rgba(0,0,0,.5); }
.coin-name { display: block; font-weight: 650; }
.coin-sym { display: block; }

/* Payment status + instructions */
.pay-status { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.pay-status.waiting { color: var(--amber); }
.pay-status.done { color: var(--green); }
.pay-status.failed { color: var(--red); }
.pay-instruct { padding: 15px 17px; border-radius: var(--radius-sm); border: 1px solid var(--border-2); }
.pay-instruct.venmo { background: rgba(61,149,206,.12); border-color: rgba(61,149,206,.4); }
.pay-instruct.zelle { background: rgba(123,52,224,.12); border-color: rgba(123,52,224,.42); }
.pay-instruct.cashapp { background: rgba(0,182,44,.12); border-color: rgba(0,182,44,.4); }
