:root {
  color-scheme: light;
  --ink: #0b1f3a;
  --text: #26384f;
  --muted: #6f7f91;
  --line: #dfe5ec;
  --surface: #ffffff;
  --canvas: #f4f7fa;
  --blue: #1769e0;
  --blue-soft: #eaf2ff;
  --green: #15944a;
  --green-soft: #eaf8f0;
  --orange: #e87916;
  --orange-soft: #fff3e6;
  --warning: #8a4b08;
  --danger: #b42318;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(22, 42, 72, 0.08);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--text);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.test-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 14px;
  border-bottom: 1px solid #f3d19e;
  background: #fff7e8;
  color: var(--warning);
  font-size: 12px;
  text-align: center;
}
.test-banner strong {
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.login-shell {
  min-height: calc(100svh - 36px);
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, #e7f0ff 0, transparent 38%),
    var(--canvas);
}
.login-card {
  width: min(100%, 400px);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.brand-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
}
.brand-logo-header {
  width: min(68vw, 250px);
  height: auto;
  display: block;
  object-fit: contain;
}
.brand-lockup-login {
  display: grid;
  place-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.brand-logo-login {
  display: block;
  width: min(100%, 310px);
  height: auto;
}
.header-brand {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
}
.login-card h1 {
  margin: 20px 0 8px;
  color: var(--ink);
  font-size: 24px;
}
.login-card > p { color: var(--muted); margin: 0 0 24px; }

label {
  display: grid;
  gap: 8px;
  margin: 0 0 17px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}
input, select {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 105, 224, .13);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 11px;
  font-weight: 800;
  text-decoration: none;
}
.button.primary { background: var(--blue); color: white; }
.button.secondary { background: var(--ink); color: white; }
.button.ghost { background: var(--blue-soft); color: var(--blue); }
.button.danger-outline {
  border: 1px solid #f0b4ae;
  background: #fff;
  color: var(--danger);
}
.button.full { width: 100%; }
.button:active { transform: translateY(1px); }

.app-header {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 10px;
  padding: 10px 14px 12px;
  border-bottom: 1px solid rgba(215, 224, 234, .9);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
}
.header-status {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-height: 20px;
  text-align: center;
}
.header-caption {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.header-clock {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.header-refresh {
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}
.header-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: min(100%, 920px);
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.header-actions .button.ghost { display: inline-flex; }
.navigation-scroll {
  width: min(100%, 1180px);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: #b8c8dc transparent;
}
.navigation-scroll::-webkit-scrollbar { height: 4px; }
.navigation-scroll::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: #b8c8dc;
}
.suo-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: max-content;
  min-width: 100%;
  padding: 10px 2px 3px;
  border-top: 1px solid var(--line);
}
.suo-nav-link,
.suo-nav-account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}
button.suo-nav-link { cursor: pointer; }
.suo-nav-link:hover,
.suo-nav-link:focus-visible {
  border-color: #bdd3f3;
  background: #dceaff;
  outline: none;
}
.suo-nav-link.is-active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 5px 14px rgba(23, 105, 224, .2);
}
.suo-nav-link.nav-primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.suo-nav-link.nav-admin {
  background: #f4f0ff;
  color: #6741b1;
}
.suo-nav-account {
  display: grid;
  gap: 1px;
  min-width: 90px;
  border-color: #d5deea;
  background: #fff;
  color: var(--ink);
  text-align: center;
}
.suo-nav-account span { font-size: 12px; font-weight: 900; }
.suo-nav-account small { color: var(--muted); font-size: 9px; }
.account-button {
  display: grid;
  min-width: 78px;
  padding: 6px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  text-align: right;
}
.account-button span { font-weight: 800; }
.account-button small { color: var(--muted); }

