/* ============================================================
   ZippyCapital — Design Tokens + Global Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-base: #07090C;
  --surface: #0E1217;
  --surface-2: #161B22;
  --surface-3: #1F2630;

  --border: #1F2630;
  --border-strong: #2A333F;

  --fg: #E6EAF0;
  --fg-muted: #8A94A6;
  --fg-subtle: #5A6475;
  --fg-disabled: #3A4453;

  --accent-green: #00E28A;
  --accent-green-hover: #1AEF9B;
  --accent-green-dim: #00B370;
  --accent-green-bg: rgba(0, 226, 138, 0.10);
  --accent-green-bg-strong: rgba(0, 226, 138, 0.18);

  --accent-red: #FF3B6B;
  --accent-red-hover: #FF527D;
  --accent-red-dim: #CC2E55;
  --accent-red-bg: rgba(255, 59, 107, 0.10);
  --accent-red-bg-strong: rgba(255, 59, 107, 0.18);

  --accent-amber: #FFB020;
  --accent-amber-bg: rgba(255, 176, 32, 0.10);

  --accent-info: #3EA6FF;
  --accent-info-bg: rgba(62, 166, 255, 0.10);

  --accent-violet: #A78BFA;

  --on-accent-green: #001810;
  --on-accent-red: #FFFFFF;

  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --text-2xs: 0.6875rem;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --text-4xl: 3rem;
  --text-5xl: 4rem;
  --text-display: 5.5rem;

  --leading-tight: 1.1;
  --leading-snug: 1.25;
  --leading-normal: 1.45;
  --leading-relaxed: 1.6;

  --tracking-tight: -0.02em;
  --tracking-caps: 0.08em;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-14: 56px;
  --space-18: 72px;
  --space-24: 96px;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 999px;

  --shadow-card-hover: 0 8px 24px -8px rgba(0,0,0,0.6);
  --shadow-popover: 0 24px 48px -12px rgba(0,0,0,0.8), 0 0 0 1px var(--border-strong);
  --shadow-modal: 0 40px 80px -20px rgba(0,0,0,0.9), 0 0 0 1px var(--border-strong);

  --glow-green: 0 0 80px rgba(0,226,138,0.25);
  --ring-focus: 0 0 0 3px rgba(0,226,138,0.18);
  --ring-danger: 0 0 0 3px rgba(255,59,107,0.18);

  --ease-out-expo: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-micro: 120ms;
  --dur-short: 200ms;
  --dur-med: 320ms;

  --nav-height-marketing: 56px;
  --nav-height-app: 48px;
  --sidebar-width: 240px;
  --content-max: 1280px;
}

/* ============================================================
   Reset + Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--fg);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   Shared utility classes
   ============================================================ */
.zc-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.zc-caps { text-transform: uppercase; letter-spacing: var(--tracking-caps); font-size: var(--text-xs); color: var(--fg-muted); font-weight: var(--weight-medium); }
.zc-num-up { color: var(--accent-green); }
.zc-num-down { color: var(--accent-red); }
.zc-num-amber { color: var(--accent-amber); }

::selection { background: var(--accent-green-bg-strong); color: var(--fg); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--fg-subtle); }

/* ============================================================
   Shared buttons
   ============================================================ */
.btn {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: background var(--dur-micro), border-color var(--dur-micro), color var(--dur-micro);
  white-space: nowrap;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--accent-green); color: var(--on-accent-green); }
.btn-primary:hover:not(:disabled) { background: var(--accent-green-hover); }
.btn-secondary { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--fg-muted); }
.btn-ghost:hover:not(:disabled) { color: var(--fg); background: var(--surface-2); }
.btn-danger { background: var(--accent-red-bg); color: var(--accent-red); border-color: rgba(255,59,107,0.25); }
.btn-danger:hover:not(:disabled) { background: var(--accent-red-bg-strong); }
.btn-approve { background: var(--accent-green-bg); color: var(--accent-green); border: 1px solid rgba(0,226,138,0.25); }
.btn-approve:hover:not(:disabled) { background: var(--accent-green-bg-strong); }
.btn-sm { padding: 4px 8px; font-size: 11px; border-radius: var(--radius-xs); }
.btn-lg { padding: 13px 22px; font-size: var(--text-base); }
.btn-full { width: 100%; }

