/* Maetore Control Centre — Premium Admin UI
   Design language: deep teal/midnight, sharp edges, bold uppercase type,
   premium automotive-operations feel.
   ================================================================ */

:root {
  /* Core palette — drawn from branding-inpiration.png */
  --bg: #0a1f1f;             /* deep midnight teal */
  --bg-elevated: #0d2929;    /* cards on bg */
  --surface: #0f2f2f;        /* panels */
  --surface-2: #133838;      /* nested surfaces */
  --surface-3: #1a4545;      /* hover/raised */
  --border: #1f5252;         /* subtle teal border */
  --border-strong: #2a6a6a;  /* strong border for inputs */

  /* Accent — same teal as the SUV */
  --accent: #2dd4bf;         /* bright teal */
  --accent-hover: #5eead4;
  --accent-pressed: #14b8a6;
  --accent-dim: rgba(45, 212, 191, 0.12);
  --accent-glow: rgba(45, 212, 191, 0.25);

  /* Text */
  --text: #f1f5f4;
  --text-secondary: #a7c4c4;
  --text-muted: #6f9090;

  /* Status */
  --ok: #34d399;
  --ok-dim: rgba(52, 211, 153, 0.15);
  --warn: #fbbf24;
  --warn-dim: rgba(251, 191, 36, 0.15);
  --bad: #f87171;
  --bad-dim: rgba(248, 113, 113, 0.15);
  --info: #60a5fa;
  --info-dim: rgba(96, 165, 250, 0.15);

  /* Spacing */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;

  /* Type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --tracking-wide: 0.08em;
  --tracking-wider: 0.12em;

  /* Radii — SHARP per spec */
  --r-0: 0;
  --r-1: 2px;
  --r-2: 4px;
  --r-pill: 0;             /* use letterspacing for "pill" feel */

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
  --shadow-accent: 0 0 0 1px var(--accent), 0 0 16px var(--accent-glow);

  /* Layout */
  --sidebar-w: 240px;
  --topbar-h: 64px;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 120ms var(--ease);
  --t-base: 200ms var(--ease);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0a2929 0%, #061818 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--t-base);
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  body { padding-bottom: 0; }
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-5);
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  width: 36px; height: 36px;
  background: var(--accent);
  color: var(--bg);
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.04em;
  border-radius: var(--r-1);
}
.brand-mark-img {
  width: 36px; height: 36px;
  object-fit: contain;
  border-radius: var(--r-1);
  flex-shrink: 0;
  background: #ffffff;
  padding: 3px;
}
.brand-text { line-height: 1.1; }
.brand-name {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: var(--tracking-wide);
  color: var(--text);
}
.brand-sub {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  color: var(--text-muted);
  margin-top: 2px;
}

.sidenav {
  flex: 1;
  padding: var(--s-4) 0;
  overflow-y: auto;
}
.sidenav-section {
  padding: var(--s-4) var(--s-5) var(--s-2);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  color: var(--text-muted);
  text-transform: uppercase;
}
.sidenav-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  padding: var(--s-3) var(--s-5);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all var(--t-fast);
}
.sidenav-item:hover {
  background: var(--surface);
  color: var(--text);
}
.sidenav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-left-color: var(--accent);
}
.sidenav-item.active .sidenav-icon { color: var(--accent); }
.sidenav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  color: var(--text-muted);
  transition: color var(--t-fast);
}
.sidenav-item:hover .sidenav-icon { color: var(--text); }
.sidenav-item span:not(.sidenav-icon) { flex: 1; }
.sidenav-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  background: var(--surface-2);
  color: var(--text-secondary);
  min-width: 20px;
  text-align: center;
  border-radius: var(--r-1);
}
.sidenav-item.active .sidenav-badge { background: var(--accent); color: var(--bg); }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: var(--s-4) var(--s-5);
}
.user { display: flex; align-items: center; gap: var(--s-3); }
.user-avatar {
  width: 32px; height: 32px;
  background: var(--surface-3);
  color: var(--accent);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: var(--r-1);
}
.user-info { line-height: 1.2; }
.user-name { font-size: 0.85rem; font-weight: 600; }
.user-role { font-size: 0.7rem; color: var(--text-muted); }

