/* ==========================================================================
   INDISTAY OPS — SHARED DESIGN SYSTEM
   Change 1: tokens + visual primitives only.
   Architecture, DOM contracts and module behaviour remain untouched.
   ========================================================================== */

:root {
  /* Brand */
  --navy: #14110D;
  --navy-2: #1D1813;
  --navy-3: #292219;
  --gold: #C9971F;
  --gold-hover: #B88616;
  --gold-soft: #F3E2BC;
  --cream: #FBF8F3;

  /* Semantic surfaces */
  --bg: var(--navy);
  --surface: var(--cream);
  --surface-alt: #F7F4EE;
  --surface-raised: var(--cream);
  --surface-dark: var(--navy);
  --surface-dark-2: var(--navy-2);

  /* Text */
  --text: #171512;
  --text-strong: #0F0E0C;
  --text-muted: #68635A;
  --text-on-dark: #FFFFFF;
  --text-muted-on-dark: #C9C2B5;

  /* Borders */
  --border: #E5E0D8;
  --border-soft: #EEEAE3;
  --border-dark: #383229;

  /* Status */
  --success: #2F7A43;
  --success-soft: #E7F3E9;
  --warning: #A66A00;
  --warning-soft: #FFF2D8;
  --error: #B3261E;
  --error-soft: #FBE9E7;
  --info: #2D5F9A;
  --info-soft: #E9F0F8;
  --purple: #6A3BA3;
  --purple-soft: #F0E9F8;

  /* Typography */
  --font-heading: Georgia, 'Times New Roman', serif;
  --font-body: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-md: 14px;
  --text-base: 15px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;

  /* Shape */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Controls */
  --control-sm: 40px;
  --control-md: 44px;
  --control-lg: 48px;
  --touch-target: 44px;

  /* Elevation */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.08);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.18);

  /* Shell */
  --frame-max: 392px;
  --content-padding: 16px;
  --topbar-height: 64px;
  --bottom-nav-height: 64px;
  --quick-action-size: 56px;

  /* Motion */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --duration-fast: 120ms;
  --duration-standard: 180ms;
}

/* Tablet/desktop: same system, wider canvas. */
@media (min-width: 700px) {
  :root {
    --frame-max: 640px;
    --content-padding: 20px;
  }
}

@media (min-width: 1000px) {
  :root {
    --frame-max: 900px;
    --content-padding: 24px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0A08;
    --surface: #1E1B15;
    --surface-alt: #262219;
    --surface-raised: #28241D;
    --surface-dark: #0B0A08;
    --surface-dark-2: #15120F;

    --text: #F8F4EC;
    --text-strong: #FFFFFF;
    --text-muted: #B9B2A0;
    --text-on-dark: #FFFFFF;
    --text-muted-on-dark: #C7C0B3;

    --border: #40392E;
    --border-soft: #302B23;
    --border-dark: #4A4235;

    --success: #78C48B;
    --success-soft: #203A27;
    --warning: #E5B55A;
    --warning-soft: #40341D;
    --error: #F18C85;
    --error-soft: #442522;
    --info: #8DB4E3;
    --info-soft: #213247;
    --purple: #C1A1E5;
    --purple-soft: #342A40;

    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.30);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  font-family: var(--font-body);
  color: var(--text);
  display: flex;
  justify-content: center;
  padding: 16px var(--content-padding);
  font-size: var(--text-base);
  line-height: 1.4;
}

.frame {
  width: 100%;
  max-width: var(--frame-max);
}

.brand {
  text-align: center;
  margin-bottom: var(--space-6);
}

.brand h1 {
  font-family: var(--font-heading);
  color: var(--text-on-dark);
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

.card {
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--content-padding);
  box-shadow: var(--shadow-soft);
}

.card h2 {
  font-family: var(--font-heading);
  margin: 0 0 var(--space-4);
  font-size: var(--text-xl);
}

.hint {
  font-size: var(--text-md);
  color: var(--text-muted);
  margin: 0 0 var(--space-4);
}

form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

label {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-top: 8px;
}

input, select, textarea {
  font-family: var(--font-body);
  font-size: 16px;
  padding: 11px 14px;
  min-height: var(--control-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent);
}

button {
  margin-top: var(--space-5);
  padding: 12px 16px;
  min-height: var(--control-lg);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--gold);
  color: var(--navy);
  font-size: var(--text-base);
  font-weight: 700;
  cursor: pointer;
}

