/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overscroll-behavior-y: contain;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }

/* SVG icons (inline, currentColor) */
svg.ic { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.tile .ico svg, .notif .ico svg, .doc .ico svg,
.communitybar .ico svg, .tabbar .tab .ico svg, .empty .ico svg {
  display: block;
}
.login .logo { display: flex; justify-content: center; color: var(--accent); }
.login .logo svg { width: 56px; height: 56px; }
.empty .ico { color: var(--muted); }

/* ---------- Tokens ---------- */
:root {
  --bg: #0b0b0d;
  --bg-elev: #16161a;
  --bg-elev-2: #1f1f25;
  --text: #f4f4f6;
  --muted: #a8a8ba;
  --text-soft: #8888a0;
  --border: #2a2a31;
  --accent: #4f8cff;
  --accent-strong: #2f6ff0;
  --success: #2ecc71;
  --warning: #f5a623;
  --danger: #ff5d5d;
  --radius: 16px;
  --radius-sm: 10px;
  --tap: 48px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f6f8;
    --bg-elev: #ffffff;
    --bg-elev-2: #eef0f4;
    --text: #14151a;
    --muted: #5a5e68;
    --text-soft: #7a7e88;
    --border: #e3e5ec;
  }
}

/* ---------- App shell ---------- */
.app {
  max-width: 540px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  flex: 1;
  text-align: center;
  letter-spacing: -0.01em;
}
.topbar .icon-btn { width: 40px; }
.icon-btn {
  width: var(--tap);
  height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--text);
}
.icon-btn:active { background: var(--bg-elev-2); }

/* ---------- Main content ---------- */
.main {
  flex: 1;
  padding: 16px 16px calc(96px + var(--safe-bottom));
}

/* ---------- Bottom nav ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: space-around;
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + var(--safe-bottom));
}
.tabbar .tab {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  min-height: var(--tap);
  border-radius: 12px;
}
.tabbar .tab .ico { line-height: 0; }
.tabbar .tab .lbl { font-size: 11px; font-weight: 600; }
.tabbar .tab.active { color: var(--accent); }
.tabbar .tab:active { background: var(--bg-elev-2); }

/* ---------- Generic UI ---------- */
.h-greet { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 2px; }
.sub { color: var(--muted); font-size: 14px; }

.section-title {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin: 22px 4px 10px;
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.tile {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 110px;
  text-align: left;
  position: relative;
  transition: transform .08s ease;
}
.tile:active { transform: scale(0.98); }
.tile .ico { color: var(--accent); line-height: 0; }
.tile .label { font-weight: 700; font-size: 15px; }
.tile .badge {
  position: absolute;
  top: 10px; right: 10px;
  min-width: 22px; height: 22px;
  padding: 0 6px;
  background: var(--danger);
  color: #fff;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.card + .card { margin-top: 10px; }
.card .row { display: flex; align-items: center; gap: 10px; }
.card .row + .row { margin-top: 6px; }
.card .title { font-weight: 700; font-size: 16px; }
.card .meta { color: var(--muted); font-size: 13px; }
.card p { margin: 6px 0 0; }

.list { display: flex; flex-direction: column; gap: 10px; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
}
.empty .ico { display: block; margin-bottom: 10px; line-height: 0; }
.ico-lg { color: var(--accent); line-height: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 18px;
  border-radius: 999px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  width: 100%;
}
.btn:active { background: var(--accent-strong); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--bg-elev-2); color: var(--text); }
.btn.danger { background: var(--danger); }
.btn.ghost { background: transparent; color: var(--accent); }

.fab {
  position: fixed;
  right: 18px;
  bottom: calc(80px + var(--safe-bottom));
  z-index: 15;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: 0;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px rgba(47,111,240,0.35);
}
.fab:active { background: var(--accent-strong); }

/* Form */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.field input, .field textarea, .field select {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  min-height: var(--tap);
  width: 100%;
  outline: none;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,140,255,.15);
  outline: none;
}
.modal-box input:focus, .modal-box textarea:focus {
  box-shadow: 0 0 0 3px rgba(79,140,255,.15);
}
@media (max-width: 480px) {
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; }
}

