/* AOS — auth surfaces (welcome, sign-in, change-pin, home)
   Cool near-white background. Black Airbox / AOS marks. Greyscale UI.
   Blue is reserved EXCLUSIVELY for the primary CTA and the input focus
   ring. Hover state is a single consistent pattern across all surfaces.
   Red is reserved for warnings.
*/

:root {
  --navy:         #0a1e32;   /* primary text (matches Airbox logo) */
  --navy-soft:    #4a5a72;
  --navy-faint:   #8a96aa;
  --slate:        #586880;
  --slate-soft:   #8a96aa;

  /* Action blue — primary CTAs and focus rings only.
     This is the loud blue; sky-pastel below is the calm one for
     selected / hovered / active states. */
  --blue:         #2d7ff9;
  --blue-vivid:   #1e6fe6;
  --blue-dark:    #1058c4;
  --blue-soft:    #e6f0ff;
  --blue-tint:    #f3f7ff;
  --blue-glow:    rgba(45, 127, 249, 0.30);

  /* Selection state — the consistent "this is hovered / active / selected"
     treatment. SHARP purple outline, NO background fill. Used on warehouse
     tiles, scope pills, picker tiles, scope chip when open.
     Vivid blue stays reserved for primary actions + form focus rings. */
  --state-border:  #8b5cf6;     /* vibrant purple — the outline */
  --state-glow:    rgba(139, 92, 246, 0.22);
  --state-text:    #6d28d9;     /* deeper purple for active text accents */

  /* Slice 5.57 — gradient overlay removed. Was a subtle sky→grey radial
     that made the cube's transparent PNG edges read as a visible box
     against the tinted backdrop. Pure white reads cleanest. */
  --bg-gradient: none;

  /* Greyscale UI palette */
  /* Slice 5.57 — pure white canvas matches the two phone apps. Was
     #f5f7f9 (cool grey), which made the monochrome cube's anti-aliased
     edge show as a faint box. White makes the cube sit cleanly. */
  --bg:           #ffffff;
  --card:         #ffffff;
  --border:       #d8dee5;
  --border-mid:   #b8c2cf;
  --border-soft:  #e8edf1;
  --tint:         #f0f2f5;   /* hover background — neutral, no colour */

  --green:        #4caf72;
  --green-soft:   #e0f0e5;

  /* Reserved for actual warnings only — never used in primary UI */
  --warn-amber:   #e0a132;
  --warn-amber-soft: #fbf0d8;
  --warn-red:     #d04545;
  --warn-red-soft:#fadcdc;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--navy);
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


/* ============================================================ */
/*  SHARED CHROME — topbar, footer, card                          */
/* ============================================================ */

.auth-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.auth-topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border-soft);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Bare topbar — pre-login. AIRBOX wordmark only, left-aligned. Nothing else. */
.auth-topbar--bare {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
}

/* App topbar — post-login. AIRBOX left, AOS center, user info right.
   Uses a 3-column grid so the centre stays mathematically centred regardless
   of how wide the left or right sections are. */
.auth-topbar--app {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.auth-topbar--app .topbar-left   { justify-self: start;  display: flex; align-items: center; }
.auth-topbar--app .topbar-center { justify-self: center; display: flex; align-items: center; }
.auth-topbar--app .topbar-right  { justify-self: end;    display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--slate); }

.topbar-logo {
  height: 28px;
  width: auto;
  display: block;
}

.topbar-aos {
  height: 30px;
  width: auto;
  display: block;
}

.topbar-user {
  font-weight: 500;
  color: var(--navy);
}

.topbar-link {
  color: var(--slate);
  text-decoration: none;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 5px;
}
.topbar-link:hover { color: var(--navy); background: var(--tint); }

.dot-online {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

.auth-footer {
  text-align: center;
  padding: 16px;
  font-size: 11px;
  color: var(--navy-faint);
  margin-top: auto;
}


/* ============================================================ */
/*  WELCOME                                                       */
/* ============================================================ */

.welcome-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 24px 48px;
}

.aos-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 56px;
  opacity: 0;
  animation: fade-in 1.0s ease-out forwards;
}

.aos-logo {
  width: 220px;
  max-width: 60vw;
  height: auto;
  display: block;
}

/* Slice 5.57 — monochrome cube replaces the old AOS logo on the browser
   welcome. Sized to carry the visual weight the old wordmark had without
   overpowering the warehouse picker below. */
.aos-cube {
  width: 96px;
  height: 96px;
  display: block;
}