/* ============================================================
   Shared badges
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}
.badge-active { background: var(--accent-green-bg); color: var(--accent-green); }
.badge-completed { background: var(--accent-info-bg); color: var(--accent-info); }
.badge-pending { background: var(--accent-amber-bg); color: var(--accent-amber); }
.badge-rejected { background: var(--accent-red-bg); color: var(--accent-red); }
.badge-exited { background: var(--surface-3); color: var(--fg-muted); border: 1px solid var(--border); }
.badge-verified { background: var(--accent-green-bg); color: var(--accent-green); }
.badge-unverified { background: var(--surface-3); color: var(--fg-muted); border: 1px solid var(--border); }

/* ============================================================
   Shared form inputs
   ============================================================ */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: var(--text-xs); color: var(--fg-muted); margin-bottom: 6px; font-weight: 500; }
.field-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.field-row a { font-size: var(--text-xs); color: var(--accent-info); text-decoration: none; }

.input {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--fg);
  width: 100%;
  transition: border-color var(--dur-micro), box-shadow var(--dur-micro);
}
.input:focus { outline: none; border-color: var(--accent-green); box-shadow: var(--ring-focus); }
.input::placeholder { color: var(--fg-subtle); }
.input.error { border-color: var(--accent-red); }
.input.error:focus { box-shadow: var(--ring-danger); }
.input-mono { font-family: var(--font-mono); }

/* ============================================================
   Shared tables
   ============================================================ */
.zc-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.zc-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  font-weight: 500;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.zc-table th.num, .zc-table td.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.zc-table td { padding: 12px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.zc-table tr:last-child td { border-bottom: 0; }
.zc-table tr:hover td { background: var(--surface-2); }

/* ============================================================
   Shared panels / cards
   ============================================================ */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 16px; }
.panel-head { padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.panel-head h3 { font-size: var(--text-sm); font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; }
.panel-head .toolbar { display: flex; gap: 6px; align-items: center; }

.kpi-grid { display: grid; gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 18px; }
.kpi-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-muted); font-weight: 500; margin: 0 0 8px; }
.kpi-value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 24px; font-weight: 500; letter-spacing: -0.02em; margin: 0; }
.kpi-delta { font-family: var(--font-mono); font-size: 11px; margin-top: 4px; color: var(--fg-muted); }

/* ============================================================
   Sidebar shared styles
   ============================================================ */
