@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --background: hsl(213, 50%, 8%);
  --foreground: hsl(210, 40%, 96%);
  --card: hsl(213, 45%, 11%);
  --card-foreground: hsl(210, 40%, 96%);
  --primary: hsl(174, 100%, 42%);
  --primary-foreground: hsl(213, 50%, 8%);
  --secondary: hsl(213, 40%, 15%);
  --secondary-foreground: hsl(210, 40%, 96%);
  --muted: hsl(213, 35%, 18%);
  --muted-foreground: hsl(215, 20%, 55%);
  --destructive: hsl(0, 72%, 51%);
  --accent: hsl(174, 100%, 42%);
  --border: hsl(213, 35%, 18%);
  --input: hsl(213, 35%, 18%);
  --ring: hsl(174, 100%, 42%);
  --radius: 0.75rem;
  --success: hsl(142, 76%, 36%);
  --warning: hsl(38, 92%, 50%);
  --tier-bronze: hsl(30, 80%, 50%);
  --tier-silver: hsl(210, 10%, 65%);
  --tier-gold: hsl(45, 93%, 47%);
  --tier-platinum: hsl(174, 100%, 42%);
  --sidebar-bg: hsl(213, 50%, 9%);
  --sidebar-border: hsl(213, 35%, 16%);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.2;
}

a { color: var(--primary); text-decoration: none; }
a:hover { opacity: 0.85; }

/* Layout */
.app-layout { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 256px; display: flex; flex-direction: column; border-right: 1px solid var(--sidebar-border); background: var(--sidebar-bg); backdrop-filter: blur(20px); }
.sidebar-logo { padding: 20px; border-bottom: 1px solid var(--sidebar-border); }
.sidebar-logo img { height: 28px; width: auto; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-user { padding: 16px; border-top: 1px solid var(--sidebar-border); }

.main-content { flex: 1; overflow-y: auto; }
.main-content-inner { max-width: 80rem; margin: 0 auto; padding: 24px; }

/* Nav items */
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 500;
  color: var(--muted-foreground);
  cursor: pointer; transition: all 0.15s;
  border: 1px solid transparent;
  text-decoration: none;
}
.nav-item:hover { background: var(--secondary); color: var(--foreground); }
.nav-item.active {
  background: hsla(174, 100%, 42%, 0.1);
  color: var(--primary);
  border-color: hsla(174, 100%, 42%, 0.2);
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-section { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-foreground); padding: 16px 12px 4px; }

/* User profile */
.user-profile { display: flex; align-items: center; gap: 12px; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--secondary); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: var(--primary);
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.875rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.75rem; color: var(--muted-foreground); text-transform: capitalize; }
.logout-btn {
  padding: 6px; border-radius: var(--radius); background: none; border: none;
  color: var(--muted-foreground); cursor: pointer; transition: all 0.15s;
}
.logout-btn:hover { background: hsla(0, 72%, 51%, 0.1); color: var(--destructive); }
.logout-btn svg { width: 16px; height: 16px; }

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}

/* Glass effect */
.glass {
  background: hsla(213, 45%, 11%, 0.6);
  backdrop-filter: blur(16px);
  border: 1px solid hsla(213, 35%, 18%, 0.5);
}

/* Glow effects */
.glow-primary { box-shadow: 0 0 20px hsla(174, 100%, 42%, 0.3), 0 0 60px hsla(174, 100%, 42%, 0.1); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: all 0.15s; border: none;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { background: var(--secondary); color: var(--foreground); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--muted); }
.btn-block { width: 100%; }

/* Form elements */
.input {
  width: 100%; padding: 10px 12px;
  background: var(--secondary); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--foreground);
  font-size: 0.875rem; font-family: inherit;
  outline: none; transition: border-color 0.15s;
}
.input:focus { border-color: var(--primary); }
.input::placeholder { color: var(--muted-foreground); }

