:root {
  color-scheme: light;
  --ink: #070707;
  --muted: #5f5a50;
  --line: #ece5d7;
  --line-dark: #dfcfaa;
  --paper: #ffffff;
  --surface: #ffffff;
  --soft: #fff9ec;
  --soft-2: #f4efe5;
  --brand: #f7ad00;
  --brand-strong: #e49c00;
  --brand-soft: #fff0bf;
  --black: #050505;
  --danger: #9d1c16;
  --warning: #8b5b00;
  --success: #0b0b0b;
  --blue: #111111;
  --shadow: 0 18px 42px rgba(28, 20, 2, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100vh;
}

body {
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: #fbf8f1;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: rgba(247, 173, 0, 0.22);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(247, 173, 0, 0.38);
  outline-offset: 2px;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.shell {
  min-height: 100vh;
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 132px;
  display: grid;
  grid-template-columns: minmax(150px, auto) minmax(0, 1fr) 190px;
  align-items: center;
  gap: 18px;
  padding: 12px 20px;
  border-bottom: 3px solid var(--brand);
  color: var(--ink);
  background: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0;
}

.logo-symbol {
  position: relative;
  width: 128px;
  height: 138px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-name {
  font-size: 18px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
}

.brand-line {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  border-radius: 10px;
  padding: 0;
  border: 1px solid rgba(247, 173, 0, 0.56);
  font-size: 20px;
  color: var(--ink);
  background: var(--brand);
}

.mobile-nav {
  display: none;
}

.mobile-nav.open {
  display: block;
}

.nav-button {
  min-height: 38px;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 900;
}

.nav-button.active,
.nav-button:hover {
  color: #111;
  border-color: var(--brand);
  background: var(--brand);
}

.nav-button.locked {
  color: rgba(7, 7, 7, 0.32);
}

.role-picker,
.filter-picker {
  display: grid;
  gap: 6px;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.role-picker select,
.filter-picker select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

.role-picker {
  color: var(--muted);
}

.auth-status {
  min-width: 190px;
  display: grid;
  gap: 4px;
  justify-items: end;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.auth-status span,
.auth-status strong {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-status strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.context-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line-dark);
  border-left: 6px solid var(--brand);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.kicker {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 5px;
  font-size: 28px;
  line-height: 1.05;
  font-weight: 950;
}

.role-summary {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.span-12 {
  grid-column: span 12;
}

.span-8 {
  grid-column: span 8;
}

.span-7 {
  grid-column: span 7;
}

.span-5 {
  grid-column: span 5;
}

.span-4 {
  grid-column: span 4;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.metric-card,
.panel,
.attention-item,
.status-card,
.availability-card,
.control-card,
.mobile-card {
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 96px;
  display: grid;
  align-content: space-between;
  padding: 13px;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: var(--brand);
}

.metric-card strong {
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
  font-weight: 950;
}

.metric-card span {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  color: var(--ink);
}

.metric-card small {
  color: var(--muted);
  font-size: 12px;
}

.metric-card.danger {
  border-left: 4px solid rgb(179, 38, 30);
}
.metric-card.warn {
  border-left: 4px solid rgb(154, 100, 0);
}
.metric-card.good {
  border-left: 4px solid rgb(47, 125, 50);
}

.panel {
  min-width: 0;
  padding: 15px;
}

.muted-text {
  color: var(--muted);
  font-size: 12px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.15;
  font-weight: 950;
}

.panel-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  color: var(--muted);
  background: var(--soft);
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.pill.neutral {
  color: var(--ink);
  border-color: var(--line-dark);
  background: #fff;
}

.pill.good {
  color: var(--success);
  border-color: rgba(247, 173, 0, 0.5);
  background: var(--brand-soft);
}

.pill.warn {
  color: var(--warning);
  border-color: rgba(247, 173, 0, 0.62);
  background: rgba(247, 173, 0, 0.16);
}

.pill.danger {
  color: var(--danger);
  border-color: rgba(179, 38, 30, 0.28);
  background: rgba(179, 38, 30, 0.08);
}

.button,
.danger-button,
.text-button {
  min-height: 36px;
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.button,
.danger-button {
  padding: 0 12px;
  color: #050505;
  background: var(--brand);
}

.button.primary-action {
    color: #111;
    background: #fff;
}


.danger-button {
  color: #fff;
  background: var(--black);
}

.text-button {
  padding: 0 10px;
  border: 1px solid var(--line-dark);
  color: #111;
  background: #fff;
}

.text-button.danger-text {
  color: var(--danger);
  border-color: rgba(179, 38, 30, 0.32);
}

.text-button.good-action {
  color: var(--ink);
  border-color: rgba(247, 173, 0, 0.66);
  background: var(--brand-soft);
}

.map-link {
  margin-top: 8px;
}

.mini-map {
  width: min(260px, 100%);
  height: 142px;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.mini-map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.text-button.inverse {
  min-height: 30px;
  color: #fff;
  border-color: rgba(5, 5, 5, 0.96);
  background: #050505;
}

.text-button:hover,
.button:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
}

.processing-overlay {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(17, 17, 17, 0.18);
  backdrop-filter: blur(2px);
}

.processing-card {
  width: min(360px, 100%);
  min-height: 82px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 8px;
  color: #111;
  background: #fff;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.18);
}

.processing-card strong,
.processing-card span {
  display: block;
}

.processing-card strong {
  font-size: 13px;
  font-weight: 950;
}

.processing-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.processing-spinner {
  width: 30px;
  height: 30px;
  margin: 0;
  border: 3px solid var(--line-dark);
  border-top-color: var(--brand);
  border-radius: 999px;
  animation: processing-spin 0.8s linear infinite;
}

@keyframes processing-spin {
  to {
    transform: rotate(360deg);
  }
}

.attention-list,
.audit-list,
.report-list,
.pipeline {
  display: grid;
  gap: 10px;
}

.attention-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  box-shadow: none;
}

.attention-item strong,
.row-title strong {
  display: block;
  font-size: 13px;
  font-weight: 950;
}

.attention-item span,
.row-title span,
.attention-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.attention-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipeline-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
}

.pipeline-row strong {
  display: block;
  font-size: 12px;
  font-weight: 950;
}

.pipeline-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.pipeline-row b {
  font-size: 12px;
  text-align: right;
}

.bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft-2);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.data-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  background: #fff;
}

.data-table.compact-table {
  min-width: 640px;
}

.data-table.compact-table th,
.data-table.compact-table td {
  padding: 8px 10px;
  font-size: 12px;
}

.ellipsis-cell {
  display: block;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ellipsis-col {
  max-width: 150px;
}

.eta-duration {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.data-table th,
.data-table td {
  padding: 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
}

.data-table th {
  color: var(--muted);
  background: var(--soft);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

/* ── Action icon buttons (riders tab) ──────────────────────────────── */
.action-icons {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
  border: 1px solid var(--line);
  padding: 0;
}

.icon-btn:hover:not(:disabled) {
  background: var(--soft-2);
  transform: translateY(-1px);
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.icon-btn.good { color: var(--success); background: #f0f5eb; border-color: #d4e2c5; }
.icon-btn.good:hover:not(:disabled) { background: #e2ebd8; }

.icon-btn.danger { color: var(--danger); background: #fdf2f1; border-color: #f0d5d3; }
.icon-btn.danger:hover:not(:disabled) { background: #f8e4e2; }

.icon-btn.neutral { color: var(--muted); background: var(--soft); }
.icon-btn.neutral:hover:not(:disabled) { background: var(--soft-2); }

.icon-btn svg {
  width: 14px;
  height: 14px;
  pointer-events: none;
}

/* ── Online presence chip ───────────────────────────────────────────── */
.online-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c4bdb3;
}

.online-dot.live {
  background: #2d8a2d;
  box-shadow: 0 0 0 2px rgba(45, 138, 45, 0.18);
}

/* ── Map modal (wider than standard modal) ─────────────────────────── */
.map-modal-panel {
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  overflow: hidden;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 60px rgba(0, 0, 0, 0.18);
  animation: modal-slide-up 0.18s ease-out;
  display: flex;
  flex-direction: column;
}

.map-modal-body {
  padding: 0;
  flex: 1;
  min-height: 360px;
  position: relative;
}

.map-modal-iframe {
  width: 100%;
  height: 100%;
  min-height: 360px;
  border: 0;
  display: block;
}

.map-modal-meta {
  padding: 10px 16px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--soft);
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.segmented button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  color: #111;
  background: #fff;
  font-size: 12px;
  font-weight: 950;
}

.segmented button.active {
  color: #050505;
  border-color: var(--brand);
  background: var(--brand);
}

.mobile-list {
  display: none;
}

.card-grid,
.availability-grid,
.control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.availability-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.control-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.control-grid.simple-controls {
  grid-template-columns: minmax(0, 1fr);
}

.card-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-grid.one-col {
  grid-template-columns: minmax(0, 1fr);
}

.status-card,
.availability-card,
.control-card {
  min-width: 0;
  padding: 14px;
  box-shadow: none;
}

.status-card {
  border-color: rgba(223, 207, 170, 0.86);
}

.status-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.status-card h3,
.availability-card h3,
.control-card h3 {
  margin-bottom: 4px;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 950;
}

.status-card p,
.availability-card p,
.control-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.details-grid {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px 10px;
  padding: 10px;
  border-radius: 8px;
  background: var(--soft);
}

.details-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.details-grid strong {
  min-width: 0;
  font-size: 12px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.center-number-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.center-number {
  min-height: 66px;
  display: grid;
  align-content: space-between;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
}

.center-number.good {
  border-color: rgba(247, 173, 0, 0.5);
  background: var(--brand-soft);
}

.center-number.danger {
  border-color: rgba(179, 38, 30, 0.3);
  background: rgba(179, 38, 30, 0.08);
}

.center-number.danger strong {
  color: var(--danger);
}

.center-number span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.center-number strong {
  font-size: 22px;
  line-height: 1;
  font-weight: 950;
}

.rider-quick-list {
  display: grid;
  gap: 10px;
}

.rider-quick-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
}

.rider-quick-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.rider-quick-head strong,
.rider-quick-head span,
.rider-location-line strong,
.rider-location-line small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.rider-quick-head strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 950;
}

.rider-quick-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.rider-location-line {
  display: grid;
  gap: 3px;
  margin-top: 10px;
}

.rider-location-line span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.rider-location-line strong {
  font-size: 12px;
  line-height: 1.3;
  font-weight: 950;
}

.rider-location-line small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.meal-action-box {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.meal-action-box label {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.meal-action-box input {
  min-height: 36px;
  width: 100%;
  padding: 0 10px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 850;
}

.center-capacity-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 10px;
}

.center-capacity-control label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.center-capacity-control input {
  min-height: 36px;
  width: 100%;
  padding: 0 10px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 850;
}

.button,
.danger-button,
.text-button,
.nav-button,
.segmented button {
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease,
    filter 0.16s ease;
}

.issue-line,
.inventory-line,
.reason-line {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--warning);
  background: rgba(247, 173, 0, 0.12);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.35;
}

.reason-line {
  color: var(--muted);
  background: var(--soft);
}

.ad-preview {
  min-height: 76px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #111;
  background:
    linear-gradient(135deg, rgba(247, 173, 0, 0.24), transparent),
    var(--soft);
  text-align: center;
}

.ad-preview strong {
  display: block;
  font-size: 18px;
  font-weight: 950;
}

.ad-preview span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.ad-preview.has-image {
  min-height: 156px;
  padding: 0;
  overflow: hidden;
  place-items: stretch;
  background: #fff;
}

.ad-preview.has-image img {
  width: 100%;
  height: 132px;
  display: block;
  object-fit: cover;
  background: #fff;
}

.ad-preview.has-image span {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  padding: 0 10px;
  border-top: 1px solid var(--line);
}

.center-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.center-actions .text-button,
.card-actions .text-button {
  flex: 1 1 104px;
}

.audit-item,
.report-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.4;
}

.audit-item:last-child,
.report-row:last-child {
  border-bottom: 0;
}

.report-row strong {
  display: block;
  font-size: 13px;
  font-weight: 950;
}

.report-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.push-template-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.push-template {
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.push-template:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.push-template strong {
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.push-template span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.3;
}

.push-form,
.push-field,
.form-grid label {
  display: grid;
  gap: 7px;
}

.push-form {
  gap: 12px;
}

.push-reach-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.push-reach-strip div {
  min-height: 62px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.push-reach-strip strong,
.push-reach-strip span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.push-reach-strip strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
}

.push-reach-strip span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  line-height: 1.25;
  text-transform: uppercase;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.push-field span,
.form-grid label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.push-form input,
.push-form select,
.push-form textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 11px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}

.push-form textarea {
  min-height: 100px;
  line-height: 1.45;
  resize: vertical;
}

.push-preview {
  padding: 12px;
  border: 1px dashed var(--line-dark);
  border-radius: 8px;
  background: var(--soft);
}

.push-phone-card {
  max-width: 420px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(247, 173, 0, 0.48);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 12, 4, 0.12);
}

.push-dot {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, var(--brand) 0 42%, #050505 43% 100%);
}

.push-phone-card strong,
.push-phone-card span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.push-phone-card strong {
  font-size: 13px;
  font-weight: 950;
}

.push-phone-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.push-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.push-row:last-child {
  border-bottom: 0;
}

.push-row strong,
.push-row span,
.push-row small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.push-row strong {
  font-size: 13px;
  font-weight: 950;
}

.push-row span,
.push-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.push-counts {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.field-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.field-list span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #111;
  background: var(--soft);
  font-size: 11px;
  font-weight: 900;
}

.backend-notice {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  color: #111;
  background: #fff;
  font-size: 12px;
  font-weight: 850;
}

.backend-notice.good {
  color: var(--success);
  border-color: rgba(247, 173, 0, 0.5);
  background: var(--brand-soft);
}

.backend-notice.warn {
  color: var(--warning);
  border-color: rgba(154, 100, 0, 0.3);
  background: rgba(154, 100, 0, 0.1);
}

.backend-notice.danger {
  color: var(--danger);
  border-color: rgba(179, 38, 30, 0.28);
  background: rgba(179, 38, 30, 0.08);
}

.auth-panel {
  display: grid;
  gap: 16px;
}

.auth-panel h2 {
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 950;
}

.auth-panel p {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.signin-form {
  max-width: 460px;
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 12px;
}

.signin-form label {
  min-width: 0;
  width: 100%;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.signin-form input,
.signin-form select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  font-weight: 750;
  text-transform: none;
}

.logo-upload-box {
  min-width: 0;
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: var(--soft);
}

.logo-upload-box > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.logo-upload-box input[type="file"] {
  min-height: 44px;
  padding: 9px;
  border: 1px dashed var(--line-dark);
  border-radius: 8px;
  background: #fff;
}

.logo-upload-preview,
.partner-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo-upload-preview img,
.partner-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  object-fit: contain;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
}

.partner-logo.placeholder {
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
}

.partner-intake-card {
  min-width: 0;
  border-color: rgba(247, 173, 0, 0.44);
}

.partner-intake-details {
  min-width: 0;
  grid-template-columns: 88px minmax(0, 1fr);
}

.partner-intake-details a {
  color: var(--black);
  font-weight: 950;
  overflow-wrap: anywhere;
}

.logo-upload-preview strong,
.partner-title h3,
.partner-title p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.empty-state {
  padding: 20px;
  border: 1px dashed var(--line-dark);
  border-radius: 8px;
  color: var(--muted);
  background: #fffdf7;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  color: #050505;
  background: var(--brand);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
  font-size: 13px;
  font-weight: 850;
}

.toast[hidden] {
  display: none;
}

@media (max-width: 1160px) {
  .header {
    grid-template-columns: 1fr;
  }

.context-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.filter-group {
  display: grid;
  gap: 4px;
  min-width: 140px;
}

.filter-group label {
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.filter-group select,
.search-picker {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 850;
}

.search-picker {
  min-width: 180px;
}

.upgrade-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.upgrade-row .filter-picker {
  flex: 1 1 180px;
}

.upgrade-row .filter-picker select {
  min-height: 38px;
  width: 100%;
  padding: 0 10px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 850;
}

.upgrade-row .text-button {
  flex: 0 0 auto;
}

@media (max-width: 720px) {
  .context-filters {
    flex-direction: column;
  }
  .search-picker {
    min-width: 0;
    width: 100%;
  }
  .filter-group {
    min-width: 0;
    width: 100%;
  }
}

.role-picker {
    max-width: 260px;
  }

  .auth-status {
    justify-items: start;
  }

  .metrics,
  .card-grid,
  .availability-grid,
  .control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .span-8,
  .span-7,
  .span-5,
  .span-4 {
    grid-column: span 12;
  }
}

@media (max-width: 720px) {
  body {
    background: #fff;
  }

  .header {
    position: static;
    padding: 14px;
  }

  .auth-status {
    min-width: 0;
  }

  .main {
    padding: 14px;
  }

  .context-bar {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }

  .metrics,
  .card-grid,
  .card-grid.two-col,
  .card-grid.one-col,
  .availability-grid,
  .control-grid {
    grid-template-columns: 1fr;
  }

  .center-number-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .push-template-row,
  .push-reach-strip,
  .form-grid {
    grid-template-columns: 1fr;
  }

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

  .push-counts {
    justify-items: start;
  }

  .panel-head,
  .attention-item {
    display: grid;
  }

  .attention-actions {
    justify-content: flex-start;
  }

  .table-wrap {
    display: none;
  }

  .mobile-list {
    display: grid;
    gap: 10px;
  }

  .mobile-card {
    padding: 12px;
    box-shadow: none;
  }

  .mobile-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-card p {
    margin: 8px 0;
    color: var(--muted);
    font-size: 12px;
  }

  .mobile-card dl {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 7px 10px;
    margin: 0;
  }

  .mobile-card dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
  }

  .mobile-card dd {
    margin: 0;
    font-size: 12px;
    font-weight: 850;
  }
}

:root {
  --app-bg: #fbf6eb;
  --touch: 44px;
  --radius: 10px;
}

body {
  background: var(--app-bg);
  overflow-x: hidden;
}

.shell {
  background:
    radial-gradient(circle at 12% 0, rgba(247, 173, 0, 0.1), transparent 260px),
    linear-gradient(180deg, #fff 0, var(--app-bg) 280px, var(--app-bg) 100%);
}

.header {
  background: #fff;
  box-shadow: 0 10px 24px rgba(32, 22, 2, 0.08);
}

.logo-symbol {
  width: 126px;
  height: 136px;
}

.metric-card,
.panel,
.attention-item,
.status-card,
.availability-card,
.control-card,
.mobile-card,
.center-number,
.text-field,
.toast {
  border-radius: var(--radius);
}

.nav {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.main {
  max-width: 1360px;
}

.button,
.danger-button,
.text-button,
.segmented button,
.nav-button {
  min-height: var(--touch);
  touch-action: manipulation;
}

.role-picker select,
.filter-picker select,
.signin-form input,
.signin-form select,
.meal-action-box input,
.text-button {
  min-height: var(--touch);
}

.data-table {
  min-width: 760px;
}

.table-wrap {
  -webkit-overflow-scrolling: touch;
}

.mobile-list .mobile-card {
  border-radius: 12px;
}

@media (max-width: 1160px) {
  .header {
    grid-template-columns: 1fr;
  }

  .role-picker,
  .auth-status {
    width: 100%;
  }

  .header,
  .brand,
  .nav,
  .auth-status,
  .context-bar {
    justify-items: center;
    text-align: center;
  }

  .auth-status,
  .role-picker select,
  .filter-picker select {
    width: 100%;
  }

  .nav {
    justify-content: center;
    width: 100%;
  }
}

@media (max-width: 720px) {
  body {
    background: var(--app-bg);
    padding: env(safe-area-inset-top) 0 0;
  }

  .header {
    position: sticky;
    top: 0;
    z-index: 20;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    padding: 12px 12px 8px;
  }

  .logo-symbol {
    width: 98px;
    height: 106px;
  }

  .brand-name {
    font-size: 15px;
  }

  .brand-line {
    font-size: 10px;
  }

  .brand {
    justify-self: center;
    grid-column: 2;
  }

  .nav-desktop,
  .header > .auth-status,
  .header > .role-picker {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    grid-column: 3;
    justify-self: end;
  }

  .mobile-nav {
    max-height: 0;
    overflow: hidden;
    transition:
      max-height 0.2s ease,
      opacity 0.2s ease;
    opacity: 0;
    pointer-events: none;
    background: #fff;
    border-bottom: 1px solid rgba(247, 173, 0, 0.44);
    border-top: none;
  }

  .mobile-nav.open {
    max-height: calc(100vh - 132px);
    max-height: calc(100dvh - 132px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-nav-inner {
    display: grid;
    gap: 8px;
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  }

  .mobile-nav .nav {
    display: grid;
    width: 100%;
    gap: 8px;
    justify-content: stretch;
  }

  .mobile-nav .nav .nav-button {
    width: 100%;
    justify-content: flex-start;
    border-radius: 12px;
    text-align: left;
    min-height: 44px;
  }

  .mobile-auth .auth-status {
    justify-items: start;
    padding: 8px 10px;
    border-top: 1px solid rgba(247, 173, 0, 0.26);
    margin-top: 4px;
  }

  .main {
    padding: 12px 12px 18px;
  }

  .context-bar {
    border-radius: 12px;
    box-shadow: none;
    text-align: center;
  }

  .context-bar .filter-picker,
  .context-bar .filter-picker select {
    width: 100%;
  }

  .panel,
  .attention-item,
  .status-card,
  .availability-card,
  .control-card,
  .mobile-card {
    border-radius: 12px;
  }

  .center-actions,
  .card-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .button,
  .danger-button,
  .text-button,
  .segmented button {
    width: 100%;
  }

  .meal-action-box input {
    min-height: 42px;
  }
}

/* ─── Pagination ─── */

.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.pagination-info {
  font-size: 12px;
  font-weight: 850;
  color: var(--muted);
  white-space: nowrap;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition: background 0.15s;
}

.page-btn:hover:not(:disabled):not(.active) {
  background: var(--soft);
  border-color: var(--brand);
}

.page-btn.active {
  color: #050505;
  background: var(--brand);
  border-color: var(--brand);
  font-weight: 950;
}

.page-btn:disabled {
  opacity: 0.38;
  cursor: default;
}

.page-btn.arrow {
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
}

.page-ellipsis {
  min-width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  user-select: none;
}

.pagination-size {
  font-size: 11px;
  font-weight: 850;
  color: var(--muted);
}

.pagination-size label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-size select {
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

@media (max-width: 720px) {
  .pagination-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .pagination-controls {
    justify-content: center;
  }

  .pagination-info,
  .pagination-size {
    text-align: center;
  }
}

/* ─── Modal Overlay ──────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(17, 17, 17, 0.22);
  backdrop-filter: blur(3px);
}

.modal-panel {
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow: visible;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 60px rgba(0, 0, 0, 0.18);
  animation: modal-slide-up 0.18s ease-out;
  display: flex;
  flex-direction: column;
}

@keyframes modal-slide-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line-light);
}

.modal-head h3 {
  font-size: 15px;
  font-weight: 900;
  margin: 0;
}

.modal-close {
  font-size: 22px;
  line-height: 1;
  padding: 0 4px;
  color: var(--muted);
}

.modal-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  flex: 1;
}

/* Live subscriptions */
.subscription-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.subscription-summary > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-light);
  border-radius: 8px;
  background: var(--soft);
}

.subscription-summary strong,
.subscription-summary span {
  display: block;
}

.subscription-summary strong {
  font-size: 20px;
  line-height: 1.1;
}

.subscription-summary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.subscription-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.subscription-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
}

.subscription-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.subscription-card h3 {
  margin: 3px 0 0;
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.subscription-kind {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.subscription-contact {
  min-height: 18px;
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.subscription-details {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 6px 8px;
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line-light);
  font-size: 12px;
}

.subscription-details dt {
  color: var(--muted);
  font-weight: 800;
}

.subscription-details dd {
  min-width: 0;
  margin: 0;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.subscription-actions,
.subscription-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.subscription-notify-form {
  display: grid;
  gap: 14px;
}

.subscription-notify-form textarea {
  width: 100%;
  resize: vertical;
}

@media (max-width: 1000px) {
  .subscription-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .subscription-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .subscription-grid {
    grid-template-columns: 1fr;
  }

  .subscription-actions .text-button {
    flex: 1;
  }
}

/* ─── Rider Picker (inside credit/debit modal) ────────────────────────── */

.rider-picker-wrapper {
  position: relative;
}

.rider-picker-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.rider-picker-input-wrap input {
  flex: 1;
  width: 100%;
}

.rider-picker-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.rider-picker-clear:hover {
  background: var(--line-dark);
  color: #111;
}

.rider-picker-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 60;
  max-height: 200px;
  overflow-y: auto;
  margin: 3px 0 0;
  padding: 4px 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
}

.rider-picker-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.1s;
}

.rider-picker-item:hover,
.rider-picker-item:focus {
  background: #f5f5f5;
}

.rider-picker-name {
  font-weight: 700;
  color: #111;
}

.rider-picker-phone {
  color: var(--muted);
  font-size: 12px;
}

.rider-picker-empty {
  justify-content: center;
  color: var(--muted);
  cursor: default;
  font-style: italic;
}

.rider-picker-empty:hover {
  background: transparent;
}

/* ─── Map Tab ─────────────────────────────────────────────────────────── */

.map-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 280px);
  min-height: 500px;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.map-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-dark);
  background: #fff;
  flex-shrink: 0;
}

.map-metrics {
  display: flex;
  gap: 20px;
}

.map-metric {
  display: flex;
  flex-direction: column;
}

.map-metric-value {
  font-size: 20px;
  font-weight: 950;
  line-height: 1.1;
  color: var(--ink);
}

.map-metric-label {
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.map-refresh-btn {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.map-refresh-btn:hover {
  background: var(--brand);
  border-color: var(--brand);
}

.map-frame {
  position: relative;
  flex: 1;
  min-height: 360px;
  width: 100%;
}

.map-container {
  position: absolute;
  inset: 0;
  min-height: 360px;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.map-container.leaflet-container,
.map-container .leaflet-container {
  width: 100%;
  height: 100%;
  background: #f0efe7;
}

.map-status {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 1100;
  max-width: min(520px, calc(100% - 28px));
  transform: translateX(-50%);
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.16);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
  text-align: center;
}

.map-status[hidden] {
  display: none;
}

.map-status-warn {
  border-color: rgba(247, 173, 0, 0.65);
  background: rgba(255, 248, 226, 0.98);
}

.map-status-danger {
  border-color: rgba(220, 38, 38, 0.36);
  background: rgba(254, 242, 242, 0.98);
  color: #991b1b;
}

/* Legend */
.map-legend {
  position: absolute;
  bottom: 20px;
  right: 12px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(6px);
  font-size: 12px;
  line-height: 1.5;
  min-width: 170px;
}

.map-legend-title {
  font-weight: 950;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--ink);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--muted);
  font-weight: 600;
}

.map-legend-item img {
  flex-shrink: 0;
  object-fit: contain;
}

.map-legend-item:last-child {
  margin-bottom: 0;
}

.map-marker-circle {
  background: transparent !important;
  border: none !important;
}

@media (max-width: 860px) {
  .map-shell {
    height: calc(100vh - 340px);
    min-height: 400px;
  }
  .map-metrics { gap: 12px; }
  .map-metric-value { font-size: 16px; }
  .map-legend {
    bottom: 10px;
    right: 6px;
    padding: 8px 10px;
    font-size: 10px;
    min-width: 140px;
  }
  .map-legend-item { gap: 4px; margin-bottom: 3px; }
}

@media (max-width: 500px) {
  .map-metrics { display: none; }
  .map-topbar { justify-content: flex-end; }
}

/* ─── Rider review queue (Unapproved / Approved tabs) ────────────────── */

.rider-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 16px 12px;
  border-bottom: 1px solid var(--line-light);
  margin-bottom: 12px;
}

.rider-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, transform 0.08s;
}

.rider-tab:hover {
  background: var(--soft-2);
  transform: translateY(-1px);
}

.rider-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--ink);
}

.tab-count {
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.rider-tab .tab-count.good {
  background: var(--green-soft);
  color: var(--green);
}

.rider-tab .tab-count.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.rider-tab.active .tab-count.good {
  background: rgba(255, 255, 255, 0.22);
  color: var(--ink);
  border: 1px;
  border-color: var(--ink);
}

.rider-tab.active .tab-count.warn {
  background: rgba(255, 255, 255, 0.22);
  color: var(--ink);
  border: 1px;
  border-color: var(--ink);
}

/* Sticky actions column (Dropit-style) */
.sticky-actions-head,
.sticky-actions {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  box-shadow: -8px 0 12px -8px rgba(0, 0, 0, 0.18);
  text-align: center;
}

.sticky-actions-head {
  z-index: 3;
}

.sticky-actions .action-icons {
  justify-content: center;
  min-width: 132px;
}

.icon-btn.warn-solid {
  color: #9a6a00;
  background: rgba(247, 173, 0, 0.14);
  border-color: rgba(247, 173, 0, 0.4);
}
.icon-btn.warn-solid:hover:not(:disabled) { background: rgba(247, 173, 0, 0.26); }

/* ─── Rider documents modal ───────────────────────────────────────────── */

.doc-modal-panel {
  width: 100%;
  max-width: 860px;
  max-height: 88vh;
  overflow: hidden;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 60px rgba(0, 0, 0, 0.18);
  animation: modal-slide-up 0.18s ease-out;
  display: flex;
  flex-direction: column;
}

.doc-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 160px;
}

.doc-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  background: var(--soft);
  font-size: 12px;
}

.doc-modal-foot svg {
  width: 13px;
  height: 13px;
  vertical-align: -2px;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.doc-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.doc-card.good { border-color: rgba(76, 158, 80, 0.4); }
.doc-card.danger { border-color: rgba(179, 38, 30, 0.32); }

.doc-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.doc-card-head strong {
  font-size: 12px;
  font-weight: 900;
}

.doc-card-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.doc-card-actions .button.small,
.doc-card-actions .button.small:hover {
  min-height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 850;
}

.doc-card-actions .button.small.good { background: var(--success); color: #fff; }
.doc-card-actions .button.small.danger { background: var(--danger); color: #fff; }
.doc-card-actions .button.small:disabled { opacity: 0.55; cursor: wait; }

.doc-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--soft);
  cursor: zoom-in;
}

.doc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f3f3f3;
  display: block;
}

.doc-zoom {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(17, 17, 17, 0.72);
  color: #fff;
  opacity: 0;
  transition: opacity 0.12s;
}

.doc-thumb:hover .doc-zoom { opacity: 1; }
.doc-zoom svg { width: 14px; height: 14px; pointer-events: none; }

.doc-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px dashed var(--line-dark);
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  padding: 8px;
}

.doc-placeholder.missing { background: var(--soft); }

.doc-note {
  margin: 0;
  font-size: 11px;
  color: var(--danger);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.doc-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 0;
}

.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: processing-spin 0.8s linear infinite;
}

