@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;700&display=swap');

/* ═══════════════════════════════════════════════════════════════
   STONE MTN REPAIR PORTAL — Design System v3
   Direction: ultra-minimal, premium dark UI (Linear / Vercel)
═══════════════════════════════════════════════════════════════ */

/* ── TOKENS ─────────────────────────────────────────────────────── */
:root {
  /* Backgrounds — navy palette */
  --bg:        #0a1628;
  --surface:   #0f1c2e;
  --surface2:  #142238;
  --surface3:  #1b2b49;
  --surface4:  #223558;

  /* Borders */
  --border:    rgba(255,255,255,0.06);
  --border-md: rgba(255,255,255,0.10);
  --border-hi: rgba(255,255,255,0.18);

  /* Brand accent — gold */
  --accent:       #e6a816;
  --accent-2:     #f0bc30;
  --accent-glow:  rgba(230,168,22,0.18);
  --accent-soft:  rgba(230,168,22,0.10);
  --on-accent:    #0a1420;

  /* Text — slightly warm */
  --text:       #ede8df;
  --text-2:     #8a8fa8;
  --text-3:     #495270;
  --text-4:     #283050;

  /* Semantic */
  --red:        #f06060;
  --red-soft:   rgba(240,96,96,0.10);
  --green:      #46d68a;
  --green-soft: rgba(70,214,138,0.10);
  --blue:       #5888f8;
  --blue-soft:  rgba(88,136,248,0.10);
  --orange:     #f09040;
  --orange-soft:rgba(240,144,64,0.10);
  --purple:     #9860f0;
  --cyan:       #28c8e8;

  /* Radius */
  --r-xs: 4px;
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 18px;

  /* Shadows */
  --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-2: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-3: 0 16px 48px rgba(0,0,0,0.7);
}

/* ── KEYFRAMES ──────────────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

/* ── RESET ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  height: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
/* Better tap targets on mobile */
button, a, [role="button"] { touch-action: manipulation; }

/* ── LOGIN ──────────────────────────────────────────────────────── */
#login-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
#login-screen::before {
  content: '';
  position: absolute;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(ellipse, rgba(230,168,22,0.07) 0%, transparent 70%);
  pointer-events: none;
  max-width: 100vw;
  overflow: hidden;
}
.login-box {
  width: 380px;
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: var(--r-xl);
  padding: 44px 36px 36px;
  box-shadow: var(--shadow-3), 0 0 0 1px rgba(230,168,22,0.06);
  position: relative;
}
.login-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.6px;
  margin-bottom: 3px;
  color: var(--text);
}
.login-logo span { color: var(--accent); }
.login-sub {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 32px;
  font-weight: 400;
}
.login-box label {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}
.login-box input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border-md);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  padding: 10px 13px;
  margin-bottom: 16px;
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.btn-primary {
  width: 100%;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 11px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.08s;
  box-shadow: 0 0 20px var(--accent-glow);
  margin-top: 2px;
}
.btn-primary:hover  { background: var(--accent-2); box-shadow: 0 0 32px rgba(230,168,22,0.30); }
.btn-primary:active { transform: scale(0.98); }
.login-hint {
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
  margin-top: 18px;
  line-height: 1.7;
}
.login-hint strong { color: var(--text-2); font-weight: 600; }

/* ── APP SHELL ──────────────────────────────────────────────────── */
#app { display: none; flex-direction: row; min-height: 100vh; }
#app.visible { display: flex; }

/* ── SIDEBAR ────────────────────────────────────────────────────── */
#sidebar {
  width: 216px;
  min-width: 216px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  transition: width 0.2s ease, min-width 0.2s ease;
  overflow: hidden;
}
#sidebar.collapsed { width: 54px; min-width: 54px; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  height: 52px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.15s;
}
.sidebar-logo span { color: var(--accent); }
#sidebar.collapsed .sidebar-logo { opacity: 0; width: 0; }

.sidebar-collapse-btn {
  background: none; border: none;
  color: var(--text-3); cursor: pointer;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  transition: color 0.15s, background 0.15s;
}
.sidebar-collapse-btn:hover { color: var(--text); background: var(--surface3); }

.nav {
  display: flex; flex-direction: column;
  gap: 1px;
  padding: 10px 8px;
  flex: 1;
  overflow-y: auto;
}
.nav-btn {
  background: none; border: none;
  color: var(--text-3);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 9px;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
  border-radius: var(--r-sm);
  display: flex; align-items: center; gap: 9px;
  white-space: nowrap; width: 100%;
  text-align: left; overflow: hidden;
  letter-spacing: 0.1px;
  position: relative;
}
.nav-btn:hover  { color: var(--text); background: var(--surface3); }
.nav-btn.active { color: var(--text); background: var(--surface3); }
.nav-btn.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 2.5px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-btn .nav-icon {
  flex-shrink: 0; width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.7;
  transition: opacity 0.12s;
}
.nav-btn:hover .nav-icon,
.nav-btn.active .nav-icon { opacity: 1; }
.nav-btn.active .nav-icon svg { stroke: var(--accent); }
.nav-btn .nav-label {
  opacity: 1; transition: opacity 0.15s; overflow: hidden;
}
#sidebar.collapsed .nav-btn .nav-label { opacity: 0; width: 0; }
#sidebar.collapsed .nav-btn { justify-content: center; padding: 8px 0; }
#sidebar.collapsed .nav-btn::before { display: none; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 8px 8px;
  display: flex; flex-direction: column; gap: 2px;
  flex-shrink: 0;
}
.sidebar-footer-row {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 6px; overflow: hidden;
}
#sidebar.collapsed .sidebar-icon-btn { display: none; }
#sidebar.collapsed .sidebar-footer { padding: 8px 0; align-items: center; }
#sidebar.collapsed .sidebar-footer-row { justify-content: center; padding: 0; width: 100%; }
.sidebar-icon-btn {
  background: none; border: none;
  color: var(--text-3);
  width: 30px; height: 30px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  transition: color 0.12s, background 0.12s;
}
.sidebar-icon-btn:hover { color: var(--text); background: var(--surface3); }

