/* ============================================================
   DASH-DGE Design System
   Dynamic Global Events | Built by TeamISR
   ============================================================ */

:root {
  --navy:        #0D1B2A;
  --navy-card:   #112233;
  --navy-dark:   #0a1520;
  --gold:        #C9962C;
  --gold-light:  #E8B84B;
  --maroon:      #8B1A2B;
  --white:       #FFFFFF;
  --grey:        #A8B4C0;
  --grey-dim:    rgba(168,180,192,0.5);
  --border:      rgba(255,255,255,0.06);
  --border-hover:rgba(255,255,255,0.12);
  --surface:     rgba(255,255,255,0.03);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  background: var(--navy);
  color: var(--white);
  font-family: 'Inter', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--navy); }
::-webkit-scrollbar-thumb { background: #1e3a5f; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ── Layout ────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar widths ─────────────────────────────────────── */
:root {
  --sidebar-w: 236px;
  --sidebar-collapsed-w: 56px;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--navy-dark);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow: hidden;
  transition: width 0.22s cubic-bezier(0.4,0,0.2,1), transform 0.22s cubic-bezier(0.4,0,0.2,1);
}

/* Desktop collapsed */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-w);
}

/* Mobile: off-screen by default */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
}

/* Overlay behind sidebar on mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 199;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.22s cubic-bezier(0.4,0,0.2,1);
}
.sidebar.collapsed ~ .main-area,
body.sidebar-collapsed .main-area {
  margin-left: var(--sidebar-collapsed-w);
}
@media (max-width: 768px) {
  .main-area { margin-left: 0 !important; }
}

.topbar {
  height: 54px;
  background: var(--navy-dark);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-content {
  flex: 1;
  padding: 1.75rem;
  max-width: 1400px;
}

/* ── Sidebar Logo ──────────────────────────────────────── */
.sidebar-logo {
  padding: 1.1rem 0.875rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  min-height: 54px; /* match topbar height */
}
.logo-wordmark {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
}
.logo-text-wrap { overflow: hidden; transition: opacity 0.15s, width 0.22s; }
.logo-dash {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
}
.logo-rule {
  width: 1px;
  height: 20px;
  background: var(--maroon);
  flex-shrink: 0;
}
.logo-dge {
  font-size: 1.3rem;
  font-weight: 700;
  font-style: italic;
  color: var(--gold);
}
.logo-sub {
  font-size: 8px;
  color: var(--grey);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
/* Collapse toggle button inside logo area */
.sidebar-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--grey);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.07); color: var(--white); }

/* Collapsed: hide logo text */
.sidebar.collapsed .logo-text-wrap { opacity: 0; width: 0; pointer-events: none; }
.sidebar.collapsed .logo-rule { display: none; }

/* ── Sidebar Nav ───────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.55rem 0.625rem;
  border-radius: 8px;
  color: var(--grey);
  text-decoration: none;
  font-size: 0.825rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}
.nav-link:hover { background: rgba(255,255,255,0.05); color: var(--white); }
.nav-link.active { background: rgba(201,150,44,0.1); color: var(--gold); }
.nav-link svg { flex-shrink: 0; width: 15px; height: 15px; }

.nav-label {
  flex: 1;
  transition: opacity 0.15s;
  overflow: hidden;
}
.nav-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  color: var(--grey);
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.nav-link.active .nav-tag { background: rgba(201,150,44,0.15); color: var(--gold); }

/* Collapsed: hide labels + tags, centre icons */
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-tag { opacity: 0; width: 0; padding: 0; overflow: hidden; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 0.55rem; }

/* Tooltip on collapsed hover */
.sidebar.collapsed .nav-link::after {
  content: attr(data-label);
  position: absolute;
  left: calc(var(--sidebar-collapsed-w) + 8px);
  top: 50%; transform: translateY(-50%);
  background: #1a2f45;
  border: 1px solid var(--border);
  color: var(--white);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 300;
}
.sidebar.collapsed .nav-link:hover::after { opacity: 1; }

