:root {
  --nav: #203c3f;
  --nav-deep: #132b2f;
  --nav-active: #315e62;
  --nav-hover: rgba(255, 255, 255, 0.08);
  --bg: #eef2f5;
  --panel: #ffffff;
  --line: #d7e0e7;
  --line-soft: #edf1f4;
  --text: #17262d;
  --muted: #64757d;
  --blue: #1264a3;
  --green: #0f7b55;
  --amber: #b45f06;
  --red: #ba2d3a;
  --violet: #6554c0;
  --focus: #8ac7ff;
  --table-head: #f6f8fa;
  --shadow: 0 14px 34px rgba(22, 37, 45, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family:
    "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  min-width: 320px;
  height: 100%;
  overflow: hidden;
}

.login-page {
  width: 100vw;
  min-width: 100%;
  height: 100vh;
  height: 100dvh;
  position: fixed;
  inset: 0;
  display: block;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(3, 12, 20, 0.9) 0%, rgba(4, 19, 30, 0.74) 42%, rgba(4, 15, 22, 0.32) 100%),
    url("./assets/login-heavy-haul-dark.png") center / cover no-repeat;
}

#login-root {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.login-page::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(2, 8, 14, 0.1), rgba(2, 8, 14, 0.42)),
    radial-gradient(circle at 24% 18%, rgba(60, 184, 195, 0.18), transparent 34%);
}

.login-card {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: min(430px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  margin: 0;
  padding: 34px;
  border: 1px solid rgba(170, 210, 220, 0.24);
  border-radius: 8px;
  background: rgba(6, 20, 31, 0.76);
  color: #eff9fb;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
  overflow: auto;
  transform: translate(-50%, -50%);
}

.login-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.login-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(166, 229, 235, 0.45);
  border-radius: 8px;
  background: linear-gradient(135deg, #0f766e, #1264a3);
  color: #fff;
  font-weight: 800;
}

.login-brand h1 {
  margin: 0;
  color: #fff;
  font-size: 22px;
}

.login-brand p,
.login-copy {
  color: rgba(226, 244, 247, 0.72);
}

.login-brand p {
  margin: 4px 0 0;
  font-size: 13px;
}

.login-copy {
  margin-bottom: 22px;
  line-height: 1.55;
  font-size: 13px;
}

.login-error {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(252, 165, 165, 0.5);
  border-radius: 6px;
  background: rgba(127, 29, 29, 0.28);
  color: #fecaca;
  font-size: 13px;
}

.login-field {
  display: block;
  margin-bottom: 14px;
}

.login-field span {
  display: block;
  margin-bottom: 6px;
  color: rgba(226, 244, 247, 0.76);
  font-size: 13px;
}

.login-field input {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid rgba(181, 213, 222, 0.34);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  color: #10242d;
  font-size: 15px;
}

.login-button {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, #14a38b, #1e7bbd);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
}

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

.app-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--nav);
  color: #eef7f5;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 16px 18px;
  background: var(--nav-deep);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 3px;
  color: #b9c9c6;
  font-size: 12px;
}

.menu {
  padding: 8px 0 18px;
}

