:root {
  /* brand */
  --teal-900: #0a3a3f;
  --teal-800: #0c4e54;
  --teal-700: #0e4a4f;
  --teal-600: #136067;
  --teal-500: #1a7e86;
  --gold: #d19900;
  --gold-soft: #e6b73d;

  /* light theme surfaces */
  --bg: #f4f6f6;
  --surface: #ffffff;
  --surface-2: #eef2f2;
  --border: rgba(12, 78, 84, 0.12);
  --border-strong: rgba(12, 78, 84, 0.22);
  --text: #14282b;
  --text-soft: #4a5f62;
  --text-faint: #7e9094;
  --accent: var(--teal-700);
  --accent-ink: #ffffff;
  --shadow-sm: 0 1px 2px rgba(10,58,63,.06), 0 1px 3px rgba(10,58,63,.08);
  --shadow-md: 0 4px 12px rgba(10,58,63,.08), 0 2px 4px rgba(10,58,63,.06);
  --shadow-lg: 0 18px 40px rgba(10,58,63,.16);

  /* type */
  --font-display: 'Frank Ruhl Libre', 'Georgia', serif;
  --font-body: 'Heebo', system-ui, sans-serif;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px;
  --side-w: 268px;
}

[data-theme="dark"] {
  --bg: #0a2125;
  --surface: #0f2e33;
  --surface-2: #103a40;
  --border: rgba(255,255,255,0.09);
  --border-strong: rgba(255,255,255,0.16);
  --text: #eef5f5;
  --text-soft: #aec5c8;
  --text-faint: #7f999d;
  --accent: var(--gold);
  --accent-ink: #14282b;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 6px 18px rgba(0,0,0,.35);
  --shadow-lg: 0 20px 44px rgba(0,0,0,.5);
}

html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

.skip-link { position: absolute; right: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--r-sm); z-index: 100; }
.skip-link:focus { right: 8px; }

/* ===== Sidebar ===== */
.sidebar {
  width: var(--side-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--teal-800), var(--teal-900));
  color: #dfeeef;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-logo { color: var(--gold-soft); flex-shrink: 0; }
.brand-text strong { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; display: block; color: #fff; line-height: 1.1; }
.brand-text small { color: #9ec2c4; font-size: .74rem; }

.nav { flex: 1; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: right;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: #cfe2e3; font-size: .88rem; font-weight: 500;
  transition: background .16s ease, color .16s ease;
  line-height: 1.25;
}
.nav button .nav-ico { font-size: 1rem; width: 22px; text-align: center; flex-shrink: 0; }
.nav button:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav button.active { background: var(--gold); color: #14282b; font-weight: 600; }
.nav button.active .nav-ico { filter: none; }

.sidebar-foot { padding: 14px 18px 18px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 8px; }
.ghub-link { display: inline-flex; align-items: center; gap: 6px; color: #bfe0e2; font-size: .82rem; font-weight: 600; }
.ghub-link:hover { color: var(--gold-soft); }
.sidebar-foot small { color: #7fa3a5; font-size: .7rem; }

/* ===== Shell / main ===== */
.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.menu-btn { display: none; color: var(--text); padding: 6px; border-radius: var(--r-sm); }
.page-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; flex: 1; min-width: 0; line-height: 1.2; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.search-wrap[hidden] { display: none !important; }
.search-wrap { display: flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; padding: 7px 14px; color: var(--text-faint); box-shadow: var(--shadow-sm); }
.search-wrap input { border: none; background: none; width: 230px; font-size: .86rem; color: var(--text); }
.search-wrap input::placeholder { color: var(--text-faint); }

.theme-btn { color: var(--text-soft); padding: 8px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); }
.theme-btn:hover { color: var(--accent); }
.ico-moon { display: none; }
[data-theme="dark"] .ico-sun { display: none; }
[data-theme="dark"] .ico-moon { display: block; }

.main { flex: 1; padding: 0 0 60px; overflow-x: hidden; }
#view { max-width: 1180px; margin: 0 auto; padding: 26px 30px 0; }

/* ===== View hero banner ===== */
.view-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(125deg, var(--teal-800) 0%, var(--teal-700) 48%, var(--teal-600) 100%);
  color: #eaf6f6; border-radius: var(--r-lg);
  padding: 30px 32px; margin-bottom: 26px;
  box-shadow: var(--shadow-md);
}
.view-hero::before {
  content: ""; position: absolute; inset-block: -40%; inset-inline-end: -10%;
  width: 360px; background:
    radial-gradient(circle at 70% 30%, rgba(209,153,0,.32), transparent 60%),
    radial-gradient(circle at 30% 80%, rgba(26,126,134,.4), transparent 55%);
  filter: blur(6px); pointer-events: none;
}
.view-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 22px 22px;
}
.view-hero .vh-eyebrow { position: relative; z-index: 1; font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-soft); font-weight: 700; margin-bottom: 8px; }
.view-hero h2 { position: relative; z-index: 1; font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.05rem); font-weight: 800; line-height: 1.12; }
.view-hero p { position: relative; z-index: 1; color: #bfdedf; font-size: .98rem; margin-top: 10px; max-width: 72ch; line-height: 1.6; }
.view-hero .vh-chip { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); font-size: .8rem; color: #eaf6f6; font-weight: 600; }
.view-hero .vh-chip b { color: var(--gold-soft); }

/* entrance animation */
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.anim > * { animation: riseIn .5s cubic-bezier(.22,.61,.36,1) backwards; }
.anim > *:nth-child(1) { animation-delay: .02s; }
.anim > *:nth-child(2) { animation-delay: .07s; }
.anim > *:nth-child(3) { animation-delay: .12s; }
.anim > *:nth-child(4) { animation-delay: .17s; }
.anim > *:nth-child(5) { animation-delay: .22s; }
.anim > *:nth-child(n+6) { animation-delay: .27s; }

/* ===== Content blocks ===== */
.lead { color: var(--text-soft); font-size: 1rem; max-width: 78ch; margin-bottom: 22px; line-height: 1.65; }
.note { background: var(--surface); border-right: 4px solid var(--gold); border-radius: var(--r-md); padding: 14px 18px; color: var(--text-soft); font-size: .92rem; margin: 0 0 22px; box-shadow: var(--shadow-sm); }
.section-h { font-family: var(--font-display); font-size: 1.22rem; font-weight: 700; color: var(--text); margin: 34px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--border-strong); }
.section-h:first-child { margin-top: 4px; }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 26px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px 20px 16px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.kpi::after { content:""; position:absolute; inset-block:0; inset-inline-start:0; width:4px; background: linear-gradient(var(--gold), var(--gold-soft)); }
.kpi .k-ico { font-size: 1.15rem; margin-bottom: 6px; opacity: .9; }
.kpi .k-val { font-family: var(--font-display); font-size: 1.85rem; font-weight: 800; color: var(--accent); line-height: 1.05; font-variant-numeric: tabular-nums; }
[data-theme="dark"] .kpi .k-val { color: var(--gold-soft); }
.kpi .k-label { color: var(--text-soft); font-size: .82rem; margin-top: 5px; }