/* ── Sidebar User ──────────────────────────────────────── */
.sidebar-user {
  padding: 0.75rem 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-user-info { transition: opacity 0.15s, width 0.22s; overflow: hidden; white-space: nowrap; }
.sidebar.collapsed .sidebar-user { justify-content: center; }
.sidebar.collapsed .sidebar-user-info { opacity: 0; width: 0; pointer-events: none; }
.sidebar.collapsed .sidebar-user .role-badge { display: none; }
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(201,150,44,0.15);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-name { font-size: 12px; font-weight: 600; color: var(--white); }
.user-role { font-size: 10px; color: var(--grey); text-transform: capitalize; }
.role-badge {
  margin-left: auto;
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(201,150,44,0.15);
  color: var(--gold);
}

/* ── Topbar ────────────────────────────────────────────── */
.event-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--navy-card);
  border: 1px solid var(--border-hover);
  border-radius: 8px;
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
  color: var(--white);
  cursor: pointer;
  transition: border-color 0.15s;
  max-width: 300px;
}
.event-selector:hover { border-color: rgba(201,150,44,0.3); }
.event-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
.event-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar-spacer { flex: 1; }

.btn-ai {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(201,150,44,0.1);
  border: 1px solid rgba(201,150,44,0.25);
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold);
  cursor: pointer;
  transition: background 0.15s;
}
.btn-ai:hover { background: rgba(201,150,44,0.18); }
.btn-ai svg { width: 13px; height: 13px; }

.icon-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--grey);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.icon-btn:hover { background: rgba(255,255,255,0.05); color: var(--white); }
.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--maroon);
}

.topbar-user {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
}
.topbar-user:hover { background: rgba(255,255,255,0.05); }
.topbar-user-name { font-size: 0.8rem; }
.topbar-user .role-badge { margin-left: 0; }

/* ── Typography ────────────────────────────────────────── */
.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 2px;
}
.page-sub {
  font-size: 0.8rem;
  color: var(--grey);
}
.section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 2px;
}
.section-sub { font-size: 0.75rem; color: var(--grey); }

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.card-pad { padding: 1.25rem; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

/* ── Grid helpers ──────────────────────────────────────── */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 700px)  { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.flex-1 { flex: 1; min-width: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.space-y > * + * { margin-top: 0.75rem; }
.space-y-sm > * + * { margin-top: 0.4rem; }

/* ── Stat card ─────────────────────────────────────────── */
.stat-card {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.stat-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 17px; height: 17px; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--white); line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--grey); }
.stat-trend { font-size: 0.7rem; display: flex; align-items: center; gap: 4px; }
.trend-up   { color: #4ade80; }
.trend-down { color: #f87171; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.45rem 0.875rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.btn-primary { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: var(--gold-light); }
.btn-secondary { background: rgba(255,255,255,0.06); color: var(--white); border: 1px solid var(--border-hover); }
.btn-secondary:hover { background: rgba(255,255,255,0.1); }
.btn-danger { background: rgba(139,26,43,0.7); color: var(--white); }
.btn-danger:hover { background: var(--maroon); }
.btn-ghost { background: transparent; color: var(--grey); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--white); border-color: var(--border-hover); }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.73rem; }

/* ── Inputs ─────────────────────────────────────────────── */
.input {
  width: 100%;
  background: var(--navy);
  border: 1px solid var(--border-hover);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: var(--white);
  font-size: 0.8rem;
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}
.input::placeholder { color: var(--grey); }
.input:focus { border-color: rgba(201,150,44,0.5); }
textarea.input { resize: vertical; min-height: 90px; }

.input-wrap { position: relative; }
.input-icon {
  position: absolute;
  left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--grey);
  pointer-events: none;
}
.input-icon svg { width: 13px; height: 13px; }
.input-wrap .input { padding-left: 30px; }

