/* ============================================================
   Ticket Foundry — Shared Stylesheet
   style.css — included by all pages
   ============================================================ */

/* ── Theme variables ──────────────────────────────────────── */
[data-theme="dark"] {
  --void:   #080a0f;
  --crypt:  #0e1118;
  --tomb:   #141820;
  --slab:   #1c2230;
  --bone:   #252d3d;
  --mist:   #8892a4;
  --ghost:  #c8d0de;
  --wraith: #e8edf5;
  --acid:   #c8ff00;
  --blood:  #ff2d55;
  --venom:  #a855f7;
  --plague: #00e5ff;
  --rust:   #ff6b35;
  --bile:   #ffdd00;
  --mono:   'Space Mono', monospace;
  --sans:   'Space Grotesk', sans-serif;
  --radius: 6px;
  --radius-lg: 10px;
}
[data-theme="light"] {
  --void:   #f0f2f7;
  --crypt:  #ffffff;
  --tomb:   #f8fafc;
  --slab:   #e2e8f0;
  --bone:   #cbd5e1;
  --mist:   #64748b;
  --ghost:  #334155;
  --wraith: #0f172a;
  --acid:   #2563eb;
  --blood:  #dc2626;
  --venom:  #7c3aed;
  --plague: #0891b2;
  --rust:   #ea580c;
  --bile:   #d97706;
  --mono:   'Space Mono', monospace;
  --sans:   'Space Grotesk', sans-serif;
  --radius: 6px;
  --radius-lg: 10px;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--void);
  color: var(--wraith);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
  padding-top: 56px;
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: var(--slab); border-radius: 3px; }
a { color: var(--acid); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ──────────────────────────────────────────────────── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: rgba(8,10,15,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--slab);
  padding: 0 40px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
[data-theme="light"] .site-nav { background: rgba(255,255,255,0.95); }
.nav-logo { display: flex; flex-direction: column; gap: 0; text-decoration: none; }
.nav-logo-mark {
  font-family: 'Space Mono', monospace;
  font-size: 8px; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--blood); font-weight: 700;
}
.nav-logo-name {
  font-size: 17px; font-weight: 600; color: var(--wraith);
  letter-spacing: -0.3px; line-height: 1.2;
}
.nav-page-label {
  font-family: 'Space Mono', monospace;
  font-size: 11px; letter-spacing: 0.5px;
  color: var(--mist); padding-left: 12px;
  border-left: 1px solid var(--slab);
}
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-text-link {
  font-family: 'Space Mono', monospace;
  font-size: 11px; letter-spacing: 0.5px;
  color: var(--mist); text-decoration: none;
  transition: color 0.15s; white-space: nowrap;
}
.nav-text-link:hover { color: var(--wraith); text-decoration: none; }
.nav-btn-theme {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--slab); background: transparent;
  color: var(--mist); cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
}
.nav-btn-theme:hover { border-color: var(--acid); color: var(--acid); }
.nav-btn-primary {
  background: var(--acid); color: #050800 !important;
  padding: 7px 16px; border-radius: 6px;
  font-weight: 600; font-size: 13px;
  text-decoration: none; white-space: nowrap;
  transition: background 0.15s; display: inline-block;
}
.nav-btn-primary:hover { background: #a8d900; text-decoration: none; }
.nav-btn-ghost {
  background: transparent; color: var(--ghost) !important;
  padding: 7px 16px; border-radius: 6px;
  font-weight: 500; font-size: 13px;
  text-decoration: none; border: 1px solid var(--slab);
  transition: all 0.15s; white-space: nowrap; display: inline-block;
}
.nav-btn-ghost:hover { background: var(--slab); text-decoration: none; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--slab);
  padding: 32px 40px;
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 24px; flex-wrap: wrap;
}
.footer-logo {
  font-family: 'Space Mono', monospace;
  font-size: 11px; color: var(--mist); letter-spacing: 1px;
}
.footer-copy { font-size: 12px; color: var(--mist); opacity: 0.6; margin-top: 4px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col-label {
  font-family: 'Space Mono', monospace; font-size: 9px;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--mist); margin-bottom: 2px;
}
.footer-link { font-size: 13px; color: var(--ghost); text-decoration: none; transition: color 0.15s; }
.footer-link:hover { color: var(--acid); }

/* ── Grid background (hero/header areas) ─────────────────── */
.grid-bg { position: relative; }
.grid-bg::before {
  content: ''; position: absolute; inset: 0;
  pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(var(--slab) 1px, transparent 1px),
    linear-gradient(90deg, var(--slab) 1px, transparent 1px);
  background-size: 48px 48px; opacity: 0.25;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 0%, transparent 100%);
}
[data-theme="light"] .grid-bg::before {
  background-image:
    linear-gradient(var(--bone) 1px, transparent 1px),
    linear-gradient(90deg, var(--bone) 1px, transparent 1px);
  opacity: 0.3;
}