/* ── APP BODY ───────────────────────────────────────────────────── */
#app-body { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  height: 52px; gap: 16px;
  position: sticky; top: 0; z-index: 100;
}
.topbar-right {
  display: flex; align-items: center;
  gap: 10px; margin-left: auto; flex-shrink: 0;
}
.role-badge {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
  white-space: nowrap;
}

/* ── MAIN CONTENT ───────────────────────────────────────────────── */
.main {
  flex: 1;
  padding: 28px 32px;
  max-width: 1300px; width: 100%;
  margin: 0 auto;
  overflow-y: auto;
}

/* ── PAGE HEADER ────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.page-title {
  font-family: 'Syne', sans-serif;
  font-size: 24px; font-weight: 800;
  letter-spacing: -0.5px; line-height: 1.1;
}
.page-subtitle { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ── BUTTONS ────────────────────────────────────────────────────── */
.btn {
  border: none; font-family: inherit;
  font-size: 12px; font-weight: 600;
  padding: 7px 14px; cursor: pointer;
  border-radius: var(--r-sm);
  transition: all 0.12s;
  display: inline-flex; align-items: center; gap: 5px;
  letter-spacing: 0.15px; white-space: nowrap;
}
.btn-accent {
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 0 16px var(--accent-glow);
}
.btn-accent:hover { background: var(--accent-2); box-shadow: 0 0 24px rgba(230,168,22,0.28); }
.btn-ghost {
  background: var(--surface3); color: var(--text-2);
  border: 1px solid var(--border-md);
}
.btn-ghost:hover { background: var(--surface4); color: var(--text); border-color: var(--border-hi); }
.btn-danger { background: var(--red-soft); color: var(--red); border: 1px solid rgba(240,96,96,0.2); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 11px; }

/* ── SEARCH ─────────────────────────────────────────────────────── */
.search-bar { display: flex; gap: 8px; margin-bottom: 18px; align-items: center; }
.search-input {
  background: var(--surface2);
  border: 1px solid var(--border-md);
  color: var(--text); font-family: inherit;
  font-size: 13px; padding: 8px 13px;
  border-radius: var(--r-sm); outline: none;
  max-width: 340px; transition: border-color 0.15s, box-shadow 0.15s;
  flex: 1;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-input::placeholder { color: var(--text-4); }

/* ── TABLES ─────────────────────────────────────────────────────── */
.table-wrap { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--surface2);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.4px; text-transform: uppercase;
  color: var(--text-3); padding: 10px 15px;
  text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.08s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }
tbody td { padding: 11px 15px; vertical-align: middle; }
.td-mono { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--text-2); }
.td-primary { font-weight: 500; font-size: 13px; }

