:root {
  --bg: #eef1f3;
  --panel: #ffffff;
  --panel-2: #f7f9fa;
  --line: #d8dee3;
  --line-strong: #b7c2ca;
  --text: #1f2a30;
  --muted: #64727b;
  --sidebar: #22282d;
  --sidebar-2: #2d3439;
  --sidebar-text: #d9e0e4;
  --accent: #16847a;
  --accent-dark: #0e665f;
  --warn: #a76516;
  --danger: #a73c35;
  --ok: #2f7a48;
  --shadow: 0 16px 36px rgba(27, 35, 40, 0.16);
}

* {
  box-sizing: border-box;
}

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

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

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

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  border-right: 1px solid #171b1f;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 10px 0 24px rgba(16, 22, 26, 0.13);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  font-weight: 800;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.brand-subtitle {
  margin-top: 3px;
  font-size: 11px;
  color: #9ca9b1;
  text-transform: uppercase;
}

.nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px 10px 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.nav::-webkit-scrollbar {
  width: 8px;
}

.nav::-webkit-scrollbar-track {
  background: transparent;
}

.nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border: 2px solid var(--sidebar);
  border-radius: 999px;
}

.nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32);
}

.nav-section {
  margin: 12px 0 6px;
}

.nav-heading {
  padding: 8px 10px 6px;
  color: #96a3ab;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-item {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  padding: 7px 10px;
  color: var(--sidebar-text);
  background: transparent;
  border: 0;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition:
    background-color 150ms ease,
    color 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

.nav-item::before {
  content: "";
  position: absolute;
  inset: 5px auto 5px 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: var(--accent);
  opacity: 0;
  transform: scaleY(0.35);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.nav-item span {
  position: relative;
  z-index: 1;
}

.nav-item.sub {
  padding-left: 18px;
  min-height: 30px;
  font-size: 12px;
}

.nav-group {
  margin: 5px 0;
}

.nav-group summary {
  position: relative;
  list-style: none;
  min-height: 36px;
  padding: 9px 10px;
  border-radius: 6px;
  color: #f3f6f7;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-weight: 760;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition:
    background-color 150ms ease,
    color 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary::after {
  content: "›";
  color: #99a7af;
  font-size: 16px;
  transform: rotate(0deg);
  transition:
    color 150ms ease,
    transform 150ms ease;
}

.nav-group[open] > summary::after {
  transform: rotate(90deg);
}

.nav-group[open] > summary {
  background: rgba(255, 255, 255, 0.075);
  color: #fff;
}

.nav-group summary:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transform: translateX(2px);
}

.nav-group summary:hover::after {
  color: #dfe7eb;
}

.nav-group-body {
  padding: 5px 0 5px 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  margin-left: 10px;
}

.nav-group[open] > .nav-group-body {
  animation: navReveal 150ms ease-out;
}

.nav-group.nested {
  margin: 3px 0;
}

.nav-group.nested summary {
  min-height: 30px;
  padding: 7px 9px;
  background: transparent;
  color: #b9c5cc;
  font-size: 12px;
  font-weight: 720;
}

.nav-group.nested[open] > summary {
  color: #fff;
}

.nav-group.nested summary:hover {
  background: rgba(255, 255, 255, 0.07);
}

.nav-group.nested .nav-group-body {
  padding: 2px 0 4px 6px;
  margin-left: 8px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  transform: translateX(3px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(22, 132, 122, 0.28), var(--sidebar-2) 46%);
  color: #fff;
  box-shadow:
    inset 3px 0 0 var(--accent),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.nav-item.active::before,
.nav-item:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7f8d95;
  flex: 0 0 auto;
  transition:
    background-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.nav-item.active .nav-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(22, 132, 122, 0.17);
}

.nav-item:hover .nav-dot {
  background: #45b7ad;
  transform: scale(1.15);
}

.nav-item:focus-visible,
.nav-group summary:focus-visible {
  outline: 2px solid rgba(69, 183, 173, 0.85);
  outline-offset: 2px;
}

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

.topbar {
  height: 72px;
  padding: 13px 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex: 0 0 auto;
}

.kicker {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 3px 0 0;
  font-size: 21px;
  line-height: 1.25;
  font-weight: 720;
}

.topbar-actions,
.toolbar,
.toolbar-actions,
.pagination,
.modal-actions,
.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.content {
  padding: 18px 22px 24px;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

@keyframes navReveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-item,
  .nav-item::before,
  .nav-dot,
  .nav-group summary,
  .nav-group summary::after,
  .toast {
    transition: none;
  }

  .nav-group[open] > .nav-group-body {
    animation: none;
  }

  .nav-item:hover,
  .nav-group summary:hover {
    transform: none;
  }
}

.band {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
}

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

.band-title {
  font-size: 14px;
  font-weight: 730;
}

.band-body {
  padding: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px;
}

.metric {
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

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

.metric-value {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 760;
}

.metric-value.warn {
  color: var(--warn);
}

.metric-value.danger {
  color: var(--danger);
}

.metric-value.ok {
  color: var(--ok);
}

.metric-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

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

.table-wrap {
  width: 100%;
  overflow: auto;
  border-top: 1px solid var(--line);
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f4f6;
  color: #39464e;
  font-size: 12px;
  font-weight: 750;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #eef7f5;
}

tbody tr.selected {
  background: #dff1ee;
}

.toolbar {
  padding: 12px 14px;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right,
.toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.action-row {
  margin-top: 12px;
}

.search {
  width: 280px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
}

.field,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.field,
.select {
  height: 34px;
  padding: 0 9px;
}

.select.small {
  width: 150px;
}

.textarea {
  min-height: 88px;
  padding: 8px 9px;
  resize: vertical;
}

.btn {
  height: 34px;
  border: 1px solid var(--accent-dark);
  background: var(--accent);
  color: #fff;
  padding: 0 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 650;
}

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

.btn.ghost {
  background: #fff;
  color: var(--text);
  border-color: var(--line-strong);
}

.btn.ghost:hover {
  background: #f1f4f6;
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
}

.btn.warn {
  background: var(--warn);
  border-color: var(--warn);
}

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

.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 9px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tag.ok {
  color: var(--ok);
  border-color: #9bc5aa;
  background: #edf7f0;
}

.tag.warn {
  color: var(--warn);
  border-color: #d8b27b;
  background: #fff6e7;
}

.tag.danger {
  color: var(--danger);
  border-color: #d6aaa6;
  background: #fff0ee;
}

.pagination {
  justify-content: flex-end;
  padding: 10px 14px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 22, 26, 0.42);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 20;
}

.modal {
  width: min(980px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.modal.small {
  width: min(520px, calc(100vw - 48px));
}

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

.modal-title {
  font-size: 16px;
  font-weight: 750;
}

.modal-body {
  padding: 16px;
  overflow: auto;
}

.modal-actions {
  padding: 12px 16px;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

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

.form-field label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-field.full {
  grid-column: 1 / -1;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  color: var(--text);
  font-size: 13px;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.empty {
  padding: 34px 16px;
  text-align: center;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  min-width: 240px;
  max-width: 420px;
  padding: 12px 14px;
  background: #20272c;
  color: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 160ms ease;
  z-index: 30;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.run-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

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

.workflow-step,
.import-card {
  min-height: 112px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 8px;
  padding: 12px;
}

.workflow-step {
  cursor: pointer;
}

.workflow-step:hover,
.import-card:hover {
  border-color: var(--accent);
  background: #eef7f5;
}

.workflow-step span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  margin-bottom: 10px;
}

.workflow-step strong,
.import-title {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 760;
  margin-bottom: 6px;
}

.workflow-step small,
.import-desc {
  color: var(--muted);
  line-height: 1.45;
}

.import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.import-card .btn {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
}

.import-actions .btn {
  margin-top: 0;
}

.process-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
}

.process-step {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 11px;
}

.process-step span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #60717a;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.process-step.ok span {
  background: var(--ok);
}

.process-step.warn span {
  background: var(--warn);
}

.process-step strong {
  display: block;
  margin-top: 8px;
  font-size: 13px;
}

.process-step small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.insight-grid,
.question-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

.insight-card {
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.insight-title {
  font-weight: 760;
  color: var(--text);
}

.insight-body {
  color: var(--muted);
  line-height: 1.45;
  flex: 1 1 auto;
}

.insight-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.insight-foot span {
  color: var(--muted);
  font-size: 12px;
}

.detail-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 12px;
  margin-top: 12px;
}

.detail-block:first-child {
  margin-top: 0;
}

.detail-block strong,
.detail-block span {
  display: block;
  font-weight: 760;
  margin-bottom: 6px;
}

.detail-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.risk-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

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

.ai-question {
  width: 100%;
}

.quick-question-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.calendar-panel {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.calendar-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 760;
}

.calendar-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.calendar-month {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 10px;
}

.calendar-month-title {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  font-weight: 760;
  background: #f1f4f6;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(92px, 1fr));
}

.calendar-weekdays span {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 730;
  text-align: center;
}

.calendar-cell {
  min-height: 92px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 7px 8px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: default;
}

.calendar-cell:nth-child(7n) {
  border-right: 0;
}

.calendar-cell.has-data {
  cursor: pointer;
  background: #f8fbfb;
}

.calendar-cell.has-data:hover {
  background: #e9f6f3;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.calendar-cell.muted {
  background: #f7f9fa;
}

.calendar-cell strong {
  font-size: 13px;
}

.calendar-cell small,
.calendar-cell em {
  font-style: normal;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.calendar-cell em {
  color: var(--accent-dark);
  font-weight: 750;
}

.calendar-cell em.warn {
  color: var(--warn);
}

.calendar-cell em.ok {
  color: var(--ok);
}

.gantt {
  padding: 0 14px 14px;
  overflow-x: auto;
}

.gantt-row {
  display: grid;
  grid-template-columns: 220px minmax(760px, 1fr);
  min-height: 58px;
  border-top: 1px solid var(--line);
}

.gantt-machine {
  padding: 10px 12px 8px 0;
  border-right: 1px solid var(--line);
}

.gantt-machine strong {
  display: block;
  font-size: 13px;
}

.gantt-machine span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.gantt-track {
  position: relative;
  min-height: 58px;
  background:
    repeating-linear-gradient(
      to right,
      #f7f9fa 0,
      #f7f9fa 1px,
      transparent 1px,
      transparent 8.333%
    );
}

.gantt-bar {
  position: absolute;
  top: 9px;
  min-width: 34px;
  height: 40px;
  border: 1px solid #7ab0a7;
  border-radius: 6px;
  background: #dcefeb;
  color: #173e39;
  padding: 4px 6px;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  touch-action: none;
}

.gantt-bar:hover {
  z-index: 2;
  border-color: var(--accent-dark);
  box-shadow: 0 6px 16px rgba(16, 24, 28, 0.14);
}

.gantt-bar.dragging {
  z-index: 3;
  opacity: 0.82;
  box-shadow: 0 8px 18px rgba(16, 24, 28, 0.18);
}

.gantt-drag-ghost {
  position: absolute;
  top: 2px;
  z-index: 4;
  padding: 2px 6px;
  border-radius: 4px;
  background: #20272c;
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
}

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

.gantt-bar strong {
  font-size: 11px;
}

.gantt-bar span {
  margin-top: 2px;
  font-size: 10px;
}

.gantt-bar.warn {
  border-color: #d9a441;
  background: #fff0cc;
  color: #5a3b05;
}

.gantt-bar.mts {
  border-color: #8aa7c8;
  background: #e3edf8;
  color: #1c3b5d;
}

.gantt-bar.task {
  border-color: #9e9a73;
  background: #edecd9;
  color: #3f3b16;
}

.gantt-bar.manual {
  border-color: #2e7d63;
  background: #cfeadf;
  color: #10392d;
  box-shadow: inset 0 -3px 0 rgba(46, 125, 99, 0.25);
}

.inline-alert {
  margin-top: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px;
  background: #f7f9fa;
}

.inline-alert.danger {
  border-color: #e2a5a5;
  background: #fff4f4;
}

.inline-alert.warn {
  border-color: #e0c26c;
  background: #fff8e6;
}

.inline-alert.ok {
  border-color: #8fc7b1;
  background: #eef8f4;
}

.inline-alert strong {
  display: block;
  margin-bottom: 8px;
}

.mini-section {
  margin-top: 10px;
}

.mini-title {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

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

.summary-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 8px;
}

.summary-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

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

.summary-value {
  margin-top: 5px;
  font-weight: 750;
}

.loading {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.wide-left {
  grid-template-columns: minmax(420px, 1.2fr) minmax(320px, 0.8fr);
}

.loading-vehicle-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.loading-vehicle-card {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
  display: grid;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.loading-vehicle-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 8px 18px rgba(30, 64, 175, 0.12);
  transform: translateY(-1px);
}

.loading-vehicle-card.selected {
  border-color: #2563eb;
  background: #eff6ff;
}

.loading-vehicle-card strong {
  color: var(--text);
  font-size: 13px;
}

.loading-vehicle-card span,
.loading-vehicle-card small {
  color: var(--muted);
  font-size: 12px;
}

.loading-truck-panel {
  display: grid;
  gap: 10px;
}

.loading-truck-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.loading-truck-meta span {
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 999px;
  padding: 4px 9px;
}

.loading-truck-floor {
  position: relative;
  width: 100%;
  min-height: 260px;
  max-height: 620px;
  border: 2px solid #263241;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.16) 1px, transparent 1px),
    linear-gradient(0deg, rgba(148, 163, 184, 0.16) 1px, transparent 1px),
    #f8fafc;
  background-size: 6.25% 20%, 6.25% 20%;
  overflow: hidden;
}

.loading-truck-axis {
  position: absolute;
  z-index: 2;
  color: #64748b;
  font-size: 11px;
  pointer-events: none;
}

.loading-truck-axis.x {
  right: 10px;
  bottom: 8px;
}

.loading-truck-axis.y {
  left: 8px;
  top: 8px;
}

.loading-box {
  position: absolute;
  border: 1px solid rgba(15, 23, 42, 0.38);
  border-radius: 3px;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  overflow: hidden;
  min-width: 8px;
  min-height: 8px;
  padding: 0;
}

.loading-box span {
  display: block;
  font-size: 10px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 4px;
}

.loading-box em {
  position: absolute;
  right: 3px;
  bottom: 1px;
  font-style: normal;
  font-size: 10px;
  opacity: 0.86;
}

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

.loading-3d-host {
  position: relative;
  width: 100%;
  height: clamp(420px, 58vh, 720px);
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f3f6f8;
}

.loading-3d-host canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.loading-3d-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  display: grid;
  gap: 3px;
  max-width: 260px;
  padding: 7px 9px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
  font-size: 12px;
}

.loading-3d-tooltip span {
  color: rgba(255, 255, 255, 0.78);
}

.attention-band {
  border-color: #f59e0b;
  background: #fffbeb;
}

.attention-band .detail-block {
  background: #fff;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 228px minmax(0, 1fr);
  }
  .metric-grid,
  .summary-list,
  .process-flow {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
  .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }
  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }
  .sidebar {
    position: relative;
    top: auto;
    height: auto;
    min-height: auto;
    box-shadow: none;
  }
  .nav {
    max-height: 48vh;
    flex: 0 1 auto;
  }
  .topbar {
    height: auto;
    align-items: flex-start;
  }
  .main {
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .content {
    overflow: visible;
  }
  .metric-grid,
  .summary-list,
  .run-grid,
  .ai-ask-row,
  .form-grid,
  .process-flow,
  .insight-grid,
  .question-grid {
    grid-template-columns: 1fr;
  }
  .search {
    width: 100%;
  }
  .calendar-weekdays,
  .calendar-grid {
    grid-template-columns: repeat(7, minmax(44px, 1fr));
  }
  .calendar-cell {
    min-height: 76px;
    padding: 5px;
  }
  .loading-3d-host {
    height: 420px;
  }
}
