*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #22263a;
  --border: #2e3350;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --text: #e2e8f0;
  --text-muted: #7c85a2;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

/* ---- LOGIN ---- */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.login-logo p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus { border-color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
}

.btn-primary { background: var(--accent); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.error-msg {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

/* ---- LAYOUT ---- */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.sidebar-logo span {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-muted);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  font-size: 13px;
  font-weight: 500;
}

.nav-item:hover { color: var(--text); background: var(--surface2); }
.nav-item.active { color: var(--accent); border-left-color: var(--accent); background: rgba(59,130,246,0.08); }

.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px 0;
  border-top: 1px solid var(--border);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.user-info { flex: 1; overflow: hidden; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--text-muted); }

.logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  transition: color 0.15s;
}
.logout-btn:hover { color: var(--danger); }

/* ---- MAIN ---- */
.main {
  flex: 1;
  overflow: auto;
  padding: 32px;
}

.page-header {
  margin-bottom: 28px;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.page-header p {
  color: var(--text-muted);
  margin-top: 4px;
  font-size: 13px;
}

/* ---- STATS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

.stat-value.blue { color: var(--accent); }
.stat-value.green { color: var(--success); }
.stat-value.yellow { color: var(--warning); }
.stat-value.white { color: var(--text); }

/* ---- SECTION ---- */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.section-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
}

/* ---- TABLE ---- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  padding: 10px 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface2); }

/* ---- BADGES ---- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-pending  { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-completed { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-inprogress { background: rgba(59,130,246,0.15); color: var(--accent); }
.badge-cancelled { background: rgba(239,68,68,0.15); color: var(--danger); }

.badge-high { background: rgba(239,68,68,0.12); color: #fca5a5; }
.badge-urgent { background: rgba(239,68,68,0.2); color: var(--danger); }
.badge-normal { background: rgba(148,163,184,0.12); color: var(--text-muted); }
.badge-low { background: rgba(34,197,94,0.1); color: #86efac; }

/* ---- EMPTY STATE ---- */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 36px; margin-bottom: 12px; }

/* ---- QUICK DATE ---- */
.date-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---- HIDDEN ---- */
.page { display: none; }
.page.active { display: block; }

/* ---- MODAL ---- */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 20px; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 20px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-ghost { background: var(--surface2); color: var(--text); }
.btn-ghost:hover { background: var(--border); }
.btn-danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }

/* ---- TOOLBAR ---- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 14px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  flex: 1;
  min-width: 180px;
}
.search-input:focus { border-color: var(--accent); }

select.filter-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 14px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

/* ---- LOW STOCK ---- */
.low-stock-row td { background: rgba(239,68,68,0.05); }
.qty-low { color: var(--danger); font-weight: 700; }
.qty-ok  { color: var(--success); font-weight: 600; }

/* ---- ALERT BANNER ---- */
.alert-banner {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #fca5a5;
}

/* ---- QTY ADJUST ---- */
.qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.qty-btn {
  width: 26px; height: 26px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.qty-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---- TABS ---- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 10px 18px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer;
  margin-bottom: -1px; transition: all 0.15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- SETTINGS FORM ---- */
.settings-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 20px;
}
.settings-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

.logo-preview {
  width: 80px; height: 80px; border-radius: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: 12px; overflow: hidden;
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-actions { display: flex; gap: 8px; margin-bottom: 18px; }

/* ---- USER TABLE ---- */
.role-badge {
  display: inline-block; padding: 2px 8px; border-radius: 100px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.role-owner { background: rgba(168,85,247,0.15); color: #c084fc; }
.role-manager { background: rgba(59,130,246,0.15); color: var(--accent); }
.role-field_tech { background: rgba(148,163,184,0.12); color: var(--text-muted); }

.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px;
}
.dot-active { background: var(--success); }
.dot-inactive { background: var(--text-muted); }

/* ---- WEEK GRID ---- */
.week-nav {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}
.week-nav h3 { font-size: 15px; font-weight: 600; }
.week-grid {
  display: grid;
  grid-template-columns: 120px repeat(7, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.week-col-header {
  padding: 10px 8px; text-align: center; font-size: 11px; font-weight: 600;
  text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.week-row-label {
  padding: 12px 10px; font-size: 12px; font-weight: 600;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--surface2); display: flex; flex-direction: column; gap: 2px;
}
.week-row-label .tech-name { color: var(--text); }
.week-row-label .tech-role { color: var(--text-muted); font-size: 10px; text-transform: uppercase; }
.week-cell {
  padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  min-height: 70px; vertical-align: top; position: relative; cursor: pointer;
  transition: background 0.1s;
}
.week-cell:hover { background: var(--surface2); }
.week-cell:last-child { border-right: none; }

.sched-chip {
  background: rgba(59,130,246,0.2); border: 1px solid rgba(59,130,246,0.4);
  border-radius: 4px; padding: 3px 6px; font-size: 11px; color: var(--accent);
  margin-bottom: 3px; cursor: pointer; line-height: 1.3;
}
.sched-chip.type-off { background: rgba(148,163,184,0.1); border-color: var(--border); color: var(--text-muted); }
.sched-chip.type-job { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.3); color: var(--success); }

.tech-filter-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }

/* ── CUSTOMERS ─────────────────────────────────────────────────────────────── */
.customer-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.12s;
}
.customer-row:last-child { border-bottom: none; }
.customer-row:hover { background: var(--surface2); }

.customer-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}

