:root {
  color-scheme: light;
  --ink: #18202a;
  --muted: #5d6775;
  --line: #d7dde5;
  --panel: #ffffff;
  --surface: #fff6f6;
  --input-bg: #ffffff;
  --card-bg: #ffffff;
  --card-hover-bg: #fffafb;
  --card-hover-line: #ef9ca0;
  --accent: #ee6f73;
  --accent-dark: #d94c53;
  --accent-soft: #ffe8e9;
  --accent-soft-hover: #ffd9db;
  --ok: #137333;
  --ok-bg: #ecfdf3;
  --ok-border: #a8d8b9;
  --warning: #96630a;
  --warning-bg: #fff7da;
  --warning-border: #ead184;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --danger-border: #f3a6a0;
  --info: #1d4f8f;
  --info-bg: #eef6ff;
  --info-border: #b9d2f0;
  --map-water: #dceef6;
  --map-land: #edf6ee;
  --map-road: #ffffff;
  --map-road-shadow: #c2d2d8;
  --map-ink: #2f5f72;
  --sticky-bg: rgba(255, 255, 255, 0.96);
  --shadow-card: rgba(24, 32, 42, 0.08);
  --shadow-panel: rgba(24, 32, 42, 0.16);
  --shadow-sticky: rgba(24, 32, 42, 0.1);
  --focus-ring: rgba(238, 111, 115, 0.18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "Noto Sans Thai", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f4f7fb;
  --muted: #a9b4c2;
  --line: #3a4656;
  --panel: #1f2937;
  --surface: #111827;
  --input-bg: #111827;
  --card-bg: #1f2937;
  --card-hover-bg: #253244;
  --card-hover-line: #68505a;
  --accent: #f07b82;
  --accent-dark: #ff9ca1;
  --accent-soft: #3b2530;
  --accent-soft-hover: #4b2d39;
  --ok: #82dda0;
  --ok-bg: #173625;
  --ok-border: #356b49;
  --warning: #f6d37a;
  --warning-bg: #3a3020;
  --warning-border: #715d2d;
  --danger: #ffb4ad;
  --danger-bg: #3a2024;
  --danger-border: #8a4a4c;
  --info: #9dc8ff;
  --info-bg: #17283d;
  --info-border: #345b86;
  --map-water: #1b3243;
  --map-land: #172d2d;
  --map-road: #344457;
  --map-road-shadow: #0b1724;
  --map-ink: #b3d8e5;
  --sticky-bg: rgba(31, 41, 55, 0.96);
  --shadow-card: rgba(0, 0, 0, 0.28);
  --shadow-panel: rgba(0, 0, 0, 0.42);
  --shadow-sticky: rgba(0, 0, 0, 0.28);
  --focus-ring: rgba(240, 123, 130, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface);
  color: var(--ink);
}

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

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 750;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, opacity 160ms ease;
}

a.button-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 14px;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

button:active {
  transform: translateY(1px);
}

.secondary {
  background: var(--accent-soft);
  color: var(--ink);
}

.secondary:hover {
  background: var(--accent-soft-hover);
}

.app-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
}

.login-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 28px;
  box-shadow: 0 18px 40px var(--shadow-card);
}

.login-brand {
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
}

.login-brand img {
  width: min(250px, 82%);
  height: auto;
  display: block;
}

.login-status {
  min-height: 22px;
  text-align: center;
}

.superapp-shell {
  display: grid;
  align-content: start;
  gap: 22px;
}

.superapp-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 22px;
  box-shadow: 0 14px 30px var(--shadow-card);
}

.superapp-hero h2 {
  font-size: clamp(1.35rem, 2.3vw, 2rem);
}

.app-tile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.app-tile {
  position: relative;
  min-height: 230px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--ink);
  padding: 18px;
  text-decoration: none;
  box-shadow: 0 14px 30px var(--shadow-card);
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.app-tile.is-active:hover {
  border-color: var(--card-hover-line);
  background: var(--card-hover-bg);
  transform: translateY(-2px);
}

.app-tile.is-inactive {
  opacity: 0.68;
}

.app-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.app-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-status {
  position: absolute;
  top: 18px;
  right: 18px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.76rem;
  font-weight: 900;
}

.app-status.is-live {
  background: var(--ok-bg);
  color: var(--ok);
}

.app-status.is-muted {
  background: var(--accent-soft);
  color: var(--muted);
}

.app-tile strong {
  align-self: end;
  font-size: 1.05rem;
}

.app-tile span:last-child {
  color: var(--muted);
  font-weight: 760;
  line-height: 1.45;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-lockup img {
  width: 160px;
  max-width: 34vw;
  height: auto;
  display: block;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.35rem, 2.3vw, 2.1rem);
}

h2 {
  font-size: 1.08rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.sync-chip,
.total-pill,
.user-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 8px 12px;
  min-height: 34px;
  line-height: 1;
  font-weight: 850;
  white-space: nowrap;
  flex: 0 0 auto;
}

