:root {
  --primary: #1e1f21;
  --primary-dark: #111213;
  --accent: #f5c518;
  --accent-dark: #d4a900;
  --bg: #f0f0f0;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #e0e0e0;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: none;
}

/* ── Layout ── */
#app { display: flex; flex-direction: column; height: 100dvh; }

#topbar {
  background: var(--primary);
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  min-height: 56px;
}
#topbar h1 { font-size: 1rem; font-weight: 600; flex: 1; letter-spacing: 0.01em; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-logo { height: 34px; display: block; flex-shrink: 0; }
.topbar-divider { width: 1px; height: 22px; background: rgba(255,255,255,0.18); flex-shrink: 0; }
#topbar .back-btn { background: none; border: none; color: white; font-size: 1.4rem; cursor: pointer; padding: 4px; line-height: 1; }
#topbar .topbar-action { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; padding: 4px; line-height: 1; }
#voice-mic-btn { transition: transform 0.15s; }
#voice-mic-btn:active { transform: scale(1.2); }
#voice-mic-btn.listening { animation: mic-pulse 1s ease-in-out infinite; }
#voice-mic-btn.processing { opacity: 0.6; }
@keyframes mic-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.15); } }

/* ── Lucide SVG icons ── */
.lc { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; vertical-align: middle; }
.action-btn .lc { display: block; margin: 0 auto; }
.empty-state .empty-icon .lc { display: block; }
.sp-icon .lc { display: block; }

#content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: 80px;
  -webkit-overflow-scrolling: touch;
}

#bottomnav {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  font-size: 0.65rem;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  gap: 2px;
  min-height: 52px;
}
.nav-item .nav-icon { font-size: 1.4rem; line-height: 1; display: flex; align-items: center; justify-content: center; }
.nav-item.active { color: var(--accent); }
.nav-item.active .nav-icon svg { stroke: var(--accent); }
.nav-badge { position:absolute; top:-2px; right:-4px; width:8px; height:8px; border-radius:50%; background:#ef4444; border:1.5px solid var(--bg); }

/* ── Cards ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.card-title { font-size: 0.75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }

/* ── Stats Row ── */
.stats-row { display: flex; gap: 10px; margin-bottom: 12px; }
.stat-card { flex: 1; background: linear-gradient(135deg, #2a2b2e 0%, var(--primary-dark) 100%); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-md); text-align: center; color: white; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--accent); line-height: 1; }
.stat-label { font-size: 0.7rem; color: rgba(255,255,255,0.65); margin-top: 4px; }

/* ── Quick Actions ── */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.action-btn {
  background: var(--card);
  border: none;
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: var(--shadow);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  transition: transform 0.1s, box-shadow 0.1s;
}
.action-btn:active { transform: scale(0.97); box-shadow: none; }
.action-btn .icon { font-size: 1.8rem; display: flex; align-items: center; justify-content: center; }
.action-btn.primary { background: var(--accent); color: var(--primary); }
.action-btn.accent  { background: var(--primary); color: white; }

/* ── Box List ── */
.search-bar {
  position: relative;
  margin-bottom: 12px;
}
.search-bar input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--card);
  color: var(--text);
  outline: none;
}
.search-bar input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,197,24,0.18); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 1.1rem; color: var(--muted); pointer-events: none; }

.filter-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  background: var(--card);
  color: var(--muted);
  flex-shrink: 0;
}
.chip.active { border-color: var(--accent); color: var(--primary); background: rgba(245,197,24,0.12); }

