/* ═══════════════════════════════════════════════════════════
   Driver Watchdog — Design System
   Font: Inter (800/900 heavy)
   Primary: #0F2AF6 | Secondary: #0BA8ED | Dark: #071126
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── Variables ───────────────────────────────────────────── */
:root {
  --primary:       #0F2AF6;
  --primary-dark:  #07168c;
  --secondary:     #0BA8ED;
  --primary-grad:  linear-gradient(135deg, #0F2AF6, #0BA8ED);

  --dark:          #071126;
  --navy:          #0b1633;
  --ink:           #07111f;

  --bg:            #f5f8ff;
  --soft:          #eef4ff;
  --card:          #ffffff;

  --text:          #07111f;
  --muted:         #607089;
  --dim:           #475467;

  --line:          #e4e9f6;
  --line-blue:     rgba(15,42,246,.14);

  --success:       #12b76a;
  --warning:       #f79009;
  --danger:        #ef4444;
  --purple:        #7c3aed;

  --success-bg:    #e7f8f1;
  --warning-bg:    #fff5df;
  --danger-bg:     #feecec;
  --info-bg:       #eef4ff;

  --shadow:        0 20px 60px rgba(15,42,246,.10);
  --shadow-sm:     0 10px 30px rgba(7,17,38,.06);
  --shadow-lg:     0 30px 90px rgba(15,42,246,.16);

  --radius:        24px;
  --radius-sm:     14px;
  --radius-pill:   999px;

  --sidebar-w:     280px;
  --header-h:      68px;

  --transition:    .2s ease;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; }

/* ── App Layout ──────────────────────────────────────────── */
.app-wrap {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  background: linear-gradient(180deg, #071126, #0c1d46);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  width: var(--sidebar-w);
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  padding: 24px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.logo-icon {
  width: 46px; height: 46px;
  border-radius: 16px;
  background: var(--primary-grad);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 12px 30px rgba(11,168,237,.32);
  flex-shrink: 0;
  color: #fff;
}
.logo-text strong {
  display: block;
  font-size: 17px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.02em;
}
.logo-text span {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #8194bf;
  margin-top: 1px;
}

.sidebar-nav {
  padding: 16px 0;
  flex: 1;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: #8194bf;
  padding: 16px 24px 8px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  color: #dbe7ff;
  font-size: 14px;
  font-weight: 700;
  border-radius: 0;
  transition: background var(--transition);
  text-decoration: none;
  margin: 1px 0;
}
.sidebar-nav a .nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-nav a .nav-icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-nav a:hover { background: rgba(255,255,255,.08); }
.sidebar-nav a.active {
  background: rgba(255,255,255,.12);
  color: #fff;
  border-right: 3px solid var(--secondary);
}
.sidebar-nav a .pill {
  font-size: 10px;
  background: rgba(11,168,237,.22);
  color: #a9e8ff;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-weight: 800;
}

.sidebar-footer {
  padding: 20px 24px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.upgrade-box {
  background: var(--primary-grad);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 18px 40px rgba(15,42,246,.28);
  margin-bottom: 16px;
}
.upgrade-box h4 {
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 6px;
}
.upgrade-box p {
  font-size: 12px;
  color: #dcecff;
  line-height: 1.5;
  margin-bottom: 12px;
}
.upgrade-box button {
  width: 100%;
  border: 0;
  background: #fff;
  color: var(--primary);
  font-weight: 900;
  font-size: 13px;
  border-radius: var(--radius-pill);
  padding: 10px;
  cursor: pointer;
  transition: var(--transition);
}
.upgrade-box button:hover { opacity: .9; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 13px;
  color: #a9e8ff;
  flex-shrink: 0;
}
.user-info-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.user-info-role {
  font-size: 11px;
  color: #8194bf;
}

/* ── Main Content ─────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--header-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.03em;
  flex: 1;
}
.topbar-search {
  flex: 1;
  max-width: 480px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--soft);
  display: grid;
  place-items: center;
  font-weight: 900;
  color: var(--primary);
  font-size: 14px;
  border: 2px solid var(--line-blue);
}

.page-content {
  padding: 28px 32px 48px;
  flex: 1;
}

/* ── Typography ──────────────────────────────────────────── */
h1 { font-size: 32px; font-weight: 900; letter-spacing: -.04em; line-height: 1.1; }
h2 { font-size: 24px; font-weight: 900; letter-spacing: -.03em; line-height: 1.15; }
h3 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
h4 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }

.text-muted   { color: var(--muted); }
.text-dim     { color: var(--dim); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.mono { font-family: 'DM Mono', 'Courier New', monospace; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  font-weight: 800;
  border-radius: var(--radius-pill);
  padding: 13px 20px;
  font-size: 14px;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn-sm  { padding: 9px 16px; font-size: 13px; }
.btn-lg  { padding: 16px 28px; font-size: 16px; }
.btn-full { width: 100%; }

.btn-primary {
  background: var(--primary-grad);
  color: #fff;
  box-shadow: 0 16px 36px rgba(15,42,246,.25);
}
.btn-primary:hover { box-shadow: 0 20px 44px rgba(15,42,246,.34); }

.btn-secondary {
  background: var(--soft);
  color: var(--primary-dark);
  border: 1px solid var(--line-blue);
}
.btn-secondary:hover { background: #e0eaff; }

.btn-ghost {
  background: var(--soft);
  color: var(--dim);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.btn-dark {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 16px 36px rgba(7,17,31,.18);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-header h3 { font-size: 17px; }
.card-body   { padding: 24px; }
.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--soft);
}

/* ── Hero Card (dashboard) ───────────────────────────────── */
.hero-card {
  background: radial-gradient(circle at top right, rgba(11,168,237,.28), transparent 38%),
              linear-gradient(135deg, #081536, #102a73);
  color: #fff;
  border-radius: 32px;
  padding: 32px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1.5fr .9fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.hero-card h1 {
  font-size: 32px;
  line-height: 1.05;
  margin: 0 0 10px;
  letter-spacing: -.04em;
  color: #fff;
}
.hero-card p { color: #cad9ff; line-height: 1.7; margin: 0; }
.hero-card .mini {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.hero-card .mini span {
  background: rgba(255,255,255,.11);
  border: 1px solid rgba(255,255,255,.13);
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 12px;
}
.protection-score {
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 24px;
  padding: 22px;
}
.protection-score .num {
  font-size: 54px;
  font-weight: 900;
  letter-spacing: -.08em;
  line-height: 1;
}
.protection-score small { color: #c4d7ff; font-weight: 700; font-size: 12px; }
.score-bar {
  height: 10px;
  background: rgba(255,255,255,.15);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 16px;
}
.score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0BA8ED, #fff);
  border-radius: var(--radius-pill);
}

/* ── Stat Cards ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.stat-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 10px;
}
.stat-value {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -.05em;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-trend {
  font-size: 13px;
  font-weight: 800;
}
.stat-trend.up      { color: var(--success); }
.stat-trend.warn    { color: var(--warning); }
.stat-trend.down    { color: var(--danger); }
.stat-trend.neutral { color: var(--muted); }

/* ── Tags / Badges ───────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.tag.green   { background: var(--success-bg); color: var(--success); }
.tag.red     { background: var(--danger-bg);  color: var(--danger); }
.tag.orange  { background: var(--warning-bg); color: #b77905; }
.tag.blue    { background: var(--info-bg);    color: var(--primary); }
.tag.muted   { background: var(--soft);       color: var(--muted); }

/* Aliases for existing code */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 800; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: #b77905; }
.badge-info    { background: var(--info-bg);    color: var(--primary); }
.badge-muted   { background: var(--soft);       color: var(--muted); }
.badge-accent  { background: var(--info-bg);    color: var(--primary); }

/* ── Alerts / Flash ──────────────────────────────────────── */
.alert {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  border: 1px solid;
  margin-bottom: 16px;
}
.alert-success { background: var(--success-bg); border-color: rgba(18,183,106,.25); color: #0a7a46; }
.alert-error   { background: var(--danger-bg);  border-color: rgba(239,68,68,.25);  color: #b91c1c; }
.alert-warning { background: var(--warning-bg); border-color: rgba(247,144,9,.25);  color: #92400e; }
.alert-info    { background: var(--info-bg);    border-color: var(--line-blue);     color: var(--primary-dark); }
.alert .alert-body { color: var(--dim); }

/* Watchdog alert cards (dashboard) */
.watchdog-alerts { display: grid; gap: 12px; }
.watchdog-alert {
  display: flex;
  gap: 13px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}
.alert-icon {
  width: 42px; height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 900;
  flex-shrink: 0;
  font-size: 16px;
}
.alert-icon.red    { background: var(--danger-bg);  color: var(--danger); }
.alert-icon.orange { background: var(--warning-bg); color: var(--warning); }
.alert-icon.blue   { background: var(--info-bg);    color: var(--primary); }
.alert-icon.green  { background: var(--success-bg); color: var(--success); }
.watchdog-alert h3 { font-size: 14px; margin: 0 0 4px; }
.watchdog-alert p  { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }

/* ── Forms ───────────────────────────────────────────────── */
.form-grid   { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid-4 { grid-template-columns: repeat(4, 1fr); }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--dim);
}
label .required { color: var(--primary); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 500;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15,42,246,.10);
}
input::placeholder, textarea::placeholder { color: #b0baca; font-weight: 400; }
textarea { resize: vertical; min-height: 100px; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23607089'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-hint  { font-size: 12px; color: var(--muted); margin-top: 3px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 3px; }

.input-prefix { position: relative; display: flex; align-items: center; }
.input-prefix::before {
  content: '$';
  position: absolute;
  left: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}
.input-prefix input { padding-left: 26px; }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  background: #f7f9ff;
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
thead th a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
thead th a:hover { color: var(--primary); }
tbody tr { border-bottom: 1px solid var(--line); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--soft); }
tbody td {
  padding: 14px 16px;
  color: var(--dim);
  vertical-align: middle;
}
tbody td strong { color: var(--text); font-weight: 700; display: block; }
tbody td span   { font-size: 12px; color: var(--muted); }

.discrepancy-row { background: rgba(239,68,68,.03); }
.discrepancy-row:hover { background: rgba(239,68,68,.07) !important; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--dim);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all var(--transition);
}
.pagination a:hover { background: var(--soft); border-color: var(--line); color: var(--primary); }
.pagination .current { background: var(--primary-grad); color: #fff; box-shadow: 0 8px 20px rgba(15,42,246,.25); }
.pagination .total { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 20px; font-weight: 900; color: var(--text); margin-bottom: 8px; }
.empty-state p  { font-size: 14px; color: var(--muted); margin-bottom: 24px; }

/* ── Upload Zone ─────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--soft);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: #eef4ff;
}
.upload-zone .upload-icon { font-size: 36px; margin-bottom: 12px; opacity: 0.5; }
.upload-zone p { font-size: 14px; color: var(--muted); font-weight: 600; }
.upload-zone .upload-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.upload-zone input[type="file"] { display: none; }

/* ── Auth Pages ──────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 12%, rgba(11,168,237,.18), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(15,42,246,.14), transparent 28%),
    linear-gradient(180deg, #f7fbff 0%, #ffffff 86%);
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.auth-card-header {
  padding: 30px 32px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.auth-logo .icon {
  width: 44px; height: 44px;
  background: var(--primary-grad);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 12px 30px rgba(15,42,246,.25);
}
.auth-logo h1 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.04em;
  color: var(--text);
}
.auth-card-header p { font-size: 14px; color: var(--muted); font-weight: 500; }
.auth-card-body  { padding: 28px 32px; }
.auth-footer {
  padding: 16px 32px;
  border-top: 1px solid var(--line);
  background: var(--soft);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

/* ── Trial Banner ────────────────────────────────────────── */
.trial-banner {
  background: linear-gradient(135deg, rgba(15,42,246,.08), rgba(11,168,237,.06));
  border: 1px solid var(--line-blue);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 600;
}
.trial-banner strong { color: var(--primary); }

.trial-bar { margin-bottom: 14px; }
.trial-bar .label { font-size: 11px; color: #8194bf; font-weight: 700; margin-bottom: 6px; }
.trial-bar .progress { height: 5px; background: rgba(255,255,255,.15); border-radius: 3px; overflow: hidden; }
.trial-bar .progress-fill { height: 100%; background: linear-gradient(90deg, #0BA8ED, #fff); border-radius: 3px; transition: width .5s ease; }

/* ── Filter Bar ──────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar input, .filter-bar select {
  max-width: 180px;
  padding: 9px 12px;
  font-size: 13px;
  border-radius: var(--radius-pill);
}
.filter-bar .filter-sep { width: 1px; height: 20px; background: var(--line); }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,17,38,.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(8px);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  padding: 20px 26px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-close {
  background: var(--soft);
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.modal-close:hover { background: var(--line); color: var(--text); }
.modal-body   { padding: 26px; }
.modal-footer {
  padding: 18px 26px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Pro Gate ────────────────────────────────────────────── */
.pro-gate {
  text-align: center;
  padding: 52px 24px;
  background: var(--soft);
  border-radius: var(--radius);
  border: 2px dashed var(--line-blue);
}
.pro-gate .pro-icon { font-size: 44px; margin-bottom: 12px; }
.pro-gate h3 { font-size: 22px; font-weight: 900; margin-bottom: 10px; letter-spacing: -.03em; }
.pro-gate p  { font-size: 14px; color: var(--muted); margin-bottom: 24px; font-weight: 500; }

/* ── Section Headers ─────────────────────────────────────── */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title h2 { font-size: 19px; margin: 0; letter-spacing: -.03em; }
.section-title a  { font-weight: 800; color: var(--primary); font-size: 13px; }

/* ── Utilities ───────────────────────────────────────────── */
.flex            { display: flex; }
.grid            { display: grid; }
.gap-4           { gap: 4px; }
.gap-8           { gap: 8px; }
.gap-12          { gap: 12px; }
.gap-16          { gap: 16px; }
.gap-20          { gap: 20px; }
.gap-24          { gap: 24px; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.ml-auto         { margin-left: auto; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border-width: 0;
}

/* ── Mobile menu toggle ──────────────────────────────────── */
#menuToggle { display: none; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1050px) {
  .app-wrap { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); transition: transform 220ms ease; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  #menuToggle { display: flex; }
  .hero-card { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid-3, .form-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .form-grid, .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
  .auth-card-body, .auth-card-header, .auth-footer { padding-left: 20px; padding-right: 20px; }
  .filter-bar input, .filter-bar select { max-width: 100%; }
  .hero-card { padding: 22px; border-radius: 22px; }
}