/* ============================================================
   Transfado — design system
   The new way to get paid. A product of Pierson Digital.
   Tokens drive both dark (default) and light themes.
   ============================================================ */

/* ---------- Tokens: DARK (default) ---------- */
:root,
:root[data-theme="dark"] {
  /* surfaces */
  --bg:            #07090F;
  --bg-2:          #0A0E17;
  --surface:       #0E131F;
  --surface-2:     #141A28;
  --surface-3:     #1C2435;
  --glass:         rgba(14,19,31,0.66);
  --border:        rgba(150,180,230,0.10);
  --border-strong: rgba(150,180,230,0.20);
  --hairline:      rgba(255,255,255,0.06);

  /* text */
  --text:          #EAF1FC;
  --text-muted:    #98A6C0;
  --text-dim:      #5E6B85;

  /* brand: Transfado green = "new money" */
  --accent:        #1FE08A;
  --accent-strong: #12C878;
  --accent-soft:   rgba(31,224,138,0.14);
  --accent-ring:   rgba(31,224,138,0.30);
  --accent-ink:    #042414;     /* text on green buttons */
  --violet:        #8B5CF6;     /* aurora + secondary only */
  --blue:          #3B82F6;     /* legacy alias / info */

  /* semantic money */
  --positive:      #1FE08A;
  --positive-text: #4ADE9A;
  --negative:      #FB5E7E;
  --negative-text: #FF859B;
  --warning:       #FBBF24;
  --gold:          #FBBF24;     /* profit / premium highlight */

  /* gradients */
  --grad-brand:  linear-gradient(135deg, #1FE08A 0%, #0FB877 100%);
  --grad-violet: linear-gradient(135deg, #8B5CF6 0%, #6366F1 100%);
  --grad-gold:   linear-gradient(135deg, #FBBF24 0%, #D97706 100%);
  --grad-text:   linear-gradient(120deg, #1FE08A 0%, #6EE7B7 50%, #8B5CF6 100%);

  /* effects */
  --shadow:     0 1px 2px rgba(0,0,0,.4), 0 10px 34px rgba(0,0,0,.34);
  --shadow-lg:  0 24px 70px rgba(0,0,0,.55);
  --glow:       0 0 0 1px var(--accent-ring), 0 10px 40px rgba(31,224,138,.22);
  --grain-opacity: .035;

  /* shape + motion */
  --radius:    16px;
  --radius-sm: 11px;
  --radius-lg: 22px;
  --ease:      cubic-bezier(.22,.61,.36,1);
  --spring:    cubic-bezier(.34,1.56,.64,1);
  --t-fast:    .14s;
  --t-med:     .28s;

  /* fonts */
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* legacy aliases so existing markup keeps working */
  --navy: var(--bg); --navy2: var(--surface); --navy3: var(--surface-2); --navy4: var(--surface-3);
  --line: var(--border); --line-strong: var(--border-strong);
  --white: var(--text); --off: var(--text); --muted: var(--text-muted); --muted-dim: var(--text-dim);
  --blue-light: #6EE7B7; --green: var(--positive); --green-light: var(--positive-text);
  --red: var(--negative); --red-soft: var(--negative-text); --amber: var(--gold);
  --grad-blue: var(--grad-brand); --grad-green: var(--grad-brand);
  --card-shadow: var(--shadow); --font-head: var(--font-display);
}

/* ---------- Tokens: LIGHT ---------- */
:root[data-theme="light"] {
  --bg:            #F5F7FB;
  --bg-2:          #FFFFFF;
  --surface:       #FFFFFF;
  --surface-2:     #F3F6FB;
  --surface-3:     #E9EFF7;
  --glass:         rgba(255,255,255,0.72);
  --border:        rgba(16,32,64,0.10);
  --border-strong: rgba(16,32,64,0.18);
  --hairline:      rgba(16,32,64,0.06);

  --text:          #0B1424;
  --text-muted:    #51617B;
  --text-dim:      #8593AC;

  --accent:        #07B870;
  --accent-strong: #059862;
  --accent-soft:   rgba(7,184,112,0.12);
  --accent-ring:   rgba(7,184,112,0.28);
  --accent-ink:    #FFFFFF;
  --violet:        #7C3AED;
  --blue:          #2563EB;

  --positive:      #07B870;
  --positive-text: #059862;
  --negative:      #E11D48;
  --negative-text: #BE123C;
  --warning:       #B45309;
  --gold:          #B7791F;

  --grad-brand:  linear-gradient(135deg, #08C078 0%, #059862 100%);
  --grad-gold:   linear-gradient(135deg, #F59E0B 0%, #B45309 100%);
  --grad-text:   linear-gradient(120deg, #07B870 0%, #059862 45%, #7C3AED 100%);

  --shadow:     0 1px 2px rgba(16,32,64,.06), 0 12px 34px rgba(16,32,64,.08);
  --shadow-lg:  0 24px 70px rgba(16,32,64,.18);
  --glow:       0 0 0 1px var(--accent-ring), 0 12px 38px rgba(7,184,112,.16);
  --grain-opacity: .02;

  --blue-light: #059862; --green-light: #059862;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  transition: background var(--t-med) var(--ease), color var(--t-med) var(--ease);
}

/* Film-grain overlay so flat areas don't look cheap */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--accent); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent-strong); }
:root[data-theme="dark"] a:hover { color: #6EE7B7; }

h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 700; color: var(--text); line-height: 1.04; letter-spacing: -.02em; }
::selection { background: var(--accent-soft); color: var(--text); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ---------- Layout helpers ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 460px; margin: 0 auto; }
.row { display: flex; gap: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wrap { flex-wrap: wrap; } .grow { flex: 1; }
.muted { color: var(--text-muted); } .dim { color: var(--text-dim); }
.small { font-size: 13px; } .tiny { font-size: 11.5px; }
.center { text-align: center; } .nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace,'SF Mono','Cascadia Code',Menlo,Consolas,monospace; }
.hidden { display: none !important; }
.mt8{margin-top:8px}.mt16{margin-top:16px}.mt24{margin-top:24px}.mt32{margin-top:32px}
.mb8{margin-bottom:8px}.mb16{margin-bottom:16px}.mb24{margin-bottom:24px}
.gap8{gap:8px}.gap24{gap:24px}
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ---------- Brand lockup ---------- */
.brand { display: inline-flex; align-items: center; gap: 0; font-family: var(--font-display); font-weight: 700; font-size: 21px; color: var(--text); letter-spacing: -.03em; }
.brand:hover { color: var(--text); }
.brand small { font-weight: 700; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand-mark { width: 34px; height: 34px; flex: none; margin-right: 11px; }
.brand-mark svg { width: 100%; height: 100%; display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 15px; line-height: 1;
  padding: 12px 20px; border-radius: 12px; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; text-decoration: none; position: relative;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-med), background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--grad-brand); color: var(--accent-ink); box-shadow: 0 6px 20px rgba(31,224,138,.28); }
.btn-primary:hover { color: var(--accent-ink); box-shadow: 0 12px 34px rgba(31,224,138,.42); }
.btn-gold { background: var(--grad-gold); color: #2a1c00; }
.btn-gold:hover { color: #2a1c00; box-shadow: 0 12px 30px rgba(251,191,36,.34); }
.btn-green { background: var(--grad-brand); color: var(--accent-ink); box-shadow: 0 6px 20px rgba(31,224,138,.28); }
.btn-green:hover { color: var(--accent-ink); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); border-color: var(--accent-ring); }
.btn-danger { background: rgba(251,94,126,.12); color: var(--negative-text); border-color: rgba(251,94,126,.3); }
.btn-danger:hover { background: rgba(251,94,126,.2); color: var(--negative-text); }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 15px 26px; font-size: 16px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 10px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); transition: border-color var(--t-med), transform var(--t-med), box-shadow var(--t-med);
}
.card-pad-lg { padding: 28px; }
.card h3 { font-size: 19px; }
.card-hover:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.panel-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 600; margin-bottom: 14px; font-family: var(--font-body); }

/* Stat tiles */
.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(196px,1fr)); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden; transition: border-color var(--t-med), transform var(--t-med); }
.stat:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.stat::before { content:""; position:absolute; left:0; top:14px; bottom:14px; width:3px; border-radius:3px; background: var(--accent); }
.stat.green::before { background: var(--positive); } .stat.gold::before { background: var(--gold); } .stat.red::before { background: var(--negative); }
.stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; }
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: 32px; color: var(--text); margin-top: 7px; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-value.green { color: var(--positive-text); } .stat-value.gold { color: var(--gold); }
.stat-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 8px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; padding: 3px 9px; border-radius: 999px; text-transform: capitalize; border: 1px solid transparent; white-space: nowrap; }
.badge::before { content:""; width:6px; height:6px; border-radius:50%; background: currentColor; }
.badge.plain::before { display:none; }
.badge.succeeded,.badge.active,.badge.paid,.badge.won,.badge.delivered { color: var(--positive-text); background: var(--accent-soft); border-color: var(--accent-ring); }
.badge.failed,.badge.suspended,.badge.past_due,.badge.canceled,.badge.lost,.badge.blocked { color: var(--negative-text); background: rgba(251,94,126,.12); border-color: rgba(251,94,126,.25); }
.badge.refunded,.badge.partially_refunded,.badge.pending,.badge.needs_response,.badge.under_review,.badge.flagged { color: var(--gold); background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.25); }
.badge.neutral,.badge.draft { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-ring); }
.badge.violet { color: var(--violet); background: rgba(139,92,246,.13); border-color: rgba(139,92,246,.28); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 600; color: var(--text-muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding: 13px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background var(--t-fast); }
table.data tbody tr:hover { background: var(--accent-soft); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-link { cursor: pointer; }
.empty-state { text-align: center; padding: 52px 20px; color: var(--text-muted); }
.empty-state .big { font-size: 40px; margin-bottom: 12px; opacity:.9; }
.empty-art { width: 96px; height: 96px; margin: 0 auto 16px; display:block; }

/* ---------- Forms ---------- */
label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.input, input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], select, textarea {
  width: 100%; font-family: var(--font-body); font-size: 15px; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: 11px;
  padding: 11px 13px; transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast); outline: none;
}
.input:focus, input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--text-dim); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath fill='%2398A6C0' d='M6 8 2 4h8z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }
.input-group { display: flex; align-items: stretch; }
.input-prefix { display:flex; align-items:center; padding: 0 12px; background: var(--surface-2); border:1px solid var(--border-strong); border-right:none; border-radius: 11px 0 0 11px; color: var(--text-muted); font-weight:600; }
.input-group .input, .input-group input { border-radius: 0 11px 11px 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.help { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
.form-error { color: var(--negative-text); font-size: 13.5px; margin: 4px 0; min-height: 0; }
fieldset { border: none; }

.switch { position: relative; display: inline-flex; align-items:center; gap:10px; cursor:pointer; }
.switch input { display:none; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3); transition: background var(--t-fast); position: relative; flex:none; }
.switch .track::after { content:""; position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%; background:#fff; transition: transform var(--t-fast) var(--spring); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }

.segmented { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: 11px; padding: 3px; gap: 3px; }
.segmented button { background: transparent; border: none; color: var(--text-muted); font-family: var(--font-body); font-weight: 600; font-size: 14px; padding: 8px 16px; border-radius: 8px; cursor: pointer; transition: all var(--t-fast); }
.segmented button.active { background: var(--accent); color: var(--accent-ink); }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 20px 14px; display: flex; flex-direction: column; gap: 5px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding: 6px 8px 16px; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 10px 13px; border-radius: 10px; color: var(--text-muted); font-weight: 600; font-size: 14.5px; cursor: pointer; transition: all var(--t-fast); border: 1px solid transparent; }
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link.active { background: var(--accent-soft); color: var(--text); border-color: var(--accent-ring); }
.side-link .ico { width: 20px; height: 20px; display:grid; place-items:center; opacity:.95; }
.side-link .ico svg { width: 18px; height: 18px; }
.side-sep { height: 1px; background: var(--border); margin: 12px 6px; }
.side-foot { margin-top: auto; padding-top: 14px; }
.side-account { font-size: 13px; color: var(--text-muted); padding: 8px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 30px; border-bottom: 1px solid var(--border); background: var(--glass); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: 23px; }
.content { padding: 28px 30px 72px; max-width: 1320px; width: 100%; }
.page { display: none; }
.page.active { display: block; animation: pageIn .34s var(--ease); }
@keyframes pageIn { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform:none; } }
.stagger > * { animation: rise .4s var(--ease) backwards; }
.stagger > *:nth-child(1){animation-delay:.02s}.stagger > *:nth-child(2){animation-delay:.06s}.stagger > *:nth-child(3){animation-delay:.10s}.stagger > *:nth-child(4){animation-delay:.14s}.stagger > *:nth-child(5){animation-delay:.18s}.stagger > *:nth-child(6){animation-delay:.22s}
@keyframes rise { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform:none; } }