/* ── STATUS BADGES ──────────────────────────────────────────────── */
.status, .status-badge {
  display: inline-flex; align-items: center;
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.2px;
  padding: 2px 9px; border-radius: 20px; white-space: nowrap;
}
.s-queue    { background: rgba(88,88,248,0.12);  color: #8888f8; border: 1px solid rgba(88,88,248,0.22); }
.s-diag     { background: rgba(168,200,48,0.12); color: #b8d040; border: 1px solid rgba(168,200,48,0.22); }
.s-repair   { background: rgba(40,200,232,0.12); color: #28c8e8; border: 1px solid rgba(40,200,232,0.22); }
.s-parts    { background: rgba(240,144,40,0.12); color: #e89840; border: 1px solid rgba(240,144,40,0.22); }
.s-ordered  { background: rgba(240,200,60,0.12); color: #e8c840; border: 1px solid rgba(240,200,60,0.22); }
.s-awaiting { background: rgba(240,100,40,0.12); color: #e87040; border: 1px solid rgba(240,100,40,0.22); }
.s-repaired { background: rgba(70,214,138,0.12); color: #46d68a; border: 1px solid rgba(70,214,138,0.22); }
.s-unrepair { background: var(--red-soft);       color: var(--red); border: 1px solid rgba(240,96,96,0.22); }
.s-declined { background: rgba(200,80,80,0.08);  color: #d07070; border: 1px solid rgba(200,80,80,0.16); }
.s-complete { background: var(--accent-soft);    color: var(--accent); border: 1px solid rgba(230,168,22,0.28); }

/* ── CARDS ──────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px 22px;
}
.card-label {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.card-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── STATS ROW ──────────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 18px 20px;
  transition: border-color 0.15s;
}
.stat-card:hover { border-color: var(--border-md); }
.stat-num {
  font-family: 'Syne', sans-serif;
  font-size: 32px; font-weight: 800; line-height: 1; margin-bottom: 6px;
}
.stat-label { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-3); }

/* ── MODAL ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px) saturate(0.8);
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 500; padding: 48px 20px; overflow-y: auto;
  opacity: 0; pointer-events: none; transition: opacity 0.18s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: var(--r-lg);
  width: 100%; max-width: 660px;
  box-shadow: var(--shadow-3), 0 0 0 1px rgba(255,255,255,0.03);
  transform: translateY(12px) scale(0.99);
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), opacity 0.18s;
  overflow: hidden;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-top {
  padding: 16px 22px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 700; }
.modal-close {
  background: none; border: none; color: var(--text-3);
  font-size: 20px; cursor: pointer; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); transition: color 0.12s, background 0.12s; line-height: 1;
}
.modal-close:hover { color: var(--text); background: var(--surface3); }
.modal-body { padding: 22px; }
.modal-footer {
  border-top: 1px solid var(--border);
  padding: 14px 22px;
  display: flex; gap: 8px; justify-content: flex-end;
  background: var(--surface2);
}

/* ── CHECK-IN DEVICE SELECTOR ───────────────────────────────────── */
.ci-device-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.ci-device-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 18px 8px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  transition: border-color .15s, background .15s, color .15s;
}
.ci-device-tile svg { width: 28px; height: 28px; }
.ci-device-tile:hover {
  border-color: rgba(230,168,22,.35);
  color: var(--text);
}
.ci-device-tile.active {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--accent);
}

.ci-brand-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.ci-brand-tile {
  padding: 6px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: border-color .15s, background .15s, color .15s;
}
.ci-brand-tile:hover {
  border-color: rgba(230,168,22,.35);
  color: var(--text);
}
.ci-brand-tile.active {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--accent);
}

/* ── FORMS ──────────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.cols1 { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.span2 { grid-column: span 2; }
.form-label { font-size: 11px; font-weight: 600; letter-spacing: 0.3px; color: var(--text-2); }
.form-label .opt { color: var(--text-3); font-weight: 400; }
.form-input, .form-select, .form-textarea {
  background: var(--surface2); border: 1px solid var(--border-md);
  color: var(--text); font-family: inherit; font-size: 13px;
  padding: 8px 11px; border-radius: var(--r-sm);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s; width: 100%;
}
.form-textarea { resize: vertical; min-height: 70px; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-input.warn { border-color: var(--orange); }
.form-warn { font-size: 11px; color: var(--orange); }
.form-section {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--accent); border-bottom: 1px solid var(--border);
  padding-bottom: 6px; margin: 18px 0 14px;
}

/* ── DETAIL ─────────────────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.detail-sidebar { display: flex; flex-direction: column; gap: 14px; }
.detail-main { display: flex; flex-direction: column; gap: 14px; }
.info-row {
  display: flex; justify-content: space-between;
  padding: 7px 0; border-bottom: 1px solid var(--border); gap: 12px;
}
.info-row:last-child { border-bottom: none; }
.info-key { font-size: 11px; font-weight: 600; letter-spacing: 0.3px; color: var(--text-3); flex-shrink: 0; }
.info-val { font-size: 12.5px; text-align: right; }
.info-val.mono { font-family: 'IBM Plex Mono', monospace; }

/* ── LOG ────────────────────────────────────────────────────────── */
.log-entry { display: flex; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.log-entry:last-child { border-bottom: none; }
.log-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-4); margin-top: 6px; flex-shrink: 0; }
.log-dot.accent { background: var(--accent); }
.log-dot.blue   { background: var(--blue); }
.log-meta { font-size: 10.5px; color: var(--text-3); margin-bottom: 1px; }
.log-text { font-size: 12.5px; }

/* ── NOTE INPUT ─────────────────────────────────────────────────── */
.note-input-row { display: flex; gap: 7px; margin-top: 8px; }
.note-input-row input {
  flex: 1; background: var(--surface2); border: 1px solid var(--border-md);
  color: var(--text); font-family: inherit; font-size: 13px;
  padding: 8px 12px; border-radius: var(--r-sm); outline: none;
  transition: border-color 0.15s;
}
.note-input-row input:focus { border-color: var(--accent); }

/* ── WO DETAIL SIDEBAR BUTTONS ─────────────────────────────────── */
.wo-sidebar-btn {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  position: relative;
}
.wo-sidebar-btn:hover { border-color: var(--accent); color: var(--accent); }
.wo-sidebar-btn.wty-active  { border-color: var(--green); color: var(--green); }
.wo-sidebar-btn.wty-expired { border-color: var(--red);   color: var(--red);   }

/* ── NOTES PANEL ────────────────────────────────────────────────── */
.np-tab { padding:8px 16px; font-family:'IBM Plex Mono',monospace; font-size:11px; letter-spacing:1px; text-transform:uppercase; background:transparent; border:none; border-bottom:2px solid transparent; color:var(--text-3); cursor:pointer; transition:all .15s; white-space:nowrap; }
.np-tab.active { color:var(--accent); border-bottom-color:var(--accent); }
.np-tab:hover:not(.active) { color:var(--text); }
.np-entry { display:flex; gap:12px; padding:14px 18px; border-bottom:1px solid var(--border); transition:background .1s; }
.np-entry:hover { background:var(--surface2); }
.np-entry:last-child { border-bottom:none; }
.np-dot { width:8px; height:8px; border-radius:50%; margin-top:6px; flex-shrink:0; }
.np-dot.status { background:var(--accent); }
.np-dot.note   { background:var(--blue); }
.np-meta { font-family:'IBM Plex Mono',monospace; font-size:10px; color:var(--text-3); margin-bottom:4px; line-height:1.4; }
.np-text { font-size:13px; line-height:1.5; }
.np-subnote { font-size:12px; color:var(--text-2); line-height:1.5; margin-top:6px; border-left:2px solid var(--border-md); padding-left:9px; }

/* @mention inline chip */
.mention-chip { display:inline; background:rgba(230,168,22,.14); color:var(--accent); border-radius:3px; padding:0 4px; font-weight:600; font-size:0.9em; }

/* mention autocomplete items */
.mention-item { padding:9px 14px; font-size:13px; cursor:pointer; display:flex; align-items:center; gap:10px; transition:background .1s; }
.mention-item:hover { background:var(--surface); }

/* ── PARTS ──────────────────────────────────────────────────────── */
.parts-list { margin-bottom: 10px; }
.part-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 11px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--r-sm); margin-bottom: 5px;
}
.part-name { font-size: 12.5px; font-weight: 500; }
.part-cost { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--accent); }
.part-remove {
  background: none; border: none; color: var(--text-3);
  font-size: 15px; cursor: pointer; padding: 2px 6px;
  border-radius: var(--r-sm); transition: color 0.12s, background 0.12s;
}
.part-remove:hover { color: var(--red); background: var(--red-soft); }
.parts-total {
  display: flex; justify-content: flex-end; gap: 8px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  padding-top: 7px; border-top: 1px solid var(--border);
}
.parts-total-val { color: var(--accent); font-size: 14px; font-weight: 700; }

/* ── FILTER CHIPS ───────────────────────────────────────────────── */
.filter-btn {
  background: var(--surface2); border: 1px solid var(--border-md); color: var(--text-2);
  font-family: inherit; font-size: 12px; font-weight: 500;
  padding: 5px 14px; cursor: pointer; transition: all 0.12s; white-space: nowrap;
  border-radius: 20px;
}
.filter-btn:hover { border-color: var(--border-hi); color: var(--text); background: var(--surface3); }
.filter-btn.active { background: var(--accent-soft); border-color: rgba(230,168,22,0.35); color: var(--accent); font-weight: 700; }

.filter-chip {
  background: transparent; border: 1px solid var(--border-md); color: var(--text-2);
  font-size: 11px; font-weight: 500; padding: 4px 12px; cursor: pointer;
  transition: all 0.12s; border-radius: 20px;
}
.filter-chip:hover { border-color: var(--border-hi); color: var(--text); }
.filter-chip.active { background: var(--accent-soft); border-color: rgba(230,168,22,0.35); color: var(--accent); }

/* ── CHECKIN STEPS ──────────────────────────────────────────────── */
.steps-header { display: flex; gap: 8px; margin-bottom: 24px; }
.step-tab {
  flex: 1; text-align: center; padding: 12px 8px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase;
  color: var(--text-3); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); transition: all 0.15s;
}
.step-tab.done { color: var(--accent); border-color: rgba(230,168,22,0.25); background: var(--accent-soft); }
.step-tab.active { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.step-num { display: block; font-size: 18px; font-family: 'Syne', sans-serif; font-weight: 800; margin-bottom: 1px; }

/* ── EMPTY STATE ────────────────────────────────────────────────── */
.empty { text-align: center; padding: 64px 20px; }
.empty-icon { font-size: 40px; margin-bottom: 14px; opacity: 0.3; }
.empty-text { font-size: 12.5px; color: var(--text-3); }

/* ── NOTIFICATION ───────────────────────────────────────────────── */
.notif {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--surface3);
  color: var(--text);
  border: 1px solid var(--border-md);
  border-left: 3px solid var(--accent);
  font-size: 12.5px; font-weight: 500;
  padding: 11px 18px; border-radius: var(--r);
  box-shadow: var(--shadow-3);
  z-index: 999;
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  transition: all 0.28s cubic-bezier(0.34,1.4,0.64,1);
}
.notif.show { transform: translateY(0) scale(1); opacity: 1; }