.form-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
}
.badge-gold    { background: rgba(201,150,44,0.15); color: var(--gold); }
.badge-green   { background: rgba(74,222,128,0.12); color: #4ade80; }
.badge-blue    { background: rgba(96,165,250,0.12); color: #60a5fa; }
.badge-purple  { background: rgba(167,139,250,0.12); color: #a78bfa; }
.badge-red     { background: rgba(139,26,43,0.2);  color: #f87171; }
.badge-grey    { background: rgba(255,255,255,0.07); color: var(--grey); }
.badge-sky     { background: rgba(56,189,248,0.12); color: #38bdf8; }
.badge-pink    { background: rgba(244,114,182,0.12); color: #f472b6; }
.badge-teal    { background: rgba(45,212,191,0.12); color: #2dd4bf; }
.module-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
}

/* ── Tables ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
th {
  text-align: left;
  padding: 0.65rem 1rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--grey);
}
td.text-white { color: var(--white); }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: rgba(255,255,255,0.03); cursor: pointer; }
tbody tr.selected { background: rgba(201,150,44,0.05); }

/* ── Tabs ───────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--navy-card);
  padding: 4px;
  border-radius: 10px;
  width: fit-content;
}
.tab-btn {
  padding: 0.35rem 1rem;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--grey);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: capitalize;
}
.tab-btn.active { background: var(--gold); color: var(--navy); font-weight: 600; }
.tab-btn:not(.active):hover { color: var(--white); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Pipeline strip ─────────────────────────────────────── */
.pipeline-strip {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 4px;
}
.pipeline-card {
  flex: 1;
  min-width: 110px;
  background: var(--navy);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.pipeline-card:hover, .pipeline-card.active { border-color: rgba(201,150,44,0.4); }
.pipeline-label { font-size: 0.7rem; color: var(--grey); margin-bottom: 4px; }
.pipeline-count { font-size: 1.6rem; font-weight: 700; color: var(--white); }
.pipeline-bar { height: 3px; background: rgba(255,255,255,0.06); border-radius: 2px; margin-top: 8px; }
.pipeline-fill { height: 3px; background: var(--gold); border-radius: 2px; }

/* ── AI panel ───────────────────────────────────────────── */
.ai-panel {
  border: 1px solid rgba(201,150,44,0.2);
  border-radius: 12px;
  padding: 1.25rem;
  background: rgba(201,150,44,0.03);
}
.ai-panel-header {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 1rem;
}
.ai-panel-header svg { width: 14px; height: 14px; color: var(--gold); }
.ai-result {
  background: var(--navy);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.875rem;
  font-size: 0.78rem;
  color: var(--grey);
  line-height: 1.65;
  white-space: pre-wrap;
  margin-top: 0.75rem;
}

/* ── Insight card ───────────────────────────────────────── */
.insight-card {
  background: var(--navy);
  border: 1px solid rgba(201,150,44,0.12);
  border-radius: 10px;
  padding: 1rem;
}
.insight-bar { width: 3px; height: 18px; background: var(--gold); border-radius: 2px; flex-shrink: 0; margin-top: 1px; }

/* ── Alert banner ───────────────────────────────────────── */
.alert {
  border-radius: 10px;
  padding: 0.875rem 1.1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
}
.alert-warning { background: rgba(139,26,43,0.08); border: 1px solid rgba(139,26,43,0.25); }
.alert svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; color: var(--maroon); }

/* ── Detail panel ───────────────────────────────────────── */
.detail-panel {
  width: 260px;
  flex-shrink: 0;
  align-self: flex-start;
  position: sticky;
  top: 70px;
}

/* ── Calendar grid ──────────────────────────────────────── */
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); }
.cal-day-header {
  padding: 0.4rem;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}
.cal-cell {
  min-height: 88px;
  padding: 0.375rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-date {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--grey);
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  margin-bottom: 3px;
}
.cal-date.today { background: var(--gold); color: var(--navy); font-weight: 700; }
.cal-event {
  font-size: 0.62rem;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 3px;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-width: 1px;
  border-style: solid;
}

/* ── Score bar ──────────────────────────────────────────── */
.score-bar-wrap { background: rgba(255,255,255,0.06); border-radius: 3px; height: 5px; }
.score-bar-fill { height: 5px; border-radius: 3px; background: var(--gold); }

/* ── Progress bar ───────────────────────────────────────── */
.progress-wrap { background: rgba(255,255,255,0.06); border-radius: 3px; height: 6px; }
.progress-fill { height: 6px; border-radius: 3px; background: var(--gold); }

/* ── Divider ─────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

/* ── Link ───────────────────────────────────────────────── */
a.link-gold { color: var(--gold); text-decoration: none; font-size: 0.75rem; display: inline-flex; align-items: center; gap: 4px; }
a.link-gold:hover { text-decoration: underline; }

/* ── Post card ──────────────────────────────────────────── */
.post-card { border-radius: 10px; padding: 1rem; background: var(--navy-card); border: 1px solid var(--border); }

/* ── Utilities ──────────────────────────────────────────── */
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-gold   { color: var(--gold); }
.text-grey   { color: var(--grey); }
.text-white  { color: var(--white); }
.text-green  { color: #4ade80; }
.text-red    { color: #f87171; }
.text-blue   { color: #60a5fa; }
.text-purple { color: #a78bfa; }
.text-sky    { color: #38bdf8; }
.text-pink   { color: #f472b6; }
.text-sm  { font-size: 0.8rem; }
.text-xs  { font-size: 0.72rem; }
.text-xxs { font-size: 0.65rem; }
.font-bold   { font-weight: 700; }
.font-medium { font-weight: 500; }
.font-semi   { font-weight: 600; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.rounded { border-radius: 8px; }
.overflow-hidden { overflow: hidden; }

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--navy-card);
  border: 1px solid var(--border-hover);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(12px);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1rem; font-weight: 700; color: var(--white); }
.modal-close {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: none; background: rgba(255,255,255,0.06);
  color: var(--grey); cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.modal-close:hover { background: rgba(255,255,255,0.12); color: var(--white); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  display: flex; gap: 0.75rem; justify-content: flex-end;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.375rem; }
.form-group + .form-group { margin-top: 1rem; }

/* ── Toast ──────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 500;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.toast {
  display: flex; align-items: center; gap: 0.625rem;
  background: var(--navy-card);
  border: 1px solid var(--border-hover);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--white);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: slideIn 0.25s ease;
  max-width: 320px;
}
.toast.success { border-left: 3px solid #4ade80; }
.toast.error   { border-left: 3px solid #f87171; }
.toast.info    { border-left: 3px solid var(--gold); }
@keyframes slideIn { from { transform: translateX(20px); opacity:0; } to { transform: translateX(0); opacity:1; } }
@keyframes slideOut { to { transform: translateX(20px); opacity:0; } }

/* ── Dropdown ───────────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 200px;
  background: var(--navy-card);
  border: 1px solid var(--border-hover);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 100;
  padding: 4px;
  opacity: 0; pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.15s, transform 0.15s;
}
.dropdown-menu.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.dropdown-item {
  display: block; width: 100%;
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  font-size: 0.8rem; color: var(--grey);
  background: none; border: none; cursor: pointer;
  text-align: left; text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.dropdown-item:hover { background: rgba(255,255,255,0.05); color: var(--white); }
.dropdown-item.active { color: var(--gold); }
.dropdown-divider { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* ── Event switcher (topbar) ────────────────────────────── */
.event-dropdown { min-width: 280px; left: 0; right: auto; }

/* ── Empty state ────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 3rem 1.5rem;
  color: var(--grey);
}
.empty-state svg { width: 40px; height: 40px; margin: 0 auto 1rem; opacity: 0.3; }
.empty-state p { font-size: 0.85rem; margin-bottom: 1rem; }

/* ── Status dot ─────────────────────────────────────────── */
.status-dot {
  width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}

/* ── Event card (events page) ───────────────────────────── */
.event-card {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  transition: border-color 0.15s, transform 0.15s;
  cursor: pointer;
}
.event-card:hover { border-color: rgba(201,150,44,0.3); transform: translateY(-1px); }
.event-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1rem; }
.event-card-title { font-size: 0.95rem; font-weight: 700; color: var(--white); margin-bottom: 3px; }
.event-card-date  { font-size: 0.73rem; color: var(--grey); }
.event-stat-row   { display: grid; grid-template-columns: repeat(3,1fr); gap: 0.75rem; margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.event-stat-val   { font-size: 1.1rem; font-weight: 700; color: var(--white); }
.event-stat-lbl   { font-size: 0.65rem; color: var(--grey); text-transform: uppercase; letter-spacing: 0.06em; }

/* ── User row (admin) ───────────────────────────────────── */
.user-row { display: flex; align-items: center; gap: 0.875rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.user-row:last-child { border-bottom: none; }
.user-row:hover { background: rgba(255,255,255,0.02); }

/* ── Toggle switch ──────────────────────────────────────── */
.toggle { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 20px; cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--white);
  left: 3px; top: 3px;
  transition: transform 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--gold); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }

/* ── Activity feed ──────────────────────────────────────── */
.activity-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 7px; height: 7px; border-radius: 50%;
  flex-shrink: 0; margin-top: 5px;
}
.activity-meta { font-size: 0.7rem; color: var(--grey); margin-top: 2px; }

/* ── Reporting date tabs ────────────────────────────────── */
.period-tabs { display: flex; gap: 4px; }
.period-tab {
  padding: 4px 12px; border-radius: 6px; font-size: 0.72rem;
  font-weight: 600; cursor: pointer; border: none;
  background: transparent; color: var(--grey); transition: all 0.15s;
}
.period-tab.active { background: var(--surface); color: var(--white); }
.period-tab:hover:not(.active) { color: var(--white); }

/* ── btn-sm ─────────────────────────────────────────────── */
.btn-sm { padding: 5px 10px; font-size: 0.72rem; gap: 4px; }
.btn-sm i[data-lucide] { width: 12px !important; height: 12px !important; }

/* ── Global Search ──────────────────────────────────────── */
.global-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.global-search-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 36px 6px 30px;
  font-size: 0.78rem;
  color: var(--white);
  width: 220px;
  outline: none;
  transition: border-color 0.15s, width 0.2s;
  font-family: inherit;
}
.global-search-input::placeholder { color: var(--grey); }
.global-search-input:focus {
  border-color: rgba(201,150,44,0.5);
  width: 280px;
}
.global-search-input:focus + .search-kbd,
.global-search-input:not(:placeholder-shown) + .search-kbd { opacity: 0; }
.search-kbd {
  position: absolute; right: 8px;
  font-size: 0.62rem; color: var(--grey);
  background: var(--navy); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px;
  pointer-events: none; transition: opacity 0.15s;
}
.search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0;
  width: 360px; background: #0f2030;
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  display: none; z-index: 2000; overflow: hidden;
  max-height: 420px; overflow-y: auto;
}
.search-dropdown.open { display: block; }
.search-group-label {
  padding: 8px 12px 4px;
  font-size: 0.62rem; font-weight: 700;
  color: var(--grey); text-transform: uppercase; letter-spacing: 0.08em;
}
.search-result {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; cursor: pointer;
  text-decoration: none; transition: background 0.1s;
}
.search-result:hover, .search-result.focused { background: var(--surface); }
.search-result-icon {
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 0.65rem; font-weight: 700;
}
.search-result-title { font-size: 0.8rem; color: var(--white); font-weight: 500; }
.search-result-sub   { font-size: 0.68rem; color: var(--grey); margin-top: 1px; }
.search-no-results   { padding: 20px; text-align: center; color: var(--grey); font-size: 0.78rem; }
.search-highlight    { color: var(--gold); font-weight: 600; }

/* ── Notifications panel ────────────────────────────────── */
.notif-btn { position: relative; }
.notif-badge {
  position: absolute; top: -3px; right: -3px;
  background: var(--maroon); color: #fff;
  font-size: 0.55rem; font-weight: 700;
  min-width: 15px; height: 15px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; pointer-events: none;
  border: 2px solid var(--navy);
}
.notif-badge.hidden { display: none; }
.notif-dropdown { min-width: 340px; max-height: 480px; overflow-y: auto; }
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem 0.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: #0f2030; z-index: 1;
}
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none; transition: background 0.1s;
  position: relative; cursor: pointer;
}
.notif-item:hover { background: var(--surface); }
.notif-item.read .notif-unread-dot { display: none; }
.notif-item.read .notif-title { color: var(--grey); }
.notif-icon-wrap {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.notif-title  { font-size: 0.78rem; color: var(--white); font-weight: 500; line-height: 1.4; }
.notif-sub    { font-size: 0.68rem; color: var(--grey); margin-top: 2px; line-height: 1.4; }
.notif-time   { font-size: 0.65rem; color: var(--grey); margin-top: 4px; }
.notif-unread-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); flex-shrink: 0; margin-top: 6px;
}
.notif-footer {
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--border);
  position: sticky; bottom: 0; background: #0f2030;
}

/* ── CSV drop zone ──────────────────────────────────────── */
.csv-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.csv-drop-zone:hover { border-color: var(--gold); background: rgba(201,150,44,0.04); }

/* ── Empty state ────────────────────────────────────────── */
.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.empty-state-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}
.empty-state-title { font-size: 0.9rem; font-weight: 700; color: var(--white); }
.empty-state-sub   { font-size: 0.75rem; color: var(--grey); max-width: 260px; line-height: 1.5; }

/* ── Responsive / mobile ────────────────────────────────── */
.mobile-menu-btn { display: none; }
@media (max-width: 768px) {
  .mobile-menu-btn { display: flex !important; }
  .page-content { padding: 1rem; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .global-search-input { width: 140px; }
  .global-search-input:focus { width: 180px; }
  .topbar { padding: 0 1rem; gap: 0.625rem; }
  .topbar-user-name { display: none; }
  .btn-ai { display: none; }
  .search-kbd { display: none; }
}
