/* ═══════════════════════════════════════════════════════════════════════════
   HireScope — Design System
   Dark navy theme with blue accent, emerald success, amber warning, rose error
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ────────────────────────────────────────────────────────── */
:root {
  /* Surfaces */
  --bg:        #0D1526;
  --panel:     #131F35;
  --card:      #182440;
  --card-h:    #1E2D50;
  --input:     #1A2845;

  /* Borders */
  --border:    #243355;
  --border-h:  #2E4070;

  /* Brand */
  --accent:    #3B82F6;
  --accent-h:  #2563EB;
  --accent-lo: #3B82F614;
  --accent-md: #3B82F630;

  /* Semantic */
  --emerald:   #10B981;
  --emerald-lo:#10B98114;
  --amber:     #F59E0B;
  --amber-lo:  #F59E0B14;
  --rose:      #F43F5E;
  --rose-lo:   #F43F5E14;
  --purple:    #8B5CF6;
  --purple-lo: #8B5CF614;
  --cyan:      #06B6D4;

  /* Text */
  --text:      #E2E8F0;
  --muted:     #94A3B8;
  --dim:       #5A6E8C;

  /* Misc */
  --radius-sm: 7px;
  --radius:    11px;
  --radius-lg: 16px;
  --shadow:    0 4px 24px #00000040;
  --font:      'Inter', system-ui, -apple-system, sans-serif;
}

/* ── RESET ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text);
       min-height: 100vh; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; color: var(--text); }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-md); }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-h); }
input[type="range"] { accent-color: var(--accent); width: 100%; cursor: pointer; }
color-scheme: dark;

/* ── ANIMATIONS ───────────────────────────────────────────────────────────── */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes fadeUp  { from { opacity:0; transform:translateY(8px); }  to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }
@keyframes pulse   { 0%,100% { box-shadow:0 0 0 3px #10B98133; } 50% { box-shadow:0 0 0 7px #10B98100; } }
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }

/* ── TYPOGRAPHY ───────────────────────────────────────────────────────────── */
h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 600; }
.text-muted { color: var(--muted); font-size: 13px; }
.text-dim   { color: var(--dim);   font-size: 12px; }
.label-caps { font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
              color: var(--dim); text-transform: uppercase; }

/* ── BUTTONS ──────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent); color: #fff; border-radius: var(--radius-sm);
  padding: 10px 18px; font-size: 13px; font-weight: 700;
  transition: background 0.15s, transform 0.1s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary:hover  { background: var(--accent-h); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.btn-full { width: 100%; justify-content: center; padding: 12px; }

.btn-secondary {
  background: var(--card); color: var(--muted);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 16px; font-size: 13px; font-weight: 600;
  transition: border-color 0.15s, color 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
  background: var(--rose-lo); color: var(--rose);
  border: 1px solid color-mix(in srgb, var(--rose) 40%, transparent);
  border-radius: var(--radius-sm); padding: 9px 16px;
  font-size: 13px; font-weight: 600;
  transition: background 0.15s;
}
.btn-danger:hover { background: #F43F5E22; }

.btn-ghost {
  background: none; color: var(--muted); border-radius: var(--radius-sm);
  padding: 7px 12px; font-size: 13px; transition: background 0.15s, color 0.15s;
}
.btn-ghost:hover { background: var(--card); color: var(--text); }

.btn-icon {
  background: none; color: var(--dim); border-radius: var(--radius-sm);
  padding: 5px 8px; font-size: 15px; transition: color 0.15s, background 0.15s;
  line-height: 1;
}
.btn-icon:hover { color: var(--text); background: var(--card); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── FORM ELEMENTS ────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--muted); margin-bottom: 6px; letter-spacing: 0.01em;
}
.form-label .hint { font-weight: 400; color: var(--dim); }

.form-input {
  width: 100%; background: var(--input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 12px; color: var(--text);
  font-size: 13px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
  color-scheme: dark;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-lo); }
.form-input::placeholder { color: var(--dim); }
textarea.form-input { resize: vertical; min-height: 80px; }
select.form-input { cursor: pointer; }
.form-input-sm { padding: 6px 10px; font-size: 12px; }

/* ── ALERTS ───────────────────────────────────────────────────────────────── */
.alert {
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 13px; border: 1px solid; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 8px;
}
.alert-error  { background: var(--rose-lo);    color: var(--rose);    border-color: color-mix(in srgb, var(--rose) 35%, transparent); }
.alert-ok     { background: var(--emerald-lo); color: var(--emerald); border-color: color-mix(in srgb, var(--emerald) 35%, transparent); }
.alert-warn   { background: var(--amber-lo);   color: var(--amber);   border-color: color-mix(in srgb, var(--amber) 35%, transparent); }

