/* Page frame: sidebar on desktop, bottom tab bar on a phone. */

.shell { display: flex; min-height: 100vh; }

.nav {
  flex: 0 0 232px;
  align-self: stretch;           /* the sidebar runs the full height of the page */
  background: var(--panel);
  border-right: 1px solid var(--hair);
}
/* The content stays in view while the page scrolls. */
.nav-inner {
  position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 4px;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 16px; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }

.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  color: var(--ink); text-decoration: none;
}
.nav a:hover { background: var(--hair-soft); }
.nav a[aria-current="page"] { background: var(--selected); font-weight: 600; }
.nav-icon { flex: none; color: var(--muted); }
.nav a[aria-current="page"] .nav-icon { color: var(--ink); }
.nav-label { flex: 1; }
.count {
  background: var(--needs); color: #fff; font-size: 12px; font-weight: 600;
  padding: 1px 7px; border-radius: 10px; min-width: 20px; text-align: center;
}
.nav-heading { margin: 18px 10px 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.nav-accounts a { padding: 7px 10px; }
.nav-foot { margin-top: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.nav-list li, .nav-accounts li { display: block; }

.main { flex: 1 1 0; min-width: 0; max-width: 1240px; padding: 28px 32px 48px; outline: none; }

.page { display: flex; flex-direction: column; gap: 26px; }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.page-head.col { flex-direction: column; align-items: flex-start; gap: 6px; }
.head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }

.block { display: flex; flex-direction: column; gap: 12px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.grid { display: grid; gap: 14px; }
.grid-needs { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.grid-seats, .grid-accounts { grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr)); align-items: start; }
.grid-machines { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); align-items: start; }
.grid-mini { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.cols { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); align-items: start; }

.shell-login .nav { display: none; }
.shell-login .main { max-width: none; padding: 0; }

/* Which screens each layout shows (phone tabs, desktop sidebar). */
.nav-list .nav-phone { display: none; }
@media (min-width: 821px) { .phone-only { display: none !important; } }
@media (max-width: 820px) { .desk-only { display: none !important; } .nav-list .nav-phone { display: block; } .nav-list .nav-desk { display: none; } }

/* ---- phone ---------------------------------------------------------------------- */
@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .nav {
    position: fixed; inset: auto 0 0 0; z-index: 10; flex: none;
    border-right: 0; border-top: 1px solid var(--hair);
  }
  .nav-inner {
    position: static; height: auto; overflow: visible;
    flex-direction: row; padding: 0 0 env(safe-area-inset-bottom); gap: 0;
  }
  .brand, .nav-accounts, .nav-foot { display: none; }
  .nav-list { flex: 1; flex-direction: row; gap: 0; }
  .nav-list li { flex: 1; }
  .nav a { flex-direction: column; gap: 2px; padding: 8px 4px 7px; border-radius: 0; font-size: 12px; position: relative; min-height: 52px; justify-content: center; }
  .nav-label { flex: none; }
  .nav a[aria-current="page"] { background: transparent; box-shadow: inset 0 3px 0 var(--ink); }
  .count { position: absolute; top: 4px; left: calc(50% + 6px); font-size: 11px; padding: 0 5px; min-width: 18px; }
  .nav-foot { margin: 0; padding: 0 6px; justify-content: center; }
  .main { padding: calc(18px + env(safe-area-inset-top)) 16px calc(88px + env(safe-area-inset-bottom)); max-width: none; }
  h1 { font-size: 24px; font-weight: 700; }
  .page { gap: 22px; }
  .shell-login .nav { display: none; }
}