/* ── Two-state browser welcome (Slice 5.57) ───────────────────────────
   State 1: brand splash — wordmark + tagline + monochrome cube, tap to
   reveal step 2. Mirrors the scanner / phone-app welcome 1:1.
   State 2: warehouse picker (the previous welcome content).
   No topbar, no chrome on the splash — the brand IS the welcome.    */
.auth-stage--welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.aos-splash {
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* Bottom padding bigger than top — pulls the centred content up
     toward the optical-centre line (about 40% from top), which feels
     more deliberate than mathematical 50% on a wide desktop screen. */
  padding: 24px 24px 18vh;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: aos-fade-in 0.5s ease both;
}
.aos-splash.hide { display: none; }

.aos-splash-mark {
  /* Slice 5.57 — shrunk to 460px for more restraint. Confidence comes
     from being a little smaller, not bigger. SVG so still pixel-crisp.
     Fades in first (100ms delay) — the brand mark arrives first. */
  width: 460px;
  max-width: 70vw;
  height: auto;
  display: block;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  opacity: 0;
  animation: aos-splash-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s forwards;
}
@keyframes aos-splash-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.aos-splash:hover .aos-splash-mark,
.aos-splash:active .aos-splash-mark { transform: scale(1.02); }

.aos-splash-tagline {
  margin: 32px 0 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.005em;
  min-height: 1.4em;            /* prevents layout jump while typing */
  display: inline-flex;
  align-items: baseline;
  opacity: 0;
  animation: aos-splash-in 0.45s ease 0.9s forwards;
}

/* Blinking caret for the typed-out tagline. Sits at the end of the line
   while characters are being added; fades to nothing once the line is
   complete so the page settles. */
.aos-splash-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--navy);
  margin-left: 4px;
  align-self: center;
  animation: aos-caret-blink 0.7s steps(2, end) infinite;
  transition: opacity 0.4s ease;
}
.aos-splash-caret.fade { opacity: 0; }
@keyframes aos-caret-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Slice 5.57 — Enter AOS button. Single clear CTA replacing the
   tap-anywhere pattern. Outlined, restrained, doesn't compete with
   the brand mark above. */
.aos-splash-btn {
  margin-top: 40px;
  padding: 12px 36px;
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
  background: #fff;
  border: 1.5px solid #c5c5c5;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.01em;
  transition: border-color 0.15s ease, transform 0.15s ease;
  opacity: 0;
  animation: aos-splash-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.5s forwards;
}
.aos-splash-btn:hover {
  border-color: var(--navy);
}
.aos-splash-btn:active {
  transform: scale(0.98);
}
.aos-splash:hover .aos-splash-cube,
.aos-splash:active .aos-splash-cube { transform: scale(1.05); }

.aos-step {
  display: none;
  min-height: 100dvh;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Same upward bias as the splash so the picker doesn't feel low. */
  padding-bottom: 18vh;
  animation: aos-fade-in 0.4s ease both;
}
.aos-step.show { display: flex; }

@keyframes aos-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.aos-subtitle {
  margin-top: 18px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate);
  font-weight: 500;
  /* Letter-spacing puts dead air after the last character. text-indent
     of the same amount visually re-centres the line. */
  text-indent: 0.18em;
  text-align: center;
}

@keyframes fade-in {
   0% { opacity: 0; transform: translateY(6px); }
 100% { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .aos-mark { animation: none; opacity: 1; }
  .picker   { animation: none; opacity: 1; }
}


/* Picker */
.picker {
  width: 100%;
  max-width: 460px;
  text-align: center;
  opacity: 0;
  animation: fade-in 0.8s ease-out 0.5s forwards;
}

.picker-heading {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--navy);
  letter-spacing: -0.005em;
}
.picker-sub {
  font-size: 13px;
  color: var(--slate);
  margin: 0 0 18px;
}

.picker-tiles {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.picker-form { margin: 0; }

/* Greyscale tile by default. On hover / active / focus the entire tile
   transitions to a neon-purple state — border, label, arrow, glow. */
.picker-tile {
  width: 100%;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--navy);
  transition: border-color 0.18s, background 0.18s,
              box-shadow 0.18s, transform 0.1s, color 0.18s;
}
.picker-tile:hover,
.picker-tile:focus,
.picker-tile:active {
  border-color: var(--state-border);
  background: var(--card);
  color: var(--navy);
  box-shadow: 0 0 0 3px var(--state-glow);
  transform: translateY(-1px);
  outline: none;
}
.picker-tile:active {
  transform: translateY(0);
}