/* ─── Lightbox (full-size document preview) ──────────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  background: rgba(10, 10, 10, 0.9);
  cursor: zoom-out;
}

.lightbox img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 8px;
  background: #fff;
  cursor: default;
}

.lightbox p {
  color: #eee;
  font-size: 12px;
  margin: 0;
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }

/* ─── Rider review modal (approve / reject / unapprove / doc reject) ─── */

.review-modal-panel {
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 60px rgba(0, 0, 0, 0.18);
  animation: modal-slide-up 0.18s ease-out;
}

.review-modal-body {
  padding: 14px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-modal-body p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.review-modal-body label {
  display: block;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.review-modal-body textarea {
  width: 100%;
  min-height: 88px;
  padding: 10px 12px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  resize: vertical;
  background: #fff;
}

.review-modal-body textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.form-error {
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}

.review-modal-panel .modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--soft);
}

.review-modal-panel .button.primary { background: var(--brand); color: #050505; }
.review-modal-panel .button.danger { background: var(--danger); color: #fff; }
.review-modal-panel .button.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line-dark); }
.review-modal-panel .button:disabled { opacity: 0.6; cursor: wait; transform: none; }

.empty-state.danger {
  border-color: rgba(179, 38, 30, 0.35);
  color: var(--danger);
  background: rgba(179, 38, 30, 0.06);
}