.user-chip {
  color: var(--ink);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sync-chip.is-live {
  background: var(--ok-bg);
  color: var(--ok);
}

.sync-chip.is-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.theme-toggle {
  width: 40px;
  min-width: 40px;
  padding: 0;
  display: grid;
  place-items: center;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.calculator-launch svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-launch {
  position: relative;
}

.notification-launch svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-launch.has-unread {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--panel);
  border-radius: 999px;
  background: var(--danger);
  color: #ffffff;
  padding: 0 5px;
  font-size: 0.7rem;
  font-weight: 950;
  line-height: 1;
}

.notification-panel {
  position: fixed;
  z-index: 1002;
  max-height: min(520px, calc(100vh - 24px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 12px;
}

.notification-panel.is-hidden {
  display: none;
}

.notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.notification-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.notification-refresh,
.notification-clear {
  min-height: 34px;
  padding: 0 12px;
}

.notification-clear {
  min-width: 96px;
}

.notification-refresh {
  min-width: 82px;
}

.notification-clear:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.notification-list {
  min-height: 90px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  padding-top: 10px;
}

.notification-item {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 10px;
}

.notification-item.is-unread {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.notification-item-head,
.notification-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notification-item-head strong {
  min-width: 0;
  flex: 1 1 auto;
  color: var(--ink);
  font-size: 0.92rem;
}

.notification-item-head span,
.notification-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.notification-delete {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
}

.notification-delete:hover,
.notification-delete:focus-visible {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger);
}

.notification-item p {
  margin: 0;
  color: var(--ink);
  font-weight: 850;
}

.admin-link-button {
  min-width: 78px;
  padding: 0 14px;
}

.logout-button {
  min-width: 112px;
  padding: 0 14px;
}

[data-theme="dark"] .theme-toggle {
  background: #263449;
  color: #f7d774;
}

.floating-calculator {
  position: fixed;
  z-index: 1000;
  top: 86px;
  right: 24px;
  width: min(330px, calc(100vw - 28px));
  height: auto;
  min-width: 280px;
  min-height: 430px;
  max-width: calc(100vw - 20px);
  max-height: calc(100vh - 20px);
  overflow: auto;
  resize: both;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 96%, white 4%);
  box-shadow: var(--shadow);
  padding: 12px;
}

.floating-calculator.is-hidden {
  display: none;
}

.calculator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: grab;
  user-select: none;
  margin-bottom: 12px;
}

.floating-calculator.is-dragging .calculator-header {
  cursor: grabbing;
}

.calculator-close {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
}

.calculator-display {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 12px;
  margin-bottom: 12px;
}

.calculator-expression {
  display: block;
  min-height: 22px;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.calculator-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.calculator-result {
  min-width: 0;
  color: var(--ink);
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.calculator-copy {
  width: 38px;
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  overflow: hidden;
  transition: width 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease;
}

.calculator-copy svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.calculator-copy span {
  width: 0;
  opacity: 0;
  white-space: nowrap;
  transition: width 180ms ease, opacity 180ms ease;
}

.calculator-copy:hover,
.calculator-copy.is-copied {
  width: 118px;
  background: var(--accent);
  color: white;
  transform: translateY(-1px);
}

.calculator-copy:hover span,
.calculator-copy.is-copied span {
  width: auto;
  opacity: 1;
}

.calculator-copy.is-copied {
  background: var(--ok);
}

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

.calculator-keys button {
  min-width: 0;
  min-height: 46px;
  padding: 0;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 850;
}

.calculator-keys .operator {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.calculator-keys .equals {
  background: var(--accent);
  color: white;
}

.calculator-keys .wide {
  grid-column: span 2;
}

.view-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.order-app-shell .view-tabs {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.tab-button {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  box-shadow: 0 8px 18px var(--shadow-card);
}

.tab-button:hover,
.tab-button.is-active {
  border-color: var(--card-hover-line);
  background: var(--accent-soft);
  color: var(--ink);
}

.view-panel {
  display: none;
}

.view-panel.is-active {
  display: block;
}

.tracking-grid,
.schedule-layout,
.maintenance-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 18px;
  align-items: start;
}

.schedule-layout,
.maintenance-layout {
  grid-template-columns: 420px minmax(0, 1fr);
}

.map-panel,
.fleet-panel,
.entry-panel,
.calendar-panel,
.maintenance-panel,
.completed-panel,
.ranking-panel,
.driver-detail-panel,
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 30px var(--shadow-card);
}

.map-toolbar,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fillings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.fillings-header > div {
  min-width: 0;
}

.fillings-header .total-pill {
  align-self: flex-start;
}

.map-toolbar {
  padding: 18px 18px 0;
}

.map-toolbar button {
  min-width: 96px;
}

.map-canvas {
  position: relative;
  height: min(62vh, 610px);
  min-height: 420px;
  margin: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--map-land);
}

.fallback-map {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, var(--map-water) 0 13%, transparent 13.3%),
    radial-gradient(circle at 88% 76%, var(--map-water) 0 16%, transparent 16.3%),
    linear-gradient(135deg, transparent 0 45%, rgba(255, 255, 255, 0.22) 45.2% 46%, transparent 46.2%),
    var(--map-land);
}

.map-road {
  position: absolute;
  left: -10%;
  width: 120%;
  height: 16px;
  border-radius: 999px;
  background: var(--map-road);
  box-shadow: 0 0 0 1px var(--map-road-shadow);
}

.road-a {
  top: 42%;
  transform: rotate(12deg);
}

.road-b {
  top: 58%;
  transform: rotate(-28deg);
}

.road-c {
  top: 24%;
  transform: rotate(-8deg);
}

.map-zone {
  position: absolute;
  border: 1px solid var(--info-border);
  border-radius: 999px;
  background: var(--info-bg);
  color: var(--map-ink);
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 850;
}

.zone-office {
  left: 9%;
  top: 68%;
}

.zone-market {
  right: 11%;
  top: 19%;
}

.zone-warehouse {
  left: 39%;
  top: 47%;
}

.vehicle-marker {
  position: absolute;
  display: grid;
  gap: 4px;
  justify-items: center;
  transform: translate(-50%, -50%);
}

.vehicle-dot {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 3px solid #ffffff;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: 0 10px 24px var(--shadow-panel);
}

.vehicle-label {
  max-width: 120px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 5px 8px;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 850;
  text-align: center;
  box-shadow: 0 8px 18px var(--shadow-card);
}

.fleet-panel,
.entry-panel,
.calendar-panel,
.maintenance-panel,
.completed-panel,
.ranking-panel {
  padding: 18px;
}

.completed-panel,
.driver-detail-panel {
  margin-top: 18px;
}

.overview-panel {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 14px 30px var(--shadow-card);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.overview-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 12px;
}

.overview-card.is-warning {
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

.overview-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.fleet-list,
.maintenance-list,
.ranking-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.fleet-card,
.maintenance-card,
.ranking-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 14px;
}

.fleet-card {
  display: grid;
  gap: 10px;
}

.fleet-card:hover {
  border-color: var(--card-hover-line);
  background: var(--card-hover-bg);
}

.card-title-line,
.card-meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.car-identity {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.fleet-number-badge {
  width: 36px;
  height: 36px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  border: 2px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.86rem;
  font-weight: 950;
}

.license-plate {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  padding: 4px 10px;
  font-weight: 900;
}

.status-badge {
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 0.78rem;
  font-weight: 900;
}

.status-badge.running,
.status-badge.done {
  background: var(--ok-bg);
  color: var(--ok);
}

.status-badge.idle,
.status-badge.scheduled,
.status-badge.planned {
  background: var(--info-bg);
  color: var(--info);
}

.status-badge.none {
  background: var(--panel);
  color: var(--muted);
}

.status-badge.maintenance,
.status-badge.open,
.status-badge.high {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-badge.medium {
  background: var(--warning-bg);
  color: var(--warning);
}

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

.meta-grid span,
.price-strip span {
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--muted);
  padding: 9px 10px;
  font-size: 0.84rem;
  font-weight: 800;
}

.meta-grid strong,
.price-strip strong {
  color: var(--ink);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 850;
}

.toggle-line input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.helper-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 780;
  line-height: 1.55;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--ink);
  padding: 0 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid var(--focus-ring);
}

