/* =====================================================================
   NexaMarket · Design system
   Tokens → base → layout → components → pages → utilities
   Light / dark via [data-theme] (system = prefers-color-scheme)
   ===================================================================== */

:root {
  --brand: #6d5efc;
  --brand-2: #14b8a6;
  --brand-rgb: 109, 94, 252;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --header-h: 68px;
  --sidebar-w: 268px;
  --container: 1240px;

  /* light */
  --bg: #f6f7fb;
  --bg-2: #eef0f7;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --surface-glass: rgba(255, 255, 255, .72);
  --border: #e6e8f0;
  --border-strong: #d6d9e6;
  --text: #0f1222;
  --text-2: #4a5068;
  --muted: #7b8199;
  --success: #16a34a;
  --success-bg: #e8f8ee;
  --warning: #d97706;
  --warning-bg: #fff4e2;
  --danger: #dc2626;
  --danger-bg: #fdecec;
  --info: #2563eb;
  --info-bg: #e9f0ff;
  --shadow-sm: 0 1px 2px rgba(16, 20, 45, .06), 0 1px 1px rgba(16, 20, 45, .04);
  --shadow: 0 4px 18px rgba(16, 20, 45, .07), 0 1px 3px rgba(16, 20, 45, .05);
  --shadow-lg: 0 18px 50px rgba(16, 20, 45, .14), 0 4px 12px rgba(16, 20, 45, .06);
  --ring: 0 0 0 4px rgba(var(--brand-rgb), .18);
  --hero-grad: radial-gradient(1200px 500px at 10% -10%, rgba(var(--brand-rgb), .20), transparent 60%),
               radial-gradient(900px 500px at 100% 0%, rgba(20, 184, 166, .16), transparent 55%);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0b0d17;
  --bg-2: #10131f;
  --surface: #131726;
  --surface-2: #171c2e;
  --surface-glass: rgba(19, 23, 38, .72);
  --border: #232a40;
  --border-strong: #2e3651;
  --text: #eef0fa;
  --text-2: #b4bad0;
  --muted: #858ca8;
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, .12);
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, .12);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, .12);
  --info: #60a5fa;
  --info-bg: rgba(96, 165, 250, .12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 6px 22px rgba(0, 0, 0, .35);
  --shadow-lg: 0 22px 60px rgba(0, 0, 0, .55);
  --hero-grad: radial-gradient(1200px 500px at 10% -10%, rgba(var(--brand-rgb), .28), transparent 60%),
               radial-gradient(900px 500px at 100% 0%, rgba(20, 184, 166, .16), transparent 55%);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    --bg: #0b0d17; --bg-2: #10131f; --surface: #131726; --surface-2: #171c2e; --surface-glass: rgba(19, 23, 38, .72);
    --border: #232a40; --border-strong: #2e3651; --text: #eef0fa; --text-2: #b4bad0; --muted: #858ca8;
    --success: #34d399; --success-bg: rgba(52, 211, 153, .12); --warning: #fbbf24; --warning-bg: rgba(251, 191, 36, .12);
    --danger: #f87171; --danger-bg: rgba(248, 113, 113, .12); --info: #60a5fa; --info-bg: rgba(96, 165, 250, .12);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35); --shadow: 0 6px 22px rgba(0, 0, 0, .35); --shadow-lg: 0 22px 60px rgba(0, 0, 0, .55);
    --hero-grad: radial-gradient(1200px 500px at 10% -10%, rgba(var(--brand-rgb), .28), transparent 60%), radial-gradient(900px 500px at 100% 0%, rgba(20, 184, 166, .16), transparent 55%);
    color-scheme: dark;
  }
}

