/* CNVD Petty Cash Mobile - design tokens follow the same structural convention used across this
   project's other mobile builds (CSS custom properties, dark/light theme toggle via .dark-theme,
   Inter font, safe-area insets, sticky glass topbar, bottom nav) - its own navy/professional
   identity distinct from sibling apps, fitting the legal-office context. */

:root {
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-light: rgba(29, 78, 216, 0.12);
  --accent-out: #dc2626;
  --accent-out-light: rgba(220, 38, 38, 0.12);
  --accent-gold: #b45309;
  --accent-gold-light: rgba(180, 83, 9, 0.12);

  /* Light theme is the default (no class needed) so there's no flash-of-dark-theme before JS
     runs; .dark-theme is the opt-in override, applied by app.js when the user picks dark. */
  --bg-main: #f6f7fb;
  --bg-card: #ffffff;
  --text-main: #101425;
  --text-muted: #5a6178;
  --text-inverse: #ffffff;
  --border-color: #e1e4ee;
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(0, 0, 0, 0.06);
  --shadow: 0 10px 30px -10px rgba(16, 20, 37, 0.14);
  --card-shadow: 0 4px 20px -5px rgba(16, 20, 37, 0.08);
  --danger: #ef4444;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --nav-height: 62px;
}

.dark-theme {
  --bg-main: #0c0f1a;
  --bg-card: #141928;
  --text-main: #eef0f8;
  --text-muted: #939aB5;
  --text-inverse: #0c0f1a;
  --border-color: #232a3d;
  --glass-bg: rgba(20, 25, 40, 0.88);
  --glass-border: rgba(255, 255, 255, 0.06);
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.55);
  --card-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.35);
}

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

html, body { height: 100%; overscroll-behavior-y: contain; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  transition: background 0.25s, color 0.25s;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px);
}

h1, h2, h3, h4 { font-weight: 700; }
button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ==================== Top App Bar ==================== */

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  padding: calc(0.65rem + var(--safe-top)) 1rem 0.65rem;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.app-brand { display: flex; align-items: center; gap: 0.55rem; font-size: 1.05rem; font-weight: 700; }
.app-brand svg { width: 26px; height: 26px; color: var(--primary); flex-shrink: 0; }

.icon-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 18px; height: 18px; }

/* ==================== Avatar / profile dropdown ==================== */

.avatar-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.avatar-btn:active { transform: scale(0.92); }

.profile-dropdown {
  position: fixed;
  top: calc(3.6rem + var(--safe-top));
  right: 0.9rem;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 250;
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  pointer-events: none;
  transition: all 0.18s ease-out;
}
.profile-dropdown.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.profile-dropdown-header { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border-color); }
.profile-dropdown-header .name { font-weight: 700; font-size: 0.9rem; }
.profile-dropdown-header .role { font-size: 0.76rem; color: var(--text-muted); margin-top: 0.1rem; text-transform: capitalize; }
.profile-dropdown-list { padding: 0.4rem 0; list-style: none; }
.profile-dropdown-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.65rem 1rem;
  font-size: 0.86rem;
  color: var(--text-main);
  transition: var(--transition);
}
.profile-dropdown-item svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-muted); }
.profile-dropdown-item:active { background: var(--primary-light); }
.profile-dropdown-item.danger { color: var(--accent-out); }
.profile-dropdown-item.danger svg { color: var(--accent-out); }
.profile-dropdown-divider { height: 1px; background: var(--border-color); margin: 0.3rem 0; }

/* ==================== Layout ==================== */

.page { max-width: 640px; margin: 0 auto; padding: 0.9rem; }
.page-title { font-size: 1.3rem; margin-bottom: 0.9rem; }
.section-title { font-size: 0.95rem; font-weight: 700; margin: 1.1rem 0 0.6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }

/* ==================== Cards ==================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--card-shadow);
}

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.summary-card { text-align: center; padding: 0.85rem 0.5rem; }
.summary-card .label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.3rem; }
.summary-card .value { font-size: 1.05rem; font-weight: 700; }
.summary-card.in .value { color: var(--primary); }
.summary-card.out .value { color: var(--accent-out); }

.balance-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  border-radius: 20px;
  padding: 1.4rem 1.2rem;
  box-shadow: var(--shadow);
}
.balance-hero .label { font-size: 0.8rem; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.04em; }
.balance-hero .value { font-size: 2rem; font-weight: 800; margin-top: 0.3rem; }
.balance-hero .subrow { display: flex; gap: 1.2rem; margin-top: 0.9rem; font-size: 0.85rem; opacity: 0.92; }

/* ==================== Transaction list ==================== */

.txn-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.8rem 0.2rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}
.txn-item:last-child { border-bottom: none; }
.txn-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.txn-icon.in { background: var(--primary-light); color: var(--primary); }
.txn-icon.out { background: var(--accent-out-light); color: var(--accent-out); }
.txn-icon svg { width: 20px; height: 20px; }
.txn-body { flex: 1; min-width: 0; }
.txn-title { font-weight: 600; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txn-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }
.txn-amount { font-weight: 700; font-size: 0.92rem; white-space: nowrap; }
.txn-amount.in { color: var(--primary); }
.txn-amount.out { color: var(--accent-out); }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); }
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 0.7rem; opacity: 0.5; }