/* ── CARD ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px;
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 18px; color: var(--text); }
.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

/* ── BADGES ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600;
  border: 1px solid;
}
.badge-remote  { color: var(--emerald); border-color: color-mix(in srgb, var(--emerald) 40%, transparent); background: var(--emerald-lo); }
.badge-hybrid  { color: var(--amber);   border-color: color-mix(in srgb, var(--amber) 40%, transparent);   background: var(--amber-lo); }
.badge-onsite  { color: var(--muted);   border-color: var(--border);  background: var(--card); }
.badge-type    { color: var(--purple);  border-color: color-mix(in srgb, var(--purple) 40%, transparent); background: var(--purple-lo); }
.badge-source  { color: var(--dim);     border-color: var(--border);  background: var(--card); }
.badge-status-saved      { color: var(--muted);   border-color: var(--border);  background: var(--card); }
.badge-status-applied    { color: var(--accent);  border-color: color-mix(in srgb, var(--accent) 40%, transparent);  background: var(--accent-lo); }
.badge-status-interview  { color: var(--amber);   border-color: color-mix(in srgb, var(--amber) 40%, transparent);   background: var(--amber-lo); }
.badge-status-offer      { color: var(--emerald); border-color: color-mix(in srgb, var(--emerald) 40%, transparent); background: var(--emerald-lo); }
.badge-status-rejected   { color: var(--rose);    border-color: color-mix(in srgb, var(--rose) 40%, transparent);    background: var(--rose-lo); }
.badge-status-withdrawn  { color: var(--dim);     border-color: var(--border);  background: var(--card); }

/* ── PULSE DOT ────────────────────────────────────────────────────────────── */
.pulse-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; flex-shrink: 0;
}
.dot-hot    { background: var(--emerald); animation: pulse 2s ease infinite; }
.dot-fresh  { background: var(--accent); }
.dot-recent { background: var(--amber); }
.dot-older  { background: var(--dim); }

/* ── SPINNER / LOADING ────────────────────────────────────────────────────── */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.65s linear infinite;
  margin: 0 auto 12px;
}
.loading-state { text-align: center; padding: 64px 20px; color: var(--dim); }
.loading-state p { font-size: 13px; margin-top: 4px; }

/* ── SITE HEADER ──────────────────────────────────────────────────────────── */
.site-header {
  background: var(--panel); border-bottom: 1px solid var(--border);
  height: 56px; display: flex; align-items: center; padding: 0 20px;
  gap: 8px; position: sticky; top: 0; z-index: 200;
  backdrop-filter: blur(8px);
}
.logo {
  font-size: 17px; font-weight: 900; letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent) 0%, var(--cyan) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-right: 8px; flex-shrink: 0;
}
.site-nav { display: flex; gap: 2px; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 6px;
  color: var(--dim); padding: 7px 11px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; text-decoration: none;
  transition: color 0.15s, background 0.15s; white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--card); }
.nav-link.active { color: var(--accent); background: var(--accent-lo); }
.nav-badge {
  background: var(--accent); color: #fff; border-radius: 20px;
  padding: 1px 6px; font-size: 10px; font-weight: 700; min-width: 18px;
  text-align: center;
}
.header-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.live-chip {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--dim);
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 10px;
}

/* ── AUTH PAGES ───────────────────────────────────────────────────────────── */
.auth-body { display: flex; align-items: center; justify-content: center;
             min-height: 100vh; background: var(--bg); padding: 20px; }
