/* ═══════════════════════════════════════
   DESIGN TOKENS — PocketShift Brand Identity
   Navy & Blue palette · Poppins typeface
   ═══════════════════════════════════════ */
:root {
  --slate-950: #060C18;
  --slate-900: #0F172A;
  --slate-800: #1E293B;
  --slate-700: #334155;
  --slate-500: #64748B;
  --slate-400: #94A3B8;
  --slate-200: #CBD5E1;
  --slate-100: #E2E8F0;
  --slate-50:  #F1F5F9;

  --copper-700: #1E40AF;
  --copper-600: #1D4ED8;
  --copper-500: #3B82F6;
  --copper-100: rgba(29,78,216,0.15);
  --copper-50:  rgba(29,78,216,0.08);

  /* Semantic */
  --bg:         #0F172A;
  --surface:    #1E293B;
  --surface-2:  #253349;
  --surface-3:  #334155;
  --text-1:     #F1F5F9;
  --text-2:     #94A3B8;
  --text-3:     #64748B;
  --text-primary:   #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted:     #64748B;
  --border:     #1E293B;
  --border-2:   #334155;
  --border-strong: #475569;

  --success-bg: rgba(34,197,94,0.12);
  --success:    #22C55E;
  --success-600: #16A34A;
  --warning-bg: rgba(245,158,11,0.12);
  --warning:    #F59E0B;
  --danger-bg:  rgba(239,68,68,0.12);
  --danger:     #EF4444;
  --info-bg:    rgba(59,130,246,0.12);
  --info:       #3B82F6;

  /* Layout */
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  14px;
  --radius-xl:  18px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.3);
  --shadow:     0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg:  0 12px 32px rgba(0,0,0,0.5);

  /* Type */
  --font:       'Poppins', system-ui, sans-serif;
  --font-display: 'Poppins', system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', monospace;
}

/* ═══ RESET & BASE ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--bg); }
body { font-family: var(--font); background: var(--bg); color: var(--text-1); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; margin: 0; }
button, input, select, textarea { font-family: var(--font); }

/* ═══ SHELL — sidebar + main (matches admin) ═══ */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 232px; background: var(--surface); border-right: 1px solid var(--border); flex-shrink: 0; display: flex; flex-direction: column; padding: 18px 12px; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 10; }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.sb-mark { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; font-size: 18px; background: transparent; }
.sb-name { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; color: var(--text-1); }
.sb-sub { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.sb-section { font-size: 10px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.07em; padding: 14px 10px 6px; }
.sb-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text-2); font-size: 13px; font-weight: 500; cursor: pointer; transition: background 0.12s, color 0.12s; border: none; background: none; width: 100%; text-align: left; font-family: var(--font); }
.sb-item i { font-size: 17px; flex-shrink: 0; width: 17px; }
.sb-item:hover { background: var(--surface-2); color: var(--text-1); }
.sb-item.active { background: var(--copper-100); color: var(--copper-600); }
.sb-spacer { flex: 1; }
.sb-foot { padding: 10px; border-top: 1px solid var(--border); margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.sb-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; color: var(--text-2); }
.sb-foot-name { font-size: 12px; font-weight: 600; }
.sb-foot-role { font-size: 10px; color: var(--text-3); }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; margin-left: 232px; }
.topbar { height: 60px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; flex-shrink: 0; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.page-title { font-size: 17px; font-weight: 700; }
.header-date { font-size: 12px; color: var(--text-3); }

/* ═══ SCREENS ═══ */
.screens { flex: 1; overflow-y: auto; }
.screen { display: none; padding: 24px 28px 60px; max-width: 1100px; }
.screen.active { display: block; }

/* ═══ PIPE DIVIDER (signature element) ═══ */
.pipe-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0 8px;
}
.pipe-divider-line { flex: 1; height: 1px; background: var(--border); }
.pipe-divider-node {
  width: 8px; height: 8px; border-radius: 50%;
  border: 2px solid var(--border-2);
  background: var(--surface); flex-shrink: 0;
}
.pipe-divider-label { font-size: 10px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }

/* ═══ STAT CARDS ═══ */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.stat-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 14px 16px; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
}
.stat-card.copper::before { background: var(--copper-600); }
.stat-card.slate::before { background: var(--slate-700); }
.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before { background: var(--danger); }
.stat-label { font-size: 10px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.stat-value { font-size: 22px; font-weight: 600; color: var(--text-1); font-family: var(--font-display); letter-spacing: -0.5px; line-height: 1; }
.stat-value.copper { color: var(--copper-700); }
.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }
.stat-value.danger { color: var(--danger); }
.stat-delta { font-size: 11px; color: var(--text-3); margin-top: 4px; font-family: var(--font-mono); }

/* ═══ ALERT BANNERS ═══ */
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius);
  margin-bottom: 8px; border: 1px solid transparent;
}
.alert-danger { background: var(--danger-bg); border-color: rgba(192,57,43,0.2); }
.settings-tab-panel { animation: fadeIn 0.15s ease; }
.price-row, .checklist-edit-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.price-row:last-child, .checklist-edit-row:last-child { border-bottom: none; }
.price-row input[type="text"] { flex: 2; }
.price-row input[type="number"] { flex: 1; }
.price-row .form-control, .checklist-edit-row .form-control { padding: 8px 10px; font-size: 13px; }
.row-remove-btn { background: var(--danger-bg); color: var(--danger); border: none; border-radius: 6px; width: 30px; height: 30px; flex-shrink: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.checklist-edit-row .drag-handle { color: var(--text-muted); font-size: 14px; flex-shrink: 0; cursor: grab; }

.layout-item-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.layout-item-row:last-child { border-bottom: none; }
.layout-item-row.dragging { opacity: 0.4; }
.layout-item-row .drag-handle { color: var(--text-muted); font-size: 16px; flex-shrink: 0; cursor: grab; }
.layout-item-icon { font-size: 18px; width: 22px; text-align: center; flex-shrink: 0; }
.layout-item-label { font-size: 13px; font-weight: 600; color: var(--text-primary); flex: 1; }
.layout-item-row.disabled .layout-item-label { color: var(--text-muted); }
.layout-reorder-btns { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.layout-reorder-btn { background: var(--surface-2); border: none; border-radius: 4px; width: 22px; height: 16px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); font-size: 11px; padding: 0; }
.layout-reorder-btn:disabled { opacity: 0.3; cursor: default; }
.layout-toggle { width: 36px; height: 20px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border-strong); position: relative; cursor: pointer; flex-shrink: 0; transition: background 0.15s; }
.layout-toggle.on { background: var(--copper-600); border-color: var(--copper-600); }
.layout-toggle-knob { width: 14px; height: 14px; border-radius: 50%; background: white; position: absolute; top: 2px; left: 2px; transition: left 0.15s; }
.layout-toggle.on .layout-toggle-knob { left: 18px; }
.greeting { padding: 2px 2px 12px; }
.greeting-hi { font-size: 21px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.3px; }
.greeting-sub { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.timeline { position: relative; padding-left: 22px; }
.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; left: -22px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--border-2); border: 2px solid var(--surface-1); }
.timeline-item.done::before { background: var(--success-600, #1a7a4a); }
.timeline-item.active::before { background: var(--copper-600); box-shadow: 0 0 0 4px var(--copper-100); }
.timeline-item::after { content: ''; position: absolute; left: -17px; top: 14px; bottom: -8px; width: 2px; background: var(--border); }
.timeline-item:last-child::after { display: none; }
.timeline-item.done::after { background: var(--success-600, #1a7a4a); opacity: 0.3; }
.timeline-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.timeline-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.line-items { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; margin: 10px 0; }
.line-row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.line-row:last-child { margin-bottom: 0; }
.line-row.total { padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--border-2); font-weight: 700; font-size: 14px; }
.line-label { color: var(--text-secondary); }
.line-row.total .line-label { color: var(--text-primary); }
.line-val { font-family: var(--font-mono); color: var(--text-primary); }
.trade-option { border: 1.5px solid var(--border-2); border-radius: var(--radius-sm); padding: 12px 6px; text-align: center; cursor: pointer; transition: all 0.12s; background: var(--surface-1); }
.trade-option.selected { border-color: var(--copper-600); background: var(--copper-50); }
.trade-option i { font-size: 20px; color: var(--text-muted); display: block; margin-bottom: 5px; }
.trade-option.selected i { color: var(--copper-600); }
.trade-option-label { font-size: 10px; font-weight: 600; color: var(--text-secondary); }
.trade-option.selected .trade-option-label { color: var(--text-primary); }
.alert-warning { background: var(--warning-bg); border-color: rgba(139,98,0,0.2); }
.alert-info { background: var(--info-bg); border-color: rgba(29,78,216,0.2); }
.alert-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.alert-title { font-size: 13px; font-weight: 600; margin-bottom: 1px; }
.alert-danger .alert-title { color: var(--danger); }
.alert-warning .alert-title { color: var(--warning); }
.alert-info .alert-title { color: var(--info, #3B82F6); }
.alert-body { font-size: 12px; color: var(--text-2); }

/* ═══ CARDS ═══ */
.card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  margin-bottom: 8px; overflow: hidden;
}
.card-body { padding: 12px 14px; }
.card-header { padding: 12px 14px 0; }
.card-footer { padding: 8px 14px 12px; display: flex; gap: 6px; border-top: 1px solid var(--border); margin-top: 8px; flex-wrap: wrap; }
.card-clickable { cursor: pointer; transition: box-shadow 0.15s, transform 0.1s; }
.card-clickable:active { transform: scale(0.99); box-shadow: var(--shadow); }

/* ═══ JOB CARD SPECIFICS ═══ */
.job-type { font-size: 14px; font-weight: 600; color: var(--text-1); margin-bottom: 2px; }
.job-client { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.job-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 0; }
.job-meta-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }
.job-meta-item svg { width: 13px; height: 13px; stroke: var(--text-3); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ═══ STATUS PILLS ═══ */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; border-radius: 20px;
  padding: 3px 8px; flex-shrink: 0; white-space: nowrap;
}
.pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.pill-urgent { background: var(--danger-bg); color: var(--danger); }
.pill-urgent::before { background: var(--danger); }
.pill-progress { background: var(--warning-bg); color: var(--warning); }
.pill-progress::before { background: var(--warning); }
.pill-done { background: var(--success-bg); color: var(--success); }
.pill-done::before { background: var(--success); }
.pill-scheduled { background: var(--info-bg); color: var(--info); }
.pill-scheduled::before { background: var(--info); }
.pill-sent { background: var(--copper-50); color: var(--copper-700); }
.pill-sent::before { background: var(--copper-600); }
.pill-overdue { background: var(--danger-bg); color: var(--danger); }
.pill-overdue::before { background: var(--danger); }
.pill-paid { background: var(--success-bg); color: var(--success); }
.pill-paid::before { background: var(--success); }

/* ═══ CHECKLIST PROGRESS ═══ */
.progress-track { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 10px; }
.progress-fill { height: 100%; background: var(--copper-600); border-radius: 2px; transition: width 0.4s ease; }

/* ═══ AVATAR ═══ */
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0; color: #fff;
}
.av-slate  { background: var(--slate-700); }
.av-copper { background: var(--copper-600); }
.av-teal   { background: #0e7490; }
.av-forest { background: #2d6a4f; }
.av-wine   { background: #7b2d8b; }

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; border: none; border-radius: var(--radius-sm);
  padding: 9px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: opacity 0.15s, transform 0.1s;
  font-family: var(--font); line-height: 1; white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.btn .ph { font-size: 16px; }
.btn-copper { background: var(--copper-600); color: #fff; }
.btn-copper:hover { background: var(--copper-700); }
.btn-outline { background: transparent; border: 1px solid var(--border-2); color: var(--text-2); }
.btn-outline:hover { border-color: var(--text-3); color: var(--text-1); }
.btn-outline.active, .send-channel-btn.active { background: var(--copper-100); border-color: var(--copper-600); color: var(--copper-600); }
.btn-slate { background: var(--slate-900); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-success { background: var(--success-bg); color: var(--success); }
.btn-full { width: 100%; padding: 12px; font-size: 14px; font-weight: 600; }

/* ═══ FAB ═══ */
.fab {
  position: fixed; bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 12px);
  right: 16px; z-index: 50;
}
.fab-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--slate-900); color: #fff;
  border: none; border-radius: 50px; padding: 13px 20px;
  font-size: 14px; font-weight: 600; font-family: var(--font);
  box-shadow: var(--shadow-lg); cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.fab-btn:active { transform: scale(0.96); box-shadow: var(--shadow); }
.fab-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ═══ QUICK ACTION GRID ═══ */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 14px;
  cursor: pointer; transition: box-shadow 0.15s, transform 0.1s;
  box-shadow: var(--shadow-sm);
}
.quick-card:active { transform: scale(0.97); box-shadow: var(--shadow); }
.quick-icon { font-size: 22px; margin-bottom: 10px; display:block; }
.quick-title { font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: 2px; }
.quick-sub { font-size: 11px; color: var(--text-3); }

/* ═══ CHART BARS ═══ */
.chart-wrap { display: flex; align-items: flex-end; gap: 5px; height: 72px; padding: 0 2px; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.chart-bar { width: 100%; background: var(--slate-100); border-radius: 3px 3px 0 0; min-height: 3px; transition: height 0.5s cubic-bezier(0.34,1.56,0.64,1); }
.chart-bar.current { background: var(--copper-600); }
.chart-bar-label { font-size: 9px; color: var(--text-3); font-family: var(--font-mono); }

/* ═══ FORMS ═══ */
.form-group { margin-bottom: 14px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-2); display: block; margin-bottom: 6px; letter-spacing: 0.02em; }
.form-control {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); padding: 10px 13px;
  font-size: 14px; color: var(--text-1); transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none; -webkit-appearance: none;
}
.form-control:focus { outline: none; border-color: var(--copper-600); box-shadow: 0 0 0 3px var(--copper-100); }
textarea.form-control { height: 80px; resize: none; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* ═══ MODAL / SHEET ═══ */
.sheet-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); z-index: 200;
  align-items: flex-end; justify-content: center;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.sheet-overlay.open { display: flex; }
.sheet {
  background: var(--surface); border-radius: 20px 20px 0 0;
  width: 100%; max-width: 480px; max-height: 90dvh;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 18px calc(env(safe-area-inset-bottom,0px) + 24px);
  box-shadow: 0 -4px 40px rgba(0,0,0,0.4);
  animation: sheetSlideUp 0.25s ease-out;
}
@keyframes sheetSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-handle { width: 36px; height: 4px; background: var(--border-2); border-radius: 2px; margin: 4px auto 14px; }
.sheet-title { font-size: 18px; font-weight: 700; color: var(--text-1); margin-bottom: 18px; font-family: var(--font-display); }
.sheet-actions { display: flex; gap: 10px; margin-top: 16px; }

/* ═══ CHECKLIST ═══ */
.checklist { padding: 2px 0; }
.cl-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.cl-item:last-child { border-bottom: none; }
.cl-box {
  width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid var(--border-2); flex-shrink: 0;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; background: var(--surface-2);
}
.cl-box.done { background: var(--success); border-color: var(--success); }
.cl-box.done::after { content: '✓'; color: #fff; font-size: 12px; font-weight: 700; }
.cl-label { font-size: 13px; color: var(--text-1); flex: 1; }
.cl-label.done { text-decoration: line-through; color: var(--text-3); }

/* ═══ TEAM CARD ═══ */
.emp-card { display: flex; align-items: center; gap: 13px; }
.emp-info { flex: 1; min-width: 0; }
.emp-name { font-size: 14px; font-weight: 600; color: var(--text-1); }
.emp-role { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.emp-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; font-family: var(--font-mono); }

/* ═══ FINANCE ROW ═══ */
.inv-card .card-body { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.inv-info .inv-client { font-size: 14px; font-weight: 600; color: var(--text-1); }
.inv-info .inv-num { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); margin-top: 2px; }
.inv-info .inv-desc { font-size: 12px; color: var(--text-2); margin-top: 4px; max-width: 200px; }
.inv-amount { font-size: 18px; font-weight: 600; font-family: var(--font-mono); color: var(--text-1); text-align: right; flex-shrink: 0; }
.inv-due { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); margin-top: 3px; text-align: right; }

/* ═══ QUOTE CALC ═══ */
.quote-total-card {
  background: var(--slate-900); border-radius: var(--radius);
  padding: 16px; margin-top: 4px;
}
.qt-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.qt-label { font-size: 12px; color: rgba(255,255,255,0.5); }
.qt-val { font-size: 13px; color: rgba(255,255,255,0.8); font-family: var(--font-mono); }
.qt-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 10px 0; }
.qt-total-label { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.7); }
.qt-total-val { font-size: 22px; font-weight: 600; color: var(--copper-500); font-family: var(--font-mono); }

/* ═══ INSTALL BANNER ═══ */
.install-banner {
  background: linear-gradient(135deg, var(--slate-900), var(--slate-800));
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 14px; border: 1px solid var(--slate-700);
}
.install-icon { font-size: 28px; flex-shrink: 0; }
.install-text { flex: 1; }
.install-title { font-size: 13px; font-weight: 600; color: #fff; margin-bottom: 2px; }
.install-sub { font-size: 11px; color: rgba(255,255,255,0.5); }

/* ═══ OFFLINE QUEUE INDICATOR ═══ */
.offline-queue {
  background: var(--warning-bg); border: 1px solid rgba(139,98,0,0.2);
  border-radius: var(--radius-sm); padding: 10px 14px;
  display: none; align-items: center; gap: 10px; margin-bottom: 12px;
  font-size: 12px; color: var(--warning);
}
.offline-queue.show { display: flex; }

/* ═══ EMPTY STATE ═══ */
.empty {
  text-align: center; padding: 52px 24px;
  display: flex; flex-direction: column; align-items: center;
}
.empty-icon { font-size: 44px; margin-bottom: 16px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-1); margin-bottom: 6px; }
.empty-sub { font-size: 13px; color: var(--text-3); line-height: 1.6; }

/* ═══ FILTER ROW ═══ */
.filter-row { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { flex-shrink: 0; padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 500; border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2); cursor: pointer; transition: all 0.15s; }
.filter-chip.active { background: var(--copper-600); color: #fff; border-color: var(--copper-600); }

/* Toggle switch */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); }
.switch { width: 44px; height: 24px; border-radius: 12px; background: var(--surface-3); cursor: pointer; position: relative; transition: background 0.2s; flex-shrink: 0; }
.switch .switch-knob { width: 20px; height: 20px; border-radius: 50%; background: #fff; position: absolute; top: 2px; left: 2px; transition: left 0.2s, background 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.switch.on { background: var(--copper-600); }
.switch.on .switch-knob { left: 22px; }

/* ═══ SEARCH ═══ */
.search-wrap { position: relative; margin-bottom: 14px; }
.search-input { padding-left: 38px !important; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* ═══ TOAST ═══ */
.toast {
  position: fixed; bottom: calc(70px + env(safe-area-inset-bottom,0px) + 8px);
  left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--slate-900); color: #fff;
  padding: 11px 20px; border-radius: 50px;
  font-size: 13px; font-weight: 500; z-index: 999;
  opacity: 0; transition: opacity 0.25s, transform 0.25s;
  pointer-events: none; white-space: nowrap;
  box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ═══ DB CONFIG SCREEN ═══ */
.db-config-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px 20px; margin-top: 8px;
}
.db-status { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius-sm); margin-bottom: 16px; }
.db-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.connected { background: var(--success); }
.disconnected { background: var(--danger); }
.db-status-text { font-size: 13px; font-weight: 500; color: var(--text-1); }
.db-status-sub { font-size: 11px; color: var(--text-3); }

