/* Deposit waiver confirmation uses the workspace's light/dark colors. */
.mianya-dialog { width: min(740px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.mianya-dialog::backdrop { background: rgba(3, 12, 24, .6); }
.mianya-form { display: grid; gap: 18px; padding: 28px; }
.mianya-form header p, .mianya-hint { color: var(--muted); font-size: 13px; margin: 0; }
.mianya-form h2 { margin: 6px 0 0; font-size: 23px; }
.mianya-form label { display: block; min-width: 0; font-weight: 600; }
.mianya-form input, .mianya-form textarea { display: block; margin-top: 9px; width: 100%; box-sizing: border-box; font: inherit; font-weight: 400; }
.mianya-form input:focus, .mianya-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.mianya-required { color: var(--danger); }
.mianya-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.mianya-preview { display: grid; gap: 8px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-size: 14px; max-height: 180px; overflow-y: auto; }
.mianya-form footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }
#mianyaProgress { margin: 0; color: var(--accent); overflow-wrap: anywhere; }
#mianyaProgress:empty, .mianya-results:empty, .mianya-preview:empty { display: none; }
.mianya-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.mianya-result-card { border: 1px solid var(--line); padding: 14px; border-radius: 10px; overflow-wrap: anywhere; }
.mianya-result-card img { display: block; width: 170px; max-width: 100%; margin: 10px auto; background: white; }
.mianya-result-card img[hidden] { display: none; }
.mianya-result-card a { color: var(--accent); }
@media (max-width: 560px) { .mianya-form { padding: 18px; gap: 16px; } .mianya-field-grid { grid-template-columns: 1fr; gap: 16px; } }

:root {
  color-scheme: light;
  /* 雾蓝、鼠尾草与蜜桃：取自品牌情绪板，同时保留足够的文字对比度。 */
  --bg: #f6f3ed;
  --surface: #fffdfa;
  --surface-muted: #edf2ec;
  --ink: #34413b;
  --muted: #657166;
  --line: #d8e0d6;
  --accent: #467985;
  --accent-strong: #365f69;
  --danger: #a95c57;
  --warn: #9a7041;
  --ok: #4f7961;
  --shadow: 0 14px 34px rgba(72, 86, 79, 0.11);
  --sidebar-bg: #48564f;
  --sidebar-ink: #fffaf2;
  --brand-mark-bg: #78abb7;
  --font-stack: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --font-scale: 1;
  --density-scale: 1;
  --component-radius: 8px;
  --sidebar-width: 260px;
}

/* Authenticated workspace settings */
.system-settings-dialog {
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  max-width: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 22px 60px rgba(35, 38, 42, 0.2);
}

.system-settings-dialog::backdrop {
  background: rgba(35, 38, 42, 0.32);
}

.system-settings-shell {
  display: grid;
  gap: 18px;
  max-height: calc(100dvh - 34px);
  padding: 22px;
  background: var(--surface);
  overflow-y: auto;
}

.system-settings-heading,
.system-settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.system-settings-heading p,
.system-settings-heading h3 {
  margin: 0;
}

.system-settings-heading p {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.system-settings-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.55);
}

.system-settings-status div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.system-settings-status span,
.system-settings-field small {
  color: var(--muted);
  font-size: 12px;
}

.system-settings-status strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-settings-field {
  display: grid;
  gap: 8px;
}

.system-settings-field textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
}

.system-settings-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.system-settings-actions {
  justify-content: flex-end;
}

.system-config-section {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.system-config-heading,
.system-portable-heading,
.system-portable-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.system-config-heading,
.system-portable-heading {
  justify-content: space-between;
}

.system-config-heading h4,
.system-config-heading p {
  margin: 0;
}

.system-config-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

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

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

.system-config-single {
  grid-template-columns: minmax(0, 1fr);
}

.system-config-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.system-config-grid label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.system-config-grid input,
.system-config-grid select,
.system-config-grid textarea {
  width: 100%;
}

.system-config-grid textarea {
  min-height: 112px;
  resize: vertical;
}

.system-portable-actions {
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.system-protection-section {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.system-protection-heading,
.system-protection-heading > div:last-child,
.system-protection-item,
.system-protection-item-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.system-protection-heading {
  justify-content: space-between;
}

.system-protection-heading h4,
.system-protection-heading p,
.system-protection-empty {
  margin: 0;
}

.system-protection-heading p,
.system-protection-empty {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.system-protection-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.system-recovery-health {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--ok) 30%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--ok) 8%, var(--surface));
  color: var(--muted);
  font-size: 12px;
}

.system-recovery-health strong {
  flex: 0 0 auto;
  color: var(--ink);
}

.system-protection-item {
  justify-content: space-between;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.5);
}

.system-protection-item > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.system-protection-item strong,
.system-protection-item span,
.system-protection-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-protection-item span,
.system-protection-item small {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 640px) {
  .system-settings-dialog {
    width: calc(100vw - 20px);
  }

  .system-settings-shell {
    padding: 16px;
  }

  .system-settings-status {
    grid-template-columns: 1fr;
  }

  .system-config-grid,
  .system-config-option-grid {
    grid-template-columns: 1fr;
  }

  .system-protection-heading,
  .system-protection-item {
    align-items: stretch;
    flex-direction: column;
  }

  .system-protection-heading > div:last-child,
  .system-protection-item-actions,
  .system-portable-heading,
  .system-portable-actions {
    flex-wrap: wrap;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-stack);
  font-size: calc(16px * var(--font-scale));
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(52, 65, 59, 0.7);
  backdrop-filter: blur(5px);
}

.auth-gate[hidden] { display: none; }

