/* ═══════════════════════════════════════════════════════════
   LiveStreamFlow — Design System v2
   ═══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

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

/* ── Dark theme (default) ── */
:root,
[data-theme="dark"] {
  --bg:           #0d0b0e;
  --bg-2:         #141118;
  --surface:      #1c1822;
  --surface-2:    #272130;
  --border:       #2a2530;
  --border-2:     #37313e;
  --border-3:     #453e4e;
  --text:         #f4ede3;
  --text-2:       #b8b0a6;
  --muted:        #75706a;

  --accent:       #f43f5e;
  --accent-dim:   rgba(244,63,94,0.14);
  --accent-soft:  rgba(244,63,94,0.28);
  --accent-deep:  #3a0f1c;
  --accent-glow:  rgba(244,63,94,0.35);
  --on-accent:    #ffffff;

  --mint:         #5ee3a3;
  --mint-soft:    rgba(94,227,163,0.13);
  --onair:        #ff3b3b;
  --amber:        #f5b544;

  --success:      #5ee3a3;
  --success-soft: rgba(94,227,163,0.13);
  --warning:      #f5b544;
  --warning-soft: rgba(245,181,68,0.13);
  --danger:       #ff3b3b;
  --danger-soft:  rgba(255,59,59,0.12);
  --info:         #7c9aff;
  --info-soft:    rgba(124,154,255,0.12);

  --radius-xs: 4px;
  --radius-sm: 7px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.6);
  --shadow:    0 2px 10px rgba(0,0,0,0.5);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg: 0 24px 64px rgba(0,0,0,0.6);

  --sidebar-w: 240px;
  --transition: 0.14s ease;

  --font:       'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

/* ── Light theme ── */
[data-theme="light"] {
  --bg:           #faf6ee;
  --bg-2:         #ffffff;
  --surface:      #f1ebdd;
  --surface-2:    #e5dcc8;
  --border:       #ebe2cd;
  --border-2:     #d4c9ad;
  --border-3:     #bfb08e;
  --text:         #1a1612;
  --text-2:       #4d463a;
  --muted:        #8a8170;

  --accent:       #e11d48;
  --accent-dim:   rgba(225,29,72,0.08);
  --accent-soft:  rgba(225,29,72,0.15);
  --accent-deep:  #ffe4ea;
  --accent-glow:  rgba(225,29,72,0.25);
  --on-accent:    #ffffff;

  --mint:         #0d8e5e;
  --mint-soft:    rgba(13,142,94,0.10);
  --onair:        #d22a2a;
  --amber:        #b67a14;

  --success:      #0d8e5e;
  --success-soft: rgba(13,142,94,0.10);
  --warning:      #b67a14;
  --warning-soft: rgba(182,122,20,0.12);
  --danger:       #d22a2a;
  --danger-soft:  rgba(210,42,42,0.10);
  --info:         #4a6fd4;
  --info-soft:    rgba(74,111,212,0.10);

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.07);
  --shadow:    0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 24px 64px rgba(0,0,0,0.10);
}

html, body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Page loader bar ── */
.page-loader {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), #ff8fa3);
  transform: scaleX(0); transform-origin: left;
  z-index: 9999; pointer-events: none;
}

/* ══════════════════════════════════════════
   APP SHELL
   ══════════════════════════════════════════ */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 20px 14px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  padding: 4px 6px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-lockup:hover { text-decoration: none; }

.brand-mark svg { display: block; }

.brand-text {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}

.brand-text .accent-word { color: var(--accent); }

.brand-version {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.12em;
  padding: 2px 6px;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  flex-shrink: 0;
}

/* ── Nav groups ── */
.nav-group { margin-bottom: 4px; }

.nav-group-label {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 12px 10px 6px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.sidebar nav a:hover {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.sidebar nav a.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

.nav-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar nav a.active .nav-icon { opacity: 1; }

.nav-soon {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  border: 1px solid var(--border-2);
  border-radius: 3px;
  padding: 1px 5px;
  letter-spacing: 0.08em;
  margin-left: auto;
}

/* ── Sidebar footer ── */
.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.user-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(140deg, var(--accent), var(--accent-deep));
  color: var(--on-accent);
  font-family: var(--font);
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-name  { font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.1; }
.user-email { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-top: 2px; }

.sidebar-actions { display: flex; gap: 6px; margin-bottom: 6px; }

.theme-toggle {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  cursor: pointer;
  transition: background var(--transition);
}

.theme-toggle:hover { background: var(--surface-2); }

/* ── Sidebar toggle (mobile) ── */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 300;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
  backdrop-filter: blur(2px);
}

/* ── Main ── */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  animation: page-arrive 0.4s ease both;
}