/* ── CUSTOMER HISTORY ───────────────────────────────────────────── */
.wo-history-row {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 13px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  margin-bottom: 5px; cursor: pointer; transition: border-color 0.12s, background 0.08s;
}
.wo-history-row:hover { background: var(--surface3); border-color: var(--border-md); }

/* ── PAGES ──────────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

.back-btn {
  background: none; border: none; color: var(--text-3); font-size: 12px; font-weight: 500;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 0; margin-bottom: 18px;
  border-radius: var(--r-sm); transition: color 0.12s;
}
.back-btn:hover { color: var(--accent); }

.tag-inline {
  font-size: 10.5px; font-weight: 500;
  background: var(--surface3); border: 1px solid var(--border-md);
  color: var(--text-2); padding: 2px 8px; border-radius: 12px;
}

/* ── PARTS TABS ─────────────────────────────────────────────────── */
.parts-tab {
  background: none; border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-3); font-family: inherit; font-size: 12.5px; font-weight: 500;
  padding: 9px 18px 11px; cursor: pointer; transition: all 0.12s; margin-bottom: -1px;
}
.parts-tab:hover { color: var(--text-2); }
.parts-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── INVENTORY ──────────────────────────────────────────────────── */
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(250px,1fr)); gap: 10px; }
.inv-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 15px 16px; display: flex; flex-direction: column; gap: 5px;
  cursor: pointer; transition: border-color 0.12s, background 0.08s;
}
.inv-card:hover { background: var(--surface2); border-color: var(--border-md); }
.inv-card-sku { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--accent); letter-spacing: 0.8px; }
.inv-card-name { font-size: 13.5px; font-weight: 500; }
.inv-card-meta { font-size: 11px; color: var(--text-3); display: flex; gap: 10px; margin-top: 3px; }
.inv-card-qty { font-family: 'IBM Plex Mono', monospace; font-size: 20px; font-weight: 700; margin-top: 3px; }
.qty-ok  { color: var(--green); }
.qty-low { color: var(--orange); }
.qty-out { color: var(--red); }

/* ── PO STATUS ──────────────────────────────────────────────────── */
.po-status {
  display: inline-flex; align-items: center;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.2px;
  padding: 2px 9px; border-radius: 20px;
}
.po-open     { background: var(--blue-soft);   color: var(--cyan);   border: 1px solid rgba(40,200,232,0.22); }
.po-partial  { background: var(--orange-soft); color: var(--orange); border: 1px solid rgba(240,144,64,0.22); }
.po-received { background: var(--green-soft);  color: var(--green);  border: 1px solid rgba(70,214,138,0.22); }
.po-cancelled{ background: var(--red-soft);    color: var(--red);    border: 1px solid rgba(240,96,96,0.22); }

/* ── TOPBAR CONTROLS ────────────────────────────────────────────── */
.topbar-icon-btn {
  background: none; border: none;
  color: var(--text-2); cursor: pointer;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  transition: color 0.12s, background 0.12s;
}
.topbar-icon-btn:hover { color: var(--text); background: var(--surface3); }
.topbar-icon-btn.active { color: var(--accent); background: var(--accent-soft); }

.topbar-divider {
  width: 1px; height: 20px;
  background: var(--border-md);
  flex-shrink: 0; margin: 0 2px;
}