.auth-wrap { width: 100%; max-width: 400px; }
.auth-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow);
}
.auth-logo {
  font-size: 20px; font-weight: 900; letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 24px; display: block;
}
.auth-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; letter-spacing: -0.02em; }
.auth-sub { color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.auth-footer { text-align: center; color: var(--dim); font-size: 13px; margin-top: 20px; }
.auth-footer a { color: var(--accent); font-weight: 600; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--dim); font-size: 12px; margin: 20px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── PAGE LAYOUT ──────────────────────────────────────────────────────────── */
.page-wrap { max-width: 1080px; margin: 0 auto; padding: 28px 20px; }
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-header h1 { letter-spacing: -0.02em; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* ── SEARCH LAYOUT ────────────────────────────────────────────────────────── */
.search-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: 1fr;
  height: calc(100vh - 56px);
  overflow: hidden;
}
.search-layout.detail-open {
  grid-template-columns: 220px 1fr 380px;
}

/* ── FILTER SIDEBAR ───────────────────────────────────────────────────────── */
.filters-sidebar {
  background: var(--panel); border-right: 1px solid var(--border);
  overflow-y: auto; padding: 16px;
  scrollbar-width: thin;
}
.filters-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.filter-section { margin-bottom: 18px; }
.filter-section-title {
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
  color: var(--dim); margin-bottom: 8px; text-transform: uppercase;
}
.filter-pills { display: flex; flex-direction: column; gap: 3px; }
.pill {
  background: none; border: 1px solid var(--border);
  color: var(--muted); border-radius: var(--radius-sm); padding: 7px 10px;
  font-size: 12px; font-weight: 500; text-align: left;
  transition: all 0.12s; cursor: pointer;
}
.pill:hover { border-color: var(--border-h); color: var(--text); }
.pill.active {
  background: var(--accent-lo); border-color: var(--accent);
  color: var(--accent); font-weight: 700;
}
.salary-labels {
  display: flex; justify-content: space-between;
  margin-bottom: 6px; font-size: 11px; font-weight: 700; color: var(--emerald);
}
.range-group { display: flex; flex-direction: column; gap: 6px; }

/* ── JOB GRID SECTION ─────────────────────────────────────────────────────── */
.grid-section { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.grid-toolbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: var(--panel); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.result-count { color: var(--muted); font-size: 13px; flex: 1; }
.result-count strong { color: var(--text); font-weight: 700; }
.job-grid {
  flex: 1; overflow-y: auto; padding: 16px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px; align-content: start;
}
.pagination {
  display: flex; gap: 6px; justify-content: center; align-items: center;
  padding: 12px 16px; background: var(--panel); border-top: 1px solid var(--border);
  flex-shrink: 0; flex-wrap: wrap;
}
.page-btn {
  background: var(--card); border: 1px solid var(--border);
  color: var(--muted); border-radius: var(--radius-sm);
  padding: 5px 11px; font-size: 12px; font-weight: 500;
  transition: all 0.12s; cursor: pointer;
}
.page-btn:hover  { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }

/* ── JOB CARD ─────────────────────────────────────────────────────────────── */
.job-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; cursor: pointer;
  transition: border-color 0.15s, transform 0.12s, background 0.15s;
  position: relative; animation: fadeUp 0.18s ease both;
}
.job-card:hover   { border-color: var(--border-h); background: var(--card-h); transform: translateY(-1px); }
.job-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-lo); }

.job-card-top { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.job-logo {
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.job-title-group { flex: 1; min-width: 0; padding-right: 28px; }
.job-title  { font-weight: 700; font-size: 13px; line-height: 1.35; color: var(--text); margin-bottom: 2px; }
.job-company{ color: var(--muted); font-size: 12px; }

.job-card-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }

.job-salary { font-weight: 800; font-size: 15px; color: var(--emerald); margin-bottom: 4px; }
.job-salary span { font-size: 11px; font-weight: 400; color: var(--dim); }
.job-location { color: var(--muted); font-size: 11px; margin-bottom: 8px; }

.job-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.job-tag {
  background: var(--panel); color: var(--dim); border: 1px solid var(--border);
  border-radius: 5px; padding: 2px 7px; font-size: 10px; font-weight: 500;
}

.job-card-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 9px; border-top: 1px solid var(--border);
}
.job-age { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; }