@keyframes page-arrive {
  from { opacity: 0.2; filter: blur(12px); transform: scale(1.015); }
  to   { opacity: 1;   filter: blur(0);    transform: scale(1); }
}

/* ── Page header ── */
.page-header {
  padding: 26px 36px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-family: var(--font);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.1;
  margin: 0;
}

.page-header .crumb {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.page-header .subtitle {
  font-size: 13.5px;
  color: var(--text-2);
  margin-top: 5px;
}

.page-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.page-body { padding: 24px 36px 48px; display: flex; flex-direction: column; gap: 16px; }

/* ══════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  letter-spacing: -0.005em;
  transition: background var(--transition), border-color var(--transition), transform 0.08s;
  text-decoration: none;
  white-space: nowrap;
  background: var(--accent);
  color: var(--on-accent);
  line-height: 1.4;
}

.btn:hover { background: color-mix(in srgb, var(--accent) 85%, black); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-2);
  font-weight: 500;
}
.btn.secondary:hover { background: var(--surface-2); border-color: var(--border-3); transform: none; }

.btn.ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border-2);
  font-weight: 500;
}
.btn.ghost:hover { background: var(--surface); color: var(--text); transform: none; }

.btn.danger-btn {
  background: transparent;
  color: var(--onair);
  border-color: rgba(255,59,59,0.4);
}
.btn.danger-btn:hover { background: var(--danger-soft); transform: none; }

.btn.small { font-size: 12px; padding: 6px 11px; }
.btn.large { font-size: 14px; padding: 12px 22px; }

/* ══════════════════════════════════════════
   PILLS / BADGES
   ══════════════════════════════════════════ */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border-2);
}

.pill.live      { background: var(--danger-soft);   color: #ff7a7a;       border-color: rgba(255,59,59,0.35); }
.pill.done      { background: var(--mint-soft);      color: var(--mint);   border-color: rgba(94,227,163,0.3); }
.pill.scheduled { background: var(--accent-dim);     color: var(--accent); border-color: var(--accent-soft); }
.pill.warn      { background: var(--warning-soft);   color: var(--amber);  border-color: rgba(245,181,68,0.3); }
.pill.cancelled { background: var(--surface-2);      color: var(--muted);  border-color: var(--border-2); }

.pill-dot {
  width: 6px; height: 6px; border-radius: 99px;
  background: currentColor; flex-shrink: 0;
}

.pill.live .pill-dot { background: #ff3b3b; box-shadow: 0 0 6px #ff3b3b; }

/* ══════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════ */

.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), inset 1px 0 0 rgba(255,255,255,0.03);
}

[data-theme="light"] .card {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85), inset 1px 0 0 rgba(255,255,255,0.5);
}

/* ── Card icon header ── */
.card-icon-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.card-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  border: 1px solid var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.card-icon-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}

.card-icon-header .card-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

/* ── Stat card ── */
.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
}

