/* ── SHARED STYLES ── Launch House Ops ─────────────────────────────────────── */
/* Common CSS used by all pages: index, calendar, catalog, new-projects       */

/* ── FONTS ── */
@font-face {
  font-family: 'Nungo';
  src: url('nNungo.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Capture It';
  src: url('CaptureIt.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ── CSS VARIABLES ── */
:root {
  --bg:         #141414;
  --surface:    #1b1b1b;
  --surface2:   #232323;
  --border:     #333333;
  --gold:       #d4b655;
  --gold-dim:   #8a7038;
  --gold-glow:  rgba(212,182,85,0.14);
  --text:       #f0eee8;
  --muted:      #8b92a0;
  --green:      #5cc98d;
  --amber:      #f0b420;
  --red:        #e87070;
  --blue:       #6aabe8;
  --header-bg:  rgba(20,20,20,0.92);
  --cal-other:  #3a3a3a;
  --cal-dimmed: #353535;
}

html[data-theme="light"] {
  --bg:         #f5f3ef;
  --surface:    #ffffff;
  --surface2:   #ede9e3;
  --border:     #cec8be;
  --gold:       #96700f;
  --gold-dim:   #b89230;
  --gold-glow:  rgba(150,112,15,0.1);
  --text:       #141620;
  --muted:      #6b665f;
  --green:      #1a6b42;
  --amber:      #9a6500;
  --red:        #a82828;
  --blue:       #1f5a9e;
  --header-bg:  rgba(245,243,239,0.94);
  --cal-other:  #c8c4bc;
  --cal-dimmed: #c0bdb5;
}

/* ── AUTH GATE ── */
html.lho-auth-pending body { visibility: hidden; }

/* ── SELECT OPTION FIX (dark theme) ── */
select option { background: var(--surface, #1a1d23); color: var(--text, #e8e6e1); }

/* ── BASE ── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(212,182,85,0.03) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(255,255,255,0.015) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── HEADER ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 36px;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.logo-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  margin-left: 4px;
  margin-top: -4px;
  margin-bottom: -4px;
}

.logo-name {
  font-family: 'Nungo', 'Cormorant Garamond', serif;
  font-size: 21px;
  font-weight: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

.logo-tag {
  font-family: 'Capture It', 'Outfit', monospace;
  font-size: 18px;
  color: #c4dd04;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ── NAV TABS ── */
.nav-tabs {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.nav-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 18px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.nav-tab:hover { color: var(--text); }
.nav-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.nav-tab-green { background: rgba(76,175,80,0.12); color: var(--green, #4caf50) !important; border: 1px solid rgba(76,175,80,0.3); border-radius: 4px; padding: 6px 16px; margin-right: 24px; white-space: nowrap; }
.nav-tab-green:hover { background: rgba(76,175,80,0.22); color: #fff !important; }
.nav-tab-green.active { background: rgba(76,175,80,0.2); border-color: var(--green, #4caf50); color: var(--green, #4caf50) !important; }
.nav-tab-divider { width: 1px; background: var(--border); margin: 8px 6px; align-self: stretch; }

/* ── HEADER RIGHT ── */
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.date-display {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-align: right;
  line-height: 1.4;
}

.btn-theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.btn-theme-toggle:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
  background: var(--gold-glow);
}

/* ── USER IDENTITY (shared across all pages) ── */
.user-identity {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border: 1px solid transparent;
}
.user-identity-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}
.btn-sign-out {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.btn-sign-out:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(224,92,92,0.08);
}

/* ── COMMON ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── NOTIFICATIONS ── */
.btn-notifications {
  background: none; border: none; color: var(--muted); cursor: pointer;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  position: relative; transition: color 0.2s;
}
.btn-notifications:hover { color: var(--text); }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--red, #ef4444); color: #fff;
  font-family: 'Outfit', sans-serif; font-size: 9px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; line-height: 1;
}
.notif-dropdown {
  position: absolute; top: 38px; right: 0; z-index: 9999;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; width: 320px; max-height: 420px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  overflow: hidden;
}
.notif-header {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-family: 'Outfit', sans-serif; font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.notif-item:hover { background: var(--surface2, rgba(255,255,255,0.03)); }
.notif-item:last-child { border-bottom: none; }
.notif-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.notif-from { font-family: 'Outfit', sans-serif; font-size: 12px; font-weight: 600; color: var(--text); }
.notif-time { font-family: 'Outfit', sans-serif; font-size: 10px; color: var(--muted); }
.notif-msg { font-family: 'Outfit', sans-serif; font-size: 12px; color: var(--text); line-height: 1.4; margin-bottom: 6px; }
.notif-item-footer { display: flex; justify-content: space-between; align-items: center; }
.notif-source { font-family: 'Outfit', sans-serif; font-size: 10px; color: var(--muted); text-transform: capitalize; }
.notif-complete-btn {
  background: none; border: 1px solid var(--border); color: var(--green, #22c55e);
  font-family: 'Outfit', sans-serif; font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 4px; cursor: pointer; transition: all 0.15s;
}
.notif-complete-btn:hover { background: var(--green, #22c55e); color: #fff; border-color: var(--green, #22c55e); }
.notif-project-link {
  color: var(--gold, #d4b655); text-decoration: none; font-weight: 500;
  transition: color 0.15s;
}
.notif-project-link:hover { color: var(--text); text-decoration: underline; }

/* ── VISIBILITY ROLES ── */
/* Hide financial sections by default, reveal per role */
.vis-commission,
.vis-foreman,
.vis-pm-fee,
.vis-net-profit,
.vis-profit-share,
.vis-owner-only { display: none !important; }

/* Owner sees all */
body.vis-owner .vis-commission,
body.vis-owner .vis-foreman,
body.vis-owner .vis-pm-fee,
body.vis-owner .vis-net-profit,
body.vis-owner .vis-profit-share,
body.vis-owner .vis-owner-only { display: block !important; }

/* PM sees foreman, PM fee, net profit */
body.vis-pm .vis-foreman,
body.vis-pm .vis-pm-fee,
body.vis-pm .vis-net-profit { display: block !important; }

/* Sales sees commission + foreman */
body.vis-sales .vis-commission,
body.vis-sales .vis-foreman { display: block !important; }

/* Sales Partner sees everything except total payouts */
body.vis-sales_partner .vis-commission,
body.vis-sales_partner .vis-foreman,
body.vis-sales_partner .vis-pm-fee,
body.vis-sales_partner .vis-net-profit,
body.vis-sales_partner .vis-profit-share { display: block !important; }

/* ── BUILD SHEET (inline in job view) ────────────────────────────────────── */

/* Buttons (used by build sheet top bar, add-item rows, etc.) */
.btn-secondary {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  padding: 8px 20px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-secondary:hover { border-color: var(--muted); color: var(--text); }

/* Financial summary rows */
.bs-summary-row { display:flex; justify-content:space-between; align-items:center; padding:8px 0; font-size:14px; }
.bs-summary-row + .bs-summary-row { border-top:1px solid var(--border); }
.bs-summary-row.total { border-top:2px solid var(--gold); margin-top:8px; padding-top:12px; font-weight:600; }
.bs-discount-notes-row { padding:0 0 4px 0; }
.bs-discount-notes-row + .bs-summary-row { border-top:none; }
.bs-summary-label { color:var(--muted); font-family:'Outfit',sans-serif; font-size:11px; letter-spacing:0.06em; }
.bs-summary-value { font-family:'Outfit',sans-serif; font-size:14px; }
.bs-summary-value.green { color:var(--green); }
.bs-summary-value.red { color:var(--red); }
.bs-summary-value.gold { color:var(--gold); }

/* Item type tag & override badges */
.bs-item-type-tag { font-family:'Outfit',sans-serif; font-size:9px; letter-spacing:0.08em; text-transform:uppercase; padding:2px 8px; border-radius:3px; border:1px solid var(--border); color:var(--gold); background:var(--surface2); display:inline-block; }
.bs-override-badge { font-family:'Outfit',sans-serif; font-size:8px; letter-spacing:0.08em; text-transform:uppercase; padding:2px 6px; border-radius:3px; background:rgba(245,166,35,0.15); color:#f5a623; border:1px solid rgba(245,166,35,0.3); margin-left:8px; vertical-align:middle; }
.bs-override-reset { background:none; border:1px solid var(--border); color:var(--muted); cursor:pointer; font-size:12px; padding:1px 6px; border-radius:3px; margin-left:4px; vertical-align:middle; transition:color 0.15s,border-color 0.15s; }
.bs-override-reset:hover { color:var(--gold); border-color:var(--gold-dim); }

/* Section group headers */
.bs-section-header td {
  background: rgba(201,168,76,0.07) !important;
  padding: 14px 18px 8px !important;
  border-bottom: 2px solid var(--gold-dim) !important;
}
.bs-section-header:hover td { background: rgba(201,168,76,0.07) !important; }
.bs-section-label {
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}
.bs-section-count {
  font-family: 'Outfit', sans-serif;
  font-size: 9px;
  color: var(--muted);
  margin-left: 10px;
}
.bs-section-visibility {
  font-family: 'Outfit', sans-serif;
  font-size: 8px;
  color: var(--muted);
  opacity: 0.6;
  margin-left: 10px;
  letter-spacing: 0.06em;
}

/* Category accordion sub-headers */
.bs-cat-header td {
  background: rgba(201,168,76,0.02) !important;
  padding: 8px 18px 8px 32px !important;
  border-bottom: 1px solid var(--border) !important;
  cursor: pointer;
  user-select: none;
}
.bs-cat-header:hover td { background: rgba(201,168,76,0.06) !important; }
.bs-cat-toggle {
  display: inline-block;
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.15s ease;
  margin-right: 8px;
  width: 10px;
  text-align: center;
}
.bs-cat-toggle.expanded { transform: rotate(90deg); }
.bs-cat-label {
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  font-weight: 400;
}
.bs-cat-count {
  font-family: 'Outfit', sans-serif;
  font-size: 9px;
  color: var(--muted);
  margin-left: 6px;
}
.bs-cat-actions {
  float: right;
  display: flex;
  gap: 6px;
}
.bs-cat-actions button {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.bs-cat-actions button:hover { border-color: var(--gold-dim); color: var(--text); }
.bs-cat-select {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  padding: 3px 6px;
  cursor: pointer;
  transition: all 0.15s;
  max-width: 260px;
  height: 26px;
}
/* Tighten product item rows to match service/expense row height */
.bs-cat-item td { padding: 6px 12px !important; }
.bs-cat-item td:first-child { padding-left: 18px !important; }
/* Tighten service/expense rows to match product rows */
#bsServiceBody td, #bsExpenseBody td { padding: 6px 12px !important; }
/* Right-align numeric cells in build sheet tables */
.catalog-price { text-align: right; }
.bs-cat-select.has-selection { color: var(--gold); border-color: var(--gold-dim); }
.bs-cat-select:hover { border-color: var(--gold-dim); color: var(--text); }
.bs-cat-select:focus { border-color: var(--gold); color: var(--text); outline: none; }
.bs-cat-select option { background: var(--bg); color: var(--text); }
.bs-cat-empty td {
  padding: 10px 18px 10px 48px !important;
  color: var(--muted);
  font-style: italic;
  font-size: 12px;
}
.bs-cat-collapsed { display: none !important; }

/* Back button (detail views) */
.job-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.job-back-btn:hover { border-color: var(--gold-dim); color: var(--text); }

/* 2-column layout */
.bs-detail-layout { display:flex; gap:24px; align-items:flex-start; }
.bs-detail-main { flex:1; min-width:0; }
.bs-detail-sidebar {
  width:320px; flex-shrink:0;
  position:sticky; top:180px;
  max-height:calc(100vh - 200px);
  overflow-y:auto;
}
.bs-detail-sidebar::-webkit-scrollbar { width:4px; }
.bs-detail-sidebar::-webkit-scrollbar-thumb { background:var(--border); border-radius:2px; }

/* Admin data (sidebar) */
.bs-admin-section {
  background:var(--surface); border:1px solid var(--border);
  padding:20px 24px; margin-bottom:24px;
}
.bs-admin-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px 20px; }
.bs-admin-section textarea.form-input { resize:vertical; min-height:60px; }

/* Customer info sidebar card */
.bs-customer-card {
  background:var(--surface); border:1px solid var(--border);
  padding:16px 20px; margin-bottom:10px;
}
.bs-customer-card .form-group { margin-bottom:8px; }
.bs-customer-card .form-group:last-child { margin-bottom:0; }
.bs-customer-card .form-label { font-size:9px; margin-bottom:2px; }
.bs-customer-card .form-input { font-size:11px; padding:5px 8px; }

/* Mark Final button */
.btn-mark-final {
  background:var(--green); color:#fff; border:none;
  font-family:'Outfit',sans-serif; font-size:11px; font-weight:500;
  padding:6px 14px; cursor:pointer; transition:all 0.15s;
  letter-spacing:0.05em;
}
.btn-mark-final:hover { opacity:0.85; }
.btn-mark-final.is-final {
  background:#e05a2b; font-family:'Special Elite',cursive;
  font-size:14px; letter-spacing:0.12em; text-transform:uppercase;
  padding:5px 14px; transform:rotate(-2deg);
  border:2px solid #e05a2b;
}
.btn-mark-final.is-final:hover { opacity:0.85; }
.final-meta {
  font-family:'Outfit',sans-serif; font-size:9px; color:var(--muted);
  margin-top:2px; text-align:center; line-height:1.3;
}

/* Greyed out (final) - product items only */
.bs-final-locked .bs-detail-main {
  pointer-events:none; opacity:0.5; filter:grayscale(40%);
}
.bs-final-locked .bs-top-bar { pointer-events:auto; opacity:1; filter:none; }

/* Sidebar cards */
.bs-sidebar-card {
  background:var(--surface); border:1px solid var(--border);
  padding:16px 20px; margin-bottom:10px;
}
.bs-sidebar-title {
  font-family:'Outfit',sans-serif; font-size:9px;
  letter-spacing:0.15em; text-transform:uppercase;
  color:var(--gold); margin-bottom:10px;
}

/* Commission flashy box */
.bs-commission-box {
  background:linear-gradient(135deg, rgba(76,201,100,0.14) 0%, rgba(76,201,100,0.04) 100%);
  border:1px solid var(--green); padding:20px; margin-bottom:10px; text-align:center;
}
.bs-commission-value {
  font-family:'Inter','Segoe UI',system-ui,sans-serif; font-size:32px; font-weight:700; color:var(--green);
}
.bs-commission-sub { font-family:'Inter','Segoe UI',system-ui,sans-serif; font-size:11px; font-weight:600; color:var(--muted); margin-top:4px; }

/* Sidebar net profit */
.bs-net-profit-card {
  background:var(--surface); border:2px solid var(--gold-dim);
  padding:20px; margin-bottom:10px; text-align:center;
}
.bs-net-profit-value {
  font-family:'Outfit',sans-serif; font-size:22px; font-weight:600;
}

/* Role visibility */
.bs-restricted-pm { display:none; }
.bs-restricted-profit-share { display:none; }
body.role-admin .bs-restricted-pm,
body.role-nick .bs-restricted-pm { display:block; }
body.role-admin .bs-restricted-profit-share,
body.role-todd .bs-restricted-profit-share,
body.role-thomas .bs-restricted-profit-share { display:block; }

/* Quote/Costs summary cards */
.bs-totals-section {
  background:var(--surface); border:1px solid var(--border);
  padding:20px 24px; margin-bottom:16px;
}
.bs-totals-title {
  font-family:'Outfit',sans-serif; font-size:9px;
  letter-spacing:0.15em; text-transform:uppercase;
  color:var(--gold); margin-bottom:10px; font-weight:500;
}
.bs-pct-input {
  background:transparent; border:none; border-bottom:1px solid transparent;
  color:var(--gold); font-family:'Outfit',sans-serif; font-size:11px;
  padding:1px 2px; outline:none; width:42px; text-align:center;
  transition:border-color 0.15s; display:inline-block;
}
.bs-pct-input:hover { border-bottom-color:var(--border); }
.bs-pct-input:focus { border-bottom-color:var(--gold-dim); }
.bs-pct-input::-webkit-inner-spin-button,
.bs-pct-input::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
.bs-pct-input { -moz-appearance:textfield; }
.bs-flat-input {
  background:transparent; border:none; border-bottom:1px solid transparent;
  color:var(--gold); font-family:'Outfit',sans-serif; font-size:11px;
  padding:1px 2px; outline:none; width:55px; text-align:center;
  transition:border-color 0.15s; display:inline-block;
}
.bs-flat-input:hover { border-bottom-color:var(--border); }
.bs-flat-input:focus { border-bottom-color:var(--gold-dim); }

/* Disabled future buttons */
.bs-future-btn {
  width:100%; padding:10px; font-family:'Outfit',sans-serif; font-size:11px;
  font-weight:600; letter-spacing:0.08em; text-transform:uppercase;
  cursor:not-allowed; opacity:0.35; border:1px solid var(--border);
  background:none; color:var(--muted); margin-bottom:6px;
}

/* Mobile bottom nav — hidden by default, shown at ≤640px */
.mobile-bottom-nav { display: none; }

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — HEADER SCALING (641px – 1200px)
   Progressive shrinking so nav items don't squish on mid-size screens
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Tier 1: ≤ 1400px — tighten spacing, shrink logo text ── */
@media (max-width: 1400px) {
  header { padding: 12px 20px; }
  .logo { gap: 10px; }
  .logo-icon { width: 52px; height: 52px; margin-top: -6px; margin-bottom: -6px; }
  .logo-name { font-size: 16px; }
  .logo-tag { font-size: 13px; letter-spacing: 0.08em; }
  .nav-tab { padding: 8px 12px; font-size: 10px; }
  .nav-tab-green { padding: 6px 12px; margin-right: 14px; font-size: 10px; }
  .header-right { gap: 12px; }
}

/* ── Tier 2: ≤ 1100px — hide "PROJECT COMMAND", tighten more ── */
@media (max-width: 1100px) {
  header { padding: 10px 16px; }
  .logo-tag { display: none; }
  .logo-name { font-size: 15px; }
  .logo-icon { width: 44px; height: 44px; margin-top: -5px; margin-bottom: -5px; }
  .nav-tab { padding: 7px 10px; }
  .nav-tab-green { padding: 5px 10px; margin-right: 10px; }
  .header-right { gap: 10px; }
  .date-display { display: none; }
}

/* ── Tier 3: ≤ 1000px — hide logo name too ── */
@media (max-width: 1000px) {
  .logo-name { display: none; }
  .logo-icon { width: 38px; height: 38px; margin-top: -4px; margin-bottom: -4px; }
  .nav-tab { padding: 6px 8px; font-size: 9px; letter-spacing: 0.05em; }
  .nav-tab-green { padding: 5px 8px; margin-right: 8px; font-size: 9px; }
  .nav-tab-divider { margin: 6px 3px; }
  .header-right { gap: 8px; }
  .user-identity { font-size: 10px; padding: 4px 8px; }
  .btn-sign-out { width: 28px; height: 28px; }
  .btn-theme-toggle { width: 28px; height: 28px; }
  .btn-notifications { width: 28px; height: 28px; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 640px)
   Shared header/nav collapse + common layout adjustments for all pages
   ══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* ── HEADER — slim single row: logo | user + theme + logout ── */
  header { padding: 8px 12px; }
  .logo { gap: 6px; }
  .logo-icon { width: 32px; height: 32px; margin-left: 0; margin-top: -2px; margin-bottom: -2px; }
  .logo-name { display: none; }
  .logo-tag { display: none; }
  .nav-tabs { display: none; }
  .header-right { gap: 8px; }
  .date-display { display: none; }
  .btn-sign-out { display: none; }
  .btn-theme-toggle { width: 26px; height: 26px; }
  .btn-notifications { width: 26px; height: 26px; }
  .user-identity { padding: 3px 6px; font-size: 10px; position: relative; cursor: pointer; }
  .user-identity-dot { width: 5px; height: 5px; }
  .mobile-signout-popover {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    z-index: 300;
    overflow: hidden;
  }
  .mobile-signout-popover.open { display: block; }
  .mobile-signout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--text);
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: 0.5px;
  }
  .mobile-signout-btn:hover { background: var(--surface2, rgba(255,255,255,0.05)); }

  /* Notification dropdown — full width on mobile */
  .notif-dropdown {
    position: fixed !important;
    top: 52px !important;
    left: 12px !important;
    right: 12px !important;
    width: calc(100vw - 24px) !important;
    max-height: 70vh !important;
    z-index: 10000 !important;
  }

  /* Changelog dropdown — full width on mobile */
  #changelogDropdown {
    position: fixed !important;
    top: 52px !important;
    left: 12px !important;
    right: 12px !important;
    width: calc(100vw - 24px) !important;
    max-height: 70vh !important;
    margin-top: 0 !important;
    z-index: 10000 !important;
  }

  /* Build sheet detail — stack sidebar below main */
  .bs-detail-layout { flex-direction: column; }
  .bs-detail-sidebar { width: 100%; position: static; max-height: none; }
  .bs-admin-grid { grid-template-columns: 1fr; }

  /* Prevent horizontal overflow on mobile */
  html, body { overflow-x: hidden; max-width: 100vw; }

  /* Body padding so content isn't hidden behind bottom nav */
  body { padding-bottom: 64px; }

  /* ── MOBILE BOTTOM NAV BAR ── */
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0; left: 0;
    width: 100%;
    height: 56px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 200;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom, 0); /* iPhone notch */
    box-sizing: border-box;
  }
  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    height: 100%;
    text-decoration: none;
    color: var(--muted);
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-nav-item.active { color: var(--gold); }
  .mobile-nav-item svg { width: 20px; height: 20px; }
  .mobile-nav-label {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
  }
}

/* ── RESPONSIVE — TABLET (≤ 768px) ── */
@media (max-width: 768px) {
  .bs-detail-layout { flex-direction: column; }
  .bs-detail-sidebar { width: 100%; position: static; max-height: none; }
  .bs-admin-grid { grid-template-columns: 1fr; }
}
