/* =========================================================
   Design tokens
   ========================================================= */
:root {
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bg: #f4f5fa;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, #eceafe 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, #e6f7f5 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eef0f7;
  --border: #e6e8f0;
  --border-strong: #d5d9e5;
  --text: #0e1330;
  --text-2: #3f4666;
  --muted: #7a809b;
  --primary: #5b4ff0;
  --primary-hover: #4c40e0;
  --primary-soft: #efedff;
  --primary-ink: #4337d6;
  --grad: linear-gradient(135deg, #5b4ff0 0%, #8b5cf6 55%, #c056f0 100%);
  --grad-soft: linear-gradient(135deg, #efedff 0%, #f6efff 100%);
  --success: #0e9f6e;
  --success-soft: #e7f8f1;
  --warning: #c77700;
  --warning-soft: #fff5e1;
  --danger: #e0364f;
  --danger-soft: #fdecef;
  --info: #0b83d9;
  --info-soft: #e6f3fd;
  --chart-cost: #6366f1;
  --chart-profit: #0d9488;
  --chart-grid: #eceef5;
  --sidebar: #0d1024;
  --sidebar-2: #151a36;
  --sidebar-text: #a4a9c6;
  --sidebar-active: #ffffff;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(14, 19, 48, .05);
  --shadow: 0 1px 2px rgba(14, 19, 48, .04), 0 6px 24px -6px rgba(14, 19, 48, .08);
  --shadow-lg: 0 24px 64px -16px rgba(14, 19, 48, .28);
  --ring: 0 0 0 4px rgba(91, 79, 240, .14);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #090c1a;
    --bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(91, 79, 240, .16) 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(13, 148, 136, .10) 0%, transparent 55%);
    --surface: #111530;
    --surface-2: #161b3a;
    --surface-3: #1d2347;
    --border: #232a50;
    --border-strong: #2f3766;
    --text: #eef0fb;
    --text-2: #c3c7e0;
    --muted: #8a90b2;
    --primary: #7c72ff;
    --primary-hover: #8d84ff;
    --primary-soft: #221f55;
    --primary-ink: #a9a2ff;
    --grad-soft: linear-gradient(135deg, #1f1c50 0%, #2a1a4d 100%);
    --success: #34d399;
    --success-soft: #0d2b25;
    --warning: #fbbf24;
    --warning-soft: #2e2410;
    --danger: #fb7185;
    --danger-soft: #36141d;
    --info: #60a5fa;
    --info-soft: #102544;
    --chart-cost: #6d6ff0;
    --chart-profit: #14a595;
    --chart-grid: #1f2548;
    --sidebar: #0a0d1f;
    --sidebar-2: #141936;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .4);
    --shadow-lg: 0 24px 64px -12px rgba(0, 0, 0, .6);
    --ring: 0 0 0 4px rgba(124, 114, 255, .22);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #090c1a;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(91, 79, 240, .16) 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(13, 148, 136, .10) 0%, transparent 55%);
  --surface: #111530;
  --surface-2: #161b3a;
  --surface-3: #1d2347;
  --border: #232a50;
  --border-strong: #2f3766;
  --text: #eef0fb;
  --text-2: #c3c7e0;
  --muted: #8a90b2;
  --primary: #7c72ff;
  --primary-hover: #8d84ff;
  --primary-soft: #221f55;
  --primary-ink: #a9a2ff;
  --grad-soft: linear-gradient(135deg, #1f1c50 0%, #2a1a4d 100%);
  --success: #34d399;
  --success-soft: #0d2b25;
  --warning: #fbbf24;
  --warning-soft: #2e2410;
  --danger: #fb7185;
  --danger-soft: #36141d;
  --info: #60a5fa;
  --info-soft: #102544;
  --chart-cost: #6d6ff0;
  --chart-profit: #14a595;
  --chart-grid: #1f2548;
  --sidebar: #0a0d1f;
  --sidebar-2: #141936;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .4);
  --shadow-lg: 0 24px 64px -12px rgba(0, 0, 0, .6);
  --ring: 0 0 0 4px rgba(124, 114, 255, .22);
  color-scheme: dark;
}

/* =========================================================
   Base
   ========================================================= */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { flex-shrink: 0; }
::selection { background: var(--primary-soft); color: var(--primary-ink); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.b { font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-nw { display: flex; gap: 8px; align-items: center; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.ok-text { color: var(--success); }
.err-text { color: var(--danger); }
.warn-text { color: var(--warning); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.85); } }
@keyframes ping { 75%, 100% { transform: scale(2.2); opacity: 0; } }
@keyframes scan { 0% { top: 8%; } 50% { top: 88%; } 100% { top: 8%; } }
@keyframes slideIn { from { transform: translateX(100%); } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.page-enter > * { animation: fadeUp .45s var(--ease) both; }
.page-enter > *:nth-child(2) { animation-delay: .04s; }
.page-enter > *:nth-child(3) { animation-delay: .08s; }
.page-enter > *:nth-child(4) { animation-delay: .12s; }
.page-enter > *:nth-child(5) { animation-delay: .16s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* =========================================================
   Layout: sidebar + topbar
   ========================================================= */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 264px; flex-shrink: 0; background: var(--sidebar); color: var(--sidebar-text);
  position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, .04);
}
.sidebar-head { padding: 20px 20px 14px; }
.logo { display: flex; align-items: center; gap: 11px; color: #fff; font-weight: 700; font-size: 16.5px; letter-spacing: -.01em; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--grad);
  box-shadow: 0 8px 20px -6px rgba(139, 92, 246, .7); flex-shrink: 0;
}
.logo-mark svg { width: 19px; height: 19px; color: #fff; }
.logo small { display: block; font-size: 11px; font-weight: 500; color: var(--sidebar-text); letter-spacing: .02em; }
.side-wallet {
  margin: 6px 14px 10px; padding: 14px 16px; border-radius: 16px; background: var(--grad); color: #fff; position: relative; overflow: hidden;
}
.side-wallet::after { content: ''; position: absolute; width: 130px; height: 130px; border-radius: 50%; background: rgba(255, 255, 255, .12); right: -40px; top: -60px; }
.side-wallet .lbl { font-size: 11.5px; opacity: .85; }
.side-wallet .amt { font-size: 21px; font-weight: 700; letter-spacing: -.02em; margin: 1px 0 10px; }
.side-wallet a {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #fff; background: rgba(255, 255, 255, .18);
  padding: 6px 11px; border-radius: 9px; position: relative; z-index: 1; transition: background .2s;
}
.side-wallet a:hover { background: rgba(255, 255, 255, .28); }
.side-nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; scrollbar-width: thin; scrollbar-color: #242a4d transparent; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; font-weight: 600; color: #5e6488; padding: 16px 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; color: var(--sidebar-text);
  font-weight: 500; font-size: 14px; transition: background .18s, color .18s; position: relative;
}
.nav-link svg { width: 19px; height: 19px; opacity: .9; }
.nav-link:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav-link.active { background: var(--sidebar-2); color: var(--sidebar-active); }
.nav-link.active::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #8b7dff; }
.nav-link.active svg { color: #9d92ff; opacity: 1; }
.nav-link .count { margin-left: auto; font-size: 11px; background: rgba(255, 255, 255, .08); padding: 1px 7px; border-radius: 99px; }
.nav-link .count.hot { background: #e0364f; color: #fff; }
.side-foot { padding: 12px 14px 16px; border-top: 1px solid rgba(255, 255, 255, .06); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.avatar {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; color: #fff; flex-shrink: 0;
  background: linear-gradient(135deg, #0d9488, #22c1a9); font-size: 14px; text-transform: uppercase;
}
.user-chip .name { color: #fff; font-weight: 600; font-size: 13.5px; }
.user-chip .role { font-size: 11.5px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; display: inline-grid; place-items: center; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); transition: all .18s; flex-shrink: 0;
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }
.icon-btn svg { width: 18px; height: 18px; }
.sidebar .icon-btn { background: transparent; border-color: rgba(255, 255, 255, .08); color: var(--sidebar-text); margin-left: auto; }
.sidebar .icon-btn:hover { color: #fff; border-color: rgba(255, 255, 255, .25); }

.main { flex: 1; min-width: 0; margin-left: 264px; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 68px; display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.topbar .title { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.topbar .crumb { font-size: 12px; color: var(--muted); }
.menu-btn { display: none; }
.top-search {
  display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 0 12px; height: 40px; width: 300px; color: var(--muted); transition: border-color .2s, box-shadow .2s;
}
.top-search:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.top-search input { border: 0; outline: 0; background: none; flex: 1; min-width: 0; height: 100%; color: var(--text); }
.top-search svg { width: 17px; height: 17px; }
.top-search kbd { font-family: var(--font); font-size: 11px; border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; }
.balance-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px 0 14px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); font-weight: 700; color: var(--text); white-space: nowrap; transition: border-color .2s;
}
.balance-pill:hover { border-color: var(--primary); }
.balance-pill .plus { width: 28px; height: 28px; border-radius: 8px; background: var(--grad); color: #fff; display: grid; place-items: center; }
.balance-pill .plus svg { width: 15px; height: 15px; }
.content { padding: 26px 28px 60px; max-width: 1360px; width: 100%; margin: 0 auto; }
.bottom-nav { display: none; }
.scrim { display: none; }

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .scrim.show { display: block; position: fixed; inset: 0; background: rgba(8, 10, 25, .5); z-index: 35; animation: fadeIn .2s; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .top-search { display: none; }
  .topbar { padding: 0 16px; height: 62px; }
  .content { padding: 18px 16px 110px; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--border);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; font-size: 10.5px; font-weight: 600; color: var(--muted); border-radius: 12px; }
  .bottom-nav a svg { width: 21px; height: 21px; }
  .bottom-nav a.active { color: var(--primary); }
  .bottom-nav a.fab { margin-top: -22px; }
  .bottom-nav a.fab span.fab-circle {
    width: 50px; height: 50px; border-radius: 16px; background: var(--grad); color: #fff; display: grid; place-items: center;
    box-shadow: 0 10px 24px -8px rgba(91, 79, 240, .8); border: 4px solid var(--bg);
  }
}
@media (max-width: 560px) {
  .topbar .crumb { display: none; }
  .balance-pill { padding-left: 10px; font-size: 13.5px; }
  .theme-btn { display: none; }
}

/* =========================================================
   Page header & cards
   ========================================================= */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 25px; font-weight: 700; letter-spacing: -.025em; margin: 0; line-height: 1.25; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h3, .card-title { margin: 0; font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.card-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.card-body { padding: 20px 22px; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.g-side { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
@media (max-width: 1200px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (max-width: 1024px) { .g-main, .g-side, .g-3 { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .g-2 { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .g-4 { gap: 12px; } }

/* stat tiles */
.stat { padding: 18px 20px; position: relative; overflow: hidden; }
.stat .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; }
.stat .ic svg { width: 20px; height: 20px; }
.stat .lbl { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat .val { font-size: 24px; font-weight: 700; letter-spacing: -.03em; margin-top: 2px; font-variant-numeric: tabular-nums; line-height: 1.25; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
@media (max-width: 420px) { .stat { padding: 14px; } .stat .val { font-size: 19px; } .stat .ic { width: 34px; height: 34px; margin-bottom: 10px; } }
.tone-primary { background: var(--primary-soft); color: var(--primary); }
.tone-success { background: var(--success-soft); color: var(--success); }
.tone-warning { background: var(--warning-soft); color: var(--warning); }
.tone-danger { background: var(--danger-soft); color: var(--danger); }
.tone-info { background: var(--info-soft); color: var(--info); }

/* hero */
.hero {
  border-radius: 24px; padding: 28px; color: #fff; background: var(--grad); position: relative; overflow: hidden; box-shadow: 0 20px 50px -20px rgba(91, 79, 240, .7);
}
.hero::before, .hero::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.hero::before { width: 320px; height: 320px; right: -80px; top: -150px; }
.hero::after { width: 200px; height: 200px; right: 140px; bottom: -130px; background: rgba(255, 255, 255, .07); }
.hero > * { position: relative; z-index: 1; }
.hero .hi { opacity: .85; font-size: 14px; }
.hero .big { font-size: 38px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.hero .actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.hero .btn-white { background: #fff; color: #3b2fd0; }
.hero .btn-glass { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .22); }
.hero .btn-glass:hover { background: rgba(255, 255, 255, .26); }
@media (max-width: 560px) { .hero { padding: 22px; } .hero .big { font-size: 31px; } }

/* =========================================================
   Controls
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px;
  border: 1px solid transparent; font-weight: 600; font-size: 14px; background: var(--primary); color: #fff; white-space: nowrap;
  transition: background .18s, transform .12s, box-shadow .18s, border-color .18s; text-decoration: none;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { background: var(--primary-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-grad { background: var(--grad); box-shadow: 0 10px 24px -10px rgba(91, 79, 240, .8); }
.btn-grad:hover { background: var(--grad); filter: brightness(1.06); box-shadow: 0 14px 30px -10px rgba(91, 79, 240, .9); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-soft { background: var(--primary-soft); color: var(--primary-ink); }
.btn-soft:hover { background: var(--primary-soft); filter: brightness(.97); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger); filter: brightness(1.06); }
.btn-success { background: var(--success); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; gap: 5px; }
.btn-xs svg { width: 14px; height: 14px; }
.btn-lg { height: 50px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }

.field { display: block; margin-bottom: 16px; }
.field > .lbl { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 13.5px; margin-bottom: 7px; color: var(--text); }
.field > .lbl .opt { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.input::placeholder { color: var(--muted); opacity: .8; }
.input:hover { border-color: var(--border-strong); }
.input:focus { border-color: var(--primary); box-shadow: var(--ring); background: var(--surface); }
textarea.input { height: auto; min-height: 130px; padding: 12px 14px; resize: vertical; line-height: 1.6; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a809b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 36px; }
.input-sm { height: 36px; border-radius: 10px; font-size: 13.5px; padding: 0 10px; }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.input-icon > .input { padding-left: 40px; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 12px 0 0 12px; }
.input-group .addon { display: grid; place-items: center; padding: 0 14px; border: 1px solid var(--border); border-left: 0; border-radius: 0 12px 12px 0; background: var(--surface-3); color: var(--muted); font-weight: 600; font-size: 13px; }
.help { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.stepper { display: flex; gap: 8px; }
.stepper .input { text-align: center; font-weight: 700; font-size: 15px; }
.stepper button { width: 44px; flex-shrink: 0; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: 18px; color: var(--text-2); transition: all .15s; }
.stepper button:hover { border-color: var(--primary); color: var(--primary); }
.quick-qty { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.quick-qty button { border: 1px dashed var(--border-strong); background: none; border-radius: 8px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.quick-qty button:hover { border-color: var(--primary); color: var(--primary); border-style: solid; }

.switch { position: relative; width: 40px; height: 23px; flex-shrink: 0; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--border-strong); transition: background .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .22s var(--ease); }
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::after { transform: translateX(17px); }
.switch input:focus-visible + span { box-shadow: var(--ring); }

.seg { display: inline-flex; padding: 4px; background: var(--surface-3); border-radius: 12px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button, .seg a { border: 0; background: none; padding: 6px 14px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--muted); white-space: nowrap; transition: all .18s; display: inline-flex; gap: 6px; align-items: center; }
.seg .active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg .cnt { font-size: 11px; background: var(--surface-3); border-radius: 99px; padding: 0 7px; color: var(--muted); }
.seg .active .cnt { background: var(--primary-soft); color: var(--primary-ink); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); font-weight: 600; font-size: 13.5px; color: var(--text-2); white-space: nowrap; transition: all .18s;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.scroll-x { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.scroll-x::-webkit-scrollbar { display: none; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-processing, .b-pending { background: var(--info-soft); color: var(--info); }
.b-processing i { animation: pulse 1.6s infinite; }
.b-done, .b-credited { background: var(--success-soft); color: var(--success); }
.b-refund, .b-unknown, .b-unmatched { background: var(--warning-soft); color: var(--warning); }
.b-failed, .b-locked { background: var(--danger-soft); color: var(--danger); }
.b-admin { background: var(--primary-soft); color: var(--primary-ink); }
.b-neutral { background: var(--surface-3); color: var(--text-2); }

/* platform icons */
.pf { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.pf svg { width: 21px; height: 21px; }
.pf-sm { width: 28px; height: 28px; border-radius: 9px; }
.pf-sm svg { width: 15px; height: 15px; }
.pf-lg { width: 48px; height: 48px; border-radius: 14px; }
.pf-lg svg { width: 24px; height: 24px; }
.pf-facebook { background: #1877f2; } .pf-tiktok { background: #111; } .pf-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.pf-youtube { background: #ff0033; } .pf-shopee { background: #ee4d2d; } .pf-threads { background: #1c1c1c; } .pf-twitter { background: #0f1419; }
.pf-telegram { background: #229ed9; } .pf-google { background: #1a73e8; } .pf-lazada { background: linear-gradient(135deg, #f36d21, #e2156b 60%, #1a0dab); } .pf-bigo { background: #00c3d0; }

/* =========================================================
   Tables & lists
   ========================================================= */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl th:first-child { padding-left: 22px; } .tbl td:first-child { padding-left: 22px; }
.tbl th:last-child { padding-right: 22px; } .tbl td:last-child { padding-right: 22px; }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .group-row td { background: var(--surface-2); font-weight: 700; font-size: 13px; padding-top: 10px; padding-bottom: 10px; }
.cell-main { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.link-cell { max-width: 260px; }
.link-cell a, .link-cell span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.link-cell a:hover { color: var(--primary); }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 7px; width: 110px; }
.progress > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #0d9488, #34d399); transition: width .6s var(--ease); }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 22px; border-bottom: 1px solid var(--border); transition: background .15s; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface-2); }
.list-item .main-t { font-weight: 600; font-size: 13.5px; }
.list-item .sub-t { font-size: 12px; color: var(--muted); }

.ocards { display: none; }
@media (max-width: 760px) {
  .hide-mobile { display: none !important; }
  .ocards { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
}
.ocard { border: 1px solid var(--border); border-radius: 16px; padding: 14px; background: var(--surface); }
.ocard .top { display: flex; gap: 12px; align-items: flex-start; }
.ocard .kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 5px 0; }
.ocard .kv span:first-child { color: var(--muted); flex-shrink: 0; }
.ocard .kv span:last-child { text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ocard .foot { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ill { width: 64px; height: 64px; border-radius: 20px; background: var(--grad-soft); display: grid; place-items: center; margin: 0 auto 14px; color: var(--primary); }
.empty .ill svg { width: 28px; height: 28px; }
.empty h4 { margin: 0 0 4px; color: var(--text); font-size: 15px; }

.skeleton { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 10px; }
.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); animation: shimmer 1.3s infinite; }
:root[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .05), transparent); }
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }

/* alerts */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; font-size: 13.5px; border: 1px solid transparent; }
.alert svg { width: 19px; height: 19px; margin-top: 1px; }
.alert b { font-weight: 600; }
.alert-info { background: var(--info-soft); color: var(--text); border-color: color-mix(in srgb, var(--info) 18%, transparent); }
.alert-info svg { color: var(--info); }
.alert-warn { background: var(--warning-soft); color: var(--text); border-color: color-mix(in srgb, var(--warning) 22%, transparent); }
.alert-warn svg { color: var(--warning); }
.alert-danger { background: var(--danger-soft); color: var(--text); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.alert-danger svg { color: var(--danger); }
.alert-primary { background: var(--grad-soft); color: var(--text); border-color: color-mix(in srgb, var(--primary) 18%, transparent); }
.alert-primary svg { color: var(--primary); }

/* =========================================================
   Services & order form
   ========================================================= */
.pf-tabs { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; margin: 0 -2px 18px; }
.pf-tabs::-webkit-scrollbar { display: none; }
.pf-tab {
  display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface);
  font-weight: 600; font-size: 14px; white-space: nowrap; color: var(--text-2); transition: all .2s var(--ease); box-shadow: var(--shadow-sm);
}
.pf-tab .pf { width: 32px; height: 32px; border-radius: 10px; }
.pf-tab .pf svg { width: 17px; height: 17px; }
.pf-tab:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.pf-tab.active { border-color: var(--primary); color: var(--text); box-shadow: var(--ring); }

.cat-list { display: flex; flex-direction: column; gap: 4px; padding: 10px; }
.cat-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; border: 0; background: none; text-align: left; width: 100%;
  color: var(--text-2); font-weight: 500; transition: all .15s;
}
.cat-item:hover { background: var(--surface-2); color: var(--text); }
.cat-item.active { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.cat-item .from { margin-left: auto; font-size: 11.5px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.cat-item.active .from { color: var(--primary-ink); opacity: .75; }
.cat-item .dot { width: 8px; height: 8px; border-radius: 3px; background: var(--border-strong); flex-shrink: 0; transition: background .15s; }
.cat-item.active .dot { background: var(--primary); }
@media (max-width: 1024px) {
  .cat-list { flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 10px; }
  .cat-item { width: auto; white-space: nowrap; border: 1px solid var(--border); }
  .cat-item .from, .cat-item .dot { display: none; }
}

.pkgs { display: flex; flex-direction: column; gap: 10px; }
.pkg {
  display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; transition: all .18s var(--ease); position: relative;
}
.pkg:hover { border-color: var(--border-strong); background: var(--surface-2); }
.pkg input { position: absolute; opacity: 0; pointer-events: none; }
.pkg .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); flex-shrink: 0; display: grid; place-items: center; transition: all .18s; }
.pkg.active { border-color: var(--primary); background: var(--primary-soft); }
.pkg.active .radio { border-color: var(--primary); background: var(--primary); box-shadow: inset 0 0 0 3px var(--surface); }
.pkg .name { font-weight: 600; font-size: 14px; color: var(--text); }
.pkg .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pkg .price { margin-left: auto; text-align: right; flex-shrink: 0; }
.pkg .price b { font-size: 16px; font-weight: 700; color: var(--primary-ink); font-variant-numeric: tabular-nums; }
.pkg .price small { display: block; font-size: 11px; color: var(--muted); }
.notes-box { border-radius: 14px; padding: 14px 16px; background: var(--warning-soft); border: 1px solid color-mix(in srgb, var(--warning) 20%, transparent); font-size: 13px; white-space: pre-line; color: var(--text-2); display: flex; gap: 10px; }
.notes-box svg { width: 18px; height: 18px; color: var(--warning); margin-top: 1px; }
.reactions { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 560px) { .reactions { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.reaction { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 1.5px solid var(--border); border-radius: 14px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text-2); transition: all .18s; background: var(--surface); text-transform: capitalize; }
.reaction:hover { transform: translateY(-2px); }
.reaction.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.reaction input { display: none; }
.reaction span { font-size: 24px; line-height: 1.1; transition: transform .2s var(--ease); }
.reaction.active span { transform: scale(1.12); }
.section-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 4px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-label .n { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); font-size: 11.5px; letter-spacing: 0; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }

.summary { position: sticky; top: 86px; }
.summary .line { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 13.5px; color: var(--muted); }
.summary .line b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.summary .total-box { margin: 14px 0 16px; padding: 16px; border-radius: 16px; background: var(--grad-soft); }
.summary .total-box .lbl { font-size: 12.5px; color: var(--muted); }
.summary .total { font-size: 30px; font-weight: 700; letter-spacing: -.03em; color: var(--primary-ink); font-variant-numeric: tabular-nums; line-height: 1.25; }
.summary .after { font-size: 12.5px; margin-top: 2px; }
.mobile-buy { display: none; }
@media (max-width: 1024px) {
  .summary { position: static; }
  .mobile-buy {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 25; align-items: center; gap: 12px;
    padding: 10px 10px 10px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  }
  .mobile-buy .t { font-size: 11.5px; color: var(--muted); }
  .mobile-buy .v { font-size: 18px; font-weight: 700; color: var(--primary-ink); line-height: 1.2; }
}

/* platform tiles on home */
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pf-tile {
  display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); transition: all .22s var(--ease); box-shadow: var(--shadow-sm);
}
.pf-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.pf-tile b { font-size: 14.5px; }
.pf-tile small { color: var(--muted); font-size: 12px; display: block; }
@media (max-width: 420px) { .pf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* =========================================================
   Deposit
   ========================================================= */
.amounts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.amounts button { height: 46px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 700; font-size: 14px; color: var(--text-2); transition: all .18s; font-variant-numeric: tabular-nums; }
.amounts button:hover { border-color: var(--border-strong); }
.amounts button.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.qr-frame { position: relative; width: 260px; max-width: 100%; margin: 0 auto; padding: 14px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); border: 1px solid var(--border); }
.qr-frame img { display: block; width: 100%; height: auto; border-radius: 10px; aspect-ratio: 1; }
.qr-frame .scan { position: absolute; left: 14px; right: 14px; height: 2px; background: linear-gradient(90deg, transparent, #5b4ff0, transparent); box-shadow: 0 0 12px #5b4ff0; animation: scan 3.2s ease-in-out infinite; }
.qr-frame .corner { position: absolute; width: 22px; height: 22px; border: 3px solid #5b4ff0; }
.qr-frame .c1 { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-radius: 12px 0 0 0; }
.qr-frame .c2 { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-radius: 0 12px 0 0; }
.qr-frame .c3 { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-radius: 0 0 0 12px; }
.qr-frame .c4 { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-radius: 0 0 12px 0; }
.waiting { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.live-dot { position: relative; width: 10px; height: 10px; }
.live-dot::before, .live-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--success); }
.live-dot::before { animation: ping 1.6s cubic-bezier(0, 0, .2, 1) infinite; }
.info-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--border); }
.info-row:last-child { border-bottom: 0; }
.info-row .k { color: var(--muted); font-size: 13px; }
.info-row .v { font-weight: 700; text-align: right; word-break: break-all; display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.copy-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: var(--primary-soft); color: var(--primary-ink); border-radius: 8px; padding: 4px 9px; font-size: 12px; font-weight: 600; flex-shrink: 0; transition: filter .15s; }
.copy-btn:hover { filter: brightness(.95); }
.copy-btn svg { width: 13px; height: 13px; }
.code-big { font-size: 22px; letter-spacing: .04em; color: var(--danger); }
.steps { counter-reset: s; display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.steps li { counter-increment: s; display: flex; gap: 12px; font-size: 13.5px; color: var(--text-2); }
.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 8px; background: var(--primary-soft); color: var(--primary-ink); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }

/* =========================================================
   Auth
   ========================================================= */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { background: var(--sidebar); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-hero::before { content: ''; position: absolute; width: 620px; height: 620px; border-radius: 50%; background: radial-gradient(circle, rgba(139, 92, 246, .45), transparent 65%); right: -220px; top: -200px; }
.auth-hero::after { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(13, 148, 136, .3), transparent 65%); left: -200px; bottom: -220px; }
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero h1 { font-size: 44px; line-height: 1.12; letter-spacing: -.035em; margin: auto 0 16px; font-weight: 700; max-width: 520px; }
.auth-hero h1 em { font-style: normal; background: linear-gradient(90deg, #a79dff, #f0abfc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero p { color: #b8bcd8; font-size: 16px; max-width: 460px; margin: 0 0 28px; }
.auth-feats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 540px; margin-bottom: 32px; }
.auth-feats div { padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); }
.auth-feats b { display: block; font-size: 21px; letter-spacing: -.02em; }
.auth-feats span { font-size: 12px; color: #9ea3c4; }
.auth-pfs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.auth-form { display: grid; place-items: center; padding: 32px 24px; }
.auth-card { width: 100%; max-width: 410px; animation: pop .5s var(--ease); }
.auth-card h2 { font-size: 26px; letter-spacing: -.025em; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); margin: 0 0 26px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 46px; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; }
.pw-wrap button:hover { color: var(--text); background: var(--surface-3); }
.pw-wrap button svg { width: 18px; height: 18px; }
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px 22px 30px; }
  .auth-hero h1 { font-size: 30px; margin-top: 28px; }
  .auth-hero p { font-size: 14.5px; margin-bottom: 18px; }
  .auth-feats { margin-bottom: 0; }
  .auth-pfs { display: none; }
  .auth-form { padding: 28px 16px 40px; align-items: start; }
}

/* =========================================================
   Overlays
   ========================================================= */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
@media (max-width: 560px) { .toasts { left: 12px; right: 12px; top: 12px; } }
.toast {
  pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; min-width: 280px; max-width: 400px; padding: 14px 16px; border-radius: 16px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 500;
  animation: pop .3s var(--ease); transition: opacity .3s, transform .3s;
}
.toast.out { opacity: 0; transform: translateX(20px); }
.toast .ti { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.toast .ti svg { width: 16px; height: 16px; }
.toast.ok .ti { background: var(--success-soft); color: var(--success); }
.toast.err .ti { background: var(--danger-soft); color: var(--danger); }
.toast.info .ti { background: var(--info-soft); color: var(--info); }
.toast .tm { padding-top: 3px; }

.overlay { position: fixed; inset: 0; background: rgba(8, 10, 25, .55); backdrop-filter: blur(3px); z-index: 150; display: grid; place-items: center; padding: 16px; animation: fadeIn .2s; }
.modal { width: 100%; max-width: 460px; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); animation: pop .3s var(--ease); border: 1px solid var(--border); max-height: calc(100vh - 32px); overflow-y: auto; }
.modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 0; }
.modal-head .mi { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.modal-head .mi svg { width: 22px; height: 22px; }
.modal-head h3 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.modal-head p { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; }
.modal-body { padding: 18px 22px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 22px 22px; }
.modal-foot .btn { min-width: 100px; }
.confirm-table { background: var(--surface-2); border-radius: 14px; padding: 6px 14px; border: 1px solid var(--border); }
.confirm-table .r { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; font-size: 13.5px; border-bottom: 1px dashed var(--border); }
.confirm-table .r:last-child { border-bottom: 0; }
.confirm-table .r span:first-child { color: var(--muted); flex-shrink: 0; }
.confirm-table .r span:last-child { font-weight: 600; text-align: right; word-break: break-all; }

.drawer-bg { position: fixed; inset: 0; background: rgba(8, 10, 25, .45); z-index: 140; animation: fadeIn .2s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); z-index: 141; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slideIn .32s var(--ease); }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { margin: 0; font-size: 16.5px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px 28px; }
.kv-grid { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px 14px; font-size: 13.5px; }
.kv-grid > span:nth-child(odd) { color: var(--muted); }
.kv-grid > span:nth-child(even) { font-weight: 500; word-break: break-all; }
pre.raw { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; font-size: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; max-height: 260px; margin: 0; }

.loader { display: grid; place-items: center; min-height: 50vh; color: var(--primary); }
.boot-logo { width: 54px; height: 54px; border-radius: 16px; background: var(--grad); display: grid; place-items: center; animation: pulse 1.4s infinite; }

/* =========================================================
   Charts
   ========================================================= */
.chart-wrap { position: relative; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; }
.chart-svg { display: block; width: 100%; height: 280px; overflow: visible; }
.chart-svg text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart-svg .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart-svg .hit { fill: transparent; cursor: crosshair; }
.chart-svg .band-hl { fill: var(--surface-3); opacity: 0; transition: opacity .12s; }
.chart-svg .band-hl.on { opacity: 1; }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 10px 12px; font-size: 12.5px; min-width: 170px; z-index: 5; opacity: 0; transition: opacity .12s; color: var(--text);
}
.chart-tip.on { opacity: 1; }
.chart-tip .h { font-weight: 700; margin-bottom: 6px; }
.chart-tip .r { display: flex; justify-content: space-between; gap: 14px; padding: 2px 0; color: var(--text-2); }
.chart-tip .r b { color: var(--text); font-variant-numeric: tabular-nums; }
.chart-tip .r i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.hbars { display: flex; flex-direction: column; gap: 14px; }
.hbar .top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 6px; }
.hbar .top span:first-child { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .top span:last-child { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar .track { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 99px; background: var(--chart-cost); transition: width .7s var(--ease); }
@media (max-width: 1024px) { .g-side > .card { position: static !important; } }
.svc-cats { position: sticky; top: 86px; }
@media (max-width: 1480px) {
  .svc { grid-template-columns: 1fr; }
  .svc-cats { position: static; }
  .svc-cats .card-head { display: none; }
  .svc-cats .cat-list { flex-direction: row; overflow-x: auto; scrollbar-width: none; flex-wrap: wrap; }
  .svc-cats .cat-item { width: auto; white-space: nowrap; border: 1px solid var(--border); }
  .svc-cats .cat-item .dot { display: none; }
}