/* Badges */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 9999px;
  font-size: 0.75rem; font-weight: 500;
}
.badge-primary { background: hsla(174, 100%, 42%, 0.15); color: var(--primary); }
.badge-success { background: hsla(142, 76%, 36%, 0.15); color: var(--success); }
.badge-warning { background: hsla(38, 92%, 50%, 0.15); color: var(--warning); }
.badge-destructive { background: hsla(0, 72%, 51%, 0.15); color: var(--destructive); }

/* Login page */
.login-wrapper {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 16px; position: relative; overflow: hidden;
}
.login-bg-blob {
  position: absolute; border-radius: 50%;
  filter: blur(128px); pointer-events: none;
}
.login-bg-blob-1 {
  width: 400px; height: 400px; top: -100px; right: -100px;
  background: hsla(174, 100%, 42%, 0.05);
}
.login-bg-blob-2 {
  width: 300px; height: 300px; bottom: -50px; left: -50px;
  background: hsla(174, 100%, 42%, 0.08);
}
.login-card {
  width: 100%; max-width: 420px; position: relative; z-index: 1;
  padding: 40px; text-align: center;
}
.login-logo { margin-bottom: 8px; }
.login-logo img { height: 32px; }
.login-subtitle { color: var(--muted-foreground); font-size: 0.875rem; margin-bottom: 32px; }
.login-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--muted-foreground); font-size: 0.75rem;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.login-buttons { display: flex; flex-direction: column; gap: 12px; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { padding: 20px; }
.stat-label { font-size: 0.75rem; color: var(--muted-foreground); margin-bottom: 4px; }
.stat-value { font-size: 1.5rem; font-weight: 600; font-family: 'Space Grotesk', sans-serif; }

/* Page header */
.page-header { margin-bottom: 24px; }
.page-title { font-size: 1.5rem; font-weight: 600; }
.page-description { color: var(--muted-foreground); font-size: 0.875rem; margin-top: 4px; }

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }

/* Card title */
.card-title { font-size: 1rem; font-weight: 600; font-family: 'Space Grotesk', sans-serif; }

/* Tier name */
.tier-name { font-size: 1.75rem; font-weight: 700; font-family: 'Space Grotesk', sans-serif; }

/* Progress bar */
.progress-header { display: flex; justify-content: space-between; font-size: 0.875rem; margin-bottom: 8px; }
.progress-label { color: var(--muted-foreground); }
.progress-value { font-weight: 500; }
.progress-bar { width: 100%; height: 8px; background: var(--secondary); border-radius: 9999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 9999px; transition: width 0.5s ease; }

/* Tables */
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th { text-align: left; padding: 12px 16px; color: var(--muted-foreground); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px 16px; border-bottom: 1px solid hsla(213, 35%, 18%, 0.5); }
.data-table tbody tr:hover { background: hsla(174, 100%, 42%, 0.02); }
.font-medium { font-weight: 500; }

/* Modal/Dialog */
.modal-dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--foreground); padding: 0; max-width: 520px; width: 90vw; margin: auto; }
.modal-dialog::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); }
.modal-content { padding: 24px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h3 { font-size: 1.125rem; font-weight: 600; font-family: 'Space Grotesk', sans-serif; }
.modal-close { background: none; border: none; color: var(--muted-foreground); font-size: 1.5rem; cursor: pointer; padding: 4px; line-height: 1; }
.modal-close:hover { color: var(--foreground); }

/* Form layout */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-label { font-size: 0.8125rem; color: var(--muted-foreground); font-weight: 500; }

/* Select styling */
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; cursor: pointer; }
/* ===== View Toggle ===== */
.view-toggle {
  display: flex; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
}
.view-toggle-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; font-size: 0.813rem; font-weight: 500;
  color: var(--muted-foreground); text-decoration: none;
  transition: all 0.15s;
}
.view-toggle-btn:hover { color: var(--foreground); }
.view-toggle-btn.active {
  background: var(--primary); color: var(--primary-foreground);
}
.view-toggle-btn svg { width: 14px; height: 14px; }