.topbar-logout-btn {
  background: none; border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer;
  padding: 4px 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  border-radius: 2px; transition: all 0.15s;
}
.topbar-logout-btn:hover { color: var(--red); border-color: var(--red); }

/* ── CLOCK WIDGET (topbar) ──────────────────────────────────────── */
.topbar-clock {
  display: flex; align-items: center; gap: 6px;
  padding: 0 10px;
  height: 32px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: default;
}
.topbar-clock-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
.topbar-clock-time {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; font-weight: 600;
  color: var(--green);
  letter-spacing: 0.5px;
}
.topbar-clock-out {
  background: none; border: none;
  color: var(--text-3); cursor: pointer;
  font-size: 13px; line-height: 1;
  padding: 0 0 0 4px;
  transition: color 0.12s;
  display: flex; align-items: center;
}
.topbar-clock-out:hover { color: var(--red); }
.topbar-clock-in {
  display: flex; align-items: center; gap: 5px;
  padding: 0 12px;
  height: 32px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; letter-spacing: 0.8px; text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}
.topbar-clock-in:hover { border-color: var(--accent); color: var(--accent); }

/* ── THEME PICKER MENU ──────────────────────────────────────────── */
#theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: -60px;
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: var(--r);
  box-shadow: var(--shadow-3);
  padding: 12px;
  min-width: 320px;
  z-index: 400;
}
#theme-menu::before {
  content: '';
  position: absolute;
  top: -5px; right: 10px;
  width: 9px; height: 9px;
  background: var(--surface);
  border-left: 1px solid var(--border-md);
  border-top: 1px solid var(--border-md);
  transform: rotate(45deg);
}
.theme-menu-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.theme-swatch-row {
  display: flex; gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 0;
}
.theme-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
  flex-shrink: 0;
  position: relative;
}
.theme-swatch:hover { transform: scale(1.15); }
.theme-swatch.active { border-color: var(--text); }
.theme-swatch-name {
  font-size: 10px; color: var(--text-2);
  text-align: center; margin-top: 4px;
  white-space: nowrap;
}

/* Sidebar logout — mobile only */
.sidebar-logout-mobile {
  display: none;
  width: 100%;
  background: none; border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer;
  padding: 7px 10px;
  font-family: inherit; font-size: 12px; font-weight: 500;
  border-radius: var(--r-sm);
  align-items: center; gap: 8px;
  transition: all 0.15s;
}
.sidebar-logout-mobile:hover { color: var(--red); border-color: var(--red); }
@media (max-width: 768px) {
  .sidebar-logout-mobile { display: flex; }
}

/* Mobile hamburger — hidden on desktop */
.topbar-hamburger {
  display: none;
  background: none; border: none;
  color: var(--text-2); cursor: pointer;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  transition: color 0.12s, background 0.12s;
}
.topbar-hamburger:hover { color: var(--text); background: var(--surface3); }

/* Mobile nav backdrop */
#mobile-nav-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
  z-index: 199;
}
#mobile-nav-backdrop.visible { display: block; }

/* ── TABLET (≤ 1024px) ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(2,1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .main { padding: 22px 20px; }
}

/* ── TABLET (≤ 900px) — compact topbar ─────────────────────────── */
@media (max-width: 900px) {
  .role-badge { display: none; }
  .topbar-clock-in { padding: 0 8px; font-size: 9px; }
  .topbar-clock-time { display: none; } /* just show dot on small tablet */
}

/* ── TABLET/MOBILE (≤ 768px) ────────────────────────────────────── */
@media (max-width: 768px) {

  /* ── Sidebar becomes a slide-in drawer ── */
  #sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    z-index: 200;
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    box-shadow: var(--shadow-3);
    /* Always show full width on mobile, ignore collapsed state */
    width: 240px !important;
    min-width: 240px !important;
  }
  #sidebar.mobile-open { transform: translateX(0); }
  /* Restore labels when sidebar opens on mobile */
  #sidebar.collapsed .nav-btn .nav-label { opacity: 1; width: auto; }
  #sidebar.collapsed .nav-btn { justify-content: flex-start; padding: 7px 9px; }
  #sidebar.collapsed .nav-btn::before { display: block; }
  #sidebar.collapsed .sidebar-logo { opacity: 1; width: auto; }
  #sidebar.collapsed .sidebar-icon-btn { display: flex; }
  #sidebar.collapsed .sidebar-footer { padding: 8px 8px; align-items: stretch; }
  #sidebar.collapsed .sidebar-footer-row { justify-content: flex-start; padding: 4px 6px; width: auto; }
  .sidebar-collapse-btn { display: none; }

  /* ── Show hamburger ── */
  .topbar-hamburger { display: flex; }

  /* ── App body takes full width ── */
  #app { flex-direction: column; }
  #app-body { width: 100%; min-width: 0; }

  /* ── Topbar compact ── */
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-divider { display: none; }
  .topbar-clock-time { display: none; }
  .topbar-logout-btn { display: none; } /* use sidebar on mobile instead */

  /* ── Main content ── */
  .main { padding: 16px 14px; }

  /* ── Page header wraps ── */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
  }
  .page-title { font-size: 20px; }

  /* ── Stats ── */
  .stats-row { grid-template-columns: repeat(2,1fr); gap: 8px; margin-bottom: 18px; }
  .stat-card { padding: 14px 16px; }
  .stat-num { font-size: 26px; }

  /* ── Tables — horizontal scroll ── */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 520px; }
  thead th { padding: 8px 12px; font-size: 10px; }
  tbody td { padding: 9px 12px; }

  /* ── Forms ── */
  .form-grid { grid-template-columns: 1fr; }
  .form-group.span2 { grid-column: span 1; }

  /* ── Modals — bottom sheet ── */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    max-width: 100%;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
  }
  .modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 18px 16px;
  }
  .modal-top { padding: 14px 16px; }
  .modal-footer { padding: 12px 16px; flex-wrap: wrap; }

  /* ── Parts tabs — scrollable ── */
  div:has(> .parts-tab) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
    scrollbar-width: none;
  }
  div:has(> .parts-tab)::-webkit-scrollbar { display: none; }
  .parts-tab { padding: 9px 14px 11px; white-space: nowrap; font-size: 12px; }

  /* ── Filter chips — scrollable row ── */
  .search-bar { flex-wrap: nowrap; overflow-x: auto; }
  .search-input { min-width: 160px; }

  /* ── Check-in steps ── */
  .steps-header { gap: 4px; margin-bottom: 16px; }
  .step-tab { padding: 8px 4px; font-size: 9.5px; }
  .step-num { font-size: 15px; }

  /* ── Detail grid ── */
  .detail-grid { grid-template-columns: 1fr; }

  /* ── Notification — full width at bottom ── */
  .notif {
    bottom: 12px; right: 12px; left: 12px;
    text-align: center;
  }

  /* ── Check-in device grid ── */
  .ci-device-grid { grid-template-columns: repeat(3,1fr); gap: 8px; }

  /* ── Appearance panel ── */
  #appearance-panel { width: 100% !important; }
  #notes-panel { width: 100% !important; max-width: 100vw; }
}