.skeleton {
  background: linear-gradient(90deg, var(--border-color) 25%, var(--glass-border) 50%, var(--border-color) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ==================== Filters / search ==================== */

.search-bar {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
}
.search-bar svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.search-bar input { flex: 1; border: none; background: none; outline: none; color: var(--text-main); font-size: 0.92rem; }

.chip-row { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.15rem 0; margin-top: 0.6rem; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ==================== Breakdown charts ==================== */

.breakdown-toggle {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.6rem;
}
.breakdown-toggle svg { width: 18px; height: 18px; color: var(--text-muted); transition: transform 0.2s; flex-shrink: 0; }
.breakdown-toggle.open svg { transform: rotate(180deg); }

.breakdown-panel { display: none; margin-top: 0.6rem; }
.breakdown-panel.open { display: block; }

.bar-group + .bar-group { margin-top: 1rem; }
.bar-group-title { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.6rem; }

.bar-item { margin-bottom: 0.6rem; }
.bar-item:last-child { margin-bottom: 0; }
.bar-item-row { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.82rem; margin-bottom: 0.28rem; }
.bar-item-name { color: var(--text-main); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-item-value { color: var(--text-muted); font-weight: 600; flex-shrink: 0; }
.bar-track { height: 7px; border-radius: 999px; background: var(--border-color); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--accent-out); }
.bar-fill.alt { background: var(--primary); }

/* ==================== Receipt photo upload ==================== */
/* Same .photo-capture component as maplogs.php's New Log tab (camera capture UI),
   moved here so entrysheet.php can share it too - kept a bit shorter since it's one
   field among several in a longer form, not the page's sole focus. */

.photo-capture {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem; height: 160px; border-radius: 14px; border: 2px dashed var(--border-color);
  background: var(--bg-main); color: var(--text-muted); cursor: pointer; overflow: hidden;
  position: relative; text-align: center; padding: 1rem;
}
.photo-capture svg { width: 30px; height: 30px; }
.photo-capture span { font-size: 0.8rem; font-weight: 600; }
.photo-capture.has-photo { border-style: solid; padding: 0; }
.photo-capture img { width: 100%; height: 100%; object-fit: cover; }
.photo-retake {
  position: absolute; bottom: 0.5rem; right: 0.5rem; background: rgba(16, 20, 37, 0.72);
  color: #fff; border: none; border-radius: 999px; padding: 0.35rem 0.7rem;
  font-size: 0.72rem; font-weight: 600; display: flex; align-items: center; gap: 0.3rem;
}

.receipt-thumbs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem; }
.receipt-thumb { position: relative; width: 60px; height: 60px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border-color); }
.receipt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.receipt-thumb-remove {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(16, 20, 37, 0.72); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.receipt-thumb-remove svg { width: 10px; height: 10px; }

/* ==================== DTR map logs ==================== */

.map-container { padding: 0; overflow: hidden; }
#dtrMap { height: 260px; width: 100%; border-radius: 16px; }
/* Leaflet's own popup chrome is always light (map tiles are a "foreign" visual
   context regardless of app theme) - just keep font consistent. */
.leaflet-popup-content { font-family: 'Inter', sans-serif; margin: 0.7rem 0.8rem; }
.leaflet-popup-content-wrapper { border-radius: 12px; }

.dtr-grid { display: flex; flex-direction: column; gap: 0.6rem; }
.dtr-card {
  display: flex; gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0.6rem;
  cursor: pointer;
  transition: var(--transition);
}
.dtr-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.dtr-card-thumb {
  width: 56px; height: 56px; border-radius: 10px; flex-shrink: 0;
  background: var(--bg-main);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  color: var(--text-muted);
}
.dtr-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dtr-card-thumb svg { width: 24px; height: 24px; }
.dtr-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 0.1rem; }
.dtr-card-toprow { display: flex; align-items: baseline; gap: 0.5rem; }
.dtr-card-time { font-weight: 700; font-size: 0.88rem; color: var(--primary); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.dtr-card-title { font-weight: 600; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dtr-card-meta { font-size: 0.78rem; color: var(--text-main); margin-top: 0.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dtr-card-meta.muted { color: var(--text-muted); }

/* Day / employee grouping - so consecutive same-day, same-messenger stops read as a timeline */
.log-day-group { margin-bottom: 1.1rem; }
.log-day-group:last-child { margin-bottom: 0; }
.log-day-header {
  display: flex; align-items: baseline; gap: 0.5rem;
  font-size: 0.86rem; font-weight: 700; color: var(--text-main);
  padding: 0.2rem 0.1rem 0.5rem;
}
.log-day-header .count { font-size: 0.74rem; font-weight: 600; color: var(--text-muted); }
.log-employee-group { margin-bottom: 0.5rem; }
.log-employee-group:last-child { margin-bottom: 0; }
.log-employee-header {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--text-muted);
  padding: 0.5rem 0.1rem 0.35rem;
}
.log-employee-header .span-total { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--primary); }
.dtr-card-diff {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.72rem; font-weight: 700;
  color: var(--accent-gold);
  background: var(--accent-gold-light);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin-top: 0.3rem;
  align-self: flex-start;
}
.dtr-card-diff svg { width: 12px; height: 12px; }

/* ==================== Forms ==================== */

.field { margin-bottom: 0.9rem; }
.field label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.35rem; }
.field .required { color: var(--danger); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-main);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.field textarea { resize: vertical; min-height: 70px; }
.field .error-msg { color: var(--danger); font-size: 0.78rem; margin-top: 0.3rem; display: none; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field.has-error .error-msg { display: block; }

.segmented { display: flex; border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; }
.segmented button {
  flex: 1; padding: 0.65rem; border: none; background: var(--bg-main); color: var(--text-muted);
  font-weight: 600; font-size: 0.88rem; cursor: pointer; transition: var(--transition);
}
.segmented button.active { background: var(--primary); color: #fff; }
.segmented button.active.out { background: var(--accent-out); color: #fff; }

datalist { display: none; }

/* ==================== Buttons ==================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.75rem 1.2rem;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--accent-out); color: #fff; }
.btn-secondary { background: var(--bg-card); color: var(--text-main); border: 1px solid var(--border-color); }
.btn-row { display: flex; gap: 0.6rem; }
.btn[disabled] { opacity: 0.6; pointer-events: none; }

.fab {
  position: fixed;
  right: 1.1rem;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 1.1rem);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  z-index: 150;
  transition: var(--transition);
}
.fab:active { transform: scale(0.92); }
.fab svg { width: 24px; height: 24px; }

/* ==================== Bottom sheet / modal ==================== */

.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 300; opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  max-height: 92vh;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  z-index: 301;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex; flex-direction: column;
  padding-bottom: var(--safe-bottom);
}
.sheet.open { transform: translateY(0); }
.sheet-handle { width: 36px; height: 4px; background: var(--border-color); border-radius: 2px; margin: 0.6rem auto; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; padding: 0.3rem 1.1rem 0.7rem; border-bottom: 1px solid var(--border-color); }
.sheet-header h3 { font-size: 1.05rem; }
.sheet-body { padding: 1rem 1.1rem; overflow-y: auto; }
.sheet-footer { padding: 0.9rem 1.1rem; border-top: 1px solid var(--border-color); }

/* ==================== Toast ==================== */

.toast-wrap { position: fixed; top: calc(1rem + var(--safe-top)); left: 0; right: 0; z-index: 500; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; pointer-events: none; }
.toast {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.7rem 1rem;
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  display: flex; align-items: center; gap: 0.5rem;
  max-width: 90vw;
  animation: toast-in 0.25s ease-out;
}
.toast.success { border-color: var(--primary); }
.toast.error { border-color: var(--danger); }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast.success svg { color: var(--primary); }
.toast.error svg { color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ==================== Bottom nav ==================== */

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--glass-border);
  display: flex;
  z-index: 200;
}
.bottom-nav a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  transition: var(--transition);
}
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.active { color: var(--primary); }

/* ==================== Loading ==================== */

.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.spinner.dark { border-color: var(--border-color); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== Login page ==================== */

.login-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1.5rem;
  padding-bottom: 1.5rem;
}
.login-logo { width: 64px; height: 64px; color: var(--primary); margin-bottom: 1rem; }
.login-wrap h1 { font-size: 1.4rem; margin-bottom: 0.2rem; }
.login-wrap p.sub { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 1.8rem; }
.login-form { width: 100%; max-width: 340px; }

@media (min-width: 640px) {
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ==================== Desktop: side menu instead of bottom nav ====================
   This app is mobile-first (bottom nav only) but is now also reachable from the ver2
   desktop sidebar's "Mobile" submenu, where a full-width bar pinned to the bottom of a
   wide desktop window reads wrong. On a desktop-width viewport the SAME <nav
   class="bottom-nav"> markup (no duplicate HTML needed) repositions into a fixed left
   side menu instead; on an actual mobile viewport nothing here applies and it stays
   exactly as the bottom bar it always was. */
@media (min-width: 992px) {
  :root { --side-nav-width: 220px; }

  .bottom-nav {
    left: 0; right: auto; bottom: 0; top: 0;
    width: var(--side-nav-width);
    height: 100%;
    padding-bottom: 0;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0.2rem;
    padding: 1.1rem 0.7rem;
    border-top: none;
    border-right: 1px solid var(--glass-border);
  }
  .bottom-nav a {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.7rem;
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    font-size: 0.86rem;
  }
  .bottom-nav a:hover { background: var(--primary-light); color: var(--primary); }
  .bottom-nav a.active { background: var(--primary-light); }
  .bottom-nav a svg { width: 20px; height: 20px; flex-shrink: 0; }

  body { padding-bottom: 0; margin-left: var(--side-nav-width); }
  .app-topbar { position: sticky; }
}