[data-theme="light"] .stat-card {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

.stat-label {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-value {
  font-family: var(--font);
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin-top: 10px;
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-value.mint  { color: var(--mint); }
.stat-value.amber { color: var(--accent); }

.stat-sub { font-size: 12px; color: var(--text-2); margin-top: 8px; }

/* ── Panel (card with header) ── */
.panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
}

[data-theme="light"] .panel {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}

.panel-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

/* ══════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════ */

.form-group { display: flex; flex-direction: column; gap: 6px; }

label { font-size: 13px; font-weight: 500; color: var(--text-2); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="url"],
textarea,
select {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 9px 12px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

input::placeholder, textarea::placeholder { color: var(--muted); }

textarea { resize: vertical; min-height: 80px; }

select option { background: var(--bg-2); color: var(--text); }

input[type="checkbox"],
input[type="radio"] {
  width: 15px; height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.field-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-section {
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.form-section:last-child { border-bottom: none; }

.form-section-title {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline input[type="search"],
.inline input[type="text"] { width: auto; }

/* ══════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════ */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

thead th {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px 16px;
  text-align: left;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface); }
td strong { color: var(--text); font-weight: 600; }
td.muted { color: var(--muted); font-size: 13px; }
td a { color: var(--text); }
td a:hover { color: var(--accent); }
.mono { font-family: var(--font-mono); }

/* ── Mobile card tables ── */
@media (max-width: 768px) {
  .mob-cards .table-wrap { overflow-x: visible; }
  .mob-cards thead { display: none !important; }
  .mob-cards tbody tr {
    display: grid !important;
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    gap: 0;
  }
  .mob-cards tbody tr:hover td { background: none; }
  .mob-cards tbody td {
    display: block !important;
    border: none !important;
    padding: 0 !important;
    background: none !important;
  }
}

/* ══════════════════════════════════════════
   EMPTY STATES
   ══════════════════════════════════════════ */

.empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--muted);
  font-size: 14px;
}

/* ══════════════════════════════════════════
   TOASTS
   ══════════════════════════════════════════ */

#toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: rgba(28, 24, 34, 0.85);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13.5px;
  color: var(--text);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  max-width: 340px;
}

[data-theme="light"] .toast {
  background: rgba(250, 246, 238, 0.88);
}

.toast-visible { opacity: 1; transform: translateY(0); }
.toast-error   { border-left: 3px solid var(--onair); }
.toast-success { border-left: 3px solid var(--mint); }

/* ══════════════════════════════════════════
   STATS GRID
   ══════════════════════════════════════════ */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats { grid-template-columns: 1fr 1fr; } }

/* ══════════════════════════════════════════
   HERO GIG CARD (dashboard)
   ══════════════════════════════════════════ */

.hero-gig {
  background: linear-gradient(135deg, var(--bg-2) 0%, var(--surface) 60%, var(--accent-deep) 220%);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 4px 24px rgba(0,0,0,0.3);
}

.hero-gig::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.hero-gig-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 4px var(--accent); opacity: 1; }
  50%       { box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent-soft); opacity: 0.7; }
}

@keyframes pulse-live {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,59,59,0.6); }
  50%       { box-shadow: 0 0 0 5px rgba(255,59,59,0); }
}

.pulse-dot {
  width: 6px; height: 6px; border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  flex-shrink: 0;
  animation: pulse-glow 2.2s ease-in-out infinite;
}

.pill.live .pill-dot {
  animation: pulse-live 1.8s ease-in-out infinite;
}

.hero-gig-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.025em;
  margin-bottom: 10px;
  line-height: 1.2;
}

.hero-gig-meta {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-2);
  letter-spacing: 0.04em;
}

.hero-gig-meta .meta-key { color: var(--muted); margin-right: 6px; }

/* ══════════════════════════════════════════
   ATTENTION CARD (dashboard)
   ══════════════════════════════════════════ */

.attention-item {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border-2);
  margin-bottom: 10px;
}

.attention-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.attention-meta { font-family: var(--font); font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.attention-actions { display: flex; gap: 6px; }

/* ══════════════════════════════════════════
   EARNINGS CHART
   ══════════════════════════════════════════ */

.earn-chart-wrap {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px 20px;
  margin-bottom: 14px;
}

.earn-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 200px;
  border-bottom: 1px solid var(--border);
  gap: 4px;
  padding-bottom: 0;
}

.earn-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.earn-bar-val {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.04em;
  min-height: 14px;
  text-align: center;
}

.earn-bar-val.hl { color: var(--accent); }

.earn-bar {
  width: 100%;
  max-width: 28px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  transition: all 0.2s;
}

.earn-bar.hl {
  background: linear-gradient(180deg, var(--accent), rgba(244,63,94,0.6));
  border: none;
  box-shadow: 0 0 20px var(--accent-glow);
}

.earn-bar-month {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ══════════════════════════════════════════
   SECTION LABEL
   ══════════════════════════════════════════ */

.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ══════════════════════════════════════════
   TABS
   ══════════════════════════════════════════ */

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  padding: 0 4px;
}

.tab {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition);
}