/* ------------------------------ Base -------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text);
  background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
h1, h2, h3, h4, h5 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); font-weight: 750; }
h3 { font-size: 1.12rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
::selection { background: rgba(var(--brand-rgb), .25); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-xs); }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 0; }
.section-sm { padding: 32px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head p { color: var(--muted); margin: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }

/* ---------------------------- Buttons -------------------------------- */
.btn {
  --b: var(--surface); --c: var(--text); --bd: var(--border);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--bd); background: var(--b); color: var(--c); font: 600 .92rem/1 var(--font);
  cursor: pointer; white-space: nowrap; transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s, border-color .2s, opacity .2s;
  user-select: none; text-decoration: none;
}
.btn:hover { color: var(--c); border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn-primary { --b: var(--brand); --c: #fff; --bd: transparent; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #9b5cff)); box-shadow: 0 6px 18px rgba(var(--brand-rgb), .32); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(var(--brand-rgb), .4); }
.btn-accent { --b: var(--brand-2); --c: #fff; --bd: transparent; }
.btn-success { --b: var(--success); --c: #fff; --bd: transparent; }
.btn-danger { --b: var(--danger); --c: #fff; --bd: transparent; }
.btn-soft { --b: rgba(var(--brand-rgb), .1); --c: var(--brand); --bd: transparent; }
.btn-ghost { --b: transparent; --bd: transparent; }
.btn-ghost:hover { background: var(--bg-2); box-shadow: none; }
.btn-outline-danger { --c: var(--danger); --bd: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-sm { height: 34px; padding: 0 12px; font-size: .84rem; border-radius: 10px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: .78rem; border-radius: 8px; gap: 5px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 1rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 42px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.btn .spinner { display: none; }
.btn.is-loading .spinner { display: inline-block; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------- Forms --------------------------------- */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(12, 1fr); }
.form-grid > * { grid-column: span 12; }
.col-6 { grid-column: span 6 !important; }
.col-4 { grid-column: span 4 !important; }
.col-8 { grid-column: span 8 !important; }
.col-3 { grid-column: span 3 !important; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: .84rem; font-weight: 600; color: var(--text-2); }
.hint { font-size: .78rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: 500 .94rem/1.3 var(--font); transition: border-color .2s, box-shadow .2s, background .2s;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.textarea.mono { font-family: ui-monospace, Menlo, monospace; font-size: .86rem; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.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='%237b8199' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.input-sm, .select.input-sm { min-height: 36px; padding: 6px 12px; font-size: .86rem; border-radius: 10px; }
.select.input-sm { padding-right: 32px; }
.is-invalid { border-color: var(--danger) !important; }
.error-text { color: var(--danger); font-size: .8rem; font-weight: 500; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .icon { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.input-group .input { padding-left: 42px; }
.input-addon { display: flex; }
.input-addon .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-addon .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; height: auto; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .9rem; color: var(--text-2); }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; font-size: .9rem; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 42px; height: 24px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .25s var(--ease); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.file-drop { border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 20px; text-align: center; color: var(--muted); background: var(--surface-2); cursor: pointer; transition: border-color .2s, background .2s; display: block; }
.file-drop:hover, .file-drop.is-over { border-color: var(--brand); background: rgba(var(--brand-rgb), .05); color: var(--brand); }
.file-drop input { display: none; }
.file-drop .icon { width: 28px; height: 28px; margin: 0 auto 8px; }
.img-preview { width: 100%; max-width: 220px; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); margin-top: 8px; }
.radio-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.radio-card { position: relative; cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card .rc-body { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: border-color .2s, box-shadow .2s, transform .2s; height: 100%; }
.radio-card .rc-body .icon { width: 22px; height: 22px; color: var(--brand); }
.radio-card .rc-body small { color: var(--muted); font-size: .76rem; line-height: 1.35; }
.radio-card input:checked + .rc-body { border-color: var(--brand); box-shadow: var(--ring); }
.radio-card:hover .rc-body { transform: translateY(-2px); }

/* ----------------------------- Cards --------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-body { 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-head h4 { margin: 0; }
.card-head .sub { color: var(--muted); font-size: .84rem; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card-glass { background: var(--surface-glass); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); }
.card-hover { transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }

/* Stat tiles */
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.stat { position: relative; overflow: hidden; padding: 18px 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.stat .stat-label { padding-right: 46px; display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .stat-value { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; margin-top: 8px; letter-spacing: -.02em; }
.stat .stat-meta { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.stat .stat-icon { position: absolute; right: 16px; top: 16px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(var(--brand-rgb), .1); color: var(--brand); }
.stat .stat-icon .icon { width: 20px; height: 20px; }
.stat.tone-success .stat-icon { background: var(--success-bg); color: var(--success); }
.stat.tone-warning .stat-icon { background: var(--warning-bg); color: var(--warning); }
.stat.tone-danger .stat-icon { background: var(--danger-bg); color: var(--danger); }
.stat.tone-info .stat-icon { background: var(--info-bg); color: var(--info); }
.stat.highlight { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 60%, #22d3ee)); color: #fff; border: 0; }
.stat.highlight .stat-label, .stat.highlight .stat-meta { color: rgba(255, 255, 255, .82); }
.stat.highlight .stat-icon { background: rgba(255, 255, 255, .18); color: #fff; }

.money-split { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.money-box { padding: 20px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.money-box h4 { display: flex; align-items: center; gap: 8px; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 14px; }
.money-box.own { border-color: color-mix(in srgb, var(--success) 40%, var(--border)); background: linear-gradient(180deg, var(--success-bg), var(--surface) 60%); }
.money-box.owed { border-color: color-mix(in srgb, var(--warning) 40%, var(--border)); background: linear-gradient(180deg, var(--warning-bg), var(--surface) 60%); }
.money-box.real { border-color: color-mix(in srgb, var(--info) 40%, var(--border)); background: linear-gradient(180deg, var(--info-bg), var(--surface) 60%); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: .92rem; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--text-2); }
.kv strong { font-weight: 700; text-align: right; }
.kv.total { border-top: 2px solid var(--border-strong); border-bottom: 0; padding-top: 12px; margin-top: 4px; font-size: 1.05rem; }
.kv.total strong { font-size: 1.2rem; }

/* ----------------------------- Badges -------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: .74rem; font-weight: 650; white-space: nowrap; background: var(--bg-2); color: var(--text-2); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.no-dot::before { display: none; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-brand { background: rgba(var(--brand-rgb), .12); color: var(--brand); }
.badge-muted { background: var(--bg-2); color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-size: .82rem; font-weight: 600; color: var(--text-2); transition: all .2s; white-space: nowrap; }
.chip:hover, .chip.active { border-color: var(--brand); color: var(--brand); background: rgba(var(--brand-rgb), .06); }
.chip .count { font-size: .72rem; color: var(--muted); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }

/* ----------------------------- Alerts -------------------------------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); font-size: .9rem; }
.alert .icon { margin-top: 2px; }
.alert-success { background: var(--success-bg); border-color: transparent; color: var(--success); }
.alert-warning { background: var(--warning-bg); border-color: transparent; color: var(--warning); }
.alert-danger, .alert-error { background: var(--danger-bg); border-color: transparent; color: var(--danger); }
.alert-info { background: var(--info-bg); border-color: transparent; color: var(--info); }
.alert p { margin: 0; color: var(--text-2); }
.alert strong { color: inherit; }

/* ----------------------------- Tables -------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .89rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 800; background: var(--surface-2); border-top: 2px solid var(--border-strong); padding: 13px 16px; }
.table .num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions > * { margin-left: 4px; }
.table .cell-main { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.table .cell-main img, .thumb { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; background: var(--bg-2); flex: none; }
.thumb-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: rgba(var(--brand-rgb), .1); color: var(--brand); flex: none; }
.cell-title { font-weight: 650; color: var(--text); }
.cell-sub { font-size: .78rem; color: var(--muted); }
.pos { color: var(--success); font-weight: 650; }
.neg { color: var(--danger); font-weight: 650; }

@media (max-width: 760px) {
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td, .table.responsive tfoot { display: block; width: 100%; }
  .table.responsive tr { border-bottom: 1px solid var(--border); padding: 10px 4px; }
  .table.responsive td { border: 0; padding: 6px 12px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table.responsive td::before { content: attr(data-label); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: left; }
  .table.responsive td.cell-full { display: block; text-align: left; }
  .table.responsive td.cell-full::before { display: none; }
  .table.responsive .actions { justify-content: flex-end; }
  .table.responsive tfoot td { display: flex; justify-content: space-between; }
}

/* ---------------------------- Header --------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface-glass); backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; gap: 18px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.18rem; letter-spacing: -.03em; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 6px 16px rgba(var(--brand-rgb), .35); }
.brand-mark .icon { width: 20px; height: 20px; }
.brand img { height: 34px; width: auto; }
.header-search { position: relative; flex: 1; max-width: 560px; }
.header-search .input { height: 44px; border-radius: 99px; padding-left: 44px; background: var(--surface); }
.header-search > .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.header-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-link { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border-radius: 11px; font-weight: 600; font-size: .9rem; color: var(--text-2); position: relative; }
.nav-link:hover, .nav-link.active { background: var(--bg-2); color: var(--text); }
.nav-link .pill { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface); }
.wallet-pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 99px; background: rgba(var(--brand-rgb), .1); color: var(--brand); font-weight: 750; font-size: .88rem; }
.wallet-pill:hover { background: rgba(var(--brand-rgb), .16); }
.subnav { border-top: 1px solid var(--border); }
.subnav .chips { padding: 10px 0; }

/* Live search */
.search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; display: none; z-index: 60; }
.search-results.open { display: block; animation: pop .18s var(--ease); }
.search-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.search-item:hover, .search-item.active { background: var(--surface-2); color: var(--text); }
.search-item img, .search-item .thumb-icon { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.search-item .meta { font-size: .76rem; color: var(--muted); }
.search-item .price { margin-left: auto; font-weight: 750; white-space: nowrap; }
.search-footer { display: block; padding: 11px 14px; text-align: center; font-size: .85rem; font-weight: 650; color: var(--brand); border-top: 1px solid var(--border); background: var(--surface-2); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 70; }
.dropdown.open .dropdown-menu { display: block; animation: pop .16s var(--ease); }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 9px; font: 550 .88rem var(--font); color: var(--text-2); background: none; border: 0; cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--bg-2); color: var(--text); }
.dropdown-menu .divider { height: 1px; background: var(--border); margin: 6px 0; }
.dropdown-head { padding: 10px 12px 8px; }
.dropdown-head strong { display: block; font-size: .92rem; }
.dropdown-head span { font-size: .78rem; color: var(--muted); }
.notif-menu { width: 340px; max-width: calc(100vw - 32px); }
.notif-item { display: block !important; padding: 10px 12px !important; }
.notif-item strong { display: block; color: var(--text); font-size: .86rem; }
.notif-item span { font-size: .8rem; color: var(--muted); }
.notif-item.unread { background: rgba(var(--brand-rgb), .06); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .9rem; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); object-fit: cover; flex: none; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.4rem; }

/* ----------------------------- Hero ---------------------------------- */
.hero { position: relative; overflow: hidden; padding: 64px 0 48px; background: var(--hero-grad); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1.04; letter-spacing: -.035em; margin-bottom: 18px; }
.hero h1 .grad { background: linear-gradient(120deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.12rem; color: var(--text-2); max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-trust { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 30px; color: var(--text-2); font-size: .88rem; font-weight: 550; }
.hero-trust span { display: inline-flex; align-items: center; gap: 8px; }
.hero-trust .icon { color: var(--success); }
.hero-visual { position: relative; min-height: 380px; }
.float-card { position: absolute; padding: 16px; border-radius: var(--radius-lg); background: var(--surface-glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: float 6s ease-in-out infinite; }
.float-card.fc-1 { top: 0; left: 6%; width: 270px; }
.float-card.fc-2 { top: 150px; right: 0; width: 250px; animation-delay: -2s; }
.float-card.fc-3 { bottom: 0; left: 18%; width: 260px; animation-delay: -4s; }
.float-card .fc-row { display: flex; align-items: center; gap: 12px; }
.float-card .fc-code { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); font-family: ui-monospace, monospace; font-size: .85rem; letter-spacing: .06em; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.hero-banner { border-radius: var(--radius-xl); padding: 40px; color: #fff; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 40%, #0ea5e9)); position: relative; overflow: hidden; }
.hero-banner::after { content: ''; position: absolute; width: 360px; height: 360px; right: -80px; top: -120px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.hero-banner h2, .hero-banner p { position: relative; z-index: 1; }
.hero-banner p { opacity: .9; max-width: 560px; }
.hero-banner .btn { position: relative; z-index: 1; }

/* --------------------------- Categories ------------------------------ */
.cat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
.cat-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(var(--brand-rgb), .4); color: var(--text); }
.cat-card .cat-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(var(--brand-rgb), .16), rgba(20, 184, 166, .14)); color: var(--brand); }
.cat-card .cat-icon .icon { width: 22px; height: 22px; }
.cat-card strong { font-size: .95rem; }
.cat-card span { font-size: .78rem; color: var(--muted); }

/* ----------------------------- Products ------------------------------ */
.product-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.product-grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.product-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.product-media { position: relative; aspect-ratio: 16/10; background: linear-gradient(135deg, rgba(var(--brand-rgb), .14), rgba(20, 184, 166, .12)); overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.product-card:hover .product-media img { transform: scale(1.05); }
.product-media .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--brand); }
.product-media .placeholder .icon { width: 44px; height: 44px; opacity: .8; }
.product-media .tags { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.product-media .tags .badge { backdrop-filter: blur(8px); background: rgba(255, 255, 255, .88); color: #1d2140; }
.product-media .tags .badge.off { background: var(--danger); color: #fff; }
.product-card > .fav, .product-media .fav { z-index: 2; position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .9); color: #1d2140; cursor: pointer; transition: transform .2s, color .2s; }
.product-card > .fav:hover, .product-media .fav:hover { transform: scale(1.1); color: var(--danger); }
.product-card > .fav.on, .product-media .fav.on { color: var(--danger); }
.product-card > .fav.on .icon, .product-media .fav.on .icon { fill: currentColor; }
.product-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.product-cat { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .74rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.product-title { font-size: .98rem; font-weight: 700; line-height: 1.32; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.64em; }
.product-seller { font-size: .8rem; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.product-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.price { font-family: var(--font-display); font-weight: 800; font-size: 1.18rem; letter-spacing: -.02em; }
.price-old { font-size: .82rem; color: var(--muted); text-decoration: line-through; font-weight: 500; }
.stars { color: #f5b301; letter-spacing: 1px; font-size: .86rem; white-space: nowrap; }
.stars .star { color: var(--border-strong); }
.stars .star.on, .stars .star.half { color: #f5b301; }
.rating-line { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); }
.stock-low { color: var(--warning); font-weight: 650; font-size: .76rem; }
.stock-out { color: var(--danger); font-weight: 650; font-size: .76rem; }

/* Product detail */
.pd-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 32px; align-items: start; }
.pd-media { border-radius: var(--radius-xl); overflow: hidden; aspect-ratio: 16/10; background: linear-gradient(135deg, rgba(var(--brand-rgb), .16), rgba(20, 184, 166, .12)); position: relative; border: 1px solid var(--border); }
.pd-media img { width: 100%; height: 100%; object-fit: cover; }
.pd-buy { position: sticky; top: calc(var(--header-h) + 18px); }
.pd-price { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 14px 0 6px; }
.pd-price .price { font-size: 2.1rem; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.qty button { width: 38px; height: 42px; border: 0; background: transparent; color: var(--text); cursor: pointer; display: grid; place-items: center; }
.qty button:hover { background: var(--bg-2); }
.qty input { width: 48px; height: 42px; border: 0; text-align: center; font: 700 .95rem var(--font); background: transparent; color: var(--text); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--text-2); }
.feature-list .icon { color: var(--success); margin-top: 3px; }
.prose { color: var(--text-2); white-space: pre-line; }
.prose h2, .prose h3 { color: var(--text); }
.rating-bars { display: grid; gap: 6px; }
.rating-bar { display: grid; grid-template-columns: 34px 1fr 30px; align-items: center; gap: 10px; font-size: .8rem; color: var(--muted); }
.rating-bar .bar { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.rating-bar .bar span { display: block; height: 100%; background: #f5b301; border-radius: 99px; }
.review { padding: 16px 0; border-bottom: 1px solid var(--border); }
.review:last-child { border-bottom: 0; }
.review-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.star-input input { display: none; }
.star-input label { font-size: 1.8rem; color: var(--border-strong); cursor: pointer; transition: color .15s, transform .15s; line-height: 1; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: #f5b301; }
.star-input label:hover { transform: scale(1.1); }

/* Store */
.store-hero { border-radius: var(--radius-xl); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.store-banner { height: 200px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); background-size: cover; background-position: center; }
.store-info { display: flex; gap: 20px; align-items: flex-end; padding: 0 28px 24px; margin-top: -48px; flex-wrap: wrap; }
.store-logo { width: 104px; height: 104px; border-radius: 24px; border: 4px solid var(--surface); background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: grid; place-items: center; color: #fff; font-size: 2.2rem; font-weight: 800; object-fit: cover; box-shadow: var(--shadow); }
.store-stats { display: flex; gap: 24px; flex-wrap: wrap; margin-left: auto; }
.store-stats div { text-align: center; }
.store-stats strong { display: block; font-size: 1.25rem; font-family: var(--font-display); }
.store-stats span { font-size: .76rem; color: var(--muted); }
.provider-card { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 22px; }
.provider-card .store-logo { width: 72px; height: 72px; border-radius: 20px; font-size: 1.5rem; border: 0; }

/* Plans */
.plans { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 16px; padding: 26px; border-radius: var(--radius-xl); border: 1px solid var(--border); background: var(--surface); position: relative; }
.plan.featured { border: 2px solid var(--brand); box-shadow: 0 18px 50px rgba(var(--brand-rgb), .18); }
.plan.featured::before { content: 'Recomendado'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); padding: 3px 12px; border-radius: 99px; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .04em; }
.plan .plan-price { font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em; }
.plan .plan-price small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; flex: 1; }
.plan li { display: flex; gap: 10px; font-size: .9rem; color: var(--text-2); }
.plan li .icon { color: var(--success); margin-top: 3px; }
.plan.current { border-color: var(--success); }

/* Steps / how it works */
.steps { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: step; }
.step { padding: 22px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); position: relative; }
.step::before { counter-increment: step; content: counter(step); position: absolute; top: 18px; right: 20px; font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; color: rgba(var(--brand-rgb), .14); }
.step .step-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(var(--brand-rgb), .1); color: var(--brand); margin-bottom: 14px; }
.step p { color: var(--text-2); font-size: .9rem; margin: 0; }

/* ----------------------------- Layout: panel ------------------------- */
.panel { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 80; transition: transform .3s var(--ease); }
.sidebar-head { height: var(--header-h); display: flex; align-items: center; padding: 0 20px; border-bottom: 1px solid var(--border); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px 24px; scrollbar-width: thin; }
.nav-section { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 16px 12px 8px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; font-size: .9rem; font-weight: 600; color: var(--text-2); transition: background .15s, color .15s; position: relative; }
.side-link .icon { width: 19px; height: 19px; opacity: .85; }
.side-link:hover { background: var(--bg-2); color: var(--text); }
.side-link.active { background: rgba(var(--brand-rgb), .1); color: var(--brand); }
.side-link.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.side-link .count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 800; display: grid; place-items: center; }
.side-group > summary { list-style: none; cursor: pointer; }
.side-group > summary::-webkit-details-marker { display: none; }
.side-group > summary .chev { margin-left: auto; transition: transform .2s; }
.side-group[open] > summary .chev { transform: rotate(180deg); }
.side-sub { padding: 4px 0 6px 30px; display: grid; gap: 2px; }
.side-sub .side-link { padding: 7px 12px; font-size: .86rem; }
.side-sub .side-link.active::before { display: none; }
.sidebar-foot { padding: 14px; border-top: 1px solid var(--border); }
.panel-main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; height: var(--header-h); display: flex; align-items: center; gap: 14px; padding: 0 28px; background: var(--surface-glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--border); }
.topbar .crumbs { font-size: .86rem; color: var(--muted); display: flex; align-items: center; gap: 6px; min-width: 0; }
.topbar .crumbs strong { color: var(--text); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { padding: 28px; flex: 1; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.65rem; margin-bottom: 4px; }
.page-head p { color: var(--muted); margin: 0; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sidebar-backdrop { display: none; }
.grid { display: grid; gap: 20px; }
.grid > *, .checkout-grid > *, .pd-grid > *, .catalog > *, .player > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--border); }
.toolbar .input, .toolbar .select { width: auto; min-width: 160px; }
.toolbar .grow { flex: 1; min-width: 200px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 12px 16px; font-weight: 650; font-size: .9rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-color: var(--brand); }

/* ----------------------------- Footer -------------------------------- */
.site-footer { margin-top: 64px; padding: 48px 0 28px; background: var(--surface); border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer-grid h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; }
.footer-grid a { display: block; padding: 4px 0; color: var(--text-2); font-size: .9rem; }
.footer-grid a:hover { color: var(--brand); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .84rem; }
.socials { display: flex; gap: 8px; margin-top: 14px; }
.socials a { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--border); display: grid !important; place-items: center; padding: 0 !important; }

/* Mobile bottom nav */
.bottom-nav { display: none; }
.show-sm { display: none !important; }

/* ----------------------------- Modal --------------------------------- */
.modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 10, 20, .55); backdrop-filter: blur(4px); animation: fade .2s; }
.modal-dialog { position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: modalIn .28s var(--ease); }
.modal-dialog.lg { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 18px 24px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 24px 22px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }

/* ----------------------------- Toasts -------------------------------- */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 300; display: flex; flex-direction: column; gap: 10px; width: 360px; max-width: calc(100vw - 36px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: toastIn .35s var(--ease); font-size: .9rem; position: relative; overflow: hidden; }
.toast .t-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.toast.success .t-icon { background: var(--success-bg); color: var(--success); }
.toast.error .t-icon { background: var(--danger-bg); color: var(--danger); }
.toast.warning .t-icon { background: var(--warning-bg); color: var(--warning); }
.toast.info .t-icon { background: var(--info-bg); color: var(--info); }
.toast .t-close { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px; }
.toast::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; background: currentColor; opacity: .25; animation: toastBar 5s linear forwards; }
.toast.success::after { color: var(--success); } .toast.error::after { color: var(--danger); } .toast.warning::after { color: var(--warning); } .toast.info::after { color: var(--info); }
.toast.leaving { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
@keyframes toastBar { from { width: 100%; } to { width: 0; } }

/* --------------------------- Empty / skeleton ------------------------ */
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .empty-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 20px; display: grid; place-items: center; background: rgba(var(--brand-rgb), .08); color: var(--brand); }
.empty .empty-icon .icon { width: 28px; height: 28px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty p { max-width: 420px; margin: 0 auto 18px; }
.skeleton { position: relative; overflow: hidden; background: var(--bg-2); border-radius: var(--radius-sm); }
.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; }
[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton-card { height: 320px; border-radius: var(--radius-lg); }
.is-loading-grid { opacity: .5; pointer-events: none; transition: opacity .2s; }

/* ----------------------------- Charts -------------------------------- */
.chart { position: relative; width: 100%; height: 280px; }
.chart.sm { height: 220px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .axis-label { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .tooltip { position: absolute; pointer-events: none; padding: 8px 12px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: .78rem; font-weight: 600; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .15s; z-index: 5; }
.chart .tooltip.show { opacity: 1; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--text-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut-wrap .chart { width: 180px; height: 180px; flex: none; }
.bar-list { display: grid; gap: 12px; }
.bar-list .bl-row { display: grid; gap: 6px; }
.bar-list .bl-top { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; }
.bar-list .bl-top span:first-child { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-list .bl-bar { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.bar-list .bl-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.progress { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .6s var(--ease); }

/* -------------------------- Delivered items -------------------------- */
.secret { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border-strong); font-family: ui-monospace, Menlo, monospace; font-size: .9rem; word-break: break-all; }
.secret .secret-value { flex: 1; letter-spacing: .02em; }
.secret .secret-value.masked { filter: blur(6px); user-select: none; }
.secret-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 10px 0 4px; font-family: var(--font); }
.delivery-box { padding: 16px; border-radius: var(--radius); background: linear-gradient(180deg, var(--success-bg), transparent 80%); border: 1px solid color-mix(in srgb, var(--success) 30%, var(--border)); }
.order-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.order-item:last-child { border-bottom: 0; }
.order-item .thumb, .order-item .thumb-icon { width: 64px; height: 64px; border-radius: 14px; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 26px; font-size: .86rem; }
.timeline li::before { content: ''; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .15); }
.timeline li::after { content: ''; position: absolute; left: 10px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline small { color: var(--muted); display: block; }
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 360px; overflow-y: auto; padding: 4px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; background: var(--bg-2); font-size: .88rem; }
.msg.mine { align-self: flex-end; background: rgba(var(--brand-rgb), .12); }
.msg small { display: block; font-size: .72rem; color: var(--muted); margin-top: 4px; }

/* Course player */
.player { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.video-frame { position: relative; aspect-ratio: 16/9; border-radius: var(--radius-lg); overflow: hidden; background: #000; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lesson-list { max-height: calc(100vh - 160px); overflow-y: auto; }
.lesson-link { display: flex; gap: 10px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: .88rem; }
.lesson-link.active { background: rgba(var(--brand-rgb), .08); color: var(--brand); font-weight: 650; }
.lesson-link .done { color: var(--success); }
.lesson-section { padding: 12px 16px 6px; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); }

/* Auth */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; background: linear-gradient(145deg, var(--brand), color-mix(in srgb, var(--brand) 45%, #0f172a)); }
.auth-side::before { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; right: -180px; bottom: -180px; background: radial-gradient(circle, rgba(20, 184, 166, .55), transparent 70%); }
.auth-side > * { position: relative; }
.auth-side .brand { color: #fff; }
.auth-side h2 { font-size: 2.1rem; max-width: 440px; }
.auth-side p { opacity: .85; max-width: 420px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.8rem; }
.auth-card .sub { color: var(--muted); margin-bottom: 26px; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .8rem; margin: 18px 0; }
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.password-meter { height: 4px; border-radius: 99px; background: var(--bg-2); overflow: hidden; margin-top: 6px; }
.password-meter span { display: block; height: 100%; width: 0; transition: width .3s, background .3s; }

/* Pagination */
.pagination { display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; padding: 18px; }
.pagination a, .pagination span { min-width: 38px; height: 38px; padding: 0 12px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-weight: 650; font-size: .86rem; color: var(--text-2); }
.pagination a:hover { border-color: var(--brand); color: var(--brand); }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination .disabled { opacity: .45; }

/* Filters sidebar (catalog) */
.catalog { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 26px; align-items: start; }
.filters { position: sticky; top: calc(var(--header-h) + 16px); }
.filter-group { padding: 16px 0; border-bottom: 1px solid var(--border); }
.filter-group:last-child { border-bottom: 0; }
.filter-group h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.filter-option { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; border-radius: 9px; font-size: .88rem; color: var(--text-2); }
.filter-option:hover, .filter-option.active { background: rgba(var(--brand-rgb), .07); color: var(--brand); }
.filter-option small { color: var(--muted); }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.filters-toggle { display: none; }

/* Checkout */
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.summary { position: sticky; top: calc(var(--header-h) + 16px); }
.line-item { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.line-item:last-child { border-bottom: 0; }
.line-item .li-main { flex: 1; min-width: 0; }
.line-item .li-title { font-weight: 650; }
.wallet-card { padding: 20px; border-radius: var(--radius-lg); color: #fff; background: linear-gradient(135deg, #1e1b4b, var(--brand) 70%, var(--brand-2)); position: relative; overflow: hidden; }
.wallet-card::after { content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%; right: -60px; top: -80px; background: rgba(255, 255, 255, .1); }
.wallet-card .wc-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; opacity: .8; }
.wallet-card .wc-amount { font-family: var(--font-display); font-size: 2.3rem; font-weight: 800; letter-spacing: -.03em; margin: 6px 0 2px; position: relative; z-index: 1; }
.wallet-card > * { position: relative; z-index: 1; }

/* Invoice / print */
.invoice { max-width: 860px; margin: 0 auto; }
.print-only { display: none; }
@media print {
  .site-header, .site-footer, .bottom-nav, .sidebar, .topbar, .no-print, .toasts { display: none !important; }
  .panel-main { margin: 0 !important; }
  .content { padding: 0 !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #ddd; }
  .print-only { display: block; }
}

/* ----------------------------- Utilities ----------------------------- */
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .justify-end { justify-content: flex-end; }
.wrap { flex-wrap: wrap; } .gap-1 { gap: 6px; } .gap-2 { gap: 10px; } .gap-3 { gap: 16px; } .gap-4 { gap: 24px; } .flex-1 { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 16px; } .stack-sm > * + * { margin-top: 8px; } .stack-lg > * + * { margin-top: 24px; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 28px; } .mb-0 { margin-bottom: 0 !important; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; } .mb-4 { margin-bottom: 28px; }
.p-0 { padding: 0 !important; }
.text-muted { color: var(--muted); } .text-2 { color: var(--text-2); } .text-sm { font-size: .86rem; } .text-xs { font-size: .76rem; } .text-lg { font-size: 1.1rem; }
.text-right { text-align: right; } .text-center { text-align: center; } .fw-bold { font-weight: 700; } .fw-800 { font-weight: 800; }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); } .text-brand { color: var(--brand); }
.w-full { width: 100%; } .hidden { display: none !important; } .nowrap { white-space: nowrap; } .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divide > * + * { border-top: 1px solid var(--border); }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } .reveal { opacity: 1; transform: none; } }

/* ----------------------------- Responsive ---------------------------- */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog { grid-template-columns: 1fr; }
  .filters { position: fixed; inset: 0 0 0 auto; width: min(340px, 90vw); z-index: 120; background: var(--surface); padding: 20px; overflow-y: auto; transform: translateX(100%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg); top: 0; }
  .filters.open { transform: none; }
  .filters-toggle { display: inline-flex; }
  .player { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; z-index: 79; background: rgba(8, 10, 20, .45); }
  .panel-main { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px 96px; }
  .hero-grid, .pd-grid, .checkout-grid, .grid-main, .grid-2 { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .pd-buy, .summary { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .section { padding: 36px 0; }
  .container { padding: 0 16px; }
  .header-row { gap: 10px; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; }
  .brand { font-size: 1.02rem; gap: 8px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  .header-nav { gap: 2px; }
  .header-nav .nav-link { padding: 0 9px; }
  .show-sm { display: inline-flex !important; }
  .site-header .header-row { flex-wrap: wrap; height: auto; padding: 10px 0; }
  .header-nav .hide-sm, .hide-sm { display: none !important; }
  .grid-3 { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .product-body { padding: 10px 12px 12px; }
  .product-title { font-size: .88rem; }
  .price { font-size: 1.02rem; }
  .product-card .product-foot .btn { width: 34px; padding: 0; }
  .product-card .product-foot .btn span { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat .stat-value { font-size: 1.2rem; }
  .stat .stat-icon { width: 32px; height: 32px; right: 10px; top: 10px; }
  .form-grid .col-6, .form-grid .col-4, .form-grid .col-8, .form-grid .col-3 { grid-column: span 12 !important; }
  .card-body { padding: 16px; }
  .card-head { padding: 14px 16px; }
  .toolbar { padding: 12px 16px; }
  .toolbar .input, .toolbar .select { flex: 1 1 140px; min-width: 0; }
  .page-head h1 { font-size: 1.35rem; }
  .order-item { grid-template-columns: 48px 1fr; padding: 14px 16px; }
  .order-item .thumb, .order-item .thumb-icon { width: 48px; height: 48px; }
  .order-item > :last-child { grid-column: 1 / -1; }
  .store-info { padding: 0 16px 18px; }
  .store-stats { margin-left: 0; width: 100%; justify-content: space-between; }
  .footer-grid { grid-template-columns: 1fr; }
  .site-footer { padding-bottom: 96px; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-dialog { border-radius: var(--radius-xl) var(--radius-xl) 0 0; max-height: 92vh; }
  .toasts { top: auto; bottom: 86px; right: 12px; left: 12px; width: auto; max-width: none; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; height: 66px; padding-bottom: env(safe-area-inset-bottom); background: var(--surface-glass); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); border-top: 1px solid var(--border); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .68rem; font-weight: 650; color: var(--muted); position: relative; }
  .bottom-nav a .icon { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--brand); }
  .bottom-nav a.active::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
  .bottom-nav .pill { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 16px; height: 16px; border-radius: 99px; background: var(--danger); color: #fff; font-size: .62rem; display: grid; place-items: center; padding: 0 4px; }
  main.with-bottom-nav { padding-bottom: 76px; }
  .pd-buy .btn-lg { height: 48px; }
}
@media (max-width: 420px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 2rem; }
}
@media (max-width: 980px) { #menu-btn { display: inline-flex !important; } }
.col-2 { grid-column: span 2 !important; } .col-5 { grid-column: span 5 !important; }
@media (max-width: 760px) { .form-grid .col-2, .form-grid .col-5 { grid-column: span 12 !important; } }
.icon-xl { width: 56px; height: 56px; opacity: .8; }