.sidebar-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
}
.sidebar-backdrop:not(.hidden) { opacity: 1; pointer-events: auto; }
@media (min-width: 769px) { .sidebar-backdrop { display: none; } }

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}
@media (max-width: 768px) {
  .main-wrap { margin-left: 0; }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: 0 var(--s-6);
  background: rgba(10, 31, 31, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 36px; height: 36px;
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--r-1);
}
.topbar-menu span {
  height: 2px;
  background: var(--text);
  display: block;
  border-radius: 1px;
}
@media (max-width: 768px) { .topbar-menu { display: flex; } }
.topbar-title { flex: 1; }
.page-eyebrow {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  color: var(--accent);
  text-transform: uppercase;
}
.topbar h1 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 2px;
}
.topbar-actions { display: flex; align-items: center; gap: var(--s-3); }
.topbar-brand-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  background: #ffffff;
  padding: 4px 8px;
  border-radius: var(--r-1);
}
@media (max-width: 768px) { .topbar-brand-logo { display: none; } }
.topbar-icon {
  width: 36px; height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--r-1);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all var(--t-fast);
}
.topbar-icon:hover { background: var(--surface-2); color: var(--text); }

.main {
  padding: var(--s-6);
  max-width: 1400px;
}
@media (max-width: 768px) { .main { padding: var(--s-4); } }

/* ============================================================
   DASHBOARD
   ============================================================ */
.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: var(--s-6);
  gap: var(--s-4);
  flex-wrap: wrap;
}
.page-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: var(--s-1);
}
.page-header-actions { display: flex; gap: var(--s-2); }

/* Stat grid */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-3);
  margin-bottom: var(--s-6);
}
@media (max-width: 1024px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats { grid-template-columns: 1fr 1fr; } }

.stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: var(--s-5);
  position: relative;
  overflow: hidden;
  transition: all var(--t-fast);
}
.stat:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--t-fast);
}
.stat:hover::before { opacity: 1; }
.stat-eyebrow {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  color: var(--text-muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.stat-eyebrow .stat-icon {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.8rem;
}
.stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: var(--s-3);
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stat-value.currency { font-size: 1.75rem; }
.stat-trend {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--s-2);
  display: flex;
  align-items: center;
  gap: var(--s-1);
}
.stat-trend.up { color: var(--ok); }
.stat-trend.down { color: var(--bad); }

/* Cards */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: var(--s-5);
  margin-bottom: var(--s-4);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.card-eyebrow {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: var(--s-1);
}
.card-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--s-1);
}

/* Two column dashboard */
.dash-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--s-4);
}
@media (max-width: 1024px) { .dash-grid { grid-template-columns: 1fr; } }

/* Attention list */
.attention-list { display: flex; flex-direction: column; }
.attention-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.attention-item:last-child { border-bottom: none; }
.attention-item .ai-dot {
  width: 6px; height: 6px;
  flex-shrink: 0;
  background: var(--warn);
}
.attention-item.crit .ai-dot { background: var(--bad); }
.attention-item .ai-text { flex: 1; }
.attention-item .ai-meta { color: var(--text-muted); font-size: 0.75rem; }
.attention-item button {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 8px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--r-1);
}
.attention-item button:hover { color: var(--accent); border-color: var(--accent); }

/* Today's operations */
.ops-list { display: flex; flex-direction: column; }
.ops-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.ops-item:last-child { border-bottom: none; }
.ops-time {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  min-width: 50px;
  font-size: 0.85rem;
}
.ops-route { flex: 1; }
.ops-route-name { font-weight: 600; }
.ops-route-meta { font-size: 0.75rem; color: var(--text-muted); }

/* ============================================================
   LISTS / TABLES
   ============================================================ */