/* ── SMALL PHONES (≤ 480px) ─────────────────────────────────────── */
@media (max-width: 480px) {
  /* Login */
  .login-box { width: 100%; border-radius: 0; border-left: none; border-right: none; padding: 36px 24px 28px; }
  #login-screen { align-items: flex-start; padding-top: 40px; }

  /* Stats go 2-col then 1-col for very narrow */
  .stats-row { grid-template-columns: 1fr 1fr; }

  /* Page title smaller */
  .page-title { font-size: 18px; }

  /* Main padding tighter */
  .main { padding: 12px 10px; }

  /* Device grid 2 col */
  .ci-device-grid { grid-template-columns: repeat(2,1fr); }

  /* Topbar */
  .topbar { padding: 0 10px; }

  /* Table min-width less aggressive */
  table { min-width: 420px; }

  /* Modal body padding */
  .modal-body { padding: 14px 12px; }
  .modal-footer { gap: 6px; }
  .modal-footer .btn { flex: 1; justify-content: center; }
}

/* ── SCROLLBARS ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface4); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hi); }

/* ── LIGHT MODE ─────────────────────────────────────────────────── */
body.light {
  --bg:        #f6f2eb;
  --surface:   #ffffff;
  --surface2:  #f0ead9;
  --surface3:  #e6ddc8;
  --surface4:  #d8cfb8;
  --border:    rgba(0,0,0,0.08);
  --border-md: rgba(0,0,0,0.13);
  --border-hi: rgba(0,0,0,0.22);
  --accent:       #c48b0a;
  --accent-2:     #d9a01a;
  --accent-glow:  rgba(196,139,10,0.18);
  --accent-soft:  rgba(196,139,10,0.10);
  --on-accent:    #ffffff;
  --text:      #16120a;
  --text-2:    #5a5040;
  --text-3:    #9a8c72;
  --text-4:    #c4b498;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.12);
  --shadow-2: 0 4px 12px rgba(0,0,0,0.14);
  --shadow-3: 0 16px 48px rgba(0,0,0,0.18);
}

/* ── UTILITY ────────────────────────────────────────────────────── */
.mono { font-family: 'IBM Plex Mono', monospace; }

/* Hide lower-priority table columns on small screens */
@media (max-width: 600px) {
  /* WO table: hide Tech and Parts columns */
  .wo-table-tech, .wo-table-parts { display: none; }

  /* Filter chips wrap */
  #filter-chips { flex-wrap: wrap !important; gap: 5px; }

  /* Search bar wraps */
  .search-bar { flex-wrap: wrap; }
  .search-input { max-width: 100% !important; width: 100%; }

  /* Page header action button full-width */
  .page-header > .btn,
  .page-header > button { width: 100%; justify-content: center; }

  /* Stats: always 2-col */
  .stats-row { grid-template-columns: 1fr 1fr !important; }

  /* Compact stat cards */
  .stat-card { padding: 12px 14px; }
  .stat-num { font-size: 22px; }

  /* Table: allow narrower */
  table { min-width: 360px; }
  thead th { font-size: 9px; padding: 7px 10px; }
  tbody td { padding: 8px 10px; font-size: 12px; }

  /* Compact check-in header */
  .steps-header { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .step-tab { flex: 0 0 auto; min-width: 52px; padding: 7px 6px; font-size: 9px; }
  .step-num { font-size: 14px; }

  /* Parts tabs */
  .parts-tab { padding: 8px 12px 10px; font-size: 11.5px; }

  /* Notif */
  .notif { font-size: 12px; padding: 10px 14px; }
}

/* ══════════════════════════════════════════════════════════════════
   DESIGN THEMES
   Applied via body[data-design="..."]
   Modern = default (no overrides needed — uses existing :root vars)
══════════════════════════════════════════════════════════════════ */

/* ── OLD SCHOOL — warm tobacco, heavy borders, classic shop feel ── */
body[data-design="oldschool"] {
  --bg:          #14090000;
  --bg:          #150d02;
  --surface:     #1e1508;
  --surface2:    #28200f;
  --surface3:    #342a18;
  --surface4:    #403420;
  --border:      rgba(200,150,60,0.2);
  --accent:      #e07000;
  --accent-2:    #f08820;
  --accent-glow: rgba(224,112,0,0.18);
  --accent-soft: rgba(224,112,0,0.10);
  --on-accent:   #fff;
  --text:        #f0dfc0;
  --text-2:      #c8a870;
  --text-3:      #8a6a3a;
  --text-4:      #5a4222;
  --text-muted:  #8a6a3a;
  --red:         #e05030;
  --green:       #60b050;
  --cyan:        #60a0c0;
  --orange:      #e09020;
  --blue:        #6080c0;
}
body[data-design="oldschool"].light {
  --bg:          #ede0c4;
  --surface:     #faf3e0;
  --surface2:    #f0e4c8;
  --surface3:    #e4d4b0;
  --surface4:    #d8c498;
  --border:      rgba(120,70,10,0.22);
  --accent:      #c05000;
  --accent-2:    #d86010;
  --accent-glow: rgba(192,80,0,0.12);
  --accent-soft: rgba(192,80,0,0.07);
  --on-accent:   #fff;
  --text:        #1a0e00;
  --text-2:      #5a3818;
  --text-3:      #9a7040;
  --text-4:      #c0a060;
  --text-muted:  #9a7040;
}

/* Old School structural overrides */
body[data-design="oldschool"] .sidebar {
  border-right: 2px solid var(--border);
}
body[data-design="oldschool"] .topbar {
  border-bottom: 2px solid var(--border);
  box-shadow: none;
}
body[data-design="oldschool"] .nav-btn.active {
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  background: rgba(224,112,0,0.12);
}
body[data-design="oldschool"] .card {
  border-width: 1.5px;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.35);
  border-radius: var(--r);
}
body[data-design="oldschool"] .stat-card {
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--r) var(--r) 0;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
}
body[data-design="oldschool"] .btn-accent {
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}
body[data-design="oldschool"] .btn-accent:active {
  box-shadow: none;
  transform: translate(2px, 2px);
}
body[data-design="oldschool"] .modal-box {
  border: 2px solid var(--border);
  box-shadow: 6px 6px 0 rgba(0,0,0,0.4);
  border-radius: var(--r);
}
body[data-design="oldschool"] .page-title {
  font-family: 'Syne', sans-serif;
}
body[data-design="oldschool"] tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.03);
}

