/* Page chrome and screen layout: header/nav, screen containers, login, sections,
   stats row, filters, responsive. Light Zavation branding. */

/* Header & Nav */
header {
  border-bottom: 1px solid var(--border);
  padding: 12px 24px; display: flex; align-items: center; gap: 18px;
  background: var(--panel); position: sticky; top: 0; z-index: 50; flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
/* The ZV oval. Sized by height so the aspect ratio is never squashed, and given
   its own breathing room because the asset is trimmed to its ink. */
.logo { height: 30px; width: auto; flex-shrink: 0; display: block; }
.brand {
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  color: var(--text-bright); letter-spacing: 0.02em;
}
.brand-sub {
  font-size: 9px; color: var(--muted); letter-spacing: 0.16em;
  font-weight: 600; text-transform: uppercase; margin-top: 2px;
}
/* Desktop header: logo and name, then who is signed in with Feedback and Sign out at the
   right; the screens get a full row of their own below, so the CCO's twelve fit on one. */
.nav-account { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; flex-basis: 100%; order: 10; margin: 2px 0 -4px -10px; }
.nav .nav-btn { padding: 6px 10px; }
.nav-btn {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  padding: 6px 14px; font-size: 10px; font-family: var(--font-body); font-weight: 700;
  cursor: pointer; border-radius: 4px; letter-spacing: 0.1em; text-transform: uppercase;
  transition: all 0.15s;
}
.nav-btn:hover { color: var(--text-strong); background: var(--panel-2); }
.nav-btn.active {
  background: var(--zv-red-wash); border-color: var(--zv-red);
  color: var(--zv-red-deep);
}
.nav-btn:focus-visible { outline: 2px solid var(--zv-red); outline-offset: 2px; }
.user-tag {
  font-size: 10px; color: var(--muted); letter-spacing: 0.06em; font-weight: 600;
  padding: 6px 12px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 4px;
}
.user-block { display: flex; flex-direction: column; align-items: stretch; gap: 2px; }
.sheet-refresh { text-align: left; padding: 0 16px 6px; }
.refresh-tag { font-size: 9px; color: var(--muted); letter-spacing: 0.04em; text-align: center; }

/* Screens */
.screen { display: none; padding: 24px; max-width: 1400px; margin: 0 auto; }
.screen.active { display: block; }
.screen-narrow { max-width: 720px; }

/* Login screen */
.login-wrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.login-card {
  background: var(--panel); border: 1px solid var(--border); border-top: 3px solid var(--zv-red);
  border-radius: 10px; padding: 36px; max-width: 420px; width: 100%;
  box-shadow: var(--shadow-md);
}
/* The stacked lockup, centred above the sign-in form. */
.login-logo { display: block; height: 64px; width: auto; margin: 0 auto 22px; }
.login-title {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  color: var(--text-bright); margin-bottom: 6px;
}
.login-sub {
  font-size: 10px; color: var(--muted); letter-spacing: 0.12em;
  margin-bottom: 28px; text-transform: uppercase; font-weight: 600;
}

/* Form layout */
.section { margin-bottom: 22px; }
.section-title {
  font-size: 9px; color: var(--zv-red); font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.row { display: grid; gap: 12px; margin-bottom: 12px; }
.row.col2 { grid-template-columns: 1fr 1fr; }
.row.col3 { grid-template-columns: 1fr 1fr 1fr; }
.row.col1 { grid-template-columns: 1fr; }

/* Stats row */
.stats-row { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }

/* Filters */
.filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { width: auto; padding: 6px 12px; font-size: 12px; }
.filters input { width: 240px; }
.record-count { margin-left: auto; font-size: 10px; color: var(--muted); letter-spacing: 0.08em; font-weight: 600; }

@media (max-width: 600px) {
  .row.col2, .row.col3 { grid-template-columns: 1fr; }
  .product-row { grid-template-columns: 1fr; }
  .nav { width: 100%; justify-content: flex-start; }
}

/* ---------- Phone navigation (redesign Phase 1) ----------
   Under 768px the top bar gives way to a bottom bar: Home, Deals, a center "+",
   Schedule, More. Main actions sit where a thumb reaches; every target is at least
   44x44px. The page leaves room for the bar and for the iPhone home indicator. */
.bottom-nav { display: none; }

.bn-item {
  flex: 1; min-width: 44px; min-height: 56px; padding: 4px 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: 0; border-radius: 10px; cursor: pointer;
  color: var(--muted); font: 600 11px/1.2 var(--font-body); letter-spacing: 0.01em;
  -webkit-tap-highlight-color: transparent;
}
.bn-item.active { color: var(--zv-red); }
.bn-item:focus-visible { outline: 2px solid var(--zv-red); outline-offset: -3px; }
.bn-plus-disc {
  width: 54px; height: 54px; margin-top: -20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--zv-red); color: #fff; box-shadow: 0 3px 10px rgba(228, 0, 43, 0.35);
}
.bn-plus .nav-icon { width: 28px; height: 28px; }
.bn-plus.active .bn-plus-disc { background: var(--zv-red-deep); }

/* More sheet. A bottom sheet on a phone, a centred panel if it is ever open wider. */
.sheet-bg {
  position: fixed; inset: 0; z-index: 120; background: rgba(0, 0, 0, 0.35);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 520px; max-height: 85vh; overflow-y: auto;
  background: var(--panel); border-radius: 16px 16px 0 0;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.15);
}
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 4px auto 12px; }
.sheet-title { font: 700 18px/1.3 var(--font-display); color: var(--text-bright); }
.sheet-who { font-size: 14px; color: var(--muted); margin-top: 2px; }
.sheet-list { list-style: none; margin: 12px 0; }
.sheet-item {
  width: 100%; min-height: 52px; padding: 0 12px; text-align: left;
  background: none; border: 0; border-radius: 8px; cursor: pointer;
  font: 500 17px/1.3 var(--font-body); color: var(--text-strong);
}
.sheet-item:hover { background: var(--panel-2); }
.sheet-item:focus-visible { outline: none; background: var(--panel-2); box-shadow: inset 0 0 0 2px var(--zv-red); }
.sheet-signout { color: var(--zv-red-deep); }
.sheet-sep { height: 1px; background: var(--border); margin: 8px 0; }
.sheet-close {
  width: 100%; min-height: 48px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel-2);
  font: 600 16px var(--font-body); color: var(--text-strong);
}
.sheet-close:focus-visible { outline: 2px solid var(--zv-red); outline-offset: 2px; }
body.sheet-open { overflow: hidden; }

@media (max-width: 767px) {
  header { padding: calc(10px + env(safe-area-inset-top)) 16px 10px; gap: 12px; }
  header .nav, header .nav-account { display: none !important; }
  .brand-sub { display: none; }

  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    background: var(--panel); border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px rgba(16, 24, 40, 0.06);
  }

  /* 16px text and fields, so iPhone Safari does not zoom in when a field is tapped. */
  body { font-size: 16px; }
  input, select, textarea, .filters input, .filters select { font-size: 16px; }
  .filters input { width: 100%; }

  .screen { padding: 16px; }
  body.signed-in .screen { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

