/* ═══════════════════════════════════════════════════════════════════════════
   HBL Demo · Shared design system
   ═══════════════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;800&family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&family=Noto+Sans+Gujarati:wght@400;500;600;700&display=swap');

:root {
  /* Brand colors */
  --blue-deepest: #030817;
  --blue-deep: #050D27;
  --blue-royal: #0A1F5C;
  --blue-coin: #0E2D7E;
  --blue-mid: #1E3A8A;
  --gold-deep: #8B6914;
  --gold: #C9962E;
  --gold-rich: #D4AF37;
  --gold-bright: #F4C430;
  --gold-pale: #F5E1A0;
  --champagne: #E8D5A0;

  /* UI tokens */
  --bg: #F7F8FB;
  --card: #FFFFFF;
  --border: #E4E7EE;
  --border-strong: #C4CAD8;
  --text: #1A2436;
  --text-muted: #5C6B83;
  --text-faint: #8B92A8;
  --accent: #0E2D7E;
  --accent-gold: #C9962E;
  --success: #047857;
  --warn: #B45309;
  --danger: #B91C1C;
  --info: #1D4ED8;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 28px rgba(10,31,92,0.12);
}

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

html, body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.gu { font-family: 'Noto Sans Gujarati', sans-serif; }
.mono { font-family: 'JetBrains Mono', monospace; }
.serif { font-family: 'Cinzel', serif; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; border: none; background: transparent; }

/* ═══ SIDEBAR LAYOUT (admin / super admin) ═══ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: linear-gradient(180deg, var(--blue-coin) 0%, var(--blue-royal) 100%);
  color: white;
  padding: 18px 0;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar.super-theme {
  background: linear-gradient(180deg, var(--blue-deepest) 0%, var(--blue-deep) 100%);
  border-right: 1px solid var(--gold-rich);
}
.sidebar .brand {
  padding: 4px 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 11px;
}
.sidebar .brand .logo-circle {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  display: flex; align-items: center; justify-content: center;
  color: var(--blue-deep); font-weight: 800; font-size: 17px;
  font-family: 'Noto Sans Gujarati', sans-serif;
}
.sidebar.super-theme .brand .logo-circle {
  background: linear-gradient(135deg, var(--gold-bright), #DC2626);
}
.sidebar .brand .b-text { font-size: 14px; font-weight: 700; line-height: 1.2; }
.sidebar .brand .b-text .small { font-size: 9px; opacity: 0.65; font-weight: 400; letter-spacing: 0.12em; display: block; margin-top: 2px; }
.sidebar .sect-label { font-size: 9px; padding: 14px 22px 6px; color: rgba(255,255,255,0.4); letter-spacing: 0.16em; text-transform: uppercase; }
.sidebar .nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 22px; font-size: 13px;
  color: rgba(255,255,255,0.78);
  border-left: 3px solid transparent;
  text-decoration: none; transition: background 0.15s;
}
.sidebar .nav-item:hover { background: rgba(255,255,255,0.05); text-decoration: none; }
.sidebar .nav-item.active { background: rgba(255,255,255,0.08); border-left-color: var(--gold-rich); color: white; font-weight: 600; }
.sidebar .nav-item .icon { width: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.sidebar .nav-item .badge { margin-left: auto; background: var(--gold-rich); color: var(--blue-deep); font-size: 9px; padding: 2px 7px; border-radius: 8px; font-weight: 700; }
.sidebar .nav-item .badge.alert { background: #DC2626; color: white; }
.sidebar-footer {
  position: sticky; bottom: 0;
  margin-top: auto; padding: 14px 22px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 11px; color: rgba(255,255,255,0.5);
  background: inherit;
}
.sidebar-footer a { color: var(--gold-bright); }

/* ═══ TOP BAR ═══ */
.main { flex-grow: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: white; height: 56px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 28px; gap: 18px;
  position: sticky; top: 0; z-index: 10;
}
.topbar .crumb { font-size: 13px; color: var(--text-muted); }
.topbar .crumb .arrow { color: var(--text-faint); margin: 0 8px; }
.topbar .crumb .current { color: var(--text); font-weight: 600; }
.topbar .search {
  margin-left: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 7px;
  padding: 7px 14px 7px 34px; font-size: 12px; color: var(--text-muted);
  width: 280px; position: relative;
  font-family: inherit;
}
.topbar .search-wrap { position: relative; margin-left: auto; }
.topbar .search-wrap::before {
  content: '🔍'; position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%); font-size: 11px; pointer-events: none; z-index: 1;
}
.topbar .user-chip {
  display: flex; align-items: center; gap: 10px;
  padding-left: 18px; border-left: 1px solid var(--border);
}
.topbar .user-chip .avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent);
  color: white; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.topbar .user-chip .info { font-size: 12px; line-height: 1.3; }
