/* FSW Exhibitor Portal — theme + shell. Dark is default; light overrides tokens
   under :root[data-theme="light"]. NO BORDER LINES — separation comes from
   background elevation + soft shadows + spacing (house rule: no border-dividers). */

:root, :root[data-theme="dark"] {
  --bg: #0a1626;
  --sidebar: #0c1b30;
  --panel: #12243e;
  --panel-2: #1a2f4d;
  --text: #e7edf5;
  --muted: #8ea1b6;
  --faint: #62768d;
  --accent: #f5a623;
  --accent-soft: rgba(245, 166, 35, 0.14);
  --link: #5b9bff;
  --btn: #f4f7fb;
  --btn-text: #0b1a2e;
  --active-bg: #f4f7fb;
  --active-text: #0b1a2e;
  --hover: rgba(255, 255, 255, 0.06);
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.24);
  --shadow-sm: 0 1px 5px rgba(0, 0, 0, 0.16);
}

:root[data-theme="light"] {
  --bg: #f4f7fb;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --panel-2: #eef2f7;
  --text: #0f2036;
  --muted: #5a6b7f;
  --faint: #8a9bb0;
  --accent: #d98510;
  --accent-soft: rgba(217, 133, 16, 0.12);
  --link: #2563eb;
  --btn: #0f2036;
  --btn-text: #ffffff;
  --active-bg: #0f2036;
  --active-text: #ffffff;
  --hover: rgba(15, 32, 54, 0.05);
  --shadow: 0 2px 10px rgba(15, 32, 54, 0.08);
  --shadow-sm: 0 1px 5px rgba(15, 32, 54, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ── layout ── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: 0 0 248px; background: var(--sidebar); position: fixed; inset: 0 auto 0 0;
  height: 100vh; display: flex; flex-direction: column; padding: 20px 14px;
  box-shadow: 3px 0 14px rgba(0, 0, 0, 0.16);
}
.main { margin-left: 248px; flex: 1; min-width: 0; }

/* ── brand / logo ── */
.brand { padding: 4px 8px 20px; }
.brand-logo-img { height: 26px; width: auto; display: block; }
.logo-light { display: none; }
:root[data-theme="light"] .logo-dark { display: none; }
:root[data-theme="light"] .logo-light { display: block; }
.brand-sub { color: var(--faint); font-size: 12px; margin-top: 8px; }

/* ── nav ── */
.nav-group { margin-top: 16px; }
.nav-label { color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: 0.7px;
  text-transform: uppercase; padding: 0 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px;
  color: var(--muted); font-weight: 500; margin-bottom: 2px; transition: background 0.12s, color 0.12s;
}
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; stroke-width: 1.9; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.is-active { background: var(--active-bg); color: var(--active-text); font-weight: 600; }

/* ── user chip ── */
.sidebar-foot { margin-top: auto; padding-top: 14px; }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 9px; border-radius: 12px; background: var(--panel);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px; display: grid; place-items: center;
  background: var(--panel-2); color: var(--text); font-weight: 700; font-size: 12px;
}
.user-name { font-weight: 600; font-size: 13px; }
.user-role { color: var(--faint); font-size: 12px; }
.chip-chev { margin-left: auto; color: var(--faint); }
.chip-logout { margin-left: auto; }
.chip-logout .icon-btn { width: 30px; height: 30px; }

/* ── topbar ── */
.topbar {
  height: 64px; display: flex; align-items: center; gap: 20px; padding: 0 32px;
  position: sticky; top: 0; z-index: 5; box-shadow: var(--shadow-sm);
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px);
}
.topbar-title { font-weight: 700; font-size: 15px; line-height: 1.1; }
.topbar-date { color: var(--faint); font-size: 12px; }
.searchbox { flex: 1; max-width: 520px; margin: 0 auto; position: relative; }
.searchbox input {
  width: 100%; height: 40px; border-radius: 10px; border: 0; background: var(--panel-2);
  color: var(--text); padding: 0 14px 0 38px; font-size: 13px;
}
.searchbox input::placeholder { color: var(--faint); }
.searchbox input:focus { outline: 2px solid var(--accent-soft); }
.searchbox svg { position: absolute; left: 12px; top: 11px; width: 17px; height: 17px; color: var(--faint); }
.topbar-right { display: flex; align-items: center; gap: 14px; color: var(--muted); }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  color: var(--muted); border: 0; cursor: pointer; background: transparent; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.help-link { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.nav-toggle { display: none; margin-right: 4px; }        /* mobile only (see media query) */
.sidebar-backdrop { display: none; }

/* ── content ── */
.content { padding: 28px 32px 60px; max-width: 1400px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
/* DE-6: .page-head had no bottom margin, so it sat flush against whatever
   follows on every page that opens with one (confirmed live on hotel.html:
   0px gap to the first .card). Portal-wide (10 templates), not something
   HO-4/HO-6 introduced -- pre-existing since page-head was added, just never
   caught until this pass measured it. Safe as a single class fix: margins
   between normal sibling blocks COLLAPSE (take the larger), not sum, so this
   cannot double up with a following element's own top margin (e.g.
   dashboard/home.html's .stat-grid, which already carries margin:24px 0 --
   collapses to max(16,24)=24px there, unchanged; becomes max(16,0)=16px
   everywhere else, fixing the flush gap). Matches the portal's existing
   hardcoded-px convention (portal has no --sp-* token ladder -- DD-1's scale
   is admin-only, see theming.md). */
.page-head { margin-bottom: 16px; }
h1.welcome { font-size: 26px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.4px; }
.subline { color: var(--muted); font-size: 14px; }
.subline strong { color: var(--text); }

/* ── buttons ── */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px;
  border-radius: 9px; font-weight: 600; font-size: 13px; cursor: pointer; border: 0; }
.btn-white { background: var(--btn); color: var(--btn-text); }
.btn-white:hover { filter: brightness(0.94); }
.btn-ghost { background: var(--panel-2); color: var(--text); }
.btn-ghost:hover { filter: brightness(1.08); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }

/* ── stat tiles ── */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 24px 0; }
.tile { background: var(--panel); border-radius: 14px; padding: 18px 18px 20px; min-height: 132px; box-shadow: var(--shadow); }
.tile-kicker { color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }
.tile-big { font-size: 30px; font-weight: 700; margin: 14px 0 4px; }
.tile-big.dash { color: var(--faint); }
.tile-sub { color: var(--muted); font-size: 13px; }
.tile-link { color: var(--link); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; }