button:hover { background: var(--gold-hover); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
button:disabled { opacity: 0.6; cursor: not-allowed; }

button.secondary {
  background: transparent;
  border: 1px solid var(--text);
  color: var(--text);
  font-weight: 600;
}

.error {
  color: var(--error);
  font-size: var(--text-sm);
  margin: 4px 0 0;
}

#welcomeRole {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  font-size: var(--text-sm);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== Icons ===== */

.icon { display: inline-flex; width: 20px; height: 20px; flex: 0 0 auto; align-items: center; justify-content: center; }
.icon svg { display: block; width: 100%; height: 100%; }

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-2);
}

.icon-badge-gold { background: var(--gold-soft); color: var(--gold); }
.icon-badge-green { background: var(--success-soft); color: var(--success); }
.icon-badge-red { background: var(--error-soft); color: var(--error); }
.icon-badge-blue { background: var(--info-soft); color: var(--info); }
.icon-badge-purple { background: var(--purple-soft); color: var(--purple); }

/* ===== App shell ===== */

#appShell {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-bottom: calc(var(--bottom-nav-height) + var(--space-4));
}
/* #appShell is styled with an explicit `display` in 3 separate places in
   this file — none of them account for the `hidden` attribute app.js
   toggles on it. Author CSS always beats the browser's built-in
   `[hidden] { display:none }` rule regardless of specificity, so without
   this the logged-out login screen bleeds the empty app shell in
   underneath it. Found live on the production app 2026-08-21. */
#appShell[hidden] { display: none; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-1) var(--space-3);
}

.topbar-title {
  font-family: var(--font-heading);
  color: var(--text-on-dark);
  font-size: var(--text-xl);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.role-chip {
  background: var(--gold);
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--text-on-dark);
  color: var(--text-on-dark);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 8px 12px;
  min-height: var(--control-md);
  margin: 0;
  cursor: pointer;
}

/* Bottom nav: 5 items incl. "More", icon-over-label, meets the 56-64px
   touch-target band and stays reachable with one thumb. */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--frame-max);
  display: flex;
  background: var(--surface-dark);
  border: 1px solid var(--border-dark);
  border-bottom: 0;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25);
  z-index: 10;
}

@media (min-width: 700px) {
  .bottom-nav { max-width: min(var(--frame-max), 480px); border-radius: 16px 16px 0 0; }
}

.nav-item {
  flex: 1;
  background: none;
  border: none;
  margin: 0;
  padding: 8px 4px 10px;
  min-height: var(--bottom-nav-height);
  font-size: 11px;
  font-weight: 600;
  color: #A9A397;
  border-radius: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-top: 2px solid transparent;
}

.nav-item .icon { width: 22px; height: 22px; }

.nav-item.active {
  color: var(--gold);
  border-top-color: var(--gold);
  background: rgba(201, 151, 31, 0.06);
}

.view { display: flex; flex-direction: column; gap: var(--space-3); }
.view[hidden] { display: none; }

/* ===== Dashboard: greeting + KPI grid + horizontal glance strip ===== */

.dash-greeting {
  padding: var(--space-2) var(--space-1) var(--space-1);
}

.dash-greeting h2 {
  font-family: var(--font-heading);
  color: var(--text-on-dark);
  margin: 0 0 2px;
  font-size: var(--text-xl);
}

.dash-greeting p {
  color: var(--text-muted-on-dark);
  margin: 0;
  font-size: var(--text-md);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.home-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.home-kpi-grid .kpi-card {
  min-height: 132px;
}

.home-kpi-grid .kpi-card .icon-badge {
  margin-bottom: var(--space-2);
}

.home-section {
  margin-top: var(--space-1);
}

.home-list-card {
  overflow: hidden;
  padding: 0;
}

.home-action-list,
.home-booking-list {
  display: flex;
  flex-direction: column;
}

.home-action-list .list-row,
.home-booking-list .list-row {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  box-shadow: none;
}

.home-action-list .list-row + .list-row,
.home-booking-list .list-row + .list-row {
  border-top: 1px solid var(--border-soft);
}

.home-empty {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5);
}

.home-empty .icon-badge {
  flex: 0 0 auto;
}

.home-list-more {
  width: 100%;
  min-height: var(--control-lg);
  border: 0;
  border-top: 1px solid var(--border-soft);
  border-radius: 0;
  background: transparent;
  color: var(--gold);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
}

.home-push-button {
  align-self: flex-start;
  margin-top: var(--space-1);
}

.booking-row-image {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.booking-row-amount {
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--text);
}