.picker-tile--disabled {
  background: var(--tint);
  opacity: 0.55;
  cursor: not-allowed;
}
.picker-tile--disabled:hover {
  border-color: var(--border);
  background: var(--tint);
  color: var(--navy);
  transform: none;
  box-shadow: none;
}

.picker-tile-label {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: inherit;        /* follows tile state (navy default, neon on hover) */
  letter-spacing: 0.005em;
}
.picker-tile-arrow {
  font-size: 18px;
  color: var(--slate-soft);
  font-weight: 500;
  margin-left: 6px;
  transition: color 0.18s, transform 0.18s;
}
.picker-tile:hover .picker-tile-arrow,
.picker-tile:focus .picker-tile-arrow {
  color: var(--state-border);
  transform: translateX(3px);
}


/* Admin link — same hover pattern as tiles, smaller */
.picker-admin {
  margin: 4px auto 14px;
  background: none;
  border: 1px dashed var(--border-mid);
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.picker-admin:hover {
  border-color: var(--navy);
  color: var(--navy);
  background: var(--tint);
}

.picker-lock {
  font-size: 11px;
  color: var(--navy-faint);
  margin: 6px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}


/* Live status strip — real data, brings life without being decoration */
.live-strip {
  margin: 32px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  animation: fade-in 0.8s ease-out 0.8s forwards;
}
@media (prefers-reduced-motion: reduce) { .live-strip { animation: none; opacity: 1; } }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-size: 12px;
  color: var(--slate);
  box-shadow: 0 1px 2px rgba(10, 30, 50, 0.03);
}
.live-pill .live-text strong {
  color: var(--navy);
  font-weight: 600;
}
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}
.live-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.25;
  animation: live-pulse 2s ease-in-out infinite;
}
.live-dot--green { background: var(--green); }
.live-dot--blue  { background: var(--blue); }
.live-dot--amber { background: var(--warn-amber); }

@keyframes live-pulse {
  0%, 100% { transform: scale(1);   opacity: 0.25; }
  50%      { transform: scale(1.6); opacity: 0;    }
}


/* ============================================================ */
/*  AUTH CARD — used by sign-in, change-pin, home                 */
/* ============================================================ */

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px 36px 24px;
  width: 100%;
  max-width: 440px;
  margin: 56px auto 24px;
  box-shadow: 0 8px 24px -10px rgba(10, 30, 50, 0.08),
              0 2px 4px rgba(10, 30, 50, 0.03);
}
.auth-card--wide { max-width: 720px; }

.auth-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 4px 0 4px;
  color: var(--navy);
}
.auth-sub {
  font-size: 13px;
  color: var(--slate);
  margin: 0 0 22px;
}
.auth-sub code {
  background: var(--tint);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--navy);
}


/* Context strip — neutral grey, matches the rest of the system */
.ctx-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--tint);
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  margin-bottom: 22px;
}
.ctx-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.ctx-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate);
  font-weight: 600;
}
.ctx-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ctx-change {
  font-size: 12px;
  color: var(--slate);
  text-decoration: none;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 5px;
  transition: color 0.12s, background 0.12s;
}
.ctx-change:hover { color: var(--navy); background: var(--card); }


/* Fields */
.field { margin-bottom: 16px; }

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 5px;
  letter-spacing: 0.02em;
}

.field-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: var(--card);
  color: var(--navy);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.field-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(58, 126, 192, 0.12);
}
.field-input::placeholder { color: var(--navy-faint); }

.pin-text-input {
  letter-spacing: 0.4em;
  font-size: 18px;
  text-align: center;
}


/* Typeahead dropdown */
.typeahead-wrap { position: relative; }

.typeahead-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: 0 8px 22px rgba(10, 30, 50, 0.10);
  max-height: 240px;
  overflow-y: auto;
  z-index: 10;
}

.ta-row {
  padding: 9px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background 0.1s;
}
.ta-row:last-child { border-bottom: none; }
.ta-row:hover,
.ta-row.ta-row--active { background: var(--tint); }

.ta-row-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.ta-row-name { color: var(--navy); font-size: 13px; }
.ta-row-name b { color: var(--navy); font-weight: 700; }
.ta-row-title {
  font-size: 11px;
  color: var(--slate);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-chip {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9px;
  flex-shrink: 0;
  margin-left: 8px;
}


/* PIN cells */
.pin-row {
  display: flex;
  gap: 8px;
}

.pin-cell {
  width: 56px;
  height: 56px;
  border: 1px solid var(--border);
  border-radius: 7px;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  background: var(--card);
  color: var(--navy);
  font-family: inherit;
  -webkit-text-security: disc;     /* mask while typing */
  transition: border-color 0.12s, background 0.12s;
}
.pin-cell:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(58, 126, 192, 0.12);
}
.pin-cell.pin-cell--filled {
  border-color: var(--navy);
  background: var(--tint);
}