.customer-info { flex: 1; min-width: 0; }
.customer-name { font-weight: 600; font-size: 14px; }
.customer-meta {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 12px; color: var(--text-muted); margin-top: 3px;
}

.customer-row-actions { opacity: 0; transition: opacity 0.12s; }
.customer-row:hover .customer-row-actions { opacity: 1; }

/* ── DETAIL PANEL ──────────────────────────────────────────────────────────── */
.detail-header {
  display: flex; align-items: center; gap: 16px;
  padding: 20px; border-bottom: 1px solid var(--border);
}

.detail-avatar-lg {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0;
}

.detail-header-info h3 { font-size: 18px; font-weight: 700; }
.detail-header-info p  { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

.detail-header-actions { margin-left: auto; display: flex; gap: 8px; }

.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px; padding: 20px;
}

.detail-field label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-muted); display: block; margin-bottom: 4px;
}
.detail-field span { font-size: 14px; }

.detail-notes { padding: 0 20px 20px; }
.detail-notes label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-muted); display: block; margin-bottom: 6px;
}
.detail-notes p { font-size: 13px; color: var(--text); line-height: 1.6; }

/* ── FINANCE ────────────────────────────────────────────────────────────────── */
.fin-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 20px;
}
@media (max-width: 900px) { .fin-stats { grid-template-columns: repeat(2, 1fr); } }

.fin-stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px;
}
.fin-stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 8px; }
.fin-stat-value { font-size: 26px; font-weight: 800; line-height: 1; }
.fin-stat-value.success { color: var(--success); }
.fin-stat-value.warning { color: var(--warning); }
.fin-stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.fin-grid {
  display: grid; grid-template-columns: 2fr 1fr;
  gap: 16px; margin-bottom: 20px;
}
@media (max-width: 900px) { .fin-grid { grid-template-columns: 1fr; } }

.fin-chart-card, .fin-quick-card { /* uses .section */ }