@media (min-width: 700px) {
  .home-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 700px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .list-row, .card { padding: 18px 20px; }
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.stat-trend { font-size: 11px; color: var(--success); margin-top: 4px; font-weight: 600; }
.stat-trend-down { color: var(--error); }

.glance-strip {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  padding-bottom: 2px;
  margin: 0 calc(var(--content-padding) * -1);
  padding-left: var(--content-padding);
  padding-right: var(--content-padding);
}

.glance-card {
  flex: 0 0 auto;
  width: 92px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--space-3) 10px;
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.glance-card .stat-value { font-size: 20px; }
.glance-card .stat-label { font-size: 11px; }
.glance-card .icon-badge { width: 34px; height: 34px; margin-bottom: 6px; }
.glance-card .icon-badge .icon { width: 17px; height: 17px; }

/* ===== Lists ===== */

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.list-header h2 {
  font-family: var(--font-heading);
  color: var(--text-on-dark);
  margin: 0;
  font-size: var(--text-lg);
}

button.small {
  margin-top: 0;
  padding: 10px 14px;
  min-height: 44px;
  font-size: var(--text-sm);
  width: auto;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-row {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 48px;
}

.list-row.clickable { cursor: pointer; }
.list-row.clickable:hover { box-shadow: var(--shadow-soft); }

.list-row .icon-badge { margin-bottom: 0; flex: 0 0 auto; }
.list-row-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.list-row-title { font-weight: 700; font-size: 14px; }
.list-row-sub { font-size: 12px; color: var(--text-muted); }
.list-row-side { font-size: 12px; color: var(--text-muted); }

/* A list item that opens a sub-page rather than acting inline — trailing
   chevron makes that distinction visible at a glance ("More" menu etc.). */
.nav-list-row {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px;
  min-height: var(--control-lg);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border: none;
  width: 100%;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.nav-list-row .icon-badge { margin-bottom: 0; width: 36px; height: 36px; }
.nav-list-row .icon-badge .icon { width: 18px; height: 18px; }
.nav-list-row-label { flex: 1; text-align: left; }
.nav-list-row .chevron { color: var(--text-muted); width: 18px; height: 18px; }

/* ===== Tabs ===== */

.tabs {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
}

.tab {
  background: transparent;
  border: 1px solid var(--text-on-dark);
  color: var(--text-on-dark);
  margin: 0;
  padding: 8px 14px;
  min-height: 40px;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
}

.tab.active {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent);
  color: var(--navy);
}

/* ===== Badges ===== */

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-green { background: var(--success-soft); color: var(--success); }
.badge-amber { background: var(--warning-soft); color: var(--warning); }
.badge-red { background: var(--error-soft); color: var(--error); }
.badge-blue { background: var(--info-soft); color: var(--info); }

/* ===== Stepper ===== */

.stepper-progress {
  display: flex;
  gap: var(--space-2);
  margin-bottom: 8px;
}

.step-dot {
  height: 6px;
  flex: 1;
  border-radius: 999px;
  background: var(--border-soft);
}

.step-dot.active { background: var(--gold); }

.stepper-nav {
  display: flex;
  gap: var(--space-3);
  margin-top: 12px;
}

.stepper-nav button { margin-top: 0; flex: 1; }

.link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  text-decoration: underline;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 8px 0 0;
  margin: 0;
  cursor: pointer;
}

.section-divider {
  font-family: var(--font-heading);
  font-size: 16px;
  margin: 20px 0 8px;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-soft);
}

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.field-hint { font-size: 11px; color: var(--text-muted); margin: 2px 0 0; }

/* ===== Sub-editors (compliance / listings / staff) ===== */

.sub-editor {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--border);
}

.sub-editor h3 {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  margin: 0 0 8px;
}

.sub-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }

.sub-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.sub-row-3 { grid-template-columns: 1fr 1fr 1fr; }

.sub-row input, .sub-row select {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: 8px 10px;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-md);
  padding: 8px 0;
  min-height: 44px;
  font-weight: 400;
}

.checkbox-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-height: 0;
  padding: 0;
  flex: 0 0 auto;
}

/* ===== Photo capture — dashed camera tile, becomes a thumbnail + check
   badge once a photo's taken. Field staff-facing, so the tap target is the
   whole tile, not a tiny native file input. ===== */

.photo-capture { margin-bottom: 12px; }

.photo-capture-input {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.capture-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: var(--text-md);
  font-weight: 600;
  cursor: pointer;
  position: relative;
}

.capture-label:focus-within, .photo-capture-input:focus + .capture-label { border-color: var(--gold); }

.photo-capture-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--success);
  color: #fff;
}
.photo-capture-check .icon { width: 12px; height: 12px; }

.photo-capture-preview {
  display: block;
  max-width: 100%;
  max-height: 160px;
  border-radius: var(--radius-md);
  margin: 0 0 8px;
  object-fit: cover;
}