textarea {
  padding-top: 12px;
  resize: vertical;
}

.quantity-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.quantity-field {
  min-width: 0;
}

.quantity-inputs span {
  color: var(--muted);
  font-weight: 850;
}

.delivery-mode-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 8px;
}

.delivery-mode-control label {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--ink);
  cursor: pointer;
}

.delivery-mode-control input {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

.branch-delivery-fields {
  display: grid;
  gap: 12px;
}

.snack-delivery-fields {
  display: grid;
  gap: 14px;
}

.branch-destination-summary {
  min-height: 88px;
}

.customer-contact-fields {
  display: grid;
  gap: 12px;
}

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

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

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

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

.destination-search-field {
  position: relative;
  display: block;
}

.destination-search-field input {
  width: 100%;
  padding-right: 52px;
}

.embedded-icon-button {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 36px;
  min-height: 36px;
  height: 36px;
  transform: translateY(-50%);
  border-radius: 6px;
  padding: 0;
}

.embedded-icon-button.is-static {
  display: grid;
  place-items: center;
  pointer-events: none;
}

.embedded-icon-button svg,
.map-action-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quote-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 12px;
}

.locked-origin,
.destination-summary {
  display: grid;
  gap: 3px;
  min-width: 0;
  border-radius: 8px;
  padding: 10px 12px;
}

.locked-origin {
  background: var(--accent-soft);
}

.destination-summary {
  border: 1px solid var(--ok-border);
  background: var(--ok-bg);
}

.locked-origin span,
.locked-origin small,
.destination-summary span,
.destination-summary small,
.powered-by span:last-child,
.quote-result > div > span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.locked-origin strong,
.destination-summary strong {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--ink);
}