.toolbar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  flex-wrap: wrap;
}
.search {
  flex: 1;
  min-width: 200px;
  position: relative;
}
.search input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  border-radius: var(--r-1);
  transition: all var(--t-fast);
}
.search input:focus { outline: none; border-color: var(--accent); }
.search input::placeholder { color: var(--text-muted); }
.search::before {
  content: "⌕";
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
}
.filter-tabs { display: flex; gap: 0; }
.filter-tab {
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: -1px;
  transition: all var(--t-fast);
  font-family: inherit;
}
.filter-tab:first-child { margin-left: 0; }
.filter-tab:hover { background: var(--surface); color: var(--text); }
.filter-tab.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

.data-table {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  overflow-x: auto;
}
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.tbl thead th {
  text-align: left;
  padding: var(--s-3) var(--s-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
}
.tbl tbody td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background var(--t-fast); }
.tbl tbody tr:hover { background: var(--surface); }
.tbl .cell-primary { font-weight: 600; }
.tbl .cell-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.tbl .cell-actions { text-align: right; white-space: nowrap; }
.tbl .empty-row td {
  text-align: center;
  padding: var(--s-12) var(--s-4);
  color: var(--text-muted);
}

/* ============================================================
   BADGES & STATUS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--r-1);
  border: 1px solid transparent;
}
.badge::before {
  content: "";
  width: 5px; height: 5px;
  background: currentColor;
}
.badge.ok, .badge.active, .badge.current, .badge.available, .badge.paid {
  background: var(--ok-dim);
  color: var(--ok);
  border-color: var(--ok);
}
.badge.warn, .badge.exiting, .badge.expiring, .badge.warning, .badge.pending {
  background: var(--warn-dim);
  color: var(--warn);
  border-color: var(--warn);
}
.badge.bad, .badge.suspended, .badge.removed, .badge.overdue, .badge.expired {
  background: var(--bad-dim);
  color: var(--bad);
  border-color: var(--bad);
}
.badge.info, .badge.in-progress, .badge.planned {
  background: var(--info-dim);
  color: var(--info);
  border-color: var(--info);
}
.badge.neutral {
  background: var(--surface-2);
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  border-radius: var(--r-1);
  transition: all var(--t-fast);
  white-space: nowrap;
}
.btn:focus { outline: none; }
.btn:focus-visible { box-shadow: 0 0 0 3px var(--accent-glow); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px var(--accent-glow);
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface);
  color: var(--text);
}
.btn-danger {
  background: var(--bad);
  color: white;
}
.btn-danger:hover:not(:disabled) { background: #ef4444; }
.btn-sm { padding: 6px 10px; font-size: 0.8rem; }
.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}
.btn-icon:hover { color: var(--text); background: var(--surface); border-color: var(--border); }

/* ============================================================
   FORMS
   ============================================================ */
form.form { display: flex; flex-direction: column; gap: var(--s-4); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  text-transform: uppercase;
}
.field label .req { color: var(--bad); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  font-family: inherit;
  font-size: 0.9rem;
  border-radius: var(--r-1);
  transition: all var(--t-fast);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}
.field textarea { min-height: 80px; resize: vertical; }
.field .hint { font-size: 0.75rem; color: var(--text-muted); }
.field .err { font-size: 0.75rem; color: var(--bad); }