.inline-form, .inline-form-wrap {
  display: flex;
  gap: var(--space-2);
  margin-top: 10px;
  flex-wrap: wrap;
}

.inline-form input, .inline-form select,
.inline-form-wrap input, .inline-form-wrap select {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  flex: 1;
  min-width: 100px;
}

/* ===== Sticky action bar — pin the one primary action for a long-scroll
   screen (turnover checklists, PO detail, etc.) to the bottom of the
   viewport, above the app's own bottom nav. ===== */

.sticky-bar {
  position: sticky;
  bottom: 8px;
  display: flex;
  gap: var(--space-3);
  background: var(--surface);
  padding: 10px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  margin-top: 8px;
}

.sticky-bar button { margin-top: 0; flex: 1; }

/* ===== Toast ===== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 76px;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: var(--cream);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 20;
  max-width: 90vw;
}

.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast-error { background: var(--error); }

/* ===== Fine-pointer sizing — placed last so it wins the cascade over the
   equal-specificity base rules above. Mouse/trackpad devices (desktop
   browser) don't need 44-48px touch targets; that sizing is for field
   staff tapping with a thumb. Scoped to hover:hover + pointer:fine so a
   touch tablet, which DOES need the big targets, is unaffected regardless
   of its screen width. ===== */

@media (hover: hover) and (pointer: fine) {
  body { font-size: 14px; }
  input, select, textarea { font-size: 14px; padding: 9px 12px; min-height: 38px; }
  button { padding: 10px 16px; min-height: 40px; font-size: 14px; }
  .icon-btn { min-height: 36px; padding: 6px 10px; }
  .checkbox-row input[type="checkbox"] { width: 16px; height: 16px; }
  .nav-item { min-height: 48px; }
}

/* ==========================================================================
   Shared component primitives for the Shell + Home second pass
   These are intentionally additive: existing views can adopt them without
   changing their JavaScript contracts.
   ========================================================================== */

.surface {
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.section-title h2,
.section-title h3 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-heading);
  font-weight: 750;
  letter-spacing: -0.01em;
}

.section-title h2 { font-size: var(--text-lg); }
.section-title h3 { font-size: var(--text-md); }

.section-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-sm);
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: var(--text-sm);
  font-weight: 700;
  margin: 0;
  cursor: pointer;
}

.kpi-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  padding: var(--space-4);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.kpi-card-label {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

.kpi-card-value {
  color: var(--text-strong);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.kpi-card-meta {
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: 1.3;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.status-success { background: var(--success-soft); color: var(--success); }
.status-warning { background: var(--warning-soft); color: var(--warning); }
.status-error { background: var(--error-soft); color: var(--error); }
.status-info { background: var(--info-soft); color: var(--info); }
.status-neutral { background: var(--surface-alt); color: var(--text-muted); }

.app-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--topbar-height);
  padding: var(--space-3) var(--content-padding);
  background: var(--surface-dark);
  color: var(--text-on-dark);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.app-header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.app-header-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid rgba(201, 151, 31, 0.55);
  border-radius: var(--radius-pill);
  color: var(--gold);
}

.app-header-brand-text {
  min-width: 0;
  color: var(--text-on-dark);
  font-size: var(--text-md);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.01em;
}

.app-header-brand-subtitle {
  display: block;
  margin-top: 2px;
  color: var(--text-muted-on-dark);
  font-size: var(--text-xs);
  font-weight: 600;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.app-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: var(--control-md);
  min-width: var(--control-md);
  height: var(--control-md);
  min-height: var(--control-md);
  padding: 0;
  margin: 0;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-on-dark);
}

.app-icon-button:hover { background: rgba(255, 255, 255, 0.06); }

.notification-count {
  position: absolute;
  top: -4px;
  right: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid var(--surface-dark);
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: var(--navy);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.role-select {
  min-height: var(--control-md);
  padding: 0 12px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-pill);
  background: var(--surface-dark-2);
  color: var(--text-on-dark);
  font-size: var(--text-sm);
  font-weight: 700;
}

.quick-action {
  position: fixed;
  right: max(16px, calc((100vw - var(--frame-max)) / 2 + 16px));
  bottom: calc(var(--bottom-nav-height) + 16px);
  z-index: 11;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--quick-action-size);
  height: var(--quick-action-size);
  min-height: var(--quick-action-size);
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: var(--navy);
  box-shadow: var(--shadow-lg);
}

.quick-action:hover { background: var(--gold-hover); }

@media (max-width: 699px) {
  .quick-action { right: 16px; }
}