.destination-summary small {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.destination-summary small:last-child {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.quote-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.map-action-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.destination-map {
  display: grid;
  min-height: 210px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--map-land);
  color: var(--map-ink);
  font-weight: 850;
  text-align: center;
}

.destination-map.is-active {
  display: block;
}

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

.quote-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.quote-result > div {
  display: grid;
  gap: 4px;
}

.quote-result strong {
  font-size: 1.24rem;
}

.powered-by {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.lalamove-logo {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 6px;
  background: #ff671f;
  color: #ffffff;
  padding: 2px 8px;
  font-weight: 950;
}

.manual-price-toggle {
  width: auto;
  min-width: 150px;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
}

.manual-price-toggle input {
  width: 18px;
  height: 18px;
}

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

.actions {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: grid;
  gap: 10px;
  margin: 0 -18px -18px;
  border-top: 1px solid var(--line);
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: var(--sticky-bg);
  box-shadow: 0 -14px 30px var(--shadow-sticky);
  backdrop-filter: blur(10px);
}

.action-buttons {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 12px;
}

.action-buttons.single {
  grid-template-columns: 1fr;
}

.status-line {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.status-line.is-ok {
  color: var(--ok);
}

.status-line.is-error {
  color: var(--danger);
}

.order-lookup-line {
  min-height: 20px;
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.order-lookup-line.is-ok {
  color: var(--ok);
}

.order-lookup-line.is-error {
  color: var(--danger);
}

.order-lookup-line.is-warning {
  color: var(--warning);
}

.leave-assignment-warning {
  min-height: 34px;
  display: flex;
  align-items: center;
  border: 1px solid var(--warning-border);
  border-radius: 8px;
  background: var(--warning-bg);
  color: var(--warning);
  padding: 8px 10px;
  font-size: 0.84rem;
  font-weight: 850;
}

.calendar-date {
  max-width: 170px;
}

.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.icon-only-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
  display: grid;
  place-items: center;
}

.icon-only-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-only-button.is-active {
  background: var(--accent);
  color: #ffffff;
}

.timetable {
  --driver-column-width: 148px;
  --hour-width: 72px;
  --timeline-width: calc(var(--hour-width) * 24);
  --vertical-hour-height: 48px;
  --vertical-timeline-height: calc(var(--vertical-hour-height) * 24);
  display: grid;
  gap: 10px;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-padding-left: var(--driver-column-width);
}

.driver-row {
  display: grid;
  grid-template-columns: var(--driver-column-width) minmax(var(--timeline-width), 1fr);
  gap: 12px;
  align-items: stretch;
  min-width: calc(var(--driver-column-width) + 12px + var(--timeline-width));
}

.driver-name {
  position: sticky;
  left: 0;
  z-index: 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 12px;
  font-weight: 900;
}

.driver-name span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.timeline-track {
  position: relative;
  min-width: var(--timeline-width);
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / calc(100% / 24) 100%,
    var(--card-bg);
}

.timeline-track.has-blocked-time {
  min-height: calc(74px + (var(--blocked-count) * 32px));
}

.timeline-track.has-blocked-time .delivery-block {
  top: calc(10px + (var(--blocked-count) * 32px));
}

.time-labels {
  display: grid;
  grid-template-columns: var(--driver-column-width) minmax(var(--timeline-width), 1fr);
  gap: 12px;
  align-items: end;
  min-width: calc(var(--driver-column-width) + 12px + var(--timeline-width));
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.timeline-corner {
  position: sticky;
  left: 0;
  z-index: 4;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 8px 10px;
}

.time-scale {
  position: relative;
  min-width: var(--timeline-width);
  height: 34px;
  border-bottom: 1px solid var(--line);
}

.time-tick {
  position: absolute;
  left: var(--tick-left);
  bottom: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.time-tick::before {
  content: "";
  display: block;
  width: 1px;
  height: 8px;
  margin: 0 auto 4px;
  background: var(--line);
}

.time-tick.is-edge-start {
  transform: none;
}

.time-tick.is-edge-start::before {
  margin-left: 0;
}

.time-tick.is-edge-end {
  transform: translateX(-100%);
}

.time-tick.is-edge-end::before {
  margin-right: 0;
}

.delivery-block {
  position: absolute;
  left: var(--block-left);
  width: var(--block-width);
  top: 10px;
  min-width: 70px;
  height: 52px;
  overflow: hidden;
  border: 1px solid var(--card-hover-line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: #ffffff;
  padding: 7px 9px;
  font-size: 0.78rem;
  font-weight: 850;
  text-align: left;
  box-shadow: 0 8px 18px var(--shadow-card);
  cursor: grab;
  touch-action: none;
}

.delivery-block:hover {
  filter: brightness(0.96);
}

.delivery-block:active {
  cursor: grabbing;
}

.delivery-block.has-leave-warning {
  box-shadow: inset 0 0 0 2px rgba(150, 99, 10, 0.5), 0 8px 18px var(--shadow-card);
}

.leave-warning-chip {
  position: absolute;
  right: 17px;
  bottom: 4px;
  border-radius: 999px;
  background: var(--warning-bg);
  color: var(--warning);
  padding: 2px 6px;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 950;
}

.delivery-block.is-delivered {
  display: grid;
  place-content: center;
  gap: 2px;
  border-color: #aab2bd;
  background: #7d8794;
  color: #ffffff;
  text-align: center;
  cursor: pointer;
  filter: grayscale(0.18);
}

.delivery-block.is-delivered strong {
  font-size: 0.9rem;
}

:root[data-theme="dark"] .delivery-block.is-delivered {
  border-color: #5c6674;
  background: #4b5563;
}

.leave-timeline-block {
  position: absolute;
  top: calc(10px + (var(--block-index) * 32px));
  left: 0.7%;
  right: 0.7%;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #aab2bd;
  border-radius: 8px;
  background: #e5e7eb;
  color: #4b5563;
  font-size: 0.78rem;
  font-weight: 900;
  pointer-events: none;
}

.maintenance-timeline-block {
  position: absolute;
  top: calc(10px + (var(--block-index) * 32px));
  left: 0.7%;
  right: 0.7%;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #aab2bd;
  border-radius: 8px;
  background: #e5e7eb;
  color: #4b5563;
  font-size: 0.78rem;
  font-weight: 900;
  pointer-events: none;
}

:root[data-theme="dark"] .leave-timeline-block {
  border-color: #5c6674;
  background: #374151;
  color: #d1d5db;
}

:root[data-theme="dark"] .maintenance-timeline-block {
  border-color: #5c6674;
  background: #374151;
  color: #d1d5db;
}

.timetable.is-vertical {
  --timeline-width: 100%;
  --driver-column-width: 220px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  overflow-x: auto;
}

.timetable.is-vertical .time-labels,
.timetable.is-vertical .driver-row {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 58px var(--vertical-timeline-height);
  gap: 10px;
  align-items: stretch;
  min-width: var(--driver-column-width);
}

.timetable.is-vertical .time-labels {
  --driver-column-width: 86px;
  min-width: 86px;
}

.timetable.is-vertical .timeline-corner,
.timetable.is-vertical .driver-name {
  position: sticky;
  top: 0;
  left: auto;
  z-index: 5;
  min-height: 58px;
}

.timetable.is-vertical .time-scale {
  height: var(--vertical-timeline-height);
  min-width: 86px;
  border-bottom: 0;
  border-left: 1px solid var(--line);
}

.timetable.is-vertical .time-tick {
  left: 0;
  top: var(--tick-top);
  bottom: auto;
  transform: translateY(-50%);
}

.timetable.is-vertical .time-tick::before {
  display: inline-block;
  width: 8px;
  height: 1px;
  margin: 0 6px 0 0;
  vertical-align: middle;
}

.timetable.is-vertical .timeline-track {
  min-width: var(--driver-column-width);
  min-height: var(--vertical-timeline-height);
  background:
    linear-gradient(180deg, var(--line) 1px, transparent 1px) 0 0 / 100% calc(100% / 24),
    var(--card-bg);
}

.timetable.is-vertical .timeline-track.has-blocked-time {
  min-height: var(--vertical-timeline-height);
}

.timetable.is-vertical .delivery-block,
.timetable.is-vertical .timeline-track.has-blocked-time .delivery-block {
  left: var(--blocked-offset, 10px);
  right: 10px;
  width: auto;
  top: var(--block-top);
  height: var(--block-height);
  min-height: 42px;
  min-width: 0;
}

.timetable.is-vertical .delivery-resize-handle {
  left: 0;
  right: 0;
  width: auto;
  height: 12px;
  cursor: ns-resize;
}

.timetable.is-vertical .delivery-resize-handle.left {
  top: 0;
  bottom: auto;
}

.timetable.is-vertical .delivery-resize-handle.right {
  top: auto;
  bottom: 0;
}

.timetable.is-vertical .leave-timeline-block,
.timetable.is-vertical .maintenance-timeline-block {
  left: calc(10px + (var(--block-index) * 64px));
  right: auto;
  top: 0.7%;
  bottom: 0.7%;
  width: 56px;
  height: auto;
  flex-direction: column;
  text-align: center;
}

.delivery-resize-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 12px;
  background: rgba(255, 255, 255, 0.32);
  cursor: ew-resize;
}

.delivery-resize-handle.left {
  left: 0;
}

.delivery-resize-handle.right {
  right: 0;
}

.delivery-block strong,
.delivery-block span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.maintenance-card {
  display: grid;
  gap: 10px;
  width: 100%;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.maintenance-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.maintenance-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.maintenance-card.is-completed {
  opacity: 0.78;
}

.leave-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 14px;
}

.leave-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.leave-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.icon-button.small {
  min-height: 36px;
  padding: 0 12px;
}

.maintenance-toolbar {
  margin-top: 14px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.pagination-controls button {
  min-width: 94px;
  min-height: 38px;
}

.pagination-controls span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  display: grid;
  gap: 6px;
  padding: 18px;
}

.stat-card span {
  color: var(--muted);
  font-weight: 850;
}

.stat-card strong {
  font-size: 1.55rem;
}

.ranking-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(120px, 220px);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.ranking-row:hover {
  border-color: var(--card-hover-line);
  background: var(--card-hover-bg);
}

.rank-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
}

.rank-copy strong,
.rank-copy span {
  display: block;
}

.rank-copy span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.rank-bar {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--accent-soft);
}

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

.analytics-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.range-label {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(4, minmax(82px, 1fr));
  gap: 8px;
}

.segmented-control button {
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
}

.segmented-control button.is-active,
.segmented-control button:hover {
  border-color: var(--card-hover-line);
  background: var(--accent-soft);
  color: var(--ink);
}

.driver-detail-panel {
  padding: 18px;
}

.driver-insight-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.driver-job-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.driver-job-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 12px;
}

.driver-job-card span,
.empty-line {
  color: var(--muted);
  font-weight: 750;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.46);
  padding: 18px;
}

.modal-panel {
  width: min(780px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  overflow-y: auto;
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 22px 60px var(--shadow-panel);
}

.modal-close-button {
  min-width: 72px;
}

.modal-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
}

.modal-actions.three {
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr) minmax(0, 1fr);
}