.tab.active, .tab:hover { color: var(--text); }
.tab.active { border-bottom-color: var(--accent); color: var(--accent); }

/* ══════════════════════════════════════════
   MONTH CALENDAR (gigs)
   ══════════════════════════════════════════ */

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }

.cal-day-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  padding: 6px 0;
}

.cal-day {
  min-height: 52px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 6px;
  position: relative;
  border: 1px solid transparent;
}

.cal-day.today { border-color: var(--accent); }

.cal-day-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-bottom: 3px;
}

.cal-day.today .cal-day-num { color: var(--accent); font-weight: 600; }

.cal-gig {
  font-size: 11px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 3px;
  padding: 1px 5px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  text-decoration: none;
}

.cal-gig:hover { background: var(--accent-soft); }

/* ══════════════════════════════════════════
   AUTH PAGES
   ══════════════════════════════════════════ */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.auth-box {
  width: 100%;
  max-width: 400px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
  text-decoration: none;
}

.auth-logo-text {
  font-family: var(--font);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.auth-logo-text .accent-word { color: var(--accent); }

.auth-title { font-size: 22px; font-weight: 700; letter-spacing: -0.025em; color: var(--text); text-align: center; margin-bottom: 6px; }
.auth-sub   { font-size: 13.5px; color: var(--text-2); text-align: center; margin-bottom: 28px; }
.auth-form  { display: flex; flex-direction: column; gap: 14px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }

.auth-error {
  background: var(--danger-soft);
  border: 1px solid rgba(255,59,59,0.3);
  border-radius: var(--radius-sm);
  color: #ff7a7a;
  padding: 10px 14px;
  font-size: 13px;
}

/* ══════════════════════════════════════════
   SETTINGS
   ══════════════════════════════════════════ */

.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
}

.settings-nav {
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  min-height: calc(100vh - 70px);
}

.settings-nav a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: background var(--transition);
  margin-bottom: 2px;
}

.settings-nav a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.settings-nav a.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }

.settings-content { padding: 28px 36px; max-width: 680px; }

.settings-section { margin-bottom: 36px; }