.box-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.1s;
}
.box-item:active { transform: scale(0.98); }
.box-icon { font-size: 1.8rem; flex-shrink: 0; }
.box-info { flex: 1; min-width: 0; }
.box-label { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.box-meta { font-size: 0.8rem; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.box-right { text-align: right; flex-shrink: 0; }
.box-weight { font-weight: 600; font-size: 0.95rem; }
.box-status { display: inline-block; font-size: 0.7rem; padding: 2px 8px; border-radius: 999px; font-weight: 600; margin-top: 4px; }

/* ── Status Badges ── */
.status-full    { background: #dcfce7; color: #15803d; }
.status-partial { background: #fef9c3; color: #a16207; }
.status-empty   { background: #fee2e2; color: #b91c1c; }
.status-merged  { background: #e0e7ff; color: #4338ca; }
.status-split   { background: #fce7f3; color: #be185d; }

/* ── Box Detail ── */
.detail-hero {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.detail-label { font-size: 0.8rem; color: var(--muted); margin-bottom: 2px; }
.detail-value { font-size: 1rem; font-weight: 500; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.detail-weight-big { font-size: 2.2rem; font-weight: 700; color: var(--primary); }

.action-row { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; }
.action-row::-webkit-scrollbar { display: none; }
.btn {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.btn:active { opacity: 0.75; }
.btn-primary { background: var(--accent); color: var(--primary); }
.btn-primary:active { background: var(--accent-dark); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline.active-view { background: var(--primary); color: white; }
.btn-danger  { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-block   { width: 100%; justify-content: center; padding: 14px; font-size: 1rem; border-radius: var(--radius); }
.btn-secondary { background: rgba(255,255,255,0.07); color: var(--text); border: 1px solid rgba(255,255,255,0.12); }
.btn-secondary:active { background: rgba(255,255,255,0.12); }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; border-radius: 6px; }
.input { width: 100%; padding: 8px 12px; border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; font-size: 0.9rem; background: rgba(255,255,255,0.05); color: var(--text); outline: none; box-sizing: border-box; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(245,197,24,0.15); }

/* ── Timeline ── */
.timeline { padding: 0; }
.timeline-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.timeline-item:last-child { border-bottom: none; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 5px; }
.timeline-body { flex: 1; }
.timeline-event { font-size: 0.85rem; font-weight: 500; }
.timeline-time  { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

/* ── Log Table ── */
.log-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.log-table th { text-align: left; padding: 8px 10px; background: var(--primary); color: white; font-weight: 600; font-size: 0.75rem; letter-spacing: 0.03em; white-space: nowrap; }
.log-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.log-table tr:last-child td { border-bottom: none; }
.log-table tr:hover td { background: rgba(0,0,0,0.025); }
.log-table .pos { color: #22c55e; font-weight: 600; }
.log-table .neg { color: #ef4444; font-weight: 600; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.form-control:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(245,197,24,0.18); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* ── Photo Capture Button ── */
.photo-capture-btn {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1.5px dashed rgba(255,255,255,0.18);
  border-radius: 14px;
  padding: 24px 16px 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s;
  color: var(--text);
  margin-top: 4px;
}
.photo-capture-btn:active { background: rgba(255,255,255,0.08); border-color: var(--accent); }
.photo-capture-btn .photo-capture-icon { color: var(--accent); opacity: 0.9; }
.photo-capture-btn .photo-capture-label { font-size: 1rem; font-weight: 700; color: #fff; }
.photo-capture-btn .photo-capture-sub { font-size: 0.75rem; color: var(--muted); }

/* ── Day Toggle (sliding pill) ── */
.day-toggle-wrap { background: #1c1d1f; border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.day-toggle { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: rgba(255,255,255,0.06); border-radius: 10px; padding: 4px; margin-bottom: 10px; }
.day-toggle-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px;
  width: calc(50% - 4px);
  border-radius: 8px;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), background-color 0.25s;
  pointer-events: none; z-index: 0;
}
.day-toggle-opt { position: relative; z-index: 1; background: transparent; border: none; padding: 10px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; transition: color 0.2s; }
.day-toggle-label { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; }
.day-toggle-sub { font-size: 0.82rem; font-weight: 700; }

/* ── Mix Calculator Accordion ── */
.mix-accordion { border-radius: 10px; overflow: hidden; margin-bottom: 12px; border: 1px solid rgba(255,255,255,0.07); }
.mix-accordion-btn { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: rgba(255,255,255,0.04); border: none; color: rgba(255,255,255,0.55); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; cursor: pointer; font-family: inherit; }
.mix-accordion-btn:active { background: rgba(255,255,255,0.08); }
.mix-accordion-chevron { font-size: 1rem; transition: transform 0.2s; line-height: 1; }
.mix-accordion-body { padding: 0 0 2px; }

/* ── Work Order Camera FAB ── */
.wo-camera-fab {
  position: fixed;
  bottom: 76px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.08);
  z-index: 90;
  transition: transform 0.15s, box-shadow 0.15s;
}
.wo-camera-fab:active { transform: scale(0.93); box-shadow: 0 2px 10px rgba(0,0,0,0.4); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
}
.modal-sheet {
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0));
  width: 100%;
  max-height: 90dvh;
  overflow-y: auto;
}
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; text-align: center; }
.modal-drag { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 16px; }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; display: flex; justify-content: center; }
.empty-state p { font-size: 0.9rem; }

/* ── Loading ── */
.spinner { border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; width: 32px; height: 32px; animation: spin 0.7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Flake calculator result entrance ── */
@keyframes flake-card-in {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.flake-calc-card { animation: flake-card-in 0.45s cubic-bezier(0.22,1,0.36,1) both; }
@media (prefers-reduced-motion: reduce) {
  .flake-calc-card { animation: none; }
}

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1f2937;
  color: white;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s;
  z-index: 300;
  white-space: nowrap;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Type Grid (Flake Color Cards) ── */
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.color-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.1s;
}
.color-card:active { transform: scale(0.97); }
.color-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.color-aliases { font-size: 0.72rem; color: var(--muted); margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.color-stats { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }

/* ── Inventory Table ── */
.inv-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 4px; }
.inv-table th { text-align: left; padding: 6px 8px; font-size: 0.7rem; color: var(--muted); text-transform: uppercase; border-bottom: 1px solid var(--border); font-weight: 600; }
.inv-table td { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.inv-table tr:last-child td { border-bottom: none; }
.inv-table tr:nth-child(even) td { background: var(--bg); }
.loc-select { font-size: 0.82rem; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--card); color: var(--text); cursor: pointer; max-width: 140px; width: 100%; }
.bulk-result-row { padding: 10px 12px; cursor: pointer; border-radius: 8px; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.bulk-result-row:hover { background: var(--bg); }
.bulk-result-type { font-size: 0.7rem; padding: 2px 6px; border-radius: 10px; background: var(--primary); color: #fff; flex-shrink: 0; text-transform: capitalize; }
.bulk-row-sub { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

/* ── Form Row (side-by-side fields) ── */
.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; min-width: 0; }

/* ── Inline link button ── */
.btn-link { background: none; border: none; color: var(--primary); font-size: 0.8rem; cursor: pointer; padding: 0; text-decoration: underline; }

/* ── Stat sub-label ── */
.stat-sub { font-size: 0.65rem; color: rgba(255,255,255,0.5); margin-top: 2px; }

/* ── Log Page ── */
.log-item { padding: 12px 0 10px; }
.log-sep  { height: 1px; background: var(--border); }

/* ── Section labels ── */
.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  padding: 0 2px;
}

/* ── Flake detail two-column layout ── */
.flake-top-layout { margin-bottom: 12px; }
.flake-blend-col  { display: none; }
#flake-blend-mobile { display: none; }
.flake-detail-tabs { display: flex; }

@media (min-width: 600px) {
  .flake-top-layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
  }
  .flake-top-layout .detail-hero {
    flex: 0 0 300px;
    margin-bottom: 0;
  }
  .flake-blend-col {
    display: block;
    flex: 1;
    min-width: 0;
  }
  .flake-detail-tabs { display: none; }
  #flake-inventory-panel { display: block !important; }
}

/* ── Responsive / Desktop ── */
@media (min-width: 600px) {
  #content { padding: 20px 24px 100px; }

  .type-grid {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 12px;
  }

  .quick-actions { grid-template-columns: repeat(4, 1fr); }

  .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
  }
  .card-grid > .card { margin-bottom: 0; }

  .modal-overlay { align-items: center; }
  .modal-sheet {
    border-radius: 20px;
    max-width: 540px;
    margin: 0 auto;
    max-height: 85dvh;
  }
}

@media (min-width: 900px) {
  #content { padding: 24px 32px 100px; }
  .type-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .card-grid  { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

@media (min-width: 1200px) {
  #content { padding: 28px 40px 100px; }
  .type-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .card-grid  { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
}

/* ── Login Screen ──────────────────────────────────────────────────────────── */

#login-overlay {
  position: fixed;
  inset: 0;
  background: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.login-box {
  background: var(--card);
  border-radius: 20px;
  padding: 36px 28px 28px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

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

.login-logo-mark {
  width: 56px;
  height: 56px;
  background: var(--primary);
  border-radius: 14px;
  margin: 0 auto 14px;
  position: relative;
}

.login-logo-mark::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 4px;
  background: var(--accent);
}

.login-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.login-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
  margin-bottom: 14px;
  text-align: center;
}

#login-form .form-group { margin-bottom: 14px; }

/* ── Hamburger & Side Panel ──────────────────────────────────────────────── */

.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
  margin-right: 4px;
}
.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: 0.2s;
}

#side-panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 300;
}
#side-panel-overlay.open { display: block; }

#side-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--card);
  z-index: 301;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,0.18);
}
#side-panel.open { transform: translateX(0); }

#side-panel-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

.sp-header {
  background: var(--primary);
  padding: 20px 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.sp-logo {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}
.sp-logo span { color: var(--accent); }
.sp-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.sp-section {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.sp-section:last-child { border-bottom: none; }
.sp-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 10px 16px 4px;
}
.sp-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 12px 16px;
  font-size: 0.92rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}
.sp-item:hover { background: var(--bg); }
.sp-item .sp-icon { font-size: 1.1rem; width: 22px; flex-shrink: 0; }
.sp-user {
  padding: 14px 16px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sp-user-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; }
.sp-user-loc { font-size: 0.75rem; color: var(--muted); }