.modal-panel.is-readonly input,
.modal-panel.is-readonly select {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--ink);
}

.delivery-proof-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 14px;
}

.delivery-proof-panel img {
  width: 100%;
  max-height: 460px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

input[readonly] {
  background: var(--accent-soft);
  color: var(--muted);
}

.order-app-shell {
  display: grid;
  align-content: start;
  gap: 18px;
}

.order-view-panel {
  display: none;
}

.order-view-panel.is-active {
  display: block;
}

.order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.order-entry-panel {
  min-width: 0;
}

.panel-header.compact {
  margin-bottom: 4px;
}

.order-box-panel,
.price-control-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 14px;
}

.price-control-panel {
  grid-template-columns: minmax(180px, 0.75fr) minmax(180px, 1fr);
  align-items: end;
}

.compact-box-panel {
  margin-top: 12px;
}

.snack-set-list {
  display: grid;
  gap: 12px;
}

.snack-set-builder {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  border: 2px dashed color-mix(in srgb, var(--warning) 46%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--warning-bg) 72%, var(--panel));
  padding: 14px;
}

.snack-set-add-panel {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warning-bg) 55%, transparent);
}

.snack-set-editor-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  border: 2px solid color-mix(in srgb, var(--warning) 56%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--warning-bg) 52%, var(--panel));
  padding: 14px;
}