.topbar .user-chip .info .name { font-weight: 600; color: var(--text); }
.topbar .user-chip .info .role { color: var(--text-faint); font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; }
.topbar a.logout {
  color: var(--text-muted); font-size: 12px; padding: 6px 12px;
  border: 1px solid var(--border); border-radius: 5px; margin-left: 10px;
}

/* ═══ PAGE CONTENT ═══ */
.content { padding: 24px 28px; flex-grow: 1; }
.page-title { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.page-title h1 { font-size: 26px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.page-title .sub { font-size: 13px; color: var(--text-muted); }

/* ═══ CARDS ═══ */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-sm);
  padding: 22px 24px; margin-bottom: 16px;
}
.card h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; color: var(--text); display: flex; align-items: center; justify-content: space-between; }
.card h3 .right-link { font-size: 12px; color: var(--accent); font-weight: 500; }
.card h3 .right-link:hover { text-decoration: underline; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 18px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px 22px;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
}
.stat-card .label { font-size: 11px; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }
.stat-card .num { font-size: 30px; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 8px; }
.stat-card .num .small { font-size: 16px; color: var(--text-faint); font-weight: 400; }
.stat-card .trend { font-size: 12px; color: var(--success); }
.stat-card .trend.down { color: var(--danger); }
.stat-card .trend.neutral { color: var(--text-muted); }

/* ═══ TABLE ═══ */
.table-wrap { background: white; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; padding: 11px 14px;
  background: #FAFBFD; color: var(--text-muted);
  font-weight: 600; font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; border-bottom: 1px solid var(--border);
}
.table td {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  color: var(--text); vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr.clickable { cursor: pointer; transition: background 0.1s; }
.table tr.clickable:hover { background: #FAFBFD; }
.table .row-avatar { display: flex; align-items: center; gap: 10px; }
.table .av-circle {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-rich));
  color: white; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}