/* The single blue moment — primary action */
.btn-primary {
  width: 100%;
  background: var(--blue);
  color: white;
  border: none;
  padding: 11px 16px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.02em;
  margin-top: 8px;
  transition: background 0.12s;
}
.btn-primary:hover:not(:disabled) { background: var(--blue-dark); }
.btn-primary:disabled {
  background: #cfd5dd;
  color: #8a96aa;
  cursor: not-allowed;
}


/* Forgot link */
.forgot-form {
  text-align: center;
  margin: 18px 0 0;
}
.forgot-link {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 12px;
  color: var(--slate);
  cursor: pointer;
  padding: 4px 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.forgot-link:hover { color: var(--navy); }


/* Auth card foot — escape link on /change-pin */
.auth-card-foot {
  text-align: center;
  margin: 18px 0 0;
  font-size: 12px;
}
.auth-card-foot-link {
  color: var(--slate);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-card-foot-link:hover { color: var(--navy); }


/* Home placeholder grid */
.placeholder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0 8px;
}
.placeholder-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  text-decoration: none;
  color: var(--navy);
  transition: border-color 0.12s, background 0.12s, transform 0.08s, box-shadow 0.12s;
}
.placeholder-tile:hover {
  border-color: var(--state-border);
  background: var(--card);
  color: var(--navy);
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px var(--state-glow);
}
.tile-label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}
.tile-sub {
  font-size: 12px;
  color: var(--slate);
}
.placeholder-note {
  margin-top: 22px;
  font-size: 12px;
  color: var(--navy-faint);
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}


/* ============================================================ */
/*  POST-LOGIN TOPBAR — SCOPE SELECTOR                             */
/* ============================================================ */

/* Slice 5.57 — cube sits left of the wordmark; both behave as one
   clickable brand element back to home. */
.topbar-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.topbar-cube {
  height: 28px;
  width: 28px;
  display: block;
}

.topbar-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
}

/* Scope selector — clickable scope label that opens a dropdown */
.scope-selector { position: relative; }

.scope-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--tint);
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 12px;
  color: var(--navy);
  cursor: pointer;
  line-height: 1.2;
  transition: border-color 0.12s, background 0.12s;
}
.scope-trigger:hover {
  border-color: var(--navy-faint);
  background: var(--card);
}
.scope-trigger[aria-expanded="true"] {
  border-color: var(--state-border);
  background: var(--card);
  color: var(--navy);
  box-shadow: 0 0 0 3px var(--state-glow);
}
.scope-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.scope-warehouse { font-weight: 600; }
.scope-sep { color: var(--navy-faint); }
.scope-period { color: var(--slate); }
.scope-caret { color: var(--slate); margin-left: 2px; flex-shrink: 0; }
.scope-trigger:hover .scope-caret { color: var(--navy); }

/* ── Scope picker modal — opens from the topbar chip ────────────────── */
.scope-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;                /* default hidden — JS adds .is-open */
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}
.scope-modal.is-open { display: flex; }
.scope-modal[hidden] { display: none !important; }   /* belt-and-braces */
.scope-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 30, 50, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.scope-panel {
  position: relative;
  width: 100%;
  max-width: 540px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 30px 80px -16px rgba(10, 30, 50, 0.40),
              0 8px 18px rgba(10, 30, 50, 0.10);
  outline: none;
  animation: scope-panel-in 0.18s ease-out;
}
@keyframes scope-panel-in {
  0%   { opacity: 0; transform: translateY(-8px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .scope-panel { animation: none; }
}

.scope-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-soft);
}
.scope-panel-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--navy);
}
.scope-panel-close {
  background: none;
  border: none;
  color: var(--slate);
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  border-radius: 5px;
}
.scope-panel-close:hover { color: var(--navy); background: var(--tint); }

.scope-panel-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}
.scope-panel-footer .btn-primary { width: auto; padding: 9px 18px; margin-top: 0; }