.auth-card {
  width: min(100%, 390px);
  padding: 32px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.auth-card h1 { margin: 14px 0 6px; font-size: 24px; }
.auth-card p { color: var(--muted); }
.auth-card form { display: grid; gap: 14px; margin-top: 22px; }
.auth-card form[hidden] { display: none; }
.auth-card label { display: grid; gap: 6px; color: var(--muted); font-size: 14px; }
.auth-card input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.auth-secondary-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.auth-secondary-actions .text-button { padding: 4px 0; }
.auth-message { min-height: 22px; margin: 14px 0 0; font-size: 14px; }
.auth-message.error { color: var(--danger); }
.text-button { border: 0; background: transparent; color: var(--accent); }
.sync-status { color: var(--muted); font-size: 13px; white-space: nowrap; }
.sync-status[data-tone="pending"] { color: var(--accent-strong); }
.sync-status[data-tone="warn"] { color: var(--warn); }
.sync-status[data-tone="error"] { color: var(--danger); }

.booking-save-toast {
  position: fixed;
  z-index: 3000;
  left: 50%;
  bottom: 24px;
  max-width: min(88vw, 420px);
  padding: 11px 18px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  background: rgba(74, 101, 94, 0.94);
  box-shadow: 0 10px 30px rgba(47, 64, 59, 0.2);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.booking-save-toast.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.booking-save-toast.visible.has-action {
  pointer-events: auto;
}

.booking-save-toast.is-sync-warning {
  max-width: min(88vw, 560px);
  border-color: rgba(171, 132, 75, 0.36);
  border-radius: 8px;
  background: rgba(248, 240, 222, 0.96);
  box-shadow: 0 8px 26px rgba(68, 62, 49, 0.16);
  color: #735b35;
  font-weight: 650;
}

.booking-toast-action {
  flex: 0 0 auto;
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: #fff;
  color: #405b54;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.booking-toast-action:hover {
  background: #edf6f3;
}

.daily-export-reminder {
  position: fixed;
  z-index: 3200;
  top: 76px;
  right: 24px;
  width: min(430px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid #bfd8dd;
  border-radius: 14px;
  background: #f6fbfc;
  box-shadow: 0 18px 48px rgba(42, 66, 64, 0.2);
}

.daily-export-reminder p {
  margin: 6px 0 14px;
  color: var(--muted);
  line-height: 1.55;
}

.daily-export-actions,
.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.app-dialog-backdrop {
  position: fixed;
  z-index: 3600;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(34, 51, 50, 0.48);
  backdrop-filter: blur(3px);
}

.app-dialog {
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: hidden;
  padding: 22px;
  border: 1px solid #d4e1df;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(28, 45, 44, 0.28);
}

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

.app-dialog-heading h3,
.app-dialog-heading p {
  margin: 0;
}

.app-dialog-heading h3 {
  margin-top: 5px;
}

.booking-history-list {
  display: grid;
  gap: 10px;
  max-height: min(570px, calc(100vh - 190px));
  overflow-y: auto;
  padding-right: 6px;
}

.booking-history-item {
  padding: 13px 14px;
  border: 1px solid #d8e3e1;
  border-radius: 11px;
  background: #fbfcfa;
}

.booking-history-item.is-undone {
  opacity: 0.58;
  background: #f1f4f2;
}

.booking-history-item p {
  margin: 6px 0;
  color: var(--ink);
}

.booking-history-item .tag {
  margin-left: 8px;
}

.booking-navigation-dialog > p {
  margin: 0 0 22px;
  color: var(--muted);
}

.asset-category-dialog {
  width: min(520px, 100%);
}

.asset-category-dialog-message {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.65;
}

.asset-category-dialog label {
  margin-bottom: 14px;
}

.asset-category-dialog-error {
  margin: 0 0 14px;
  border: 1px solid #efb6b0;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff1f0;
  color: var(--danger);
  font-size: 13px;
}

.app-dialog-actions .danger-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 7px;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: calc(22px * var(--density-scale)) calc(18px * var(--density-scale));
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  overflow: hidden;
}

.sidebar-toggle {
  position: absolute;
  top: 18px;
  right: -14px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 28px;
  height: 36px;
  border: 1px solid #728279;
  border-radius: 8px;
  background: #5b6c63;
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.brand {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 52px;
}

.app-shell.sidebar-collapsed .sidebar {
  padding: 22px 15px;
}

.app-shell.sidebar-collapsed .sidebar-toggle {
  right: -14px;
}

.app-shell.sidebar-collapsed .sidebar-toggle {
  transform: rotate(180deg);
}

.app-shell.sidebar-collapsed .brand {
  grid-template-columns: 46px;
}

.app-shell.sidebar-collapsed .brand h1,
.app-shell.sidebar-collapsed .brand p {
  display: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: var(--brand-mark-bg);
  color: #ffffff;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.brand p,
.eyebrow {
  margin: 3px 0 0;
  color: #d9e4dd;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 30px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #edf2eb;
  text-align: left;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-item > span { display: inline-grid; place-items: center; width: 22px; color: #c9ded5; font-size: 17px; font-weight: 800; }
.nav-item > svg { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active > span, .nav-item:hover > span { color: #ffffff; }
.sidebar-footer { position:absolute; left:18px; right:18px; bottom:18px; display:grid; gap:8px; padding-top:14px; border-top:1px solid color-mix(in srgb, var(--sidebar-ink) 14%, transparent); }
.sidebar-footer-action { display:flex; align-items:center; gap:14px; width:100%; min-height:42px; padding:0 12px; border:0; border-radius:10px; background:transparent; color:var(--sidebar-ink); text-align:left; cursor:pointer; }
.sidebar-footer-action:hover { background:color-mix(in srgb, var(--accent) 18%, var(--sidebar-bg) 82%); }
.sidebar-footer-action span { width:22px; font-size:25px; line-height:1; color:#b8c6d8; text-align:center; }
.sidebar-footer-action strong { font-size:14px; font-weight:700; }
.app-shell.sidebar-collapsed .sidebar-footer { left:10px; right:10px; }
.app-shell.sidebar-collapsed .sidebar-footer-action { justify-content:center; padding:0; }
.app-shell.sidebar-collapsed .sidebar-footer-action strong { display:none; }
html[data-theme-preset="dark"] body { background:#081321; color:#e7edf7; }
html[data-theme-preset="dark"] .sidebar { background:#0e1728; border-right:1px solid #1d2a40; }
html[data-theme-preset="dark"] .workspace { background:#0a1423; }
html[data-theme-preset="dark"] .panel, html[data-theme-preset="dark"] .metric { background:#111e31; border-color:#22334b; box-shadow:0 12px 28px rgba(0,0,0,.18); }
html[data-theme-preset="dark"] .nav-item { color:#cbd7e8; }
html[data-theme-preset="dark"] .nav-item.active { background:#102d3e; border-color:#103f4b; color:#36e0c2; }
html[data-theme-preset="dark"] .nav-item.active > svg { color:#36e0c2; }
html[data-theme-preset="dark"] .panel-heading, html[data-theme-preset="dark"] .booking-edit-summary { background:#142238; border-color:#263a55; }
html[data-theme-preset="dark"] input, html[data-theme-preset="dark"] select, html[data-theme-preset="dark"] textarea { background:#0d192b; border-color:#2b405d; color:#edf4ff; }
/* Final dark surface pass: legacy component rules are intentionally overridden here. */
html[data-theme-preset="dark"] .workspace,
html[data-theme-preset="dark"] .view,
html[data-theme-preset="dark"] .form-workspace,
html[data-theme-preset="dark"] .schedule-layout,
html[data-theme-preset="dark"] .simulation-page,
html[data-theme-preset="dark"] .asset-workspace { color:#e7edf7; }
html[data-theme-preset="dark"] .panel,
html[data-theme-preset="dark"] .metric,
html[data-theme-preset="dark"] .task-panel,
html[data-theme-preset="dark"] .task-card,
html[data-theme-preset="dark"] .todo-item,
html[data-theme-preset="dark"] .income-panel,
html[data-theme-preset="dark"] .inventory-model-card,
html[data-theme-preset="dark"] .inventory-model-order-card,
html[data-theme-preset="dark"] .warehouse-card,
html[data-theme-preset="dark"] .booking-edit-summary,
html[data-theme-preset="dark"] .customer-check-panel,
html[data-theme-preset="dark"] .form-panel,
html[data-theme-preset="dark"] .checkout-sidebar,
html[data-theme-preset="dark"] .checkout-order,
html[data-theme-preset="dark"] .gantt-panel,
html[data-theme-preset="dark"] .simulation-controls-panel,
html[data-theme-preset="dark"] .simulation-pool-panel,
html[data-theme-preset="dark"] .simulation-board-panel,
html[data-theme-preset="dark"] .simulation-inspector-panel,
html[data-theme-preset="dark"] .simulation-model-card,
html[data-theme-preset="dark"] .simulation-order-card,
html[data-theme-preset="dark"] .simulation-summary-card,
html[data-theme-preset="dark"] .asset-editor-panel,
html[data-theme-preset="dark"] .asset-card,
html[data-theme-preset="dark"] .device-return-group,
html[data-theme-preset="dark"] .device-return-row,
html[data-theme-preset="dark"] .all-order-card,
html[data-theme-preset="dark"] .all-orders-model-group { background:#111e31 !important; border-color:#263a55 !important; color:#e7edf7 !important; }
html[data-theme-preset="dark"] .panel-heading,
html[data-theme-preset="dark"] .task-panel-heading,
html[data-theme-preset="dark"] .booking-form-heading,
html[data-theme-preset="dark"] .simulation-section-heading,
html[data-theme-preset="dark"] .asset-editor-heading { background:#142238 !important; border-color:#263a55 !important; color:#f2f6fc !important; }
html[data-theme-preset="dark"] h1, html[data-theme-preset="dark"] h2, html[data-theme-preset="dark"] h3, html[data-theme-preset="dark"] h4,
html[data-theme-preset="dark"] strong, html[data-theme-preset="dark"] label, html[data-theme-preset="dark"] .field-help,
html[data-theme-preset="dark"] .meta, html[data-theme-preset="dark"] small { color:#dce7f5; }
html[data-theme-preset="dark"] p, html[data-theme-preset="dark"] span { color:inherit; }
html[data-theme-preset="dark"] .ghost-button,
html[data-theme-preset="dark"] button:not(.nav-item):not(.sidebar-footer-action) { background:#172943; border-color:#35516f; color:#e9f1fb; }
html[data-theme-preset="dark"] .ghost-button:hover,
html[data-theme-preset="dark"] button:not(.nav-item):not(.sidebar-footer-action):hover { background:#203955; border-color:#4b7695; }
html[data-theme-preset="dark"] .primary-button { background:#1b8f91 !important; border-color:#35c3b4 !important; color:#f4ffff !important; }
html[data-theme-preset="dark"] .task-card.is-overdue, html[data-theme-preset="dark"] .simulation-order-card.is-adjusted { background:#302531 !important; border-color:#a26170 !important; }
html[data-theme-preset="dark"] .task-card.is-warning, html[data-theme-preset="dark"] .simulation-gantt-transfer.is-warning { background:#332e22 !important; border-color:#a78948 !important; }
html[data-theme-preset="dark"] table th, html[data-theme-preset="dark"] table td { background:#111e31; border-color:#263a55; color:#dce7f5; }
html[data-theme-preset="dark"] .sidebar-footer { border-color:#21324b; }
html[data-theme-preset="dark"] .dashboard-quick-actions { background:#0f1c2e !important; border-color:#263a55 !important; }
html[data-theme-preset="dark"] .inventory-date-range-field,
html[data-theme-preset="dark"] .stock-line-date-range-field,
html[data-theme-preset="dark"] .date-picker-field { background:#0d192b !important; color:#edf4ff !important; border-color:#35516f !important; }
html[data-theme-preset="dark"] .inventory-combination-panel { background:#122238 !important; border-color:#2b4563 !important; }
html[data-theme-preset="dark"] .inventory-combination-body { background:#0e1b2e !important; border-color:#263f5d !important; }
html[data-theme-preset="dark"] .inventory-combination-column { background:#13263c !important; border-color:#2b4968 !important; }
html[data-theme-preset="dark"] .inventory-combination-column-heading { background:#13263c !important; border-color:#2b4968 !important; }
html[data-theme-preset="dark"] .inventory-combination-card { background:#182e47 !important; border-color:#345371 !important; }
html[data-theme-preset="dark"] .inventory-combination-card strong { color:#edf4ff !important; }
html[data-theme-preset="dark"] .inventory-combination-card span,
html[data-theme-preset="dark"] .inventory-combination-column-heading span { color:#aebed2 !important; }
/* State overrides below intentionally outrank the task type. */
html[data-theme-preset="dark"] .task-card {
  --task-fill: #172b43;
  --task-line: #345574;
  --task-accent: #4ba7a2;
}
html[data-theme-preset="dark"] .task-card.task-type-checkout {
  --task-fill: #342925;
  --task-line: #805747;
  --task-accent: #d29170;
}
html[data-theme-preset="dark"] .task-card.task-type-checkin {
  --task-fill: #302d23;
  --task-line: #78673f;
  --task-accent: #c8ab66;
}
html[data-theme-preset="dark"] .task-card.task-type-return {
  --task-fill: #19313b;
  --task-line: #436d7b;
  --task-accent: #79b3c3;
}
html[data-theme-preset="dark"] .task-card.task-type-agent-review {
  --task-fill: #302b3e;
  --task-line: #716087;
  --task-accent: #b19ace;
}
html[data-theme-preset="dark"] .task-card.is-claim {
  --task-fill: #362d22;
  --task-line: #89663e;
  --task-accent: #d5a05f;
}
html[data-theme-preset="dark"] .task-card.is-waiver-release {
  --task-fill: #1c3430;
  --task-line: #46786b;
  --task-accent: #74baa5;
}
html[data-theme-preset="dark"] .task-card:is(.is-overdue, .has-pending-claim) {
  --task-fill: #3b252c;
  --task-line: #925664;
  --task-accent: #e18791;
}
html[data-theme-preset="dark"] .task-card.is-completed {
  --task-fill: #202a33;
  --task-line: #3c4c5a;
  --task-accent: #6c8190;
  opacity: 1;
}
html[data-theme-preset="dark"] .task-card:is(
  [class*="task-type-"], .is-claim, .is-waiver-release, .is-overdue, .is-completed
) {
  background: var(--task-fill) !important;
  border-color: var(--task-line) !important;
  box-shadow: inset 4px 0 0 var(--task-accent) !important;
}
html[data-theme-preset="dark"] .task-card .card-title,
html[data-theme-preset="dark"] .task-card .meta,
html[data-theme-preset="dark"] .task-card .task-meta-line,
html[data-theme-preset="dark"] .task-card .task-model-inline,
html[data-theme-preset="dark"] .task-card .task-title,
html[data-theme-preset="dark"] .task-card .task-meta { color:#e9f1fb !important; }
html[data-theme-preset="dark"] .task-card .task-agent-review-badge,
html[data-theme-preset="dark"] .task-card .task-status-badge { background:#263d56 !important; color:#d8f2ed !important; border-color:#477b83 !important; }
html[data-theme-preset="dark"] .task-progress-ring { background:conic-gradient(#42bdb0 var(--task-progress-angle), #263a55 0deg) !important; }
html[data-theme-preset="dark"] .todo-list input,
html[data-theme-preset="dark"] .todo-form input,
html[data-theme-preset="dark"] .todo-add-row input,
html[data-theme-preset="dark"] .income-summary-box,
html[data-theme-preset="dark"] .income-details,
html[data-theme-preset="dark"] .income-order-list,
html[data-theme-preset="dark"] .inventory-overview-toolbar input,
html[data-theme-preset="dark"] .inventory-model-grid > button { background:#111e31 !important; border-color:#2b4563 !important; color:#e7edf7 !important; }
html[data-theme-preset="dark"] .todo-list input { background:#182e47 !important; color:#edf4ff !important; }
html[data-theme-preset="dark"] .todo-list .todo-priority,
html[data-theme-preset="dark"] .todo-list button { background:#172943 !important; color:#dce7f5 !important; border-color:#35516f !important; }
html[data-theme-preset="dark"] .income-summary-box strong { color:#b8d7ee !important; }
html[data-theme-preset="dark"] .panel-heading .task-progress-counts span { background:#1b3047 !important; border-color:#3a5875 !important; color:#d5e3f2 !important; }
html[data-theme-preset="dark"] .panel-heading .task-progress-counts span strong { color:#eff6ff !important; }
html[data-theme-preset="dark"] .panel-heading .task-progress-counts .task-overdue-count { background:#4a2c35 !important; border-color:#a96570 !important; color:#ffd9d7 !important; }
html[data-theme-preset="dark"] .task-progress-counts .task-overdue-count strong { color:#ffe8e4 !important; }
html[data-theme-preset="dark"] .customer-check-item { background:#182e47 !important; border-color:#345574 !important; }
html[data-theme-preset="dark"] .customer-check-icon { background:#21485a !important; color:#8de1d2 !important; }
html[data-theme-preset="dark"] .customer-check-item strong { color:#b6c9dd !important; }
html[data-theme-preset="dark"] .customer-check-item span { color:#e7f0fb !important; }
html[data-theme-preset="dark"] .customer-check-item span.is-empty { color:#93a7bd !important; }
html[data-theme-preset="dark"] .booking-form-workspace input,
html[data-theme-preset="dark"] .booking-form-workspace select,
html[data-theme-preset="dark"] .booking-form-workspace textarea { background:#0d192b !important; color:#edf4ff !important; border-color:#35516f !important; }
html[data-theme-preset="dark"] .booking-form-workspace .booking-date-order-hint,
html[data-theme-preset="dark"] .booking-form-workspace .booking-date-source-hint,
html[data-theme-preset="dark"] .booking-form-workspace .booking-city-source-hint { background:#162b41 !important; color:#b9cce0 !important; border-color:#2e4b68 !important; }
html[data-theme-preset="dark"] .auth-gate,
html[data-theme-preset="dark"] .auth-card,
html[data-theme-preset="dark"] .auth-card h1,
html[data-theme-preset="dark"] .auth-card h2,
html[data-theme-preset="dark"] .auth-card p,
html[data-theme-preset="dark"] .auth-message { color:#e7edf7 !important; }
html[data-theme-preset="dark"] .auth-gate { background:rgba(5,13,25,.78) !important; }
html[data-theme-preset="dark"] .auth-card { background:#111e31 !important; border-color:#2b4563 !important; box-shadow:0 24px 70px rgba(0,0,0,.42) !important; }
html[data-theme-preset="dark"] .auth-card input,
html[data-theme-preset="dark"] .auth-card select { background:#0d192b !important; color:#edf4ff !important; border-color:#35516f !important; }

.app-shell.sidebar-collapsed .nav-item {
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 0;
}


.app-shell.sidebar-collapsed .nav-item { gap: 0; justify-content: center; font-size: 0; }
.app-shell.sidebar-collapsed .nav-item > svg { width: 23px; height: 23px; flex-basis: 23px; stroke-width: 2.1; }

.nav-item:hover,
.nav-item.active {
  background: #64756b;
  border-color: #8d9c91;
  color: #ffffff;
}

.workspace {
  min-width: 0;
  padding: 18px 22px;
}

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

.topbar h2 {
  margin: 4px 0 0;
  font-size: 28px;
  letter-spacing: 0;
}

.topbar-actions,
.button-row,
.filter-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.dashboard-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--component-radius);
  background: color-mix(in srgb, var(--surface) 86%, var(--surface-muted) 14%);
}

.dashboard-quick-actions button { min-height: 38px; }
.dashboard-quick-actions button span { margin-right: 5px; font-size: 16px; }

.task-panels {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

.task-panels > .panel,
.task-list,
.task-card,
.task-card .card-top {
  min-width: 0;
  max-width: 100%;
}

.dashboard-inventory-column {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.inventory-overview-toolbar {
  margin: -2px 0 14px;
}

.inventory-overview-toolbar .inventory-range-field-label {
  flex: 1 1 320px;
}

.inventory-date-range-field {
  cursor: pointer;
  font-weight: 700;
}

.inventory-category-filter-section {
  display: grid;
  gap: 8px;
  margin: -2px 0 14px;
}

.inventory-category-filter-section > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inventory-category-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inventory-category-filter {
  min-height: 34px;
  border: 1px solid #d4dfda;
  border-radius: 999px;
  background: var(--category-bg, #f4f7f5);
  color: var(--ink);
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.inventory-category-filter span {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  min-height: 20px;
  margin-left: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 10px;
}

.inventory-category-filter:hover,
.inventory-category-filter:focus-visible {
  border-color: var(--category-border, var(--accent));
  outline: none;
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

.inventory-category-filter.active {
  border-color: var(--category-accent, var(--accent));
  box-shadow: 0 0 0 3px var(--category-ring, rgba(67, 128, 142, 0.13));
  color: var(--category-ink, var(--accent-strong));
}

.inventory-overview-hint {
  margin: -6px 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.inventory-category-tone-1 {
  --category-bg: #f1f7f2;
  --category-border: #cadccf;
  --category-accent: #789d82;
  --category-ring: rgba(120, 157, 130, 0.16);
  --category-ink: #42634a;
}

.inventory-category-tone-2 {
  --category-bg: #eff6f8;
  --category-border: #c8dce1;
  --category-accent: #7197a1;
  --category-ring: rgba(113, 151, 161, 0.16);
  --category-ink: #416771;
}

.inventory-category-tone-3 {
  --category-bg: #faf5eb;
  --category-border: #e4d6bd;
  --category-accent: #ad8e5c;
  --category-ring: rgba(173, 142, 92, 0.15);
  --category-ink: #765d35;
}

.inventory-category-tone-4 {
  --category-bg: #f2f5f8;
  --category-border: #d1dbe4;
  --category-accent: #8095a8;
  --category-ring: rgba(128, 149, 168, 0.15);
  --category-ink: #536a7e;
}

.inventory-category-tone-5 {
  --category-bg: #f6f1f8;
  --category-border: #ddcfe3;
  --category-accent: #9a7ba6;
  --category-ring: rgba(154, 123, 166, 0.15);
  --category-ink: #6d5178;
}

.inventory-category-tone-6 {
  --category-bg: #f8f2ef;
  --category-border: #e2d1c8;
  --category-accent: #a47f6d;
  --category-ring: rgba(164, 127, 109, 0.15);
  --category-ink: #725344;
}

.inventory-category-tone-7 {
  --category-bg: #f1f7f6;
  --category-border: #c9deda;
  --category-accent: #719b94;
  --category-ring: rgba(113, 155, 148, 0.15);
  --category-ink: #456d66;
}

.inventory-category-tone-8 {
  --category-bg: #f7f6ef;
  --category-border: #dfddc7;
  --category-accent: #96926b;
  --category-ring: rgba(150, 146, 107, 0.15);
  --category-ink: #68653f;
}

.inventory-combination-panel {
  margin: 0 0 14px;
  border: 1px solid #d3dfdc;
  border-radius: 12px;
  background: #f9fbfa;
  overflow: hidden;
}

.inventory-combination-panel > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 13px 15px;
  cursor: pointer;
  list-style: none;
}

.inventory-combination-panel > summary::-webkit-details-marker {
  display: none;
}

.inventory-combination-panel > summary::after {
  content: "⌄";
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 22px;
  font-weight: 800;
  transition: transform 150ms ease;
}

.inventory-combination-panel[open] > summary::after {
  transform: rotate(180deg);
}

.inventory-combination-panel > summary > span:first-child {
  min-width: 0;
}

.inventory-combination-panel > summary strong,
.inventory-combination-panel > summary small {
  display: block;
}

.inventory-combination-panel > summary strong {
  color: var(--ink);
  font-size: 14px;
}

.inventory-combination-panel > summary small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.inventory-combination-summary {
  margin-left: auto;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.inventory-combination-body {
  display: grid;
  gap: 12px;
  border-top: 1px solid #dbe4e1;
  padding: 14px;
  background: #fffefa;
}

.inventory-combination-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
}

.inventory-combination-toolbar input {
  flex: 1 1 auto;
}

.inventory-combination-toolbar button {
  flex: 0 0 auto;
}

.inventory-combination-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  max-height: 430px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 1px 3px 4px 1px;
}

.inventory-combination-column {
  align-self: start;
  min-width: 0;
  border: 1px solid var(--category-border, #d8e2de);
  border-radius: 11px;
  background: var(--category-bg, #f7faf8);
  padding: 10px;
}

.inventory-combination-column-heading {
  position: sticky;
  top: -1px;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: -2px -2px 8px;
  border-bottom: 1px solid var(--category-border, #d8e2de);
  background: var(--category-bg, #f7faf8);
  padding: 4px 2px 9px;
}

.inventory-combination-column-heading strong {
  color: var(--category-ink, var(--ink));
}

.inventory-combination-column-heading span {
  color: var(--muted);
  font-size: 11px;
}

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

.inventory-combination-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 62px;
  border: 1px solid rgba(123, 145, 136, 0.2);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.66);
  padding: 9px;
}

.inventory-combination-card.selected {
  border-color: var(--category-accent, var(--accent));
  box-shadow: 0 0 0 2px var(--category-ring, rgba(67, 128, 142, 0.12));
}

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

.inventory-combination-card strong {
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.inventory-combination-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.inventory-combination-qty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inventory-combination-qty button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #cbdadd;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-strong);
  font-size: 17px;
  font-weight: 850;
  cursor: pointer;
}

.inventory-combination-qty button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.inventory-combination-qty b {
  min-width: 18px;
  color: var(--ink);
  text-align: center;
}

.inventory-combination-empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.inventory-combination-result {
  display: grid;
  grid-template-columns: minmax(200px, 0.8fr) minmax(0, 1.6fr);
  gap: 10px;
}

.inventory-combination-result-heading,
.inventory-combination-result-items,
.inventory-combination-empty-state {
  border: 1px solid #d8e3df;
  border-radius: 10px;
  background: #f5faf8;
  padding: 12px;
}

.inventory-combination-result-heading span,
.inventory-combination-result-heading strong,
.inventory-combination-result-heading small,
.inventory-combination-empty-state strong,
.inventory-combination-empty-state span {
  display: block;
}

.inventory-combination-result-heading span {
  color: var(--muted);
  font-size: 10px;
}

.inventory-combination-result-heading strong {
  margin-top: 4px;
  color: var(--accent-strong);
  font-size: 18px;
}

.inventory-combination-result-heading small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.inventory-combination-result-heading.has-shortage {
  border-color: #e4c9bc;
  background: #fcf5f0;
}

.inventory-combination-result-heading.has-shortage strong,
.inventory-combination-result-items .has-shortage strong {
  color: #a55a3d;
}

.inventory-combination-result-items {
  display: grid;
  gap: 8px;
}

.inventory-combination-result-items > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px dashed #dce5e1;
  padding-bottom: 7px;
}

.inventory-combination-result-items > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.inventory-combination-result-items span,
.inventory-combination-result-items strong {
  font-size: 11px;
}

.inventory-combination-result-items span {
  color: var(--muted);
}

.inventory-combination-result-items strong {
  color: var(--ink);
  text-align: right;
}

.inventory-combination-empty-state {
  grid-column: 1 / -1;
  text-align: center;
}

.inventory-combination-empty-state strong {
  color: var(--ink);
}

.inventory-combination-empty-state span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.income-toolbar {
  margin-bottom: 12px;
}

.income-toolbar .inline-date {
  flex: 1 1 150px;
}

.income-summary-box {
  border: 1px solid #d5e1dc;
  border-radius: 10px;
  background: linear-gradient(135deg, #edf6f6, #fffefa 72%);
  padding: 14px;
}

.income-summary-box > span {
  color: var(--muted);
  font-size: 12px;
}

.income-summary-box > strong {
  display: block;
  margin-top: 5px;
  color: var(--accent-strong);
  font-size: 28px;
}

.income-summary-box > p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.income-details {
  margin-top: 10px;
  border-top: 1px solid #dde5df;
  padding-top: 10px;
}

.income-details > summary {
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 750;
}

.income-detail-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.income-detail-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.income-detail-toolbar select {
  width: auto;
  min-width: 178px;
  min-height: 36px;
  padding: 6px 30px 6px 10px;
}

.income-order-list {
  display: grid;
  gap: 7px;
  max-height: 320px;
  margin-top: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.income-order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #dbe4df;
  border-radius: 8px;
  background: #fffefa;
  padding: 10px;
}

.income-order-row.is-canceled {
  border-color: #efc9cc;
  background: #fff1f2;
}

.income-order-row strong,
.income-order-row span {
  display: block;
}

.income-order-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.income-order-amount {
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 850;
  white-space: nowrap;
}

.inventory-shortage {
  color: #c92f4d;
}

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

.model-summary-card {
  position: relative;
  display: block;
  width: 100%;
  min-height: 112px;
  border: 1px solid var(--category-border, #d5e1dc);
  border-radius: 10px;
  background: var(--category-bg, #fffefa);
  color: var(--ink);
  padding: 14px 44px 14px 15px;
  text-align: left;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.model-summary-card::after {
  content: "›";
  position: absolute;
  top: 50%;
  right: 16px;
  translate: 0 -50%;
  color: var(--accent);
  font-size: 30px;
  line-height: 1;
}

.model-summary-card:hover,
.model-summary-card:focus-visible {
  border-color: var(--category-accent, var(--accent));
  box-shadow: 0 7px 20px rgba(61, 78, 69, 0.12);
  transform: translateY(-1px);
  outline: none;
}

.model-summary-card > span {
  color: var(--muted);
  font-size: 12px;
}

.model-summary-card > strong {
  display: block;
  margin-top: 3px;
  font-size: 17px;
}

.model-summary-card > p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.model-summary-card-hint {
  display: block;
  margin-top: 8px;
  color: var(--category-ink, var(--accent-strong));
  font-size: 12px;
  font-weight: 700;
}

.inventory-overview-empty {
  grid-column: 1 / -1;
}

.inventory-model-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 36px));
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  overflow: hidden;
  contain: layout paint;
  box-shadow: 0 26px 70px rgba(34, 45, 40, 0.28);
}

.inventory-model-dialog::backdrop {
  background: rgba(39, 53, 49, 0.52);
}

.inventory-model-dialog-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  max-height: min(760px, calc(100vh - 36px));
  padding: 18px;
  overflow: hidden;
  contain: layout paint;
}

.inventory-model-dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.inventory-model-dialog-heading p,
.inventory-model-dialog-heading h3 {
  margin: 0;
}

.inventory-model-dialog-heading p {
  color: var(--muted);
  font-size: 12px;
}

.inventory-model-dialog-heading h3 {
  margin-top: 3px;
  font-size: 21px;
}

.inventory-model-order-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  max-height: min(620px, calc(100vh - 150px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  contain: layout paint style;
  will-change: scroll-position;
}

.inventory-model-order-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #d8e2de;
  border-radius: 10px;
  background: #fffefa;
  padding: 13px;
  content-visibility: auto;
  contain: layout paint style;
  contain-intrinsic-size: 0 86px;
}

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

.inventory-model-order-card h4,
.inventory-model-order-card p {
  margin: 0;
}

.inventory-model-order-card h4 {
  font-size: 15px;
}

.inventory-model-order-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.inventory-model-order-line {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-model-order-request {
  color: color-mix(in srgb, var(--muted) 88%, var(--accent) 12%);
}

.inventory-model-order-qty {
  color: var(--accent-strong);
  font-weight: 800;
}

.metric {
  min-height: 104px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.split-grid,
.two-column {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.4fr);
  gap: 14px;
  align-items: start;
}

.schedule-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.form-workspace {
  max-width: 1100px;
}

.booking-form-workspace {
  display: grid;
  grid-template-columns: minmax(640px, 1.25fr) minmax(400px, 0.85fr);
  gap: 14px;
  align-items: start;
  max-width: none;
  container-type: inline-size;
}

.booking-form-workspace > .form-panel {
  min-width: 0;
}

.booking-form-workspace > .form-panel > .panel-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.customer-check-panel {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  background: linear-gradient(160deg, #f3f8f9 0%, #f8f5ff 100%);
  border-color: #cadde1;
}

.customer-check-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.customer-check-heading p,
.customer-check-heading h3,
.customer-check-copy-status {
  margin: 0;
}

.customer-check-heading p {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.customer-check-heading h3 {
  font-size: 19px;
}

.customer-check-heading .ghost-button {
  flex: 0 0 auto;
}

.customer-check-actions {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.customer-check-list {
  display: grid;
  gap: 9px;
}

.customer-check-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px;
  border: 1px solid #d7e2e4;
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.88);
}

.customer-check-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #e4f1f4;
  color: #437c89;
}

.customer-check-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.customer-check-item strong,
.customer-check-item span {
  display: block;
}

.customer-check-item strong {
  margin-bottom: 4px;
  color: #657278;
  font-size: 12px;
}

.customer-check-item span {
  color: var(--ink);
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.customer-check-item span.is-empty {
  color: #9ba5a8;
}

.customer-check-copy-status {
  min-height: 20px;
  margin-top: 9px;
  color: #437c89;
  font-size: 12px;
  text-align: right;
}

.schedule-layout .schedule-panel {
  order: 1;
}

.schedule-layout .form-panel {
  order: 2;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
  min-width: 0;
}

.schedule-panel {
  padding: 14px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 34px;
  margin-bottom: 12px;
}

.panel-heading h3 {
  margin: 0;
  font-size: 17px;
}

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

.booking-form-heading-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

#bookingFormTitle {
  min-width: 0;
  overflow-wrap: anywhere;
}

.booking-order-navigation {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.booking-order-navigation[hidden] {
  display: none;
}

.booking-order-navigation button {
  min-height: 32px;
  padding: 0 10px;
  white-space: nowrap;
}

.booking-form-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.booking-form-heading-actions span {
  flex: 1 1 260px;
  min-width: min(220px, 100%);
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-align: left;
}

.booking-form-heading-actions button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.booking-stepper { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:10px 12px; border:1px solid var(--line); border-radius:9px; background:var(--surface-muted); }
.booking-stepper button { border:0; border-radius:999px; padding:7px 11px; background:transparent; color:var(--muted); font-size:12px; font-weight:700; }
.booking-stepper button.active { background:var(--accent); color:#fff; }
.booking-stepper span { margin-left:auto; color:var(--muted); font-size:12px; }

.booking-start-new-button {
  min-height: 34px;
  padding: 0 13px;
  white-space: nowrap;
}

.booking-save-top-button {
  min-height: 34px;
  padding: 0 14px;
  white-space: nowrap;
}

.booking-delete-current-button {
  min-height: 34px;
  padding: 0 13px;
  border-color: #e3bdb3;
  background: #f8e9e4;
  color: #a45249;
}

.booking-delete-current-button:hover {
  border-color: #d9a69b;
  background: #f4ddd6;
}

.booking-delete-current-button:focus-visible {
  outline: 3px solid rgba(169, 92, 87, 0.2);
  outline-offset: 2px;
}

.booking-return-button {
  min-height: 32px;
  padding: 0 11px;
  white-space: nowrap;
}

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

.asset-workspace {
  height: calc(100vh - 122px);
  min-height: 560px;
  overflow: hidden;
}

.asset-workspace > .form-panel,
.asset-list-panel {
  max-height: 100%;
  overflow: hidden;
}

.asset-workspace > .form-panel {
  align-self: start;
  overflow-y: auto;
}

.asset-editor-panel {
  gap: 18px;
  padding: 20px;
  background: #fffdfa;
  container-type: inline-size;
}

.asset-editor-heading {
  align-items: flex-start;
  margin-bottom: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid #e3ebe7;
}

.asset-editor-heading h3,
.asset-editor-heading p {
  margin: 0;
}

.asset-editor-heading h3 {
  margin-top: 3px;
}

.asset-editor-eyebrow {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.asset-form-section {
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid #e0e9e5;
  border-radius: 11px;
  background: #fbfcfa;
}

.asset-form-section h4 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.asset-basic-grid,
.asset-classification-grid {
  align-items: start;
  gap: 13px;
}

.asset-classification-section {
  background: #f8fbf9;
}

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

.asset-classification-grid > label,
.asset-basic-grid > label {
  align-content: start;
}

.asset-supplement-section {
  background: #fcfbf8;
}

.asset-photo-field input {
  padding: 7px 9px;
}

.asset-photo-field input::file-selector-button {
  margin-right: 10px;
  border: 1px solid #cad8d3;
  border-radius: 7px;
  padding: 7px 11px;
  background: #eef4f0;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.asset-default-links-field {
  display: grid;
  gap: 9px;
  grid-column: 1 / -1;
  min-width: 0;
}

.asset-default-links-heading {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.asset-default-links-heading .field-help {
  font-weight: 500;
}

.asset-default-links-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  grid-auto-rows: minmax(38px, max-content);
  align-content: start;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  max-height: 190px;
  overflow-y: auto;
  padding: 2px;
}

.asset-default-link-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 38px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 7px 9px;
  cursor: pointer;
  overflow: hidden;
}

.asset-default-link-option:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface) 88%);
  color: var(--accent-strong);
}

.asset-default-link-option input {
  flex: 0 0 auto;
  width: 17px;
  min-width: 17px;
  min-height: 17px;
}

.asset-default-link-option span {
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.asset-default-link-option > .asset-default-link-qty {
  flex: 0 0 52px;
  width: 52px;
  min-width: 52px;
  min-height: 30px;
  padding: 4px 6px;
  font-size: 12px;
}

.asset-default-link-option > .asset-default-link-qty:disabled {
  display: none;
}

.asset-default-links-empty {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 10px;
  font-size: 12px;
}

.asset-notes-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: 13px;
  align-items: start;
}

.asset-form-actions {
  justify-content: flex-start;
  padding-top: 2px;
}

.asset-classification-section > .managed-category-field {
  grid-template-columns: minmax(200px, 1fr) auto;
  align-items: end;
  gap: 7px 10px;
}

.asset-classification-section > .managed-category-field > label,
.asset-classification-section > .managed-category-field > .field-help {
  grid-column: 1 / -1;
}

.asset-classification-section > .managed-category-field > select {
  grid-column: 1;
}

.asset-classification-section > .managed-category-field > .managed-party-actions {
  grid-column: 2;
  flex-wrap: nowrap;
}

@container (max-width: 760px) {
  .asset-classification-grid,
  .asset-notes-grid {
    grid-template-columns: 1fr;
  }

  .asset-classification-section > .managed-category-field {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .asset-classification-section > .managed-category-field > select,
  .asset-classification-section > .managed-category-field > .managed-party-actions,
  .asset-classification-section > .managed-category-field > .field-help {
    grid-column: 1;
  }
}

.asset-list-panel {
  display: flex;
  flex-direction: column;
}

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

.managed-party-field {
  display: grid;
  gap: 6px;
  align-content: start;
}

.managed-category-field {
  border: 1px solid #dbe4e1;
  border-radius: 9px;
  padding: 10px;
  background: #f8fbf9;
}

.managed-party-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.checkout-date-shortcuts .ghost-button {
  flex: 1 1 92px;
  white-space: nowrap;
}

.date-picker-field {
  cursor: pointer;
}

.date-picker-field.is-invalid {
  border-color: #c97767;
  background: #fff6f3;
  box-shadow: 0 0 0 2px rgba(201, 119, 103, 0.12);
}

.booking-date-order-hint,
.booking-date-validation {
  margin: -4px 0 0;
  font-size: 12px;
  line-height: 1.55;
}

.booking-date-order-hint {
  color: var(--muted);
}

.booking-city-source-hint,
.booking-date-source-hint {
  margin: -4px 0 0;
  padding: 8px 10px;
  border-radius: 9px;
  background: #f2f7f3;
  color: #557064;
  font-size: 12px;
  line-height: 1.55;
}

.booking-city-source-hint.is-conflict,
.booking-date-source-hint.is-conflict {
  background: #fff6df;
  color: #8a641d;
}

.booking-date-validation {
  border-left: 3px solid #c97767;
  border-radius: 7px;
  background: #fff3ef;
  padding: 8px 10px;
  color: #974838;
  font-weight: 700;
}

.inventory-date-range-field {
  cursor: pointer;
}

.date-picker-popover {
  position: fixed;
  z-index: 1000;
  width: min(520px, calc(100vw - 28px));
  border: 1px solid #c9d8da;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(18, 38, 43, 0.2);
  padding: 18px;
}

.date-range-picker-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -4px -4px 12px;
  border-radius: 10px;
  background: #eef6f5;
  padding: 9px 11px;
}

.date-range-picker-status strong {
  color: var(--accent-strong);
  font-size: 13px;
}

.date-range-picker-status span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.date-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.date-picker-month {
  color: var(--ink);
  font-size: 24px;
  font-weight: 850;
}

.date-picker-nav {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 42px;
  border: 1px solid #d4e0e2;
  border-radius: 9px;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
}

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

.date-picker-weekday {
  display: grid;
  place-items: center;
  min-height: 34px;
  color: #607478;
  font-size: 16px;
  font-weight: 800;
}

.date-picker-day {
  display: grid;
  place-items: center;
  min-height: 56px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: #ffffff;
  color: var(--ink);
  font-size: 20px;
  font-weight: 750;
  cursor: pointer;
}

.date-picker-day:hover {
  border-color: #b8cccf;
  background: #eff7f6;
}

.date-picker-day.outside {
  color: #a8b5b8;
}

.date-picker-day.today {
  border-color: var(--accent);
}

.date-picker-day.selected {
  background: var(--accent);
  color: #ffffff;
}

.date-picker-day.in-range {
  border-color: #c9dddf;
  background: #e4f1f1;
  color: var(--accent-strong);
}

.date-picker-day.range-edge {
  border-color: var(--accent-strong);
  background: var(--accent);
  color: #ffffff;
}

.form-section-title {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.field-help {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

#assetDefaultLinksField[hidden] {
  display: none;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cdd8da;
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 9px 10px;
  outline: none;
}

textarea {
  resize: vertical;
}

#bookingAddress {
  min-height: 132px;
  line-height: 1.55;
}

.booking-edit-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 18px;
  padding: 14px;
  border: 1px solid #cbdde0;
  border-radius: 10px;
  background: #edf6f6;
}

.booking-edit-summary h4 {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  color: var(--accent-strong);
  font-size: 14px;
}

.booking-summary-item {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #d7e4df;
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
  text-align: left;
}

.booking-summary-item strong,
.booking-summary-item span,
.booking-summary-item small {
  display: block;
}

.booking-summary-item strong {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.booking-summary-item span {
  min-height: 42px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.booking-summary-item small {
  margin-top: 5px;
  color: var(--accent);
  font-size: 11px;
}

.booking-summary-item:hover,
.booking-summary-item:focus-visible {
  border-color: #8fb9c3;
  background: #f7fbfa;
  box-shadow: 0 0 0 3px rgba(120, 171, 183, 0.16);
}

.booking-summary-picker {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px solid #b9d5d9;
  border-radius: 10px;
  background: #fffdfa;
}

.summary-picker-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

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

.summary-picker-search-row {
  margin-bottom: 12px;
}

.summary-picker-search-row input {
  width: 100%;
  background: #ffffff;
}

.summary-picker-heading span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.summary-picker-heading-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  max-height: 330px;
  overflow: auto;
}

.summary-choice-grid.summary-request-choice-grid {
  display: block;
  max-height: none;
  overflow: visible;
  padding: 1px;
}

.summary-request-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.summary-request-column {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffefa;
}

.summary-request-column-lens {
  background: #f7fafb;
}

.summary-request-column-body {
  background: #f7faf7;
}

.summary-request-column-support {
  background: #fcfaf6;
}

.summary-request-column-heading,
.summary-request-subgroup-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
}

.summary-request-column-heading {
  position: static;
  min-width: 0;
  margin: -3px -3px 9px;
  padding: 5px 3px 9px;
  border-bottom: 1px solid var(--line);
  background: inherit;
  overflow-wrap: anywhere;
}

.summary-request-column-heading span,
.summary-request-subgroup-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.summary-request-column-list {
  display: grid;
  gap: 9px;
}

.summary-request-subgroup + .summary-request-subgroup {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.summary-request-subgroup-heading {
  margin: 2px 2px 8px;
  font-size: 13px;
}

.summary-request-column-empty {
  margin: 0;
  padding: 16px 8px;
  text-align: center;
}

.summary-search-empty {
  grid-column: 1 / -1;
  padding: 18px;
  text-align: center;
}

.summary-choice-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffefa;
  color: var(--ink);
  text-align: left;
}

/* Muted category colors make device types scannable without competing with content. */
.summary-choice-card.summary-category-body {
  border-color: #d2ded4;
  background: #eef4ef;
}

.summary-choice-card.summary-category-lens {
  border-color: #cfdee3;
  background: #edf4f6;
}

.summary-choice-card.summary-category-tripod {
  border-color: #e4d8c8;
  background: #f8f2e9;
}

.summary-choice-card.summary-category-dji {
  border-color: #ddd4e5;
  background: #f3eff6;
}

.summary-choice-card.summary-category-high-value {
  border-color: #e5c17f;
  background: #fff7e7;
}

.summary-choice-card.summary-category-transfer {
  border-color: #e2d2df;
  background: #f8f0f6;
}

.summary-choice-card.summary-category-other {
  border-color: #deddd7;
  background: #f6f5f1;
}

.summary-choice-card[hidden] {
  display: none;
}

.summary-choice-card.selected {
  border-color: #78abb7;
  box-shadow: inset 3px 0 0 var(--accent);
}

.summary-choice-card.summary-category-body.selected {
  background: #e2eee5;
}

.summary-choice-card.summary-category-lens.selected {
  background: #e1eef2;
}

.summary-choice-card.summary-category-tripod.selected {
  background: #f3eadc;
}

.summary-choice-card.summary-category-dji.selected {
  background: #ebe4f1;
}

.summary-choice-card.summary-category-high-value.selected {
  border-color: #b47718;
  background: #ffedc9;
}

.summary-choice-card.summary-category-transfer.selected {
  background: #f2e5ee;
}

.summary-choice-card.summary-category-other.selected {
  background: #ecebe5;
}

.summary-choice-card strong,
.summary-choice-card span {
  display: block;
  overflow-wrap: anywhere;
}

.summary-choice-card > div:first-child {
  min-width: 0;
}

.summary-choice-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.summary-choice-card .summary-request-stock {
  max-width: 100%;
  overflow: hidden;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-choice-card.request-stock-low .summary-request-stock {
  color: #8b681f;
}

.summary-choice-card.request-stock-unavailable .summary-request-stock,
.summary-choice-card.request-stock-shortage .summary-request-stock,
.summary-choice-card.request-stock-invalid .summary-request-stock {
  color: #9b4f48;
  font-weight: 600;
}

.summary-choice-card.request-stock-pending .summary-request-stock,
.summary-choice-card.request-stock-transfer .summary-request-stock {
  color: var(--muted);
}

.summary-qty-control {
  display: grid;
  grid-template-columns: 30px 26px 30px;
  align-items: center;
  text-align: center;
}

.summary-qty-control button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #bfd3d6;
  border-radius: 7px;
  background: #fff;
  color: var(--accent-strong);
}

.summary-qty-control button:disabled {
  opacity: 0.35;
}

.summary-accessory-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.summary-option-edit,
.summary-option-delete {
  padding: 5px 7px;
  border-radius: 7px;
  font-size: 11px;
  white-space: nowrap;
}

.summary-option-edit {
  border: 1px solid #bfd3d6;
  background: #f1f7f5;
  color: var(--accent-strong);
}

.summary-option-delete {
  border: 1px solid #efc8bd;
  background: #fff0eb;
  color: #b65b4d;
}

.booking-summary-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}


select[multiple] {
  min-height: 190px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.primary-button,
.ghost-button,
.small-button {
  min-height: 40px;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 650;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.ghost-button,
.small-button {
  background: var(--surface-muted);
  border-color: #d5e1e3;
  color: var(--ink);
}

.ghost-button.active {
  border-color: var(--accent);
  background: #e5f5f2;
  color: var(--accent-strong);
}

.small-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.danger-button {
  background: #fff1f0;
  border-color: #ffd6d3;
  color: var(--danger);
}

.import-button {
  display: inline-grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.import-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

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

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

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

th {
  background: #f1f5f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.asset-list,
.booking-list,
.movement-list,
.task-list {
  display: grid;
  gap: 10px;
}

.all-orders-toolbar {
  margin-bottom: 8px;
}

.all-orders-toolbar input {
  flex: 1 1 320px;
}

.all-orders-toolbar select {
  flex: 0 1 240px;
}

.all-orders-toolbar .inline-date {
  flex: 0 1 190px;
}

.all-orders-model-filter-trigger {
  display: grid;
  align-content: center;
  gap: 1px;
  flex: 0 1 190px;
  min-height: 48px;
  text-align: left;
}

.all-orders-model-filter-trigger span { color: var(--muted); font-size: 10px; }
.all-orders-model-filter-trigger strong {
  max-width: 180px;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.all-orders-model-filter-trigger.is-active,
.all-orders-floating-model-filter.is-active {
  border-color: #8f86bd;
  background: #f1edff;
  color: #5f518f;
}

.orders-view-hint {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.all-orders-sticky-controls {
  position: sticky;
  top: 12px;
  z-index: 45;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  width: 100%;
  margin: 0 0 10px;
  pointer-events: none;
}

.all-orders-floating-filter-shell {
  display: none;
  gap: 7px;
  min-width: 0;
  border: 1px solid rgba(199, 214, 207, 0.9);
  border-radius: 12px;
  padding: 7px;
  background: rgba(255, 253, 250, 0.96);
  box-shadow: 0 8px 24px rgba(46, 62, 55, 0.14);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.all-orders-sticky-controls.is-search-visible .all-orders-floating-filter-shell { display: grid; }

.all-orders-floating-primary {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 116px;
  gap: 7px;
  min-width: 0;
}

.all-orders-floating-search {
  display: flex;
  min-width: 0;
}

.all-orders-floating-search > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.all-orders-floating-search input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border-color: rgba(91, 139, 150, 0.42);
  background: rgba(255, 255, 255, 0.84);
}

.all-orders-floating-search input:focus {
  border-color: #6f9eaa;
}

.all-orders-jump-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0;
  border: 1px solid rgba(199, 214, 207, 0.9);
  border-radius: 10px;
  padding: 7px;
  background: rgba(255, 253, 250, 0.94);
  box-shadow: 0 8px 24px rgba(46, 62, 55, 0.14);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.all-orders-jump-actions button {
  min-height: 36px;
  white-space: nowrap;
}

.all-orders-floating-model-filter {
  display: grid;
  align-content: center;
  gap: 1px;
  min-width: 0;
  min-height: 38px;
}

.all-orders-floating-model-filter span { font-size: 10px; line-height: 1; }
.all-orders-floating-model-filter strong { font-size: 12px; line-height: 1.1; }

.all-orders-floating-more-toggle { display: none; min-height: 38px; }
.all-orders-floating-more-toggle span { font-size: 10px; }
.all-orders-floating-more-toggle strong {
  display: inline-grid;
  min-width: 19px;
  min-height: 19px;
  place-items: center;
  border-radius: 999px;
  background: #e6ece9;
  font-size: 10px;
}

.all-orders-floating-more-toggle.is-active strong { background: #ece7ff; color: #5f518f; }

.all-orders-floating-secondary {
  display: grid;
  grid-template-columns: repeat(2, minmax(142px, 0.8fr)) minmax(155px, 1fr) minmax(185px, 1.15fr) auto;
  gap: 7px;
  min-width: 0;
}

.all-orders-floating-secondary label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.all-orders-floating-secondary input,
.all-orders-floating-secondary select,
.all-orders-floating-secondary button {
  min-width: 0;
  min-height: 38px;
  padding: 6px 8px;
}

@media (min-width: 641px) and (max-width: 1540px) {
  .all-orders-sticky-controls { grid-template-columns: 1fr; }
  .all-orders-jump-actions { justify-self: end; }
}

.all-orders-model-dialog {
  width: min(900px, calc(100vw - 32px));
  max-height: min(780px, calc(100dvh - 40px));
  margin: auto;
  border: 0;
  border-radius: 18px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(39, 50, 46, 0.22);
}

.all-orders-model-dialog::backdrop {
  background: rgba(31, 41, 38, 0.42);
  backdrop-filter: blur(3px);
}

.all-orders-model-dialog-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  max-height: min(780px, calc(100dvh - 40px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: inherit;
  background: var(--surface);
}

.all-orders-model-dialog-heading,
.all-orders-model-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}

.all-orders-model-dialog-heading {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(120deg, #eef8ff, #f8f0ff 62%, #fff5eb);
}

.all-orders-model-dialog-heading p,
.all-orders-model-dialog-heading h3 { margin: 0; }
.all-orders-model-dialog-heading p { color: #7b78a3; font-size: 10px; font-weight: 850; letter-spacing: 0.13em; }
.all-orders-model-dialog-heading h3 { margin-top: 2px; font-size: 20px; }
.all-orders-model-dialog-heading span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

.all-orders-model-dialog-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(210px, 0.45fr);
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.all-orders-model-dialog-controls label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
.all-orders-model-groups {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 10px;
  overflow-y: auto;
  padding: 14px 18px 18px;
  overscroll-behavior: contain;
}

.all-orders-model-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
  min-width: 0;
}

.all-orders-model-group {
  align-self: start;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dce3e1;
  border-radius: 13px;
  background: #f8faf9;
}

.all-orders-model-group.category-body { background: #edf7ff; border-color: #cfe1ef; }
.all-orders-model-group.category-lens { background: #f2f5ff; border-color: #d7ddf0; }
.all-orders-model-group.category-tripod { background: #fff7ea; border-color: #eadfc9; }
.all-orders-model-group.category-dji { background: #f7f0ff; border-color: #e1d4ec; }
.all-orders-model-group.category-high-value { background: #fff0f1; border-color: #ead4d6; }

.all-orders-model-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 11px 8px;
  border-bottom: 1px solid rgba(110, 125, 118, 0.13);
}

.all-orders-model-group > header span { color: var(--muted); font-size: 10px; }
.all-orders-model-group > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 9px; }
.all-orders-model-option {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid rgba(122, 135, 130, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.all-orders-model-option:hover { border-color: #9389bd; transform: translateY(-1px); }
.all-orders-model-option.is-selected {
  border-color: #8478b5;
  background: #ece7ff;
  box-shadow: inset 4px 0 0 #8c7fc0, 0 3px 10px rgba(93, 77, 148, 0.09);
}
.all-orders-model-option strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.all-orders-model-option span { color: var(--muted); font-size: 9px; }
.all-orders-model-empty { grid-column: 1 / -1; display: grid; place-items: center; min-height: 180px; color: var(--muted); text-align: center; }
.all-orders-model-empty strong,
.all-orders-model-empty span { display: block; }

.all-orders-model-dialog-actions {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.all-orders-model-dialog-actions button { min-width: 130px; }

.all-orders-list {
  max-height: none;
  contain: layout style;
}

.all-orders-window-edge {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px dashed #c7d6d0;
  border-radius: 7px;
  background: #f3f7f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.all-orders-window-edge[hidden] {
  display: none;
}

.all-order-date {
  display: inline-flex;
  margin-bottom: 7px;
  border-radius: 999px;
  padding: 4px 9px;
  background: #e7f3f5;
  color: #315e68;
  font-size: 12px;
  font-weight: 700;
}

.all-order-card {
  border-left-width: 6px;
  content-visibility: auto;
  contain: layout paint style;
  contain-intrinsic-size: auto 238px;
}

.all-order-card[hidden] {
  display: none;
}

.all-orders-search-empty[hidden] {
  display: none;
}

.all-order-card[data-order-ship-date] {
  scroll-margin-top: 78px;
}

.all-order-card.order-stage-card-draft,
.all-order-card.order-stage-card-legacy_pending {
  border-left-color: #7b8b91;
  background: #f6f8f8;
}

.all-order-card.order-stage-card-pending_review,
.all-order-card.order-stage-card-pending_ship {
  border-left-color: #d59228;
  background: #fffaf0;
}

.all-order-card.order-stage-card-shipped,
.all-order-card.order-stage-card-in_rental {
  border-left-color: #2f7f8e;
  background: #f2fafb;
}

.all-order-card.order-stage-card-pending_return,
.all-order-card.order-stage-card-pending_checkin {
  border-left-color: #7656a8;
  background: #f8f4ff;
}

.all-order-card.order-stage-card-completed {
  border-left-color: #3d8a61;
  background: #f2faf5;
}

.all-order-card.order-stage-card-canceled {
  border-color: #efc3cd;
  border-left-color: #d85f78;
  background: #fff0f3;
}

.order-progress-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.order-progress-badge.order-stage-pending_review,
.order-progress-badge.order-stage-pending_ship {
  background: #f9e4b8;
  color: #7b4a00;
}

.order-progress-badge.order-stage-shipped,
.order-progress-badge.order-stage-in_rental {
  background: #cfe9ed;
  color: #205c67;
}

.order-progress-badge.order-stage-pending_return,
.order-progress-badge.order-stage-pending_checkin {
  background: #e8ddf7;
  color: #5c388d;
}

.order-progress-badge.order-stage-completed {
  background: #d9efe2;
  color: #2b6947;
}

.order-progress-badge.order-stage-draft,
.order-progress-badge.order-stage-legacy_pending {
  background: #e1e7e9;
  color: #536268;
}

.order-progress-badge.order-stage-canceled {
  background: #f7ccd6;
  color: #8d2940;
}

.order-progress-note {
  margin: 7px 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.order-stage-card-canceled .order-progress-note {
  color: #c92f4d;
}

.asset-list-panel .asset-list {
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.asset-card,
.booking-card,
.movement-card,
.task-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.task-card.task-type-checkout {
  border-color: #dfb9af;
  background: #fff8f5;
  box-shadow: inset 4px 0 0 #bd7668;
}

.task-card.task-type-checkin {
  border-color: #dbccaa;
  background: #fffaf1;
  box-shadow: inset 4px 0 0 #ad9360;
}

.task-card.task-type-return {
  border-color: #bfd2d7;
  background: #f5fafb;
  box-shadow: inset 4px 0 0 #7399a2;
}

.task-card {
  overflow: hidden;
}

.task-card.is-completed {
  background: #f2f5f3;
  opacity: 0.72;
  box-shadow: none;
}

.task-card.is-completed .card-title,
.task-card.is-completed .meta {
  text-decoration: line-through;
}

.task-card.is-overdue {
  border-color: #e6aa9c;
  background: #fff7f3;
  box-shadow: inset 4px 0 0 #d86f5d;
}

.task-card.task-type-agent-review {
  border-color: #d8a62f;
  background: linear-gradient(135deg, #fffaf0, #fff);
}

.task-agent-review-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #8a5a00;
  background: #fff0bd;
  font-size: 12px;
  font-weight: 700;
}

.task-card.is-claim {
  border-color: #e3bd78;
  background: #fffaf0;
  box-shadow: inset 4px 0 0 #ce8b2f;
}

.task-card.is-waiver-release {
  border-color: #b9d7ce;
  background: #f7fcfa;
  box-shadow: inset 4px 0 0 #4f877a;
}

.task-card.is-waiver-release.has-pending-claim {
  border-color: #e1786c;
  background: #fff8f6;
  box-shadow: inset 5px 0 0 #cf493e, 0 7px 20px rgba(169, 60, 48, 0.1);
}

.panel-heading .waiver-release-hint.has-pending-claim {
  border: 1px solid #e78d82;
  border-radius: 999px;
  padding: 5px 9px;
  background: #ffe8e4;
  color: #a83b31;
  font-weight: 850;
}

.task-waiver-main {
  min-width: 0;
  flex: 1 1 auto;
}

.task-waiver-number-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.task-waiver-number-row strong {
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.task-waiver-claim-warning {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  border: 1px solid #e78d82;
  border-radius: 9px;
  padding: 9px 11px;
  background: #ffe4df;
  color: #8f3028;
  line-height: 1.45;
}

.task-waiver-claim-warning strong {
  font-size: 13px;
  font-weight: 900;
}

.task-waiver-claim-warning span {
  color: #a64b42;
  font-size: 12px;
}

.task-waiver-copy {
  min-height: 30px;
  padding: 5px 10px;
}

.task-order-open {
  min-width: 0;
  max-width: 100%;
  flex: 1 1 0;
  align-self: stretch;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.task-order-open:hover .card-title {
  color: var(--brand);
}

.task-meta-line {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-model-inline {
  color: #72817d;
  font-size: 0.88em;
}

.task-order-open:focus-visible {
  outline: 3px solid rgba(79, 135, 122, 0.28);
  outline-offset: 4px;
}

.task-heading-main,
.task-progress-summary,
.task-progress-counts {
  display: flex;
  align-items: center;
}

.task-heading-main {
  min-width: 0;
  gap: 16px;
  flex-wrap: wrap;
}

.task-progress-summary {
  gap: 11px;
}

.task-progress-counts {
  gap: 7px;
  flex-wrap: wrap;
}

.panel-heading .task-progress-counts span {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  border: 1px solid #d6e2dd;
  border-radius: 999px;
  padding: 5px 9px;
  background: #f3f7f5;
  color: #62756f;
  line-height: 1;
  white-space: nowrap;
}

.task-progress-counts strong {
  color: #304942;
  font-size: 14px;
}

.panel-heading .task-progress-counts .task-overdue-count {
  border-color: #e9b8ac;
  background: #fff1ec;
  color: #a94e40;
}

.task-progress-counts .task-overdue-count strong {
  color: #a33f32;
}

.task-progress-ring {
  --task-progress-angle: 0deg;
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
  background: conic-gradient(#4f877a var(--task-progress-angle), #dfe8e4 0deg);
  box-shadow: 0 0 0 1px rgba(79, 135, 122, 0.08);
}

.task-progress-ring::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  background: #fffdfa;
}

.panel-heading .task-progress-ring span {
  position: relative;
  z-index: 1;
  color: #365b52;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.task-complete-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 34px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.task-complete-toggle input {
  width: 20px;
  height: 20px;
  accent-color: #4c7d72;
  cursor: pointer;
}

.task-complete-toggle input:disabled {
  cursor: not-allowed;
}

.task-list-toggle {
  width: 100%;
  margin-top: 2px;
  padding: 11px 14px;
  border: 1px dashed #b8cbc5;
  border-radius: 10px;
  background: #f4f8f6;
  color: #496a62;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.task-list-toggle:hover {
  border-style: solid;
  background: #eaf3ef;
}

.task-overdue-badge {
  display: inline-flex;
  margin-top: 8px;
  border: 1px solid #e5aa9d;
  border-radius: 999px;
  padding: 4px 9px;
  background: #fde7e1;
  color: #a33f32;
  font-size: 12px;
  font-weight: 850;
}

.task-claim-badge {
  display: inline-flex;
  margin-top: 8px;
  border: 1px solid #e1b76e;
  border-radius: 999px;
  padding: 4px 9px;
  background: #fff0cc;
  color: #8b5a13;
  font-size: 12px;
  font-weight: 850;
}

.task-waiver-badge {
  display: inline-flex;
  margin-top: 8px;
  border: 1px solid #a8cfc3;
  border-radius: 999px;
  padding: 4px 9px;
  background: #dff1eb;
  color: #2f6a5b;
  font-size: 12px;
  font-weight: 850;
}

.task-transfer-badge {
  display: inline-flex;
  margin-top: 8px;
  border: 1px solid #d5c2e3;
  border-radius: 999px;
  padding: 4px 9px;
  background: #f4ebfa;
  color: #71478d;
  font-size: 12px;
  font-weight: 800;
}

.todo-add-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.todo-add-row input {
  flex: 1 1 auto;
}

.todo-add-row select,
.todo-heading-actions select {
  flex: 0 0 auto;
  width: auto;
  min-width: 104px;
  background: #f8faf8;
}

.todo-panel .panel-heading {
  align-items: flex-start;
  flex-wrap: wrap;
}

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

#todoCount {
  white-space: nowrap;
}

.todo-heading-actions select {
  min-width: 142px;
}

.todo-add-row .primary-button {
  flex: 0 0 auto;
  min-width: 68px;
  white-space: nowrap;
  word-break: keep-all;
}

.todo-list {
  display: grid;
  gap: 9px;
}

.todo-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  transition: border-color 120ms ease, background 120ms ease, opacity 120ms ease;
}

.todo-item.priority-urgent:not(.is-completed) {
  border-color: #e7b8ad;
  background: #fff8f5;
  box-shadow: inset 4px 0 #c96d5e;
}

.todo-item.priority-low:not(.is-completed) {
  border-color: #d7dce5;
  background: #f6f7fa;
  box-shadow: inset 4px 0 #98a3b3;
}

.todo-check {
  width: 20px;
  height: 20px;
  accent-color: #4c7d72;
}

.todo-text {
  min-width: 0;
  border-color: transparent;
  background: transparent;
  font-weight: 650;
}

.todo-text:focus {
  border-color: #9ccbd2;
  background: #ffffff;
}

.todo-priority-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 72px;
  border: 1px solid #d7e1dc;
  border-radius: 999px;
  background: #f1f5f2;
  color: #5d7169;
  overflow: hidden;
}

.todo-priority-control > span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 30px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 850;
  text-align: center;
  line-height: 1;
  pointer-events: none;
}

.todo-priority-control select {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100%;
  opacity: 0;
  cursor: pointer;
}

.todo-priority-control.priority-urgent {
  border-color: #e4b2a7;
  background: #fce6e0;
  color: #a4483e;
}

.todo-priority-control.priority-normal {
  border-color: #afd4ca;
  background: #e1f1ed;
  color: #347064;
}

.todo-priority-control.priority-low {
  border-color: #cfd5df;
  background: #e9edf3;
  color: #667184;
}

.todo-item.is-completed {
  background: #f2f5f3;
}

.todo-item.is-completed .todo-text {
  color: var(--muted);
  text-decoration: line-through;
}

@media (max-width: 620px) {
  .todo-add-row {
    align-items: stretch;
    flex-direction: column;
  }

  .todo-add-row select,
  .todo-heading-actions select {
    width: 100%;
  }

  .todo-heading-actions {
    align-items: flex-end;
    flex-direction: column;
  }

  .todo-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .todo-priority-control {
    grid-column: 2;
    justify-self: start;
  }
}

.booking-card.is-canceled {
  background: #f7f8f8;
  border-color: #d9e0e1;
}

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

.card-title {
  margin: 0;
  font-size: 15px;
}

.asset-card-main {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
}

.asset-photo {
  width: 74px;
  height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: #f4f7f8;
}

.asset-photo.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.asset-details {
  margin: 8px 0 0;
  color: #344447;
  font-size: 13px;
  line-height: 1.55;
}

.asset-default-links {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.asset-default-links strong {
  color: var(--accent-strong);
}

.occupy-cell {
  display: grid;
  gap: 4px;
}

.occupy-cell strong,
.occupy-cell span {
  display: block;
}

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

.mini-gantt {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.mini-gantt-header,
.mini-gantt-row {
  display: grid;
  grid-template-columns: 260px minmax(480px, 1fr);
}

.mini-corner,
.mini-label {
  position: sticky;
  left: 0;
  z-index: 2;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.mini-corner {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 10px;
  background: #f7fafb;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mini-days,
.mini-lane {
  display: grid;
}

.mini-day {
  display: grid;
  place-items: center;
  min-height: 46px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f7fafb;
  font-size: 11px;
}

.mini-day.in-query {
  background: #e8f7ef;
}

.mini-day strong,
.mini-day span {
  display: block;
}

.mini-label {
  min-height: 48px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

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

.mini-label span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.mini-lane {
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  background-size: 54px 100%;
  background-image: linear-gradient(to right, transparent calc(100% - 1px), var(--line) 1px);
}

.mini-bar {
  align-self: center;
  height: 30px;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background: #c8f1ce;
  color: #173a21;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 750;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tag.available {
  background: #e8f7ef;
  color: var(--ok);
}

.tag.reserved {
  background: #fff5df;
  color: var(--warn);
}

.tag.out {
  background: #e8f0ff;
  color: #2452a6;
}

.tag.maintenance {
  background: #fff0f0;
  color: var(--danger);
}

.tag.canceled {
  background: #eef1f2;
  color: #637276;
}

.tag.order-stage-draft,
.tag.order-stage-legacy_pending {
  background: #e1e7e9;
  color: #536268;
}

.tag.order-stage-pending_review,
.tag.order-stage-pending_ship {
  background: #f9e4b8;
  color: #7b4a00;
}

.tag.order-stage-shipped,
.tag.order-stage-in_rental {
  background: #cfe9ed;
  color: #205c67;
}

.tag.order-stage-pending_return,
.tag.order-stage-pending_checkin {
  background: #e8ddf7;
  color: #5c388d;
}

.tag.order-stage-completed {
  background: #d9efe2;
  color: #2b6947;
}

.tag.order-stage-canceled {
  background: #f7ccd6;
  color: #8d2940;
}

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

.clone-button {
  border-color: #9ccbd2;
  background: #e8f5f6;
  color: #285f69;
}

.availability-box {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
  color: var(--muted);
  padding: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.availability-box.ok {
  background: #edf9f2;
  border-color: #bde7cf;
  color: var(--ok);
}

.availability-box.bad {
  background: #fff1f0;
  border-color: #ffc9c4;
  color: var(--danger);
}

.availability-box.warning {
  background: #fbf7ec;
  border-color: #e4d4aa;
  color: #80652d;
}

.checkout-filter-box {
  display: grid;
  gap: 10px;
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(520px, 1.35fr);
  gap: 14px;
  align-items: start;
  height: calc(100vh - 122px);
  min-height: 560px;
  overflow: hidden;
}

.checkout-sidebar,
.warehouse-panel {
  max-height: 100%;
  overflow: hidden;
}

.checkout-sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  display: flex;
  flex-direction: column;
}

.warehouse-panel {
  display: flex;
  flex-direction: column;
}

.movement-panel {
  grid-column: 1 / -1;
  display: none;
}

.warehouse-panel .filter-row {
  margin-bottom: 12px;
}

.inline-check {
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  color: var(--ink);
  white-space: nowrap;
}

.inline-check input {
  width: 16px;
  min-height: 16px;
}

.warehouse-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.warehouse-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  cursor: grab;
  overflow: hidden;
}

.warehouse-card[class*="inventory-category-tone-"] {
  border-color: var(--category-border);
  background: var(--category-bg);
}

.warehouse-card[class*="inventory-category-tone-"]::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--category-accent);
}

.warehouse-card[class*="inventory-category-tone-"] > div {
  min-width: 0;
}

.warehouse-card[class*="inventory-category-tone-"] > div > span {
  color: var(--category-ink);
}

.warehouse-card:active {
  cursor: grabbing;
}

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

.warehouse-card span {
  margin-top: 3px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.warehouse-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.warehouse-transfer-card {
  grid-column: 1 / -1;
  min-height: 118px;
  cursor: default;
  border-color: #cdb6df;
  background: #fbf6ff;
}

.warehouse-transfer-card.selected {
  border-color: #a77cc2;
  box-shadow: inset 4px 0 0 #9b6ab8;
}

.warehouse-transfer-card > div > strong {
  color: #70458a;
}

.transfer-assignment-note {
  display: grid;
  gap: 4px;
  border: 1px solid #d8c3e7;
  border-radius: 8px;
  background: #fbf6ff;
  padding: 12px;
}

.transfer-assignment-note strong {
  color: #70458a;
}

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

.checked-out-box {
  margin-top: 12px;
}

.checkout-order-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  min-height: 96px;
  overflow-y: auto;
  margin-top: 12px;
  padding-right: 4px;
}

.checkout-order-card {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
}

.checkout-order-card:hover {
  border-color: #b8cccf;
  background: #f5faf9;
}

.checkout-order-card.active {
  border-color: var(--accent);
  background: #e9f8f5;
  box-shadow: inset 3px 0 0 var(--accent);
}

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

.checkout-order-card span,
.checkout-order-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.checkout-order {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfb;
  padding: 12px;
}

.checkout-long-info span,
.checkout-section-title {
  color: #607478;
  font-size: 12px;
  font-weight: 800;
}

.checkout-long-info {
  display: grid;
  gap: 8px;
}

.checkout-long-info div {
  border: 1px solid #d9e4e6;
  border-radius: 7px;
  background: #ffffff;
  padding: 8px 9px;
}

.checkout-long-info p,
.checkout-request-text {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.checkout-adjustment-panel { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--surface-muted) 65%, var(--surface) 35%); }
.checkout-adjustment-list { display: grid; gap: 6px; margin: 8px 0; font-size: 12px; }
.checkout-mismatch, .checkout-match { display:block; padding: 7px 9px; border-radius: 7px; }
.checkout-mismatch { background:#fff1ed; color:#9b4f42; }
.checkout-match { background:#ebf7ef; color:#3f7959; }

.checkout-section-title {
  margin-top: 12px;
}

.drop-zone {
  flex: 1;
  overflow-y: auto;
  min-height: 260px;
  border: 1px dashed transparent;
  border-radius: 8px;
}

.drop-zone.drag-over {
  border-color: var(--accent);
  background: #eaf8f5;
}

.assigned-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.assigned-asset {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #cfe5e2;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

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

.drop-hint {
  display: grid;
  place-items: center;
  min-height: 150px;
  border: 1px dashed #a9bdc1;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 16px;
}

.asset-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.asset-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #e7f5f3;
  color: #0b5f59;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.request-chip {
  gap: 8px;
}

.request-chip button {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: rgba(11, 95, 89, 0.12);
  color: #0b5f59;
  padding: 0;
  font-weight: 800;
}

.request-builder {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1fr) 100px auto;
  gap: 12px;
  align-items: end;
}

.sub-heading {
  margin-top: 16px;
}

.gantt-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.gantt-filter-grid > input:first-child,
.gantt-filter-grid .button-row {
  grid-column: span 2;
}

.gantt-daqq-filter {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf5f1;
  cursor: pointer;
}

.gantt-daqq-filter input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.gantt-daqq-filter span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.gantt-daqq-filter strong,
.gantt-daqq-filter small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-daqq-filter small {
  color: var(--muted);
  font-size: 0.72rem;
}

.gantt-daqq-filter:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}

.gantt-model-filter {
  grid-column: 1 / -1;
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
}

.gantt-model-filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gantt-model-filter-heading > div {
  display: grid;
  gap: 2px;
}

.gantt-model-filter-heading span {
  color: var(--muted);
  font-size: 0.86rem;
}

.gantt-model-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 8px;
  max-height: 190px;
  overflow-y: auto;
  padding: 2px 4px 2px 2px;
}

.gantt-model-card {
  display: grid;
  gap: 3px;
  min-height: 78px;
  padding: 10px 12px;
  text-align: left;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f5f7f4;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.gantt-model-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.gantt-model-card.is-selected {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent), 0 0 0 2px rgba(73, 134, 149, 0.12);
}

.gantt-model-card.category-body { background: #edf5f1; }
.gantt-model-card.category-lens { background: #edf5f7; }
.gantt-model-card.category-tripod { background: #f5f1e9; }
.gantt-model-card.category-dji { background: #f3eef6; }
.gantt-model-card.category-high-value { background: #fff3d9; }
.gantt-model-card.category-other { background: #f4f4f1; }

.gantt-model-card-category,
.gantt-model-card > span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
}

.gantt-model-card > strong {
  font-size: 0.98rem;
}

.gantt-model-empty {
  grid-column: 1 / -1;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.gantt-filter-grid .button-row {
  flex-wrap: nowrap;
}

.inline-date {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.gantt {
  overflow-x: auto;
  overflow-y: hidden;
  max-height: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.gantt-title {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  background: #eef5f4;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

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

.gantt-header,
.gantt-row {
  display: grid;
  grid-template-columns: 270px minmax(1612px, 1fr);
}

.gantt-header {
  position: sticky;
  top: 41px;
  z-index: 4;
}

.gantt-corner,
.gantt-label {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #ffffff;
  border-right: 1px solid var(--line);
}

.gantt-corner {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 12px;
  background: #f7fafb;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.gantt-days,
.gantt-lane {
  display: grid;
}

.gantt-day {
  display: grid;
  align-content: center;
  gap: 2px;
  min-height: 52px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  background: #f7fafb;
}

.gantt-day strong {
  color: var(--ink);
  font-size: 13px;
}

.gantt-day span {
  font-size: 11px;
}

.gantt-day.weekend {
  background: #f1f5f6;
}

.gantt-day.today {
  background: #dff6e8;
  color: var(--ok);
  font-weight: 800;
}

.gantt-label {
  min-height: 62px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

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

.gantt-label span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.gantt-lane {
  position: relative;
  min-height: 62px;
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(to right, transparent calc(100% - 1px), var(--line) 1px);
  background-size: 52px 100%;
}

.gantt-bar {
  border: 0;
  align-self: center;
  min-width: 34px;
  height: 36px;
  overflow: hidden;
  border-radius: 7px;
  background: #c8f1ce;
  color: #173a21;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  cursor: pointer;
}

.gantt-bar:hover {
  background: #aee8b8;
  box-shadow: inset 0 0 0 2px rgba(8, 116, 67, 0.18);
}

.empty-state {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #b7c5c8;
  border-radius: 8px;
  background: #f8fbfb;
}

.empty-state strong {
  display: block;
  color: var(--ink);
  margin-bottom: 5px;
}

@media (max-width: 1540px) {
  .booking-form-workspace {
    grid-template-columns: 1fr;
  }

  .customer-check-panel {
    position: static;
    max-height: none;
  }
}

@container (max-width: 1120px) {
  .booking-form-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-check-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 1280px) {
  .asset-workspace {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .asset-workspace > .form-panel,
  .asset-list-panel {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar-toggle {
    display: none;
  }

  .app-shell.sidebar-collapsed .sidebar {
    padding: 22px 18px;
  }

  .app-shell.sidebar-collapsed .brand {
    grid-template-columns: 46px 1fr;
  }

  .app-shell.sidebar-collapsed .brand h1,
  .app-shell.sidebar-collapsed .brand p {
    display: block;
  }

  .nav {
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    overflow-x: auto;
  }

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

  .booking-form-heading-actions {
    align-items: center;
    flex-direction: row;
  }

  .booking-order-navigation {
    flex-wrap: wrap;
  }

  .app-shell.sidebar-collapsed .nav-item {
    display: block;
    padding: 0 12px;
    font-size: inherit;
  }

  .nav-item > span { display: none; }

  .app-shell.sidebar-collapsed .nav-item::before {
    content: none;
  }

  .split-grid,
  .two-column,
  .checkout-layout,
  .schedule-layout,
  .metrics {
    grid-template-columns: 1fr;
  }

  .checkout-layout {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .asset-workspace {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .checkout-sidebar,
  .warehouse-panel,
  .asset-workspace > .form-panel,
  .asset-list-panel {
    max-height: none;
    overflow: visible;
  }

  .checkout-sidebar {
    position: static;
  }

  .warehouse-list,
  .asset-list-panel .asset-list,
  .drop-zone {
    overflow: visible;
  }

  .request-builder {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .booking-form-heading-main {
    align-items: stretch;
    flex-direction: column;
  }

  .booking-order-navigation {
    width: 100%;
  }

  .booking-order-navigation button,
  .booking-form-heading-actions button {
    flex: 1 1 calc(50% - 4px);
  }

  .booking-form-heading-actions span {
    flex-basis: 100%;
    min-width: 0;
  }

  .all-orders-sticky-controls {
    top: 8px;
    grid-template-columns: 1fr;
  }

  .all-orders-sticky-controls.is-search-visible {
    position: fixed;
    inset: auto 8px calc(8px + env(safe-area-inset-bottom));
    z-index: 90;
    width: auto;
    margin: 0;
    padding: 7px;
    border: 1px solid rgba(199, 214, 207, 0.94);
    border-radius: 14px;
    background: rgba(255, 253, 250, 0.96);
    box-shadow: 0 12px 36px rgba(38, 52, 47, 0.2);
    backdrop-filter: blur(12px);
    pointer-events: auto;
  }

  .all-orders-sticky-controls.is-search-visible .all-orders-floating-filter-shell {
    display: grid;
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .all-orders-floating-primary { grid-template-columns: minmax(0, 1fr) 76px 76px; }
  .all-orders-floating-more-toggle { display: grid; align-content: center; gap: 1px; }
  .all-orders-floating-secondary { display: none; grid-template-columns: 1fr 1fr; }
  .all-orders-sticky-controls.is-filters-expanded .all-orders-floating-secondary { display: grid; }
  .all-orders-floating-secondary label { grid-template-columns: 1fr; gap: 3px; }
  .all-orders-floating-secondary select { width: 100%; }
  .all-orders-floating-secondary button { grid-column: 1 / -1; }

  .all-orders-jump-actions {
    width: 100%;
  }

  .all-orders-jump-actions button {
    flex: 1 1 0;
  }

  .all-orders-sticky-controls.is-search-visible .all-orders-jump-actions {
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .all-orders-list { padding-bottom: 142px; }
  .all-orders-sticky-controls.is-filters-expanded ~ .all-orders-list { padding-bottom: 330px; }

  .all-orders-model-filter-trigger {
    flex: 1 1 100%;
    width: 100%;
  }

  .all-orders-model-dialog {
    width: 100vw;
    max-width: none;
    max-height: 88dvh;
    margin: auto 0 0;
    border-radius: 20px 20px 0 0;
  }

  .all-orders-model-dialog-shell {
    max-height: 88dvh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
  }

  .all-orders-model-dialog-heading,
  .all-orders-model-dialog-actions { padding: 13px 14px; }
  .all-orders-model-dialog-heading h3 { font-size: 18px; }
  .all-orders-model-dialog-controls { grid-template-columns: 1fr; padding: 11px 14px; }
  .all-orders-model-groups { padding: 11px 14px 16px; }
  .all-orders-model-row { grid-template-columns: 1fr; }
  .all-orders-model-group > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .all-orders-model-dialog-actions { padding-bottom: calc(13px + env(safe-area-inset-bottom)); }
  .all-orders-model-dialog-actions button { flex: 1 1 0; min-width: 0; }

  .daily-export-reminder {
    top: 14px;
    right: 16px;
  }

  .app-dialog-backdrop {
    align-items: end;
    padding: 10px;
  }

  .app-dialog {
    max-height: calc(100vh - 20px);
    padding: 18px;
  }

  .app-dialog-actions > button {
    flex: 1 1 100%;
  }

  .workspace {
    padding: 16px;
  }

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

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

  .booking-edit-summary {
    grid-template-columns: 1fr;
  }

  .customer-check-heading {
    flex-direction: column;
  }

  .inventory-model-grid {
    grid-template-columns: 1fr;
  }

  .inventory-combination-panel > summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .inventory-combination-summary {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

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

  .inventory-combination-columns {
    grid-template-columns: 1fr;
  }

  .inventory-combination-result {
    grid-template-columns: 1fr;
  }

  .inventory-combination-result-items > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .inventory-combination-result-items strong {
    text-align: left;
  }

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

  .summary-choice-grid {
    grid-template-columns: 1fr;
  }

  .summary-request-columns {
    grid-template-columns: 1fr;
  }

  .gantt-filter-grid {
    grid-template-columns: 1fr;
  }

  .request-builder {
    grid-template-columns: 1fr;
  }

  .card-top {
    flex-direction: column;
  }

  .task-order-open {
    flex-basis: auto;
  }

  .task-panel-heading {
    flex-direction: column;
  }

  .task-heading-main {
    width: 100%;
    justify-content: space-between;
  }

  .task-progress-summary {
    gap: 8px;
  }

  .asset-card-main {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .assigned-asset,
  .warehouse-card {
    grid-template-columns: 1fr;
  }

  .asset-photo {
    width: 64px;
    height: 64px;
  }

}

@media print {
  body {
    background: #ffffff;
  }

  .sidebar,
  .topbar,
  .panel-heading span,
  .nav {
    display: none;
  }

  .workspace,
  .panel {
    padding: 0;
    box-shadow: none;
    border: 0;
  }

  .view {
    display: none !important;
  }

  .view.active {
    display: block !important;
  }
}

/* Pastel rental theme: warm paper base, mist-blue actions and peach highlights. */
body {
  background:
    radial-gradient(circle at 88% 4%, rgba(153, 205, 216, 0.3), transparent 28rem),
    radial-gradient(circle at 4% 96%, rgba(227, 195, 178, 0.22), transparent 26rem),
    var(--bg);
}

.panel,
.metric,
.asset-card,
.booking-card,
.movement-card,
.task-card,
.warehouse-card,
.date-picker-popover {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.metric:nth-child(2) {
  background: color-mix(in srgb, var(--surface) 88%, var(--ok) 12%);
}

.metric:nth-child(3) {
  background: color-mix(in srgb, var(--surface) 88%, var(--warn) 12%);
}

.metric:nth-child(4) {
  background: color-mix(in srgb, var(--surface) 88%, var(--danger) 12%);
}

input,
select,
textarea,
.date-picker-day {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(120, 171, 183, 0.28);
}

.ghost-button,
.small-button,
.date-picker-nav {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--ink);
}

.ghost-button.active,
.date-picker-day:hover {
  border-color: #8fb9c3;
  background: #e4f1f3;
  color: #365f69;
}

.availability-box.ok,
.status.available,
.status.reserved {
  background: #e8f0e8;
}

.availability-box.bad,
.danger-button {
  border-color: #efcabc;
  background: #fce9e2;
}

.gantt-day.weekend,
.gantt-lane:nth-child(even) {
  background: color-mix(in srgb, var(--surface) 82%, var(--bg) 18%);
}

.gantt-day.today {
  background: color-mix(in srgb, var(--surface) 82%, var(--accent) 18%);
}

.gantt-bar {
  background: #78abb7;
}

/* Gantt order preview drawer */
.gantt-bar.is-active {
  background: #aee8b8;
  color: #184c35;
  box-shadow:
    inset 0 0 0 2px rgba(8, 116, 67, 0.28),
    0 5px 16px rgba(50, 92, 76, 0.2);
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: -4px;
}

.gantt-drawer-backdrop[hidden],
.gantt-booking-drawer[hidden] {
  display: none;
}

.gantt-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(38, 51, 49, 0.32);
  opacity: 0;
  transition: opacity 0.22s ease;
  will-change: opacity;
}

.gantt-drawer-backdrop.is-open {
  opacity: 1;
}

.gantt-booking-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 91;
  width: min(680px, 46vw);
  min-width: 520px;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0, rgba(153, 205, 216, 0.26), transparent 23rem),
    var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -22px 0 54px rgba(44, 63, 58, 0.22);
  transform: translate3d(100%, 0, 0);
  transition: transform 0.22s ease;
  will-change: transform;
  backface-visibility: hidden;
  contain: layout paint;
}

.gantt-booking-drawer.is-open {
  transform: translate3d(0, 0, 0);
}

.gantt-drawer-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
}

.gantt-drawer-header,
.gantt-drawer-actions {
  position: relative;
  z-index: 2;
  background: rgba(255, 253, 250, 0.985);
}

.gantt-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid #d7e1dc;
}

.gantt-drawer-header p {
  margin: 0 0 5px;
  color: #71817b;
  font-size: 0.82rem;
}

.gantt-drawer-header h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2.1vw, 1.75rem);
  line-height: 1.25;
}

.gantt-drawer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.gantt-drawer-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.gantt-drawer-badge.pending_review,
.gantt-drawer-badge.pending_ship {
  color: #7c621f;
  background: #fff4cf;
  border-color: #eadcaa;
}

.gantt-drawer-badge.shipped,
.gantt-drawer-badge.in_rental {
  color: #2c6972;
  background: #e4f2f4;
  border-color: #bedde2;
}

.gantt-drawer-badge.pending_return,
.gantt-drawer-badge.pending_checkin {
  color: #68458f;
  background: #f1e8fb;
  border-color: #dac7ed;
}

.gantt-drawer-badge.completed {
  color: #3e6b51;
  background: #e6f0e8;
  border-color: #c8ddce;
}

.gantt-drawer-badge.draft,
.gantt-drawer-badge.legacy_pending {
  color: #536268;
  background: #edf1f2;
  border-color: #d5dfe1;
}

.gantt-drawer-badge.canceled {
  color: #b84f54;
  background: #fbe8e9;
  border-color: #f0c8cb;
}

.gantt-drawer-badge.transfer {
  color: #76529a;
  background: #f4eafa;
  border-color: #dfc8ed;
}

.gantt-drawer-content {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 22px 26px 34px;
  scrollbar-gutter: stable;
}

.gantt-drawer-section {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid #d5e0dc;
  border-radius: 18px;
  background: rgba(255, 253, 250, 0.94);
  box-shadow: 0 8px 20px rgba(56, 74, 69, 0.045);
}

.gantt-drawer-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  background: #edf6f7;
  border-color: #c8dfe2;
}

.gantt-drawer-overview div {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.gantt-drawer-overview span,
.gantt-drawer-section-heading span {
  color: #72827c;
  font-size: 0.78rem;
}

.gantt-drawer-overview strong {
  font-size: 1rem;
}

.gantt-drawer-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.gantt-drawer-section-heading h3 {
  margin: 0;
  font-size: 1rem;
}

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

.gantt-drawer-field {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dce5e1;
  border-radius: 13px;
  background: #fffefa;
}

.gantt-drawer-field.is-wide {
  grid-column: 1 / -1;
}

.gantt-drawer-field-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #43656a;
  border-radius: 11px;
  background: #e3f1f3;
}

.gantt-drawer-field-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.gantt-drawer-field > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.gantt-drawer-field strong {
  color: #65766f;
  font-size: 0.77rem;
}

.gantt-drawer-field span:last-child {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  line-height: 1.52;
}

.gantt-drawer-field.is-empty span:last-child {
  color: #9aa6a1;
}

.gantt-drawer-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 26px 20px;
  border-top: 1px solid #d7e1dc;
  box-shadow: 0 -10px 24px rgba(53, 70, 65, 0.06);
}

.stock-line-page {
  display: grid;
  gap: 16px;
}

.stock-line-hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(460px, 1.2fr);
  gap: 28px;
  align-items: end;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 12%, rgba(128, 170, 164, 0.18), transparent 34%),
    linear-gradient(135deg, #fffdfa 8%, #eff6f3 62%, #edf4f6);
}

.stock-line-hero-copy p,
.stock-line-chart-heading p {
  margin: 0;
  color: #78928a;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.stock-line-hero-copy h3 {
  margin: 7px 0 6px;
  font-size: clamp(25px, 3vw, 38px);
  letter-spacing: -0.035em;
}

.stock-line-hero-copy > span {
  display: block;
  max-width: 620px;
  color: var(--muted);
  line-height: 1.65;
}

.stock-line-range-controls {
  display: grid;
  gap: 10px;
}

.stock-line-range-controls label {
  font-weight: 750;
}

.stock-line-date-range-field {
  min-height: 48px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.88);
  font-size: 16px;
  font-weight: 800;
}

.stock-line-preset-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stock-line-preset-buttons button {
  flex: 1 1 104px;
  white-space: nowrap;
}

.stock-line-preset-buttons button.active {
  border-color: #7ba6a4;
  background: #e2efed;
  color: #385f60;
  box-shadow: 0 0 0 3px rgba(100, 151, 149, 0.1);
}

.stock-line-controls-panel {
  display: grid;
  gap: 14px;
}

.stock-line-control-grid {
  display: grid;
  grid-template-columns: minmax(250px, 1.2fr) repeat(2, minmax(210px, 0.9fr));
  gap: 10px;
}

.stock-line-control-card,
.stock-line-switch-card {
  min-width: 0;
  border: 1px solid #d9e3de;
  border-radius: 12px;
  background: #fafbf8;
  padding: 13px;
}

.stock-line-control-card > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.stock-line-control-card > small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}

.stock-line-segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  border-radius: 10px;
  background: #e9efeb;
  padding: 4px;
}

.stock-line-segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.stock-line-segmented button.active {
  background: #fffdfa;
  color: var(--accent-strong);
  box-shadow: 0 4px 12px rgba(65, 83, 74, 0.1);
}

.stock-line-switch-card {
  display: flex;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  cursor: pointer;
}

.stock-line-switch-card input {
  flex: 0 0 auto;
  width: 20px;
  min-height: 20px;
  accent-color: var(--accent);
}

.stock-line-switch-card strong,
.stock-line-switch-card small {
  display: block;
}

.stock-line-switch-card strong {
  color: var(--ink);
  font-size: 13px;
}

.stock-line-switch-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.stock-line-model-selector {
  border: 1px solid #d6e2dd;
  border-radius: 13px;
  background: #f9fbf9;
  overflow: hidden;
}

.stock-line-model-selector > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 13px 15px;
  cursor: pointer;
  list-style: none;
}

.stock-line-model-selector > summary::-webkit-details-marker {
  display: none;
}

.stock-line-model-selector > summary::after {
  content: "⌄";
  color: var(--accent);
  font-size: 21px;
  font-weight: 900;
  transition: transform 150ms ease;
}

.stock-line-model-selector[open] > summary::after {
  transform: rotate(180deg);
}

.stock-line-model-selector > summary > span:first-child {
  min-width: 0;
}

.stock-line-model-selector > summary strong,
.stock-line-model-selector > summary small {
  display: block;
}

.stock-line-model-selector > summary strong {
  color: var(--ink);
  font-size: 14px;
}

.stock-line-model-selector > summary small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

#stockLineSelectionStatus {
  margin-left: auto;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.stock-line-selector-body {
  display: grid;
  gap: 12px;
  border-top: 1px solid #dce5e1;
  background: #fffefa;
  padding: 14px;
}

.stock-line-selector-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stock-line-selector-toolbar input {
  flex: 1 1 auto;
}

.stock-line-selector-toolbar button {
  flex: 0 0 auto;
}

.stock-line-model-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 10px;
  padding: 1px 3px 4px 1px;
}

.stock-line-model-column {
  align-self: start;
  min-width: 0;
  border: 1px solid var(--category-border, #d7e2dd);
  border-radius: 11px;
  background: var(--category-bg, #f7faf8);
  padding: 10px;
}

.stock-line-model-column-heading {
  position: sticky;
  top: -1px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -2px -2px 9px;
  border-bottom: 1px solid var(--category-border, #d7e2dd);
  background: var(--category-bg, #f7faf8);
  padding: 4px 2px 9px;
}

.stock-line-model-column-heading strong,
.stock-line-model-column-heading span {
  display: block;
}

.stock-line-model-column-heading strong {
  color: var(--category-ink, var(--ink));
  font-size: 13px;
}

.stock-line-model-column-heading span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.stock-line-model-column-heading button {
  border: 0;
  background: transparent;
  color: var(--category-ink, var(--accent-strong));
  padding: 3px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.stock-line-model-list {
  display: grid;
  gap: 7px;
}

.stock-line-model-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(120, 143, 134, 0.2);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.67);
  color: var(--ink);
  padding: 8px 9px;
  text-align: left;
  cursor: pointer;
}

.stock-line-model-option.selected {
  border-color: var(--category-accent, var(--accent));
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 2px var(--category-ring, rgba(65, 124, 137, 0.12));
}

.stock-line-model-option strong,
.stock-line-model-option small {
  display: block;
}

.stock-line-model-option strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.stock-line-model-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.stock-line-model-option b {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  border-radius: 999px;
  background: var(--category-bg, #edf4f1);
  color: var(--category-ink, var(--accent-strong));
  font-size: 14px;
}

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

.stock-line-kpis article {
  min-width: 0;
  border: 1px solid #d9e3de;
  border-radius: 12px;
  background: linear-gradient(145deg, #fffdfa, #f5f9f6);
  padding: 14px;
  box-shadow: 0 8px 20px rgba(67, 83, 75, 0.055);
}

.stock-line-kpis article.has-shortage {
  border-color: #e8c8bd;
  background: linear-gradient(145deg, #fffaf6, #fceee9);
}

.stock-line-kpis span,
.stock-line-kpis strong,
.stock-line-kpis small {
  display: block;
}

.stock-line-kpis span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.stock-line-kpis strong {
  margin-top: 5px;
  color: var(--ink);
  font-size: 25px;
}

.stock-line-kpis small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.stock-line-kpis article.has-shortage strong {
  color: #a95c57;
}

.stock-line-chart-panel {
  min-width: 0;
  overflow: hidden;
}

.stock-line-chart-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.stock-line-chart-heading h3 {
  margin: 6px 0 4px;
  font-size: 21px;
}

.stock-line-chart-heading > div:first-child > span {
  color: var(--muted);
  font-size: 11px;
}

.stock-line-chart-note {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

#stockLineCapacityKey {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

#stockLineCapacityKey[hidden] {
  display: none;
}

.stock-line-note-solid,
.stock-line-note-dashed {
  display: inline-block;
  width: 24px;
  height: 0;
  border-top: 3px solid #6d9690;
}

.stock-line-note-dashed {
  margin-left: 8px;
  border-top-width: 2px;
  border-top-style: dashed;
  opacity: 0.6;
}

.stock-line-legend {
  display: flex;
  gap: 8px;
  margin: 14px 0 10px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 2px 1px 7px;
}

.stock-line-legend-item {
  display: grid;
  grid-template-columns: 34px minmax(112px, 1fr) auto;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 210px;
  border: 1px solid #d8e2de;
  border-radius: 10px;
  background: #fffefa;
  color: var(--ink);
  padding: 8px 9px;
  text-align: left;
  cursor: pointer;
}

.stock-line-legend-item.is-hidden {
  opacity: 0.47;
  background: #f1f3f1;
}

.stock-line-legend-swatch {
  display: block;
  width: 32px;
  height: 10px;
  border-top: 3px solid var(--series-color);
  border-bottom: 1px dashed var(--series-color);
}

.stock-line-legend-swatch.dash-2 {
  border-top-style: dashed;
}

.stock-line-legend-swatch.dash-3 {
  border-top-style: dotted;
}

.stock-line-legend-swatch.dash-4 {
  border-top-style: double;
}

.stock-line-legend-item strong,
.stock-line-legend-item small {
  display: block;
}

.stock-line-legend-item strong {
  font-size: 12px;
}

.stock-line-legend-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.stock-line-legend-item b {
  color: var(--muted);
  font-size: 9px;
}

.stock-line-chart-scroll {
  position: relative;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid #dbe4e0;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(239, 246, 244, 0.58), rgba(255, 253, 250, 0.9)),
    #fffdfa;
  scrollbar-color: #9fb7b1 transparent;
  scrollbar-width: thin;
}

.stock-line-chart {
  min-width: 100%;
}

.stock-line-svg {
  display: block;
  min-width: 100%;
  height: auto;
  overflow: visible;
  font-family: inherit;
}

.stock-line-x-tick line,
.stock-line-y-tick line {
  stroke: #d9e3df;
  stroke-width: 1;
  opacity: 0.72;
}

.stock-line-x-tick text,
.stock-line-y-tick text {
  fill: #71817a;
  font-size: 10px;
}

.stock-line-x-tick.is-today line {
  stroke: #709da1;
  stroke-width: 1.5;
  opacity: 0.55;
}

.stock-line-x-tick.is-today text {
  fill: #3f7078;
  font-weight: 850;
}

.stock-line-band-baseline,
.stock-line-band-midline {
  stroke: #d5dfdb;
  stroke-width: 1;
}

.stock-line-band-midline {
  stroke-dasharray: 3 5;
  opacity: 0.55;
}

.stock-line-area {
  opacity: 0.38;
}

.stock-line-overlay-area {
  opacity: 0.055;
}

.stock-line-path {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  paint-order: stroke;
  filter: drop-shadow(0 2px 2px rgba(54, 72, 66, 0.08));
}

.stock-line-layer.is-combined .stock-line-path,
.stock-line-svg-overlay .is-combined .stock-line-path {
  stroke-width: 4.5;
}

.stock-line-capacity-line {
  stroke-width: 1.5;
  stroke-dasharray: 7 6;
  opacity: 0.58;
}

.stock-line-capacity-label {
  font-size: 9px;
  font-weight: 800;
}

.stock-line-band-category {
  fill: #788881;
  font-size: 9px;
  font-weight: 700;
}

.stock-line-band-label {
  fill: #34413b;
  font-size: 15px;
  font-weight: 850;
}

.stock-line-band-scale {
  fill: #7b8a84;
  font-size: 8px;
}

.stock-line-y-title {
  fill: #6e7d76;
  font-size: 11px;
  font-weight: 750;
}

.stock-line-today-marker {
  stroke: #477c85;
  stroke-width: 1.5;
  stroke-dasharray: 2 4;
  opacity: 0.56;
  pointer-events: none;
}

.stock-line-cursor {
  stroke: #334f52;
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  opacity: 0.7;
  pointer-events: none;
}

.stock-line-tooltip {
  position: absolute;
  z-index: 8;
  width: min(330px, calc(100vw - 56px));
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid rgba(199, 216, 211, 0.9);
  border-radius: 12px;
  background: rgba(255, 253, 250, 0.86);
  box-shadow: 0 14px 34px rgba(47, 65, 59, 0.18);
  padding: 14px;
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.stock-line-tooltip > strong {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 15px;
}

.stock-line-tooltip p {
  display: grid;
  grid-template-columns: 9px minmax(82px, 0.72fr) minmax(160px, 1.28fr);
  gap: 9px;
  align-items: center;
  margin: 8px 0;
}

.stock-line-tooltip p > span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--series-color);
}

.stock-line-tooltip b,
.stock-line-tooltip em {
  min-width: 0;
  font-size: 11px;
  font-style: normal;
}

.stock-line-tooltip b {
  color: var(--ink);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.stock-line-tooltip em {
  color: var(--muted);
  text-align: right;
}

.stock-line-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 380px;
  padding: 30px;
  text-align: center;
}

.stock-line-empty strong,
.stock-line-empty span {
  display: block;
}

.stock-line-empty strong {
  color: var(--ink);
  font-size: 17px;
}

.stock-line-empty span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.stock-line-footnote {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .stock-line-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .stock-line-control-grid {
    grid-template-columns: 1fr;
  }

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

  .gantt-booking-drawer {
    width: min(620px, 78vw);
    min-width: 0;
  }
}

@media (max-width: 680px) {
  .stock-line-hero {
    gap: 18px;
  }

  .stock-line-preset-buttons button {
    flex-basis: calc(50% - 4px);
  }

  .stock-line-selector-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .stock-line-model-selector > summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  #stockLineSelectionStatus {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .stock-line-model-columns {
    grid-template-columns: 1fr;
  }

  .stock-line-kpis {
    grid-template-columns: 1fr;
  }

  .stock-line-chart-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .stock-line-chart-note {
    white-space: normal;
  }

  .gantt-booking-drawer {
    width: 100%;
    border-left: 0;
  }

  .gantt-drawer-header {
    padding: 18px 16px 15px;
  }

  .gantt-drawer-content {
    padding: 16px 14px 26px;
  }

  .gantt-drawer-section {
    padding: 14px;
    border-radius: 15px;
  }

  .gantt-drawer-overview,
  .gantt-drawer-grid {
    grid-template-columns: 1fr;
  }

  .gantt-drawer-field.is-wide {
    grid-column: auto;
  }

  .gantt-drawer-actions {
    padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  }

  .gantt-drawer-actions button {
    flex: 1 1 calc(50% - 5px);
  }

  .gantt-drawer-actions .primary-button {
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gantt-booking-drawer,
  .gantt-drawer-backdrop {
    transition: none;
  }
}

/* Configurable workspace presentation */
.panel,
.metric,
button,
input,
select,
textarea,
.system-settings-dialog,
.system-protection-item {
  border-radius: var(--component-radius);
}

.panel,
.metric,
.auth-card {
  box-shadow: var(--shadow);
}

.workspace {
  padding: calc(18px * var(--density-scale)) calc(22px * var(--density-scale));
}

.panel {
  padding: calc(18px * var(--density-scale));
}

html[data-sidebar-side="right"] .app-shell {
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
}

html[data-sidebar-side="right"] .app-shell.sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr) 76px;
}

html[data-sidebar-side="right"] .sidebar {
  order: 2;
}

html[data-sidebar-side="right"] .workspace {
  order: 1;
}

html[data-sidebar-side="right"] .sidebar-toggle {
  right: auto;
  left: -14px;
  transform: rotate(180deg);
}

html[data-sidebar-side="right"] .app-shell.sidebar-collapsed .sidebar-toggle {
  right: auto;
  left: -14px;
  transform: none;
}

@media (max-width: 980px) {
  html[data-sidebar-side="right"] .app-shell,
  html[data-sidebar-side="right"] .app-shell.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-sidebar-side="right"] .sidebar {
    order: 1;
  }

  html[data-sidebar-side="right"] .workspace {
    order: 2;
  }
}

html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  scroll-behavior: auto !important;
  transition-duration: 0.001ms !important;
  animation-duration: 0.001ms !important;
}

html[data-theme-preset="dark"] {
  color-scheme: dark;
}

html[data-theme-preset="dark"] .system-settings-status,
html[data-theme-preset="dark"] .system-protection-item,
html[data-theme-preset="dark"] .task-card,
html[data-theme-preset="dark"] .todo-item {
  background: color-mix(in srgb, var(--surface) 90%, white 10%);
}

html[data-theme-preset="dark"] body {
  background: var(--bg);
}

html[data-theme-preset="dark"] .auth-card,
html[data-theme-preset="dark"] .customer-check-panel,
html[data-theme-preset="dark"] .inventory-model-dialog-shell,
html[data-theme-preset="dark"] .gantt-drawer-shell,
html[data-theme-preset="dark"] .empty-state {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

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

.system-toggle-groups fieldset {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--component-radius);
}

.system-toggle-groups legend,
.system-version-heading strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

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

.system-toggle-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--component-radius);
  background: color-mix(in srgb, var(--surface) 88%, var(--bg) 12%);
  color: var(--ink);
  font-size: 13px;
}

.system-toggle-item input {
  flex: 0 0 auto;
}

.system-toggle-item span {
  min-width: 0;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

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

.system-rule-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 130px minmax(120px, auto);
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--component-radius);
  background: color-mix(in srgb, var(--surface) 88%, var(--bg) 12%);
}

.system-rule-row label,
.system-rule-enabled {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.system-rule-enabled span {
  min-width: 0;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.system-rule-row label > span,
.system-rule-row small,
.system-template-help,
.system-version-heading span {
  color: var(--muted);
  font-size: 12px;
}

.system-rule-row input[type="number"] {
  width: 76px;
}

.system-template-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.system-template-grid textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
}

.system-template-preview {
  min-height: 92px;
  max-height: 220px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--component-radius);
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  overflow: auto;
  white-space: pre-wrap;
}

.system-appearance-grid label:has(input[type="range"]) {
  grid-template-columns: minmax(0, 1fr) auto;
}

.system-appearance-grid label:has(input[type="range"]) span,
.system-appearance-grid label:has(input[type="range"]) input {
  grid-column: 1 / -1;
}

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

.system-color-grid label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--component-radius);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.system-color-grid input {
  width: 42px;
  height: 30px;
  padding: 2px;
}

.system-import-preview {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--accent);
  border-radius: var(--component-radius);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface) 93%);
}

.system-import-preview[hidden] {
  display: none;
}

.system-import-summary {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.system-diff-list {
  display: grid;
  gap: 4px;
  max-height: 260px;
  overflow: auto;
}

.system-diff-row {
  display: grid;
  grid-template-columns: 52px minmax(150px, 1fr) minmax(130px, 1fr) minmax(130px, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.system-diff-row code,
.system-diff-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-diff-row strong {
  color: var(--accent-strong);
}

.system-import-actions,
.system-version-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.system-version-heading {
  margin-top: 4px;
}

.system-version-heading > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.system-version-heading .ghost-button {
  flex: 0 0 auto;
}

/* Device-return reporting keeps each model as a quiet ledger section rather
   than introducing another layer of decorative cards inside the panels. */
.device-return-page {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.device-return-toolbar-panel .panel-heading > div,
.device-return-pending-panel .panel-heading > div {
  min-width: 0;
}

.device-return-toolbar-panel .panel-heading p,
.device-return-pending-panel .panel-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.device-return-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 0.75fr)) auto minmax(170px, 1fr) minmax(180px, 1fr);
  gap: 10px;
  align-items: end;
}

.device-return-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.device-return-toolbar input,
.device-return-toolbar select {
  width: 100%;
  min-width: 0;
}

.device-return-range-actions {
  display: flex;
  gap: 7px;
}

.device-return-range-actions button {
  flex: 1 1 auto;
  white-space: nowrap;
}

.device-return-rule-note {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.device-return-metrics {
  margin-bottom: 0;
}

.device-return-quality-notice {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--warn) 42%, var(--line) 58%);
  border-radius: var(--component-radius);
  background: color-mix(in srgb, var(--warn) 8%, var(--surface) 92%);
  color: color-mix(in srgb, var(--warn) 78%, var(--ink) 22%);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.55;
}

.device-return-quality-notice[hidden] {
  display: none;
}

.device-return-trend-panel {
  min-width: 0;
}

.device-return-trend-toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.device-return-trend-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.device-return-trend-models {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  max-height: 116px;
  overflow-y: auto;
  padding: 2px;
}

.device-return-trend-model-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid var(--category-border, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--category-bg, var(--surface)) 44%, var(--surface) 56%);
  color: var(--category-ink, var(--ink));
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.device-return-trend-model-option input {
  width: 15px;
  min-width: 15px;
  min-height: 15px;
}

.device-return-trend-legend {
  display: flex;
  gap: 8px 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.device-return-trend-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.device-return-trend-legend-item i {
  display: inline-block;
  width: 20px;
  height: 3px;
  border-radius: 99px;
  background: var(--trend-color, var(--accent));
}

.device-return-trend-chart {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--component-radius);
  background: color-mix(in srgb, var(--surface) 94%, var(--bg) 6%);
  overflow: hidden;
}

.device-return-trend-scroll {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.device-return-trend-scroll svg {
  display: block;
  min-width: 100%;
  height: 330px;
}

.device-return-trend-grid {
  stroke: color-mix(in srgb, var(--line) 74%, transparent 26%);
  stroke-width: 1;
}

.device-return-trend-axis-label {
  fill: var(--muted);
  font-size: 10px;
}

.device-return-trend-y-title {
  fill: var(--muted);
  font-size: 10px;
}

.device-return-trend-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  pointer-events: none;
}

.device-return-trend-hit {
  fill: transparent;
  pointer-events: all;
  cursor: crosshair;
}

.device-return-trend-cursor {
  stroke: color-mix(in srgb, var(--accent) 68%, transparent 32%);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  pointer-events: none;
}

.device-return-trend-tooltip {
  position: absolute;
  z-index: 8;
  width: min(300px, calc(100vw - 56px));
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid color-mix(in srgb, var(--line) 82%, var(--accent) 18%);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 88%, transparent 12%);
  box-shadow: 0 12px 28px rgba(47, 65, 59, 0.16);
  padding: 11px 12px;
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.device-return-trend-tooltip > strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 13px;
}

.device-return-trend-tooltip p {
  display: grid;
  grid-template-columns: 8px minmax(80px, 1fr) auto;
  gap: 7px;
  align-items: center;
  margin: 6px 0;
}

.device-return-trend-tooltip p > span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--trend-color, var(--accent));
}

.device-return-trend-tooltip b,
.device-return-trend-tooltip em {
  min-width: 0;
  font-size: 11px;
  font-style: normal;
}

.device-return-trend-tooltip b {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.device-return-trend-tooltip em {
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.device-return-trend-tooltip em small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.device-return-trend-points circle {
  stroke: var(--surface);
  stroke-width: 1.5;
  pointer-events: none;
}

.device-return-trend-empty,
.device-return-trend-empty-state {
  color: var(--muted);
  font-size: 12px;
}

.device-return-trend-empty-state {
  display: grid;
  gap: 5px;
  min-height: 180px;
  place-content: center;
  padding: 20px;
  text-align: center;
}

.device-return-trend-empty-state strong {
  color: var(--ink);
}

html[data-theme-preset="dark"] .device-return-trend-chart {
  background: var(--dark-surface-soft);
}

.device-return-group-list,
.device-return-pending-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.device-return-group {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--component-radius);
  background: color-mix(in srgb, var(--surface) 94%, var(--bg) 6%);
  overflow: clip;
}

.device-return-group > summary {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(330px, auto);
  gap: 18px;
  align-items: center;
  padding: 13px 14px;
  cursor: pointer;
  list-style: none;
}

.device-return-group > summary::-webkit-details-marker {
  display: none;
}

.device-return-group > summary::after {
  content: "▾";
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  color: var(--muted);
  transform: rotate(-90deg);
  transition: transform 160ms ease;
}

.device-return-group[open] > summary::after {
  transform: rotate(0);
}

.device-return-group-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  padding-right: 18px;
}

.device-return-group-title > span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--category-border, var(--line));
  border-radius: 999px;
  background: var(--category-bg, var(--surface-muted));
  color: var(--category-ink, var(--ink));
  font-size: 11px;
  font-weight: 800;
}

.device-return-group-title > strong {
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.device-return-group-title > small {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.device-return-group-kpis {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px 18px;
  min-width: 0;
  padding-right: 22px;
  color: var(--muted);
  font-size: 11px;
}

.device-return-group-kpis strong {
  color: var(--accent-strong);
  font-size: 13px;
}

.device-return-progress {
  height: 4px;
  background: color-mix(in srgb, var(--line) 66%, transparent 34%);
  overflow: hidden;
}

.device-return-progress > span {
  display: block;
  height: 100%;
  max-width: 100%;
  background: var(--accent);
}

.device-return-table {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--component-radius);
  overflow: clip;
}

.device-return-row {
  display: grid;
  grid-template-columns: minmax(200px, 1.6fr) repeat(6, minmax(0, 1fr)) 84px;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 11px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 76%, transparent 24%);
  font-size: 12px;
}

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

.device-return-row.is-heading {
  padding-top: 8px;
  padding-bottom: 8px;
  background: color-mix(in srgb, var(--surface-muted) 62%, var(--surface) 38%);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.device-return-row.is-mother {
  background: color-mix(in srgb, var(--accent) 5%, var(--surface) 95%);
}

.device-return-model-row {
  border-left: 4px solid var(--category-accent, var(--accent));
  background: color-mix(in srgb, var(--category-bg, var(--surface-muted)) 34%, var(--surface) 66%);
}

.device-return-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.device-return-row > span:nth-child(n + 2):nth-child(-n + 7) {
  text-align: center;
}

.device-return-row > span:first-child strong,
.device-return-row > span:first-child small {
  display: block;
}

.device-return-row > span:first-child small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.device-return-row > span:nth-last-child(1) {
  justify-self: end;
}

.device-return-missing {
  color: var(--warn);
  font-style: normal;
  font-weight: 800;
}

.device-return-value-warning {
  display: block;
  margin-top: 3px;
  color: var(--warn);
  font-size: 9px;
  font-weight: 800;
}

.device-return-paid-back-cell strong {
  display: block;
  color: var(--accent-strong);
}

.device-return-roi-cell strong,
.device-return-roi-cell small,
.device-return-roi-cell i {
  display: block;
}

.device-return-roi-cell small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.device-return-roi-cell i {
  width: 100%;
  height: 3px;
  margin-top: 6px;
  background: color-mix(in srgb, var(--line) 66%, transparent 34%);
  overflow: hidden;
}

.device-return-roi-cell i b {
  display: block;
  height: 100%;
  max-width: 100%;
  background: var(--accent);
}

.device-return-pending-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.device-return-pending-row:last-child {
  border-bottom: 0;
}

.device-return-pending-row > div {
  min-width: 0;
}

.device-return-pending-row > div strong,
.device-return-pending-row > div span {
  display: block;
  overflow-wrap: anywhere;
}

.device-return-pending-row > div span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.device-return-complete {
  display: grid;
  gap: 4px;
  padding: 18px 0 6px;
  color: var(--ok);
  text-align: center;
}

.device-return-complete span {
  color: var(--muted);
  font-size: 12px;
}

.asset-valuation-group {
  margin: 8px 0 0;
  color: var(--accent-strong);
  font-size: 12px;
  line-height: 1.5;
}

html[data-theme-preset="dark"] .device-return-group,
html[data-theme-preset="dark"] .device-return-row.is-mother {
  background: color-mix(in srgb, var(--surface) 92%, white 8%);
}

@media (max-width: 1180px) {
  .device-return-toolbar {
    grid-template-columns: repeat(2, minmax(150px, 1fr)) auto;
  }

  .device-return-toolbar label:nth-last-child(-n + 2) {
    grid-column: span 1;
  }

  .device-return-group > summary {
    grid-template-columns: minmax(190px, 0.9fr) minmax(290px, 1.1fr);
  }

  .device-return-row {
    grid-template-columns: minmax(170px, 1.35fr) repeat(6, minmax(0, 1fr)) 78px;
    gap: 8px;
  }
}

@media (max-width: 760px) {
  .device-return-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .device-return-range-actions {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .device-return-group > summary {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .device-return-group > summary::after {
    grid-column: 1;
  }

  .device-return-group-kpis {
    justify-content: flex-start;
    padding-right: 20px;
  }

  .device-return-row.is-heading {
    display: none;
  }

  .device-return-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    padding: 13px 14px;
  }

  .device-return-row > span:nth-child(n + 2):nth-child(-n + 7) {
    text-align: left;
  }

  .device-return-row > span::before {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
  }

  .device-return-row > span:nth-child(1) {
    grid-column: 1 / -1;
  }

  .device-return-row > span:nth-child(2)::before { content: "库存数量"; }
  .device-return-row > span:nth-child(3)::before { content: "单台价值"; }
  .device-return-row > span:nth-child(4)::before { content: "型号总价值"; }
  .device-return-row > span:nth-child(5)::before { content: "归集租金"; }
  .device-return-row > span:nth-child(6)::before { content: "已回本台数"; }
  .device-return-row > span:nth-child(7)::before { content: "回报率 / 订单"; }

  .device-return-row > span:nth-last-child(1) {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .device-return-row > span:nth-last-child(1) button {
    width: 100%;
  }

  .device-return-pending-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .device-return-pending-row button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* Simulation playground: a separate, soft-colour scheduling sandbox. */
.simulation-page {
  display: grid;
  gap: 16px;
}

.simulation-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 126px;
  padding: 24px 28px;
  border: 1px solid rgba(117, 126, 196, 0.2);
  border-radius: calc(var(--radius) + 10px);
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.9) 0 7px, transparent 8px),
    radial-gradient(circle at 90% 24%, rgba(255, 255, 255, 0.8) 0 5px, transparent 6px),
    linear-gradient(120deg, #eef7ff 0%, #f8efff 48%, #fff2e8 100%);
  box-shadow: 0 14px 34px rgba(93, 100, 150, 0.1);
}

.simulation-hero::after {
  content: "";
  position: absolute;
  right: 8%;
  bottom: -54px;
  width: 180px;
  height: 110px;
  border: 2px solid rgba(116, 136, 191, 0.16);
  border-radius: 50%;
  transform: rotate(-8deg);
}

.simulation-hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.simulation-sparkle {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 16px 16px 16px 5px;
  background: linear-gradient(145deg, #879de0, #b68bd4);
  color: #fff;
  font-size: 23px;
  box-shadow: 0 8px 18px rgba(105, 104, 177, 0.2);
}

.simulation-hero-copy p,
.simulation-section-heading p {
  margin: 0 0 4px;
  color: #7779a4;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.simulation-hero-copy h3 {
  margin: 0 0 7px;
  color: #373b5d;
  font-size: clamp(1.65rem, 2.2vw, 2.25rem);
}

.simulation-hero-copy > div > span {
  color: #666b7b;
  line-height: 1.65;
}

.simulation-save-state {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 180px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: #59606c;
  backdrop-filter: blur(8px);
}

.simulation-save-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8cae9f;
  box-shadow: 0 0 0 5px rgba(140, 174, 159, 0.14);
}

.simulation-save-state.is-saving .simulation-save-dot {
  background: #d9a65b;
  animation: simulationPulse 1s ease-in-out infinite;
}

.simulation-save-state.is-error .simulation-save-dot { background: #d36d73; }

@keyframes simulationPulse {
  50% { transform: scale(0.68); opacity: 0.62; }
}

.simulation-controls-panel {
  display: grid;
  gap: 16px;
  border-radius: calc(var(--radius) + 6px);
}

.simulation-plan-bar,
.simulation-filter-grid,
.simulation-action-row {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.simulation-plan-bar label {
  flex: 1 1 320px;
}

.simulation-filter-grid > label {
  flex: 1 1 150px;
}

.simulation-filter-grid .simulation-name-field {
  flex-basis: 280px;
}

.simulation-action-row {
  flex: 2 1 460px;
  justify-content: flex-end;
}

.simulation-action-row .primary-button {
  background: linear-gradient(135deg, #718fd1, #9c7fc4);
  border-color: transparent;
}

.simulation-model-picker {
  border: 1px solid #dfdced;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(250, 249, 255, 0.96), rgba(255, 255, 255, 0.86));
}

.simulation-model-picker > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  cursor: pointer;
  list-style: none;
}

.simulation-model-picker > summary::-webkit-details-marker { display: none; }
.simulation-model-picker > summary > span { display: grid; gap: 2px; }
.simulation-model-picker > summary small { color: var(--muted); }

.simulation-model-picker-body {
  display: grid;
  gap: 12px;
  padding: 0 15px 15px;
}

.simulation-selected-models {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.simulation-selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 5px 7px 5px 12px;
  border: 1px solid #d7d4eb;
  border-radius: 999px;
  background: #f5f1ff;
  color: #4e4d73;
  font-weight: 750;
}

.simulation-selected-chip span { color: #77758d; font-size: 0.78rem; }
.simulation-selected-chip button {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #6b6c90;
  cursor: pointer;
}

.simulation-model-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 9px;
  max-height: 220px;
  overflow-y: auto;
}

.simulation-model-card {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 80px;
  padding: 11px 13px;
  text-align: left;
  border: 1px solid #dce1e5;
  border-radius: 13px;
  background: #f6fafb;
  color: var(--ink);
  cursor: pointer;
}

.simulation-model-card:hover { transform: translateY(-1px); border-color: #94a6cc; }
.simulation-model-card.is-selected { border-color: #8a86c6; box-shadow: inset 4px 0 0 #9b8bca; }
.simulation-model-card.category-body { background: #edf7ff; }
.simulation-model-card.category-lens { background: #f2f5ff; }
.simulation-model-card.category-tripod { background: #fff7ea; }
.simulation-model-card.category-dji { background: #f7f0ff; }
.simulation-model-card.category-high-value { background: #fff0f1; }
.simulation-model-card small { color: var(--muted); }

.simulation-change-notice {
  padding: 14px 17px;
  border: 1px solid #e7c57f;
  border-radius: 13px;
  background: #fff9e8;
  color: #705723;
}

.simulation-change-notice strong { display: block; margin-bottom: 4px; }
.simulation-change-notice > span { display: block; line-height: 1.55; }
.simulation-change-details {
  margin-top: 12px;
  border-top: 1px solid rgb(231 197 127 / 65%);
}
.simulation-change-details summary {
  padding: 10px 0 7px;
  cursor: pointer;
  font-weight: 750;
  color: #604a1b;
}
.simulation-change-list {
  display: grid;
  gap: 7px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 3px;
}
.simulation-change-item {
  padding: 9px 10px;
  border: 1px solid rgb(231 197 127 / 72%);
  border-radius: 9px;
  background: rgb(255 255 255 / 55%);
}
.simulation-change-item-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-bottom: 6px;
}
.simulation-change-item-head strong { margin: 0; }
.simulation-change-type,
.simulation-change-booking-id { font-size: 11px; }
.simulation-change-type {
  padding: 2px 6px;
  border-radius: 999px;
  background: #f2e5c5;
  color: #705723;
}
.simulation-change-booking-id { color: #8b7650; }
.simulation-change-fields { display: grid; gap: 3px; }
.simulation-change-field {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 18px minmax(0, 1fr);
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  font-size: 12px;
}
.simulation-change-field > span:first-child { color: #705723; }
.simulation-change-field del { color: #927f5d; overflow-wrap: anywhere; }
.simulation-change-field strong { overflow-wrap: anywhere; }
.simulation-change-missing { border-left: 3px solid #c76f69; }
.simulation-change-new { border-left: 3px solid #7596b8; }
.simulation-change-notice.is-dismissed {
  border-color: #a8d5c3;
  background: #eff9f4;
  color: #315f50;
}
.simulation-change-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
@media (max-width: 680px) {
  .simulation-change-field {
    grid-template-columns: 72px minmax(0, 1fr);
  }
  .simulation-change-field > span[aria-hidden="true"] { display: none; }
  .simulation-change-field strong { grid-column: 2; }
}

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

.simulation-summary-card {
  display: grid;
  gap: 4px;
  min-height: 84px;
  padding: 14px;
  border: 1px solid #e1e3e8;
  border-radius: 14px;
  background: #fff;
}

.simulation-summary-card span { color: var(--muted); font-size: 0.8rem; }
.simulation-summary-card strong { color: #43465e; font-size: 1.45rem; }
.simulation-summary-card.is-safe { background: #eff9f3; }
.simulation-summary-card.is-warning { background: #fff8e7; }
.simulation-summary-card.is-danger { background: #fff0f0; }

.simulation-workspace {
  display: grid;
  grid-template-columns: minmax(230px, 0.68fr) minmax(600px, 2.2fr) minmax(250px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.simulation-pool-panel,
.simulation-board-panel,
.simulation-inspector-panel {
  padding: 16px;
  border-radius: calc(var(--radius) + 6px);
}

.simulation-pool-panel,
.simulation-inspector-panel {
  position: sticky;
  top: 12px;
}

.simulation-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.simulation-section-heading h3 { margin: 0; }
.simulation-section-heading > span {
  display: grid;
  place-items: center;
  min-width: 30px;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f0edf9;
  color: #66638c;
  font-weight: 800;
  font-size: 0.8rem;
}

.simulation-help {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.simulation-order-pool,
.simulation-lane-orders {
  display: grid;
  gap: 9px;
  min-height: 110px;
  padding: 9px;
  border: 1px dashed #cdd3df;
  border-radius: 13px;
  background: rgba(247, 248, 252, 0.7);
}

.simulation-order-pool {
  max-height: 64vh;
  overflow-y: auto;
}

.simulation-dropzone.is-drag-over {
  border-color: #8c8bc2;
  background: #f3f0ff;
  box-shadow: inset 0 0 0 2px rgba(140, 139, 194, 0.12);
}

.simulation-order-card {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 11px 12px;
  border: 1px solid #dfe3e8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 13px rgba(70, 78, 96, 0.06);
  cursor: grab;
}

.simulation-order-card:active { cursor: grabbing; }
.simulation-order-card.is-dragging { opacity: 0.48; transform: rotate(1deg); }
.simulation-order-card:hover { border-color: #aeb7d6; }
.simulation-order-card.is-adjusted {
  border-color: #b6a1dc;
  background: linear-gradient(145deg, #fff, #f7f2ff);
  box-shadow: inset 4px 0 0 #9a84cc, 0 5px 13px rgba(70, 78, 96, 0.06);
}

.simulation-order-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.simulation-adjusted-badge {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f0e9ff;
  color: #7055a7;
  font-size: 0.7rem;
  font-weight: 800;
}

.simulation-order-card-heading,
.simulation-order-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.simulation-order-card-heading strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.simulation-order-card-heading span,
.simulation-order-card-meta span {
  color: var(--muted);
  font-size: 0.74rem;
}

.simulation-order-stage {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf5f1;
  color: #4e7569;
  font-size: 0.7rem;
  font-weight: 800;
}

.simulation-board-scroll {
  overflow-x: auto;
  padding-bottom: 5px;
}

.simulation-board {
  display: grid;
  gap: 12px;
  min-width: 560px;
}

.simulation-empty {
  display: grid;
  place-items: center;
  min-height: 230px;
  padding: 28px;
  text-align: center;
  border: 1px dashed #d1d4df;
  border-radius: 16px;
  background: linear-gradient(145deg, #fbfcff, #fff8f4);
  color: var(--muted);
}

.simulation-empty strong { display: block; margin-bottom: 6px; color: #4b4e68; }

.simulation-lane {
  overflow: hidden;
  border: 1px solid #dfe2ea;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 7px 18px rgba(78, 84, 108, 0.06);
}

.simulation-lane-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(100deg, #edf7ff, #f7f0ff 62%, #fff5eb);
  border-bottom: 1px solid #e2e2eb;
}

.simulation-lane-title { display: grid; gap: 3px; }
.simulation-lane-title strong { color: #464967; }
.simulation-lane-title span { color: #717486; font-size: 0.78rem; }

.simulation-slot-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.simulation-slot {
  padding: 4px 7px;
  border: 1px solid rgba(132, 134, 182, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #686b87;
  font-size: 0.7rem;
  font-weight: 750;
}

.simulation-lane-orders {
  min-height: 132px;
  margin: 10px;
  border-style: solid;
  background: #fafbfc;
}

.simulation-lane-orders .simulation-order-card {
  cursor: grab;
  border-left: 5px solid #91a6d6;
}

.simulation-transfer {
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: -2px 4px;
  color: #777b8d;
}

.simulation-transfer::before,
.simulation-transfer::after {
  content: "";
  height: 1px;
  background: #d9dce4;
}

.simulation-transfer-card {
  display: grid;
  gap: 5px;
  min-width: 190px;
  padding: 8px 10px;
  border: 1px solid #dfe2e8;
  border-radius: 11px;
  background: #fff;
  text-align: center;
}

.simulation-transfer-card.is-safe { border-color: #a8d7ba; background: #f1fbf4; }
.simulation-transfer-card.is-warning { border-color: #e6c77f; background: #fff9e9; }
.simulation-transfer-card.is-danger { border-color: #e0a1a4; background: #fff1f1; }
.simulation-transfer-card.is-unknown { border-color: #cfd4dd; background: #f6f7f9; }

.simulation-transfer-card select {
  min-height: 30px;
  padding: 4px 7px;
  font-size: 0.74rem;
}

.simulation-transfer-card strong { font-size: 0.76rem; }
.simulation-transfer-card span { font-size: 0.7rem; color: var(--muted); }

.simulation-inspector-section {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.simulation-inspector-section:last-child { border-bottom: 0; }
.simulation-inspector-section h4 { margin: 0; }
.simulation-inspector-section p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 0.82rem; }
.simulation-inspector-list { display: grid; gap: 7px; }

.simulation-order-edit-grid,
.simulation-booking-notes,
.simulation-request-summary {
  display: grid;
  gap: 6px;
}

.simulation-order-edit-grid label,
.simulation-booking-notes label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.76rem;
}

.simulation-order-edit-grid input,
.simulation-booking-notes textarea {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 7px 8px;
  font-size: 0.8rem;
}

.simulation-order-edit-grid > small,
.simulation-booking-notes > small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.simulation-request-summary,
.simulation-booking-notes {
  padding: 9px 10px;
  border-radius: 10px;
  background: #f5f8f6;
  font-size: 0.76rem;
}

.simulation-request-summary > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.simulation-request-summary > div > span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
}

.simulation-booking-notes > span {
  color: var(--muted);
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

html[data-theme-preset="dark"] .simulation-request-summary,
html[data-theme-preset="dark"] .simulation-booking-notes {
  background: var(--dark-surface-soft);
}

.simulation-city-source,
.simulation-date-source {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-radius: 10px;
  background: #eff8f4;
  font-size: 0.78rem;
}

.simulation-city-source > span,
.simulation-date-source > span { color: var(--muted); }
.simulation-city-source .simulation-city-conflict { color: #986a1c; }
.simulation-date-source.has-warning { background: #fff6df; }
.simulation-date-source .simulation-date-conflict { color: #986a1c; }

.simulation-adjustment-summary {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  border: 1px solid #cbbce8;
  border-radius: 11px;
  background: #f6f1ff;
  color: #654f91;
  font-size: 0.78rem;
}

.simulation-adjustment-summary.is-unchanged {
  border-color: #dfe4e1;
  background: #f6f8f7;
  color: var(--muted);
}

.simulation-check-item.is-adjusted {
  border: 1px solid #cbbce8;
  background: #f7f2ff;
}

.simulation-sf-tool {
  margin: 4px 0 8px;
  border: 1px solid #cfe3dc;
  border-radius: 12px;
  background: linear-gradient(145deg, #f5fbf8, #fbfaf5);
}

.simulation-sf-tool summary {
  display: grid;
  gap: 2px;
  padding: 10px 11px;
  cursor: pointer;
  color: #416d61;
  font-weight: 800;
}

.simulation-sf-tool summary::-webkit-details-marker { display: none; }
.simulation-sf-tool summary small { color: var(--muted); font-size: 0.68rem; font-weight: 500; }
.simulation-sf-tool-body { display: grid; gap: 8px; padding: 0 10px 10px; }
.simulation-sf-tool-body label { display: grid; gap: 4px; color: var(--muted); font-size: 0.72rem; }
.simulation-sf-tool-body input { width: 100%; min-width: 0; }
.simulation-sf-city-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.simulation-sf-tool-body .ghost-button { min-height: 34px; padding: 6px 10px; }
.simulation-sf-result { display: grid; gap: 2px; padding: 8px 9px; border-radius: 9px; background: #f2f5f4; color: var(--muted); font-size: 0.7rem; line-height: 1.45; }
.simulation-sf-result.is-safe { background: #eaf8ef; color: #3f7258; }
.simulation-sf-result.is-danger { background: #fff0f1; color: #9a4b51; }
.simulation-sf-result.is-loading { background: #f2f0fb; color: #675e8d; }

.simulation-four-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.simulation-four-date-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.simulation-four-date-grid label > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.simulation-four-date-grid small {
  padding: 2px 6px;
  border-radius: 999px;
  background: #edf0f5;
  color: var(--muted);
  font-size: 0.66rem;
}

.simulation-four-date-grid input { min-width: 0; width: 100%; }
.simulation-four-date-grid .is-locked input {
  cursor: not-allowed;
  background: #f3f5f7;
  color: #69736f;
}

.simulation-version-item,
.simulation-check-item {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-radius: 10px;
  background: #f7f8fa;
  font-size: 0.78rem;
}

.simulation-version-item span,
.simulation-check-item span { color: var(--muted); }

html[data-theme-preset="dark"] .simulation-hero,
html[data-theme-preset="dark"] .simulation-lane-heading {
  background: linear-gradient(120deg, #303b4c, #3d3548 58%, #463a32);
}

html[data-theme-preset="dark"] .simulation-hero-copy h3,
html[data-theme-preset="dark"] .simulation-lane-title strong { color: var(--ink); }
html[data-theme-preset="dark"] .simulation-model-card,
html[data-theme-preset="dark"] .simulation-order-card,
html[data-theme-preset="dark"] .simulation-lane,
html[data-theme-preset="dark"] .simulation-summary-card,
html[data-theme-preset="dark"] .simulation-transfer-card { background: var(--surface); color: var(--ink); }

@media (max-width: 1320px) {
  .simulation-workspace { grid-template-columns: minmax(220px, 0.7fr) minmax(540px, 1.8fr); }
  .simulation-inspector-panel { position: static; grid-column: 1 / -1; }
  .simulation-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 850px) {
  .simulation-hero { align-items: flex-start; flex-direction: column; padding: 20px; }
  .simulation-save-state { width: 100%; }
  .simulation-plan-bar > *,
  .simulation-action-row,
  .simulation-action-row > * { width: 100%; }
  .simulation-filter-grid { display: grid; grid-template-columns: 1fr 1fr; }
  .simulation-filter-grid .simulation-name-field,
  .simulation-filter-grid .simulation-action-row { grid-column: 1 / -1; }
  .simulation-workspace { grid-template-columns: 1fr; }
  .simulation-pool-panel,
  .simulation-inspector-panel { position: static; }
  .simulation-order-pool { max-height: 330px; }
  .simulation-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .simulation-board-panel { padding-inline: 10px; }
}

@media (max-width: 560px) {
  .simulation-hero-copy { gap: 11px; }
  .simulation-sparkle { width: 39px; height: 39px; border-radius: 13px 13px 13px 4px; }
  .simulation-filter-grid { grid-template-columns: 1fr; }
  .simulation-filter-grid .simulation-name-field,
  .simulation-filter-grid .simulation-action-row { grid-column: auto; }
  .simulation-summary { grid-template-columns: 1fr 1fr; }
  .simulation-model-cards { grid-template-columns: 1fr 1fr; }
  .simulation-lane-heading { align-items: flex-start; flex-direction: column; }
  .simulation-four-date-grid { grid-template-columns: 1fr; }
  .simulation-slot-list { justify-content: flex-start; }
}

.simulation-board {
  min-width: calc(270px + var(--simulation-timeline-width, 620px));
}

.simulation-gantt-header,
.simulation-gantt-row {
  display: grid;
  grid-template-columns: 270px var(--simulation-timeline-width, 620px);
}

.simulation-gantt-header {
  position: sticky;
  top: 0;
  z-index: 5;
  overflow: hidden;
  border: 1px solid #dde1e8;
  border-radius: 14px 14px 0 0;
  background: #f7f8fc;
}

.simulation-gantt-corner,
.simulation-lane-heading {
  position: sticky;
  left: 0;
  z-index: 4;
}

.simulation-gantt-corner {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 58px;
  padding: 10px 14px;
  border-right: 1px solid #dde1e8;
  background: linear-gradient(135deg, #eef7ff, #f8f0ff);
  color: #565a76;
}

.simulation-gantt-corner span { color: var(--muted); font-size: 0.7rem; }

.simulation-gantt-days,
.simulation-gantt-grid {
  display: grid;
  grid-template-columns: repeat(var(--simulation-days), minmax(78px, 78px));
}

.simulation-gantt-day {
  display: grid;
  place-content: center;
  gap: 2px;
  min-height: 58px;
  text-align: center;
  border-right: 1px solid #e2e5eb;
  color: #747889;
  background: #f8f9fc;
  font-size: 0.7rem;
}

.simulation-gantt-day strong { color: #555a70; font-size: 0.77rem; }
.simulation-gantt-day.is-today { background: #e9f7ef; }
.simulation-gantt-day.is-today strong { color: #4e8469; }

.simulation-gantt-row {
  position: relative;
  z-index: 1;
  overflow: visible;
  border: 1px solid #dde1e8;
  border-top: 0;
  background: #fff;
}

.simulation-gantt-row:last-child { border-radius: 0 0 14px 14px; }

.simulation-gantt-row .simulation-lane-heading {
  position: sticky;
  left: 0;
  z-index: 1;
  min-height: var(--simulation-lane-height, 168px);
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  border-top: 0;
  border-right: 1px solid #dde1e8;
  border-bottom: 0;
}

.simulation-gantt-row .simulation-slot-list { justify-content: flex-start; }

.simulation-gantt-lane {
  position: relative;
  z-index: 2;
  min-height: var(--simulation-lane-height, 168px);
  overflow: visible;
  background: #fbfcfe;
}

.simulation-gantt-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.simulation-gantt-grid i {
  border-right: 1px solid #eceef2;
  background: linear-gradient(180deg, rgba(247, 248, 252, 0.2), rgba(246, 248, 251, 0.58));
}

.simulation-gantt-grid i:nth-child(7n),
.simulation-gantt-grid i:nth-child(7n + 1) { background: rgba(235, 240, 249, 0.52); }

.simulation-gantt-order {
  position: absolute;
  top: var(--simulation-track-top, 12px);
  left: calc(var(--simulation-left) * 78px + 5px);
  width: calc(var(--simulation-span) * 78px - 10px);
  min-width: 68px;
  height: 72px;
  display: grid;
  align-content: center;
  gap: 2px;
  overflow: hidden;
  padding: 8px 10px;
  border: 1px solid #a8b9df;
  border-radius: 12px;
  background: linear-gradient(135deg, #dfeeff, #e9e3ff);
  color: #3f4967;
  box-shadow: 0 5px 12px rgba(91, 105, 148, 0.12);
  cursor: grab;
}

.simulation-gantt-order:hover { border-color: #7f91c0; transform: translateY(-1px); }
.simulation-gantt-order:active { cursor: grabbing; }
.simulation-gantt-order.is-dragging { opacity: 0.48; }
.simulation-gantt-order.is-adjusted {
  border: 2px solid #9174c6;
  background: linear-gradient(135deg, #efe6ff, #e0ecff);
  box-shadow: 0 0 0 3px rgba(145, 116, 198, 0.12), 0 5px 12px rgba(91, 105, 148, 0.12);
}
.simulation-gantt-order span,
.simulation-gantt-order small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.simulation-gantt-order strong {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 4px;
  font-size: 0.8rem;
  line-height: 1.2;
}
.simulation-gantt-order strong > span {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.simulation-gantt-order strong em {
  margin-left: 3px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #7154aa;
  color: #fff;
  font-size: 0.56rem;
  font-style: normal;
  vertical-align: 1px;
}
.simulation-gantt-order span { font-size: 0.68rem; color: #5f6880; }
.simulation-gantt-order small { font-size: 0.62rem; color: #7b8295; }

.simulation-transition-rail {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 34px;
  border-top: 1px dashed #dfe4ec;
  background: color-mix(in srgb, #f7f9fc 86%, transparent 14%);
  pointer-events: none;
}

html[data-theme-preset="dark"] .simulation-transition-rail {
  border-top-color: rgba(177, 188, 205, 0.22);
  background: color-mix(in srgb, var(--surface) 86%, transparent 14%);
}

.simulation-transition-marker {
  position: absolute;
  z-index: 5;
  top: 5px;
  left: calc(var(--simulation-transition-left, 0) * 78px + 12px);
  display: grid;
  width: 24px;
  height: 24px;
  min-height: 24px;
  place-items: center;
  transform: translateX(-50%);
  border: 1px solid #bdc7d5;
  border-radius: 999px;
  background: #fff;
  color: #5c6777;
  padding: 0;
  box-shadow: 0 3px 8px rgba(74, 80, 96, 0.12);
  font-size: 0.66rem;
  font-weight: 850;
  cursor: pointer;
  pointer-events: auto;
}

.simulation-transition-marker.is-safe { border-color: #8cc6a1; background: #eaf8ef; color: #407557; }
.simulation-transition-marker.is-warning { border-color: #dbb75f; background: #fff5d8; color: #8a681d; }
.simulation-transition-marker.is-danger { border-color: #d58c92; background: #ffeaec; color: #974850; }
.simulation-transition-marker:hover,
.simulation-transition-marker.is-linked-active {
  transform: translateX(-50%) scale(1.1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent 82%);
}

.simulation-gantt-transfer {
  position: relative;
  width: 100%;
  min-width: 0;
  border: 1px solid #cfd5de;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(74, 80, 96, 0.08);
}

.simulation-gantt-transfer > summary {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px 7px;
  min-height: 32px;
  padding: 4px 8px;
  cursor: pointer;
  list-style: none;
}

.simulation-gantt-transfer > summary::-webkit-details-marker { display: none; }
.simulation-gantt-transfer > summary::after {
  content: "＋";
  grid-column: 3;
  grid-row: 1 / span 2;
  color: #6f7c8c;
  font-size: 0.82rem;
  font-weight: 800;
}
.simulation-gantt-transfer[open] > summary::after { content: "－"; }
.simulation-gantt-transfer[open] {
  box-shadow: 0 8px 20px rgba(53, 63, 82, 0.13);
}

.simulation-transfer-summary strong,
.simulation-transfer-summary small {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.simulation-transfer-summary strong { color: #3f4e4a; font-size: 0.68rem; }
.simulation-transfer-summary small { color: #76808e; font-size: 0.6rem; }
.simulation-transfer-dot {
  display: grid;
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #596776;
  font-size: 0.62rem;
  font-weight: 850;
}

.simulation-gantt-transfer.is-linked-active {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent 82%);
}

.simulation-transfer-body {
  display: grid;
  gap: 6px;
  padding: 0 10px 10px;
}

.simulation-gantt-transfer[open] .simulation-transfer-body {
  max-height: 245px;
  overflow-y: auto;
}

.simulation-gantt-transfer select {
  min-height: 34px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 0.7rem;
}

.simulation-gantt-transfer.is-safe { border-color: #9ed0b0; background: #f0fbf4; }
.simulation-gantt-transfer.is-warning { border-color: #e5c679; background: #fff8e6; }
.simulation-gantt-transfer.is-danger { border-color: #dfa1a5; background: #fff0f1; }

html[data-theme-preset="dark"] .simulation-transition-marker {
  border-color: #68758a;
  background: #2f3848;
  color: #dce6f5;
}

html[data-theme-preset="dark"] .simulation-gantt-transfer {
  border-color: #526073;
  background: var(--surface);
  color: var(--ink);
}

html[data-theme-preset="dark"] .simulation-gantt-transfer.is-safe { border-color: #5b9270; background: color-mix(in srgb, #315442 72%, var(--surface) 28%); }
html[data-theme-preset="dark"] .simulation-gantt-transfer.is-warning { border-color: #9d8040; background: color-mix(in srgb, #594b28 72%, var(--surface) 28%); }
html[data-theme-preset="dark"] .simulation-gantt-transfer.is-danger { border-color: #9d5f68; background: color-mix(in srgb, #5b3038 72%, var(--surface) 28%); }

/* The compact connection marker stays on the timeline; details expand in place. */
.simulation-gantt-transfer .simulation-transfer-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  color: #3f4e4a;
  font-size: 0.7rem;
}

.simulation-gantt-transfer .simulation-transfer-title strong {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.simulation-gantt-transfer .simulation-transfer-title > span { color: #8c96a3; }

.simulation-gantt-transfer .simulation-transfer-route {
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.simulation-package-warning { display:inline-flex; margin-left:6px; padding:3px 6px; border-radius:999px; background:#fff0df; color:#956329; font-size:10px; font-weight:800; }
.simulation-package-diff { display:grid; gap:4px; margin:8px 0; padding:8px 10px; border-left:3px solid #d18a54; border-radius:7px; background:#fff7eb; color:#79552f; font-size:12px; }
.booking-step-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:12px 0 4px; padding:10px 12px; border:1px solid var(--line, #dfe5ec); border-radius:8px; background:var(--surface-subtle, #f7f9fb); }
.booking-step-actions span { color:var(--muted, #687383); font-size:12px; font-weight:700; }
.booking-step-actions button { min-height:36px; }
.booking-step-actions button:disabled { opacity:.45; cursor:not-allowed; }
html[data-theme-preset="dark"] .booking-step-actions {
  background: #142942 !important;
  border-color: #345574 !important;
}
html[data-theme-preset="dark"] .booking-step-actions > span {
  color: #c5d6e7 !important;
}
html[data-theme-preset="dark"] .booking-step-actions .ghost-button {
  background: #1b3550 !important;
  border-color: #476987 !important;
  color: #edf5ff !important;
}
html[data-theme-preset="dark"] .booking-step-actions .ghost-button:hover:not(:disabled) {
  background: #264660 !important;
}
html[data-theme-preset="dark"] .booking-step-actions .primary-button {
  background: #19666b !important;
  border-color: #4bb7ad !important;
  color: #f1fffd !important;
}
html[data-theme-preset="dark"] .booking-step-actions .primary-button:hover:not(:disabled) {
  background: #1d6e72 !important;
}
html[data-theme-preset="dark"] .booking-step-actions button:disabled {
  background: #192b3d !important;
  border-color: #344a60 !important;
  color: #9aaec2 !important;
  opacity: 1;
}
.booking-form-workspace #bookingForm [hidden] { display:none !important; }
.checkout-adjustment-editor { display:grid; gap:8px; margin-top:10px; }
.checkout-adjustment-editor textarea { width:100%; min-height:76px; resize:vertical; }
.checkout-adjustment-toolbar { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; }
.checkout-adjustment-toolbar small { color:var(--muted, #687383); }
.checkout-confirm-bar { position:sticky; bottom:0; z-index:4; display:flex; align-items:center; justify-content:space-between; gap:12px; margin:12px -12px -12px; padding:10px 12px; border-top:1px solid #e6c99f; background:#fffaf1; box-shadow:0 -4px 12px rgba(45,33,15,.08); }
.checkout-confirm-bar[hidden] { display:none; }
@media (max-width: 640px) { .booking-step-actions { flex-wrap:wrap; } .booking-step-actions span { order:-1; width:100%; text-align:center; } .checkout-confirm-bar { align-items:stretch; flex-direction:column; } }

.simulation-gantt-transfer .simulation-sf-check-button {
  min-height: 23px;
  padding: 2px 6px;
  border: 1px solid #c8d4cf;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.78);
  color: #4f6f66;
  font-size: 0.61rem;
  font-weight: 750;
  cursor: pointer;
}

.simulation-gantt-transfer .simulation-sf-check-button:disabled { cursor: wait; opacity: 0.65; }
.simulation-gantt-transfer .simulation-sf-check-result { color: var(--muted); font-size: 0.6rem; line-height: 1.4; overflow-wrap: anywhere; }
.simulation-gantt-transfer .simulation-sf-check-result.is-safe { color: #4d8262; }
.simulation-gantt-transfer .simulation-sf-check-result.is-danger { color: #a34f55; }

.simulation-gantt-transfer .simulation-sf-route-editor {
  grid-column: 1 / -1;
  min-width: 0;
  border-top: 1px dashed rgba(104, 123, 116, 0.28);
  padding-top: 4px;
}

.simulation-gantt-transfer .simulation-sf-route-editor > summary {
  color: #4f6f66;
  font-size: 0.58rem;
  font-weight: 800;
  cursor: pointer;
  list-style-position: inside;
}

.simulation-gantt-transfer .simulation-sf-route-editor[open] { display: grid; gap: 5px; }
.simulation-gantt-transfer .simulation-sf-route-editor label { display: grid; gap: 2px; color: var(--muted); font-size: 0.55rem; }
.simulation-gantt-transfer .simulation-sf-route-editor input { width: 100%; min-width: 0; height: 28px; padding: 4px 6px; border-radius: 7px; font-size: 0.58rem; }
.simulation-gantt-transfer .simulation-sf-route-editor > small { color: var(--muted); font-size: 0.52rem; line-height: 1.35; }

.simulation-transition-list {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-width: 0;
  padding-top: 4px;
  border-top: 1px solid #eaecf1;
}

@media (max-width: 700px) {
  .simulation-transition-list {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .simulation-detail-label {
    padding-top: 0;
  }
}

.simulation-transition-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: 8px;
  min-width: 0;
}

/* Legacy declarations retained below for compatibility with saved markup. */
.simulation-gantt-transfer.is-legacy {
  position: relative;
  display: grid;
  gap: 6px;
  width: 320px;
  padding: 10px;
  border: 1px solid #cfd5de;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(74, 80, 96, 0.08);
}
.simulation-lane-placeholder {
  position: absolute;
  top: 48px;
  left: 18px;
  color: #9a9eaa;
  font-size: 0.78rem;
}

.simulation-lane-details {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 9px 14px 11px calc(var(--simulation-heading-width, 270px) + 14px);
  border-top: 1px dashed #e0e3ea;
  background: linear-gradient(90deg, #fafbfe, #fffdfb);
}

.simulation-order-key-list,
.simulation-transition-list {
  width: 100%;
  max-width: calc(var(--simulation-timeline-width, 620px) - 28px);
}

.simulation-order-key-list {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 7px;
}

.simulation-detail-label {
  flex: 0 0 60px;
  padding-top: 6px;
  color: #7a8091;
  font-size: 0.63rem;
  font-weight: 800;
}

.simulation-order-key {
  display: inline-flex;
  max-width: 360px;
  min-height: 30px;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid #d5dcec;
  border-radius: 10px;
  background: #f6f8ff;
  color: #48536e;
  font-size: 0.66rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.simulation-order-key b {
  display: grid;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  background: #e3e8f8;
  font-size: 0.58rem;
}

.simulation-order-key span { overflow-wrap: anywhere; }
.simulation-order-key:hover { border-color: #99a9ce; background: #edf2ff; }

.simulation-transition-list {
  padding-top: 8px;
  border-top: 1px solid #eaecf1;
}

@media (max-width: 850px) {
  .simulation-board { --simulation-heading-width: 210px; }
  .simulation-gantt-header,
  .simulation-gantt-row { grid-template-columns: 210px var(--simulation-timeline-width, 620px); }
  .simulation-board { min-width: calc(210px + var(--simulation-timeline-width, 620px)); }
}

@media (max-width: 430px) {
  .device-return-toolbar {
    grid-template-columns: 1fr;
  }

  .device-return-range-actions,
  .device-return-toolbar label:nth-last-child(-n + 2) {
    grid-column: 1;
  }

  .device-return-range-actions {
    grid-row: auto;
  }

  .device-return-toolbar-panel .panel-heading,
  .device-return-pending-panel .panel-heading {
    flex-direction: column;
  }

  .device-return-group-kpis {
    display: grid;
    gap: 4px;
  }
}

[data-admin-setting][hidden],
[data-workspace-module][hidden],
.task-panels[hidden],
.dashboard-inventory-column[hidden],
.nav-item[hidden] {
  display: none !important;
}

/* Dark theme compatibility layer.
   A number of older panels intentionally use light, component-specific fills.
   Keep their semantic accents, but remap the surfaces and text when the dark
   preset is active so controls never become white-on-white or low contrast. */
html[data-theme-preset="dark"] {
  --shadow: 0 16px 38px rgba(0, 0, 0, 0.24);
  --dark-surface-raised: color-mix(in srgb, var(--surface) 93%, white 7%);
  --dark-surface-soft: color-mix(in srgb, var(--surface) 86%, var(--bg) 14%);
  --dark-surface-accent: color-mix(in srgb, var(--accent) 14%, var(--surface) 86%);
  --dark-line-soft: color-mix(in srgb, var(--line) 82%, white 18%);
}

html[data-theme-preset="dark"] .nav-item:hover,
html[data-theme-preset="dark"] .nav-item.active {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line) 40%);
  background: color-mix(in srgb, var(--accent) 22%, var(--sidebar-bg) 78%);
  color: var(--sidebar-ink);
}

html[data-theme-preset="dark"] .sidebar-toggle {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface) 70%, var(--sidebar-bg) 30%);
  color: var(--sidebar-ink);
}

html[data-theme-preset="dark"] .panel,
html[data-theme-preset="dark"] .metric,
html[data-theme-preset="dark"] .app-dialog,
html[data-theme-preset="dark"] .date-picker-popover,
html[data-theme-preset="dark"] .daily-export-reminder,
html[data-theme-preset="dark"] .inventory-combination-panel,
html[data-theme-preset="dark"] .inventory-model-dialog,
html[data-theme-preset="dark"] .stock-line-chart,
html[data-theme-preset="dark"] .asset-editor-panel {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

html[data-theme-preset="dark"] .panel-heading,
html[data-theme-preset="dark"] .booking-edit-summary,
html[data-theme-preset="dark"] .system-settings-status,
html[data-theme-preset="dark"] .system-protection-item,
html[data-theme-preset="dark"] .booking-history-item,
html[data-theme-preset="dark"] .asset-form-section,
html[data-theme-preset="dark"] .managed-category-field,
html[data-theme-preset="dark"] .inventory-model-order-card,
html[data-theme-preset="dark"] .income-order-row,
html[data-theme-preset="dark"] .all-orders-model-group,
html[data-theme-preset="dark"] .warehouse-card,
html[data-theme-preset="dark"] .todo-item {
  border-color: var(--dark-line-soft);
  background: var(--dark-surface-raised);
  color: var(--ink);
}

html[data-theme-preset="dark"] .inventory-combination-body,
html[data-theme-preset="dark"] .inventory-combination-card,
html[data-theme-preset="dark"] .inventory-combination-result-heading,
html[data-theme-preset="dark"] .inventory-combination-result-items,
html[data-theme-preset="dark"] .inventory-combination-empty-state,
html[data-theme-preset="dark"] .income-summary-box,
html[data-theme-preset="dark"] .task-card,
html[data-theme-preset="dark"] .device-return-group,
html[data-theme-preset="dark"] .device-return-row,
html[data-theme-preset="dark"] .gantt-model-card,
html[data-theme-preset="dark"] .gantt-booking-bar {
  border-color: var(--dark-line-soft);
  background: var(--dark-surface-soft);
  color: var(--ink);
}

html[data-theme-preset="dark"] input,
html[data-theme-preset="dark"] select,
html[data-theme-preset="dark"] textarea,
html[data-theme-preset="dark"] .date-picker-day,
html[data-theme-preset="dark"] .date-picker-nav,
html[data-theme-preset="dark"] .ghost-button,
html[data-theme-preset="dark"] .small-button,
html[data-theme-preset="dark"] .inventory-combination-qty button,
html[data-theme-preset="dark"] .booking-order-navigation button {
  border-color: var(--line);
  background: var(--dark-surface-soft);
  color: var(--ink);
}

html[data-theme-preset="dark"] input::placeholder,
html[data-theme-preset="dark"] textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 86%, white 14%);
}

html[data-theme-preset="dark"] input:focus,
html[data-theme-preset="dark"] select:focus,
html[data-theme-preset="dark"] textarea:focus,
html[data-theme-preset="dark"] .date-picker-day:hover,
html[data-theme-preset="dark"] .ghost-button:hover,
html[data-theme-preset="dark"] .small-button:hover,
html[data-theme-preset="dark"] .inventory-combination-qty button:hover {
  border-color: var(--accent);
  background: var(--dark-surface-accent);
  color: var(--ink);
}

html[data-theme-preset="dark"] .primary-button,
html[data-theme-preset="dark"] .system-settings-actions .primary-button,
html[data-theme-preset="dark"] .asset-form-actions .primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #102326;
}

html[data-theme-preset="dark"] .primary-button:hover,
html[data-theme-preset="dark"] .primary-button:focus-visible {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #f3fbfa;
}

html[data-theme-preset="dark"] .danger-button,
html[data-theme-preset="dark"] .booking-delete-current-button {
  border-color: color-mix(in srgb, var(--danger) 65%, var(--line) 35%);
  background: color-mix(in srgb, var(--danger) 20%, var(--surface) 80%);
  color: #f1b5ae;
}

html[data-theme-preset="dark"] .danger-button:hover,
html[data-theme-preset="dark"] .booking-delete-current-button:hover {
  background: color-mix(in srgb, var(--danger) 32%, var(--surface) 68%);
  color: #ffd9d3;
}

html[data-theme-preset="dark"] .system-settings-dialog::backdrop,
html[data-theme-preset="dark"] .inventory-model-dialog::backdrop {
  background: rgba(4, 8, 10, 0.72);
}

html[data-theme-preset="dark"] .system-settings-shell,
html[data-theme-preset="dark"] .inventory-model-dialog-shell {
  background: var(--surface);
  color: var(--ink);
}

html[data-theme-preset="dark"] .system-config-section,
html[data-theme-preset="dark"] .system-protection-section,
html[data-theme-preset="dark"] .system-version-heading,
html[data-theme-preset="dark"] .system-settings-actions,
html[data-theme-preset="dark"] .asset-editor-heading {
  border-color: var(--line);
}

html[data-theme-preset="dark"] .system-template-preview,
html[data-theme-preset="dark"] .system-toggle-item,
html[data-theme-preset="dark"] .system-rule-row,
html[data-theme-preset="dark"] .system-color-swatch,
html[data-theme-preset="dark"] .system-appearance-preview {
  border-color: var(--line);
  background: var(--dark-surface-soft);
  color: var(--ink);
}

/* Category colors remain useful in dark mode, but are blended into the dark
   surface instead of leaving bright pastel cards behind. */
html[data-theme-preset="dark"] [class*="inventory-category-tone-"],
html[data-theme-preset="dark"] .all-orders-model-group.category-tripod,
html[data-theme-preset="dark"] .all-orders-model-group.category-high-value,
html[data-theme-preset="dark"] .simulation-model-card[class*="category-"] {
  background: color-mix(in srgb, var(--category-bg, var(--surface)) 11%, var(--surface) 89%);
  border-color: color-mix(in srgb, var(--category-border, var(--line)) 70%, var(--line) 30%);
  color: var(--ink);
}

html[data-theme-preset="dark"] .inventory-category-filter span,
html[data-theme-preset="dark"] .task-progress-ring,
html[data-theme-preset="dark"] .task-progress-counts span {
  background: color-mix(in srgb, var(--surface) 80%, white 20%);
  color: var(--ink);
}

html[data-theme-preset="dark"] .date-picker-day.selected,
html[data-theme-preset="dark"] .date-picker-day.range-edge {
  background: var(--accent);
  color: #102326;
}

html[data-theme-preset="dark"] .date-picker-day.in-range {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line) 45%);
  background: color-mix(in srgb, var(--accent) 20%, var(--surface) 80%);
  color: var(--ink);
}

html[data-theme-preset="dark"] .muted,
html[data-theme-preset="dark"] .field-help,
html[data-theme-preset="dark"] .system-settings-field small,
html[data-theme-preset="dark"] .system-protection-item span,
html[data-theme-preset="dark"] .system-protection-item small {
  color: var(--muted);
}

html[data-theme-preset="dark"] button:disabled {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface) 82%, var(--bg) 18%);
  color: color-mix(in srgb, var(--muted) 72%, var(--surface) 28%);
  opacity: 0.72;
}

.split-grid.is-single-column {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 760px) {
  .system-toggle-groups,
  .system-template-grid,
  .system-toggle-grid,
  .system-import-scopes,
  .system-color-grid {
    grid-template-columns: 1fr;
  }

  .system-rule-row,
  .system-diff-row {
    grid-template-columns: 1fr;
  }

  .system-import-actions,
  .system-version-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .system-version-heading .ghost-button {
    width: 100%;
  }
}
/* Ultimate dark theme override: keep this block last so legacy page styles cannot reintroduce light surfaces. */
html[data-theme-preset="dark"] {
  --bg:#081321; --surface:#111e31; --surface-muted:#142238; --ink:#e7edf7; --muted:#aebed2; --line:#263a55; --accent:#42bdb0; --accent-strong:#7adbd0;
}
html[data-theme-preset="dark"] body,
html[data-theme-preset="dark"] main,
html[data-theme-preset="dark"] .workspace,
html[data-theme-preset="dark"] .view { background:#081321 !important; color:#e7edf7 !important; }
html[data-theme-preset="dark"] .panel,
html[data-theme-preset="dark"] .metric,
html[data-theme-preset="dark"] .form-panel,
html[data-theme-preset="dark"] .customer-check-panel,
html[data-theme-preset="dark"] .checkout-sidebar,
html[data-theme-preset="dark"] .checkout-order,
html[data-theme-preset="dark"] .task-card,
html[data-theme-preset="dark"] .todo-item,
html[data-theme-preset="dark"] .income-panel,
html[data-theme-preset="dark"] .inventory-model-card,
html[data-theme-preset="dark"] .inventory-model-order-card,
html[data-theme-preset="dark"] .warehouse-card,
html[data-theme-preset="dark"] .asset-card,
html[data-theme-preset="dark"] .booking-card,
html[data-theme-preset="dark"] .movement-card,
html[data-theme-preset="dark"] .device-return-group,
html[data-theme-preset="dark"] .device-return-row,
html[data-theme-preset="dark"] .all-order-card,
html[data-theme-preset="dark"] .all-orders-model-group,
html[data-theme-preset="dark"] .simulation-hero,
html[data-theme-preset="dark"] .simulation-controls-panel,
html[data-theme-preset="dark"] .simulation-pool-panel,
html[data-theme-preset="dark"] .simulation-board-panel,
html[data-theme-preset="dark"] .simulation-inspector-panel,
html[data-theme-preset="dark"] .simulation-summary-card { background:#111e31 !important; border-color:#263a55 !important; color:#e7edf7 !important; }
html[data-theme-preset="dark"] .task-card .card-top,
html[data-theme-preset="dark"] .task-card .card-body,
html[data-theme-preset="dark"] .task-card .task-content,
html[data-theme-preset="dark"] .task-card .task-order-open {
  background: transparent !important;
}
html[data-theme-preset="dark"] .task-card .task-order-open:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}
html[data-theme-preset="dark"] .task-card .task-order-open:focus-visible {
  outline: 2px solid var(--task-accent);
  outline-offset: 2px;
}
html[data-theme-preset="dark"] .booking-card .card-top { background:#172b43 !important; color:#e7edf7 !important; }
html[data-theme-preset="dark"] input,
html[data-theme-preset="dark"] select,
html[data-theme-preset="dark"] textarea,
html[data-theme-preset="dark"] .date-picker-field,
html[data-theme-preset="dark"] .inventory-date-range-field,
html[data-theme-preset="dark"] .stock-line-date-range-field,
html[data-theme-preset="dark"] .booking-search-input,
html[data-theme-preset="dark"] .all-orders-search input { background:#0d192b !important; color:#edf4ff !important; border-color:#35516f !important; }
html[data-theme-preset="dark"] input::placeholder,
html[data-theme-preset="dark"] textarea::placeholder { color:#8fa5bd !important; opacity:1 !important; }
html[data-theme-preset="dark"] .inventory-combination-panel,
html[data-theme-preset="dark"] .inventory-combination-body,
html[data-theme-preset="dark"] .inventory-combination-column,
html[data-theme-preset="dark"] .inventory-combination-card,
html[data-theme-preset="dark"] .simulation-model-picker,
html[data-theme-preset="dark"] .simulation-model-picker-body,
html[data-theme-preset="dark"] .simulation-model-card,
html[data-theme-preset="dark"] .simulation-order-card { background:#162b43 !important; border-color:#355574 !important; color:#e7edf7 !important; }
html[data-theme-preset="dark"] .inventory-combination-card strong,
html[data-theme-preset="dark"] .simulation-model-card strong,
html[data-theme-preset="dark"] .simulation-order-card strong,
html[data-theme-preset="dark"] .asset-card strong,
html[data-theme-preset="dark"] .booking-card strong { color:#eff6ff !important; }
html[data-theme-preset="dark"] .panel-heading,
html[data-theme-preset="dark"] .task-panel-heading,
html[data-theme-preset="dark"] .simulation-section-heading,
html[data-theme-preset="dark"] .asset-editor-heading { background:#142238 !important; border-color:#263a55 !important; color:#f1f6fd !important; }
html[data-theme-preset="dark"] .panel-heading .task-progress-counts span,
html[data-theme-preset="dark"] .task-progress-counts span,
html[data-theme-preset="dark"] .inventory-category-filter span,
html[data-theme-preset="dark"] .booking-status-pill,
html[data-theme-preset="dark"] .order-stage-badge { background:#1b3047 !important; border-color:#3a5875 !important; color:#dce9f6 !important; }
html[data-theme-preset="dark"] .panel-heading .task-progress-counts .task-overdue-count,
html[data-theme-preset="dark"] .task-overdue-badge { background:#4a2c35 !important; border-color:#a96570 !important; color:#ffe5e2 !important; }
html[data-theme-preset="dark"] .customer-check-item,
html[data-theme-preset="dark"] .income-summary-box,
html[data-theme-preset="dark"] .income-details,
html[data-theme-preset="dark"] .date-range-picker-popover,
html[data-theme-preset="dark"] .date-picker-popover { background:#172b43 !important; border-color:#355574 !important; color:#e7edf7 !important; }
html[data-theme-preset="dark"] .gantt-table,
html[data-theme-preset="dark"] .gantt-grid,
html[data-theme-preset="dark"] .simulation-gantt-header,
html[data-theme-preset="dark"] .simulation-gantt-lane { background:#0f1d30 !important; color:#dce7f5 !important; border-color:#2a405c !important; }
html[data-theme-preset="dark"] .simulation-gantt-day,
html[data-theme-preset="dark"] .simulation-gantt-corner,
html[data-theme-preset="dark"] .simulation-lane-heading { background:#142238 !important; color:#dce7f5 !important; border-color:#2a405c !important; }
html[data-theme-preset="dark"] .simulation-gantt-order,
html[data-theme-preset="dark"] .gantt-booking-bar { background:#1d3a57 !important; color:#eff6ff !important; border-color:#47758e !important; }
html[data-theme-preset="dark"] .simulation-gantt-order span,
html[data-theme-preset="dark"] .simulation-gantt-order small,
html[data-theme-preset="dark"] .gantt-booking-bar span { color:#dce9f6 !important; }
html[data-theme-preset="dark"] button:not(.nav-item):not(.sidebar-footer-action) { color:#e7edf7 !important; }

/* Last-resort contrast corrections for legacy widgets. */
html[data-theme-preset="dark"] .task-card .card-title,
html[data-theme-preset="dark"] .task-card .task-meta-line,
html[data-theme-preset="dark"] .task-card .task-model-inline,
html[data-theme-preset="dark"] .waiver-release-hint,
html[data-theme-preset="dark"] .task-agent-review-badge { color:#e7f2ff !important; }
html[data-theme-preset="dark"] .task-agent-review-badge,
html[data-theme-preset="dark"] .task-card .task-status-badge { background:#244052 !important; border-color:#4d8b91 !important; }
html[data-theme-preset="dark"] .task-card.is-overdue .task-agent-review-badge,
html[data-theme-preset="dark"] .task-card.is-claim .task-agent-review-badge { background:#59333c !important; color:#ffe9e6 !important; }
html[data-theme-preset="dark"] .simulation-model-picker-body,
html[data-theme-preset="dark"] .simulation-model-picker > summary,
html[data-theme-preset="dark"] .simulation-filter-grid,
html[data-theme-preset="dark"] .gantt-filter-grid,
html[data-theme-preset="dark"] .all-orders-filter-panel { background:#142238 !important; color:#e7edf7 !important; border-color:#2c4764 !important; }
html[data-theme-preset="dark"] .simulation-model-card,
html[data-theme-preset="dark"] .simulation-selected-chip,
html[data-theme-preset="dark"] .simulation-summary-card { background:#1b3550 !important; color:#edf5ff !important; border-color:#3b6382 !important; }
html[data-theme-preset="dark"] .simulation-empty,
html[data-theme-preset="dark"] .inventory-overview-empty,
html[data-theme-preset="dark"] .empty-state { background:#172b43 !important; color:#dce9f6 !important; border-color:#355574 !important; }
html[data-theme-preset="dark"] .panel *:not(svg):not(path) { border-color:inherit; }
html[data-theme-preset="dark"] .panel input,
html[data-theme-preset="dark"] .panel select,
html[data-theme-preset="dark"] .panel textarea,
html[data-theme-preset="dark"] .view input,
html[data-theme-preset="dark"] .view select,
html[data-theme-preset="dark"] .view textarea { background:#0d192b !important; color:#edf4ff !important; }
html[data-theme-preset="dark"] .booking-summary-picker,
html[data-theme-preset="dark"] .summary-choice-grid,
html[data-theme-preset="dark"] .summary-request-columns,
html[data-theme-preset="dark"] .summary-request-column,
html[data-theme-preset="dark"] .summary-request-subgroup,
html[data-theme-preset="dark"] .summary-choice-card { background:#13263c !important; border-color:#355574 !important; color:#e7edf7 !important; }
html[data-theme-preset="dark"] .summary-choice-card strong { color:#edf5ff !important; }
html[data-theme-preset="dark"] .summary-choice-card span,
html[data-theme-preset="dark"] .summary-choice-card small,
html[data-theme-preset="dark"] .summary-request-column-heading span,
html[data-theme-preset="dark"] .summary-request-subgroup-heading span { color:#afc2d7 !important; }
html[data-theme-preset="dark"] .summary-choice-card {
  --request-bg: #252d36;
  --request-selected-bg: #354350;
  --request-border: #566573;
  --request-accent: #bed0df;
}
html[data-theme-preset="dark"] .summary-choice-card.summary-category-body {
  --request-bg: #192f2a;
  --request-selected-bg: #254b3d;
  --request-border: #426d59;
  --request-accent: #9ad8b0;
}
html[data-theme-preset="dark"] .summary-choice-card.summary-category-lens {
  --request-bg: #182f3d;
  --request-selected-bg: #224958;
  --request-border: #416c80;
  --request-accent: #9bd8eb;
}
html[data-theme-preset="dark"] .summary-choice-card.summary-category-tripod {
  --request-bg: #342b20;
  --request-selected-bg: #4e3e2b;
  --request-border: #78613e;
  --request-accent: #e6c28b;
}
html[data-theme-preset="dark"] .summary-choice-card.summary-category-dji {
  --request-bg: #30253e;
  --request-selected-bg: #483654;
  --request-border: #735c85;
  --request-accent: #d9b9ed;
}
html[data-theme-preset="dark"] .summary-choice-card.summary-category-high-value {
  --request-bg: #353017;
  --request-selected-bg: #4b4324;
  --request-border: #847335;
  --request-accent: #ebd780;
}
html[data-theme-preset="dark"] .summary-choice-card.summary-category-transfer {
  --request-bg: #352633;
  --request-selected-bg: #4e3747;
  --request-border: #815b75;
  --request-accent: #e6b6d4;
}
html[data-theme-preset="dark"] .summary-choice-card[class*="summary-category-"] {
  background: var(--request-bg) !important;
  border-color: var(--request-border) !important;
}
html[data-theme-preset="dark"] .summary-choice-card.selected {
  background: var(--request-selected-bg) !important;
  border-color: var(--request-accent) !important;
  box-shadow: inset 3px 0 0 var(--request-accent);
}
html[data-theme-preset="dark"] .summary-choice-card .summary-qty-control b {
  color: #edf5ff !important;
}
html[data-theme-preset="dark"] .summary-choice-card .summary-request-stock {
  color: #c1cddd !important;
}
html[data-theme-preset="dark"] .summary-choice-card.request-stock-low .summary-request-stock {
  color: #f1d28b !important;
}
html[data-theme-preset="dark"] .summary-choice-card.request-stock-unavailable .summary-request-stock,
html[data-theme-preset="dark"] .summary-choice-card.request-stock-shortage .summary-request-stock,
html[data-theme-preset="dark"] .summary-choice-card.request-stock-invalid .summary-request-stock {
  color: #ffb5bc !important;
}
html[data-theme-preset="dark"] .summary-request-column-heading,
html[data-theme-preset="dark"] .summary-request-subgroup-heading {
  color: #e7edf7 !important;
}
html[data-theme-preset="dark"] .summary-request-column-lens > .summary-request-column-heading {
  color: #9bd8eb !important;
}
html[data-theme-preset="dark"] .summary-request-column-body > .summary-request-column-heading {
  color: #9ad8b0 !important;
}
html[data-theme-preset="dark"] .asset-classification-section .managed-category-field {
  background: #12243a !important;
  border-color: #345574 !important;
  color: #eaf3fc !important;
}
html[data-theme-preset="dark"] .asset-classification-section .field-help {
  color: #b8ccdf !important;
}
html[data-theme-preset="dark"] .gantt-drawer,
html[data-theme-preset="dark"] .gantt-drawer-shell,
html[data-theme-preset="dark"] .gantt-booking-drawer,
html[data-theme-preset="dark"] .gantt-drawer-content,
html[data-theme-preset="dark"] .app-dialog,
html[data-theme-preset="dark"] dialog { background:#111e31 !important; border-color:#355574 !important; color:#e7edf7 !important; }
html[data-theme-preset="dark"] .gantt-drawer .booking-detail-card,
html[data-theme-preset="dark"] .gantt-drawer .booking-detail-section,
html[data-theme-preset="dark"] .gantt-drawer .drawer-section { background:#172b43 !important; border-color:#355574 !important; color:#e7edf7 !important; }
html[data-theme-preset="dark"] .gantt-drawer input,
html[data-theme-preset="dark"] .gantt-drawer select,
html[data-theme-preset="dark"] .gantt-drawer textarea { background:#0d192b !important; color:#edf4ff !important; }
html[data-theme-preset="dark"] .waiver-release-hint.has-pending-claim,
html[data-theme-preset="dark"] .simulation-adjusted-badge,
html[data-theme-preset="dark"] .simulation-package-warning { background:#59333c !important; border-color:#a96570 !important; color:#ffe9e6 !important; }

/* Dark semantic treatment for dashboard claim badges and the Gantt order drawer. */
html[data-theme-preset="dark"] .task-claim-badge {
  background: #4a3027 !important;
  border-color: #b97852 !important;
  color: #ffe7d2 !important;
}
html[data-theme-preset="dark"] .task-overdue-badge {
  background: #482a33 !important;
  border-color: #a96570 !important;
  color: #ffe5e2 !important;
}
html[data-theme-preset="dark"] .task-waiver-badge {
  background: #173b3b !important;
  border-color: #4d9690 !important;
  color: #c9f2e8 !important;
}
html[data-theme-preset="dark"] .gantt-booking-drawer,
html[data-theme-preset="dark"] .gantt-drawer-shell,
html[data-theme-preset="dark"] .gantt-drawer-header,
html[data-theme-preset="dark"] .gantt-drawer-actions {
  background: #101d2e !important;
  color: #e8f1fb !important;
  border-color: #2b4764 !important;
}
html[data-theme-preset="dark"] .gantt-drawer-header p,
html[data-theme-preset="dark"] .gantt-drawer-section-heading span,
html[data-theme-preset="dark"] .gantt-drawer-overview span,
html[data-theme-preset="dark"] .gantt-drawer-field strong {
  color: #9db2c8 !important;
}
html[data-theme-preset="dark"] .gantt-drawer-header h2,
html[data-theme-preset="dark"] .gantt-drawer-section-heading h3,
html[data-theme-preset="dark"] .gantt-drawer-field span:last-child,
html[data-theme-preset="dark"] .gantt-drawer-overview strong {
  color: #edf5ff !important;
}
html[data-theme-preset="dark"] .gantt-drawer-content {
  background: #0d1929 !important;
}
html[data-theme-preset="dark"] .gantt-drawer-section {
  background: #15283f !important;
  border-color: #31516f !important;
  box-shadow: 0 8px 20px rgba(0,0,0,.18) !important;
}
html[data-theme-preset="dark"] .gantt-drawer-overview {
  background: #173747 !important;
  border-color: #326477 !important;
}
html[data-theme-preset="dark"] .gantt-drawer-overview div,
html[data-theme-preset="dark"] .gantt-drawer-field {
  background: #1b3048 !important;
  border-color: #355574 !important;
}
html[data-theme-preset="dark"] .gantt-drawer-field-icon {
  background: #214756 !important;
  color: #8fddd5 !important;
}
html[data-theme-preset="dark"] .gantt-drawer-field.is-empty span:last-child {
  color: #7890a8 !important;
}
html[data-theme-preset="dark"] .gantt-drawer-badge.pending_review,
html[data-theme-preset="dark"] .gantt-drawer-badge.pending_ship {
  background: #4a3820 !important; border-color: #9f7b3f !important; color: #ffe5ad !important;
}
html[data-theme-preset="dark"] .gantt-drawer-badge.shipped,
html[data-theme-preset="dark"] .gantt-drawer-badge.in_rental {
  background: #173e4a !important; border-color: #3e8b9b !important; color: #c5f0f4 !important;
}
html[data-theme-preset="dark"] .gantt-drawer-badge.pending_return,
html[data-theme-preset="dark"] .gantt-drawer-badge.pending_checkin,
html[data-theme-preset="dark"] .gantt-drawer-badge.transfer {
  background: #392b4e !important; border-color: #7960a4 !important; color: #eadcff !important;
}
html[data-theme-preset="dark"] .gantt-drawer-badge.completed {
  background: #1c4135 !important; border-color: #4b9074 !important; color: #c8f1dd !important;
}
html[data-theme-preset="dark"] .gantt-drawer-badge.draft,
html[data-theme-preset="dark"] .gantt-drawer-badge.legacy_pending {
  background: #263544 !important; border-color: #536b81 !important; color: #d5e1ec !important;
}
html[data-theme-preset="dark"] .gantt-drawer-badge.canceled {
  background: #482a33 !important; border-color: #a96570 !important; color: #ffe5e2 !important;
}

/* Nested cards used by income details, simulation inspector and dispatch previews. */
html[data-theme-preset="dark"] .income-order-row,
html[data-theme-preset="dark"] .income-order-row.is-canceled,
html[data-theme-preset="dark"] .simulation-inspector-section,
html[data-theme-preset="dark"] .simulation-booking-notes,
html[data-theme-preset="dark"] .simulation-request-summary,
html[data-theme-preset="dark"] .simulation-city-source,
html[data-theme-preset="dark"] .simulation-date-source,
html[data-theme-preset="dark"] .simulation-adjustment-summary {
  background: #172d46 !important;
  border-color: #345674 !important;
  color: #e8f1fb !important;
}
html[data-theme-preset="dark"] .income-order-row strong,
html[data-theme-preset="dark"] .simulation-inspector-section h4,
html[data-theme-preset="dark"] .simulation-inspector-section strong {
  color: #edf5ff !important;
}
html[data-theme-preset="dark"] .income-order-row span,
html[data-theme-preset="dark"] .simulation-inspector-section p,
html[data-theme-preset="dark"] .simulation-inspector-section small,
html[data-theme-preset="dark"] .simulation-inspector-section label {
  color: #afc2d7 !important;
}
html[data-theme-preset="dark"] .income-order-amount { color: #7fd8d0 !important; }
html[data-theme-preset="dark"] .simulation-inspector-section input,
html[data-theme-preset="dark"] .simulation-inspector-section textarea,
html[data-theme-preset="dark"] .simulation-inspector-section select {
  background: #0d1b2d !important;
  border-color: #3a5c7c !important;
  color: #edf5ff !important;
}

html[data-theme-preset="dark"] .simulation-order-pool,
html[data-theme-preset="dark"] .simulation-pool-empty,
html[data-theme-preset="dark"] .simulation-plan-notes,
html[data-theme-preset="dark"] .simulation-board,
html[data-theme-preset="dark"] .simulation-gantt-row,
html[data-theme-preset="dark"] .simulation-gantt-row > div,
html[data-theme-preset="dark"] .simulation-gantt-order-key,
html[data-theme-preset="dark"] .inventory-combination-summary,
html[data-theme-preset="dark"] .inventory-combination-summary > div {
  background: #142942 !important;
  border-color: #345674 !important;
  color: #e8f1fb !important;
}
html[data-theme-preset="dark"] .simulation-order-pool h3,
html[data-theme-preset="dark"] .simulation-plan-notes h3,
html[data-theme-preset="dark"] .inventory-combination-summary strong,
html[data-theme-preset="dark"] .inventory-combination-summary span {
  color: #edf5ff !important;
}
html[data-theme-preset="dark"] .simulation-order-card,
html[data-theme-preset="dark"] .simulation-order-key,
html[data-theme-preset="dark"] .simulation-gantt-order-key {
  background: #1b3855 !important;
  border-color: #3c6587 !important;
  color: #edf5ff !important;
}
html[data-theme-preset="dark"] .simulation-gantt-row,
html[data-theme-preset="dark"] .simulation-gantt-row:nth-child(even) {
  background: #142942 !important;
}
html[data-theme-preset="dark"] .simulation-gantt-transfer > summary,
html[data-theme-preset="dark"] .simulation-transition-marker.is-safe,
html[data-theme-preset="dark"] .simulation-transition-marker.is-warning,
html[data-theme-preset="dark"] .simulation-transition-marker.is-danger {
  color: #edf5ff !important;
}
html[data-theme-preset="dark"] .inventory-combination-summary {
  background: #17344d !important;
}

html[data-theme-preset="dark"] .device-return-trend-chart,
html[data-theme-preset="dark"] .device-return-trend-scroll,
html[data-theme-preset="dark"] .device-return-trend-tooltip {
  background: #12243a !important;
  border-color: #345674 !important;
  color: #eaf3fc !important;
}
html[data-theme-preset="dark"] .device-return-trend-chart svg {
  background: #12243a !important;
}
html[data-theme-preset="dark"] .device-return-trend-chart text,
html[data-theme-preset="dark"] .device-return-trend-tooltip,
html[data-theme-preset="dark"] .device-return-trend-legend-item {
  fill: #c8d8e8 !important;
  color: #c8d8e8 !important;
}
html[data-theme-preset="dark"] .device-return-trend-tooltip strong,
html[data-theme-preset="dark"] .device-return-trend-tooltip span,
html[data-theme-preset="dark"] .device-return-trend-tooltip b,
html[data-theme-preset="dark"] .device-return-trend-tooltip em,
html[data-theme-preset="dark"] .device-return-trend-tooltip small { color: #eaf3fc !important; }
html[data-theme-preset="dark"] .device-return-table,
html[data-theme-preset="dark"] .device-return-row,
html[data-theme-preset="dark"] .device-return-header,
html[data-theme-preset="dark"] .device-return-notice {
  background: #142942 !important;
  border-color: #345674 !important;
  color: #e8f1fb !important;
}
html[data-theme-preset="dark"] .device-return-row .device-return-roi-cell strong,
html[data-theme-preset="dark"] .device-return-row > strong { color: #edf5ff !important; }
html[data-theme-preset="dark"] .device-return-row small,
html[data-theme-preset="dark"] .device-return-row i { color: #a9bfd4 !important; }
html[data-theme-preset="dark"] .device-return-table .device-return-category {
  background: #244052 !important; border-color: #4d8b91 !important; color: #d5f3ef !important;
}
html[data-theme-preset="dark"] .device-return-group-title > span {
  background: color-mix(in srgb, var(--category-accent, #7197a1) 24%, #111e31) !important;
  border-color: color-mix(in srgb, var(--category-accent, #7197a1) 65%, #111e31) !important;
  color: color-mix(in srgb, var(--category-accent, #7197a1) 25%, #ffffff) !important;
}
html[data-theme-preset="dark"] .device-return-quality-notice {
  background: #342c20 !important;
  border-color: #76613f !important;
  color: #f0d299 !important;
}
html[data-theme-preset="dark"] .device-return-trend-model-option {
  background: var(--model-dark-bg, #252d36) !important;
  border-color: color-mix(in srgb, var(--model-dark-accent, #bed0df) 40%, #111e31) !important;
  color: #c1cddd !important;
}
html[data-theme-preset="dark"] .device-return-trend-model-option:has(input:checked) {
  background: var(--model-dark-selected, #354350) !important;
  border-color: var(--model-dark-accent, #bed0df) !important;
}
html[data-theme-preset="dark"] .device-return-trend-model-option > span {
  color: #c1cddd !important;
}
html[data-theme-preset="dark"] .device-return-trend-model-option:has(input:checked) > span {
  color: #edf5ff !important;
}
html[data-theme-preset="dark"] .device-return-trend-model-option input {
  accent-color: var(--model-dark-accent, #bed0df);
  color-scheme: dark;
}
html[data-theme-preset="dark"] .device-return-trend-model-option:hover,
html[data-theme-preset="dark"] .device-return-trend-model-option:focus-within {
  outline: 2px solid var(--model-dark-accent, #bed0df);
  outline-offset: 1px;
}
html[data-theme-preset="dark"] .simulation-package-diff {
  background: #302b22 !important;
  border-color: #dfb26e !important;
  color: #eed5ae !important;
}
html[data-theme-preset="dark"] .simulation-package-diff > strong {
  color: #ffe5bd !important;
}
html[data-theme-preset="dark"] .simulation-package-diff > span {
  color: #eed5ae !important;
}
html[data-theme-preset="dark"] .simulation-transfer-body .simulation-transfer-route {
  color: #c5d6e7 !important;
}
html[data-theme-preset="dark"] .gantt-title {
  background: #172d46 !important;
  border-color: #345574 !important;
  color: #edf5ff !important;
}
html[data-theme-preset="dark"] .gantt-title strong {
  color: #edf5ff !important;
}
html[data-theme-preset="dark"] .gantt-title span {
  color: #b8ccdf !important;
}
html[data-theme-preset="dark"] .asset-form-section,
html[data-theme-preset="dark"] .asset-classification-section,
html[data-theme-preset="dark"] .asset-supplement-section,
html[data-theme-preset="dark"] .asset-photo-field input::file-selector-button {
  background: #172d46 !important;
  border-color: #345674 !important;
  color: #e8f1fb !important;
}
html[data-theme-preset="dark"] .asset-form-section h4,
html[data-theme-preset="dark"] .asset-default-links-heading,
html[data-theme-preset="dark"] .asset-form-section label { color: #dce9f6 !important; }

html[data-theme-preset="dark"] .dispatch-order-detail,
html[data-theme-preset="dark"] .dispatch-order-summary,
html[data-theme-preset="dark"] .dispatch-booking-card,
html[data-theme-preset="dark"] .assignment-order-card,
html[data-theme-preset="dark"] .assignment-detail-card,
html[data-theme-preset="dark"] .customer-check-panel { background:#142942 !important; border-color:#345674 !important; color:#e8f1fb !important; }
html[data-theme-preset="dark"] .checkout-order,
html[data-theme-preset="dark"] .checkout-long-info,
html[data-theme-preset="dark"] .assigned-asset,
html[data-theme-preset="dark"] .assigned-list,
html[data-theme-preset="dark"] .drop-hint,
html[data-theme-preset="dark"] .transfer-assignment-note { background:#142942 !important; border-color:#345674 !important; color:#e8f1fb !important; }
html[data-theme-preset="dark"] .checkout-long-info span,
html[data-theme-preset="dark"] .checkout-section-title { color:#a9bfd4 !important; }
html[data-theme-preset="dark"] .checkout-long-info p,
html[data-theme-preset="dark"] .assigned-asset strong,
html[data-theme-preset="dark"] .assigned-asset span,
html[data-theme-preset="dark"] .drop-hint { color:#edf5ff !important; }
html[data-theme-preset="dark"] .checkout-long-info > div,
html[data-theme-preset="dark"] .checkout-request-text,
html[data-theme-preset="dark"] .checkout-confirm-bar,
html[data-theme-preset="dark"] .checkout-confirm-bar > * {
  background: #1a3550 !important;
  border-color: #3f6582 !important;
  color: #eaf3fc !important;
}
html[data-theme-preset="dark"] .checkout-long-info > div span,
html[data-theme-preset="dark"] .checkout-long-info > div p,
html[data-theme-preset="dark"] .checkout-request-text { color: #eaf3fc !important; }
html[data-theme-preset="dark"] .checkout-adjustment-panel {
  background: #1a3550 !important;
  border-color: #456a86 !important;
  color: #eaf3fc !important;
}
html[data-theme-preset="dark"] .checkout-adjustment-panel .checkout-section-title,
html[data-theme-preset="dark"] .checkout-adjustment-panel .field-help,
html[data-theme-preset="dark"] .checkout-adjustment-panel small { color: #d5e5f1 !important; }
html[data-theme-preset="dark"] .checkout-adjustment-panel .checkout-mismatch,
html[data-theme-preset="dark"] .checkout-adjustment-panel .checkout-match {
  border: 1px solid #477897 !important;
  background: #214665 !important;
  color: #edf7ff !important;
}
html[data-theme-preset="dark"] .checkout-adjustment-panel .checkout-mismatch {
  background: #4a3824 !important;
  border-color: #a27d42 !important;
  color: #ffedc4 !important;
}
html[data-theme-preset="dark"] .checkout-adjustment-panel .ghost-button { color: #eaf3fc !important; }
html[data-theme-preset="dark"] .gantt-model-filter,
html[data-theme-preset="dark"] .gantt-model-filter-heading,
html[data-theme-preset="dark"] .gantt-model-card-list,
html[data-theme-preset="dark"] .gantt-model-card,
html[data-theme-preset="dark"] .gantt-filter-grid {
  background: #142942 !important;
  border-color: #345674 !important;
  color: #e8f1fb !important;
}
html[data-theme-preset="dark"] .gantt-model-card.category-body,
html[data-theme-preset="dark"] .gantt-model-card.category-lens,
html[data-theme-preset="dark"] .gantt-model-card.category-tripod,
html[data-theme-preset="dark"] .gantt-model-card.category-dji,
html[data-theme-preset="dark"] .gantt-model-card.category-high-value,
html[data-theme-preset="dark"] .gantt-model-card.category-other { background:#1b3854 !important; border-color:#477897 !important; color:#edf5ff !important; }
html[data-theme-preset="dark"] .gantt-model-card.is-selected { background:#1d5b60 !important; border-color:#58bdb2 !important; color:#ecfffb !important; }
html[data-theme-preset="dark"] .gantt-model-card-category,
html[data-theme-preset="dark"] .gantt-model-card > span:last-child,
html[data-theme-preset="dark"] .gantt-model-filter-heading span { color:#b8ccdf !important; }
html[data-theme-preset="dark"] .gantt-header,
html[data-theme-preset="dark"] .gantt-row,
html[data-theme-preset="dark"] .gantt-corner,
html[data-theme-preset="dark"] .gantt-label,
html[data-theme-preset="dark"] .gantt-day,
html[data-theme-preset="dark"] .gantt-lane {
  background:#12243a !important;
  border-color:#345674 !important;
  color:#e8f1fb !important;
}
html[data-theme-preset="dark"] .gantt-day.weekend { background:#182e47 !important; }
html[data-theme-preset="dark"] .gantt-day.today { background:#1d595d !important; }
html[data-theme-preset="dark"] .gantt-day strong,
html[data-theme-preset="dark"] .gantt-day span,
html[data-theme-preset="dark"] .gantt-label strong,
html[data-theme-preset="dark"] .gantt-label span { color:#c4d6e7 !important; }
html[data-theme-preset="dark"] .gantt-bar { background:#214665 !important; border-color:#4b7b99 !important; color:#edf5ff !important; }
html[data-theme-preset="dark"] .gantt-daqq-filter,
html[data-theme-preset="dark"] .gantt-daqq-filter:has(input:checked) { background:#17364f !important; border-color:#477897 !important; color:#eaf3fc !important; }
html[data-theme-preset="dark"] .gantt-daqq-filter strong,
html[data-theme-preset="dark"] .gantt-daqq-filter small { color:#c5d8e8 !important; }

/* Inventory details need explicit surfaces: saved theme variables may be light. */
html[data-theme-preset="dark"] .inventory-category-tone-1,
html[data-theme-preset="dark"] :is(.gantt-model-card, .all-orders-model-group).category-body,
html[data-theme-preset="dark"] .simulation-model-card.category-body {
  --model-dark-bg: #192f2a; --model-dark-selected: #254b3d; --model-dark-accent: #9ad8b0;
}
html[data-theme-preset="dark"] .inventory-category-tone-2,
html[data-theme-preset="dark"] :is(.gantt-model-card, .all-orders-model-group).category-lens,
html[data-theme-preset="dark"] .simulation-model-card.category-lens {
  --model-dark-bg: #182f3d; --model-dark-selected: #224958; --model-dark-accent: #9bd8eb;
}
html[data-theme-preset="dark"] .inventory-category-tone-3,
html[data-theme-preset="dark"] :is(.gantt-model-card, .all-orders-model-group).category-tripod,
html[data-theme-preset="dark"] .simulation-model-card.category-tripod {
  --model-dark-bg: #342b20; --model-dark-selected: #4e3e2b; --model-dark-accent: #e6c28b;
}
html[data-theme-preset="dark"] .inventory-category-tone-4,
html[data-theme-preset="dark"] :is(.gantt-model-card, .all-orders-model-group).category-dji,
html[data-theme-preset="dark"] .simulation-model-card.category-dji {
  --model-dark-bg: #30253e; --model-dark-selected: #483654; --model-dark-accent: #d9b9ed;
}
html[data-theme-preset="dark"] .inventory-category-tone-5,
html[data-theme-preset="dark"] :is(.gantt-model-card, .all-orders-model-group).category-high-value,
html[data-theme-preset="dark"] .simulation-model-card.category-high-value {
  --model-dark-bg: #353017; --model-dark-selected: #4b4324; --model-dark-accent: #ebd780;
}
html[data-theme-preset="dark"] .inventory-category-tone-6 {
  --model-dark-bg: #352633; --model-dark-selected: #4e3747; --model-dark-accent: #e6b6d4;
}
html[data-theme-preset="dark"] .inventory-category-tone-7 {
  --model-dark-bg: #183332; --model-dark-selected: #254b49; --model-dark-accent: #9bdbd2;
}
html[data-theme-preset="dark"] .inventory-category-tone-8 {
  --model-dark-bg: #2c3026; --model-dark-selected: #414937; --model-dark-accent: #cedbad;
}
html[data-theme-preset="dark"] .model-summary-card[class*="inventory-category-tone-"],
html[data-theme-preset="dark"] .inventory-category-filter[class*="inventory-category-tone-"],
html[data-theme-preset="dark"] .simulation-model-card[class*="category-"] {
  background: var(--model-dark-bg, #252d36) !important;
  border-color: color-mix(in srgb, var(--model-dark-accent, #bed0df) 45%, #111e31) !important;
  color: #edf5ff !important;
}
html[data-theme-preset="dark"] .model-summary-card:hover,
html[data-theme-preset="dark"] .model-summary-card:focus-visible,
html[data-theme-preset="dark"] .inventory-category-filter:hover,
html[data-theme-preset="dark"] .inventory-category-filter:focus-visible,
html[data-theme-preset="dark"] .inventory-category-filter.active,
html[data-theme-preset="dark"] .simulation-model-card:hover,
html[data-theme-preset="dark"] .simulation-model-card:focus-visible,
html[data-theme-preset="dark"] .simulation-model-card.is-selected {
  background: var(--model-dark-selected, #354350) !important;
  border-color: var(--model-dark-accent, #bed0df) !important;
}
html[data-theme-preset="dark"] .simulation-model-card.is-selected {
  box-shadow: inset 4px 0 0 var(--model-dark-accent, #bed0df);
}
html[data-theme-preset="dark"] .model-summary-card > span:first-child,
html[data-theme-preset="dark"] .model-summary-card::after {
  color: var(--model-dark-accent, #bed0df) !important;
}
html[data-theme-preset="dark"] .model-summary-card > p,
html[data-theme-preset="dark"] .simulation-model-card small {
  color: #c1cddd !important;
}
html[data-theme-preset="dark"] .all-order-date,
html[data-theme-preset="dark"] .simulation-slot,
html[data-theme-preset="dark"] .simulation-save-state {
  background: #244052 !important;
  border: 1px solid #4d7487 !important;
  color: #e3f5fa !important;
}
html[data-theme-preset="dark"] .simulation-lane-title strong,
html[data-theme-preset="dark"] .simulation-hero-copy h3,
html[data-theme-preset="dark"] .inventory-combination-panel > summary strong {
  color: #edf5ff !important;
}
html[data-theme-preset="dark"] .simulation-lane-title span,
html[data-theme-preset="dark"] .simulation-hero-copy > div > span,
html[data-theme-preset="dark"] .inventory-combination-panel > summary small {
  color: #b8ccdf !important;
}
html[data-theme-preset="dark"] .model-summary-card .inventory-shortage {
  color: #ff9ba8 !important;
}
html[data-theme-preset="dark"] .inventory-model-dialog,
html[data-theme-preset="dark"] .inventory-model-dialog-shell {
  background: #111e31 !important;
  color: #eaf3fc !important;
}
html[data-theme-preset="dark"] .inventory-model-dialog-heading {
  background: transparent !important;
}
html[data-theme-preset="dark"] .inventory-model-dialog-heading h3,
html[data-theme-preset="dark"] .inventory-model-order-card h4,
html[data-theme-preset="dark"] .inventory-model-dialog .empty-state strong {
  color: #eaf3fc !important;
}
html[data-theme-preset="dark"] .inventory-model-dialog-heading p,
html[data-theme-preset="dark"] .inventory-model-order-card p,
html[data-theme-preset="dark"] .inventory-model-order-line,
html[data-theme-preset="dark"] .inventory-model-dialog .empty-state p {
  color: #b8ccdf !important;
}
html[data-theme-preset="dark"] .inventory-model-order-card,
html[data-theme-preset="dark"] .inventory-model-dialog .empty-state {
  background: #182e47 !important;
  border-color: #345574 !important;
}
html[data-theme-preset="dark"] .inventory-model-order-line .inventory-model-order-qty {
  color: #91ded2 !important;
}
html[data-theme-preset="dark"] .stock-line-model-column-heading {
  background: #1b3048 !important;
  border-color: #345574 !important;
}
html[data-theme-preset="dark"] .stock-line-model-selector > summary strong {
  color: #eaf3fc !important;
}
html[data-theme-preset="dark"] .stock-line-model-selector > summary small {
  color: #b8ccdf !important;
}
html[data-theme-preset="dark"] #stockLineSelectionStatus {
  color: #91ded2 !important;
}
html[data-theme-preset="dark"] .stock-line-model-option b {
  background: #21445a !important;
  color: #d5f8f2 !important;
}
html[data-theme-preset="dark"] .stock-line-segmented {
  background: #0d1b2d !important;
  border: 1px solid #345574;
}
html[data-theme-preset="dark"] .all-orders-sticky-controls,
html[data-theme-preset="dark"] .all-orders-floating-filter-shell,
html[data-theme-preset="dark"] .all-orders-floating-primary,
html[data-theme-preset="dark"] .all-orders-floating-secondary { background:#142942 !important; border-color:#345674 !important; color:#e8f1fb !important; }
html[data-theme-preset="dark"] .all-orders-floating-search,
html[data-theme-preset="dark"] .all-orders-floating-search input,
html[data-theme-preset="dark"] .all-orders-floating-secondary input,
html[data-theme-preset="dark"] .all-orders-floating-secondary select,
html[data-theme-preset="dark"] .all-orders-floating-model-filter,
html[data-theme-preset="dark"] .all-orders-floating-more-toggle { background:#0d1b2d !important; border-color:#3a5c7c !important; color:#edf5ff !important; }
html[data-theme-preset="dark"] .all-orders-sticky-controls label,
html[data-theme-preset="dark"] .all-orders-floating-search > span { color:#a9bfd4 !important; }

html[data-theme-preset="dark"] .task-waiver-claim-warning {
  background: #542d35 !important;
  border-color: #c07179 !important;
  color: #fff1ee !important;
}
html[data-theme-preset="dark"] .task-waiver-claim-warning strong,
html[data-theme-preset="dark"] .task-waiver-claim-warning span { color: #fff1ee !important; }
html[data-theme-preset="dark"] .todo-priority-control,
html[data-theme-preset="dark"] .todo-priority-control.priority-urgent,
html[data-theme-preset="dark"] .todo-priority-control.priority-normal,
html[data-theme-preset="dark"] .todo-priority-control.priority-low {
  border-color: #45627d !important;
  color: #eaf3fc !important;
}
html[data-theme-preset="dark"] .todo-priority-control.priority-urgent { background: #543039 !important; }
html[data-theme-preset="dark"] .todo-priority-control.priority-normal { background: #173d3b !important; }
html[data-theme-preset="dark"] .todo-priority-control.priority-low { background: #26364a !important; }

/* Shared dark pill language: restrained fill, clear outline, readable foreground. */
html[data-theme-preset="dark"] .order-progress-badge,
html[data-theme-preset="dark"] .booking-status-pill,
html[data-theme-preset="dark"] .order-stage-badge,
html[data-theme-preset="dark"] .task-progress-counts span,
html[data-theme-preset="dark"] .inventory-category-filter span,
html[data-theme-preset="dark"] .simulation-selected-chip,
html[data-theme-preset="dark"] .simulation-order-badges span,
html[data-theme-preset="dark"] .simulation-adjusted-badge,
html[data-theme-preset="dark"] .simulation-package-warning,
html[data-theme-preset="dark"] .task-transfer-badge,
html[data-theme-preset="dark"] .task-agent-review-badge {
  background: #243b53 !important;
  border: 1px solid #52728c !important;
  border-radius: 999px !important;
  color: #e7f1fb !important;
  box-shadow: none !important;
}
html[data-theme-preset="dark"] .order-progress-badge.order-stage-canceled,
html[data-theme-preset="dark"] .task-card.is-overdue .task-overdue-badge,
html[data-theme-preset="dark"] .task-card.is-claim .task-claim-badge { background:#4b3038 !important; border-color:#a86976 !important; color:#ffe8e6 !important; }
html[data-theme-preset="dark"] .order-progress-badge.order-stage-completed,
html[data-theme-preset="dark"] .task-waiver-badge { background:#1d4140 !important; border-color:#4f948d !important; color:#d3f4ed !important; }
html[data-theme-preset="dark"] .order-progress-badge.order-stage-pending_review,
html[data-theme-preset="dark"] .order-progress-badge.order-stage-pending_ship { background:#493a25 !important; border-color:#9d7d47 !important; color:#ffebbd !important; }
html[data-theme-preset="dark"] .simulation-lane-heading > span,
html[data-theme-preset="dark"] .simulation-order-key,
html[data-theme-preset="dark"] .simulation-order-key-list > span,
html[data-theme-preset="dark"] .simulation-transition-marker,
html[data-theme-preset="dark"] .simulation-transfer-dot {
  background: #29445d !important;
  border-color: #61819a !important;
  color: #eaf3fc !important;
}
html[data-theme-preset="dark"] .simulation-order-key > span:first-child,
html[data-theme-preset="dark"] .simulation-order-key-list > span > span:first-child {
  background: #d9e6ef !important;
  color: #1a3045 !important;
}
html[data-theme-preset="dark"] .all-orders-jump-actions {
  background: #152b43 !important;
  border: 1px solid #365977 !important;
  border-radius: 14px !important;
  padding: 6px !important;
}
html[data-theme-preset="dark"] .all-orders-jump-actions button {
  background: #223e58 !important;
  border-color: #52738f !important;
  color: #eaf3fc !important;
}
html[data-theme-preset="dark"] .all-orders-jump-actions button:last-child {
  background: #1d6668 !important;
  border-color: #55b9b0 !important;
  color: #e6fffb !important;
}
html[data-theme-preset="dark"] #simulationBoardMeta,
html[data-theme-preset="dark"] .simulation-board-panel > header span,
html[data-theme-preset="dark"] .simulation-detail-label,
html[data-theme-preset="dark"] .simulation-order-key-list > .simulation-detail-label {
  color: #c5d8e8 !important;
}
html[data-theme-preset="dark"] .simulation-data-check,
html[data-theme-preset="dark"] .simulation-data-check strong,
html[data-theme-preset="dark"] .simulation-data-check span,
html[data-theme-preset="dark"] .simulation-change-summary {
  background: #1b3854 !important;
  border-color: #477897 !important;
  color: #eaf3fc !important;
}
html[data-theme-preset="dark"] .simulation-order-key-list > span:not(.simulation-detail-label) {
  background: #23445f !important;
  border-color: #527994 !important;
  color: #eaf3fc !important;
}
html[data-theme-preset="dark"] .simulation-order-key b,
html[data-theme-preset="dark"] .simulation-section-heading > span,
html[data-theme-preset="dark"] .simulation-transition-marker {
  background: #2d4f6b !important;
  border: 1px solid #6b8da5 !important;
  color: #f0f7fd !important;
}
html[data-theme-preset="dark"] .simulation-change-notice,
html[data-theme-preset="dark"] .simulation-change-details,
html[data-theme-preset="dark"] .simulation-change-item,
html[data-theme-preset="dark"] .simulation-change-field {
  background: #1b3048 !important;
  border-color: #3d607d !important;
  color: #eaf3fc !important;
}
html[data-theme-preset="dark"] .simulation-check-item,
html[data-theme-preset="dark"] .simulation-version-item {
  background: #1b3854 !important;
  border: 1px solid #477897 !important;
  border-radius: 10px !important;
  color: #eaf3fc !important;
}
html[data-theme-preset="dark"] .simulation-check-item strong,
html[data-theme-preset="dark"] .simulation-check-item span,
html[data-theme-preset="dark"] .simulation-version-item strong,
html[data-theme-preset="dark"] .simulation-version-item span { color: #eaf3fc !important; }
html[data-theme-preset="dark"] .simulation-check-item.is-adjusted { background: #4a3824 !important; border-color: #a27d42 !important; }
html[data-theme-preset="dark"] .simulation-change-notice strong,
html[data-theme-preset="dark"] .simulation-change-notice > span,
html[data-theme-preset="dark"] .simulation-change-item strong,
html[data-theme-preset="dark"] .simulation-change-field > span:first-child,
html[data-theme-preset="dark"] .simulation-change-field del { color: #d2e3f1 !important; }
html[data-theme-preset="dark"] .simulation-lane-details {
  background: #12243a !important;
  border-color: #345674 !important;
}

/* Inventory Timeline (折线库存) complete dark surface map. */
html[data-theme-preset="dark"] .stock-line-page,
html[data-theme-preset="dark"] .stock-line-hero,
html[data-theme-preset="dark"] .stock-line-controls-panel,
html[data-theme-preset="dark"] .stock-line-control-card,
html[data-theme-preset="dark"] .stock-line-switch-card,
html[data-theme-preset="dark"] .stock-line-model-selector,
html[data-theme-preset="dark"] .stock-line-selector-body,
html[data-theme-preset="dark"] .stock-line-model-column,
html[data-theme-preset="dark"] .stock-line-chart-panel,
html[data-theme-preset="dark"] .stock-line-kpis article {
  background: #12243a !important;
  border-color: #345674 !important;
  color: #e8f1fb !important;
}
html[data-theme-preset="dark"] .stock-line-hero-copy h3,
html[data-theme-preset="dark"] .stock-line-chart-heading h3,
html[data-theme-preset="dark"] .stock-line-model-column-heading strong,
html[data-theme-preset="dark"] .stock-line-kpis strong { color: #edf5ff !important; }
html[data-theme-preset="dark"] .stock-line-hero-copy p,
html[data-theme-preset="dark"] .stock-line-chart-heading p,
html[data-theme-preset="dark"] .stock-line-control-card > small,
html[data-theme-preset="dark"] .stock-line-switch-card small,
html[data-theme-preset="dark"] .stock-line-model-column-heading span,
html[data-theme-preset="dark"] .stock-line-kpis span,
html[data-theme-preset="dark"] .stock-line-kpis small { color: #a9bfd4 !important; }
html[data-theme-preset="dark"] .stock-line-date-range-field,
html[data-theme-preset="dark"] .stock-line-selector-toolbar input,
html[data-theme-preset="dark"] .stock-line-model-option {
  background: #0d1b2d !important; border-color: #3a5c7c !important; color: #edf5ff !important;
}
html[data-theme-preset="dark"] .stock-line-model-option.selected,
html[data-theme-preset="dark"] .stock-line-segmented button.active,
html[data-theme-preset="dark"] .stock-line-preset-buttons button.active { background: #1b5960 !important; color: #e3fffb !important; border-color: #58bdb2 !important; }
html[data-theme-preset="dark"] .stock-line-chart-scroll,
html[data-theme-preset="dark"] .stock-line-chart,
html[data-theme-preset="dark"] .stock-line-svg { background: #0e1d2f !important; }
html[data-theme-preset="dark"] .stock-line-x-tick text,
html[data-theme-preset="dark"] .stock-line-y-tick text,
html[data-theme-preset="dark"] .stock-line-band-label,
html[data-theme-preset="dark"] .stock-line-y-title { fill: #b9cce0 !important; color: #b9cce0 !important; }
html[data-theme-preset="dark"] .stock-line-tooltip { background: #1a3048 !important; border-color: #4a7091 !important; color: #edf5ff !important; }
/* Keep model categories visible across all three filter surfaces. */
html[data-theme-preset="dark"] .stock-line-model-column[class*="inventory-category-tone-"],
html[data-theme-preset="dark"] .all-orders-model-group[class*="category-"],
html[data-theme-preset="dark"] .gantt-model-card[class*="category-"] {
  background: var(--model-dark-bg, #252d36) !important;
  border-color: color-mix(in srgb, var(--model-dark-accent, #bed0df) 45%, #111e31) !important;
}
html[data-theme-preset="dark"] .stock-line-model-column .stock-line-model-column-heading,
html[data-theme-preset="dark"] .all-orders-model-group > header {
  background: var(--model-dark-bg, #252d36) !important;
  border-color: color-mix(in srgb, var(--model-dark-accent, #bed0df) 45%, #111e31) !important;
}
html[data-theme-preset="dark"] .stock-line-model-column .stock-line-model-column-heading strong,
html[data-theme-preset="dark"] .all-orders-model-group > header strong,
html[data-theme-preset="dark"] .gantt-model-card .gantt-model-card-category {
  color: var(--model-dark-accent, #bed0df) !important;
}
html[data-theme-preset="dark"] .stock-line-model-column .stock-line-model-option,
html[data-theme-preset="dark"] .all-orders-model-group .all-orders-model-option {
  background: color-mix(in srgb, var(--model-dark-bg, #252d36) 65%, #0d192b) !important;
  border-color: color-mix(in srgb, var(--model-dark-accent, #bed0df) 40%, #111e31) !important;
}
html[data-theme-preset="dark"] .stock-line-model-column .stock-line-model-option:is(.selected, :hover, :focus-visible),
html[data-theme-preset="dark"] .all-orders-model-group .all-orders-model-option:is(.is-selected, :hover, :focus-visible),
html[data-theme-preset="dark"] .gantt-model-card:is(.is-selected, :hover, :focus-visible) {
  background: var(--model-dark-selected, #354350) !important;
  border-color: var(--model-dark-accent, #bed0df) !important;
}
html[data-theme-preset="dark"] .stock-line-model-column .stock-line-model-option.selected,
html[data-theme-preset="dark"] .all-orders-model-group .all-orders-model-option.is-selected,
html[data-theme-preset="dark"] .gantt-model-card.is-selected {
  box-shadow: inset 3px 0 0 var(--model-dark-accent, #bed0df);
}
html[data-theme-preset="dark"] .stock-line-model-column .stock-line-model-option b {
  background: var(--model-dark-selected, #354350) !important;
  color: var(--model-dark-accent, #bed0df) !important;
}
html[data-theme-preset="dark"] .all-orders-model-dialog-shell,
html[data-theme-preset="dark"] .all-orders-model-dialog-controls,
html[data-theme-preset="dark"] .all-orders-model-groups {
  background: #111e31 !important;
  border-color: #345574 !important;
  color: #edf5ff !important;
}
html[data-theme-preset="dark"] .all-orders-model-dialog-heading,
html[data-theme-preset="dark"] .all-orders-model-dialog-actions {
  background: #172d46 !important;
  border-color: #345574 !important;
}
html[data-theme-preset="dark"] .all-orders-model-dialog h3,
html[data-theme-preset="dark"] .all-orders-model-option strong,
html[data-theme-preset="dark"] .all-orders-model-empty strong {
  color: #edf5ff !important;
}
html[data-theme-preset="dark"] .all-orders-model-dialog-heading p,
html[data-theme-preset="dark"] .all-orders-model-dialog-heading span,
html[data-theme-preset="dark"] .all-orders-model-dialog-controls label,
html[data-theme-preset="dark"] .all-orders-model-group > header span,
html[data-theme-preset="dark"] .all-orders-model-option span,
html[data-theme-preset="dark"] .all-orders-model-empty span,
html[data-theme-preset="dark"] .stock-line-model-option small {
  color: #c1cddd !important;
}
html[data-theme-preset="dark"] .stock-line-tooltip > strong,
html[data-theme-preset="dark"] .stock-line-tooltip b { color: #edf5ff !important; }
html[data-theme-preset="dark"] .stock-line-tooltip em { color: #c5d6e7 !important; }
html[data-theme-preset="dark"] .simulation-transition-rail {
  background: #162b43 !important;
  border-top-color: #385a76 !important;
}
html[data-theme-preset="dark"] .simulation-gantt-grid i,
html[data-theme-preset="dark"] .simulation-gantt-grid i:nth-child(7n),
html[data-theme-preset="dark"] .simulation-gantt-grid i:nth-child(7n + 1) {
  background: rgba(53, 82, 108, .28) !important;
  border-color: rgba(117, 153, 177, .28) !important;
}
html[data-theme-preset="dark"] .simulation-gantt-order {
  background: #214665 !important;
  border-color: #477897 !important;
  color: #edf5ff !important;
}
html[data-theme-preset="dark"] .simulation-gantt-order span,
html[data-theme-preset="dark"] .simulation-gantt-order small { color: #c5d8e8 !important; }
html[data-theme-preset="dark"] .simulation-gantt-order.is-adjusted { background: #3b304f !important; border-color: #9275c3 !important; }
html[data-theme-preset="dark"] .simulation-pool-empty,
html[data-theme-preset="dark"] .simulation-pool-empty strong,
html[data-theme-preset="dark"] .simulation-pool-empty span,
html[data-theme-preset="dark"] .simulation-board-panel > header button {
  background: #1b3854 !important;
  border-color: #477897 !important;
  color: #eaf3fc !important;
}