/* ── Shared buttons ───────────────────────────────────────── */
.btn-primary {
  background: var(--acid); color: #050800;
  padding: 12px 28px; border-radius: 7px;
  font-weight: 600; font-size: 15px;
  transition: background 0.15s; display: inline-block;
  text-decoration: none;
}
.btn-primary:hover { background: #a8d900; text-decoration: none; }
.btn-ghost {
  background: transparent; color: var(--ghost);
  padding: 12px 28px; border-radius: 7px;
  font-weight: 500; font-size: 15px;
  border: 1px solid var(--slab);
  transition: all 0.15s; display: inline-block;
  text-decoration: none;
}
.btn-ghost:hover { background: var(--slab); color: var(--wraith); text-decoration: none; }

/* ── Sidebar layout (user-guide & install-guide) ──────────── */
.doc-layout {
  display: flex; max-width: 1200px;
  margin: 0 auto; padding: 32px 24px 80px;
  gap: 48px;
}
.doc-sidebar {
  width: 220px; flex-shrink: 0;
  padding: 0;
  position: sticky; top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
}
.doc-main { flex: 1; min-width: 0; }
.sidebar-section { margin-bottom: 24px; }
.sidebar-label {
  font-family: 'Space Mono', monospace;
  font-size: 9px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--mist);
  padding: 0 12px; margin-bottom: 6px;
}
.nav-link {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 6px;
  font-size: 13px; color: var(--ghost);
  text-decoration: none; cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.15s; margin-bottom: 2px;
}
.nav-link:hover { color: var(--wraith); background: rgba(200,255,0,0.05); text-decoration: none; }
.nav-link.active { color: var(--acid); border-left-color: var(--acid); background: rgba(200,255,0,0.05); }
.nav-icon { font-size: 14px; flex-shrink: 0; }
[data-theme="light"] .nav-link.active { color: var(--acid); }

/* ── Shared doc section styles ────────────────────────────── */
.section-eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 9px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--acid);
  font-weight: 700; margin-bottom: 6px;
}
.section-title {
  font-size: 26px; font-weight: 600;
  color: var(--wraith); margin-bottom: 8px; line-height: 1.2;
}
.section-desc { font-size: 14px; color: var(--ghost); margin-bottom: 28px; line-height: 1.6; }
.section-divider { height: 1px; background: var(--slab); margin-bottom: 28px; }

.guide-card {
  background: var(--crypt); border: 1px solid var(--slab);
  border-radius: 12px; padding: 24px; margin-bottom: 20px;
}
.guide-card-title {
  font-size: 15px; font-weight: 600; color: var(--wraith);
  margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.guide-card p { font-size: 14px; color: var(--ghost); margin-bottom: 8px; line-height: 1.6; }
.guide-card p:last-child { margin-bottom: 0; }

.steps { display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--slab); }
.step:last-child { border-bottom: none; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--acid); color: #050800;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Mono', monospace; font-size: 11px;
  font-weight: 600; flex-shrink: 0; margin-top: 2px;
}
[data-theme="light"] .step-num { color: #fff; }
.step-content { flex: 1; }
.step-title { font-size: 14px; font-weight: 600; color: var(--wraith); margin-bottom: 3px; }
.step-desc { font-size: 13px; color: var(--ghost); line-height: 1.5; }

.callout {
  border-radius: 8px; padding: 12px 16px;
  font-size: 13px; line-height: 1.6;
  margin: 12px 0; display: flex; gap: 10px;
}
.callout-icon { flex-shrink: 0; font-size: 15px; }
.callout.tip  { background: rgba(200,255,0,0.06); border: 1px solid rgba(200,255,0,0.2); color: var(--acid); }
.callout.note { background: rgba(79,142,247,0.08); border: 1px solid rgba(79,142,247,0.2); color: #4f8ef7; }
.callout.warn { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.2); color: #f59e0b; }
[data-theme="light"] .callout.tip { color: var(--acid); }

.guide-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 12px 0; background: var(--crypt); border: 1px solid var(--slab); border-radius: 8px; overflow: hidden; }
.guide-table th { background: var(--tomb); color: var(--mist); font-family: 'Space Mono', monospace; font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--slab); }
.guide-table td { padding: 10px 12px; border-bottom: 1px solid var(--slab); color: var(--ghost); vertical-align: top; }
.guide-table tr:last-child td { border-bottom: none; }
.guide-table tr:hover td { background: var(--tomb); }

.role-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; font-family: 'Space Mono', monospace; letter-spacing: 0.5px; text-transform: uppercase; }
.role-badge.admin { background: rgba(168,85,247,0.12); color: var(--venom); border: 1px solid rgba(168,85,247,0.25); }
.role-badge.tech  { background: rgba(79,142,247,0.12); color: #4f8ef7; border: 1px solid rgba(79,142,247,0.25); }
.role-badge.viewer{ background: rgba(34,197,94,0.1); color: #22c55e; border: 1px solid rgba(34,197,94,0.2); }
.role-badge.all   { background: rgba(200,255,0,0.08); color: var(--acid); border: 1px solid rgba(200,255,0,0.2); }

/* ── FAQ accordion ────────────────────────────────────────── */
.faq-item { border-bottom: 1px solid var(--slab); overflow: hidden; }
.faq-item:last-child { border-bottom: none; }
.faq-q { padding: 14px 0; font-size: 14px; font-weight: 600; color: var(--wraith); cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: color 0.15s; user-select: none; }
.faq-q:hover { color: var(--acid); }
.faq-arrow { color: var(--mist); font-size: 12px; transition: transform 0.2s; flex-shrink: 0; }
.faq-q.open .faq-arrow { transform: rotate(180deg); }
.faq-a { font-size: 13px; color: var(--ghost); line-height: 1.6; max-height: 0; overflow: hidden; transition: max-height 0.25s ease, padding 0.2s; }
.faq-a.open { max-height: 300px; padding-bottom: 14px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .site-nav { padding: 0 24px; }
}
@media (max-width: 768px) {
  .doc-sidebar { display: none; }
  .doc-layout { padding: 24px 16px 60px; }
}
@media (max-width: 640px) {
  .site-nav { padding: 0 16px; }
  .nav-text-link { display: none; }
  .nav-btn-ghost { display: none; }
  .site-footer { padding: 20px 16px; flex-direction: column; gap: 16px; }
  .footer-links { gap: 16px; }
}
@media (max-width: 420px) {
  body { font-size: 14px; }
}

/* ── Theme toggle JS helper (applied via JS) ──────────────── */