.sidebar { border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
.sb-brand { padding: 13px 20px; border-bottom: 1px solid var(--border); height: var(--nav-height-app); display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sb-brand img { height: 22px; }
.sb-nav { padding: 10px 8px; flex: 1; }
.sb-section { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg-subtle); padding: 12px 12px 5px; font-weight: 500; }
.sb-link { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: var(--radius-sm); color: var(--fg-muted); text-decoration: none; font-size: var(--text-sm); font-weight: 500; margin-bottom: 1px; transition: background var(--dur-micro), color var(--dur-micro); }
.sb-link:hover { background: var(--surface); color: var(--fg); }
.sb-link.active { background: var(--surface-2); color: var(--fg); }
.sb-link.active svg, .sb-link.active .sb-icon { color: var(--accent-green); }
.sb-link-inner { display: flex; align-items: center; gap: 10px; flex: 1; }
.sb-count { font-family: var(--font-mono); font-size: 10px; padding: 1px 6px; border-radius: var(--radius-xs); background: var(--accent-amber-bg); color: var(--accent-amber); }
.sb-foot { padding: 12px; border-top: 1px solid var(--border); flex-shrink: 0; }
.sb-user { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; }
.sb-user:hover { background: var(--surface); }
.sb-avatar { width: 28px; height: 28px; border-radius: 999px; background: var(--accent-green-bg); color: var(--accent-green); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; font-family: var(--font-mono); flex-shrink: 0; }
.sb-user-name { font-size: var(--text-sm); font-weight: 500; color: var(--fg); }
.sb-user-sub { font-size: 11px; color: var(--fg-muted); font-family: var(--font-mono); }

/* ============================================================
   Topbar
   ============================================================ */
.topbar { height: var(--nav-height-app); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 10; background: rgba(7,9,12,0.80); backdrop-filter: blur(12px); }
.topbar-search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 5px 10px; width: 260px; }
.topbar-search input { background: transparent; border: 0; outline: 0; color: var(--fg); font-family: var(--font-sans); font-size: var(--text-sm); width: 100%; }
.topbar-search input::placeholder { color: var(--fg-subtle); }
.topbar-right { display: flex; gap: 8px; align-items: center; }
.icon-btn { width: 32px; height: 32px; border-radius: var(--radius-sm); background: transparent; border: 1px solid var(--border); color: var(--fg-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; position: relative; transition: background var(--dur-micro), color var(--dur-micro); }
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; background: var(--accent-green); border-radius: 999px; }

/* ============================================================
   Progress bar
   ============================================================ */
.progress { height: 4px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent-green); border-radius: 999px; transition: width var(--dur-med) var(--ease-out-expo); }
.progress-fill.amber { background: var(--accent-amber); }
.progress-fill.red { background: var(--accent-red); }

/* ============================================================
   Ticker strip
   ============================================================ */
.ticker { height: 36px; border-bottom: 1px solid var(--border); overflow: hidden; display: flex; align-items: center; background: var(--bg-base); }
.ticker-track { display: flex; gap: 40px; animation: ticker-scroll 60s linear infinite; white-space: nowrap; padding-left: 24px; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-item { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 11px; color: var(--fg); }
.ticker-item img { width: 13px; height: 13px; }
.ticker-sym { color: var(--fg-muted); }

/* ============================================================
   Separator
   ============================================================ */
.sep { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--fg-subtle); font-size: var(--text-xs); }
.sep::before, .sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ============================================================
   Admin tag
   ============================================================ */
.admin-tag { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-amber); background: var(--accent-amber-bg); padding: 2px 6px; border-radius: var(--radius-xs); font-weight: 600; }

/* ============================================================
   Tabs
   ============================================================ */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab { padding: 10px 16px; font-size: var(--text-sm); color: var(--fg-muted); border-bottom: 2px solid transparent; cursor: pointer; font-weight: 500; text-decoration: none; display: flex; gap: 8px; align-items: center; transition: color var(--dur-micro); }
.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg); border-bottom-color: var(--accent-green); }
.tab .t-count { font-family: var(--font-mono); font-size: 10px; padding: 1px 6px; border-radius: var(--radius-xs); background: var(--surface-2); color: var(--fg-muted); }
.tab.active .t-count.urgent { background: var(--accent-amber-bg); color: var(--accent-amber); }

/* ============================================================
   Asset cell (table)
   ============================================================ */
.asset-cell { display: flex; align-items: center; gap: 10px; }
.asset-cell img { width: 24px; height: 24px; }
.asset-sym { font-weight: 500; font-size: var(--text-sm); }
.asset-name { font-size: 11px; color: var(--fg-muted); }

/* ============================================================
   User cell (table)
   ============================================================ */
.user-cell { display: flex; align-items: center; gap: 10px; }
.avatar { width: 28px; height: 28px; border-radius: 999px; background: var(--accent-green-bg); color: var(--accent-green); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 11px; font-family: var(--font-mono); flex-shrink: 0; }
.avatar.blue { background: var(--accent-info-bg); color: var(--accent-info); }
.avatar.red { background: var(--accent-red-bg); color: var(--accent-red); }
.avatar.violet { background: rgba(167,139,250,0.12); color: var(--accent-violet); }
.user-name { font-size: var(--text-sm); font-weight: 500; }
.user-email { font-size: 11px; color: var(--fg-muted); font-family: var(--font-mono); }