.menu-section {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.menu-button,
.submenu-button {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.submenu-button {
  grid-template-columns: 16px 1fr;
  min-height: 36px;
  padding-left: 50px;
  color: #dbe7e5;
  font-size: 13px;
}

.menu-button:hover,
.submenu-button:hover,
.menu-button.active,
.submenu-button.active {
  background: var(--nav-active);
}

.menu-icon {
  color: #b9d7ff;
}

.chevron {
  color: #d0dcda;
}

.submenu {
  display: none;
  padding-bottom: 6px;
  background: rgba(22, 36, 34, 0.22);
}

.menu-section.open .submenu {
  display: block;
}

.submenu-flyout-wrap {
  position: relative;
}

.submenu-flyout-wrap .submenu-button {
  grid-template-columns: 16px 1fr auto;
}

.flyout-chevron {
  color: #d0dcda;
}

.status-flyout {
  position: absolute;
  top: 0;
  left: 100%;
  z-index: 20;
  display: none;
  min-width: 136px;
  padding: 6px 0;
  background: #2f4743;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.24);
}

.submenu-flyout-wrap:hover .status-flyout,
.submenu-flyout-wrap:focus-within .status-flyout {
  display: block;
}

.status-flyout button {
  width: 100%;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.status-flyout button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 72px;
  padding: 12px 24px;
  background: rgba(244, 246, 247, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 22px;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
}

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

.icon-button,
.primary,
.secondary,
.ghost {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.icon-button {
  width: 36px;
  height: 36px;
}

.primary,
.secondary,
.ghost {
  min-height: 32px;
  padding: 0 12px;
}

.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.ghost {
  background: transparent;
}

.user-chip {
  display: grid;
  place-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: #e6efed;
  color: #27413d;
}

.content {
  padding: 20px 24px 40px;
}

.stats-grid,
.module-grid,
.report-grid {
  display: grid;
  gap: 14px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.module-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.report-grid {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.card,
.table-card,
.form-card,
.board-column {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card {
  padding: 16px;
}

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

.metric-value {
  margin: 8px 0 4px;
  font-size: 26px;
  font-weight: 700;
}

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

.toolbar,
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.search {
  min-width: 220px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.compact-filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: -4px 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafb;
}

.compact-filterbar label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.compact-filterbar select {
  min-width: 120px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
}

.section-caption {
  margin: 12px 0 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.tab {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.tab.active {
  border-color: var(--blue);
  background: #e8f1fb;
  color: var(--blue);
}

.table-card {
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: #526469;
  background: #f7fafb;
  font-size: 12px;
  font-weight: 600;
}

td.actions {
  color: var(--blue);
}

.row-select {
  width: 15px;
  height: 15px;
  accent-color: var(--blue);
  cursor: pointer;
}

.select-col {
  width: 36px;
  min-width: 36px;
  text-align: center;
}

.tb-allcb,
.tb-rowcb {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.filter-row th {
  padding: 2px 4px;
  background: #fbfdff;
  font-weight: 400;
}

.filter-cell {
  position: relative;
}

.filter-row .select-col {
  padding: 2px;
}

.tb-filter {
  width: 100%;
  min-width: 54px;
  box-sizing: border-box;
  padding: 2px 5px;
  border: 1px solid #d5dee7;
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-size: 11px;
  line-height: 1.3;
  outline: none;
}

.tb-filter:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(18, 100, 163, 0.1);
}

.tb-date-wrap {
  position: relative;
}

.tb-date-trigger {
  width: 100%;
  min-width: 78px;
  height: 24px;
  overflow: hidden;
  padding: 2px 6px;
  border: 1px solid #d5dee7;
  border-radius: 4px;
  background: #fff;
  color: #52616a;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.tb-date-trigger:hover,
.tb-date-trigger:focus {
  border-color: var(--blue);
  color: var(--blue);
  box-shadow: 0 0 0 2px rgba(18, 100, 163, 0.1);
  outline: none;
}

.date-range-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  width: min(620px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid #d5dee7;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(20, 38, 50, 0.18);
  color: var(--text);
  font-size: 12px;
}

.date-range-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.date-range-fields label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  color: #52616a;
  white-space: nowrap;
}

.date-range-input {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 2px 6px;
  border: 1px solid #d5dee7;
  border-radius: 4px;
  font-size: 12px;
}

.date-range-calendars {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.date-calendar {
  min-width: 0;
}

.date-calendar-head {
  display: grid;
  grid-template-columns: 24px minmax(72px, 1fr) minmax(72px, 1fr) 24px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.date-calendar-head select,
.date-nav {
  height: 24px;
  border: 1px solid #d5dee7;
  border-radius: 4px;
  background: #fff;
  color: #42535a;
  font-size: 12px;
}

.date-nav {
  padding: 0;
  font-weight: 700;
  cursor: pointer;
}

.date-weekdays,
.date-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.date-weekdays span {
  color: #78909a;
  font-size: 11px;
  text-align: center;
}

.date-day {
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #fff;
  color: #1f2d35;
  font-size: 12px;
  cursor: pointer;
}

.date-day:hover {
  border-color: #b8d6ef;
  background: #eef7ff;
}

.date-day.muted {
  color: #b8c4cc;
}

.date-day.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.date-range-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.date-range-actions button {
  min-height: 28px;
  padding: 0 12px;
}

.detail-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #0f6db8;
  font: inherit;
  cursor: pointer;
}

.detail-link:hover {
  text-decoration: underline;
}

.status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.status-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: #42535a;
  cursor: pointer;
}

.status-tabs button.active,
.status-tabs button:hover {
  border-color: var(--blue);
  background: #edf6ff;
  color: var(--blue);
}

.status-tabs span {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #e8eef5;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status.blue {
  background: #e8f1fb;
  color: var(--blue);
}

.status.green {
  background: #e7f5ef;
  color: var(--green);
}

.status.amber {
  background: #fff2dc;
  color: var(--amber);
}

.status.red {
  background: #fde8e8;
  color: var(--red);
}

.status.violet {
  background: #eceefe;
  color: var(--violet);
}

.form-card {
  padding: 16px;
  margin-bottom: 16px;
}

.form-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 10px 18px;
}

.field {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
  word-break: keep-all;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.field textarea {
  min-height: 68px;
  resize: vertical;
}

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

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

.workflow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.workflow-step {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.workflow-step strong {
  display: block;
  margin-bottom: 5px;
}

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

.board-column {
  min-height: 240px;
  padding: 12px;
}

.board-column h3 {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.shipment-card {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.shipment-card strong {
  display: block;
  margin-bottom: 6px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 10px;
  border-left: 3px solid var(--blue);
  background: #f7fafb;
}

.map-panel {
  display: grid;
  place-items: center;
  min-height: 330px;
  border: 1px dashed #9db3b8;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(25, 118, 210, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(25, 118, 210, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
}

.route-line {
  width: min(620px, 86%);
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--blue), var(--amber));
  position: relative;
}

.route-line::before,
.route-line::after {
  content: "";
  position: absolute;
  top: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 5px solid var(--green);
}

.route-line::before {
  left: -2px;
}

.route-line::after {
  right: -2px;
  border-color: var(--amber);
}

.truck-dot {
  position: absolute;
  left: 56%;
  top: -14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(25, 118, 210, 0.28);
}

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

.action-link {
  margin-right: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-size: 13px;
}

.action-link:hover {
  text-decoration: underline;
}

.action-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 3px;
  border: 1px solid #28a2ff;
  border-radius: 2px;
  background: #f4fbff;
  color: #0085d5;
  font-size: 12px;
  line-height: 1;
}

.action-icon:hover {
  background: #e3f3ff;
  text-decoration: none;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #1f3431;
  color: #fff;
  box-shadow: var(--shadow);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 31, 34, 0.36);
}

.modal {
  width: min(900px, 100%);
  max-height: min(780px, 90vh);
  overflow: auto;
  resize: both;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 22px 70px rgba(20, 38, 43, 0.28);
}

.modal-medium {
  width: min(900px, 100%);
}

.modal-large {
  width: min(1280px, 100%);
  max-height: 92vh;
}

.modal-full {
  width: calc(100vw - 32px);
  height: calc(100vh - 32px);
  max-height: none;
}

.modal-full .modal-body {
  max-height: calc(100vh - 104px);
  overflow: auto;
}

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

.modal header h2 {
  margin: 0;
  min-width: 0;
}

.modal-body {
  padding: 16px;
}

.modal-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
  align-items: center;
}

.modal-form {
  display: grid;
  gap: 12px;
}

.modal-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.modal-form input,
.modal-form textarea {
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 0;
}

.detail-list div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fafb;
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
}

.detail-list dd {
  margin: 4px 0 0;
}

.modal-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px 18px;
}

.modal-form-grid .field {
  min-width: 0;
}

.field-wide {
  grid-column: span 2;
}

.field-medium {
  grid-column: span 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

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

.kx-section {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.kx-section h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 38px;
  margin: 0;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: #f1f5f6;
}

.kx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 10px 18px;
  padding: 12px;
}

.kx-field {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.kx-field span {
  line-height: 1.35;
  text-align: right;
  word-break: keep-all;
}

.kx-field input,
.kx-field select,
.kx-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
}

.kx-field textarea,
.field textarea {
  min-height: 64px;
  resize: vertical;
}

.required {
  color: var(--red);
  margin-right: 3px;
}

.kx-mini-table {
  padding: 0 12px 12px;
  overflow-x: auto;
}

.kx-mini-table table {
  min-width: 760px;
  background: #fff;
}

.dictionary-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.dictionary-group {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.dictionary-group h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--text);
}

.dictionary-group h3 span {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.dictionary-category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
}

.dictionary-category-list span {
  padding: 4px 8px;
  border: 1px solid #d8e1ee;
  border-radius: 4px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1.3;
}

.dictionary-group-summary {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 14px 12px;
  color: #64748b;
}

.dictionary-group-summary strong {
  color: #0f6db8;
  font-size: 22px;
}

.dictionary-table table {
  min-width: 980px;
}

.dictionary-merged-cell {
  min-width: 108px;
  background: #fbfdff;
  color: #31444c;
  font-weight: 600;
  vertical-align: top;
}

.dictionary-group-cell {
  background: #eef6ff;
  color: #0f6db8;
  border-right: 1px solid #d7e7f7;
}

button,
input,
select,
textarea {
  outline-color: var(--focus);
}

button {
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.app-shell {
  background: var(--bg);
}

.sidebar {
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.brand {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  background: #f8fafc;
  color: #173d42;
}

.menu {
  padding: 10px 8px 20px;
}

.menu-section {
  margin-bottom: 4px;
  border-bottom: 0;
}

.menu-button,
.submenu-button {
  position: relative;
  width: 100%;
  border-radius: 6px;
}

.menu-button {
  min-height: 40px;
  padding: 0 10px;
  color: #f4fbfa;
  font-weight: 700;
}

.submenu {
  padding: 4px 0 7px;
  border-radius: 6px;
  background: rgba(10, 24, 27, 0.22);
}

.submenu-button {
  min-height: 32px;
  padding: 0 10px 0 38px;
  color: #dbe7e5;
}

.menu-button:hover,
.submenu-button:hover {
  background: var(--nav-hover);
}

.menu-button.active,
.submenu-button.active {
  background: var(--nav-active);
  color: #fff;
}

.submenu-button.active::before {
  content: "";
  position: absolute;
  left: 22px;
  width: 3px;
  height: 16px;
  border-radius: 999px;
  background: #8ad7ff;
}

.chevron,
.flyout-chevron {
  transition: transform 0.16s ease;
}

.menu-section.open > .menu-button .chevron {
  transform: rotate(90deg);
}

.status-flyout {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
}

.topbar {
  min-height: 68px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.eyebrow {
  letter-spacing: 0;
}

h1 {
  font-size: 21px;
  font-weight: 750;
}

.icon-button,
.primary,
.secondary,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.icon-button {
  border-color: #cfdae2;
  background: #fff;
  color: #29444d;
}

.primary,
.secondary,
.ghost {
  min-height: 34px;
  line-height: 1;
}

.primary {
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(18, 100, 163, 0.16);
}

.primary:hover {
  border-color: #0e5287;
  background: #0e5287;
}

.secondary:hover,
.ghost:hover,
.icon-button:hover {
  border-color: #b9c7d2;
  background: #f7fafc;
}

.user-chip {
  border: 1px solid #d5e0de;
  border-radius: 6px;
  background: #f2f7f6;
  font-size: 13px;
}

.content {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 22px 36px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.toolbar,
.tabs {
  margin-bottom: 12px;
}

.toolbar {
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(17, 38, 48, 0.04);
}

.toolbar .primary,
.toolbar .secondary {
  min-width: 0;
  padding: 0 10px;
}

.search {
  flex: 1 1 280px;
  max-width: 440px;
  min-height: 34px;
  border-color: #cdd8e0;
  background: #fbfdff;
}

.search::placeholder {
  color: #8a9aa3;
}

.card,
.table-card,
.form-card,
.board-column {
  box-shadow: 0 8px 22px rgba(22, 37, 45, 0.05);
}

.card {
  padding: 14px 15px;
}

.metric-label,
.metric-note {
  line-height: 1.35;
}

.metric-value {
  margin: 7px 0 3px;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.workflow.form-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.workflow-step {
  min-width: 0;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(17, 38, 48, 0.04);
}

.table-card {
  border-color: #d5dee6;
  background: var(--panel);
}

.table-scroll {
  max-width: 100%;
  overflow: auto;
}

table {
  min-width: 1040px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  line-height: 1.45;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #52616a;
  background: var(--table-head);
  font-weight: 700;
}

tbody tr:hover td {
  background: #f8fbfd;
}

td.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

th:last-child,
td.actions {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 104px;
  background: #fff;
  box-shadow: -10px 0 18px -18px rgba(15, 23, 42, 0.45);
}

tbody tr:hover td.actions {
  background: #f8fbfd;
}

.empty-cell {
  height: 92px;
  color: var(--muted);
  text-align: center;
}

.detail-link {
  max-width: 180px;
  overflow: hidden;
  color: var(--blue);
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.status-tabs {
  gap: 6px;
  padding: 4px 0 2px;
}

.status-tabs button {
  min-height: 31px;
  border-radius: 6px;
}

.status-tabs button.active,
.status-tabs button:hover {
  background: #eaf4ff;
}

.status {
  gap: 5px;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid transparent;
  font-weight: 700;
  line-height: 1;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.status.blue {
  border-color: #cbe2f6;
  background: #edf6ff;
  color: var(--blue);
}

.status.green {
  border-color: #c8eadc;
  background: #ecf8f2;
  color: var(--green);
}

.status.amber {
  border-color: #f2d8a5;
  background: #fff8ea;
  color: var(--amber);
}

.status.red {
  border-color: #f2c7cc;
  background: #fff0f2;
  color: var(--red);
}

.status.violet {
  border-color: #d8d1ff;
  background: #f2f0ff;
  color: var(--violet);
}

.status.neutral {
  border-color: #d8e0e7;
  background: #f5f7f9;
  color: #6b7780;
}

.form-card {
  padding: 14px;
}

.form-card h2 {
  margin-bottom: 12px;
  color: #253941;
  font-size: 16px;
}

.field input,
.field select,
.field textarea,
.kx-field input,
.kx-field select,
.kx-field textarea,
.modal-form input,
.modal-form textarea {
  border-color: #cdd8e0;
  background: #fff;
  color: var(--text);
}

.field input[readonly],
.kx-field input[readonly] {
  background: #f7fafc;
  color: #51646d;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.kx-field input:focus,
.kx-field select:focus,
.kx-field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(18, 100, 163, 0.12);
}

.action-link {
  margin-right: 4px;
}

.action-icon {
  width: 26px;
  height: 26px;
  border-color: transparent;
  border-radius: 4px;
  background: #eef6fb;
  color: var(--blue);
  font-weight: 700;
}

.action-icon:hover {
  border-color: #b8d8ef;
  background: #e3f1fb;
}

.action-icon[title="驳回"],
.action-icon[title="删除"],
.action-icon[title="停用"],
.action-icon[title="登记异常"] {
  background: #fff3f4;
  color: var(--red);
}

.toast {
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.modal-overlay {
  align-items: start;
  padding: 28px;
  overflow: auto;
  background: rgba(16, 30, 36, 0.42);
}

.modal {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  resize: none;
}

.modal header {
  flex: 0 0 auto;
  min-height: 54px;
  background: #fbfdff;
}

.modal header h2 {
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-body {
  overflow: auto;
  background: #fff;
}

.modal-size-button {
  width: 34px;
  padding: 0;
}

.kx-section {
  overflow: hidden;
  background: #fff;
}

.kx-section h3 {
  background: #f7fafc;
  color: #253941;
}

.kx-grid {
  gap: 9px 16px;
}

.detail-list dd {
  overflow-wrap: anywhere;
}

/* V10: independent workbench scrolling and richer table tooling */
.app-shell {
  max-height: 100vh;
  max-height: 100dvh;
}

.table-scroll {
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
}

.dashboard-hero {
  position: relative;
  margin: -18px -22px 18px;
  min-height: clamp(220px, 31vh, 360px);
  padding: clamp(34px, 5vw, 58px) 32px 38px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(90deg, rgba(7, 27, 33, 0.78), rgba(13, 53, 62, 0.46) 48%, rgba(13, 42, 48, 0.22)),
    url("./assets/home-heavy-haul-road.png") center 58% / cover no-repeat;
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 19, 22, 0.08), rgba(6, 19, 22, 0.32)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 64px);
  pointer-events: none;
}

.dashboard-hero h2,
.dashboard-hero p {
  position: relative;
  margin: 0;
}

.dashboard-hero h2 {
  color: #fff;
  font-size: 26px;
  font-weight: 750;
}

.dashboard-hero p {
  max-width: 720px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.6;
}

.chart-grid,
.ops-wall-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 14px;
  margin: 0 0 14px;
}

.report-layout {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.report-data-first > .table-card {
  margin-bottom: 0;
}

.report-data-first > .report-chart-grid {
  margin: 0;
}

.report-data-first .table-scroll {
  max-height: min(44vh, 460px);
  overflow: auto;
  overscroll-behavior: contain;
}

.chart-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(22, 37, 45, 0.05);
}

.chart-wide {
  grid-column: span 2;
}

.chart-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin-bottom: 8px;
}

.chart-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 750;
}

.chart-card header span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.chart-card header strong {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 5px;
  background: #eef6f8;
  color: #21636b;
  font-size: 12px;
  font-weight: 700;
}

.chart-host {
  width: 100%;
  height: 272px;
  min-height: 240px;
}

.chart-fallback {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-empty {
  display: grid;
  place-items: center;
  height: 100%;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
}

.ops-wall {
  min-height: calc(100vh - 68px);
  margin: -18px -22px -36px;
  padding: 18px 22px 28px;
  background: #10292f;
  color: #e8f3f4;
}

.ops-wall-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(232, 243, 244, 0.14);
}

.ops-wall-head h2 {
  margin: 4px 0 0;
  color: #fff;
  font-size: 24px;
  letter-spacing: 0;
}

.ops-wall .eyebrow {
  color: rgba(232, 243, 244, 0.68);
}

.ops-wall-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.ops-wall-meta span {
  padding: 5px 9px;
  border: 1px solid rgba(232, 243, 244, 0.16);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(232, 243, 244, 0.8);
  font-size: 12px;
}

.ops-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.ops-kpi,
.ops-wall .chart-card,
.ops-live-list {
  border: 1px solid rgba(232, 243, 244, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

.ops-kpi {
  min-width: 0;
  padding: 12px;
}

.ops-kpi span,
.ops-kpi em {
  display: block;
  color: rgba(232, 243, 244, 0.65);
  font-size: 12px;
  font-style: normal;
}

.ops-kpi strong {
  display: block;
  margin: 6px 0 4px;
  color: #fff;
  font-size: 23px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ops-wall .chart-card h3 {
  color: #fff;
}

.ops-wall .chart-card header span {
  color: rgba(232, 243, 244, 0.66);
}

.ops-wall .chart-card header strong {
  background: rgba(255, 255, 255, 0.08);
  color: #cfecee;
}

.ops-live-list {
  margin-top: 14px;
  padding: 14px;
}

.ops-live-list header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ops-live-list header strong {
  color: #fff;
}

.ops-live-list header span {
  color: rgba(232, 243, 244, 0.65);
  font-size: 12px;
}

.ops-live-list > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}

.ops-live-list article {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(232, 243, 244, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
}

.ops-live-list article strong,
.ops-live-list article span,
.ops-live-list article em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-live-list article strong {
  color: #fff;
  font-size: 13px;
}

.ops-live-list article span,
.ops-live-list article em {
  margin-top: 5px;
  color: rgba(232, 243, 244, 0.68);
  font-size: 12px;
  font-style: normal;
}

tbody tr:nth-child(even) td {
  background: #fafbfc;
}

tbody tr:nth-child(even):hover td {
  background: #f0f4f7;
}

.column-picker-wrap {
  position: relative;
}

.column-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  min-width: 224px;
  max-height: min(420px, 70vh);
  overflow: auto;
  padding: 8px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}

.column-panel label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 4px 14px;
  color: #31444c;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.column-panel label:hover {
  background: #f5f8fa;
}

.column-panel input[type="checkbox"] {
  accent-color: var(--blue);
}

.column-help {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

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

.column-panel .column-sortable-item,
.column-sortable-item {
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #fff;
  cursor: grab;
  user-select: none;
}

.column-sortable-item.dragging {
  opacity: 0.55;
}

.permission-tree {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding: 10px;
  border-top: 1px solid var(--line-soft);
}

.permission-node {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #fff;
  padding: 8px;
}

.permission-node header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.permission-node header span {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.permission-actions,
.role-check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.permission-actions label,
.role-check-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #f8fafb;
  font-size: 12px;
  cursor: pointer;
}

.permission-actions input,
.role-check-item input {
  margin: 0;
}

.role-check-list {
  max-height: 180px;
  overflow: auto;
  padding: 10px;
  border-top: 1px solid var(--line-soft);
}

.drag-handle {
  color: #94a3b8;
  font-size: 14px;
}

.column-actions {
  display: flex;
  gap: 6px;
  padding: 8px 14px 4px;
  border-top: 1px solid var(--line-soft);
}

.combo-input {
  position: relative;
  min-width: 0;
  z-index: 1;
}

.form-card,
.form-grid,
.kx-section,
.kx-grid {
  overflow: visible;
}

.field,
.kx-field {
  position: relative;
}

.field:focus-within,
.kx-field:focus-within,
.combo-input:focus-within {
  z-index: 3000;
}

.combo-input select {
  display: none;
}

.combo-input input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 28px 6px 9px;
  border: 1px solid #cdd8e0;
  border-radius: 5px;
  background:
    #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239BA8B2' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  color: var(--text);
}

.combo-input input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(18, 100, 163, 0.12);
}

.combo-dropdown {
  display: none;
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  right: 0;
  z-index: 3200;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #cdd8e0;
  border-radius: 0 0 5px 5px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.combo-dropdown.open {
  display: block;
}

.combo-option {
  padding: 7px 10px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
}

.combo-option:hover {
  background: #eef5f8;
  color: var(--blue);
}

.report-notice {
  margin: 0 0 10px;
  padding: 8px 11px;
  border: 1px solid #cdd8e0;
  border-radius: 5px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
}

.report-notice.success {
  border-color: #b8d8c6;
  background: #f2fbf5;
  color: #166534;
}

.report-notice.warning {
  border-color: #f2d18a;
  background: #fff8e8;
  color: #8a5a00;
}

.import-wizard {
  gap: 12px;
}

.import-wizard .kx-section {
  overflow: hidden;
}

.import-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
}

.import-steps div {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #d7e5e2;
  border-radius: 5px;
  background: #f8fafc;
  color: #52616a;
  font-size: 12px;
}

.import-steps strong {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #e8f1fb;
  color: var(--blue);
  font-size: 12px;
}

.import-steps span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 12px 12px;
}

.import-summary {
  margin: 0 12px 12px;
}

.import-preview {
  max-height: 340px;
  overflow: auto;
  background: #fff;
}

.import-preview .table-wrap {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.import-preview table {
  min-width: 980px;
}

tbody tr.is-selected {
  background: #eaf6f4 !important;
  outline: 1px solid #9fd3ca;
}

.selected-sum-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 9px 12px;
  border-top: 1px solid var(--line-soft);
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
}

.selected-sum-bar[hidden] {
  display: none;
}

.selected-sum-bar strong {
  color: var(--text);
}

.selected-sum-bar span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid #d7e5e2;
  border-radius: 999px;
  background: #fff;
}

.selected-sum-bar .tb-sumcfg {
  margin-left: auto;
}

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

.sum-column-list label {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: #f8fafc;
  cursor: pointer;
}

.sum-column-list input {
  accent-color: var(--blue);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast {
  animation: slideUp 0.25s ease;
}

.mobile-workbench {
  display: grid;
  gap: 14px;
  max-width: 1180px;
  margin: 0 auto;
}

.mobile-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.mobile-title-row h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.mobile-role {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid #c8d8dd;
  border-radius: 999px;
  background: #f8fbfc;
  color: #315e62;
  font-size: 12px;
  font-weight: 700;
}

.mobile-kpi-strip,
.mobile-action-grid,
.mobile-money-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mobile-kpi-strip > div,
.mobile-money-grid > div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mobile-kpi-strip span,
.mobile-money-grid strong {
  display: block;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.mobile-kpi-strip em,
.mobile-money-grid span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.mobile-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.mobile-tabs button,
.mobile-status-grid button,
.mobile-action-grid button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.mobile-tabs button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

.mobile-tabs button.active,
.mobile-tabs button:hover {
  border-color: #9fc4d6;
  background: #eaf4f8;
  color: var(--blue);
  font-weight: 700;
}

.mobile-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.mobile-section-head h3 {
  margin-bottom: 0;
  font-size: 15px;
}

.mobile-section-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.mobile-action-grid button {
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 10px;
  text-align: left;
}

.mobile-action-grid strong {
  font-size: 19px;
}

.mobile-action-grid span {
  color: var(--muted);
  font-size: 12px;
}

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

.mobile-status-grid button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  font-size: 13px;
}

.mobile-status-grid span {
  color: var(--muted);
  font-size: 12px;
}

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

.mobile-task-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfcfd;
}

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

.mobile-task-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mobile-task-card p {
  margin-bottom: 0;
  line-height: 1.45;
}

.mobile-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mobile-card-meta span {
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef3f6;
  color: #40545d;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.mobile-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mobile-card-actions .primary,
.mobile-card-actions .secondary {
  min-height: 34px;
  padding: 0 12px;
}

.mobile-timeline {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mobile-timeline li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 4px 10px;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfcfd;
}

.mobile-timeline span,
.mobile-timeline em,
.mobile-empty,
.mobile-profile-list dd,
.mobile-profile-list dt {
  color: var(--muted);
  font-style: normal;
}

.mobile-timeline em {
  grid-column: 2;
  overflow-wrap: anywhere;
}

.mobile-empty {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fafafa;
  text-align: center;
}

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

.mobile-bar-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.mobile-bar-row div {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef2;
}

.mobile-bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.mobile-bar-row em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
}

.mobile-profile-card {
  display: flex;
  gap: 12px;
  align-items: center;
}

.mobile-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: #e8f3f4;
  color: var(--nav);
  font-weight: 800;
}

.mobile-profile-card h3,
.mobile-profile-card p {
  margin-bottom: 0;
}

.mobile-profile-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.mobile-profile-list div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--line-soft);
}

.mobile-profile-list dt {
  font-weight: 700;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .content {
    padding: 16px;
  }

  .stats-grid,
  .module-grid,
  .report-grid,
  .chart-grid,
  .mobile-kpi-strip,
  .mobile-action-grid,
  .mobile-money-grid,
  .ops-wall-grid,
  .board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-kpi-strip,
  .ops-live-list > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

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

  .field-wide {
    grid-column: span 1;
  }
}

@media (max-width: 760px) {
  .login-page {
    background-position: center;
  }

  .login-card {
    width: calc(100vw - 36px);
    max-height: calc(100vh - 36px);
    padding: 24px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .sidebar {
    position: relative;
    height: min(34vh, 300px);
    max-height: min(34vh, 300px);
    overflow-y: auto;
  }

  .topbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
  }

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

  .content {
    padding: 12px;
  }

  .dashboard-hero {
    margin: -12px -12px 14px;
    padding: 34px 18px 30px;
  }

  .dashboard-hero h2 {
    font-size: 22px;
  }

  .ops-wall {
    margin: -12px -12px -24px;
    padding: 14px 12px 22px;
  }

  .ops-wall-head {
    flex-direction: column;
  }

  .ops-wall-meta {
    justify-content: flex-start;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar .search {
    flex-basis: 100%;
    max-width: none;
  }

  .toolbar .primary,
  .toolbar .secondary {
    flex: 1 1 142px;
  }

  table {
    min-width: 820px;
  }

  .date-range-popover {
    width: min(360px, calc(100vw - 24px));
  }

  .date-range-fields,
  .date-range-calendars {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 7px 8px;
  }

  .stats-grid,
  .module-grid,
  .report-grid,
  .chart-grid,
  .mobile-kpi-strip,
  .mobile-action-grid,
  .mobile-money-grid,
  .ops-wall-grid,
  .board,
  .dictionary-groups,
  .workflow {
    grid-template-columns: 1fr;
  }

  .mobile-title-row,
  .mobile-section-head,
  .mobile-task-card header {
    flex-wrap: wrap;
    align-items: flex-start;
  }

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

  .mobile-timeline li,
  .mobile-profile-list div {
    grid-template-columns: 1fr;
  }

  .mobile-timeline em {
    grid-column: auto;
  }

  .chart-wide {
    grid-column: span 1;
  }

  .chart-host {
    height: 240px;
  }

  .ops-kpi-strip,
  .ops-live-list > div {
    grid-template-columns: 1fr;
  }

  .field,
  .kx-field {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .modal-overlay {
    padding: 10px;
  }

  .modal,
  .modal-medium,
  .modal-large {
    width: 100%;
    max-height: calc(100vh - 20px);
  }

  .modal-full {
    width: 100%;
    height: calc(100vh - 20px);
  }

  .modal header {
    align-items: flex-start;
  }

  .modal-tools {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .modal-form-grid,
  .kx-grid {
    grid-template-columns: 1fr;
  }

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

  .detail-list {
    grid-template-columns: 1fr;
  }

  .dictionary-category-list span {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}