.settings-section-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.settings-section-sub   { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

/* Danger zone */
.danger-zone {
  border: 1px solid rgba(255,59,59,0.25);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  background: var(--danger-soft);
}

.danger-zone-title { font-size: 14px; font-weight: 600; color: var(--onair); margin-bottom: 6px; }

/* Google Calendar card */
.gcal-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.gcal-card.connected {
  border-color: rgba(94,227,163,0.3);
  background: var(--mint-soft);
}

/* ══════════════════════════════════════════
   LANDING PAGE
   ══════════════════════════════════════════ */

.landing-page {
  width: 100%;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  position: relative;
  overflow-x: hidden;
}

.land-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 56px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.land-nav-links {
  display: flex;
  gap: 28px;
  font-size: 13px;
  color: var(--text-2);
}

.land-nav-links a {
  color: var(--text-2);
  text-decoration: none;
  transition: color var(--transition);
}

.land-nav-links a:hover { color: var(--text); }

.land-hero {
  position: relative;
  padding: 100px 56px 80px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.land-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  margin-bottom: 32px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.land-h1 {
  font-family: var(--font);
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.98;
  margin: 0 0 28px;
  max-width: 980px;
}

.land-h1 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.land-sub {
  font-size: clamp(15px, 2.5vw, 18px);
  color: var(--text-2);
  line-height: 1.55;
  max-width: 580px;
  margin-bottom: 36px;
}

.land-ctas { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 20px; }

.land-small-print {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.land-mockup {
  margin-top: 64px;
  width: 100%;
  max-width: 1080px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: 0 40px 120px rgba(0,0,0,0.5);
}

.mockup-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 12px;
}

.mockup-dot { width: 11px; height: 11px; border-radius: 99px; background: var(--surface-2); }

.mockup-url {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.land-features {
  position: relative;
  padding: 80px 56px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}

.land-features-inner { max-width: 1080px; margin: 0 auto; }

.land-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.land-feat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  min-height: 260px;
}

.land-feat-num   { font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.16em; margin-bottom: 18px; }
.land-feat-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 12px; }
.land-feat-body  { font-size: 13.5px; color: var(--text-2); line-height: 1.6; flex: 1; }
.land-feat-tags  { font-family: var(--font-mono); font-size: 10px; color: var(--muted); letter-spacing: 0.14em; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }

.land-cta-section {
  padding: 80px 56px 100px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.land-cta-h2 {
  font-family: var(--font);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.04;
  margin: 18px auto 36px;
  max-width: 780px;
}

.land-cta-h2 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.land-footer {
  padding: 28px 56px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  flex-wrap: wrap;
  gap: 12px;
}

.land-footer a { color: var(--muted); text-decoration: none; }
.land-footer a:hover { color: var(--text-2); }

/* ══════════════════════════════════════════
   GIGS PAGE LAYOUT
   ══════════════════════════════════════════ */

.gigs-layout { display: flex; flex-direction: column; }
.gigs-cal-section  { order: 1; }
.gigs-tabs-section { order: 2; }

/* Desktop: grid calendar visible, agenda hidden */
.cal-agenda    { display: none; }
.cal-grid-view { display: block; }

/* Calendar chip text: white on dark theme, dark on light theme for contrast */
.cal-chip { color: #fff !important; }
[data-theme="light"] .cal-chip { color: #1a1612 !important; }

@media (max-width: 768px) {
  .gigs-tabs-section { order: 1; }
  .gigs-cal-section  { order: 2; }
  .cal-agenda    { display: block; }
  .cal-grid-view { display: none; }
}

/* ══════════════════════════════════════════
   MOBILE — RESPONSIVE
   ══════════════════════════════════════════ */

@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    left: -100%;
    top: 0; bottom: 0;
    z-index: 200;
    width: var(--sidebar-w);
    transition: left 0.22s ease;
    overflow-y: auto;
    height: 100vh;
  }

  .sidebar.open { left: 0; }
  .sidebar-overlay.open { display: block; }
  .sidebar-toggle { display: flex; }
  .sidebar-close  { display: block; }

  .page-header { padding: 56px 18px 16px; }
  .page-body   { padding: 16px 18px 40px; }

  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-value { font-size: 24px; }

  .hero-gig { padding: 18px; }
  .hero-gig-title { font-size: 19px; }
  .hero-gig-meta { gap: 8px; flex-direction: column; }

  .form-row { grid-template-columns: 1fr; }

  .land-nav { padding: 16px 20px; }
  .land-nav-links { display: none; }
  .land-hero { padding: 60px 20px 48px; }
  .land-features { padding: 48px 20px; }
  .land-features-grid { grid-template-columns: 1fr; }
  .land-cta-section { padding: 48px 20px 60px; }
  .land-footer { padding: 20px; }

  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { min-height: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 12px; display: flex; gap: 4px; flex-wrap: wrap; }
  .settings-content { padding: 20px 18px; }
}

@media (max-width: 480px) {
  .page-header h1 { font-size: 22px; }
}

/* ══════════════════════════════════════════
   MOBILE CARD TABLES — per-page
   ══════════════════════════════════════════ */

@media (max-width: 768px) {
  /* Earnings sessions */
  .earn-row {
    grid-template-columns: 1fr auto !important;
    grid-template-areas: "date earned" "gig gig" "co co" "gmv rate" !important;
    gap: 0 16px !important;
  }
  .earn-row .e-date   { grid-area: date; }
  .earn-row .e-earned { grid-area: earned; font-family: var(--font-mono); color: var(--mint); font-weight: 600; }
  .earn-row .e-gig    { grid-area: gig;  font-weight: 600; color: var(--text); margin-top: 3px; }
  .earn-row .e-co     { grid-area: co;   font-size: 12px; margin-top: 2px; }
  .earn-row .e-gmv    { grid-area: gmv;  font-size: 12px; margin-top: 4px; white-space: nowrap; }
  .earn-row .e-rate   { grid-area: rate; font-size: 12px; margin-top: 4px; text-align: right; white-space: nowrap; }
  .earn-row .e-gmv::before  { content: "GMV ";  color: var(--muted); font-family: var(--font-mono); font-size: 10px; }
  .earn-row .e-rate::before { content: "Rate "; color: var(--muted); font-family: var(--font-mono); font-size: 10px; }
  .mob-cards .e-hide-mob { display: none !important; }

  /* Gigs list future */
  .gig-row-future {
    grid-template-columns: 80px 1fr auto !important;
    grid-template-areas: "date title  status" "date co     action" !important;
    gap: 0 10px !important;
    align-items: center;
  }
  .gig-row-future .g-date   { grid-area: date; }
  .gig-row-future .g-title  { grid-area: title; font-weight: 600; color: var(--text); }
  .gig-row-future .g-co     { grid-area: co;    font-size: 12px; color: var(--muted); }
  .gig-row-future .g-status { grid-area: status; }
  .gig-row-future .g-action { grid-area: action; }
  .mob-cards .g-hide-mob { display: none !important; }

  /* Gigs list history */
  .gig-row-hist {
    grid-template-columns: 80px 1fr auto !important;
    grid-template-areas: "date title earn" "date co    earn" !important;
    gap: 0 10px !important;
    align-items: center;
  }
  .gig-row-hist .gh-date  { grid-area: date; }
  .gig-row-hist .gh-title { grid-area: title; font-weight: 600; color: var(--text); }
  .gig-row-hist .gh-co    { grid-area: co;   font-size: 12px; color: var(--muted); }
  .gig-row-hist .gh-earn  { grid-area: earn; font-family: var(--font-mono); color: var(--mint); text-align: right; }
  .mob-cards .gh-hide-mob { display: none !important; }

  /* Companies list */
  .co-row {
    grid-template-columns: 1fr auto auto !important;
    grid-template-areas: "name earn action" "stats stats stats" !important;
    gap: 0 10px !important;
    align-items: start;
  }
  .co-row .co-name   { grid-area: name; }
  .co-row .co-earn   { grid-area: earn; font-family: var(--font-mono); color: var(--mint); font-size: 13px; align-self: center; }
  .co-row .co-action { grid-area: action; align-self: center; }
  .co-row .co-stats  { grid-area: stats; }
  .co-mob-stats { display: none; font-size: 12px; color: var(--muted); margin-top: 3px; }
  .mob-cards .co-hide-mob { display: none !important; }
  .mob-cards .co-row .co-mob-stats { display: block; }

  /* Products list */
  .pr-row {
    grid-template-columns: 32px 1fr auto auto !important;
    grid-template-areas: "check name stock action" !important;
    align-items: center;
    gap: 0 10px !important;
  }
  .pr-row .pr-check  { grid-area: check; }
  .pr-row .pr-name   { grid-area: name; }
  .pr-row .pr-stock  { grid-area: stock; }
  .pr-row .pr-action { grid-area: action; }
  .pr-mob-meta { display: none; font-size: 12px; color: var(--muted); margin-top: 3px; }
  .mob-cards .pr-hide-mob { display: none !important; }
  .mob-cards .pr-row .pr-mob-meta { display: block; }
}

/* ══════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════ */

.text-muted  { color: var(--muted); }
.text-mint   { color: var(--mint); }
.text-accent { color: var(--accent); }
.text-sm     { font-size: 12px; }
.font-mono   { font-family: var(--font-mono); }

.flex-between { display: flex; justify-content: space-between; align-items: center; }
.two-col   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

@media (max-width: 768px) {
  .two-col   { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr; }
}

.mb-12 { margin-bottom: 12px; }
.mb-20 { margin-bottom: 20px; }
.mb-28 { margin-bottom: 28px; }

hr.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-2);
}

/* ── Company sub-tabs ── */
.co-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
}
.co-tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.co-tab:hover { color: var(--text); }
.co-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Sidebar Companies dropdown ── */
.nav-item-group {
  display: flex;
  align-items: center;
  gap: 0;
}
.nav-item-group > a {
  flex: 1;
  min-width: 0;
}
.nav-expand-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, transform 0.2s;
  margin-right: 4px;
}
.nav-expand-btn:hover { color: var(--text); }
.nav-expand-btn.expanded { transform: rotate(180deg); }
.nav-sub-items {
  display: none;
  padding: 2px 0 4px 0;
}
.nav-sub-items.open { display: block; }
.nav-sub-items a {
  display: block;
  padding: 6px 12px 6px 36px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color 0.12s, background 0.12s;
}
.nav-sub-items a:hover {
  color: var(--text);
  background: var(--surface);
}