/* tables */
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; margin: 0 0 26px; transition: box-shadow .2s ease; }
.table-card:hover { box-shadow: var(--shadow-md); }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .87rem; }
thead th {
  background: var(--teal-700); color: #fff; font-weight: 600;
  text-align: right; padding: 11px 14px; white-space: nowrap; position: sticky; top: 0; z-index: 1;
  font-size: .82rem;
}
[data-theme="dark"] thead th { background: var(--teal-600); }
tbody td { padding: 9px 14px; border-top: 1px solid var(--border); color: var(--text); vertical-align: top; }
tbody td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
tbody tr:hover td { background: color-mix(in srgb, var(--gold) 8%, transparent); }
tbody td a { color: var(--teal-500); font-weight: 600; }
[data-theme="dark"] tbody td a { color: var(--gold-soft); }
.row-emph td { font-weight: 700; background: color-mix(in srgb, var(--teal-700) 9%, transparent) !important; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; line-height: 1.5; }
.b-high { background: rgba(209,153,0,.18); color: #8a6500; }
.b-mid { background: rgba(19,96,103,.16); color: var(--teal-600); }
.b-low { background: rgba(126,144,148,.18); color: var(--text-soft); }
[data-theme="dark"] .b-high { color: var(--gold-soft); }
[data-theme="dark"] .b-mid { color: #8fd6dd; }

.table-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); color: var(--text-faint); font-size: .82rem; }

/* filter chips (venues) */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { padding: 6px 13px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-soft); font-size: .82rem; font-weight: 500; transition: all .15s ease; }
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.empty { text-align: center; color: var(--text-faint); padding: 40px 20px; font-size: .95rem; }

/* slides viewer */
.slides-intro { color: var(--text-soft); margin-bottom: 20px; }
.slides-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.slide-thumb { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.slide-thumb:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.slide-thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--surface-2); }
.slide-thumb .st-cap { padding: 8px 12px; font-size: .78rem; color: var(--text-soft); display: flex; justify-content: space-between; }
.slide-thumb .st-cap b { color: var(--accent); }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(8,28,31,.92); display: none; align-items: center; justify-content: center; flex-direction: column; padding: 20px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 94vw; max-height: 82vh; border-radius: var(--r-sm); box-shadow: var(--shadow-lg); }
.lb-bar { display: flex; align-items: center; gap: 18px; margin-top: 16px; color: #dfeeef; }
.lb-bar button { color: #fff; background: rgba(255,255,255,.12); width: 46px; height: 46px; border-radius: 50%; font-size: 1.4rem; display: grid; place-items: center; }
.lb-bar button:hover { background: var(--gold); color: #14282b; }
.lb-count { font-variant-numeric: tabular-nums; font-size: .92rem; }
.lb-close { position: absolute; top: 18px; left: 18px; color: #fff; background: rgba(255,255,255,.12); width: 44px; height: 44px; border-radius: 50%; font-size: 1.5rem; display: grid; place-items: center; }
.lb-close:hover { background: var(--gold); color: #14282b; }

/* sources list */
.src-list a { color: var(--teal-500); word-break: break-all; }
[data-theme="dark"] .src-list a { color: var(--gold-soft); }

/* ===== responsive ===== */
@media (max-width: 920px) {
  .sidebar { position: fixed; inset-inline-start: 0; transform: translateX(105%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  [dir="rtl"] .sidebar { transform: translateX(105%); }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: inline-flex; }
  .scrim { position: fixed; inset: 0; background: rgba(8,28,31,.5); z-index: 35; }
  .main { padding: 20px 16px 50px; }
  .search-wrap input { width: 130px; }
  .page-title { font-size: 1.08rem; }
}
@media (max-width: 540px) {
  .search-wrap { display: none; }
  .kpi .k-val { font-size: 1.4rem; }
}