.dashboard {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 18px 14px 44px;
}
.loading-state {
  padding: 60px 20px;
  color: var(--muted);
  text-align: center;
}
.dashboard-grid { display: grid; gap: 14px; }
.card {
  min-width: 0;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(22, 42, 72, .045);
}
.plan-card {
  border-top: 4px solid var(--green);
  background: linear-gradient(145deg, #fff 35%, #f4fbf7 100%);
}
.arrival-card { border-top: 4px solid var(--orange); }
.dispatch-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: -3px 0 17px;
}
.dispatch-overview-item {
  position: relative;
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 13px 14px;
  overflow: hidden;
  border: 1px solid #dce7f5;
  border-radius: 14px;
  background: linear-gradient(145deg, #f7faff, #eef5ff);
}
.dispatch-overview-item::after {
  position: absolute;
  top: -19px;
  right: -17px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(20, 105, 220, .08);
  content: "";
}
.dispatch-overview-item span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}
.dispatch-overview-item strong {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-size: clamp(18px, 6vw, 25px);
  line-height: 1.1;
}
.dispatch-overview-value {
  display: grid;
  gap: 7px;
}
.dispatch-overview-value b {
  display: block;
  overflow: hidden;
  color: inherit;
  font: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dispatch-overview-value em {
  display: block;
  color: var(--blue);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}
.dispatch-overview-item.total {
  border-color: #0b376f;
  background: linear-gradient(145deg, #0b1f3a, #0d4c96);
}
.dispatch-overview-item.total::after { background: rgba(255, 255, 255, .1); }
.dispatch-overview-item.total span,
.dispatch-overview-item.total strong { color: white; }
.dispatch-overview-item.total .dispatch-overview-value em { color: #c6daf4; }
.section-disclosure {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 52px;
  padding: 11px 14px;
  border: 1px solid #cbdffb;
  border-radius: 13px;
  background: linear-gradient(145deg, #f7faff, #eef5ff);
  color: var(--ink);
  text-align: left;
}
.section-disclosure > span {
  display: grid;
  gap: 2px;
}
.section-disclosure strong {
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}
.section-disclosure small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.section-disclosure i {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--blue);
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  transform: rotate(-90deg);
  transition: transform .18s ease;
}
.section-disclosure.is-open i { transform: rotate(0); }
.section-disclosure-content { padding-top: 16px; }
.arrival-disclosure {
  border-color: #f2d7b6;
  background: linear-gradient(145deg, #fffaf4, #fff4e8);
}
.arrival-disclosure strong,
.arrival-disclosure i { color: var(--orange); }
.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h2 { margin: 0; color: var(--ink); font-size: 21px; }
h3 { color: var(--ink); }
.muted { color: var(--muted); font-size: 11px; }
.metric-row, .fact-row, .progress-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.metric-row { padding: 7px 0; color: var(--muted); }
.metric-row strong { color: var(--text); font-size: 18px; }
.plan-details-button {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .18s ease;
}
.plan-details-button:hover,
.plan-details-button:focus-visible { background: rgba(20, 105, 220, .07); }
.plan-details-button small {
  display: block;
  margin-top: 2px;
  color: var(--blue);
  font-size: 9px;
  font-weight: 800;
}
.fact-row {
  margin: 8px -9px;
  padding: 13px 9px;
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--ink);
  font-weight: 900;
}
.fact-row strong { font-size: clamp(32px, 10vw, 46px); }
.progress-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.progress-overview > div:first-child {
  display: grid;
  gap: 3px;
}
.progress-overview span { color: var(--muted); font-size: 11px; font-weight: 700; }
.progress-overview > div:first-child strong { color: var(--ink); font-size: 20px; }
.progress-percent-badge {
  display: grid;
  min-width: 92px;
  padding: 9px 12px;
  border-radius: 14px;
  background: var(--green-soft);
  text-align: right;
}
.progress-percent-badge small {
  color: var(--green);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.progress-percent-badge strong {
  color: var(--green);
  font-size: 28px;
  line-height: 1;
}
.progress-track {
  display: flex;
  height: 20px;
  margin: 12px 0 11px;
  overflow: hidden;
  border: 1px solid rgba(11, 31, 58, .08);
  border-radius: 99px;
  background: #e9eef4;
  box-shadow: inset 0 1px 2px rgba(11, 31, 58, .08);
}
.progress-segment {
  width: 0;
  height: 100%;
  transition: width .3s ease;
}
.progress-done { background: linear-gradient(90deg, #15964c, #38b866); }
.progress-remaining { background: linear-gradient(90deg, #e4c900, #f2dc34); }
.progress-cancelled { background: linear-gradient(90deg, #d82c27, #ed534d); }
.progress-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.progress-stat {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 10px 9px 9px 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.progress-stat::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  content: "";
}
.progress-stat.done::before { background: var(--green); }
.progress-stat.remaining::before { background: #d9be00; }
.progress-stat.cancelled::before { background: var(--danger); }
.progress-stat span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.progress-stat strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.progress-stat small { font-size: 10px; font-weight: 900; }
.progress-stat.done small { color: var(--green); }
.progress-stat.remaining small { color: #9e8800; }
.progress-stat.cancelled small { color: var(--danger); }

.site-row, .site-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
}
.site-row-block { border-bottom: 1px solid var(--line); }
.site-row-block > .site-row { border-bottom: 0; }
.site-row-button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
.site-row-button:hover { color: var(--blue); }
.row-chevron {
  display: inline-block;
  width: 18px;
  color: var(--blue);
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  vertical-align: -1px;
}
.site-row strong { color: var(--ink); }
.site-auto {
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}
.site-row .no-data { color: var(--muted); font-weight: 500; }
.site-total {
  margin: 8px -19px -19px;
  padding: 9px 19px;
  border: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--blue-soft);
  color: var(--ink);
  font-weight: 900;
}
.site-total strong { font-size: 22px; }

.shipment-panel {
  margin: 0 0 14px;
  padding: 13px;
  border: 1px solid #cbdffb;
  border-radius: 13px;
  background: #f7faff;
}
.shipment-filters {
  display: grid;
  gap: 8px;
}
.shipment-filters label {
  gap: 5px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}
.shipment-filters input {
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 12px;
}
.shipment-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 11px 0 7px;
  color: var(--muted);
  font-size: 12px;
}
.shipment-summary strong { color: var(--blue); }
.shipment-list {
  max-height: 340px;
  overflow: auto;
  border-top: 1px solid var(--line);
}
.shipment-row {
  display: grid;
  grid-template-columns: 44px 34px minmax(0, 1.7fr) minmax(0, 1.2fr) 74px;
  gap: 9px;
  min-width: 0;
  align-items: center;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.shipment-row > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shipment-row time { color: var(--muted); font-variant-numeric: tabular-nums; }
.shipment-row strong { color: var(--ink); }
.shipment-row b { color: var(--blue); text-align: right; }
.shipment-project {
  display: grid;
  gap: 2px;
}
.shipment-project b {
  overflow: hidden;
  color: var(--ink);
  text-align: left;
  text-overflow: ellipsis;
}
.shipment-project small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
}
.shipment-header {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #f7faff;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}
.shipment-customer { display: none; }
.shipment-empty {
  padding: 16px 4px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.current-grid { display: grid; gap: 12px; }
.current-box {
  padding: 16px;
  border-radius: 14px;
  background: var(--blue-soft);
}
#loading-card { background: var(--orange-soft); }
#unloading-card { background: var(--blue-soft); }
.unclassified-box { background: #fff8dc; }
.current-box > span { color: var(--muted); font-size: 13px; font-weight: 700; }
.current-box > strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 28px;
}
.current-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.current-sites-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.current-site-panel {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(23, 105, 224, .12);
  border-radius: 12px;
  background: rgba(255, 255, 255, .72);
}
.current-site-panel.is-empty {
  background: rgba(255, 255, 255, .42);
}
.current-site-name {
  display: block;
  color: var(--blue);
  font-size: 13px;
}
.current-site-value {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 23px;
  font-weight: 900;
}
.current-site-note,
.current-site-empty {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.current-material-list { margin-top: 6px; }
.current-material-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid rgba(23, 105, 224, .12);
}
.current-material-row:first-child { border-top: 0; }
.current-material-row span { min-width: 0; overflow-wrap: anywhere; }
.current-material-row strong {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 12px;
}
.compact-list { margin-top: 10px; }
.compact-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  border-top: 1px solid rgba(23, 105, 224, .12);
}
.compact-row strong { white-space: nowrap; }

.unit-chip {
  padding: 5px 9px;
  border-radius: 99px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}
.classification-warning {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 12px 15px;
  border: 1px solid #f3d19e;
  border-radius: 13px;
  background: #fff8e8;
  color: var(--warning);
  font-size: 12px;
}
.classification-warning span { color: #7a5a33; }
.dispatch-tabs {
  display: flex;
  gap: 6px;
  margin: -5px 0 12px;
}
.dispatch-tab {
  min-height: 36px;
  padding: 7px 11px;
  border: 0;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}
.dispatch-tab.active {
  background: var(--ink);
  color: #fff;
}
.dispatch-table {
  table-layout: fixed;
  font-size: 11px;
}
.dispatch-table th:first-child,
.dispatch-table td:first-child { width: 40%; }
.dispatch-project-label {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.dispatch-project-label > span,
.dispatch-project-label small {
  overflow: hidden;
  text-overflow: ellipsis;
}
.dispatch-project-label small {
  color: var(--muted);
  font-size: 9px;
}
.dispatch-table th,
.dispatch-table td { padding: 10px 5px; }
.dispatch-total-row {
  background: var(--blue-soft);
  color: var(--ink);
  font-weight: 900;
}
.dispatch-detail-row td {
  padding: 5px;
  background: #f7faff;
}
.dispatch-detail-row .shipment-list {
  max-height: 280px;
  border-top: 0;
}
.dispatch-filters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.dispatch-filters select {
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 12px;
}
.mapping-warning {
  margin: 0 0 10px;
  padding: 9px 11px;
  border: 1px solid #f3d19e;
  border-radius: 10px;
  background: #fff8e8;
  color: var(--warning);
  font-size: 11px;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
th { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.number-cell { text-align: right; white-space: nowrap; }
.empty-row td { color: var(--muted); text-align: center; }
.arrival-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
}
.arrival-toggle i {
  width: 16px;
  color: var(--orange);
  font-style: normal;
  font-size: 18px;
}
.arrival-supplier-row td {
  padding-top: 8px;
  padding-bottom: 8px;
  background: #fffaf4;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.arrival-supplier-row td:first-child {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dialog {
  width: min(calc(100% - 24px), 480px);
  max-height: calc(100svh - 24px);
  margin: auto;
  padding: 22px;
  overflow: auto;
  border: 0;
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(7, 25, 49, .28);
}
.dialog::backdrop { background: rgba(7, 25, 49, .56); backdrop-filter: blur(3px); }
.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.close-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--canvas);
  color: var(--muted);
  font-size: 25px;
}
.step-hint, .field-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.step-hint { margin: -8px 0 20px; }
.field-note { margin: -8px 0 18px; }
.plan-reason-section {
  margin: 0 0 20px;
  padding: 14px;
  border: 1px solid #f0d8b3;
  border-radius: 14px;
  background: #fff8ee;
}
.plan-change-summary,
.plan-reason-balance {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.plan-change-summary { margin-bottom: 16px; }
.plan-change-summary span { color: var(--muted); font-size: 12px; }
.plan-change-summary strong { color: var(--ink); font-size: 18px; }
.plan-reason-section .field-note { margin: 0 0 12px; }
.plan-reason-rows { display: grid; gap: 9px; margin-bottom: 10px; }
.plan-reason-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 34px;
  align-items: end;
  gap: 8px;
}
.plan-reason-row label { margin: 0; font-size: 10px; }
.plan-reason-row input { margin: 4px 0 0; }
.plan-reason-remove {
  width: 34px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: #fbe9e8;
  color: var(--danger);
  font-size: 20px;
  cursor: pointer;
}
.plan-reason-balance {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.plan-reason-balance.is-invalid { color: var(--danger); }
.plan-history-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.plan-history-summary div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  background: var(--blue-soft);
}
.plan-history-summary span { color: var(--muted); font-size: 11px; }
.plan-history-summary strong { color: var(--ink); font-size: 18px; }
.plan-history-table { font-size: 12px; }
.plan-history-table th,
.plan-history-table td { padding: 10px 8px; }
.plan-history-table td:first-child {
  width: 105px;
  color: var(--ink);
  font-weight: 900;
  white-space: nowrap;
}
.plan-history-table .increase { color: var(--green); }
.plan-history-table .decrease { color: var(--danger); }
.plan-history-empty { margin: 16px 0 0; text-align: center; }

.close-shift-button {
  margin-top: 18px;
  border: 1px solid #cbd9eb;
  background: #f4f8fe;
  color: #0b3f7a;
}
.close-shift-button:hover { background: #e8f1fd; }
.close-dispatch-dialog { max-width: 560px; }
.close-dispatch-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 12px;
}
.close-dispatch-summary article {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid #d9e4f2;
  border-radius: 14px;
  background: #f7faff;
}
.close-dispatch-summary span { color: var(--muted); font-size: 12px; }
.close-dispatch-summary strong { color: var(--ink); font-size: 22px; }
.close-dispatch-warning {
  display: grid;
  gap: 5px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #f2c17c;
  border-radius: 14px;
  background: #fff6e8;
  color: #8a4a00;
}
.close-dispatch-warning[hidden] { display: none; }
.close-dispatch-warning span { font-size: 13px; line-height: 1.4; }
.force-close-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 9px;
  margin: 14px 0;
  font-weight: 700;
}
.force-close-row input { width: 19px; height: 19px; margin: 0; }
.form-error {
  min-height: 18px;
  margin: 0 0 10px;
  color: var(--danger);
  font-size: 13px;
}
.button-row { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.users-list { display: grid; gap: 8px; margin-bottom: 24px; }
.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 11px;
  background: var(--canvas);
}
.user-row-info { display: grid; gap: 3px; min-width: 0; }
.user-row small { color: var(--muted); }
.user-delete-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid #f0b4ae;
  border-radius: 9px;
  background: #fff;
  color: var(--danger);
  font-weight: 800;
}
.user-delete-button:disabled { cursor: wait; opacity: .55; }
.user-current-label {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}
.user-form { padding-top: 4px; border-top: 1px solid var(--line); }
.account-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: -8px 0 22px;
  padding: 13px 15px;
  border-radius: 12px;
  background: var(--blue-soft);
}
.account-summary strong { color: var(--ink); }
.account-summary span { color: var(--blue); font-size: 12px; font-weight: 800; }
.account-logout { margin-top: 12px; }

.toast {
  position: fixed;
  z-index: 20;
  right: 16px;
  bottom: 16px;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: .2s ease;
}
.toast.visible { opacity: 1; transform: translateY(0); }

.report-shell {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 18px 14px 44px;
}
.report-page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.report-page-heading h1 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: clamp(24px, 5vw, 34px);
}
.report-page-heading p {
  max-width: 650px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.report-filter-grid {
  display: grid;
  gap: 12px;
}
.report-filter-grid label { margin: 0; }
.report-cargo-filter {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.report-cargo-filter legend,
.advanced-condition-row label > span:first-child {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}
.report-cargo-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}
.report-cargo-options label {
  margin: 0;
  cursor: pointer;
}
.report-cargo-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.report-cargo-options span {
  display: grid;
  min-height: 41px;
  place-items: center;
  padding: 7px 9px;
  border: 1px solid #ccd8e8;
  border-radius: 10px;
  background: #f7faff;
  color: #496078;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  transition: .15s ease;
}
.report-cargo-options input:checked + span {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 5px 12px rgba(23, 105, 224, .18);
}
.report-cargo-options input:focus-visible + span {
  outline: 3px solid rgba(23, 105, 224, .25);
  outline-offset: 2px;
}
.report-advanced {
  margin-top: 14px;
  border: 1px solid #d8e3f0;
  border-radius: 14px;
  background: #f8fbff;
  overflow: hidden;
}
.report-advanced summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}
.report-advanced summary small {
  color: var(--blue);
  font-size: 11px;
  text-align: right;
}
.report-advanced[open] summary {
  border-bottom: 1px solid #d8e3f0;
  background: #eef5ff;
}
.report-advanced-body { padding: 14px; }
.advanced-conditions { display: grid; gap: 10px; }
.advanced-condition-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(160px, .9fr) minmax(240px, 1.35fr) 38px;
  align-items: end;
  gap: 9px;
  padding: 12px;
  border: 1px solid #dbe5f1;
  border-radius: 12px;
  background: #fff;
}
.advanced-condition-row label { min-width: 0; margin: 0; }
.advanced-condition-row label > span:first-child {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}
.advanced-values {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
}
.advanced-values input { min-width: 0; }
.advanced-values small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.advanced-range-separator { color: var(--muted); }
.advanced-placeholder {
  display: flex;
  align-items: center;
  min-height: 42px;
  color: var(--muted);
  font-size: 12px;
}
.advanced-remove {
  display: grid;
  width: 38px;
  height: 42px;
  place-items: center;
  border: 1px solid #f0c9c5;
  border-radius: 10px;
  background: #fff5f3;
  color: var(--danger);
  font-size: 22px;
  line-height: 1;
}
.advanced-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}
.report-archive-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 13px;
}
.report-archive-toggle input { width: 18px; height: 18px; }
.report-advanced-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.report-active-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}
.report-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.report-filter-chip {
  max-width: min(100%, 420px);
  overflow: hidden;
  padding: 7px 10px;
  border: 1px solid #b9d4f7;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #14569f;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.report-filter-chip span { margin-left: 4px; font-size: 14px; }
.report-reset-link {
  padding: 5px;
  border: 0;
  background: transparent;
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}
.report-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.report-filter-actions .button { flex: 1 1 auto; }
.report-filter-error { margin: 8px 0 0; }
.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.report-summary-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.report-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.report-summary-card strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 22px;
}
.report-note {
  margin: 12px 0;
  padding: 11px 13px;
  border: 1px solid #cbdffb;
  border-radius: 12px;
  background: var(--blue-soft);
  color: #31577f;
  font-size: 12px;
}
.report-table-card {
  padding: 0;
  overflow: hidden;
}
.report-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.report-table-toolbar strong { color: var(--ink); }
.report-status { color: var(--muted); font-size: 12px; }
.report-table-wrap {
  max-height: calc(100svh - 250px);
  overflow: auto;
}
.report-table {
  min-width: 1900px;
  font-size: 12px;
}
.report-table thead {
  position: sticky;
  z-index: 2;
  top: 0;
  background: #f7f9fc;
}
.report-table th { white-space: nowrap; }
.report-table td { vertical-align: top; }
.report-table .report-id { color: var(--muted); font-variant-numeric: tabular-nums; }
.report-table .report-weight { text-align: right; white-space: nowrap; }
.report-table .report-time { white-space: nowrap; }
.report-shift-cell {
  min-width: 190px;
}
.report-shift-cell small {
  display: block;
  max-width: 260px;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}
.shift-assignment-badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff0d8;
  color: #8a4a00;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
.manual-ttn-badge {
  display: inline-flex;
  margin-top: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e7f2ff;
  color: #155da6;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}
.report-shift-actions {
  min-width: 125px;
  white-space: nowrap;
}
.report-ttn-button {
  display: block;
  min-height: 32px;
  padding: 6px 10px;
  font-size: 11px;
}
.report-shift-button + .report-ttn-button {
  margin-top: 7px;
}
.manual-ttn-dialog { width: min(calc(100% - 24px), 560px); }
.manual-ttn-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  margin-top: 18px;
}
.manual-ttn-actions .danger-outline { grid-column: 1 / -1; }
.manual-ttn-actions .danger-outline[hidden] { display: none; }
.report-shift-button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 11px;
}
.report-shift-revert {
  display: block;
  margin-top: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--danger);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.shift-transfer-dialog { width: min(calc(100% - 24px), 620px); }
.shift-transfer-movement {
  margin: -8px 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.45;
}
.shift-transfer-preview {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #d9e4f2;
  border-radius: 14px;
  background: #f7faff;
}
.shift-transfer-preview[hidden] { display: none; }
.shift-transfer-preview p { margin: 0; color: var(--muted); font-size: 12px; }
.shift-transfer-preview > div { display: grid; gap: 8px; }
.shift-transfer-preview article {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
}
.shift-transfer-preview article span { color: var(--muted); font-size: 12px; }
.report-empty {
  padding: 42px 20px !important;
  color: var(--muted);
  text-align: center !important;
}
.report-loading {
  padding: 30px;
  color: var(--muted);
  text-align: center;
}
.report-catalog-shell { max-width: 1180px; }
.report-catalog {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.report-catalog-card {
  position: relative;
  display: flex;
  min-height: 220px;
  flex-direction: column;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.report-catalog-card:hover,
.report-catalog-card:focus-visible {
  border-color: #8ab7f3;
  box-shadow: 0 18px 40px rgba(11, 31, 58, .12);
  transform: translateY(-2px);
}
.report-catalog-card h2 {
  max-width: 320px;
  margin: 32px 0 8px;
  font-size: 22px;
  line-height: 1.15;
}
.report-catalog-card p {
  max-width: 460px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.report-catalog-card > strong {
  margin-top: auto;
  color: var(--blue);
  font-size: 13px;
}
.report-card-number {
  position: absolute;
  top: 14px;
  right: 18px;
  color: #d8e5f7;
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
}
.report-card-tag {
  align-self: flex-start;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.report-catalog-card-inert .report-card-tag {
  background: #e8f7ee;
  color: #16814a;
}
.report-catalog-card-concrete .report-card-tag {
  background: #fff0df;
  color: #b75d00;
}
.report-catalog-card-daily .report-card-tag {
  background: #eee9ff;
  color: #6237bd;
}
.report-catalog-placeholder {
  border-style: dashed;
  background: rgba(255, 255, 255, .42);
  box-shadow: none;
  opacity: .72;
}
.report-catalog-placeholder:hover {
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}
.summary-filter-grid { grid-template-columns: 1fr; }
.summary-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.summary-total-card {
  grid-column: 1 / -1;
  border-color: #b8d5fa;
  background: var(--blue-soft);
}
.summary-total-card strong {
  color: var(--blue);
  font-size: 26px;
}
.summary-report-table {
  min-width: 680px;
  font-size: 13px;
}
body[data-report-type="concrete"] .summary-report-table { min-width: 480px; }
.summary-report-table td:nth-child(2) { font-weight: 700; }
.summary-section-heading th {
  padding: 13px 12px;
  border-top: 12px solid var(--surface);
  background: var(--ink);
  color: white;
  font-size: 14px;
  letter-spacing: .02em;
  text-align: left;
}
.summary-section-heading:first-child th { border-top: 0; }
.summary-section-total td {
  border-top: 2px solid #b8d5fa;
  background: var(--blue-soft);
  color: var(--ink);
  font-weight: 900;
}
.summary-section-total td:last-child {
  color: var(--blue);
  white-space: nowrap;
}
.summary-section-empty td {
  padding: 15px;
  color: var(--muted);
  text-align: center;
}
.daily-dispatch-shell { max-width: 1100px; }
.daily-filter-grid {
  display: grid;
  gap: 12px;
}
.daily-filter-grid > label { margin: 0; }
.daily-sites-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.daily-sites-fieldset legend {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}
.daily-site-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.daily-site-option {
  position: relative;
  display: block;
  margin: 0;
}
.daily-site-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
  pointer-events: none;
}
.daily-site-option span {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}
.daily-site-option input:checked + span {
  border-color: #83b2ef;
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: inset 0 0 0 1px #83b2ef;
}
.daily-site-option input:focus-visible + span {
  outline: 3px solid rgba(23, 105, 224, .18);
  outline-offset: 1px;
}
.daily-kpi-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.daily-dispatch-table {
  min-width: 560px;
  font-size: 13px;
}
.daily-dispatch-table th:not(:first-child),
.daily-dispatch-table td:not(:first-child) {
  text-align: right;
}
.daily-dispatch-table tfoot {
  position: sticky;
  z-index: 1;
  bottom: 0;
  background: var(--blue-soft);
  color: var(--ink);
}
.daily-dispatch-table tfoot td {
  border-top: 2px solid #9fc5f5;
  font-size: 14px;
}

.daily-material-date-row td {
  background: #fff200;
  color: #111827;
  text-align: center;
}

.daily-material-subtotal-row td {
  background: #f3f6fa;
}

.daily-group-options {
  display: grid;
  align-content: center;
  gap: 0.5rem;
}

@media (min-width: 720px) {
  .app-header { padding: 12px 28px 14px; }
  .brand-logo-header { width: 290px; height: auto; }
  .dashboard { padding: 28px 24px 60px; }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .card { padding: 24px; }
  .wide { grid-column: 1 / -1; }
  .current-sites-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-total { margin: 8px -24px -24px; padding: 12px 24px; }
  table { font-size: 14px; }
  .report-shell { padding: 28px 24px 60px; }
  .report-filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
  .report-summary-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .report-filter-actions .button { flex: 0 0 auto; }
  .report-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-total-card { grid-column: auto; }
  .daily-filter-grid {
    grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr) minmax(260px, 1.35fr);
    align-items: end;
  }
  .daily-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shipment-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 719px) {
  .advanced-condition-row { grid-template-columns: 1fr; }
  .advanced-remove { width: 100%; height: 38px; }
  .advanced-values { flex-wrap: wrap; }
  .advanced-values input { flex: 1 1 130px; }
  .advanced-toolbar { align-items: stretch; }
  .advanced-toolbar .button { width: 100%; }
  .report-archive-toggle { align-items: flex-start; }
  .report-active-filters { align-items: flex-start; }
}

@media (max-width: 520px) {
  .dashboard { width: auto; }
  .arrival-card table {
    table-layout: fixed;
    font-size: 10px;
  }
  .arrival-card th,
  .arrival-card td { padding: 9px 3px; }
  .arrival-card th:first-child,
  .arrival-card td:first-child { width: 40%; }
  .arrival-supplier-row td { font-size: 9px; }
  .dispatch-table { font-size: 10px; }
  .dispatch-table th,
  .dispatch-table td { padding: 9px 3px; }
  .dispatch-filters { grid-template-columns: 1fr; }
  .shipment-row {
    grid-template-columns: 36px 24px minmax(0, 1.4fr) minmax(0, 1fr) 54px;
    gap: 5px;
    font-size: 10px;
  }
  .shipment-project small {
    display: block;
    font-size: 8px;
  }
  .test-banner {
    align-items: flex-start;
    gap: 6px;
    font-size: 11px;
    line-height: 1.25;
  }
  .app-header {
    position: relative;
    align-items: stretch;
    gap: 8px;
    padding: 8px 10px 11px;
  }
  .header-brand {
    align-self: stretch;
    width: 100%;
  }
  .brand-logo-header { width: min(76vw, 235px); height: auto; }
  .header-caption { max-width: none; font-size: 10px; }
  .header-clock { font-size: 12px; }
  .header-refresh { width: 100%; }
  .header-actions {
    align-self: stretch;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding-top: 9px;
  }
  .navigation-scroll {
    width: 100%;
    padding-bottom: 2px;
  }
  .suo-navigation {
    justify-content: flex-start;
    gap: 6px;
    min-width: max-content;
    padding-top: 8px;
  }
  .suo-nav-link,
  .suo-nav-account {
    min-height: 38px;
    padding: 7px 11px;
    font-size: 12px;
  }
  .dispatch-overview-item { padding: 13px 11px; }
  .dispatch-overview-item strong { font-size: 21px; }
  .dispatch-overview-value em { font-size: 8px; }
  .header-actions .button { min-height: 38px; padding: 7px 11px; font-size: 12px; }
  #edit-shift-button { padding: 7px 10px; font-size: 11px; }
  .account-button { min-width: 58px; padding: 4px 6px; text-align: center; }
  .account-button small { display: none; }
  .report-page-heading { align-items: flex-start; flex-direction: column; }
  .report-table-toolbar { align-items: flex-start; flex-direction: column; }
  .report-dashboard-link { display: none !important; }
  .report-catalog-card { min-height: 200px; }
  .summary-report-table {
    min-width: 0;
    table-layout: fixed;
    font-size: 10px;
  }
  .summary-report-table th,
  .summary-report-table td {
    padding: 9px 4px;
    overflow-wrap: anywhere;
  }
  .summary-report-table th:first-child,
  .summary-report-table td:first-child { width: 7%; }
  body[data-report-type="inert"] .summary-report-table th:nth-child(2),
  body[data-report-type="inert"] .summary-report-table td:nth-child(2) { width: 31%; }
  body[data-report-type="inert"] .summary-report-table th:nth-child(3),
  body[data-report-type="inert"] .summary-report-table td:nth-child(3) { width: 38%; }
  body[data-report-type="inert"] .summary-report-table th:nth-child(4),
  body[data-report-type="inert"] .summary-report-table td:nth-child(4) { width: 24%; }
  body[data-report-type="concrete"] .summary-report-table { min-width: 0; }
  body[data-report-type="concrete"] .summary-report-table th:nth-child(2),
  body[data-report-type="concrete"] .summary-report-table td:nth-child(2) { width: 58%; }
  body[data-report-type="concrete"] .summary-report-table th:nth-child(3),
  body[data-report-type="concrete"] .summary-report-table td:nth-child(3) { width: 35%; }
  .daily-dispatch-table {
    min-width: 520px;
    font-size: 11px;
  }
  .daily-dispatch-table th,
  .daily-dispatch-table td {
    padding: 10px 7px;
  }
}

@media (min-width: 1000px) {
  .dispatch-overview { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media print {
  .test-banner,
  .app-header,
  .report-page-heading,
  .report-filter-card,
  .report-note,
  .report-table-toolbar {
    display: none !important;
  }
  body { background: #fff; }
  .report-shell { width: 100%; padding: 0; }
  .report-table-card { border: 0; box-shadow: none; }
  .report-table-wrap { max-height: none; overflow: visible; }
  .report-table { min-width: 0; font-size: 8px; }
}

/* Admin reference catalogs */
.reference-shell {
  max-width: 1480px;
}

.reference-tabs {
  display: flex;
  gap: 8px;
  margin: 20px 0;
  padding: 5px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  border-radius: 16px;
  background: #e8eef7;
}

.reference-tab {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  color: #52647a;
  background: transparent;
  font: inherit;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.reference-tab.active {
  color: #fff;
  background: #0b1f3a;
}

.reference-panel {
  padding: 28px;
}

.reference-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.reference-heading h2 {
  margin: 5px 0 6px;
}

.reference-heading p {
  margin: 0;
  color: #708198;
}

.reference-search {
  display: block;
  max-width: 620px;
  margin-top: 22px;
}

.reference-search span {
  display: block;
  margin-bottom: 7px;
  color: #61738b;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.reference-search input {
  width: 100%;
}

.reference-count {
  margin: 18px 0 8px;
  color: #708198;
  font-size: 14px;
}

.reference-table-wrap {
  overflow-x: auto;
  border: 1px solid #dbe4ef;
  border-radius: 16px;
}

.reference-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.reference-table th,
.reference-table td {
  padding: 13px 15px;
  border-bottom: 1px solid #e5ebf2;
  text-align: left;
  vertical-align: middle;
}

.reference-table th {
  color: #60728a;
  background: #f5f8fc;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

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

.reference-table tbody tr:hover {
  background: #f8fbff;
}

.reference-unmatched-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  color: #53667e;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.reference-unmatched-toggle input {
  width: 17px;
  height: 17px;
  accent-color: #0b62d6;
}

.reference-unmatched-row {
  background: #fffaf0;
}

.reference-status {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.reference-status.confirmed {
  color: #087443;
  background: #e6f7ee;
}

.reference-status.unmatched {
  color: #9b4a00;
  background: #fff0d9;
}

.reference-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  white-space: nowrap;
}

.reference-edit,
.reference-delete {
  border: 0;
  padding: 7px 9px;
  border-radius: 8px;
  background: #e9f1ff;
  color: #0b62d6;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.reference-delete {
  color: #b42318;
  background: #fff0ef;
}

.reference-empty {
  padding: 28px 0 8px;
  color: #708198;
  text-align: center;
}

.reference-dialog {
  width: min(760px, calc(100vw - 28px));
}

.reference-dialog form {
  display: grid;
  gap: 16px;
}

.reference-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

@media (max-width: 720px) {
  .reference-panel {
    padding: 18px 14px;
  }

  .reference-heading {
    display: grid;
  }

  .reference-heading .button {
    width: 100%;
  }

  .reference-form-grid {
    grid-template-columns: 1fr;
  }

  .reference-table-wrap {
    overflow: visible;
    border: 0;
  }

  .reference-table,
  .reference-table tbody,
  .reference-table tr,
  .reference-table td {
    display: block;
    width: 100%;
  }

  .reference-table thead {
    display: none;
  }

  .reference-table tr {
    margin-bottom: 11px;
    padding: 10px 12px;
    border: 1px solid #dbe4ef;
    border-radius: 14px;
  }

  .reference-table td {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 9px;
    padding: 7px 0;
    border: 0;
  }

  .reference-table td::before {
    content: attr(data-label);
    color: #708198;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .reference-table .reference-actions {
    display: flex;
    justify-content: flex-start;
    padding-top: 10px;
  }

  .reference-table .reference-actions::before {
    display: none;
  }
}

/* Audit log */
.audit-shell {
  max-width: 1480px;
}

.audit-filter-card {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr 1fr auto;
  align-items: end;
  gap: 14px;
  margin: 20px 0;
  padding: 20px;
}

.audit-filter-card label {
  display: grid;
  gap: 7px;
  color: #61738b;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.audit-filter-card select,
.audit-filter-card input {
  width: 100%;
}

.audit-card {
  padding: 24px;
}

.audit-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.audit-card-heading h2 {
  margin: 5px 0 0;
}

.audit-table td:nth-child(2) small,
.audit-table td:nth-child(4) small {
  display: block;
  margin-top: 4px;
  color: #7b8a9e;
}

.audit-category {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e8f1ff;
  color: #0b62d6;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.audit-category-auth,
.audit-category-security {
  color: #6b3cc9;
  background: #f0eaff;
}

.audit-category-data {
  color: #087443;
  background: #e6f7ee;
}

.audit-category-document {
  color: #9b4a00;
  background: #fff1df;
}

.audit-failed {
  background: #fff7f6;
}

.audit-error {
  color: #b42318 !important;
  font-weight: 800;
}

.history-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 24px 14px 56px;
}

.history-tabs {
  display: flex;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 16px;
  padding: 5px;
  border: 1px solid #dce6f2;
  border-radius: 16px;
  background: #edf3fa;
}
.history-tab {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  background: transparent;
  color: #52657c;
  font-weight: 800;
  cursor: pointer;
}
.history-tab.active {
  background: #fff;
  color: #075fc9;
  box-shadow: 0 4px 14px rgba(24, 60, 100, .08);
}
.history-dispatch-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.history-dispatch-meta span {
  padding: 8px 10px;
  border-radius: 10px;
  background: #f0f5fb;
  color: #607087;
  font-size: 12px;
}
.history-dispatch-meta .danger-text {
  background: #fff0ed;
  color: #a33524;
}

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

.history-list-card,
.history-detail-card {
  padding: 22px;
}

.history-count {
  padding: 6px 9px;
  border-radius: 99px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.history-list-item > span {
  display: grid;
  gap: 3px;
}

.history-list-item small {
  color: var(--muted);
  font-size: 11px;
}

.history-list-item.active {
  border-color: #8dbbf6;
  background: var(--blue-soft);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--blue);
}

.history-list-fact {
  justify-items: end;
  white-space: nowrap;
}

.history-detail-card {
  transition: opacity .15s ease;
}

.history-detail-card.is-loading {
  opacity: .55;
  pointer-events: none;
}

.history-detail-heading {
  align-items: flex-start;
}

.history-detail-heading h2 {
  margin-bottom: 5px;
}

.history-detail-heading p {
  margin: 0;
}

.history-captured {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.history-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 10px;
}

.history-metrics article,
.history-sites article,
.history-current-state article {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid #dbe5f2;
  border-radius: 14px;
  background: #f7faff;
}

.history-metrics span,
.history-sites span,
.history-current-state span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.history-metrics strong {
  color: var(--ink);
  font-size: clamp(17px, 2vw, 24px);
}

.history-metrics .history-fact {
  border-color: #b9e4cc;
  background: var(--green-soft);
}

.history-metrics .history-fact strong {
  color: #087b3d;
}

.history-sites {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 18px;
}

.history-sites strong {
  color: var(--ink);
  font-size: 18px;
}

.history-section {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.history-section summary {
  position: relative;
  padding: 15px 42px 15px 15px;
  color: var(--ink);
  font-weight: 900;
  list-style: none;
  cursor: pointer;
}

.history-section summary::-webkit-details-marker {
  display: none;
}

.history-section summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  color: var(--blue);
  font-size: 20px;
}

.history-section[open] summary {
  border-bottom: 1px solid var(--line);
  background: #f8fbff;
}

.history-section[open] summary::after {
  content: "−";
}

.history-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.history-table th,
.history-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.history-table th {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.history-table th:first-child,
.history-table td:first-child {
  text-align: left;
  white-space: normal;
}

.history-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

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

.history-section-empty {
  margin: 0;
  padding: 16px;
}

.history-site-breakdowns {
  display: grid;
  gap: 14px;
  padding: 14px;
  background: #f4f7fb;
}

.history-site-report {
  overflow: hidden;
  border: 1px solid #d8e3f0;
  border-radius: 14px;
  background: #fff;
}

.history-site-report-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fbff;
}

.history-site-report-heading h3 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 20px;
}

.history-site-report-heading > strong {
  color: var(--blue);
  font-size: 18px;
  white-space: nowrap;
}

.history-site-total {
  border-color: #8ab7ee;
}

.history-site-total .history-site-report-heading {
  background: #eaf3ff;
}

.history-detail-table,
.history-mark-table {
  min-width: 560px;
}

.history-detail-table th:nth-child(2),
.history-detail-table td:nth-child(2),
.history-mark-table th:first-child,
.history-mark-table td:first-child {
  text-align: left;
}

.history-table tfoot td {
  border-top: 2px solid #cddbeb;
  border-bottom: 0;
  background: #f6f9fd;
  color: var(--ink);
  font-weight: 900;
}

.history-current-state {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 14px;
}

.history-current-state p {
  margin: 0;
}

.history-current-state small {
  color: var(--muted);
}

.audit-limit-note {
  margin: 14px 0 0;
}

@media (max-width: 900px) {
  .audit-filter-card {
    grid-template-columns: 1fr 1fr;
  }

  .audit-filter-card .button {
    width: 100%;
  }

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

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

@media (max-width: 720px) {
  .history-tabs { width: 100%; }
  .history-tab { flex: 1; padding: 10px 8px; font-size: 12px; }
  .history-site-breakdowns { padding: 10px; }
  .history-site-report-heading { padding: 12px; }
  .history-site-report-heading h3 { font-size: 17px; }
  .history-site-report-heading > strong { font-size: 15px; }
  .audit-filter-card {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .audit-card {
    padding: 18px 14px;
  }

  .audit-table td {
    grid-template-columns: 105px 1fr;
  }

  .history-shell {
    padding: 18px 10px 42px;
  }

  .history-list-card,
  .history-detail-card {
    padding: 16px;
  }

  .history-list {
    display: flex;
    gap: 8px;
    margin: 0 -16px;
    padding: 0 16px 3px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .history-list-item {
    flex: 0 0 min(82vw, 285px);
    scroll-snap-align: start;
  }

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

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

  .history-sites article {
    padding: 12px 9px;
  }

  .history-sites strong {
    font-size: 15px;
  }

  .history-current-state {
    grid-template-columns: 1fr;
  }
}