/* ===== Tab Bar ===== */
.tab-bar {
  display: flex; gap: 2px; background: var(--secondary);
  border-radius: var(--radius); padding: 4px;
  width: fit-content;
}
.tab-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: calc(var(--radius) - 2px);
  font-size: 0.813rem; font-weight: 500;
  color: var(--muted-foreground); text-decoration: none;
  transition: all 0.15s;
}
.tab-item:hover { color: var(--foreground); }
.tab-item.active {
  background: var(--card); color: var(--foreground);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.tab-item svg { width: 16px; height: 16px; }

/* ===== Radial Gauge ===== */
.gauge-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 24px; padding: 16px 24px 24px;
  justify-items: center;
}
@media (max-width: 768px) { .gauge-grid { grid-template-columns: repeat(2, 1fr); } }

.gauge-wrapper {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.gauge-svg-container {
  position: relative; width: 140px; height: 140px;
}
.gauge-svg { transform: rotate(-90deg); }
.gauge-progress {
  transition: stroke-dashoffset 1s ease-out, stroke 0.3s ease;
}
.gauge-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.gauge-percent {
  font-size: 1.25rem; font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
}
.gauge-value {
  font-size: 0.625rem; color: var(--muted-foreground);
}
.gauge-label {
  font-size: 0.75rem; color: var(--muted-foreground);
  text-align: center; line-height: 1.3; max-width: 120px;
}
.gauge-target {
  font-size: 0.625rem; color: var(--muted-foreground);
  opacity: 0.6;
}

/* ===== RAG Color Classes ===== */
.rag-green { color: hsl(142, 76%, 36%); }
.rag-amber { color: hsl(38, 92%, 50%); }
.rag-red { color: hsl(0, 72%, 51%); }
.rag-green-bg { background: hsl(142, 76%, 36%); }
.rag-amber-bg { background: hsl(38, 92%, 50%); }
.rag-red-bg { background: hsl(0, 72%, 51%); }

/* ===== KPI Summary Cards ===== */
.kpi-summary-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 24px;
}
@media (max-width: 768px) { .kpi-summary-grid { grid-template-columns: repeat(2, 1fr); } }

.kpi-summary-card { padding: 0; overflow: hidden; }
.kpi-summary-bar { height: 3px; }
.kpi-summary-label { font-size: 0.688rem; color: var(--muted-foreground); }
.kpi-summary-value {
  font-size: 1.125rem; font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
}
.kpi-progress-row {
  display: flex; align-items: center; gap: 8px; margin-top: 4px;
}
.kpi-progress-track {
  flex: 1; height: 5px; border-radius: 999px; overflow: hidden;
  background: hsl(230, 20%, 18%);
}
.kpi-progress-fill {
  height: 100%; border-radius: 999px;
  transition: width 0.7s ease;
}
.kpi-progress-pct { font-size: 0.625rem; font-weight: 500; }

/* ===== Podium ===== */
.podium-container {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 12px; padding: 24px 16px 8px;
}
@media (min-width: 768px) { .podium-container { gap: 24px; } }