.save-btn {
  position: absolute; top: 11px; right: 11px;
  background: none; color: var(--dim); font-size: 16px;
  padding: 3px 4px; border-radius: 6px; line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.save-btn:hover { color: var(--amber); background: var(--amber-lo); }
.save-btn.saved { color: var(--amber); }

/* ── DETAIL PANEL ─────────────────────────────────────────────────────────── */
.detail-panel {
  background: var(--panel); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
  animation: fadeIn 0.18s ease;
}
.detail-panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 18px; border-bottom: 1px solid var(--border);
  flex-shrink: 0; position: sticky; top: 0; background: var(--panel); z-index: 5;
}
.detail-panel-body { flex: 1; overflow-y: auto; padding: 18px; }

.detail-co-header { display: flex; gap: 14px; margin-bottom: 16px; align-items: center; }
.detail-logo {
  width: 52px; height: 52px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0;
}
.detail-title   { font-weight: 800; font-size: 17px; margin-bottom: 3px; line-height: 1.2; }
.detail-company { color: var(--muted); font-size: 13px; }

.detail-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px;
}
.detail-stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.detail-stat-label { font-size: 10px; color: var(--dim); font-weight: 600; margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.05em; }
.detail-stat-val   { font-weight: 800; font-size: 14px; }