/* ============================================================
   Copy field
   ============================================================ */
.copy-field { display: flex; align-items: center; gap: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.copy-field-value { flex: 1; padding: 10px 12px; font-family: var(--font-mono); font-size: 12px; color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-field-btn { padding: 8px 12px; background: var(--surface-3); border: 0; border-left: 1px solid var(--border); color: var(--fg-muted); cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500; font-family: var(--font-sans); transition: color var(--dur-micro), background var(--dur-micro); white-space: nowrap; }
.copy-field-btn:hover { color: var(--fg); background: var(--border-strong); }
.copy-field-btn.copied { color: var(--accent-green); }

/* ============================================================
   OTP input
   ============================================================ */
.otp-row { display: flex; gap: 8px; justify-content: center; }
.otp-cell { width: 48px; height: 56px; text-align: center; font-family: var(--font-mono); font-size: 22px; font-weight: 600; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--fg); transition: border-color var(--dur-micro), box-shadow var(--dur-micro); }
.otp-cell:focus { outline: none; border-color: var(--accent-green); box-shadow: var(--ring-focus); }
.otp-cell.error { border-color: var(--accent-red); animation: shake 0.4s var(--ease-out-expo); }
.otp-dash { align-self: center; color: var(--fg-subtle); font-size: 20px; }
@keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-4px); } 40%,80% { transform: translateX(4px); } }

/* ============================================================
   Skeleton loader
   ============================================================ */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================================
   Empty state
   ============================================================ */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 32px; text-align: center; }
.empty-icon { width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--surface-2); color: var(--fg-subtle); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.empty-title { font-size: var(--text-md); font-weight: 600; margin: 0 0 8px; }
.empty-sub { font-size: var(--text-sm); color: var(--fg-muted); margin: 0 0 24px; max-width: 320px; line-height: 1.5; }

/* ============================================================
   Error notice
   ============================================================ */
.notice { padding: 12px 16px; border-radius: var(--radius-sm); font-size: var(--text-sm); display: flex; align-items: flex-start; gap: 10px; }
.notice-error { background: var(--accent-red-bg); border: 1px solid rgba(255,59,107,0.25); color: var(--accent-red); }
.notice-success { background: var(--accent-green-bg); border: 1px solid rgba(0,226,138,0.25); color: var(--accent-green); }
.notice-warning { background: var(--accent-amber-bg); border: 1px solid rgba(255,176,32,0.25); color: var(--accent-amber); }
.notice-info { background: var(--accent-info-bg); border: 1px solid rgba(62,166,255,0.25); color: var(--accent-info); }

/* ============================================================
   Blazor reconnect + error UI overrides
   ============================================================ */
#blazor-error-ui {
  display: none;
  position: fixed;
  bottom: 0;
  width: 100%;
  background: var(--accent-red-bg);
  border-top: 1px solid rgba(255,59,107,0.3);
  color: var(--accent-red);
  padding: 12px 20px;
  font-size: var(--text-sm);
  z-index: 1000;
}
#blazor-error-ui.blazor-error-ui-show { display: flex; align-items: center; justify-content: space-between; }

/* ============================================================
   Table horizontal scroll (overrides overflow:hidden on .panel)
   ============================================================ */
.panel { overflow-x: auto; }          /* allow table scroll; y-hidden still clips corners */
.zc-table { min-width: 560px; }       /* force scroll instead of squish on narrow screens */

body { overflow-x: hidden; }

/* ============================================================
   App shell — sidebar + content grid
   ============================================================ */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
  position: relative;
}
.app-content { display: flex; flex-direction: column; min-width: 0; }