/* ── MINIMAL — monochrome, sharp corners, zero noise ── */
body[data-design="minimal"] {
  --bg:          #0a0a0e;
  --surface:     #101016;
  --surface2:    #16161f;
  --surface3:    #1c1c28;
  --surface4:    #222230;
  --border:      rgba(255,255,255,0.07);
  --accent:      #c8c8d8;
  --accent-2:    #e0e0f0;
  --accent-glow: rgba(200,200,216,0.08);
  --accent-soft: rgba(200,200,216,0.05);
  --on-accent:   #0a0a0e;
  --text:        #e4e4f0;
  --text-2:      #9898b0;
  --text-3:      #585870;
  --text-4:      #383848;
  --text-muted:  #585870;
  --red:         #c05858;
  --green:       #58a878;
  --cyan:        #5898b8;
  --orange:      #b08858;
  --blue:        #5878c0;
}
body[data-design="minimal"].light {
  --bg:          #f6f6fa;
  --surface:     #ffffff;
  --surface2:    #f0f0f6;
  --surface3:    #e6e6f0;
  --surface4:    #dcdcea;
  --border:      rgba(0,0,0,0.08);
  --accent:      #1a1a2e;
  --accent-2:    #2a2a42;
  --accent-glow: rgba(26,26,46,0.06);
  --accent-soft: rgba(26,26,46,0.04);
  --on-accent:   #fff;
  --text:        #0a0a16;
  --text-2:      #4a4a60;
  --text-3:      #8a8a9e;
  --text-4:      #b0b0c4;
  --text-muted:  #8a8a9e;
}

/* Minimal structural overrides */
body[data-design="minimal"] .sidebar {
  border-right: 1px solid var(--border);
  box-shadow: none;
}
body[data-design="minimal"] .topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}
body[data-design="minimal"] .nav-btn {
  border-radius: 4px;
}
body[data-design="minimal"] .nav-btn.active {
  background: transparent;
  box-shadow: none;
  color: var(--accent);
  border-right: 2px solid var(--accent);
  border-radius: 0;
  font-weight: 700;
}
body[data-design="minimal"] .card,
body[data-design="minimal"] .stat-card {
  box-shadow: none;
  border-radius: 4px;
}
body[data-design="minimal"] .btn,
body[data-design="minimal"] .btn-accent,
body[data-design="minimal"] .btn-ghost {
  border-radius: 3px;
}
body[data-design="minimal"] .btn-accent {
  background: var(--text);
  color: var(--bg);
}
body[data-design="minimal"] .btn-accent:hover {
  background: var(--text-2);
}
body[data-design="minimal"] .modal-box {
  border-radius: 4px;
  box-shadow: 0 2px 40px rgba(0,0,0,0.6);
  border: 1px solid var(--border);
}
body[data-design="minimal"] .page-title {
  font-weight: 600;
  letter-spacing: -0.3px;
}
body[data-design="minimal"] .stat-num {
  color: var(--text) !important;
}
body[data-design="minimal"] .topbar-icon-btn {
  border-radius: 3px;
}

/* ── OLD SCHOOL — Typography, Buttons, Forms, Tables ── */

body[data-design="oldschool"] .btn {
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  border: 2px solid transparent;
}
body[data-design="oldschool"] .btn-accent {
  border-color: var(--accent);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.4);
}
body[data-design="oldschool"] .btn-accent:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.5);
}
body[data-design="oldschool"] .btn-accent:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}
body[data-design="oldschool"] .btn-ghost {
  border: 2px solid var(--border-md);
  background: transparent;
}
body[data-design="oldschool"] .btn-ghost:hover {
  border-color: var(--accent);
  background: rgba(0,0,0,0.1);
}
body[data-design="oldschool"] .btn-sm {
  font-size: 10px;
  letter-spacing: 1px;
}
body[data-design="oldschool"] .topbar-icon-btn {
  border-radius: 3px;
  border: 1.5px solid var(--border-md);
}

/* Old School — Page & section titles */
body[data-design="oldschool"] .page-title {
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 17px;
  font-weight: 700;
}
body[data-design="oldschool"] .section-title,
body[data-design="oldschool"] .card-title,
body[data-design="oldschool"] .modal-title {
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
}
body[data-design="oldschool"] .nav-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.5px;
}
body[data-design="oldschool"] .stat-label {
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 10px;
}
body[data-design="oldschool"] .stat-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 30px;
  font-weight: 700;
}