.competition-widget {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px;
}
.comp-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.comp-label { font-size: 11px; font-weight: 700; color: var(--muted); }
.comp-level { font-size: 11px; font-weight: 800; }
.comp-bar   { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.comp-fill  { height: 100%; border-radius: 3px; transition: width 0.6s ease; }
.comp-hint  { font-size: 10px; color: var(--dim); margin-top: 5px; }

.detail-section       { margin-bottom: 16px; }
.detail-section-label { font-size: 10px; font-weight: 800; color: var(--dim); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }
.skill-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.skill-chip  {
  background: var(--accent-lo); color: var(--accent);
  border: 1px solid var(--accent-md); border-radius: 6px;
  padding: 3px 10px; font-size: 11px; font-weight: 600;
}
.job-description { color: var(--muted); font-size: 12px; line-height: 1.75; white-space: pre-line; }
.detail-source { font-size: 11px; color: var(--dim); margin-bottom: 16px; }

.detail-actions { display: flex; gap: 8px; position: sticky; bottom: 0;
                  background: var(--panel); padding: 14px 0 2px; }
.detail-actions .btn-primary  { flex: 1; justify-content: center; }
.detail-actions .btn-secondary { flex: 1; justify-content: center; }
.track-btn { flex: 1; justify-content: center; }
.track-btn.tracking {
  background: var(--emerald-lo); color: var(--emerald);
  border-color: color-mix(in srgb, var(--emerald) 40%, transparent);
}

/* ── TRACKER PAGE ─────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 24px;
}
.stat-tile {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 12px; text-align: center; cursor: pointer;
  transition: all 0.15s;
}
.stat-tile:hover  { border-color: var(--border-h); }
.stat-tile.active { border-color: var(--accent); background: var(--accent-lo); }
.stat-num   { font-size: 28px; font-weight: 900; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 11px; color: var(--dim); }

.n-total     { color: var(--text); }
.n-applied   { color: var(--accent); }
.n-interview { color: var(--amber); }
.n-offer     { color: var(--emerald); }
.n-rejected  { color: var(--rose); }
.n-withdrawn { color: var(--dim); }

.app-list    { display: flex; flex-direction: column; gap: 8px; }
.app-row {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; display: grid;
  grid-template-columns: 40px 1fr auto auto; gap: 12px; align-items: center;
  transition: border-color 0.15s;
}
.app-row:hover { border-color: var(--border-h); }
.app-logo-sm {
  width: 40px; height: 40px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.app-title { font-weight: 700; font-size: 13px; color: var(--text); margin-bottom: 2px; }
.app-meta  { font-size: 11px; color: var(--muted); }
.app-date  { font-size: 11px; color: var(--dim); margin-top: 2px; }

.status-select {
  border-radius: var(--radius-sm); padding: 6px 10px; font-size: 12px;
  font-weight: 600; border: 1px solid; background: var(--card);
  cursor: pointer; outline: none; color-scheme: dark;
  transition: border-color 0.15s;
}

.empty-state { text-align: center; padding: 72px 20px; color: var(--dim); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 14px; opacity: 0.6; }
.empty-state h3 { color: var(--muted); font-size: 16px; margin-bottom: 6px; }
.empty-state p  { font-size: 13px; }

/* ── CALENDAR ─────────────────────────────────────────────────────────────── */
.calendar-layout { display: grid; grid-template-columns: 1fr 290px; gap: 20px; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-nav h2 { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px;
  margin-bottom: 3px; text-align: center;
}
.cal-weekday { font-size: 10px; font-weight: 700; color: var(--dim); padding: 4px 0; text-transform: uppercase; letter-spacing: 0.05em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-cell {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 5px; min-height: 70px;
  transition: border-color 0.15s;
}
.cal-cell:hover { border-color: var(--border-h); }
.cal-cell.today { background: var(--accent-lo); border-color: var(--accent); }
.cal-cell.empty { background: transparent; border-color: transparent; }
.cal-date {
  font-size: 11px; font-weight: 500; color: var(--dim);
  text-align: center; margin-bottom: 4px;
}
.cal-cell.today .cal-date { color: var(--accent); font-weight: 800; }
.cal-event-chip {
  border-radius: 4px; font-size: 9px; font-weight: 600;
  padding: 2px 5px; margin-bottom: 2px; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis; line-height: 1.3;
}
.cal-more { font-size: 9px; color: var(--dim); text-align: center; padding: 1px 0; }

.cal-sidebar { display: flex; flex-direction: column; gap: 14px; }
.upcoming-list { display: flex; flex-direction: column; gap: 7px; }
.upcoming-item {
  background: var(--card); border: 1px solid var(--border);
  border-left-width: 3px; border-radius: var(--radius-sm);
  padding: 10px 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
}
.upcoming-title { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.upcoming-co    { font-size: 11px; color: var(--muted); }
.upcoming-when  { font-size: 11px; color: var(--dim); margin-top: 3px; }
.upcoming-note  { font-size: 11px; color: var(--dim); font-style: italic; margin-top: 2px; }

/* ── PROFILE PAGE ─────────────────────────────────────────────────────────── */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.section-subtitle { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }

/* ── ERROR PAGES ──────────────────────────────────────────────────────────── */
.error-body { display: flex; align-items: center; justify-content: center;
              min-height: 100vh; text-align: center; padding: 20px; }
.error-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.7; }
.error-code { font-size: 72px; font-weight: 900; color: var(--border);
              letter-spacing: -0.04em; line-height: 1; margin-bottom: 8px; }

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .search-layout.detail-open { grid-template-columns: 220px 1fr; }
  .detail-panel { display: none !important; }
  .stats-grid   { grid-template-columns: repeat(3, 1fr); }
  .profile-grid { grid-template-columns: 1fr; }
  .calendar-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .search-layout { grid-template-columns: 1fr; }
  .filters-sidebar { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .app-row { grid-template-columns: 1fr auto; }
  .app-logo-sm { display: none; }
}

/* ── DETAIL PANEL OVERRIDE — fixed slide-in overlay ── */
.search-layout.detail-open {
  grid-template-columns: 220px 1fr;
}
.detail-panel {
  position: fixed;
  top: 56px;
  right: 0;
  width: 420px;
  height: calc(100vh - 56px);
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 150;
  box-shadow: -8px 0 32px #00000060;
  animation: slideInRight 0.2s ease;
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── DETAIL PANEL OVERRIDE v2 ── */
.detail-panel {
  position: fixed;
  top: 56px;
  left: 220px;
  right: 0;
  width: auto;
  height: calc(100vh - 56px);
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 150;
  box-shadow: -8px 0 32px #00000060;
  animation: slideInRight 0.2s ease;
}

/* ── DETAIL PANEL OVERRIDE v3 ── */
.detail-panel[hidden] {
  display: none !important;
}

/* ── DETAIL PANEL OVERRIDE v3 ── */
.detail-panel[hidden] {
  display: none !important;
}