/* Mobile overlay behind the drawer */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 49;
  backdrop-filter: blur(2px);
  cursor: pointer;
}

/* Hamburger — hidden on wide screens */
.hamburger-btn { display: none !important; }

/* ============================================================
   Responsive breakpoints
   ============================================================ */

/* ── Small: < 640px ── */
@media (max-width: 639px) {
  .topbar { padding: 0 12px !important; }
  .app-content > main { padding: 12px !important; }
  .hide-xs { display: none !important; }

  /* Page header row: stack on very small screens */
  .page-header { flex-direction: column !important; align-items: flex-start !important; gap: 10px !important; }

  /* OTP cells smaller */
  .otp-cell { width: 40px; height: 48px; font-size: 18px; }

  /* KPI value font size */
  .kpi-value { font-size: 20px !important; }
}

/* ── Medium: 640px – 899px ── */
@media (max-width: 899px) {
  /* Sidebar becomes a fixed off-canvas drawer */
  .app-shell { grid-template-columns: 1fr; }

  .app-shell .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    z-index: 50;
    transform: translateX(-100%);
    transition: transform var(--dur-med) var(--ease-out-expo);
    background: var(--bg-base);
    border-right: 1px solid var(--border);
    box-shadow: none;
  }
  .app-shell.nav-open .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 48px rgba(0,0,0,0.6);
  }
  .app-shell.nav-open .nav-overlay { display: block; }

  /* Show hamburger, hide topbar search */
  .hamburger-btn { display: flex !important; }
  .topbar-search { display: none !important; }
  .topbar { padding: 0 16px; }

  /* Main content full-width */
  .app-content > main { padding: 16px; }

  /* Mobile sidebar close button */
  .sb-close-btn { display: flex !important; }
}

/* ── Desktop: ≥ 900px ── */
@media (min-width: 900px) {
  .nav-overlay { display: none !important; }
  .sb-close-btn { display: none !important; }
}

/* Sidebar mobile close button (hidden by default) */
.sb-close-btn {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.sb-close-btn:hover { background: var(--surface-2); color: var(--fg); }

/* ============================================================
   Responsive grid utilities
   ============================================================ */

/* KPI grid: 2 cols mobile → 4 cols desktop */
.zc-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 12px;
}
@media (min-width: 900px) {
  .zc-kpi-grid { grid-template-columns: repeat(4, 1fr) !important; }
}

/* 3-col card grid (wallets, plan cards): 1 → 2 → 3 */
.zc-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 600px) { .zc-card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .zc-card-grid { grid-template-columns: repeat(3, 1fr); } }

/* Main two-col (2fr + 1fr): stacks on mobile */
.zc-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
@media (min-width: 900px) { .zc-two-col { grid-template-columns: 2fr 1fr; } }

/* Equal two-col: stacks on mobile */
.zc-two-col-equal {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 768px) { .zc-two-col-equal { grid-template-columns: repeat(2, 1fr); } }

/* 3-col stat grid (investment detail): 1 → 3 */
.zc-stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 600px) { .zc-stat-grid { grid-template-columns: repeat(3, 1fr); } }

/* 3-col plan selector: 1 → 2 → 3 */
.zc-plan-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
@media (min-width: 600px) { .zc-plan-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .zc-plan-grid { grid-template-columns: repeat(3, 1fr); } }

/* Invest page: plan selector + open panel side-by-side on wide screens */
.zc-invest-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}
@media (min-width: 900px) { .zc-invest-layout { grid-template-columns: 1fr 380px; } }

/* Quick links grid (admin): 1 → 2 → 3 */
.zc-link-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}
@media (min-width: 600px) { .zc-link-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .zc-link-grid { grid-template-columns: repeat(3, 1fr); } }

/* Page header: title + action button */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  gap: 12px;
}

/* Coin selector row: wraps on very narrow screens */
.coin-selector { display: flex; gap: 8px; flex-wrap: wrap; }
.coin-selector > * { flex: 1; min-width: 72px; }