/* ═══ UTILITY ═══ */
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-3); }
.text-sm { font-size: 12px; }

/* ═══ DESKTOP LAYOUT (≥900px) ═══
   Same markup, repositioned: bottom nav becomes a left sidebar,
   header becomes a top bar that no longer needs safe-area insets,
   content gets a max content width with breathing room rather
   than stretching edge-to-edge on large screens.
   Placed at the END of the stylesheet deliberately — these rules
   share specificity with the base mobile rules above, so source
   order is what makes them actually win at this breakpoint. */
/* ═══ MOBILE ═══ */
@media (max-width: 768px) {
  .sidebar { position: fixed; left: -260px; width: 260px; z-index: 150; transition: left 0.25s ease; box-shadow: none; }
  .sidebar.open { left: 0; box-shadow: 4px 0 24px rgba(0,0,0,0.5); }
  .sb-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 149; }
  .sb-overlay.open { display: block; }
  .main { margin-left: 0; }
  .topbar { padding: 0 14px; height: 52px; }
  .page-title { font-size: 15px; }
  .mob-menu { display: flex !important; }
  .screen { padding: 14px 14px 80px !important; }
  .stats-grid { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .quick-grid { grid-template-columns: 1fr 1fr 1fr !important; }
  .form-row { flex-direction: column; gap: 8px; }
  .sheet-overlay { align-items: flex-end !important; justify-content: stretch !important; }
  .sheet { max-width: none !important; width: 100% !important; border-radius: 16px 16px 0 0 !important; max-height: 92dvh; min-height: 40dvh; padding: 10px 16px calc(env(safe-area-inset-bottom,0px) + 20px); }
  .fab { bottom: 20px; right: 16px; z-index: 50; }
  .filter-row { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap !important; gap: 6px !important; }
  .card-footer { flex-wrap: wrap; gap: 6px; }
  /* Larger touch targets for mobile */
  .sb-item { min-height: 44px; padding: 10px 14px; font-size: 14px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .filter-chip { min-height: 36px; padding: 0 12px; font-size: 12px; }
  .form-control { min-height: 44px; font-size: 16px; } /* 16px prevents iOS zoom */
  select.form-control { font-size: 16px; }
  .card { margin-bottom: 8px; }
  .card-body { padding: 12px; }
  /* Prevent content scroll when sidebar is open */
  body.sb-open { overflow: hidden; }
}
.mob-menu { display: none; align-items: center; justify-content: center; background: none; border: none; color: var(--text-2); font-size: 22px; cursor: pointer; padding: 8px; border-radius: 8px; margin-right: 8px; flex-shrink: 0; }
.mob-menu:active { background: var(--surface-2); }
.sb-overlay { display: none; }

@media (min-width: 900px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .sheet-overlay { align-items: center; }
  .sheet {
    max-width: 480px; border-radius: 16px; max-height: 85vh;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  }
  .fab { position: fixed; bottom: 28px; right: 36px; }
}

@media (min-width: 1280px) {
  .screen { max-width: 1280px; }
}

/* Tutorial spotlight overlay */
.tutorial-overlay { position: fixed; inset: 0; z-index: 9998; pointer-events: none; }
.tutorial-overlay.active { pointer-events: auto; }
.tutorial-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 9998; transition: opacity 0.2s; }
.tutorial-spotlight { position: absolute; z-index: 9999; border-radius: 10px; box-shadow: 0 0 0 4000px rgba(0,0,0,0.6); pointer-events: none; transition: all 0.3s ease; }
.tutorial-tooltip { position: absolute; z-index: 10000; background: var(--surface-1); border-radius: 14px; padding: 18px 20px; max-width: 320px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); pointer-events: auto; }
.tutorial-tooltip::before { content: ''; position: absolute; width: 12px; height: 12px; background: var(--surface-1); transform: rotate(45deg); }
.tutorial-tooltip.above::before { bottom: -6px; left: 24px; }
.tutorial-tooltip.below::before { top: -6px; left: 24px; }
.tutorial-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.tutorial-text { font-size: 13px; line-height: 1.6; color: var(--text-2); margin-bottom: 14px; }
.tutorial-progress { display: flex; gap: 4px; margin-bottom: 12px; }
.tutorial-dot { flex: 1; height: 3px; border-radius: 2px; background: var(--surface-3); }
.tutorial-dot.done { background: var(--copper-600); }
.tutorial-dot.current { background: var(--copper-600); }
.tutorial-actions { display: flex; gap: 8px; }
.tutorial-highlight { position: relative; z-index: 9999; pointer-events: auto !important; animation: tutorialPulse 1.5s infinite; }
@keyframes tutorialPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(29,78,216,0.4); } 50% { box-shadow: 0 0 0 8px rgba(29,78,216,0); } }

/* Native app adjustments */
body.native-app { padding-top: env(safe-area-inset-top); }
body.native-app .topbar { padding-top: env(safe-area-inset-top); height: calc(52px + env(safe-area-inset-top)); }
body.native-app .sidebar { padding-top: env(safe-area-inset-top); }
body.native-app .screen { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
body.native-app .fab { bottom: calc(20px + env(safe-area-inset-bottom)); }
body.native-app .sheet { padding-bottom: env(safe-area-inset-bottom); }