/* Intentional horizontal strips: chips, glance cards and tabs only. */
.glance-strip, .tabs {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.glance-strip::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }

::selection {
  background: var(--gold-soft);
  color: var(--navy);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* ===== Change 5 audit fixes: warm operational canvas + shared row/status polish ===== */
body:has(#appShell:not([hidden])) {
  background: var(--navy);
}

.auth-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin: 0 auto var(--space-3);
  border: 2px solid var(--gold);
  border-radius: 18px 18px 18px 6px;
  color: var(--gold);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.04em;
  transform: rotate(-2deg);
}

.brand-tagline {
  margin: var(--space-2) 0 0;
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.app-header-brand-kicker {
  color: var(--text-muted-on-dark);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
}

.app-header-brand-text span {
  font-weight: 500;
}

.list-row-side-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  flex: 0 0 auto;
  min-width: 0;
}

.list-row-side-group .badge,
.list-row-side-group .booking-row-amount {
  flex: 0 0 auto;
}

.list-row-side-group .chevron {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--text-muted);
}

.list-row.clickable:focus-visible,
.nav-list-row:focus-visible,
.home-list-more:focus-visible,
.section-link:focus-visible,
.quick-action:focus-visible,
.app-icon-button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Home deliberately switches from the dark branded shell to a warm cream
   operational workspace, matching the approved mobile composition. */
.home-dashboard {
  margin: 0 calc(var(--content-padding) * -1);
  padding: var(--space-4) var(--content-padding) calc(var(--bottom-nav-height) + 28px);
  background: var(--cream);
  color: var(--text);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.home-dashboard .dash-greeting {
  padding: var(--space-2) 0 var(--space-3);
}

.home-dashboard .dash-greeting h2 {
  color: var(--text-strong);
}

.home-dashboard .dash-greeting p {
  color: var(--text-muted);
}

.home-dashboard .section-title h2,
.home-dashboard .section-title h3 {
  color: var(--text-strong);
}

.home-dashboard .glance-strip {
  margin-left: calc(var(--content-padding) * -1);
  margin-right: calc(var(--content-padding) * -1);
}

.home-dashboard .home-list-card {
  background: var(--surface);
}

.home-dashboard .home-push-button {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.home-dashboard .home-push-button:hover {
  background: var(--surface);
}

@media (prefers-color-scheme: dark) {
  .home-dashboard {
    background: #18150F;
  }
}

/* ===== Change 3: authentication + shell composition ===== */
.auth-brand {
  padding: var(--space-6) var(--space-2) var(--space-4);
  margin-bottom: var(--space-4);
}

.brand-kicker,
.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-kicker { margin-bottom: var(--space-1); }

.brand-subtitle {
  margin: var(--space-1) 0 0;
  color: var(--text-muted-on-dark);
  font-size: var(--text-sm);
  font-weight: 600;
}

.auth-heading { margin-bottom: var(--space-5); }
.auth-heading .hint { margin-top: var(--space-2); margin-bottom: 0; }
.auth-heading h2 { margin-bottom: 0; }

.auth-card {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

.auth-card > button:last-child { margin-top: var(--space-3); }

#appShell {
  gap: 0;
  min-height: calc(100vh - 32px);
  background: var(--bg);
}

.app-header {
  margin: 0 calc(var(--content-padding) * -1);
  padding-left: var(--content-padding);
  padding-right: var(--content-padding);
}

.shell-pagebar {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: var(--space-3) 0 var(--space-2);
}

.shell-pagebar .topbar-title {
  color: var(--text-on-dark);
  font-size: var(--text-lg);
  font-weight: 750;
  letter-spacing: -0.01em;
}

#logoutBtn {
  min-height: var(--control-md);
  white-space: nowrap;
}

@media (max-width: 699px) {
  .app-header-actions { gap: 6px; }
  .role-select { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #logoutBtn { padding-left: 9px; padding-right: 9px; }
}


/* ===== Final Shell/Home tone corrections ===== */
.app-header {
  background: var(--navy);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.shell-pagebar {
  background: var(--navy);
  padding-left: var(--content-padding);
  padding-right: var(--content-padding);
  margin: 0 calc(var(--content-padding) * -1);
}

.app-header-brand-mark {
  border-radius: 16px 16px 16px 6px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.app-header-brand-text {
  font-size: 15px;
  letter-spacing: 0.02em;
}

.app-header-brand-subtitle {
  color: var(--gold);
  font-size: 8px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.app-icon-button {
  border-color: rgba(255,255,255,0.18);
}

#notificationBtn .icon {
  width: 19px;
  height: 19px;
}

#appShell {
  overflow: visible;
}