.podium-entry {
  display: flex; flex-direction: column; align-items: center;
}
.podium-icon { margin-bottom: 8px; }
.podium-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--secondary); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem; font-weight: 700; color: var(--primary);
  margin-bottom: 8px;
}
.podium-avatar-gold {
  width: 56px; height: 56px; font-size: 1rem;
  box-shadow: 0 0 0 2px hsl(45, 93%, 47%, 0.6), 0 0 0 4px var(--background);
}
.podium-name {
  font-size: 0.75rem; font-weight: 600; text-align: center;
  max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.podium-name-lg { font-size: 0.875rem; max-width: 100px; }
.podium-billed {
  font-size: 0.625rem; font-weight: 700; color: var(--primary);
  font-family: 'Space Grotesk', sans-serif; margin-top: 2px;
}
.podium-placements {
  font-size: 0.5625rem; color: var(--muted-foreground);
}
.podium-block {
  margin-top: 8px; border-radius: 12px 12px 0 0;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 12px;
  width: 80px;
}
@media (min-width: 768px) { .podium-block { width: 112px; } }

.podium-block-0 {
  height: 140px;
  background: linear-gradient(to top, hsla(210, 10%, 65%, 0.1), hsla(210, 10%, 65%, 0.3));
  border: 1px solid hsla(210, 10%, 65%, 0.4); border-bottom: none;
}
.podium-block-1 {
  height: 180px;
  background: linear-gradient(to top, hsla(45, 93%, 47%, 0.1), hsla(45, 93%, 47%, 0.3));
  border: 1px solid hsla(45, 93%, 47%, 0.4); border-bottom: none;
}
.podium-block-2 {
  height: 110px;
  background: linear-gradient(to top, hsla(30, 80%, 50%, 0.1), hsla(30, 80%, 50%, 0.2));
  border: 1px solid hsla(30, 80%, 50%, 0.3); border-bottom: none;
}
.podium-rank {
  font-size: 1.5rem; font-weight: 900; opacity: 0.4;
  font-family: 'Space Grotesk', sans-serif;
}

/* ===== Leaderboard Rows ===== */
.leaderboard-row {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px; border-radius: var(--radius);
  transition: background 0.15s;
}
.leaderboard-row:hover { background: hsla(213, 40%, 15%, 0.4); }
.leaderboard-rank {
  width: 32px; text-align: center;
  font-size: 0.875rem; font-weight: 700; color: var(--muted-foreground);
}
.leaderboard-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--secondary); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: var(--primary);
  flex-shrink: 0;
}
.leaderboard-info { flex: 1; min-width: 0; }
.leaderboard-name-row { display: flex; align-items: center; gap: 6px; }
.leaderboard-name {
  font-size: 0.875rem; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.leaderboard-placements {
  font-size: 0.625rem; color: var(--muted-foreground);
}
.leaderboard-billed {
  font-size: 0.875rem; font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
}

/* ===== Stat Icon ===== */
.stat-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--secondary);
  display: flex; align-items: center; justify-content: center;
}

/* ===== Dialog / Modal ===== */
.dialog-overlay {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 16px;
}
.dialog-overlay:target { display: flex; }
.dialog-content {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); width: 100%; max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.dialog-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 12px;
}
.dialog-header h3 {
  font-size: 1.1rem; font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}
.dialog-close {
  font-size: 1.5rem; color: var(--muted-foreground);
  text-decoration: none; line-height: 1;
}
.dialog-close:hover { color: var(--foreground); }
.dialog-body { padding: 0 24px 16px; }
.dialog-footer { padding: 0 24px 20px; }

/* ===== Form Styles ===== */
.form-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.form-label {
  font-size: 0.813rem; color: var(--muted-foreground);
  white-space: nowrap;
}
.form-group { margin-bottom: 12px; }
.form-group .form-label { display: block; margin-bottom: 4px; }
textarea.input { resize: vertical; min-height: 60px; }

/* ===== Data Table ===== */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table th {
  text-align: left; padding: 10px 16px;
  font-size: 0.75rem; font-weight: 600;
  color: var(--muted-foreground); text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid hsla(213, 35%, 18%, 0.3);
}
.data-table tbody tr:hover { background: hsla(213, 40%, 15%, 0.3); }

/* ===== Card Header Row ===== */
.card-header-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
}
.card-header-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.1rem; font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}

/* ===== Delete button ===== */
.btn-icon-delete {
  padding: 6px; border-radius: var(--radius); background: none; border: none;
  color: var(--muted-foreground); cursor: pointer; transition: all 0.15s;
}
.btn-icon-delete:hover { background: hsla(0, 72%, 51%, 0.1); color: var(--destructive); }
.btn-icon-delete svg { width: 16px; height: 16px; }

/* ===== Empty State ===== */
.empty-state {
  padding: 48px 24px; text-align: center;
  color: var(--muted-foreground); font-size: 0.875rem;
}