/* ── two-column ── */
.cols { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; align-items: start; }
.card { background: var(--panel); border-radius: 14px; padding: 20px 22px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.card-title { font-size: 16px; font-weight: 700; }
.card-note { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.card-count { color: var(--faint); font-size: 13px; font-weight: 600; }

/* ── setup checklist (no dividers — spacing only) ── */
.check-row { display: flex; align-items: flex-start; gap: 13px; padding: 11px 0; color: inherit; }
a.check-row:hover .check-title { color: var(--link); }
.check-circle { width: 18px; height: 18px; border-radius: 50%; background: var(--panel-2); flex: 0 0 18px; margin-top: 1px;
  display: grid; place-items: center; }
.check-circle.is-done { background: rgba(70, 167, 88, 0.2); color: #6fcf82; }
.check-circle.is-done svg { width: 11px; height: 11px; }
:root[data-theme="light"] .check-circle.is-done { color: #1e7d32; }

/* ── staff preview bar (EX-2) — obvious accent bar, never mistaken for real ── */
.preview-bar {
  display: flex; align-items: center; gap: 10px; padding: 9px 32px; font-size: 13px; font-weight: 600;
  background: var(--accent); color: #0b1a2e; position: sticky; top: 0; z-index: 20;
}
.preview-bar svg { flex: 0 0 16px; }
.preview-bar span { flex: 1; }
.preview-bar strong { font-weight: 800; }
.preview-exit {
  background: rgba(11, 26, 46, 0.16); color: #0b1a2e; font-weight: 700; padding: 4px 12px; border-radius: 8px;
}
.preview-exit:hover { background: rgba(11, 26, 46, 0.28); }

/* ── flash messages ── */
.flash-stack { margin-bottom: 18px; }
.flash { border-radius: 10px; padding: 11px 14px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-sm); }
.flash + .flash { margin-top: 8px; }
.flash-ok { background: rgba(70, 167, 88, 0.14); color: #6fcf82; }
.flash-error { background: rgba(229, 72, 77, 0.12); color: #ff8f93; }
.flash-info { background: var(--panel); color: var(--text); }
:root[data-theme="light"] .flash-ok { color: #1e7d32; }
:root[data-theme="light"] .flash-error { color: #b3261e; }
.check-body { flex: 1; min-width: 0; }
.check-title { font-weight: 600; font-size: 14px; }
.check-desc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.due-badge { color: var(--accent); background: var(--accent-soft); font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 8px; white-space: nowrap; }

/* ── empty states ── */
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty-icon { width: 34px; height: 34px; color: var(--faint); margin: 0 auto 12px; display: block; }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; }
.link { color: var(--link); font-weight: 600; }

.stack > * + * { margin-top: 16px; }

/* ── stub page ── */
.stub-wrap { display: grid; place-items: center; min-height: 50vh; text-align: center; }
.stub-badge { color: var(--accent); background: var(--accent-soft); font-size: 12px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; padding: 5px 12px; border-radius: 8px; }
.stub-wrap h1 { font-size: 24px; margin: 16px 0 6px; }
.stub-wrap p { color: var(--muted); max-width: 440px; }

@media (max-width: 1000px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .cols { grid-template-columns: 1fr; }
}

/* ── mobile: sidebar becomes an off-canvas drawer ── */
@media (max-width: 820px) {
  .nav-toggle { display: grid; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 40; box-shadow: 3px 0 24px rgba(0, 0, 0, 0.4);
  }
  .app.nav-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 30;
    background: rgba(0, 0, 0, 0.5);
  }
  .main { margin-left: 0; }
  .topbar { padding: 0 16px; gap: 12px; }
  .searchbox { display: none; }          /* search is desktop-only for now */
  .help-link { display: none; }
  .content { padding: 20px 16px 48px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .preview-bar { padding: 9px 16px; }
  /* wide tables scroll inside their card instead of pushing the page */
  .card { overflow-x: auto; }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  h1.welcome { font-size: 22px; }
  .topbar-date { display: none; }
}

/* ── auth (standalone card, no shell) ── */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; }
.auth-wrap { width: 100%; max-width: 420px; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand .brand-logo-img { height: 30px; margin: 0 auto; }
.auth-brand-sub { color: var(--faint); font-size: 12px; margin-top: 8px; }
.auth-card { background: var(--panel); border-radius: 16px; padding: 28px 28px 26px; box-shadow: var(--shadow); }
.auth-title { font-size: 21px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.3px; }
.auth-sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.auth-links { margin-top: 16px; font-size: 13px; text-align: center; }
.auth-foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 18px; }

/* ── honeypot (bot trap) — kept out of view + off the a11y tree ── */
.hp-wrap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── forms ── */
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 0; border-radius: 10px; background: var(--panel-2); color: var(--text);
  height: 40px; padding: 0 13px; font-size: 13px; font-family: inherit;
}
.field textarea { height: auto; min-height: 88px; padding: 11px 13px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent-soft); }
.field-error { display: block; color: #e5484d; font-size: 12px; margin-top: 5px; }
.form-error { background: rgba(229, 72, 77, 0.12); color: #ff8f93; border-radius: 10px;
  padding: 10px 13px; font-size: 13px; margin-bottom: 14px; }
:root[data-theme="light"] .form-error { color: #b3261e; }
.form-ok { background: rgba(70, 167, 88, 0.14); color: #6fcf82; border-radius: 10px;
  padding: 10px 13px; font-size: 13px; margin-bottom: 14px; }
:root[data-theme="light"] .form-ok { color: #1e7d32; }
.btn-primary { background: var(--btn); color: var(--btn-text); }
.btn-primary:hover { filter: brightness(0.94); }
.btn-danger { background: #c53030; color: #fff; }
.btn-danger:hover { filter: brightness(0.90); }
.btn-block { width: 100%; justify-content: center; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }

/* ── tables (borderless: row separation via spacing + zebra elevation) ── */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th { text-align: left; color: var(--faint); font-size: 11px; font-weight: 700;
  letter-spacing: 0.6px; text-transform: uppercase; padding: 8px 12px; }
.tbl td { padding: 12px; vertical-align: middle; }
.tbl tbody tr { background: transparent; }
.tbl tbody tr:nth-child(odd) td { background: var(--panel-2); }
.tbl tbody tr td:first-child { border-radius: 10px 0 0 10px; }
.tbl tbody tr td:last-child { border-radius: 0 10px 10px 0; }

/* ── status badges ── */
.badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 8px; white-space: nowrap; }
.badge-ok { color: #6fcf82; background: rgba(70, 167, 88, 0.14); }
.badge-warn { color: var(--accent); background: var(--accent-soft); }
.badge-muted { color: var(--muted); background: var(--panel-2); }
.badge-bad { color: #ff8f93; background: rgba(229, 72, 77, 0.12); }
:root[data-theme="light"] .badge-ok { color: #1e7d32; }
:root[data-theme="light"] .badge-bad { color: #b3261e; }

/* ── Themed dialog + toast (mirrors admin app-shell / fsw.css) ──────────────
   Replaces native confirm/alert/prompt. Theme-aware via portal tokens; no
   borders (elevation by shadow); reduced-motion collapses the entrance. */
.fsw-modal-overlay { position: fixed; inset: 0; background: rgba(4, 10, 20, 0.55);
  display: grid; place-items: center; z-index: 12000; padding: 20px; animation: fsw-fade-in 0.16s ease-out; }
.fsw-modal { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); padding: 24px;
  max-width: 380px; width: 100%; animation: fsw-modal-in 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
.fsw-modal__title { margin: 0 0 8px; font-size: 17px; font-weight: 700; color: var(--text); }
.fsw-modal__msg { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.fsw-modal__label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.fsw-modal__btns { display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fsw-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fsw-modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.btn:focus-visible, .nav-item:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.fsw-toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 13000;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.fsw-toast { pointer-events: auto; max-width: 90vw; padding: 11px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: #fff; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(10px); transition: opacity 0.22s ease-out, transform 0.22s ease-out; }
.fsw-toast.show { opacity: 1; transform: none; }
.fsw-toast--success { background: #177a45; }
.fsw-toast--error { background: #a12d2d; }
.fsw-toast--info { background: var(--panel-2); color: var(--text); }
@media (prefers-reduced-motion: reduce) {
  .fsw-modal-overlay, .fsw-modal { animation: none; }
  .fsw-toast { transition: none; }
}
