/* Layout shell shared by the app screens and the admin: fixed menu on the left (desktop), bottom bar
   (phone). Two modes: daily work (green) and setup/admin (slate blue). Plain CSS so it works on both
   without Tailwind. Selectors start with .sb-side / .sb-bottom so they beat the admin's `a:link` colours. */
:root { --sb-width: 15.5rem; }

.sb-side {
  --bg: #3A5C4B; --active: #4B7260; --hover: #46695A; --line: #547A68; --muted: #BFD3C7; --text: #E3EDE7;
  position: fixed; inset: 0 auto 0 0; width: var(--sb-width); z-index: 40; overflow: hidden;
  display: flex; flex-direction: column; padding: 22px 14px 14px; box-sizing: border-box;
  background: var(--bg); color: var(--text); font-family: "Hanken Grotesk", system-ui, sans-serif; font-size: 15px;
}
.sb-side.is-setup { --bg: #3B4A66; --active: #56668A; --hover: #4A5A7C; --line: #5C6B8E; --muted: #C3CCE0; --text: #EEF1F7; }
.sb-bottom.is-setup { --bg: #3B4A66; --active: #56668A; }

.sb-side a.sb-brand { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 24px; color: #fff; padding: 0 12px 6px; text-decoration: none; }
.sb-side .sb-mode {
  align-self: flex-start; margin: 0 12px 18px; padding: 3px 10px; border-radius: 999px;
  background: var(--active); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .05em;
}
.sb-side .sb-list { display: flex; flex-direction: column; gap: 4px; }
.sb-side a.sb-link {
  display: flex; align-items: center; gap: 12px; box-sizing: border-box; padding: 11px 12px; border-radius: 10px;
  color: var(--text); text-decoration: none; font-size: 15px;
}
.sb-side a.sb-link.sb-big { padding: 12px; font-size: 16px; font-weight: 500; }
.sb-side a.sb-link:hover { background: var(--hover); color: #fff; text-decoration: none; }
.sb-side a.sb-link[aria-current="page"] { background: var(--active); color: #fff; font-weight: 700; }
.sb-side .sb-label { flex: 1; }
.sb-side .sb-badge {
  min-width: 22px; text-align: center; padding: 1px 7px; border-radius: 999px;
  background: #fff; color: #1F6B48; font-size: 13px; font-weight: 700;
}
.sb-side a.sb-back {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; margin-bottom: 14px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.35); color: #fff; text-decoration: none; font-weight: 600;
}
.sb-side a.sb-back:hover { background: var(--hover); color: #fff; text-decoration: none; }
.sb-side a.sb-setup {
  margin-top: auto; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px;
  background: rgba(255,255,255,.12); color: var(--text); text-decoration: none;
}
.sb-side a.sb-setup:hover { background: var(--hover); color: #fff; text-decoration: none; }
.sb-side .sb-user { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.sb-side a.sb-setup + .sb-user { margin-top: 10px; }
.sb-side .sb-user > .sb-name { display: block; padding: 4px 12px; color: var(--muted); }
.sb-side .sb-user a, .sb-side .sb-user button, .sb-sheet a, .sb-sheet button {
  display: block; box-sizing: border-box; width: 100%; margin: 0; padding: 8px 12px; border-radius: 8px;
  background: none; border: 0; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.sb-side .sb-user a:hover, .sb-side .sb-user button:hover, .sb-sheet a:hover, .sb-sheet button:hover { background: var(--hover); color: #fff; }
.sb-user form { margin: 0; }
.sb-bottom { display: none; }

/* content area gets out of the menu's way */
body.sb-has-menu { margin-left: var(--sb-width); }

@media (max-width: 767px) {
  .sb-side { display: none; }
  body.sb-has-menu { margin-left: 0; padding-bottom: 64px; }
  .sb-bottom {
    --bg: #3A5C4B; --hover: #46695A; --text: #E3EDE7;
    position: fixed; inset: auto 0 0 0; z-index: 40; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    background: #fff; border-top: 1px solid #E5E9E2; font-family: "Hanken Grotesk", system-ui, sans-serif;
  }
  .sb-bottom > a, .sb-bottom .sb-more > summary {
    min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 13px;
    color: #4A554F; text-decoration: none; cursor: pointer; list-style: none;
  }
  .sb-bottom .sb-more > summary::-webkit-details-marker { display: none; }
  .sb-bottom > a[aria-current="page"], .sb-bottom .sb-more > summary.is-active { color: #1F6B48; font-weight: 700; }
  .sb-bottom.is-setup > a, .sb-bottom.is-setup .sb-more > summary { color: #2F3A55; }
  .sb-bottom.is-setup .sb-more > summary.is-active { color: #3B4A66; }
  .sb-badge-small { background: #2A8057; color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; font-weight: 700; }
  .sb-more { position: static; }
  .sb-sheet {
    position: fixed; inset: auto 0 56px 0; max-height: 70vh; overflow-y: auto; background: var(--bg);
    padding: 8px 12px 12px; border-radius: 14px 14px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.18);
  }
  .sb-sheet a[aria-current="page"] { background: var(--active, #4B7260); color: #fff; font-weight: 600; }
  .sb-sheet .sb-user { display: flex; gap: 8px; margin-top: 8px; }
}

/* The hidden attribute must win over utility classes such as flex/grid, or the show/hide toggles do nothing. */
[hidden] { display: none !important; }

/* One-tap (HTMX) buttons: show that something is happening while the request runs. */
.htmx-request { opacity: .55; pointer-events: none; transition: opacity .15s; }