/* ============================================================
   Modal (ZcConfirmModal + ad-hoc)
   ============================================================ */
.zc-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: zc-fade-in var(--dur-short) var(--ease-standard);
}
.zc-modal {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 440px;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  animation: zc-modal-in var(--dur-med) var(--ease-out-expo);
}
.zc-modal-title { font-size: 18px; font-weight: 600; margin: 0 0 8px; letter-spacing: -0.01em; }
.zc-modal-message { font-size: 14px; color: var(--fg-muted); margin: 0 0 20px; line-height: 1.5; }
.zc-modal-body { margin-bottom: 20px; }
.zc-modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes zc-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes zc-modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ============================================================
   Landing page responsive tweaks
   ============================================================ */
.hero-section { padding: 120px 32px 80px; }
.section-pad { padding: 96px 32px; }
.section-pad-bottom { padding: 0 32px 96px; }

.landing-rates, .landing-hiw, .landing-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.landing-reviews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.review-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.landing-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-top: 56px; }
.landing-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 48px; max-width: var(--content-max); margin: 0 auto; }
.landing-nav-links { display: flex; gap: 24px; }
.landing-nav-toggle { display: none; background: none; border: 1px solid var(--border-strong); color: var(--fg); width: 36px; height: 36px; border-radius: var(--radius-sm); cursor: pointer; align-items: center; justify-content: center; }
.landing-mobile-menu { display: none; position: sticky; top: 56px; z-index: 19; background: rgba(7,9,12,0.96); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding: 8px 16px; flex-direction: column; }
.landing-mobile-menu.open { display: flex; }
.landing-mobile-menu .nav-link { font-size: 15px; padding: 14px 4px; border-bottom: 1px solid var(--border); color: var(--fg); }
.landing-mobile-menu .nav-link:last-child { border-bottom: none; }

@media (max-width: 899px) {
  .hero-section { padding: 64px 16px 48px; }
  .section-pad { padding: 56px 16px; }
  .section-pad-bottom { padding: 0 16px 56px; }

  .landing-rates, .landing-hiw, .landing-plans { grid-template-columns: 1fr; gap: 12px; }
  .landing-reviews { grid-template-columns: 1fr; gap: 12px; }
  .review-form-grid { grid-template-columns: 1fr; gap: 10px; }
  .landing-stats { grid-template-columns: repeat(2, 1fr); margin-top: 40px; }
  .landing-footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .landing-nav-links { display: none; }
  .landing-nav-toggle { display: inline-flex; }
  .landing-cta-panel { padding: 40px 24px !important; }
  .landing-cta-panel h2 { font-size: 28px !important; }
  .landing-section-h { font-size: 30px !important; }
}

@media (max-width: 639px) {
  .landing-footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .landing-footer-brand { grid-column: 1 / -1; }
  .landing-footer-bottom { flex-direction: column !important; gap: 8px; text-align: center; }
}

/* Landing cards reusable */
.plan-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; position: relative; }
.plan-card.featured { border-color: var(--accent-green); background: linear-gradient(180deg, rgba(0,226,138,0.05), transparent 40%), var(--surface); }
.hiw-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 28px; }
.rate-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; }
.review-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 22px; display: flex; flex-direction: column; }
.admin-review-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 899px) { .admin-review-grid { grid-template-columns: 1fr; } }