/* ═══ BADGES ═══ */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 12px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
}
.badge.pending { background: #FEF3C7; color: var(--warn); }
.badge.approved, .badge.pass { background: #D1FAE5; color: var(--success); }
.badge.review { background: #DBEAFE; color: var(--info); }
.badge.rejected { background: #FEE2E2; color: var(--danger); }
.badge.live { background: #DC2626; color: white; }
.badge.draft { background: #E5E7EB; color: #4B5563; }
.badge.diff-1 { background: #D1FAE5; color: var(--success); }
.badge.diff-2 { background: #DBEAFE; color: var(--info); }
.badge.diff-3 { background: #FEF3C7; color: var(--warn); }
.badge.diff-4 { background: #FED7AA; color: #C2410C; }
.badge.diff-5 { background: #FEE2E2; color: var(--danger); }
.badge.ai { background: linear-gradient(135deg, var(--gold-bright), var(--gold)); color: var(--blue-deep); }

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 18px; font-size: 13px; font-weight: 600;
  border-radius: 6px; cursor: pointer;
  transition: all 0.15s; text-decoration: none;
  font-family: inherit; border: 1px solid transparent;
}
.btn.primary { background: var(--accent); color: white; }
.btn.primary:hover { background: #08236A; text-decoration: none; }
.btn.secondary { background: white; color: var(--accent); border-color: var(--accent); }
.btn.secondary:hover { background: #F0F4FF; text-decoration: none; }
.btn.gold { background: linear-gradient(135deg, var(--gold-bright), var(--gold)); color: var(--blue-deep); }
.btn.gold:hover { filter: brightness(1.05); text-decoration: none; }
.btn.danger { background: var(--danger); color: white; }
.btn.danger:hover { background: #991717; text-decoration: none; }
.btn.ghost { color: var(--text-muted); background: white; border-color: var(--border); }
.btn.ghost:hover { background: var(--bg); text-decoration: none; }
.btn.sm { padding: 5px 12px; font-size: 11px; }
.btn.lg { padding: 12px 26px; font-size: 14px; }
.btn.block { width: 100%; }

/* ═══ PROGRESS BARS ═══ */
.bar { width: 100%; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bar .fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); transition: width 0.3s; }
.bar.lg { height: 10px; }

/* ═══ TWO-COL / THREE-COL ═══ */
.row-2-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.row-3-2 { display: grid; grid-template-columns: 3fr 2fr; gap: 18px; }
.row-1-1 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }

/* ═══ ROLE BANNER (top of admin/host etc to show "demo as X") ═══ */
.demo-banner {
  background: linear-gradient(90deg, var(--gold-bright), var(--gold));
  color: var(--blue-deep);
  padding: 6px 28px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}
.demo-banner a { color: var(--blue-deep); text-decoration: underline; font-weight: 700; margin-left: 12px; }

/* ═══ TIMELINE ═══ */
.timeline { display: flex; flex-direction: column; gap: 14px; }
.timeline-item { display: flex; gap: 12px; align-items: flex-start; }
.timeline-item .marker {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--success); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0;
}
.timeline-item .marker.pending { background: var(--info); }
.timeline-item .marker.empty { background: #D1D5DB; color: white; }
.timeline-item .content-tl { font-size: 12px; line-height: 1.5; }
.timeline-item .content-tl strong { display: block; color: var(--text); margin-bottom: 2px; }
.timeline-item .content-tl .meta { color: var(--text-muted); font-size: 11px; }
.timeline-item.dim { opacity: 0.5; }

/* ═══ FILTER CHIPS ═══ */
.filter-row {
  background: white; border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 16px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.filter-row .label { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.05em; }
.chip {
  background: var(--accent); color: white;
  padding: 4px 12px; border-radius: 14px;
  font-size: 11px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip .x { cursor: pointer; opacity: 0.7; }
.chip .x:hover { opacity: 1; }
.chip.add { background: var(--bg); color: var(--accent); border: 1px dashed var(--accent); cursor: pointer; }

/* ═══ STORY HOOK (admin contestant detail) ═══ */
.story-hook {
  background: #FFF8E1; border-left: 3px solid var(--gold);
  padding: 10px 14px; margin-bottom: 8px; border-radius: 4px;
  font-size: 13px; line-height: 1.55; color: var(--text);
}
.story-hook strong { color: var(--blue-coin); }

/* ═══ FORM ELEMENTS ═══ */
.input, select, textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 6px;
  font-family: inherit; font-size: 14px; color: var(--text); background: white;
}
.input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 45, 126, 0.1);
}
.field-row { margin-bottom: 16px; }
.field-row label { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 6px; letter-spacing: 0.02em; }
.field-row .hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ═══ MODAL OVERLAY (for approve/reject etc) ═══ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(3, 8, 23, 0.5);
  display: none; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-overlay.show { display: flex; }
.modal {
  background: white; border-radius: 12px; padding: 28px 30px;
  max-width: 520px; width: 90%; box-shadow: var(--shadow-lg);
}
.modal h2 { font-size: 20px; margin-bottom: 8px; color: var(--text); }
.modal p { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ═══ TOAST ═══ */
.toast {
  position: fixed; bottom: 28px; right: 28px;
  background: var(--text); color: white; padding: 12px 20px;
  border-radius: 8px; font-size: 13px; box-shadow: var(--shadow-lg);
  display: none; z-index: 200; max-width: 360px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.show { display: block; animation: slideUp 0.2s ease-out; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