/* Status pills */
.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  color: var(--text);
}
.pill.pending  { background: rgba(245,166,35,0.15); color: var(--warning); }
.pill.progress { background: rgba(79,140,255,0.15); color: var(--accent); }
.pill.done     { background: rgba(46,204,113,0.15); color: var(--success); }
.pill.paid     { background: rgba(46,204,113,0.15); color: var(--success); }
.pill.unpaid   { background: rgba(255,93,93,0.15);  color: var(--danger); }

/* Voting bars */
.bar {
  height: 8px;
  background: var(--bg-elev-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
}

/* Login */
.login {
  min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 24px;
  gap: 18px;
}
.login .logo { font-size: 56px; text-align: center; }
.login h1 { text-align: center; margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.login .sub { text-align: center; }
.login-tabs {
  display: flex; gap: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 14px;
}
.login-tab {
  flex: 1;
  padding: 10px 0;
  border: none; background: none;
  font-size: 14px; font-weight: 600;
  border-radius: 999px;
  color: var(--text-soft);
  cursor: pointer;
  min-height: var(--tap);
}
.login-tab.active {
  background: var(--accent);
  color: #fff;
}
.role-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 8px; }
.role {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  min-height: var(--tap);
}
.role .ico { font-size: 24px; }
.role .name { font-weight: 700; }
.role .desc { color: var(--muted); font-size: 13px; }

/* Toast */
.toast {
  position: fixed;
  left: 50%; bottom: calc(110px + var(--safe-bottom));
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  z-index: 50;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  animation: pop .2s ease;
}
@keyframes pop { from { transform: translate(-50%, 8px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal-box {
  background: var(--bg-elev);
  border-radius: var(--radius);
  width: 100%; max-width: 480px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.modal-box h3 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
}
.modal-box input[type="text"],
.modal-box input[type="number"],
.modal-box input[type="email"],
.modal-box input[type="password"],
.modal-box input[type="tel"],
.modal-box input[type="url"],
.modal-box input[type="search"],
.modal-box input[type="date"],
.modal-box input[type="time"],
.modal-box input[type="datetime-local"],
.modal-box textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  margin-bottom: 12px;
  font-family: inherit;
  box-sizing: border-box;
}
.modal-box input[type="number"] {
  margin-bottom: 0;
  text-align: center;
  -moz-appearance: textfield;
}
.modal-box input[type="number"]::-webkit-outer-spin-button,
.modal-box input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.modal-box textarea { resize: vertical; min-height: 80px; }
.modal-box input:focus, .modal-box textarea:focus {
  outline: none; border-color: var(--accent);
}
.modal-box .field-label {
  font-weight: 600;
  font-size: 13px;
  margin: 14px 0 6px;
  color: var(--text);
}
.modal-box .field-hint {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 6px;
}
.modal-box .field-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.modal-box .field-row > div {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.modal-box .field-row label {
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 4px;
  font-weight: 500;
}
.modal-actions {
  display: flex; gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}
.modal-actions button {
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  min-height: var(--tap);
}
.modal-actions .modal-cancel {
  background: var(--bg);
  color: var(--text-soft);
  border: 1px solid var(--border);
}
.modal-actions .modal-ok {
  background: var(--accent);
  color: #fff;
}

/* Detail header */
.detail-hero {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.detail-hero .title { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.detail-hero .meta { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* Vote actions */
.vote-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.vote-actions .btn { padding: 0 8px; font-size: 14px; }

/* Reservation calendar (simple) */
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 8px;
  overflow: hidden;
}
.cal .day {
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  min-width: 0;
}
.cal .day.busy { background: var(--bg-elev-2); color: var(--muted); text-decoration: line-through; }
.cal .day.mine { background: var(--accent); color: #fff; border-color: var(--accent); }
.cal .day.past { opacity: .35; pointer-events: none; }
.cal .day.selected { border-color: var(--accent); border-width: 2px; box-shadow: 0 0 0 2px rgba(47,111,240,.2); }
.past-slot { opacity: .4; pointer-events: none; }

/* ---------- Search overlay ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.45);
  display: flex; flex-direction: column; align-items: center;
  padding: calc(var(--safe-top) + 16px) 16px 16px;
  animation: fadeIn .12s ease;
}
.search-box {
  background: var(--bg);
  border-radius: var(--radius);
  width: 100%; max-width: 600px;
  max-height: 80vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.search-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.search-input-row input {
  flex: 1; border: 0; outline: none;
  font-size: 16px; background: transparent;
  color: var(--text); font-family: inherit;
}
.search-input-row .ico { color: var(--muted); }
.search-results { overflow-y: auto; padding: 4px 0; }
.search-group-title {
  padding: 10px 16px 4px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase;
  color: var(--muted); letter-spacing: .04em;
}
.search-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border: 0;
  background: transparent; width: 100%;
  text-align: left; font-size: 14px;
  color: var(--text); cursor: pointer;
  font-family: inherit;
}
.search-item:active { background: var(--bg-elev-2); }
.search-item .ico { color: var(--accent); flex-shrink: 0; }
.search-item .title { font-weight: 500; }
.search-loading {
  padding: 20px 16px; text-align: center;
  color: var(--muted); font-size: 14px;
}
.cal .day.empty { border: none; background: none; }
.cal .head { font-size: 11px; color: var(--muted); aspect-ratio: auto; padding: 4px 0; }
.cal .day { position: relative; flex-direction: column; gap: 0; }
.cal .day-label {
  font-size: 8px; font-weight: 500; line-height: 1;
  position: absolute; bottom: 2px;
  color: inherit; opacity: .7;
}

/* Receipts */
.receipt {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.receipt .left .month { font-weight: 700; }
.receipt .left .amount { color: var(--muted); font-size: 13px; }
.receipt + .receipt { margin-top: 8px; }

/* Doc item */
.doc {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.doc .ico { color: var(--accent); line-height: 0; }
.doc .name { font-weight: 700; }
.doc .meta { color: var(--muted); font-size: 12px; }
.doc + .doc { margin-top: 8px; }

/* Community bar */
.communitybar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
  min-height: 38px;
}
.communitybar .ico { color: var(--accent); line-height: 0; display: inline-flex; }
.communitybar .name { flex: 1; font-weight: 700; }
.communitybar .sw { color: var(--accent); font-weight: 600; font-size: 12px; display: inline-flex; align-items: center; gap: 2px; }

.community-card.active { border-color: var(--accent); }

/* Photo gallery (incidents) */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 6px;
  margin-top: 10px;
}
.photo-gallery a, .photo-gallery img {
  display: block; width: 100%; aspect-ratio: 1;
  border-radius: 10px; object-fit: cover;
  border: 1px solid var(--border); background: var(--bg-elev-2);
}

/* Photo upload button */
.photo-upload-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 14px 16px;
  border: 2px dashed var(--border);
  border-radius: calc(var(--radius) - 4px);
  background: var(--bg);
  color: var(--text-soft);
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  min-height: var(--tap);
  transition: border-color .15s, color .15s;
}
.photo-upload-btn:active {
  border-color: var(--accent);
  color: var(--accent);
}

/* Photo previews (form) */
.photo-previews {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px;
}
.photo-previews img {
  width: 64px; height: 64px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--border);
}

/* Notifications */
.notif {
  display: flex; gap: 12px;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.notif.unread { border-left: 3px solid var(--accent); }
.notif .ico { color: var(--accent); line-height: 0; }
.notif .title { font-weight: 700; }
.notif .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.notif + .notif { margin-top: 8px; }

/* Ayuda (acordeón) */
.help-item {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}
.help-item > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  min-height: var(--tap);
  user-select: none;
}
.help-item > summary::-webkit-details-marker { display: none; }
.help-item > summary .ico { color: var(--accent); line-height: 0; flex-shrink: 0; }
.help-item > summary .name { flex: 1; font-weight: 700; font-size: 15px; }
.help-item > summary .chev { color: var(--muted); transition: transform .15s ease; line-height: 0; }
.help-item[open] > summary .chev { transform: rotate(180deg); }
.help-item[open] > summary { border-bottom: 1px solid var(--border); }
.help-body {
  padding: 14px 16px 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}
.help-body p { margin: 0; }
.help-body p + p { margin-top: 8px; }

/* Chat */
.chat { display: flex; flex-direction: column; height: calc(100dvh - 200px); min-height: 400px; }
.chat-header {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.chat-header .ico { color: var(--accent); }
.chat-header .name { font-weight: 700; }
.chat-list {
  flex: 1;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 4px;
}
.chat-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 16px;
  word-wrap: break-word;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  align-self: flex-start;
}
.chat-bubble.mine { background: var(--accent); color: #fff; align-self: flex-end; border-color: var(--accent); }
.chat-time { font-size: 10px; opacity: .6; margin-top: 4px; }
.chat-inputbar {
  display: flex; gap: 8px; align-items: flex-end;
  padding: 10px 4px 0;
  border-top: 1px solid var(--border);
}
.chat-input {
  flex: 1;
  resize: none;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  min-height: 44px;
  max-height: 120px;
}

/* ========================================================
   Desktop / tablet layout
   ======================================================== */

/* Sidebar: hidden on mobile by default */
.sidenav { display: none; }

@media (min-width: 960px) {
  body { font-size: 15px; }

  .app {
    max-width: none;
    background: var(--bg);
  }

  /* Sidebar fixed to viewport left; main content offset by its width */
  .app-inner {
    display: block;
    min-height: 100dvh;
    padding-left: 260px;
  }

  .topbar {
    padding: 18px 40px 16px;
    max-width: 1100px;
    margin: 0 auto;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }
  .topbar h1 { text-align: left; font-size: 22px; }

  .communitybar {
    max-width: 1040px;
    margin: 18px auto 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
  }

  .main {
    padding: 20px 40px 60px;
    max-width: 1100px;
    margin: 0 auto;
  }

  /* Sidebar: fixed on viewport left edge */
  .sidenav {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    background: var(--bg-elev);
    border-right: 1px solid var(--border);
    padding: 18px 12px;
    overflow-y: auto;
    z-index: 5;
  }
  .sidenav-brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 800; font-size: 18px;
    padding: 4px 12px 18px;
    letter-spacing: -0.01em;
  }
  .sidenav-brand .ico { color: var(--accent); line-height: 0; }
  .sidenav-list {
    display: flex; flex-direction: column; gap: 2px;
    flex: 1;
  }
  .sidenav-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }
  .sidenav-item {
    display: flex; align-items: center; gap: 12px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 400;
    text-align: left;
    min-height: 40px;
    transition: background .08s ease, color .08s ease;
  }
  .sidenav-item .ico { color: inherit; line-height: 0; flex-shrink: 0; }
  .sidenav-item .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidenav-item:hover { background: var(--bg-elev-2); color: var(--text); }
  .sidenav-item.active {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent);
  }

  /* Hide bottom tabs on desktop */
  .tabbar { display: none; }

  /* Wider grids on desktop */
  .grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .tile { min-height: 130px; padding: 20px; }

  /* Detail hero & cards feel less cramped */
  .detail-hero { padding: 24px; }
  .card { padding: 18px; }

  /* Login centered nicely */
  .login {
    max-width: 420px;
    margin: 60px auto;
  }

  /* FAB: tabbar is gone, align to right of main content column */
  .fab {
    bottom: 32px;
    right: max(32px, calc((100vw - 260px - 1100px) / 2 + 24px));
  }

  /* Modal overlays should account for sidebar */
  .modal-box { max-width: 480px; }

  /* Two-column layouts for list-heavy screens */
  .doc, .card, .notif { transition: background .1s ease; }
  .doc:hover, .receipt:hover { background: var(--bg-elev-2); }

  /* Reservation calendar: cap so days aren't huge */
  .cal { max-width: 560px; }
}

@media (min-width: 1200px) {
  .main { padding: 24px 48px 48px; }
}