@media (max-width: 640px) {
  .doc-grid { grid-template-columns: 1fr; }
  .doc-modal-body { padding: 12px; }
}

/* ─── Today view: center card + automation health layout polish ────── */

/* Center meal cards (Today + Centers tabs share this card component) */
.status-card[data-center-card] {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.status-card[data-center-card] .status-card-head {
  margin-bottom: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.status-card[data-center-card] .center-number-grid {
  gap: 10px;
}

.center-number {
  min-height: 74px;
  padding: 12px;
}

.center-number strong {
  font-size: 24px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.status-card[data-center-card] .inventory-line {
  margin-top: 0;
  padding: 9px 10px;
  border-left: 3px solid rgba(247, 173, 0, 0.65);
  line-height: 1.45;
}

/* Bottom action group: controls + meal actions pinned so equal-height
   cards align their action rows */
.status-card-actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.center-controls {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.center-controls .center-actions {
  margin-top: 0;
}

.status-card[data-center-card] .meal-action-box {
  margin-top: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

/* Automation health + Attention needed rows (live view only) */
.attention-item {
  padding: 14px 12px;
  gap: 14px;
  border-left: 3px solid var(--line);
}

.attention-item.good {
  border-left-color: rgb(47, 125, 50);
}

.attention-item.warn {
  border-left-color: rgb(154, 100, 0);
}

.attention-item.danger {
  border-left-color: rgb(179, 38, 30);
}

.attention-list .signal-item {
  min-height: 64px;
}

/* Center card grid: two roomier columns on wide screens and even row
   heights, so the action bar has room and cards stay equal height */
.center-card-grid {
  gap: 16px;
}

@media (min-width: 721px) {
  .center-card-grid {
    grid-auto-rows: 1fr;
  }
}

@media (min-width: 1161px) {
  .center-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Desktop: horizontal button rows. Buttons keep their full label width
   (min-width: fit-content) and wrap as whole units instead of crushing
   text into single letters. */
@media (min-width: 721px) {
  .status-card[data-center-card] .center-actions .text-button,
  .meal-action-box .center-actions .text-button {
    flex: 1 1 0;
    min-width: fit-content;
    white-space: nowrap;
    overflow-wrap: normal;
  }

  .status-card[data-center-card] .center-actions .text-button {
    padding-left: 8px;
    padding-right: 8px;
  }

  /* Compact action bar: Qty on the left, three buttons on the right */
  .meal-action-box {
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
  }

  .meal-action-box label {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .meal-action-box .center-actions {
    margin-top: 0;
  }

  .meal-action-box .center-actions .text-button {
    padding-left: 6px;
    padding-right: 6px;
    font-size: 11px;
  }
}

/* Numeric cells (e.g. rider Earnings) — right aligned, tabular figures */
.data-table td.numeric,
.mobile-card dd.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ─── Date filter inputs (Riders tab) ────────────────────────────── */

.date-input {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.date-input input[type="date"] {
  width: 100%;
  min-height: 38px;
  padding: 0 34px 0 10px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: normal;
  text-transform: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.date-input:hover input[type="date"] {
  border-color: var(--brand);
}

.date-input > svg {
  position: absolute;
  right: 10px;
  width: 15px;
  height: 15px;
  color: var(--brand);
  pointer-events: none;
}

/* Keep the native picker fully clickable — the invisible indicator
   covers the whole input so tapping anywhere (including the icon)
   opens the browser calendar. */
.date-input input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* ─── Horizontal inline filter groups (Tickets / Routes panel heads) ── */

@media (min-width: 721px) {
  .filters-head {
    flex-wrap: wrap;
  }

  .filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 10px;
  }

  .filter-group .filter-picker {
    min-width: 150px;
  }

  .filter-group .filter-sm {
    min-width: 112px;
  }

  .filter-group .search-picker {
    min-width: 200px;
    min-height: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
  }

  .filter-group .search-picker input {
    min-height: 38px;
    width: 100%;
    padding: 0 10px;
    border: 1px solid var(--line-dark);
    border-radius: 8px;
    color: var(--ink);
    background: #fff;
    font-size: 13px;
    font-weight: 850;
  }
}

/* ─── Riders toolbar: tabs + filters on one inline row ─────────────── */

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

@media (min-width: 721px) {
  .rider-toolbar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
  }

  .rider-toolbar .rider-tabs {
    padding: 0;
    border-bottom: none;
    margin-bottom: 0;
  }

  .rider-toolbar .filter-group {
    flex: 1 1 auto;
  }
}
/* Versioned app-content publishing console */
.content-release-form { display: grid; gap: 18px; }
.content-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.content-form-grid label, .content-json-field { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.content-form-grid input, .content-form-grid select, .content-json-field textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line); background: var(--surface, #fff); color: var(--ink); border-radius: 8px; padding: 11px 12px; font: inherit; }
.content-json-field textarea { min-height: 320px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.55; }
.content-json-field small { font-weight: 500; }
.content-scope-row { padding: 13px 14px; border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 5px; }
.content-scope-row span { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.content-scope-row strong { font-size: 13px; line-height: 1.6; }
.content-actions { justify-content: flex-end; }
.content-phone { min-height: 430px; border: 1px solid #dfb75d; border-radius: 28px; padding: 18px; background: linear-gradient(160deg, #fffaf0, #ffedc6); color: #241b08; box-shadow: 0 18px 40px rgba(142, 94, 0, .16); overflow: hidden; }
.content-phone-status { display: flex; justify-content: space-between; font-size: 11px; font-weight: 800; }
.content-phone-mark { width: 48px; height: 48px; display: grid; place-items: center; margin: 46px auto 18px; border-radius: 50%; background: #f5a800; font: 900 24px/1 serif; }
.content-phone .eyebrow { text-align: center; text-transform: uppercase; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.content-phone h3 { margin: 8px auto 26px; max-width: 250px; text-align: center; font-size: 25px; line-height: 1.08; }
.content-phone-card { margin-top: 10px; padding: 13px; border: 1px solid rgba(101, 67, 0, .2); border-radius: 8px; background: rgba(255,255,255,.72); display: grid; gap: 3px; }
.content-phone-card span { font-size: 12px; }
.content-history { display: grid; gap: 10px; }
.content-history-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.content-history-row h3 { margin: 8px 0 3px; font-size: 15px; }
.content-history-row p { margin: 0; color: var(--muted); font-size: 12px; }
.content-copy-workbench,
.content-change-list {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface, #fff) 92%, #f7ad00 8%);
}
.content-copy-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.content-copy-heading h3 { margin: 2px 0 4px; font-size: 17px; }
.content-copy-heading p:not(.kicker) { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.content-copy-heading .kicker { margin: 0; }
.content-copy-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.content-copy-controls label,
.content-copy-search,
.content-copy-replacement { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 750; }
.content-copy-controls select,
.content-copy-search input,
.content-copy-replacement textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--surface, #fff);
  color: var(--ink);
  font: inherit;
}
.content-copy-search input:focus,
.content-copy-replacement textarea:focus,
.content-copy-controls select:focus { outline: 2px solid color-mix(in srgb, #f7ad00 58%, transparent); outline-offset: 1px; }
.content-copy-results {
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface, #fff);
  box-shadow: 0 12px 28px rgba(32, 24, 8, .09);
}
.content-copy-result {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.content-copy-result:last-child { border-bottom: 0; }
.content-copy-result:hover,
.content-copy-result:focus-visible { background: color-mix(in srgb, #f7ad00 11%, var(--surface, #fff)); }
.content-copy-result > span:first-child { min-width: 0; display: grid; gap: 3px; }
.content-copy-result strong,
.content-copy-result small { overflow-wrap: anywhere; }
.content-copy-result strong { font-size: 13px; line-height: 1.35; }
.content-copy-result small { color: var(--muted); font-size: 11px; }
.content-copy-result > span:last-child { flex: 0 0 auto; font-size: 22px; line-height: 1; }
.content-copy-selection { display: grid; gap: 13px; padding-top: 2px; }
.content-copy-current { display: grid; gap: 5px; padding: 13px; border-left: 3px solid #f7ad00; background: var(--surface, #fff); }
.content-copy-current span { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.content-copy-current strong { font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.content-copy-current small { color: var(--muted); font-size: 10px; }
.content-copy-replacement textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.content-copy-replacement > span { display: flex; justify-content: space-between; gap: 12px; }
.content-copy-replacement > span small { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.content-placeholder-note { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 11px; }
.content-placeholder-note code { padding: 3px 6px; border-radius: 4px; background: var(--ink); color: var(--surface, #fff); }
.content-copy-add-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.content-copy-add-row small { color: var(--muted); font-weight: 700; }
.content-copy-prompt { padding: 18px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); text-align: center; font-size: 12px; }
.content-change-list { background: var(--surface, #fff); }
.content-change-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.content-change-row > div { min-width: 0; display: grid; gap: 4px; }
.content-change-row span { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.content-change-row strong { font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.content-change-row small { color: var(--muted); font-size: 10px; }
.content-change-row .icon-button { flex: 0 0 38px; width: 38px; height: 38px; font-size: 22px; }
.content-advanced { border: 1px solid var(--line); border-radius: 8px; background: var(--surface, #fff); }
.content-advanced summary { padding: 13px 14px; cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 750; }
.content-advanced[open] summary { border-bottom: 1px solid var(--line); }
.content-advanced .content-json-field { padding: 14px; }
@media (max-width: 760px) {
  .content-form-grid,
  .content-copy-controls { grid-template-columns: 1fr; }
  .content-history-row { align-items: flex-start; flex-direction: column; }
  .content-copy-heading,
  .content-copy-add-row { align-items: stretch; flex-direction: column; }
  .content-copy-add-row .button { width: 100%; }
  .content-copy-workbench,
  .content-change-list { padding: 14px; }
}

/* ─── Admin shell modernization ─── */
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    radial-gradient(circle at 12% 0, rgba(247, 173, 0, 0.07), transparent 260px),
    linear-gradient(180deg, #fff 0, #fbf7ec 280px, #fbf7ec 100%);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(240px, 270px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  width: min(100%, 1560px);
  margin: 0 auto;
  padding: 0 18px 22px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 180px 1fr 180px;
  align-items: center;
  min-height: 82px;
  width: min(100%, 1560px);
  margin: 0 auto;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 2px solid var(--line-dark);
  color: var(--ink);
  background: #fff;
}

.header .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.header .brand .logo-symbol {
  width: 58px;
  height: 58px;
}

.header .brand .brand-name {
  font-size: 17px;
}

.header-meta {
  justify-self: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.desktop-signout {
  justify-self: end;
  padding: 10px 14px;
  border: 1px solid var(--line-dark);
  border-radius: 9px;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  color: var(--ink);
}

.menu-toggle {
  display: none;
  width: 44px;
  min-height: 44px;
  border-radius: 11px;
  border: 1px solid var(--line-dark);
  background: #fff;
  font-size: 21px;
  line-height: 1;
  color: var(--ink);
}

.admin-sidebar {
  position: sticky;
  top: 88px;
  left: 0;
  z-index: 35;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-self: stretch;
  height: calc(100vh - 88px);
  border: 1px solid var(--line-dark);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(48, 38, 10, 0.05);
  overflow: hidden;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--soft-2);
}

.sidebar-title {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.side-nav {
  display: grid;
  gap: 8px;
  padding: 10px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-button {
  justify-self: stretch;
  justify-content: flex-start;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  text-align: left;
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
}

.nav-button.active {
  color: #111;
  border-color: rgba(247, 173, 0, 0.7);
  background: linear-gradient(90deg, #fff 0, #fff5d6 100%);
  font-weight: 950;
}

.nav-button.locked {
  opacity: 0.45;
}

.sidebar-meta {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.sidebar-meta .role-picker,
.sidebar-meta .auth-status {
  width: 100%;
  justify-items: stretch;
}

.sidebar-meta .auth-status {
  justify-items: stretch;
}

.sidebar-meta .auth-status span,
.sidebar-meta .auth-status strong {
  max-width: none;
}

.sidebar-meta .text-button.inverse {
  width: 100%;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.35);
  border: 0;
  padding: 0;
  z-index: 30;
}

.sidebar-backdrop.open {
  display: block;
}

.main {
  margin: 0;
  width: 100%;
  padding: 0;
}

.context-bar,
.panel,
.metric-card,
.attention-item,
.status-card,
.availability-card,
.control-card,
.mobile-card,
.auth-panel,
.panel-head h2,
.table-wrap,
.mobile-list {
  border-radius: 12px;
}

@media (max-width: 1160px) {
  .dashboard-layout {
    display: block;
    padding: 0 12px 18px;
  }

  .header {
    grid-template-columns: 44px 1fr 44px;
    width: 100%;
    padding: 12px;
  }

  .header .brand {
    justify-self: center;
    justify-content: center;
    text-align: center;
  }

  .header-meta {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    order: 3;
    justify-self: end;
  }

  .desktop-signout {
    display: none;
  }

  .admin-sidebar {
    position: fixed;
    inset: 68px 0 auto auto;
    width: min(86vw, 320px);
    height: calc(100dvh - 68px);
    transform: translateX(100%);
    transition:
      transform 0.2s ease,
      box-shadow 0.2s ease;
    border-radius: 16px 0 0 16px;
    border-right: 1px solid var(--line-dark);
    border-top: 0;
    box-shadow: -12px 14px 32px rgba(38, 25, 1, 0.25);
    right: 0;
    left: auto;
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    z-index: 33;
  }

  .main {
    padding-bottom: 16px;
  }
}

@media (max-width: 720px) {
  .header {
    grid-template-columns: 44px 1fr 44px;
    min-height: 72px;
    padding: 10px 12px;
  }

  .header .brand {
    justify-self: center;
    grid-column: 2;
  }

  .header .brand .logo-symbol {
    width: 52px;
    height: 52px;
  }

  .header .brand .brand-name {
    font-size: 15px;
  }

  .header .brand .brand-line {
    font-size: 9px;
  }

  .menu-toggle {
    order: 3;
    grid-column: 3;
    margin-left: auto;
    border-color: rgba(247, 173, 0, 0.45);
  }

  .dashboard-layout {
    padding: 0 12px 18px;
  }

  .admin-sidebar {
    inset: 64px 0 0 auto;
    width: min(92vw, 360px);
    height: calc(100dvh - 64px);
  }
}

.startup-error {
  min-height: calc(100vh - 32px);
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.startup-error .panel {
  width: min(680px, 100%);
}

.startup-error h1 {
  margin-bottom: 10px;
  font-size: 22px;
}

.startup-error-text {
  margin-top: 8px;
  color: var(--danger);
  font-size: 12px;
  word-break: break-word;
}

/* Modern operations workspace */
:root {
  --ink: #181816;
  --muted: #67675f;
  --line: #e8e8e2;
  --line-dark: #d9d9d1;
  --paper: #ffffff;
  --surface: #ffffff;
  --soft: #faf8f1;
  --soft-2: #f4f3ee;
  --brand: #f5aa00;
  --brand-strong: #d99300;
  --brand-soft: #fff3cf;
  --success: #1f6d46;
  --warning: #8a5a00;
  --danger: #ad2d28;
  --shadow: 0 1px 2px rgba(24, 24, 22, 0.04);
}

body {
  color: var(--ink);
  background: #f5f6f7;
}

.shell {
  background: #f5f6f7;
}

.header {
  min-height: 66px;
  width: 100%;
  max-width: none;
  grid-template-columns: 236px minmax(0, 1fr) 110px;
  gap: 18px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 1px 0 rgba(24, 24, 22, 0.02);
}

.header .brand {
  gap: 10px;
}

.header .brand .logo-symbol {
  width: 46px;
  height: 46px;
}

.header .brand .brand-name {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.header-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.live-workspace > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2f8a5c;
  box-shadow: 0 0 0 3px rgba(47, 138, 92, 0.12);
}

.desktop-signout {
  min-height: 36px;
  padding: 0 12px;
  border-color: var(--line-dark);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 750;
}

.dashboard-layout {
  width: min(100%, 1600px);
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 0;
  padding: 0 24px 28px;
}

.admin-sidebar {
  top: 66px;
  height: calc(100vh - 66px);
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #fbfbfa;
  box-shadow: none;
}

.sidebar-head {
  min-height: 50px;
  padding: 12px 14px 8px;
  border: 0;
  background: transparent;
}

.sidebar-title {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.side-nav {
  display: block;
  padding: 0 10px 16px;
}

.nav-group + .nav-group {
  margin-top: 17px;
}

.nav-group-label {
  margin: 0 0 5px;
  padding: 0 9px;
  color: #8a8a82;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-group-items {
  display: grid;
  gap: 2px;
}

.nav-button {
  position: relative;
  min-height: 36px;
  padding: 0 10px 0 13px;
  border: 0;
  border-radius: 6px;
  color: #4f4f49;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  transition: color 0.14s ease, background 0.14s ease;
}

.nav-button:hover {
  color: var(--ink);
  background: #f1f1ed;
}

.nav-button.active {
  color: var(--ink);
  border: 0;
  background: var(--brand-soft);
  font-weight: 850;
}

.nav-button.active::before {
  content: "";
  position: absolute;
  inset: 7px auto 7px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand-strong);
}

.sidebar-meta {
  padding: 12px;
  border-color: var(--line);
  background: #fbfbfa;
}

.main {
  width: 100%;
  max-width: none;
  padding: 22px 0 0 28px;
}

.context-bar {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
  align-items: end;
  margin: 0 0 18px;
  padding: 2px 0 18px;
  border: 0;
  border-bottom: 1px solid var(--line-dark);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.context-bar h1 {
  margin-bottom: 6px;
  font-size: 25px;
  line-height: 1.12;
  font-weight: 850;
}

.context-bar .kicker {
  margin-bottom: 7px;
  color: #77776f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.page-purpose {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.context-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.filter-picker span,
.meal-action-box label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}

.filter-picker select {
  min-height: 38px;
  border-color: var(--line-dark);
  border-radius: 7px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.grid {
  gap: 16px;
}

.metrics.core-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.metric-card,
.panel,
.attention-item,
.status-card,
.availability-card,
.control-card,
.mobile-card,
.auth-panel,
.table-wrap,
.mobile-list {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 102px;
  padding: 15px;
}

.metric-card::before {
  display: none;
}

.metric-card strong {
  margin: 0;
  font-size: 27px;
  font-weight: 850;
}

.metric-card span {
  margin-top: 13px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.metric-card small {
  margin-top: 3px;
  font-size: 11px;
}

.panel {
  padding: 18px;
  background: #fff;
}

.panel-head {
  align-items: center;
  margin-bottom: 16px;
}

.panel-head h2 {
  font-size: 15px;
  font-weight: 850;
}

.panel-head p {
  margin-top: 4px;
  font-size: 11px;
}

.status-card {
  box-shadow: none;
}

.status-card[data-center-card] {
  padding: 15px;
}

.center-number-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.center-number {
  border-radius: 7px;
  background: #f7f7f4;
}

.center-number strong {
  font-weight: 850;
}

.center-number span {
  min-height: 2.5em;
  display: flex;
  align-items: flex-start;
  word-break: normal;
  overflow-wrap: normal;
}

.text-button,
.button,
.danger-button {
  border-radius: 7px;
  font-weight: 800;
}

.center-controls .center-actions,
.meal-action-box .center-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}

.center-actions .text-button {
  min-width: 0;
  padding: 7px 9px;
  line-height: 1.25;
  word-break: normal;
  overflow-wrap: normal;
}

@media (min-width: 721px) {
  .status-card[data-center-card] .meal-action-box {
    grid-template-columns: minmax(0, 1fr);
  }

  .status-card[data-center-card] .meal-action-box label {
    grid-template-columns: minmax(0, 1fr) minmax(88px, 120px);
    align-items: center;
    gap: 10px;
  }

  .status-card[data-center-card] .center-actions .text-button,
  .meal-action-box .center-actions .text-button {
    min-width: 0;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
  }

  .status-card[data-center-card] .center-controls .text-button {
    min-height: 54px;
  }

  .status-card[data-center-card] .meal-action-box .text-button {
    min-height: 48px;
    padding: 8px 10px;
    font-size: 12px;
    overflow: hidden;
  }

  .status-card[data-center-card].compact .meal-action-box .center-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-card[data-center-card].compact .meal-action-box .center-actions .text-button:last-child {
    grid-column: 1 / -1;
  }
}

.attention-item,
.audit-item {
  box-shadow: none;
}

.backend-notice {
  border-radius: 7px;
  box-shadow: none;
}

@media (max-width: 1160px) {
  .header {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    min-height: 64px;
    padding: 8px 12px;
  }

  .header .brand {
    grid-column: 2;
    justify-self: center;
  }

  .header-meta,
  .desktop-signout {
    display: none;
  }

  .menu-toggle {
    grid-column: 3;
    width: 40px;
    min-height: 40px;
    border-color: var(--line-dark);
    border-radius: 7px;
  }

  .dashboard-layout {
    display: block;
    padding: 0 16px 24px;
  }

  .admin-sidebar {
    inset: 64px 0 0 auto;
    width: min(88vw, 320px);
    height: calc(100dvh - 64px);
    border-left: 1px solid var(--line);
    border-right: 0;
    border-radius: 0;
    background: #fff;
  }

  .main {
    padding: 18px 0 0;
  }

  .metrics.core-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  html,
  body {
    overflow-x: hidden;
  }

  body {
    background: #f5f6f7;
  }

  .header {
    position: sticky;
    min-height: 64px;
    padding: 7px 10px;
  }

  .header .brand {
    gap: 7px;
  }

  .header .brand .logo-symbol {
    width: 44px;
    height: 44px;
  }

  .header .brand .brand-name {
    font-size: 12px;
  }

  .dashboard-layout {
    padding: 0 10px 18px;
  }

  .context-bar {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-bottom: 15px;
  }

  .context-bar h1 {
    font-size: 22px;
  }

  .page-purpose {
    font-size: 12px;
  }

  .context-filters {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .metrics.core-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics.core-metrics .metric-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .metric-card {
    min-height: 94px;
    padding: 13px;
  }

  .metric-card strong {
    font-size: 24px;
  }

  .panel {
    padding: 14px;
  }

  .panel-head {
    align-items: flex-start;
  }

  .center-controls .center-actions,
  .meal-action-box .center-actions {
    grid-template-columns: 1fr;
  }

  .center-actions .text-button {
    width: 100%;
  }

  .admin-sidebar {
    width: min(92vw, 340px);
  }
}