.section-head { display:flex; align-items:center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { font-size: 22px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.grid-side { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }

/* ---------- Chart ---------- */
.chart { width: 100%; height: 200px; display: block; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.chart .draw { stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: draw 1.1s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart-legend { display:flex; gap:18px; font-size:12.5px; color: var(--text-muted); margin-top: 10px; }
.chart-legend i { width:10px; height:10px; border-radius:3px; display:inline-block; margin-right:6px; vertical-align: middle; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(2,5,12,.62); backdrop-filter: blur(6px); display: none; align-items: flex-start; justify-content: center; z-index: 100; padding: 40px 16px; overflow-y: auto; }
.modal-backdrop.open { display: flex; animation: fade .2s; }
@keyframes fade { from{opacity:0} to{opacity:1} }
.modal { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px; width: 100%; max-width: 520px; box-shadow: var(--shadow-lg); animation: pop .26s var(--spring); }
.modal.wide { max-width: 720px; }
@keyframes pop { from { opacity:0; transform: scale(.95) translateY(12px); } to { opacity:1; transform:none; } }
.modal-head { display:flex; align-items:center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 20px; }
.modal-body { padding: 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--border); display:flex; justify-content: flex-end; gap: 10px; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 24px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }

/* ---------- Toast ---------- */
#toasts { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { background: var(--surface-2); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent); color: var(--text); padding: 13px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; max-width: 360px; animation: slidein .3s var(--spring); }
.toast.success { border-left-color: var(--positive); }
.toast.error { border-left-color: var(--negative); }
@keyframes slidein { from { opacity:0; transform: translateX(24px); } to { opacity:1; transform:none; } }

/* ---------- Fee breakdown ---------- */
.fee-break { background: var(--bg-2); border: 1px solid var(--border); border-radius: 13px; padding: 16px; font-size: 14px; }
.fee-break .row-between { padding: 6px 0; }
.fee-break .total { border-top: 1px dashed var(--border-strong); margin-top: 8px; padding-top: 12px; font-weight: 700; color: var(--text); }
.fee-break .pierson { color: var(--gold); }
.fee-break .free { color: var(--positive-text); font-weight:700; }

.copy-field { display:flex; align-items:center; gap:8px; background: var(--bg-2); border:1px solid var(--border-strong); border-radius: 11px; padding: 4px 4px 4px 14px; }
.copy-field code { flex:1; font-size: 13px; color: var(--text); overflow:hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Spinner + skeleton shimmer ---------- */
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.25); border-top-color: currentColor; border-radius:50%; animation: spin .7s linear infinite; display:inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { padding: 56px; text-align:center; color: var(--text-muted); }
.skel { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 8px; }
.skel::after { content:""; position:absolute; inset:0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--surface-3), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skel-line { height: 12px; margin: 8px 0; }
.skel-card { height: 110px; }

/* ---------- Theme toggle + lang select (top bar controls) ---------- */
.topctl { display:inline-flex; align-items:center; gap:8px; }
.icon-btn { width:38px; height:38px; display:grid; place-items:center; border-radius:10px; border:1px solid var(--border-strong); background: var(--surface-2); color: var(--text-muted); cursor:pointer; transition: all var(--t-fast); }
.icon-btn:hover { color: var(--text); border-color: var(--accent-ring); background: var(--surface-3); }
.icon-btn svg { width:18px; height:18px; }
.lang-select { background: var(--surface-2); border:1px solid var(--border-strong); color: var(--text-muted); border-radius:10px; padding:8px 28px 8px 11px; font-size:13px; font-weight:600; cursor:pointer; width:auto; }

/* ---------- Command palette (⌘K) ---------- */
.cmdk-backdrop { position: fixed; inset:0; background: rgba(2,5,12,.5); backdrop-filter: blur(5px); display:none; align-items:flex-start; justify-content:center; padding-top: 14vh; z-index: 300; }
.cmdk-backdrop.open { display:flex; animation: fade .15s; }
.cmdk { width: 100%; max-width: 560px; background: var(--surface); border:1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow-lg); overflow:hidden; animation: pop .2s var(--spring); }
.cmdk input { border:none; border-bottom:1px solid var(--border); border-radius:0; padding:18px 20px; font-size:16px; background:transparent; }
.cmdk input:focus { box-shadow:none; }
.cmdk-list { max-height: 340px; overflow-y:auto; padding:8px; }
.cmdk-item { display:flex; align-items:center; gap:12px; padding:11px 13px; border-radius:10px; cursor:pointer; color: var(--text); font-size:14.5px; }
.cmdk-item .k { margin-left:auto; font-size:11px; color: var(--text-dim); }
.cmdk-item.sel, .cmdk-item:hover { background: var(--accent-soft); }
.cmdk-empty { padding: 28px; text-align:center; color: var(--text-muted); }

/* ---------- Aurora background ---------- */
.aurora { position:absolute; inset:0; overflow:hidden; pointer-events:none; z-index:0; }
.aurora span { position:absolute; border-radius:50%; filter: blur(70px); opacity:.5; animation: float 18s var(--ease) infinite alternate; }
.aurora .a1 { width:520px; height:520px; background: radial-gradient(circle, rgba(31,224,138,.5), transparent 65%); top:-160px; right:-120px; }
.aurora .a2 { width:460px; height:460px; background: radial-gradient(circle, rgba(139,92,246,.42), transparent 65%); bottom:-180px; left:-120px; animation-delay:-6s; }
.aurora .a3 { width:380px; height:380px; background: radial-gradient(circle, rgba(59,130,246,.32), transparent 65%); top:30%; left:40%; animation-delay:-11s; }
@keyframes float { to { transform: translate(40px,-30px) scale(1.12); } }

/* QR */
.qr-box { background:#fff; padding:12px; border-radius:14px; display:inline-block; }
.qr-box img, .qr-box canvas { display:block; width:160px; height:160px; }

/* count-up helper (no layout shift) */
.countup { font-variant-numeric: tabular-nums; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top:0; z-index: 30; height: auto; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 4px; padding: 10px; align-items:center; }
  .sidebar .brand { padding: 4px 8px; }
  .sidebar .side-link span:not(.ico) { display:none; }
  .side-sep, .side-foot { display:none; }
  .grid-2, .grid-3, .grid-side { grid-template-columns: 1fr; }
  .topbar { padding: 12px 18px; }
  .content { padding: 20px 18px 64px; }
}
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .stat-value { font-size: 27px; }
  #toasts { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .aurora span { animation: none; }
}