/* ===== Light Mode ===== */
body.light {
  --background: hsl(210, 40%, 98%);
  --foreground: hsl(213, 50%, 10%);
  --card: hsl(0, 0%, 100%);
  --card-foreground: hsl(213, 50%, 10%);
  --primary: hsl(174, 100%, 32%);
  --primary-foreground: hsl(0, 0%, 100%);
  --secondary: hsl(213, 20%, 92%);
  --secondary-foreground: hsl(213, 50%, 10%);
  --muted: hsl(213, 15%, 90%);
  --muted-foreground: hsl(215, 20%, 45%);
  --border: hsl(213, 15%, 85%);
  --input: hsl(213, 15%, 90%);
  --sidebar-bg: hsl(210, 30%, 96%);
  --sidebar-border: hsl(213, 15%, 88%);
}

/* ===== Data Tables ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table thead { border-bottom: 1px solid var(--border); }
.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: hsla(174, 100%, 42%, 0.03); }


/* ===== Icon buttons ===== */
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--radius);
  background: none; border: none;
  color: var(--muted-foreground); cursor: pointer; transition: all 0.15s;
}
.btn-icon:hover { background: var(--secondary); color: var(--foreground); }
.btn-icon svg { width: 16px; height: 16px; }
.btn-icon-danger:hover { background: hsla(0, 72%, 51%, 0.1); color: var(--destructive); }

/* ===== Form layout ===== */
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-label { font-size: 0.8rem; color: var(--muted-foreground); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ===== Search Modal (Cmd+K Palette) ===== */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}
.search-palette {
  width: 560px;
  max-width: 90vw;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.search-palette-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--foreground);
  font-size: 1rem;
  font-family: inherit;
}
.search-palette-input::placeholder { color: var(--muted-foreground); }
.search-kbd {
  font-size: 0.625rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--secondary);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  font-family: inherit;
}
.search-results {
  max-height: 360px;
  overflow-y: auto;
}
.search-group { padding: 8px 0; }
.search-group-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  padding: 4px 16px;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  color: var(--foreground);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s;
}
.search-result-item:hover,
.search-result-item.active {
  background: var(--secondary);
}
.search-result-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  flex-shrink: 0;
}
.search-result-text { min-width: 0; }
.search-result-title { font-size: 0.875rem; font-weight: 500; }
.search-result-subtitle { font-size: 0.75rem; color: var(--muted-foreground); }
.search-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* ===== Select styling ===== */
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

/* ===== View-As ===== */
.view-as-select {
  width: 100%; padding: 6px 8px;
  background: var(--secondary); border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px); color: var(--foreground);
  font-size: 0.8125rem; font-family: inherit;
  outline: none; transition: border-color 0.15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  padding-right: 28px; cursor: pointer;
}
.view-as-select:focus { border-color: var(--primary); }
.view-as-banner {
  background: hsla(38, 92%, 50%, 0.15); border: 1px solid hsla(38, 92%, 50%, 0.3);
  color: hsl(38, 92%, 50%); padding: 10px 16px; border-radius: var(--radius);
  margin-bottom: 16px; display: flex; align-items: center;
  justify-content: space-between; font-size: 0.875rem;
}
.view-as-banner button {
  background: none; border: none; color: var(--primary);
  cursor: pointer; font-weight: 500; text-decoration: underline;
  font-family: inherit; font-size: 0.875rem;
}

/* ===== Coming Soon Stub ===== */
.coming-soon-card { max-width: 480px; margin: 80px auto; text-align: center; padding: 48px; }
.coming-soon-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.6; }
.coming-soon-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 8px; font-family: 'Space Grotesk', sans-serif; }
.coming-soon-text { color: var(--muted-foreground); font-size: 0.875rem; margin-bottom: 24px; }
.coming-soon-badge {
  display: inline-flex; padding: 4px 12px; border-radius: 9999px;
  background: hsla(174, 100%, 42%, 0.15); color: var(--primary);
  font-size: 0.75rem; font-weight: 600;
}

/* ===== Nav section muted (for admin section when viewing-as) ===== */
.nav-section-muted { opacity: 0.5; }
.nav-section-muted .nav-item { opacity: 0.7; }