.fin-bar-chart {
  display: flex; align-items: flex-end; gap: 12px;
  padding: 16px 20px 8px; height: 160px; overflow-x: auto;
}
.fin-bar-group { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; min-width: 52px; }
.fin-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.fin-bar {
  width: 100%; min-height: 4px;
  background: var(--accent); border-radius: 4px 4px 0 0;
  transition: height 0.4s ease; cursor: default;
}
.fin-bar:hover { opacity: .8; }
.fin-bar-label { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.fin-bar-val { font-size: 10px; color: var(--text-muted); white-space: nowrap; }

.fin-quick-list { padding: 4px 20px 12px; }
.fin-quick-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.fin-quick-row:last-child { border-bottom: none; }
.fin-quick-row strong { font-weight: 700; }

.fin-rank {
  display: inline-block; width: 20px; height: 20px; line-height: 20px;
  text-align: center; background: var(--surface2); border-radius: 50%;
  font-size: 11px; font-weight: 700; margin-right: 6px;
}

/* ── JOBS ────────────────────────────────────────────────────────────────────── */
.job-row { cursor: pointer; }
.job-row:hover td { background: var(--surface2); }
.job-title { font-weight: 600; font-size: 14px; }
.job-customer { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.customer-preview-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  font-size: 13px;
}
.customer-preview-card strong { font-weight: 700; margin-right: 4px; }
.customer-preview-card span { color: var(--text-muted); }

/* Tech checkbox grid in job modal */
.tech-checkbox-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 8px; margin-top: 4px;
}
.tech-checkbox-label {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; cursor: pointer;
  font-size: 13px; transition: border-color .15s;
}
.tech-checkbox-label:hover { border-color: var(--accent); }
.tech-checkbox-label input { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.tech-checkbox-label span  { font-weight: 600; flex: 1; }

/* ══════════════════════════════════════════════════════════════════
   MOBILE / RESPONSIVE
   ══════════════════════════════════════════════════════════════════ */

/* Mobile top bar (hidden on desktop) */
.mobile-header {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; z-index: 150;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}
.mobile-header .mobile-brand {
  flex: 1; font-weight: 700; font-size: 15px; color: var(--accent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hamburger {
  background: none; border: none; color: var(--text);
  font-size: 22px; cursor: pointer; padding: 6px; line-height: 1;
  flex-shrink: 0;
}

/* Sidebar overlay (mobile backdrop) */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 190;
  background: rgba(0,0,0,.55);
  opacity: 0; transition: opacity .25s;
  pointer-events: none;
}
.sidebar-overlay.active { opacity: 1; pointer-events: all; }

@media (max-width: 768px) {

  /* Show mobile header */
  .mobile-header { display: flex; }
  .sidebar-overlay { display: block; }

  /* Layout: single column, leave room for top bar */
  .layout { display: block; }
  .main   { margin-top: 56px; padding: 14px 12px 80px; overflow: auto; }

  /* Sidebar becomes a fixed left drawer */
  .sidebar {
    position: fixed; top: 0; left: -240px; bottom: 0;
    width: 240px; z-index: 200;
    transition: left .25s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,.4);
  }
  .sidebar.open { left: 0; }

  /* Bigger touch targets for nav items */
  .nav-item { padding: 13px 20px; font-size: 14px; }

  /* Page header */
  .page-header { margin-bottom: 16px; }
  .page-header h2 { font-size: 18px; }

  /* Section padding */
  .section { border-radius: 8px; }

  /* Toolbar: wrap and stack */
  .toolbar {
    flex-wrap: wrap; gap: 8px; padding: 10px 12px;
  }
  .toolbar .search-input { min-width: 0; flex: 1 1 100%; }
  .toolbar .filter-select { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .toolbar .btn { flex-shrink: 0; }

  /* Tables: horizontal scroll */
  .section { overflow-x: auto; }
  .table { min-width: 520px; }

  /* Cards: smaller gap */
  .stats-grid { gap: 10px; }
  .stat-card  { padding: 14px 16px; }
  .stat-value { font-size: 28px; }

  /* Finance stats: 2 columns */
  .fin-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .fin-grid  { grid-template-columns: 1fr; }

  /* Customer rows */
  .customer-row { padding: 12px 14px; }
  .customer-row-actions { opacity: 1; }

  /* Detail view */
  .detail-grid { grid-template-columns: 1fr; gap: 12px; padding: 14px; }
  .detail-header { padding: 14px; gap: 12px; }
  .detail-header-actions { flex-direction: column; gap: 6px; }

  /* Modals: slide up from bottom */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100% !important;
    width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: 90dvh;
    overflow-y: auto;
    margin: 0;
  }
  .modal-body { padding: 12px 16px; }

  /* Form rows stack vertically */
  .form-row { flex-direction: column; gap: 0; }

  /* Tech checkbox grid: single column */
  .tech-checkbox-grid { grid-template-columns: 1fr; }

  /* Distributor rows */
  .dist-row { flex-wrap: wrap; gap: 10px; }
  .dist-actions { width: 100%; justify-content: flex-end; }

  /* Schedule week grid: scrollable */
  .week-grid { min-width: 600px; }

  /* Settings cards */
  .settings-card { padding: 16px; }

  /* Bottom nav bar */
  .bottom-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 140;
    background: var(--surface);
    border-top: 1px solid var(--border);
    height: 60px;
  }
  .bottom-nav-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 2px; color: var(--text-muted); cursor: pointer;
    font-size: 10px; font-weight: 600;
    border: none; background: none;
    transition: color .15s;
    padding: 0;
  }
  .bottom-nav-item .bn-icon { font-size: 20px; line-height: 1; }
  .bottom-nav-item.active  { color: var(--accent); }
}

/* Desktop: hide mobile-only elements */
@media (min-width: 769px) {
  .bottom-nav { display: none; }
  .mobile-header { display: none; }
}