/* Old School — Forms */
body[data-design="oldschool"] .form-label {
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 10px;
  font-weight: 700;
}
body[data-design="oldschool"] .form-input,
body[data-design="oldschool"] .form-select,
body[data-design="oldschool"] .form-textarea {
  border-radius: 2px;
  border-width: 2px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
}
body[data-design="oldschool"] .form-input:focus,
body[data-design="oldschool"] .form-select:focus,
body[data-design="oldschool"] .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 2px 2px 0 var(--accent-glow);
}

/* Old School — Tables */
body[data-design="oldschool"] table {
  border: 1.5px solid var(--border-md);
}
body[data-design="oldschool"] thead th {
  background: var(--surface3);
  border-bottom: 2px solid var(--accent);
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 10px;
  color: var(--accent);
  font-weight: 700;
}
body[data-design="oldschool"] td {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}
body[data-design="oldschool"] tbody tr:hover {
  border-left: 3px solid var(--accent);
}

/* Old School — Tabs & pills */
body[data-design="oldschool"] .tab-btn,
body[data-design="oldschool"] .filter-btn {
  border-radius: 2px;
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 1px;
  border: 1.5px solid transparent;
}
body[data-design="oldschool"] .tab-btn.active,
body[data-design="oldschool"] .filter-btn.active {
  border-color: var(--accent);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

/* Old School — Search bar */
body[data-design="oldschool"] .search-bar {
  border-radius: 2px;
  border: 2px solid var(--border-md);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}
body[data-design="oldschool"] .search-bar:focus {
  border-color: var(--accent);
}

/* Old School — Badge */
body[data-design="oldschool"] .badge {
  border-radius: 2px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── MINIMAL — Typography, Buttons, Forms, Tables ── */

body[data-design="minimal"] .btn {
  border-radius: 0;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: 1px solid transparent;
}
body[data-design="minimal"] .btn-accent {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  box-shadow: none;
}
body[data-design="minimal"] .btn-accent:hover {
  background: var(--text-2);
  border-color: var(--text-2);
  transform: none;
  box-shadow: none;
}
body[data-design="minimal"] .btn-ghost {
  background: none;
  border: 1px solid var(--border-md);
}
body[data-design="minimal"] .btn-ghost:hover {
  background: none;
  border-color: var(--text-3);
}
body[data-design="minimal"] .btn-sm {
  font-size: 10px;
  letter-spacing: 1px;
}
body[data-design="minimal"] .topbar-icon-btn {
  border-radius: 0;
  border: 1px solid var(--border);
}
body[data-design="minimal"] .topbar-icon-btn:hover {
  border-color: var(--border-md);
  background: transparent;
}

/* Minimal — Page & section titles */
body[data-design="minimal"] .page-title {
  font-weight: 300;
  font-size: 32px;
  letter-spacing: -1px;
  text-transform: none;
}
body[data-design="minimal"] .section-title,
body[data-design="minimal"] .card-title {
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 10px;
  color: var(--text-3);
}
body[data-design="minimal"] .modal-title {
  font-weight: 300;
  font-size: 20px;
  letter-spacing: -0.5px;
}
body[data-design="minimal"] .nav-label {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.2px;
}
body[data-design="minimal"] .stat-label {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 9px;
  font-weight: 400;
  color: var(--text-3);
}
body[data-design="minimal"] .stat-num {
  font-weight: 200 !important;
  font-size: 40px !important;
  letter-spacing: -2px;
  color: var(--text) !important;
}

/* Minimal — Forms (bottom-border only) */
body[data-design="minimal"] .form-label {
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 10px;
  color: var(--text-3);
}
body[data-design="minimal"] .form-input,
body[data-design="minimal"] .form-select,
body[data-design="minimal"] .form-textarea {
  border: none;
  border-bottom: 1px solid var(--border-md);
  border-radius: 0;
  background: transparent;
  padding-left: 0;
  box-shadow: none;
}
body[data-design="minimal"] .form-input:focus,
body[data-design="minimal"] .form-select:focus,
body[data-design="minimal"] .form-textarea:focus {
  outline: none;
  border-bottom: 1px solid var(--text);
  background: transparent;
  box-shadow: none;
}

/* Minimal — Tables */
body[data-design="minimal"] table {
  border: none;
}
body[data-design="minimal"] thead th {
  background: transparent;
  border-bottom: 1px solid var(--border-md);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 9px;
  color: var(--text-3);
}
body[data-design="minimal"] tbody tr {
  border-bottom: 1px solid var(--border);
}
body[data-design="minimal"] tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

/* Minimal — Tabs & pills */
body[data-design="minimal"] .tab-btn,
body[data-design="minimal"] .filter-btn {
  border-radius: 0;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
  background: none;
}
body[data-design="minimal"] .tab-btn.active,
body[data-design="minimal"] .filter-btn.active {
  border-bottom-color: var(--accent);
  background: none;
  box-shadow: none;
}

/* Minimal — Search bar */
body[data-design="minimal"] .search-bar {
  border: none;
  border-bottom: 1px solid var(--border-md);
  border-radius: 0;
  background: transparent;
  padding-left: 0;
}
body[data-design="minimal"] .search-bar:focus {
  border-bottom-color: var(--text);
  box-shadow: none;
}

/* Minimal — Badge */
body[data-design="minimal"] .badge {
  border-radius: 2px;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* Minimal — Cards get no radius on inner elements */
body[data-design="minimal"] .card,
body[data-design="minimal"] .stat-card,
body[data-design="minimal"] .modal-box {
  border-radius: 0;
}

/* ── LEADS ──────────────────────────────────────────────────────── */
.lead-status-badge {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid;
  background: transparent;
}
