/* OQN UI Theme
   Light warm amber-yellow theme with high contrast.
   Cosmetic changes should mostly be edits to variables.css (design tokens).
   Component-level overrides live here. */
:root {
  /* Primitive: colors */
  --c-black:   #1A1A2E;
  --c-ink:     #1F1F1F;
  --c-slate:   #3A3A5C;
  --c-slate-2: #5A5A7A;
  --c-white:   #FFFBEF;
  --c-muted:   #6B6B8A;

  --c-gold:    #F59E0B;
  --c-orange:  #D97706;
  --c-green:   #15803D;
  --c-red:     #B91C1C;
  --c-blue:    #1D4ED8;

  /* Typography */
  --font-sans:    ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --font-display: "Sora", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  --font-mono:    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Spacing */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  20px;
  --s-6:  24px;
  --s-8:  32px;
  --s-10: 40px;

  /* Radius */
  --r-2:    10px;
  --r-3:    14px;
  --r-pill: 999px;

  /* Semantic */
  --bg:        #FFF3C4;
  --surface:   #FFFBEF;
  --surface-2: #FFF8DC;
  --border:    rgba(26, 26, 46, 0.15);

  --text:       var(--c-ink);
  --text-muted: var(--c-muted);

  --accent:   var(--c-gold);
  --accent-2: var(--c-orange);

  --btn-bg:   linear-gradient(135deg, var(--c-gold), var(--c-orange));
  --btn-text: #FFFBEF;

  --shadow-lg: 0 24px 60px rgba(26, 26, 46, 0.18);

  --page-max: 1120px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

h1, h2, h3 { font-family: var(--font-display); margin: 0; color: var(--c-black); }
p { margin: 0; }
code, pre { font-family: var(--font-mono); }

::selection { background: rgba(245, 158, 11, 0.30); }

.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--s-4);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--c-black);
  color: #FFFBEF;
  border-bottom: 3px solid var(--c-gold);
}

/* Username badge in the dark topbar */
.topbar .badge {
  color: #FFFBEF;
  border-color: rgba(255, 251, 239, 0.30);
  background: rgba(255, 251, 239, 0.10);
}

/* Ghost button inside the dark topbar */
.topbar .btn.ghost {
  color: #FFFBEF;
  font-weight: 600;
}
.topbar .btn.ghost:hover {
  background: rgba(255, 251, 239, 0.10);
  filter: none;
}

/* Hamburger button — hidden on desktop */
.nav-toggle { display: none; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--c-gold);
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--btn-bg);
  box-shadow: 0 4px 12px rgba(245,158,11,0.4);
}

.main {
  padding: var(--s-4) 0 var(--s-10);
}

.section {
  margin: var(--s-6) 0;
}

.section-title {
  font-size: 18px;
  margin-bottom: var(--s-2);
  color: var(--c-black);
}

.section-subtitle {
  margin-bottom: var(--s-4);
  color: var(--text-muted);
  font-size: 13px;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--s-8);
  align-items: center;
}

@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
}

.stack {
  display: grid;
  gap: var(--s-3);
}

.hero-title {
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.15;
  margin: 10px 0 10px;
  color: var(--c-black);
}

.hero-subtitle {
  color: var(--c-slate);
  max-width: 56ch;
  margin-bottom: var(--s-4);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: var(--s-4);
  box-shadow: 0 4px 18px rgba(26, 26, 46, 0.10);
}

.card.soft { background: var(--surface-2); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: rgba(245, 158, 11, 0.18);
  color: var(--c-orange);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

.badge {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: rgba(26, 26, 46, 0.04);
}

.btn {
  cursor: pointer;
  border: 1px solid transparent;
  padding: 9px 14px;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.btn:hover { filter: brightness(0.94); }

.btn.primary {
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(217,119,6,0.30);
}

.btn.outline {
  border-color: rgba(26, 26, 46, 0.25);
  background: rgba(26, 26, 46, 0.04);
  color: var(--c-black);
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
}

.btn.small { padding: 7px 12px; font-size: 13px; }

.link {
  color: var(--c-orange);
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}

.muted { color: var(--text-muted); }

.input {
  width: 100%;
  background: #FFFBEF;
  border: 1px solid rgba(26, 26, 46, 0.25);
  color: var(--c-ink);
  border-radius: var(--r-2);
  padding: 10px 12px;
}

.input:focus {
  outline: 2px solid var(--c-gold);
  outline-offset: 1px;
}

.label {
  display: block;
  font-size: 12px;
  color: var(--c-slate);
  font-weight: 600;
  margin-bottom: 6px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
}

.hr {
  height: 1px;
  background: var(--border);
  margin: var(--s-4) 0;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 8px 0;
  border-bottom: 1px dashed rgba(26, 26, 46, 0.12);
  font-size: 13px;
}

.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-muted); }
.kv .v { font-weight: 600; color: var(--c-black); }

.notice {
  border: 1px solid rgba(217,119,6,0.35);
  background: rgba(245,158,11,0.10);
  border-radius: var(--r-3);
  padding: var(--s-3);
  color: var(--c-ink);
  font-size: 13px;
}

.notice.error {
  border-color: rgba(185,28,28,0.40);
  background: rgba(185,28,28,0.08);
}

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--r-3);
  border: 1px solid var(--border);
}

.table th, .table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(26, 26, 46, 0.08);
  text-align: left;
  font-size: 13px;
}

.table th {
  color: var(--c-slate);
  font-weight: 700;
  background: rgba(26, 26, 46, 0.04);
}

.table tr:hover td { background: rgba(245, 158, 11, 0.06); }

.bundle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--s-3);
}

.bundle-card-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 6px;
  font-family: var(--font-display);
  color: var(--c-black);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.meta-pill {
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: rgba(26, 26, 46, 0.05);
  border: 1px solid rgba(26, 26, 46, 0.10);
}

/* ── App shell: desktop two-column layout ── */
.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: var(--s-4);
}

.sidebar {
  position: sticky;
  top: var(--s-4);
  align-self: start;
}

/* ── Mobile nav ── */
@media (max-width: 980px) {
  /* Hamburger visible, desktop sticky sidebar gone */
  .nav-toggle { display: inline-flex; }

  .app-shell {
    grid-template-columns: 1fr;
  }

  /* Sidebar collapses: hidden by default, not sticky, no overlap */
  .sidebar {
    position: static;      /* critical: removes sticky so it doesn't cover content */
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.3s ease, opacity 0.2s ease;
  }

  /* Open state toggled by JS */
  .sidebar.nav-open {
    max-height: 800px;     /* generous cap; animates open */
    opacity: 1;
    pointer-events: auto;
  }
}

.nav {
  display: grid;
  gap: var(--s-2);
  align-items: stretch;
}

.navlink {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--r-2);
  border: 1px solid rgba(26, 26, 46, 0.12);
  background: rgba(26, 26, 46, 0.03);
  color: var(--c-black);
  font-size: 13px;
  font-weight: 500;
}

.navlink:hover {
  background: rgba(245,158,11,0.10);
  border-color: rgba(217,119,6,0.30);
}

.navlink.active {
  border-color: rgba(217,119,6,0.50);
  background: rgba(245,158,11,0.16);
  font-weight: 700;
  color: var(--c-orange);
}

.big-number {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  margin-top: 4px;
  color: var(--c-black);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.55);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 9999;
}

.modal {
  max-width: 760px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.footer {
  padding-top: var(--s-6);
  color: var(--text-muted);
  font-size: 12px;
}