/* KYC slot review grid (admin) */
.kyc-slot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kyc-slot { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.kyc-slot-label { font-size: 11px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }
.kyc-slot-empty { font-size: 12px; color: var(--fg-subtle); padding: 12px 0; text-align: center; }
.kyc-slot img { width: 100%; max-height: 180px; object-fit: contain; border-radius: var(--radius-xs); background: var(--surface); }
@media (max-width: 639px) { .kyc-slot-grid { grid-template-columns: 1fr; } }
.stat-box { background: var(--surface); padding: 24px; }
.nav-link { font-size: 13px; color: var(--fg-muted); text-decoration: none; font-weight: 500; }
.nav-link:hover { color: var(--fg); }
.footer-link { display: block; font-size: 13px; color: var(--fg); text-decoration: none; margin-bottom: 8px; }
.footer-link:hover { color: var(--accent-green); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Toast (top-right access-denied banner) */
.zc-toast {
  position: fixed; top: 80px; right: 20px; z-index: 9000;
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--border); border-left: 3px solid var(--accent-red);
  padding: 14px 16px; border-radius: var(--radius-md);
  display: flex; gap: 12px; align-items: flex-start;
  max-width: 380px; min-width: 280px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  animation: zc-toast-in 0.25s ease-out, zc-toast-out 0.4s ease-in 4s forwards;
}
@keyframes zc-toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes zc-toast-out { to { opacity: 0; transform: translateX(20px); pointer-events: none; visibility: hidden; } }
@media (max-width: 639px) {
  .zc-toast { left: 12px; right: 12px; max-width: none; min-width: 0; top: 64px; }
}

/* ============================================================
   Live rates page
   ============================================================ */
.rates-filter-row { display: flex; justify-content: flex-end; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.rates-tabs { display: inline-flex; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px; }
.rates-tab { background: none; border: none; color: var(--fg-muted); font-family: var(--font-sans); font-size: 13px; font-weight: 500; padding: 6px 16px; border-radius: 999px; cursor: pointer; transition: color 150ms, background 150ms; }
.rates-tab:hover { color: var(--fg); }
.rates-tab.active { background: var(--surface-2); color: var(--fg); }

.rates-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1199px) { .rates-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 899px)  { .rates-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
@media (max-width: 559px)  { .rates-grid { grid-template-columns: 1fr; } }

.rate-card-v2 {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
  transition: border-color 150ms, transform 150ms;
}
.rate-card-v2:hover { border-color: var(--border-strong); }

.rate-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.rate-avatar {
  width: 32px; height: 32px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.rate-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 999px; position: absolute; inset: 0; }
.rate-avatar .avatar-letter { z-index: 0; }
.rate-avatar.avatar-text .avatar-letter { z-index: 1; }
.rate-titles { min-width: 0; }
.rate-sym { font-size: 13px; font-weight: 600; color: var(--fg); letter-spacing: 0.02em; }
.rate-name { font-size: 11px; color: var(--fg-muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rate-price {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.rate-change { font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.rate-change.up   { color: var(--accent-green); }
.rate-change.down { color: var(--accent-red); }
.rate-spark { margin-top: auto; padding-top: 8px; height: 48px; }
.rate-spark svg { display: block; width: 100%; height: 48px; }

.rates-meta { font-size: 11px; color: var(--fg-subtle); font-family: var(--font-mono); }

@media (max-width: 559px) {
  .rate-card-v2 { padding: 16px; min-height: 160px; }
  .rate-price { font-size: 20px; }
  .rates-tab { padding: 6px 12px; font-size: 12px; }
}

/* ============================================================
   Notifications list
   ============================================================ */
.notif-row:last-child { border-bottom: none !important; }
.notif-row:hover { background: var(--surface-2) !important; }

/* ============================================================
   Admin quick-link hover
   ============================================================ */
.admin-quicklink:hover { border-color: var(--accent-green) !important; }

/* ============================================================
   Responsive tables — stack on very narrow
   ============================================================ */
@media (max-width: 639px) {
  .page-header h1 { font-size: 20px !important; }
  .kpi-value { font-size: 20px !important; }
}

/* Hide table action label text on mobile for tight rows */
@media (max-width: 639px) {
  .hide-sm { display: none !important; }
}

/* Two-column form (collapses on mobile) */
.zc-form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 639px) { .zc-form-2col { grid-template-columns: 1fr; } }

/* Invest page summary panel: sticky on desktop only */
@media (min-width: 900px) { .zc-invest-sticky { position: sticky; top: 72px; } }