.snack-subheader {
  display: grid;
  gap: 3px;
  border-bottom: 1px solid color-mix(in srgb, var(--warning) 30%, var(--line));
  padding-bottom: 10px;
}

.snack-subheader span {
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 950;
}

.snack-subheader small {
  color: var(--muted);
  font-weight: 800;
}

.snack-set-add-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 110px minmax(170px, 0.7fr);
  gap: 12px;
  align-items: end;
}

.snack-set-card {
  display: grid;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--warning) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, white);
  padding: 14px;
  box-shadow: 0 8px 18px var(--shadow-card);
}

.snack-set-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.snack-set-main h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  letter-spacing: 0;
}

.snack-set-main span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 780;
}

.snack-set-main strong {
  white-space: nowrap;
  color: var(--accent-dark);
  font-size: 1.05rem;
}

.snack-set-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.snack-set-actions .icon-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.35rem;
  line-height: 1;
}

.snack-set-controls {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.set-random-toggle,
.set-no-filling {
  min-height: 46px;
  display: flex;
  align-items: center;
}

.set-no-filling {
  color: var(--muted);
  font-weight: 850;
}

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

.set-filling-slots.is-disabled {
  opacity: 0.58;
}

.full-width {
  width: 100%;
}

.order-filling-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.order-filling-card {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) 82px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 10px;
}

.order-filling-card span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.order-filling-card strong {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-filling-card small {
  color: var(--muted);
  font-weight: 800;
}

.order-filling-card input {
  min-height: 40px;
  padding: 0 8px;
  text-align: center;
  font-weight: 900;
}

.order-preview-panel {
  display: block;
  position: sticky;
  top: 18px;
  min-height: 0;
  padding: 0;
  background: transparent;
  overflow: visible;
}

.order-preview-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 14px 30px var(--shadow-card);
}

.order-preview-card h2 {
  font-size: 1.35rem;
}

.preview-customer {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.preview-customer strong {
  font-size: 1.05rem;
}

.preview-customer span,
.preview-section > span {
  color: var(--muted);
  font-weight: 820;
}

.preview-section {
  display: grid;
  gap: 8px;
}

.preview-list {
  display: grid;
  gap: 7px;
}

.preview-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 6px;
  background: var(--accent-soft);
  padding: 8px 10px;
  font-weight: 840;
}

.preview-line.is-stacked span {
  display: grid;
  gap: 3px;
}

.preview-line small {
  color: var(--muted);
  font-weight: 800;
}

.preview-line strong {
  white-space: nowrap;
}

.price-summary {
  display: grid;
  gap: 8px;
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.price-summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.price-summary dt {
  color: var(--muted);
  font-weight: 820;
}

.price-summary dd {
  margin: 0;
  font-weight: 950;
}

.price-summary .is-final {
  border-radius: 8px;
  background: var(--ok-bg);
  color: var(--ok);
  padding: 10px 12px;
}

.price-summary .is-final dt {
  color: inherit;
}

.order-history-panel {
  margin-top: 0;
}

.order-list {
  display: grid;
  gap: 12px;
}

.order-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 14px;
}

.order-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.order-card header > div {
  min-width: 0;
}

.order-card h2 {
  margin: 0;
}