/* Pickup location autocomplete dropdown */
.pickup-field { position: relative; }
.pickup-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0; right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-1);
  max-height: 280px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: var(--shadow-lg);
}
.pickup-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  transition: background var(--t-fast);
}
.pickup-item:last-child { border-bottom: none; }
.pickup-item:hover { background: var(--surface); }
.pickup-main { font-weight: 600; }
.pickup-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.pickup-sub.muted { font-style: italic; }
.pickup-new { color: var(--accent); }
.pickup-new:hover { background: var(--accent-dim); }
.pickup-empty {
  padding: 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ============================================================
   LOCATION WIDGET (Google Maps + Places)
   ============================================================ */
.loc-widget {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.loc-input-row {
  display: flex;
  gap: var(--s-2);
}
.loc-search {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  font-family: inherit;
  font-size: 0.9rem;
  border-radius: var(--r-1);
  transition: all var(--t-fast);
}
.loc-search:focus { outline: none; border-color: var(--accent); }
.loc-confirm {
  white-space: nowrap;
  padding: 8px 14px;
  font-size: 0.8rem;
}
.loc-confirm:disabled { opacity: 0.4; cursor: not-allowed; }
.loc-predictions {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  max-height: 240px;
  overflow-y: auto;
  border-radius: var(--r-1);
  z-index: 5;
}
.loc-pred {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
}
.loc-pred:last-child { border-bottom: none; }
.loc-pred:hover { background: var(--surface); }
.loc-pred-main { font-weight: 600; }
.loc-pred-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.loc-pred-empty {
  padding: 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.loc-map {
  width: 100%;
  height: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-1);
}
.loc-meta {
  font-size: 0.8rem;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-1);
  color: var(--text-secondary);
  min-height: 1px;
}
.loc-meta-name { color: var(--text); font-weight: 600; }
.loc-error {
  padding: 12px;
  background: var(--bad-dim);
  color: var(--bad);
  font-size: 0.85rem;
  border: 1px solid var(--bad);
  border-radius: var(--r-1);
}
.loc-error code {
  background: var(--bg);
  padding: 1px 4px;
  border-radius: var(--r-1);
  font-size: 0.8rem;
}

.form-section {
  border-top: 1px solid var(--border);
  padding-top: var(--s-4);
}
.form-section:first-child { border-top: none; padding-top: 0; }
.form-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: var(--s-3);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
}
.modal:not(.hidden) { opacity: 1; pointer-events: auto; }
.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-2);
  box-shadow: var(--shadow-lg);
  transform: scale(0.96);
  transition: transform var(--t-base);
}
.modal:not(.hidden) .modal-card { transform: scale(1); }

.modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  padding: var(--s-5);
  border-bottom: 1px solid var(--border);
}
.modal-eyebrow {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  color: var(--accent);
  text-transform: uppercase;
}
.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 2px;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: var(--s-1) var(--s-2);
  border-radius: var(--r-1);
  transition: all var(--t-fast);
}
.modal-close:hover { color: var(--text); background: var(--surface-2); }
.modal-body { padding: var(--s-5); overflow-y: auto; flex: 1; }
.modal-actions {
  display: flex;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-5);
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.modal-actions .btn { flex: 1; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: var(--s-6);
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 12px 20px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 400;
  border-radius: var(--r-1);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: all 250ms var(--ease);
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast.error { border-left-color: var(--bad); }
.toast.success { border-left-color: var(--ok); }
@media (max-width: 768px) { .toast { bottom: var(--s-4); } }

/* ============================================================
   LOADING & EMPTY STATES
   ============================================================ */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  padding: var(--s-12);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.loading-block .spinner { width: 24px; height: 24px; border-width: 3px; }

.empty {
  text-align: center;
  padding: var(--s-12) var(--s-4);
  color: var(--text-muted);
}
.empty-icon {
  font-size: 2.5rem;
  color: var(--text-muted);
  opacity: 0.3;
  margin-bottom: var(--s-3);
}
.empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--s-1);
}
.empty-text { font-size: 0.875rem; }
.empty .btn { margin-top: var(--s-4); }

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.mono { font-family: var(--font-mono); }
.right { text-align: right; }
.uppercase { text-transform: uppercase; letter-spacing: var(--tracking-wide); }

/* Section title (eyebrow style) */
.section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 0 0 var(--s-3) 0;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* Selection */
::selection { background: var(--accent); color: var(--bg); }

/* Login page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--surface-1);
}
.login-card {
  background: var(--surface-2);
  padding: var(--s-8);
  border-radius: var(--r-1);
  width: 100%;
  max-width: 360px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.login-card h2 { margin-bottom: var(--s-2); }
.login-card .muted { margin-bottom: var(--s-6); }