.btn-secondary {
  background: none;
  border: 1px solid var(--border);
  color: var(--slate);
  padding: 9px 16px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.btn-secondary:hover { background: var(--tint); color: var(--navy); border-color: var(--navy-faint); }


/* Section rows inside the panel */
.scope-row {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border-soft);
}
.scope-row:last-of-type { border-bottom: none; }
.scope-row-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--slate);
  margin-bottom: 10px;
}
.scope-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.scope-pill {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.scope-pill:hover {
  border-color: var(--navy-faint);
  background: var(--tint);
}
.scope-pill.is-active {
  background: var(--card);
  border-color: var(--state-border);
  color: var(--state-text);
  font-weight: 600;
  box-shadow: 0 0 0 3px var(--state-glow);
}
.scope-pill.is-active:hover {
  border-color: var(--state-border);
}


/* ============================================================ */
/*  PERFORMANCE BANNER                                             */
/* ============================================================ */

.perf-banner {
  width: 100%;
  border-bottom: 1px solid var(--border-soft);
}
.perf-banner-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.perf-banner-note-row {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 24px 12px;
  text-align: right;
}

/* Band variants — each variant sets background + accent text */
.perf-banner--band-awaiting    { background: var(--tint); }
.perf-banner--band-dark-green  { background: #d1fae5; }
.perf-banner--band-light-green { background: #ecfdf5; }
.perf-banner--band-amber       { background: #fef3c7; }
.perf-banner--band-orange      { background: #fed7aa; }
.perf-banner--band-red         { background: #fecaca; }

.perf-sep { color: var(--navy-faint); margin: 0 2px; }

.perf-grades {
  display: flex;
  align-items: baseline;
  gap: 32px;
}
.perf-grade { text-align: center; }
.perf-grade-eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--slate);
  font-weight: 700;
  margin-bottom: 2px;
}
.perf-grade-value {
  font-size: 36px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.perf-grade-value--small { font-size: 22px; color: var(--slate); }
.perf-grade-pending { color: var(--navy-faint); }

.perf-note {
  font-size: 12px;
  color: var(--slate);
  font-style: italic;
}


/* Period switcher — tabs inside the performance banner */
.perf-period {
  display: inline-flex;
  align-items: center;
  background: rgba(10, 30, 50, 0.05);
  border: 1px solid rgba(10, 30, 50, 0.08);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.perf-period-tab {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--slate);
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.perf-period-tab:hover { color: var(--navy); background: rgba(255,255,255,0.5); }
.perf-period-tab.is-active {
  background: var(--card);
  color: var(--navy);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(10,30,50,0.06);
}


/* Note line in the scope-picker modal explaining the split */
.scope-row-note {
  padding: 12px 22px 16px;
  font-size: 12px;
  color: var(--slate);
  font-style: italic;
  line-height: 1.5;
  margin: 0;
}


/* ============================================================ */
/*  APP CONTENT — wrapper inside the auth-stage                    */
/* ============================================================ */

.app-content {
  max-width: 1380px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  width: 100%;
}


/* Greeting block — date + greeting + sub */
.greeting-block { margin-bottom: 32px; }
.greeting-date {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--slate);
  font-weight: 700;
  margin-bottom: 8px;
}
.greeting {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
  color: var(--navy);
}
.greeting-sub {
  font-size: 14px;
  color: var(--slate);
  margin: 0;
}


/* Operative grid — two-column card layout */
.op-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 760px) {
  .op-grid { grid-template-columns: 1fr; }
}

.op-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
}
.op-card-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--slate);
  font-weight: 700;
  margin-bottom: 12px;
}
.op-card-body { color: var(--navy); }
.op-empty {
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
  margin: 0 0 6px;
}
.op-empty-sub {
  font-size: 12px;
  color: var(--slate);
  margin: 0;
  line-height: 1.5;
}

.op-role-body { display: flex; flex-direction: column; gap: 8px; }
.op-role-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
}
.op-role-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate);
  font-weight: 600;
}
.op-role-value { color: var(--navy); font-weight: 500; }


/* Placeholder pages (supervisor/manager/ops_head/admin homes) */
.placeholder-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 32px;
}
.placeholder-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.placeholder-body {
  font-size: 14px;
  color: var(--slate);
  line-height: 1.6;
  margin: 0 0 12px;
}


/* ============================================================ */
/*  FLASH MESSAGES                                                */
/* ============================================================ */

.flash-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.flash {
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 13px;
  box-shadow: 0 6px 18px rgba(10,30,50,0.12);
  background: var(--card);
  border-left: 3px solid var(--slate);
}
.flash-error {
  background: var(--warn-red-soft);
  color: #6f1d1d;
  border-left-color: var(--warn-red);
}
.flash-ok {
  background: var(--green-soft);
  color: #1f5a35;
  border-left-color: var(--green);
}
.flash-warning {
  background: var(--warn-amber-soft);
  color: #6c4d10;
  border-left-color: var(--warn-amber);
}