.order-id-copy-group {
  width: fit-content;
  max-width: 100%;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  padding: 4px 5px 4px 0;
  font: inherit;
  font-weight: 950;
  text-align: left;
  cursor: pointer;
  transition: padding 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.order-id-copy-group:hover,
.order-id-copy-group:focus-visible,
.order-id-copy-group.is-copied {
  border-color: var(--line);
  background: var(--accent-soft);
  padding-left: 12px;
  box-shadow: 0 8px 18px var(--shadow-card);
}

.order-id-copy-group.is-copied {
  border-color: var(--ok-border);
  background: var(--ok-bg);
  animation: orderCopiedPulse 520ms ease;
}

.order-number-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-copy-icon {
  width: 32px;
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--accent);
  overflow: hidden;
  white-space: nowrap;
  transition: width 180ms ease, background 180ms ease, color 180ms ease;
}

.order-id-copy-group:hover .order-copy-icon,
.order-id-copy-group:focus-visible .order-copy-icon,
.order-id-copy-group.is-copied .order-copy-icon {
  width: 88px;
  background: var(--accent);
  color: #ffffff;
}

.order-id-copy-group.is-copied .order-copy-icon {
  width: 112px;
  background: var(--ok);
}

.order-copy-icon svg {
  width: 17px;
  height: 17px;
  min-width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.order-copy-icon span {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  font-size: 0.78rem;
  font-weight: 950;
  transition: max-width 180ms ease, opacity 180ms ease;
}

.order-id-copy-group:hover .order-copy-icon span,
.order-id-copy-group:focus-visible .order-copy-icon span,
.order-id-copy-group.is-copied .order-copy-icon span {
  max-width: 76px;
  opacity: 1;
}

@keyframes orderCopiedPulse {
  0% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.035);
  }

  100% {
    transform: scale(1);
  }
}

.order-card-total {
  display: flex;
  align-items: center;
  justify-content: end;
  flex-wrap: wrap;
  gap: 8px;
  text-align: right;
}

.order-card-total strong {
  white-space: nowrap;
}

.order-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 780;
}

.order-delivery-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.order-card-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 48px;
  gap: 8px;
}

.order-card-actions .is-copied {
  border-color: var(--ok-border);
  background: var(--ok-bg);
  color: var(--ok);
  animation: orderCopiedPulse 520ms ease;
}

.order-history-search {
  display: block;
}

.order-history-filters {
  display: grid;
  gap: 10px;
  margin: 12px 0 14px;
}

.order-filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 10px;
}

.order-filter-group > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
  margin-right: 4px;
}

.order-filter-group button {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 0.86rem;
}

.order-filter-group button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.public-order-shell {
  max-width: 980px;
}

.public-order-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 16px 36px var(--shadow-panel);
}

.public-order-hero {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.public-order-hero h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

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

.public-order-section {
  display: grid;
  min-width: 0;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 12px;
}

.public-order-section > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.public-order-section > strong {
  color: var(--ink);
  font-size: 1.04rem;
}

.public-order-section p {
  margin: 0;
  color: var(--muted);
  font-weight: 780;
}

.public-order-section a {
  color: var(--accent);
  font-weight: 900;
}

.payment-warning {
  border: 1px solid var(--warning-border);
  border-radius: 8px;
  background: var(--warning-bg);
  color: var(--warning);
  padding: 10px 12px;
  margin: 0;
  font-weight: 900;
}

.delivery-prompt-copy {
  margin: 0;
  border: 1px solid var(--info-border);
  border-radius: 8px;
  background: var(--info-bg);
  color: var(--info);
  padding: 12px;
  font-weight: 850;
}

.delivery-prompt-copy strong {
  color: inherit;
  font-weight: 950;
}

.order-delivery-fee-panel .quote-result.compact {
  align-items: center;
}

.public-order-contact {
  display: grid;
  gap: 6px;
  border: 1px solid var(--info-border);
  border-radius: 8px;
  background: var(--info-bg);
  color: var(--info);
  padding: 12px;
}

.public-order-contact span {
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.public-order-contact p {
  margin: 0;
  font-weight: 850;
}

.order-404-card {
  margin-top: clamp(12px, 3vw, 28px);
}

.order-404-hero h2 {
  max-width: 12ch;
  line-height: 1.08;
}

.order-expand-button {
  justify-content: center;
}

.order-expand-icon {
  display: inline-block;
  min-width: 1em;
}

.order-detail-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.order-detail-section {
  display: grid;
  gap: 8px;
}

.order-detail-section > strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.order-detail-list {
  display: grid;
  gap: 6px;
}

.order-detail-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-radius: 6px;
  background: var(--accent-soft);
  padding: 8px 10px;
  font-weight: 820;
}

.order-detail-line span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.order-detail-line small {
  color: var(--muted);
  font-weight: 780;
}

.order-detail-line strong {
  white-space: nowrap;
}

.order-content-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.order-content-tags span {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 7px 10px;
  font-weight: 850;
}

.snack-admin-panel {
  max-width: 980px;
  margin: 0 auto;
}

.snack-admin-list {
  display: grid;
  gap: 12px;
}

.snack-admin-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 160px) 110px 70px;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 12px;
}

.snack-active-toggle {
  min-height: 46px;
  align-items: center;
  justify-content: center;
}

