/* Web version only (Netlify / iPhone). The Log / History / Inventory / Admin tabs live in a slide-in drawer opened with the ☰ button,
   so the whole screen is available to the app. Phones: closed by default, overlays the page. Wide screens (>= 900px): docked sidebar that
   can be collapsed (remembered). The Android app keeps its bottom tab bar (this file is not part of it). */
:root { --drawer: 236px; }

body { padding-bottom: 0; padding-left: 0; transition: padding-left .22s ease; }

.appbar-left { display: flex; align-items: center; gap: 2px; min-width: 0; }
.appbar-left h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#menuBtn { font-size: 1.5rem; line-height: 1; padding: 6px 12px 8px 4px; }

.tabbar {
  top: 0; bottom: 0; right: auto; left: 0;
  width: min(80vw, var(--drawer));
  flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 2px;
  padding: calc(8px + env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left));
  border-top: 0; border-right: 1px solid var(--border);
  overflow-y: auto; z-index: 30;
  transform: translateX(-102%); visibility: hidden;
  transition: transform .22s ease, visibility 0s linear .22s;
}
body.nav-open .tabbar { transform: none; visibility: visible; transition: transform .22s ease, visibility 0s; box-shadow: 6px 0 24px rgb(0 0 0 / .25); }

.nav-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px 14px; }
.nav-head strong { font-size: 1.05rem; }
.tabbar .nav-close { flex: 0 0 auto; border: 0; background: none; color: var(--muted); font: inherit; font-size: 1.2rem; padding: 6px 10px; border-radius: 10px; }

.tabbar button[data-view], .tabbar #adminConsoleBtn {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; border-radius: 10px; font-size: 1rem; text-align: left;
}
.tabbar button[data-view] span, .tabbar #adminConsoleBtn span { display: inline-block; width: 1.6em; text-align: center; font-size: 1.25rem; }
.tabbar #adminConsoleBtn { margin-top: auto; border: 0; background: none; color: var(--muted); font-weight: 600; }
.tabbar #adminConsoleBtn[hidden] { display: none; }
.tabbar button[data-view].active { background: color-mix(in srgb, var(--primary) 12%, transparent); box-shadow: inset 3px 0 0 var(--primary); }

#navScrim { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .45); opacity: 0; visibility: hidden; transition: opacity .22s ease, visibility 0s linear .22s; }
body.nav-open #navScrim { opacity: 1; visibility: visible; transition: opacity .22s ease, visibility 0s; }

@media (min-width: 900px) {
  body.nav-open { padding-left: var(--drawer); }
  body.nav-open .tabbar { box-shadow: none; }
  #navScrim { display: none; }
  .tabbar .nav-close { display: none; }
}
@media (prefers-reduced-motion: reduce) { body, .tabbar, #navScrim { transition: none !important; } }