.admin-shell {
  padding-bottom: 96px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(280px, 1fr) minmax(0, 1.8fr);
  gap: 18px;
  align-items: start;
}

.admin-editor-panel {
  max-height: calc(100vh - 180px);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.admin-list {
  min-height: 0;
  max-height: inherit;
  display: grid;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 10px;
  align-items: end;
}

.admin-driver-row {
  grid-template-columns: minmax(130px, 1fr) minmax(120px, 0.8fr) 58px;
}

.admin-car-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 14px;
}

.admin-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.admin-card-actions .license-plate {
  min-width: 140px;
}

.admin-save-bar {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 18px;
  z-index: 40;
  width: min(1392px, calc(100% - 48px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sticky-bg);
  padding: 12px 14px;
  box-shadow: 0 -14px 30px var(--shadow-sticky);
  backdrop-filter: blur(10px);
}

.admin-save-bar button {
  min-width: 148px;
}

.admin-ops-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  margin-top: 18px;
  margin-bottom: 112px;
}

.superapp-admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 112px;
}

.superapp-control-panel,
.maintenance-break-card {
  gap: 16px;
}

.maintenance-toggle {
  border: 1px solid var(--warning-border);
  border-radius: 8px;
  background: var(--warning-bg);
  color: var(--warning);
  padding: 14px;
}

.superapp-toggle-list {
  display: grid;
  gap: 12px;
}

.superapp-toggle-row {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 14px;
}

.superapp-toggle-row.is-disabled {
  opacity: 0.62;
}

.superapp-toggle-row p,
.maintenance-copy {
  margin: 0;
  color: var(--muted);
  font-weight: 780;
  line-height: 1.55;
}

.maintenance-symbol {
  width: 92px;
  height: 92px;
  justify-self: center;
  display: grid;
  place-items: center;
  color: var(--warning);
}

.maintenance-symbol i {
  animation: maintenanceGearSpin 2.8s linear infinite;
  font-size: 4.4rem;
  line-height: 1;
}

@keyframes maintenanceGearSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.audit-list {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}

.storage-list {
  display: grid;
  gap: 12px;
}

.storage-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 12px;
}

.storage-card.is-missing {
  border-color: var(--danger-border);
  background: var(--danger-bg);
}

.storage-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.storage-meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--accent-soft);
}

.storage-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.audit-row {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  padding: 10px 12px;
}

.audit-row span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.is-hidden {
  display: none !important;
}

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

  .order-layout {
    grid-template-columns: 1fr;
  }

  .order-preview-panel {
    position: static;
    order: -1;
  }

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

  .snack-set-add-controls,
  .snack-set-controls,
  .set-filling-slots {
    grid-template-columns: 1fr;
  }

  .tracking-grid,
  .schedule-layout,
  .maintenance-layout {
    grid-template-columns: 1fr;
  }

  .fleet-panel {
    order: -1;
  }

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

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

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

  .superapp-admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-ops-grid {
    grid-template-columns: 1fr;
  }

  .admin-editor-panel {
    max-height: none;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-lockup {
    width: 100%;
    align-items: flex-start;
  }

  .brand-lockup img {
    width: 116px;
    max-width: 34vw;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .superapp-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-tile-grid {
    grid-template-columns: 1fr;
  }

  .app-tile {
    min-height: 190px;
  }

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

  .tab-button {
    min-height: 42px;
    padding: 0 8px;
  }

  .map-canvas {
    height: 390px;
    min-height: 390px;
    margin: 14px;
  }

  .map-toolbar,
  .panel-header,
  .fillings-header,
  .maintenance-card header {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-toolbar button,
  .calendar-date {
    width: 100%;
    max-width: none;
  }

  .calendar-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 42px 42px minmax(0, 1fr) 42px;
  }

  .field-row,
  .field-row.three,
  .field-row.four,
  .delivery-mode-control,
  .price-control-panel,
  .price-strip,
  .quote-actions,
  .coord-line,
  .analytics-grid,
  .driver-insight-grid,
  .segmented-control {
    grid-template-columns: 1fr;
  }

  .quote-result {
    align-items: stretch;
    flex-direction: column;
  }

  .manual-price-toggle {
    justify-content: flex-start;
  }

  .analytics-toolbar,
  .modal-actions,
  .modal-actions.three {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .analytics-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .action-buttons {
    grid-template-columns: 1fr;
  }

  .order-filling-grid,
  .snack-set-add-controls,
  .snack-set-controls,
  .set-filling-slots,
  .snack-admin-row {
    grid-template-columns: 1fr;
  }

  .order-card-actions {
    grid-template-columns: 1fr;
  }

  .public-order-hero {
    flex-direction: column;
  }

  .public-order-grid {
    grid-template-columns: 1fr;
  }

  .timetable {
    --driver-column-width: 112px;
    --hour-width: 64px;
  }

  .ranking-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .rank-bar {
    grid-column: 1 / -1;
  }

  .admin-row,
  .admin-driver-row,
  .admin-card-actions,
  .admin-save-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .admin-save-bar {
    left: 14px;
    right: 14px;
    width: calc(100% - 28px);
    flex-direction: column;
  }

  .admin-save-bar button,
  .admin-card-actions .license-plate {
    width: 100%;
  }
}
