:root {
  color-scheme: light;
  --bg: #f7f4f7;
  --bg-2: #eff7fc;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --surface-soft: rgba(255, 255, 255, 0.68);
  --line: rgba(43, 58, 84, 0.08);
  --line-strong: rgba(43, 58, 84, 0.14);
  --text: #172033;
  --muted: #68758a;
  --subtle: #9aa5b6;
  --pink: #f27a9a;
  --pink-strong: #d9537a;
  --pink-soft: #fff2f6;
  --blue: #6fa9d8;
  --blue-strong: #397daa;
  --blue-soft: #eef8ff;
  --green: #34b983;
  --green-soft: #e9f8f1;
  --amber: #d4817a;
  --amber-soft: #fff1ed;
  --red: #c95b5b;
  --red-soft: #fff0f0;
  --section-pink: #fff7fb;
  --section-blue: #f3faff;
  --section-green: #f4fff9;
  --section-amber: #fff9f0;
  --section-neutral: #fbfcff;
  --accent-pink: rgba(242, 122, 154, 0.52);
  --accent-blue: rgba(111, 169, 216, 0.52);
  --accent-green: rgba(52, 185, 131, 0.46);
  --accent-amber: rgba(212, 129, 122, 0.46);
  --gradient-primary: linear-gradient(135deg, #e8879b 0%, #6da8ce 100%);
  --gradient-accent: linear-gradient(135deg, #f27a9a 0%, #6fa9d8 100%);
  --gradient-soft: linear-gradient(135deg, rgba(255, 242, 246, 0.96) 0%, rgba(238, 248, 255, 0.96) 100%);
  --gradient-page: linear-gradient(180deg, #fbfcff 0%, #f6f2f7 42%, #eef8ff 100%);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.86) inset, 0 10px 24px rgba(45, 62, 90, 0.055);
  --shadow-float: 0 24px 70px rgba(46, 62, 86, 0.12);
  --radius-panel: 8px;
  --radius-card: 7px;
}

/* Order detail cockpit: final one-screen customer-service workflow layout. */
.order-detail-dialog {
  width: min(1240px, calc(100vw - 28px));
  height: min(720px, calc(100vh - 28px));
  max-height: none;
}

.order-detail-dialog-frame {
  height: 100%;
  max-height: none;
}

.order-detail-dialog-body {
  overflow: hidden;
  padding: 9px;
}

.order-detail-dialog .detail-content {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr) minmax(280px, 0.82fr);
  grid-template-rows: 54px 118px 118px minmax(82px, 1fr) 38px;
  grid-template-areas:
    "status status actions"
    "confirm payment actions"
    "customer staging overview"
    "execution staging history"
    "copy timeline save";
  gap: 7px;
}

.order-detail-dialog .detail-head {
  display: none;
}

.order-detail-dialog .detail-status-strip { grid-area: status; }
.order-detail-dialog .order-confirm-section { grid-area: confirm; }
.order-detail-dialog .payment-section { grid-area: payment; }
.order-detail-dialog .staging-section { grid-area: staging; }
.order-detail-dialog .customer-note-section { grid-area: customer; }
.order-detail-dialog .execution-note-section { grid-area: execution; }
.order-detail-dialog .order-detail-overview-section { grid-area: overview; }
.order-detail-dialog .customer-history-section { grid-area: history; }
.order-detail-dialog .copy-section { grid-area: copy; }
.order-detail-dialog .timeline-section { grid-area: timeline; }
.order-detail-dialog .action-grid { grid-area: actions; }
.order-detail-dialog #saveOrderEdits,
.order-detail-dialog #detailReadonlyNotice { grid-area: save; }

.order-detail-dialog .detail-section,
.order-detail-dialog .action-grid {
  gap: 5px;
  padding: 7px 8px 7px 10px;
  border-radius: 7px;
  box-shadow: none;
}

.order-detail-dialog .detail-section-head {
  min-height: 20px;
  padding-bottom: 4px;
  gap: 8px;
}

.order-detail-dialog .detail-section h3 {
  font-size: 12px;
  line-height: 1.15;
}

.order-detail-dialog .detail-section-head > span {
  font-size: 10px;
  line-height: 1.2;
}

.order-detail-dialog .detail-status-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.order-detail-dialog .detail-status-step {
  gap: 1px;
  padding: 7px 8px 5px;
  border-radius: 7px;
}

.order-detail-dialog .detail-status-step strong,
.order-detail-dialog .detail-status-step em {
  white-space: normal;
}

.order-detail-dialog .detail-status-step strong {
  font-size: 11px;
}

.order-detail-dialog .detail-status-step em {
  font-size: 10px;
}

.order-detail-dialog .detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.order-detail-dialog .detail-grid > div,
.order-detail-dialog .order-detail-fact,
.order-detail-dialog .customer-history-grid div,
.order-detail-dialog .customer-history-item {
  padding: 5px 6px;
  border-radius: 6px;
}

.order-detail-dialog .detail-grid span,
.order-detail-dialog .order-detail-fact span,
.order-detail-dialog label span,
.order-detail-dialog .customer-history-grid span,
.order-detail-dialog .customer-history-item span {
  font-size: 10px;
  line-height: 1.2;
}

.order-detail-dialog .detail-grid strong,
.order-detail-dialog .order-detail-fact strong,
.order-detail-dialog .customer-history-grid strong,
.order-detail-dialog .customer-history-item strong {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.22;
}

.order-detail-dialog input,
.order-detail-dialog select {
  height: 28px;
  padding: 0 7px;
  border-radius: 7px;
  font-size: 12px;
}

.order-detail-dialog textarea {
  min-height: 0;
  padding: 6px 7px;
  resize: none;
  border-radius: 7px;
  font-size: 11.5px;
  line-height: 1.3;
}

.order-detail-dialog .payment-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.order-detail-dialog .payment-section p {
  margin: 0;
  font-size: 10px;
  line-height: 1.25;
}

.order-detail-dialog .staging-order-tools {
  grid-template-columns: minmax(0, 1fr) minmax(88px, 0.6fr);
  gap: 5px;
  padding: 6px;
  border-radius: 6px;
}

.order-detail-dialog .staging-scene-summary {
  min-height: 24px;
  padding: 5px 6px;
  font-size: 10px;
  line-height: 1.25;
}

.order-detail-dialog .staging-reference-preview {
  gap: 4px;
  padding: 5px;
  border-radius: 6px;
}

.order-detail-dialog .staging-reference-preview-head strong,
.order-detail-dialog .staging-reference-preview-head span {
  font-size: 10px;
}

.order-detail-dialog .staging-reference-preview-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.order-detail-dialog .staging-reference-preview-strip img,
.order-detail-dialog .staging-reference-empty {
  min-height: 26px;
  border-radius: 5px;
}

.order-detail-dialog .staging-reference-empty {
  padding: 4px 6px;
  font-size: 10px;
  line-height: 1.2;
}

.order-detail-dialog .staging-section textarea {
  min-height: 48px;
}

.order-detail-dialog .customer-note-section textarea,
.order-detail-dialog .execution-note-section textarea {
  min-height: 48px;
}

.order-detail-dialog .staging-library-picker {
  padding: 4px 6px;
  border-radius: 6px;
}

.order-detail-dialog .staging-library-picker summary {
  font-size: 10px;
}

.order-detail-dialog .staging-library-picker select[multiple],
.order-detail-dialog .staging-order-actions {
  display: none;
}

.order-detail-dialog .action-grid {
  align-content: start;
  grid-template-columns: 1fr;
}

.order-detail-dialog .action-grid button,
.order-detail-dialog .copy-tools button,
.order-detail-dialog #saveOrderEdits {
  min-height: 29px;
  padding: 4px 8px;
  font-size: 11px;
}

.order-detail-dialog .order-detail-fact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.order-detail-dialog .order-detail-secondary {
  padding-top: 4px;
}

.order-detail-dialog .order-detail-secondary summary {
  font-size: 10px;
}

.order-detail-dialog .customer-history-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.order-detail-dialog .customer-history-list,
.order-detail-dialog .timeline {
  gap: 4px;
}

.order-detail-dialog .customer-history-item:nth-child(n+2) {
  display: none;
}

.order-detail-dialog .copy-tools {
  grid-template-columns: 1fr minmax(90px, 0.75fr) 1fr;
  gap: 5px;
}

.order-detail-dialog .timeline li {
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 10px;
  line-height: 1.25;
}

.order-detail-dialog .timeline strong {
  font-size: 10.5px;
}

.order-detail-dialog #saveOrderEdits {
  align-self: stretch;
  width: 100%;
}

/* Responsive workspace fit: compress navigation and keep tables inside the viewport. */
@media (max-width: 1280px) {
  body {
    min-width: 0;
    padding: 8px;
  }

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

  .sidebar {
    gap: 8px;
    padding: 9px;
  }

  .brand {
    gap: 8px;
    padding: 7px;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
  }

  .brand-name {
    font-size: 12px;
  }

  .brand-subtitle,
  .nav-item small,
  .sidebar-note span:not(.note-label) {
    display: none;
  }

  .nav-list,
  .nav-sublist,
  .nav-group {
    gap: 5px;
  }

  .nav-group summary {
    min-height: 24px;
    padding: 0 6px;
    font-size: 10.5px;
  }

  .nav-item {
    min-height: 32px;
    padding: 0 7px;
    font-size: 12px;
  }

  .nav-subitem {
    min-height: 30px;
    margin-left: 0;
    padding-left: 7px;
    border-left-width: 1px;
  }

  .sidebar-note {
    padding: 8px;
  }

  .topbar,
  .top-actions,
  .filter-bar {
    gap: 8px;
  }

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

  .table-wrap,
  .workbench-table-wrap,
  .schedule-table-wrap,
  .staging-gallery-table-wrap {
    overflow-x: hidden;
  }

  table,
  .orders-panel table,
  .schedule-table,
  .staging-gallery-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  th,
  td,
  .orders-panel th,
  .orders-panel td {
    width: auto;
    max-width: none;
    padding: 5px 4px;
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
    font-size: 10px;
    line-height: 1.25;
  }

  .orders-panel .cell-main,
  .orders-panel .cell-sub,
  .orders-panel .tag-list span,
  .table-sort-button span {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .orders-panel .select-column {
    width: 28px !important;
  }

  .status-chip,
  .customer-type-chip,
  .schedule-state-chip,
  .data-status-chip {
    min-height: 20px;
    padding: 2px 5px;
    white-space: normal;
  }
}

@media (max-width: 1040px) {
  body {
    padding: 6px;
  }

  .app-shell {
    grid-template-columns: 104px minmax(0, 1fr);
    min-height: calc(100vh - 12px);
    border-radius: 10px;
  }

  .sidebar {
    padding: 6px;
  }

  .brand {
    justify-content: center;
    padding: 6px 4px;
  }

  .brand > div:not(.brand-mark),
  .nav-group summary::after,
  .sidebar-note {
    display: none;
  }

  .nav-group summary {
    justify-content: center;
    padding: 0;
    font-size: 10px;
  }

  .nav-item {
    justify-items: center;
    min-height: 30px;
    padding: 0 4px;
    text-align: center;
    font-size: 11px;
    line-height: 1.15;
  }

  .nav-subitem {
    padding-left: 4px;
    border-left: 0;
  }

  .main {
    min-width: 0;
  }

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

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

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

  .orders-panel th,
  .orders-panel td,
  th,
  td {
    padding: 4px 3px;
    font-size: 9.5px;
  }

  .order-detail-dialog {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
  }

  .order-detail-dialog .detail-content {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr) minmax(220px, 0.74fr);
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #eef1f6;
}

body {
  margin: 0;
  min-width: 1360px;
  min-height: 100vh;
  padding: 8px;
  background: var(--gradient-page);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

[id*="itab" i],
[class*="itab" i],
[aria-label*="iTab" i],
[title*="iTab" i],
[aria-label*="快速悬浮框"],
[title*="快速悬浮框"] {
  display: none !important;
}

body > :not(.app-shell):not(.sanmiao-login-overlay):not(dialog):not(script):not(style):not(link):not(.column-drag-ghost):not(.inline-editor-drawer) {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  width: 100%;
  min-height: calc(100vh - 16px);
  max-width: none;
  margin: 0 auto;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(28px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-right: 1px solid rgba(17, 24, 39, 0.06);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 246, 250, 0.68) 52%, rgba(240, 249, 255, 0.72));
  backdrop-filter: blur(26px);
  color: var(--text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-card);
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--gradient-accent);
  color: #ffffff;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(232, 135, 155, 0.24);
}

.brand-name {
  font-size: 14px;
  font-weight: 800;
}

.brand-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

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

.nav-group {
  display: grid;
  gap: 7px;
}

.nav-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  padding: 0 10px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 850;
  list-style: none;
  cursor: pointer;
}

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

.nav-group summary::after {
  color: var(--subtle);
  content: "⌄";
  font-size: 12px;
}

.nav-group:not([open]) summary::after {
  content: "›";
}

.nav-sublist {
  display: grid;
  gap: 7px;
}

.nav-item {
  display: grid;
  align-content: center;
  gap: 2px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

.nav-item small {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
}

.nav-item.active,
.nav-item:hover {
  border-color: rgba(242, 122, 154, 0.18);
  background: linear-gradient(90deg, rgba(255, 242, 246, 0.96), rgba(238, 248, 255, 0.94));
  color: var(--text);
  box-shadow: 0 10px 22px rgba(45, 62, 90, 0.07);
}

.nav-item.active small,
.nav-item:hover small {
  color: var(--muted);
}

.nav-subitem {
  min-height: 36px;
  margin-left: 8px;
  padding-left: 12px;
  border-left: 2px solid rgba(232, 135, 155, 0.18);
  border-radius: 11px;
  font-size: 13px;
}

.nav-subitem small {
  font-size: 10px;
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  box-shadow: var(--shadow-card);
}

.note-label {
  display: block;
  margin-bottom: 4px;
  color: var(--pink);
  font-weight: 800;
}

.main {
  min-width: 0;
  min-height: calc(100vh + 240px);
  padding: 12px;
  overflow: visible;
}

.topbar {
  position: relative;
  top: auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: var(--radius-panel);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(24px);
}

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

h1 {
  font-size: 21px;
  font-weight: 850;
  line-height: 1.2;
}

.topbar p,
.panel-head p,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.topbar p {
  margin-top: 4px;
}

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

.source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-notice-root {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 80;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.admin-notice {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-left: 4px solid var(--accent-pink);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
  padding: 11px 12px;
  transform: translateY(0);
  transition: opacity 160ms ease, transform 160ms ease;
}

.admin-notice-warning {
  border-left-color: #d97706;
}

.admin-notice-error {
  border-left-color: #dc2626;
}

.admin-notice-success {
  border-left-color: #059669;
}

.admin-notice-leaving {
  opacity: 0;
  transform: translateY(-6px);
}

.primary-button,
.ghost-button,
.danger-button {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 800;
}

.primary-button {
  background: var(--gradient-accent);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(232, 135, 155, 0.2);
}

.primary-button:hover {
  filter: saturate(1.08);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(17, 24, 39, 0.08);
  color: #53607a;
}

.ghost-button.is-active {
  border-color: rgba(232, 135, 155, 0.38);
  background: var(--pink-soft);
  color: var(--pink-strong);
}

.danger-button {
  background: var(--red-soft);
  border-color: #ffd6d6;
  color: var(--red);
}

.primary-button[aria-busy="true"],
.ghost-button[aria-busy="true"],
.danger-button[aria-busy="true"] {
  cursor: progress;
  opacity: 0.72;
  animation: admin-action-busy 1.1s ease-in-out infinite;
}

@keyframes admin-action-busy {
  50% { box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.08); }
}

.compact {
  min-height: 34px;
  padding: 0 12px;
}

.full-width {
  width: 100%;
}

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

.metric-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 4px;
  min-height: 64px;
  padding: 9px 10px;
  border: 1px solid rgba(43, 58, 84, 0.1);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), var(--section-neutral));
  box-shadow: var(--shadow-card);
}

.metric-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent-blue);
  content: "";
}

.metric-card:nth-child(1),
.metric-card:nth-child(2),
.metric-card:nth-child(3) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), var(--section-pink));
}

.metric-card:nth-child(1)::before,
.metric-card:nth-child(2)::before,
.metric-card:nth-child(3)::before {
  background: var(--accent-pink);
}

.metric-card:nth-child(4),
.metric-card:nth-child(5),
.metric-card:nth-child(6) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), var(--section-blue));
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric-card strong {
  display: block;
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

.metric-card:nth-child(1) strong,
.metric-card:nth-child(2) strong,
.metric-card:nth-child(3) strong {
  color: var(--pink);
}

.metric-card:nth-child(4) strong,
.metric-card:nth-child(5) strong,
.metric-card:nth-child(6) strong {
  color: var(--blue);
}

.today-flow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.today-flow-card {
  overflow: hidden;
  min-width: 0;
  border: 1px solid rgba(111, 169, 216, 0.2);
  border-left: 5px solid var(--accent-blue);
  border-radius: var(--radius-panel);
  background: linear-gradient(180deg, #ffffff 0%, var(--section-blue) 100%);
  box-shadow: none;
  backdrop-filter: none;
}

.tomorrow-plan-panel {
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid rgba(212, 129, 122, 0.24);
  border-left: 5px solid var(--accent-amber);
  border-radius: var(--radius-panel);
  background: linear-gradient(180deg, #ffffff 0%, var(--section-amber) 100%);
  box-shadow: none;
  backdrop-filter: none;
}

.orders-panel::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  content: "";
}

.today-flow-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
}

.today-flow-head-with-actions {
  align-items: center;
}

.today-flow-title-block {
  min-width: 0;
}

.today-flow-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.today-flow-head h2 {
  margin-bottom: 5px;
  font-size: 18px;
  font-weight: 850;
}

.today-flow-title-row h2 {
  margin-bottom: 0;
}

.today-flow-head p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.today-flow-title-block p {
  margin-top: 5px;
}

.today-flow-head > span {
  flex: 0 0 auto;
  min-width: 58px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-strong);
  text-align: center;
  font-size: 12px;
  font-weight: 850;
}

.today-flow-summary-inline {
  flex: 0 0 auto;
  min-width: 0;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.workbench-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.workbench-refresh-control {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.workbench-refresh-status {
  max-width: 280px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.workbench-refresh-status[data-state="success"] {
  color: var(--blue-strong);
}

.workbench-refresh-status[data-state="warning"],
.workbench-refresh-status[data-state="error"] {
  color: var(--pink-strong);
}

.workbench-head-actions .ghost-button {
  white-space: nowrap;
}

@media (max-width: 720px) {
  .today-flow-head-with-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .workbench-head-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

.today-order-list {
  display: block;
  padding: 0;
}

.workbench-table-wrap {
  width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  border-top: 1px solid rgba(57, 125, 170, 0.12);
  background: rgba(255, 255, 255, 0.64);
}

.workbench-new-table {
  min-width: 1960px;
}

.workbench-execution-table {
  min-width: 1900px;
}

.workbench-prep-table {
  min-width: 1760px;
}

.workbench-grid-table {
  width: max-content;
  min-width: 100%;
  font-size: 10.8px;
}

.workbench-grid-head,
.workbench-grid-body {
  display: grid;
  min-width: 0;
}

.workbench-grid-row {
  display: grid;
  grid-template-columns: var(--workbench-grid-columns);
  width: 100%;
  min-width: 100%;
  align-items: stretch;
}

.workbench-grid-cell {
  min-width: 0;
  max-width: none;
  padding: 5px 6px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: visible;
  overflow-wrap: normal;
  text-align: center;
  text-overflow: clip;
  white-space: normal;
  word-break: keep-all;
  font-size: 10.4px;
  line-height: 1.35;
}

.workbench-grid-header-cell {
  display: grid;
  min-height: 38px;
  align-items: center;
  padding-top: 9px;
  padding-bottom: 9px;
  border-bottom: 2px solid rgba(57, 125, 170, 0.26);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(238, 248, 255, 0.99));
  color: #203a54;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  box-shadow: 0 12px 22px rgba(45, 62, 90, 0.1);
}

.workbench-grid-header-cell:first-child {
  border-top-left-radius: 8px;
}

.workbench-grid-header-cell:last-child {
  border-top-right-radius: 8px;
}

.workbench-grid-body-cell {
  display: block;
  min-height: 35px;
  background: #ffffff;
}

.workbench-grid-body-row:nth-child(even) .workbench-grid-body-cell {
  background: #ffffff;
}

.workbench-grid-body-row:hover .workbench-grid-body-cell,
.workbench-grid-body-row.selected .workbench-grid-body-cell {
  background: #ffffff;
}

.workbench-grid-body-row.is-fresh {
  box-shadow: inset 3px 0 0 var(--blue-strong);
}

.workbench-grid-cell > * {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: normal;
  word-break: keep-all;
}

.workbench-grid-table strong,
.workbench-grid-table .cell-main {
  color: #172033;
  font-weight: 850;
}

.workbench-grid-table strong,
.workbench-grid-table .cell-sub,
.workbench-grid-table .status-chip,
.workbench-grid-table .owner-pill,
.workbench-grid-table .today-order-tag,
.workbench-grid-table .ghost-button {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.workbench-grid-table .cell-sub {
  color: #8490a3;
  font-size: 10px;
  font-weight: 700;
}

.workbench-grid-header-cell .table-sort-button span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.workbench-grid-table .status-chip,
.workbench-grid-table .customer-type-chip,
.workbench-grid-table .staging-need-chip,
.workbench-grid-table .schedule-state-chip {
  height: auto;
  min-height: 22px;
  padding: 3px 6px;
  text-align: center;
}

.role-task-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.role-task-grid.is-tomorrow {
  padding: 14px 20px 18px;
}

.role-task-column {
  min-width: 0;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.66);
}

.role-task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}

.role-task-head strong {
  font-size: 13px;
  font-weight: 900;
}

.role-task-head span {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-size: 11px;
  font-weight: 850;
}

.role-task-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.role-task-card {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 116px;
  padding: 11px;
  border: 1px solid rgba(17, 24, 39, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  text-align: left;
}

.role-task-card.is-clickable:hover {
  border-color: rgba(232, 135, 155, 0.34);
  background: var(--pink-soft);
}

.role-task-card strong,
.role-task-card small,
.role-task-card em {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.42;
}

.role-task-card strong {
  font-size: 13px;
  font-weight: 850;
}

.role-task-card small,
.role-task-card em,
.role-empty {
  color: var(--muted);
  font-size: 12px;
}

.role-task-card em {
  color: #53607a;
  font-style: normal;
}

.today-order-card {
  display: grid;
  min-width: 0;
  min-height: 238px;
  align-content: start;
  gap: 8px;
  padding: 13px;
  border: 1px solid rgba(17, 24, 39, 0.075);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.today-order-card:hover,
.today-order-card.is-selected {
  border-color: rgba(232, 135, 155, 0.36);
  background: linear-gradient(135deg, rgba(255, 241, 245, 0.96), rgba(240, 242, 255, 0.94));
}

.today-order-card.is-fresh {
  border-color: rgba(62, 132, 192, 0.42);
  background: linear-gradient(135deg, rgba(230, 246, 255, 0.98), rgba(255, 244, 248, 0.94));
  box-shadow: 0 14px 30px rgba(62, 132, 192, 0.14);
}

.today-order-tag {
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--pink-soft);
  color: var(--pink-strong);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.today-order-card strong,
.today-order-card small,
.today-order-card em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.today-order-card strong {
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
}

.today-order-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.today-order-card em {
  color: #53607a;
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.today-order-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 2px 0;
}

.today-order-detail-grid div {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
}

.today-order-detail-grid dt,
.today-order-detail-grid dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.today-order-detail-grid dt {
  color: var(--subtle);
  font-size: 10px;
  font-weight: 800;
}

.today-order-detail-grid dd {
  margin-top: 3px;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.today-empty {
  grid-column: 1 / -1;
  padding: 8px 0;
}

.tomorrow-plan-grid {
  display: block;
  padding: 0;
}

.tomorrow-plan-card {
  display: grid;
  min-width: 0;
  min-height: 154px;
  align-content: start;
  gap: 7px;
  padding: 14px;
  border: 1px solid rgba(17, 24, 39, 0.075);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.84);
}

.tomorrow-plan-card.is-clickable {
  cursor: pointer;
}

.tomorrow-plan-card.is-clickable:hover {
  border-color: rgba(109, 168, 206, 0.42);
  background: linear-gradient(135deg, rgba(244, 250, 255, 0.96), rgba(255, 241, 245, 0.88));
}

.tomorrow-plan-card span {
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-size: 11px;
  font-weight: 850;
}

.tomorrow-plan-card strong,
.tomorrow-plan-card p,
.tomorrow-plan-card em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.tomorrow-plan-card strong {
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
}

.tomorrow-plan-card p,
.tomorrow-plan-card em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.tomorrow-plan-card p {
  margin: 0;
  white-space: pre-line;
}

.tomorrow-plan-card em {
  color: #53607a;
  font-style: normal;
}

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

.orders-panel {
  overflow: hidden;
  min-height: calc(100vh - 250px);
  border: 1px solid rgba(242, 122, 154, 0.18);
  border-left: 5px solid var(--accent-pink);
  border-radius: var(--radius-panel);
  background: linear-gradient(180deg, #ffffff 0%, #fffafd 44%, var(--section-blue) 100%);
  box-shadow: none;
  backdrop-filter: none;
}

.detail-panel {
  display: none;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(255, 247, 251, 0.86), rgba(243, 250, 255, 0.78));
}

.panel-head h2,
.detail-head h2 {
  font-size: 18px;
  font-weight: 850;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(132px, 1fr));
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(247, 251, 255, 0.9), rgba(255, 248, 252, 0.78));
}

.filter-bar label {
  min-width: 0;
}

.filter-title {
  display: flex;
  align-items: center;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.filter-bar .search-field {
  grid-column: span 2;
}

.workbench-filter-bar {
  grid-template-columns: 112px repeat(5, minmax(128px, 1fr)) auto auto;
  align-items: end;
  margin: 0 0 8px;
  border: 1px solid rgba(111, 169, 216, 0.16);
  border-radius: var(--radius-panel);
  background: linear-gradient(90deg, rgba(243, 250, 255, 0.92), rgba(255, 247, 251, 0.82));
}

.workbench-filter-bar .ghost-button {
  align-self: end;
  white-space: nowrap;
}

.workbench-action-bar {
  grid-template-columns: 112px minmax(0, 1fr) auto auto;
  align-items: center;
}

.workbench-action-bar .ghost-button {
  align-self: center;
}

.workbench-action-note {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.service-consult-panel {
  display: grid;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--gradient-soft);
}

.import-preview-panel {
  display: grid;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.import-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.import-preview-head h3 {
  margin-bottom: 4px;
  font-size: 15px;
}

.import-preview-head p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

.import-preview-grid article {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
}

.import-preview-grid span,
.import-preview-grid strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.import-preview-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.import-preview-grid strong {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 900;
}

.import-batch-strip {
  display: grid;
  grid-template-columns: auto minmax(140px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 12px;
}

.import-batch-strip strong {
  color: var(--ink);
  font-weight: 850;
}

.import-batch-strip em {
  min-width: 0;
  overflow-wrap: anywhere;
  font-style: normal;
}

.import-preflight-panel {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(91, 120, 190, 0.13);
  border-radius: 12px;
  background: rgba(246, 251, 255, 0.74);
}

.import-preflight-panel.is-blocking {
  border-color: rgba(207, 82, 82, 0.26);
  background: rgba(255, 246, 246, 0.9);
}

.import-preflight-panel.is-review {
  border-color: rgba(232, 135, 155, 0.26);
  background: rgba(255, 248, 251, 0.9);
}

.import-preflight-panel.is-pass {
  border-color: rgba(42, 140, 108, 0.18);
  background: rgba(244, 252, 248, 0.86);
}

.import-repair-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(91, 120, 190, 0.13);
  border-radius: 8px;
  background: rgba(246, 251, 255, 0.82);
  color: var(--muted);
  font-size: 12px;
}

.import-repair-note strong {
  color: var(--ink);
  font-weight: 850;
}

.import-preflight-status {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.import-preflight-status span,
.import-preflight-status em {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
}

.import-preflight-status strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.import-preflight-counts,
.import-preflight-issues,
.import-preflight-rows {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.import-preflight-next {
  margin: 0;
  padding: 8px 10px;
  border-left: 3px solid rgba(91, 120, 190, 0.42);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.45;
}

.import-preflight-counts {
  justify-content: flex-end;
  min-width: 150px;
}

.import-preflight-counts button {
  min-height: 24px;
  padding: 0 9px;
}

.import-preflight-counts span,
.import-preflight-issues span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(17, 24, 39, 0.07);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
}

.import-preflight-rows article {
  min-width: 150px;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
}

.import-preflight-rows strong,
.import-preflight-rows span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.import-preflight-rows strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 880;
}

.import-preflight-rows span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.import-repair-workbench,
.import-batch-details {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(91, 120, 190, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.import-repair-head,
.import-batch-details-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.import-repair-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.import-repair-head span,
.import-batch-details-head span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

.import-repair-head strong,
.import-batch-details h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.import-repair-head em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
}

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

.import-review-issue-card {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 92px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(91, 120, 190, 0.12);
  border-radius: 10px;
  background: rgba(246, 251, 255, 0.82);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.import-review-issue-card:hover {
  border-color: rgba(91, 120, 190, 0.32);
  background: #fff;
}

.import-review-issue-card span,
.import-review-issue-card strong,
.import-review-issue-card em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.import-review-issue-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.import-review-issue-card strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 920;
  line-height: 1;
}

.import-review-issue-card em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.import-review-issue-card.is-empty {
  cursor: default;
}

.import-repair-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.import-repair-group {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.86);
}

.import-repair-group.is-blocking {
  border-color: rgba(207, 82, 82, 0.22);
  background: rgba(255, 247, 247, 0.9);
}

.import-repair-group.is-duplicate {
  border-color: rgba(232, 135, 155, 0.22);
  background: rgba(255, 248, 251, 0.9);
}

.import-repair-group.is-review {
  border-color: rgba(91, 120, 190, 0.16);
  background: rgba(246, 251, 255, 0.9);
}

.import-repair-group div:first-child {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
}

.import-repair-group div:first-child span,
.import-repair-group div:first-child em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 780;
}

.import-repair-group div:first-child strong {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.import-repair-group p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.import-repair-row-list {
  display: grid;
  gap: 6px;
}

.import-repair-row-card {
  display: grid;
  gap: 6px;
  padding: 7px 8px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.import-repair-row-card:hover {
  border-color: rgba(91, 120, 190, 0.3);
  background: #fff;
}

.import-repair-row-main {
  display: grid;
  gap: 3px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.import-repair-row-list strong,
.import-repair-row-list span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.import-repair-row-list strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.import-repair-row-list span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.import-repair-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.import-repair-row-actions button {
  min-height: 23px;
  padding: 0 7px;
  border: 1px solid rgba(91, 120, 190, 0.16);
  border-radius: 999px;
  background: rgba(246, 251, 255, 0.9);
  color: #476282;
  font-size: 11px;
  font-weight: 780;
  cursor: pointer;
}

.import-repair-row-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.import-batch-detail-card {
  border: 1px solid rgba(17, 24, 39, 0.07);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.8);
  overflow: hidden;
}

.import-batch-detail-card summary {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
}

.import-batch-detail-card summary span,
.import-batch-detail-card summary strong,
.import-batch-detail-card summary em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.import-batch-detail-card summary span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 880;
}

.import-batch-detail-card summary strong,
.import-batch-detail-card summary em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
}

.import-batch-detail-body {
  display: grid;
  gap: 9px;
  padding: 0 12px 12px;
}

.import-batch-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.import-batch-detail-grid span,
.import-batch-detail-body p,
.import-batch-detail-issues span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.import-batch-detail-body p {
  margin: 0;
}

.import-batch-detail-body pre {
  max-height: 96px;
  margin: 0;
  padding: 9px 10px;
  overflow: auto;
  border: 1px solid rgba(17, 24, 39, 0.07);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.import-batch-detail-issues {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.import-batch-detail-issues span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

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

.import-flow-steps span,
.import-dialog-grid article,
.import-mapping-table div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(17, 24, 39, 0.07);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  overflow-wrap: anywhere;
}

.import-flow-steps span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.import-flow-steps .is-done {
  color: var(--pink-strong);
  background: var(--pink-soft);
}

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

.import-dialog-grid span,
.import-dialog-grid strong,
.import-mapping-table span,
.import-mapping-table strong {
  display: block;
}

.import-dialog-grid span,
.import-mapping-table span {
  color: var(--muted);
  font-size: 12px;
}

.import-dialog-grid strong,
.import-mapping-table strong {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 850;
}

.import-mapping-table {
  display: grid;
  gap: 8px;
}

.import-mapping-table h3 {
  font-size: 14px;
}

.order-column-panel {
  display: grid;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
}

.order-column-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.order-column-panel-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.order-column-panel-head h3 {
  margin-bottom: 4px;
  font-size: 15px;
}

.order-column-panel-head p,
.table-status-row {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.order-column-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 152px));
  align-items: start;
  gap: 6px;
}

.column-toggle {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 28px 18px;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 32px;
  padding: 6px 7px;
  border: 1px solid rgba(17, 24, 39, 0.07);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  cursor: grab;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease, transform 0.16s ease;
  will-change: transform;
}

.column-toggle:active {
  cursor: grabbing;
}

.column-toggle.is-dragging {
  border-color: rgba(236, 72, 153, 0.4);
  box-shadow: inset 0 0 0 1px rgba(236, 72, 153, 0.08);
  opacity: 0.42;
  transform: scale(0.97);
}

.column-toggle.drag-over {
  border-color: rgba(139, 92, 246, 0.46);
  background: rgba(255, 245, 250, 0.94);
}

.column-toggle.drop-before,
.column-toggle.drop-after {
  box-shadow: 0 10px 20px rgba(45, 62, 90, 0.08);
}

.column-toggle.drop-before {
  transform: translateX(3px);
}

.column-toggle.drop-after {
  transform: translateX(-3px);
}

.column-drop-placeholder {
  display: grid;
  min-height: 32px;
  place-items: center;
  border: 1px dashed rgba(236, 72, 153, 0.54);
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255, 241, 246, 0.94), rgba(238, 248, 255, 0.86));
  color: var(--pink-strong);
  font-size: 11px;
  font-weight: 850;
  opacity: 0.94;
  outline: 2px solid rgba(236, 72, 153, 0.08);
  outline-offset: -4px;
  transform: scale(1);
  animation: column-placeholder-in 0.14s ease-out;
}

.column-drop-placeholder span {
  pointer-events: none;
}

@keyframes column-placeholder-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }

  to {
    opacity: 0.94;
    transform: scale(1);
  }
}

.column-toggle input[type="checkbox"] {
  justify-self: start;
  margin: 0;
}

.column-toggle-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 12px;
  font-weight: 780;
}

.column-toggle small {
  justify-self: end;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

.column-toggle.is-default small {
  color: var(--pink-strong);
}

.column-drag-handle {
  display: grid;
  place-items: center;
  width: 18px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: grab;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0;
  line-height: 1;
}

.column-drag-handle:hover,
.column-drag-handle:focus-visible {
  background: rgba(236, 72, 153, 0.1);
  color: var(--pink-strong);
}

body.is-order-column-dragging {
  cursor: grabbing;
  user-select: none;
}

.column-drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  border-color: rgba(236, 72, 153, 0.46);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 38px rgba(17, 24, 39, 0.18), 0 5px 14px rgba(236, 72, 153, 0.16);
  opacity: 0;
  transform-origin: left top;
  transition: opacity 0.12s ease, box-shadow 0.12s ease;
}

.column-drag-ghost.is-active {
  opacity: 0.96;
}

.column-drag-ghost input[type="checkbox"] {
  opacity: 1;
}

.column-drag-ghost .column-drag-handle {
  background: rgba(236, 72, 153, 0.1);
  color: var(--pink-strong);
  cursor: grabbing;
}

.table-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.44);
}

.table-status-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.table-status-row span:first-child {
  color: var(--ink);
  font-weight: 820;
}

.table-action-buttons {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.table-action-buttons .ghost-button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12px;
}

.service-consult-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.service-consult-head h3 {
  margin-bottom: 4px;
  font-size: 15px;
}

.service-consult-head p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

.service-consult-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: var(--radius-card);
  background: #ffffff;
}

.service-consult-card strong,
.service-consult-card span,
.service-consult-card small {
  display: block;
}

.service-consult-card span,
.service-consult-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  outline: none;
}

input,
select {
  min-width: 0;
  height: 38px;
  padding: 0 12px;
}

input[type="checkbox"] {
  width: 16px;
  max-width: 16px;
  inline-size: 16px;
  min-width: 16px;
  height: 16px;
  max-height: 16px;
  block-size: 16px;
  padding: 0;
  box-sizing: border-box;
  border-radius: 4px;
  accent-color: var(--pink);
}

textarea {
  resize: vertical;
  padding: 10px 12px;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(232, 135, 155, 0.14);
}

.table-wrap {
  width: 100%;
  overflow: auto;
  overscroll-behavior-x: contain;
  border-top: 1px solid rgba(57, 125, 170, 0.12);
  background: rgba(255, 255, 255, 0.64);
}

table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.orders-panel table {
  width: 100%;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.orders-panel thead {
  position: static;
  top: auto;
  z-index: auto;
}

.orders-panel th,
.orders-panel td {
  width: auto;
  max-width: none;
  padding-right: 5px;
  padding-left: 5px;
  font-size: 10.8px;
}

.orders-panel .select-column {
  width: auto;
  min-width: 0;
  text-align: center;
}

.orders-panel .select-column input {
  width: 16px;
  height: 16px;
  accent-color: var(--pink);
}

th,
td {
  max-width: 260px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

th {
  position: static;
  top: auto;
  z-index: 1;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(20px);
}

.orders-panel .table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 0 0 8px 8px;
}

.orders-panel th {
  z-index: 3;
  min-height: 38px;
  padding-top: 9px;
  padding-bottom: 9px;
  border-bottom: 2px solid rgba(57, 125, 170, 0.26);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(238, 248, 255, 0.99));
  color: #203a54;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.15;
  white-space: normal;
  box-shadow: 0 12px 22px rgba(45, 62, 90, 0.11);
  text-align: center;
}

.orders-panel th:first-child {
  border-top-left-radius: 8px;
}

.orders-panel th:last-child {
  border-top-right-radius: 8px;
}

.order-table-heading {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.table-sort-button {
  display: inline-grid;
  grid-template-columns: minmax(0, auto) auto;
  width: 100%;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 900;
  text-align: center;
}

.table-sort-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.table-sort-button em {
  min-width: 10px;
  color: var(--pink-strong);
  font-style: normal;
  font-weight: 950;
}

.table-sort-button:not(:disabled):hover {
  color: var(--pink-strong);
}

.table-sort-button:disabled {
  cursor: default;
}

.table-sort-button.is-active {
  color: #172033;
}

.orders-panel td {
  background: #ffffff;
}

.orders-panel tbody tr:nth-child(even) td {
  background: #ffffff;
}

.orders-panel .cell-main {
  color: #172033;
  font-weight: 850;
}

.orders-panel .cell-sub {
  color: #8490a3;
  font-size: 10px;
  font-weight: 700;
}

.order-staging-preview {
  display: inline-flex;
  width: 42px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  object-fit: cover;
}

.order-staging-preview-button {
  display: inline-grid;
  width: 46px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: zoom-in;
}

.order-staging-preview.no-image {
  background: var(--blue-soft);
  color: var(--blue-strong);
}

.order-staging-preview-empty {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

.image-preview-dialog {
  width: min(880px, calc(100vw - 40px));
  max-width: 96vw;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(10, 18, 30, 0.94);
}

.image-preview-dialog::backdrop {
  background: rgba(15, 23, 42, 0.58);
}

.image-preview-dialog form {
  position: relative;
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 34px 16px 16px;
  background: transparent;
}

.image-preview-dialog img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  border-radius: 6px;
  object-fit: contain;
}

.image-preview-close {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.schedule-state-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.schedule-state-chip.pending {
  border-color: rgba(232, 135, 155, 0.34);
  background: rgba(255, 241, 245, 0.76);
  color: var(--pink-strong);
  border-style: dashed;
}

.schedule-state-chip.locked,
.schedule-state-chip.manual-lock {
  background: rgba(238, 247, 255, 0.94);
  color: var(--blue-strong);
}

.schedule-state-chip.final-paid,
.schedule-state-chip.done {
  background: rgba(235, 250, 244, 0.92);
  color: #23815b;
}

.schedule-state-chip.cancel {
  background: var(--red-soft);
  color: var(--red);
}

#ordersWorkspace .order-grid-cell[data-order-column="mainAction"] .ghost-button {
  width: 100%;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 11px;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.selected {
  background: linear-gradient(90deg, rgba(255, 241, 245, 0.82), rgba(240, 242, 255, 0.72));
}

.cell-main {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 780;
}

.cell-sub {
  min-width: 0;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clamp-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--pink-soft);
  color: var(--pink-strong);
  font-size: 12px;
  font-weight: 800;
}

.status-chip.done {
  background: var(--blue-soft);
  color: var(--blue-strong);
}

.status-chip.info {
  border-color: rgba(109, 168, 206, 0.24);
  background: #f1f7ff;
  color: #365f8b;
}

.status-chip.cancel {
  background: var(--red-soft);
  color: var(--red);
}

.detail-panel {
  position: sticky;
  top: 22px;
  min-width: 0;
  padding: 20px;
}

.detail-empty {
  display: grid;
  min-height: 320px;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
}

.detail-content {
  display: grid;
  gap: 18px;
}

.order-detail-dialog {
  width: min(1380px, calc(100vw - 44px));
  max-height: calc(100vh - 36px);
  padding: 0;
  border: 1px solid rgba(57, 125, 170, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f7f4f8 50%, #eef8ff);
  box-shadow: var(--shadow-float);
}

.order-detail-dialog::backdrop {
  background: rgba(17, 24, 39, 0.32);
}

.order-detail-dialog-frame {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(100vh - 36px);
}

.order-detail-dialog-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(57, 125, 170, 0.14);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(18px);
}

.order-detail-dialog-head span,
.order-detail-dialog-head strong {
  display: block;
}

.order-detail-dialog-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-detail-dialog-head strong {
  margin-top: 3px;
  font-size: 16px;
  font-weight: 900;
}

.order-detail-dialog-body {
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.order-detail-dialog .detail-content {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(360px, 0.72fr);
  grid-template-areas:
    "hero hero"
    "status status"
    "summary payment"
    "staging actions"
    "staging history"
    "staging timeline"
    "customer timeline"
    "execution overview"
    "copy overview"
    "save readonly";
  align-items: start;
  gap: 12px;
  max-width: none;
}

.order-detail-dialog .detail-head { grid-area: hero; }
.order-detail-dialog .detail-status-strip { grid-area: status; }
.order-detail-dialog .detail-grid { grid-area: summary; }
.order-detail-dialog .payment-section { grid-area: payment; }
.order-detail-dialog .staging-section { grid-area: staging; }
.order-detail-dialog .customer-note-section { grid-area: customer; }
.order-detail-dialog .execution-note-section { grid-area: execution; }
.order-detail-overview-section { grid-area: overview; }
.order-detail-dialog .customer-history-section { grid-area: history; }
.order-detail-dialog .copy-section { grid-area: copy; }
.order-detail-dialog .timeline-section { grid-area: timeline; }
.order-detail-dialog .action-grid { grid-area: actions; }
.order-detail-dialog #detailReadonlyNotice { grid-area: readonly; }
.order-detail-dialog #saveOrderEdits { grid-area: save; }

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

.detail-status-step {
  position: relative;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(57, 125, 170, 0.14);
  border-radius: 8px;
  background: #ffffff;
}

.detail-status-step::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10px;
  right: 10px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: rgba(91, 120, 190, 0.16);
}

.detail-status-step strong,
.detail-status-step em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-status-step strong {
  color: #1f314f;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.detail-status-step em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.detail-status-step.is-done {
  background: rgba(236, 250, 244, 0.94);
}

.detail-status-step.is-done::before {
  background: var(--green);
}

.detail-status-step.is-active {
  border-color: rgba(232, 135, 155, 0.28);
  background: rgba(255, 247, 250, 0.96);
}

.detail-status-step.is-active::before {
  background: var(--pink);
}

.detail-status-step.is-cancel::before {
  background: var(--red);
}

.hidden,
.detail-content.hidden {
  display: none !important;
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(57, 125, 170, 0.16);
  border-radius: 8px;
  background: linear-gradient(90deg, #ffffff, rgba(255, 242, 246, 0.82) 48%, rgba(238, 248, 255, 0.86));
  box-shadow: 0 8px 22px rgba(37, 56, 102, 0.06);
}

.detail-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--pink);
  font-size: 12px;
  font-weight: 850;
}

#detailMeta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.detail-grid,
.payment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 10px;
}

.detail-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

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

.order-detail-dialog .detail-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.detail-grid > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

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

.customer-history-grid div {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.78);
}

.customer-history-grid span,
.customer-history-grid strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.customer-history-grid span {
  color: var(--muted);
  font-size: 11px;
}

.customer-history-grid strong {
  margin-top: 4px;
  font-size: 13px;
}

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

.customer-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
}

.customer-history-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.customer-history-item strong {
  color: var(--pink-strong);
  font-size: 12px;
}

.detail-section {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 11px;
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(57, 125, 170, 0.14);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, var(--section-neutral));
  box-shadow: 0 6px 18px rgba(37, 56, 102, 0.04);
}

.detail-section::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent-blue);
  content: "";
}

.detail-section h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
}

.detail-section h3::before {
  display: inline-block;
  width: 4px;
  height: 14px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--gradient-accent);
  vertical-align: -2px;
  content: "";
}

.detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(91, 120, 190, 0.12);
  background: transparent;
}

.detail-section-head > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}

.payment-section,
.staging-section {
  border-color: rgba(232, 135, 155, 0.22);
}

.payment-section {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 250, 0.9));
}

.payment-section::before,
.customer-note-section::before,
.copy-section::before,
.action-grid::before {
  background: var(--accent-pink);
}

.staging-section {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(238, 248, 255, 0.96));
}

.staging-section::before,
.order-detail-overview-section::before,
.customer-history-section::before {
  background: var(--accent-blue);
}

.execution-note-section {
  border-color: rgba(212, 129, 122, 0.22);
  background: linear-gradient(180deg, #ffffff, var(--section-amber));
}

.execution-note-section::before,
.timeline-section::before {
  background: var(--accent-amber);
}

.staging-section .detail-section-head {
  border-bottom-color: rgba(109, 168, 206, 0.22);
}

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

.order-detail-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}

.order-detail-table th,
.order-detail-table td {
  padding: 9px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 12px;
}

.order-detail-table tr:last-child th,
.order-detail-table tr:last-child td {
  border-bottom: 0;
}

.order-detail-table th {
  width: 116px;
  background: #f7f9fb;
  color: var(--muted);
  font-weight: 850;
  text-align: left;
}

.order-detail-table td {
  color: var(--text);
  font-weight: 760;
  overflow-wrap: anywhere;
}

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

.order-detail-fact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.order-detail-fact {
  min-width: 0;
  padding: 8px 9px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.06);
  background: rgba(248, 250, 253, 0.68);
}

.order-detail-fact.wide {
  grid-column: 1 / -1;
}

.order-detail-fact span,
.order-detail-secondary dt {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.order-detail-fact strong,
.order-detail-secondary dd {
  display: block;
  min-width: 0;
  margin: 4px 0 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.order-detail-secondary {
  border-top: 1px solid rgba(17, 24, 39, 0.07);
  padding-top: 8px;
}

.order-detail-secondary summary {
  color: var(--blue-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

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

.copy-tools {
  display: grid;
  grid-template-columns: minmax(100px, auto) minmax(120px, 1fr) minmax(100px, auto);
  gap: 8px;
  align-items: end;
}

.copy-tools label {
  min-width: 0;
}

.staging-order-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(109, 168, 206, 0.18);
  border-radius: 8px;
  background: rgba(246, 251, 255, 0.74);
}

.staging-order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.staging-order-actions .ghost-button {
  flex: 1 1 120px;
}

.staging-scene-summary {
  min-height: 70px;
  white-space: pre-line;
  padding: 10px;
  border: 1px dashed rgba(109, 168, 206, 0.3);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.55;
}

.staging-reference-preview {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(232, 135, 155, 0.18);
  border-radius: 8px;
  background: #fff8fb;
}

.staging-reference-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.staging-reference-preview-head strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.staging-reference-preview-head span {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staging-reference-preview-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.staging-reference-preview-strip img,
.staging-reference-empty {
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(232, 135, 155, 0.18);
  border-radius: 7px;
  background: #fff;
}

.staging-reference-preview-strip img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.staging-reference-empty {
  display: grid;
  grid-column: 1 / -1;
  place-items: center;
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.staging-section textarea {
  min-height: 260px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.65;
}

.staging-library-picker {
  padding: 9px 10px;
  border: 1px dashed rgba(109, 168, 206, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.staging-library-picker summary {
  color: var(--blue-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.staging-library-picker label {
  margin-top: 10px;
}

.staging-library-picker select[multiple] {
  min-height: 210px;
  white-space: normal;
}

.customer-note-section textarea,
.execution-note-section textarea {
  min-height: 118px;
  line-height: 1.6;
}

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

.timeline li {
  padding: 8px 10px;
  border-left: 3px solid rgba(232, 135, 155, 0.28);
  border-radius: 6px;
  background: rgba(248, 250, 253, 0.82);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.timeline strong {
  display: block;
  color: var(--text);
}

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

.action-grid {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(232, 135, 155, 0.2);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, var(--section-pink));
}

.action-grid::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent-pink);
  content: "";
}

.order-detail-dialog {
  width: min(1280px, calc(100vw - 28px));
  height: calc(100vh - 28px);
  max-height: 720px;
}

.order-detail-dialog-frame {
  height: 100%;
  max-height: none;
}

.order-detail-dialog-head {
  min-height: 52px;
  padding: 8px 12px;
}

.order-detail-dialog-head span,
.order-detail-dialog-head em {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 780;
  line-height: 1.25;
}

.order-detail-dialog-head strong {
  margin-top: 1px;
  font-size: 15px;
  line-height: 1.2;
}

.order-detail-dialog-head em {
  margin-top: 2px;
}

.order-detail-dialog-body {
  overflow: hidden;
  padding: 10px;
}

.order-detail-dialog .detail-content {
  display: grid;
  height: 100%;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 0.92fr) minmax(0, 0.82fr);
  grid-template-rows: 54px 70px minmax(150px, 1fr) 88px 40px;
  grid-template-areas:
    "hero status status payment"
    "summary summary actions payment"
    "staging staging overview history"
    "customer execution overview timeline"
    "copy copy save readonly";
  gap: 8px;
  max-width: none;
  min-height: 0;
}

.order-detail-dialog .detail-head,
.order-detail-dialog .detail-section,
.order-detail-dialog .action-grid,
.order-detail-dialog #saveOrderEdits,
.order-detail-dialog #detailReadonlyNotice {
  min-height: 0;
}

.order-detail-dialog .detail-head {
  padding: 8px 10px;
  gap: 8px;
  box-shadow: none;
}

.order-detail-dialog .detail-kicker {
  margin-bottom: 2px;
  font-size: 10px;
}

.order-detail-dialog .detail-head h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.15;
}

.order-detail-dialog #detailMeta {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.2;
}

.order-detail-dialog .status-chip {
  min-height: 22px;
  padding: 2px 8px;
  font-size: 10px;
}

.order-detail-dialog .detail-status-strip {
  gap: 5px;
}

.order-detail-dialog .detail-status-step {
  gap: 2px;
  padding: 7px 8px 5px;
}

.order-detail-dialog .detail-status-step strong,
.order-detail-dialog .detail-status-step em {
  white-space: normal;
}

.order-detail-dialog .detail-status-step strong {
  font-size: 11px;
}

.order-detail-dialog .detail-status-step em {
  font-size: 10px;
}

.order-detail-dialog .detail-grid,
.order-detail-dialog .payment-grid {
  gap: 6px;
}

.order-detail-dialog .detail-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.order-detail-dialog .detail-grid > div {
  padding: 7px 8px;
  border-radius: 7px;
}

.order-detail-dialog .detail-grid span,
.order-detail-dialog label span {
  font-size: 10px;
  line-height: 1.2;
}

.order-detail-dialog .detail-grid strong {
  margin-top: 3px;
  font-size: 12px;
}

.order-detail-dialog .detail-section {
  gap: 6px;
  padding: 8px 9px 8px 10px;
  border-radius: 7px;
  box-shadow: none;
}

.order-detail-dialog .detail-section-head {
  min-height: 22px;
  padding-bottom: 5px;
}

.order-detail-dialog .detail-section h3 {
  font-size: 12px;
}

.order-detail-dialog .detail-section h3::before {
  height: 12px;
  margin-right: 6px;
}

.order-detail-dialog .detail-section-head > span,
.order-detail-dialog .muted {
  font-size: 10.5px;
  line-height: 1.35;
}

.order-detail-dialog input,
.order-detail-dialog select {
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12px;
}

.order-detail-dialog textarea {
  min-height: 0;
  padding: 7px 8px;
  resize: none;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.35;
}

.order-detail-dialog .payment-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.order-detail-dialog .payment-section p {
  margin: 0;
}

.order-detail-dialog .action-grid {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 6px;
  padding: 8px 9px 8px 10px;
  box-shadow: none;
}

.order-detail-dialog .action-grid button,
.order-detail-dialog #saveOrderEdits,
.order-detail-dialog .copy-tools button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 11px;
}

.order-detail-dialog .staging-section {
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}

.order-detail-dialog .staging-order-tools {
  gap: 6px;
  padding: 7px;
  border-radius: 7px;
}

.order-detail-dialog .staging-scene-summary {
  min-height: 28px;
  padding: 6px 7px;
  font-size: 10.5px;
  line-height: 1.35;
}

.order-detail-dialog .staging-reference-preview {
  gap: 4px;
  padding: 6px;
  border-radius: 7px;
}

.order-detail-dialog .staging-reference-preview-head strong,
.order-detail-dialog .staging-reference-preview-head span {
  font-size: 10.5px;
}

.order-detail-dialog .staging-reference-preview-strip {
  gap: 5px;
}

.order-detail-dialog .staging-reference-preview-strip img,
.order-detail-dialog .staging-reference-empty {
  min-height: 28px;
  border-radius: 6px;
}

.order-detail-dialog .staging-reference-empty {
  padding: 5px 7px;
  font-size: 10.5px;
  line-height: 1.25;
}

.order-detail-dialog .staging-section textarea {
  min-height: 48px;
}

.order-detail-dialog .staging-library-picker {
  padding: 5px 7px;
  border-radius: 7px;
}

.order-detail-dialog .staging-library-picker summary {
  font-size: 10.5px;
}

.order-detail-dialog .staging-library-picker select[multiple] {
  min-height: 72px;
}

.order-detail-dialog .customer-note-section textarea,
.order-detail-dialog .execution-note-section textarea {
  min-height: 46px;
}

.order-detail-dialog .order-detail-fact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.order-detail-dialog .order-detail-fact {
  padding: 5px 6px;
}

.order-detail-dialog .order-detail-fact span,
.order-detail-dialog .order-detail-secondary dt {
  font-size: 10px;
}

.order-detail-dialog .order-detail-fact strong,
.order-detail-dialog .order-detail-secondary dd {
  margin-top: 2px;
  font-size: 10.5px;
  line-height: 1.25;
}

.order-detail-dialog .order-detail-secondary {
  padding-top: 5px;
}

.order-detail-dialog .order-detail-secondary summary {
  font-size: 10.5px;
}

.order-detail-dialog .customer-history-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.order-detail-dialog .customer-history-grid div,
.order-detail-dialog .customer-history-item {
  padding: 5px 6px;
  border-radius: 7px;
}

.order-detail-dialog .customer-history-grid span,
.order-detail-dialog .customer-history-item span {
  font-size: 10px;
}

.order-detail-dialog .customer-history-grid strong,
.order-detail-dialog .customer-history-item strong {
  margin-top: 2px;
  font-size: 10.5px;
}

.order-detail-dialog .customer-history-list {
  gap: 4px;
}

.order-detail-dialog .copy-tools {
  grid-template-columns: 1fr minmax(90px, 0.8fr) 1fr;
  gap: 6px;
  align-items: end;
}

.order-detail-dialog .timeline {
  gap: 4px;
}

.order-detail-dialog .timeline li {
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  line-height: 1.3;
}

.order-detail-dialog .timeline strong {
  font-size: 10.5px;
}

.order-detail-dialog #saveOrderEdits {
  align-self: stretch;
}

.order-detail-dialog #detailReadonlyNotice {
  align-self: stretch;
  padding: 8px 10px;
  font-size: 11px;
}

dialog {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: var(--radius-panel);
  background: var(--surface-strong);
  box-shadow: var(--shadow-float);
}

.form-dialog {
  width: min(640px, calc(100vw - 32px));
}

dialog::backdrop {
  background: rgba(28, 28, 30, 0.22);
  backdrop-filter: blur(8px);
}

dialog form {
  display: grid;
  gap: 14px;
}

dialog h2 {
  font-size: 18px;
}

dialog p {
  color: var(--muted);
  line-height: 1.6;
}

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

.dialog-field-wide {
  grid-column: 1 / -1;
}

.dialog-error {
  min-height: 18px;
  color: var(--red);
  font-size: 12px;
  font-weight: 750;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.module-view {
  min-height: calc(100vh - 250px);
}

.module-grid,
.analytics-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.module-panel {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid rgba(111, 169, 216, 0.16);
  border-radius: var(--radius-panel);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), var(--section-neutral));
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(24px);
}

.module-panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-pink));
  content: "";
}

.module-panel.wide {
  min-width: 0;
}

.schedule-page-grid {
  grid-template-columns: minmax(0, 1fr);
}

.schedule-deferred-panels {
  display: contents;
}

.schedule-deferred-loading {
  min-height: 120px;
  align-content: center;
}

.schedule-deferred-loading strong,
.schedule-deferred-loading span {
  display: block;
}

.schedule-deferred-loading span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.analytics-layout .wide {
  grid-column: 1 / -1;
}

.module-panel h2 {
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 850;
}

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

.content-focus-card {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(232, 135, 155, 0.22);
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, rgba(255, 246, 250, 0.98), rgba(239, 249, 255, 0.94));
  box-shadow: inset 4px 0 0 var(--accent-pink);
}

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

.content-focus-card strong {
  font-size: 14px;
  font-weight: 850;
}

.content-focus-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.content-editor {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.content-editor-section {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(111, 169, 216, 0.16);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, #ffffff, var(--section-blue));
}

.content-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -14px -14px 0;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(111, 169, 216, 0.14);
  background: rgba(247, 251, 255, 0.88);
}

.content-section-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 850;
}

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

.content-row-list {
  display: grid;
  gap: 10px;
}

.content-row {
  padding: 12px;
  border: 1px solid rgba(43, 58, 84, 0.09);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, #ffffff, rgba(251, 252, 255, 0.9));
  box-shadow: inset 3px 0 0 rgba(111, 169, 216, 0.24);
}

.content-row.is-filtered-hidden {
  display: none;
}

.staging-tools {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(109, 168, 206, 0.22);
  border-radius: var(--radius-card);
  background: rgba(248, 251, 255, 0.92);
  box-shadow: inset 3px 0 0 rgba(111, 169, 216, 0.34);
}

.staging-work-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(111, 169, 216, 0.22);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, #ffffff, var(--section-blue));
  box-shadow: inset 4px 0 0 var(--accent-blue);
}

.staging-work-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.staging-work-head h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 900;
}

.staging-work-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.staging-work-head > span {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(92, 132, 178, 0.22);
  border-radius: 999px;
  background: #f5f9ff;
  color: #365f8b;
  font-size: 12px;
  font-weight: 850;
}

.staging-work-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.staging-work-metrics article {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.staging-work-metrics span,
.staging-work-metrics small {
  color: var(--muted);
  font-size: 11px;
}

.staging-work-metrics strong {
  font-size: 20px;
  font-weight: 900;
}

.staging-work-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.staging-execution-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(212, 129, 122, 0.22);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, #ffffff, var(--section-amber));
  box-shadow: inset 4px 0 0 var(--accent-amber);
}

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

.staging-execution-summary article {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid rgba(212, 129, 122, 0.16);
  border-radius: 6px;
  background: #fff;
}

.staging-execution-summary span {
  color: var(--muted);
  font-size: 11px;
}

.staging-execution-summary strong {
  font-size: 19px;
  font-weight: 900;
}

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

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

.staging-execution-row {
  display: grid;
  grid-template-columns: 130px minmax(260px, 1fr) 168px auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(212, 129, 122, 0.14);
  border-radius: 6px;
  background: #fff;
}

.staging-execution-row.overdue {
  border-color: rgba(245, 158, 11, 0.32);
  background: #fffaf0;
}

.staging-exec-time,
.staging-exec-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.staging-exec-time strong,
.staging-exec-main strong {
  font-weight: 900;
}

.staging-exec-time span,
.staging-exec-main span,
.staging-exec-main small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.staging-exec-main span,
.staging-exec-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staging-exec-images {
  display: grid;
  grid-template-columns: repeat(4, 34px);
  gap: 5px;
  min-height: 34px;
  align-items: center;
}

.staging-exec-images img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.staging-exec-no-image {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.staging-exec-actions {
  justify-content: flex-end;
  white-space: nowrap;
}

.staging-image-queue-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 0;
  border: 1px solid rgba(242, 122, 154, 0.24);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, #ffffff, var(--section-pink));
  box-shadow: inset 4px 0 0 var(--accent-pink);
}

.staging-image-queue-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 247, 251, 0.82);
}

.staging-image-queue-summary article {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid rgba(236, 72, 153, 0.14);
  border-radius: 6px;
  background: #fff;
}

.staging-image-queue-summary span {
  color: var(--muted);
  font-size: 11px;
}

.staging-image-queue-summary strong {
  font-size: 19px;
  font-weight: 900;
}

.staging-image-queue-list {
  display: grid;
  gap: 8px;
  padding: 12px 14px 14px;
}

.staging-image-queue-row {
  display: grid;
  grid-template-columns: 78px minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(242, 122, 154, 0.12);
  border-radius: 6px;
  background: #fff;
}

.staging-image-queue-row.missing-main {
  border-color: rgba(236, 72, 153, 0.24);
  background: #fff7fb;
}

.staging-image-queue-thumb .staging-table-thumb {
  width: 64px;
  height: 48px;
}

.staging-image-queue-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.staging-image-queue-main strong {
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staging-image-queue-main > span {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staging-image-queue-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.staging-image-queue-actions {
  justify-content: flex-end;
  white-space: nowrap;
}

.staging-hot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 2px;
}

.staging-hot-list strong,
.staging-hot-list span {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.staging-hot-list strong {
  color: #334155;
  background: #eef2f7;
}

.staging-hot-list span {
  color: #365f8b;
  background: #f1f7ff;
}

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

.staging-tools-head h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 850;
}

.staging-tools-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.staging-filter-grid,
.staging-batch-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}

.staging-filter-grid-compact {
  max-width: 760px;
}

.staging-quick-add-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid rgba(17, 24, 39, 0.06);
}

.staging-quick-add-bar > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.staging-batch-bar {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding-top: 12px;
  border-top: 1px solid rgba(17, 24, 39, 0.06);
}

.staging-filter-grid label,
.staging-batch-bar label {
  min-width: 0;
}

.staging-gallery-panel {
  position: relative;
  display: grid;
  gap: 0;
  border: 1px solid rgba(111, 169, 216, 0.2);
  border-radius: var(--radius-panel);
  background: linear-gradient(180deg, #ffffff, var(--section-blue));
  overflow: hidden;
  box-shadow: inset 4px 0 0 rgba(111, 169, 216, 0.34);
}

.staging-gallery-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 251, 255, 0.88);
}

.staging-gallery-head h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 900;
}

.staging-gallery-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.staging-gallery-head > span {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 850;
}

.staging-gallery-table-wrap {
  width: 100%;
  overflow: auto;
}

.staging-gallery-table {
  min-width: 1520px;
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.staging-gallery-table th,
.staging-gallery-table td {
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staging-gallery-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef3f5;
  color: #3f4b5d;
  font-size: 11px;
  font-weight: 850;
}

.staging-gallery-table tbody tr:hover {
  background: linear-gradient(90deg, rgba(255, 241, 245, 0.72), rgba(240, 242, 255, 0.58));
}

.staging-gallery-table tbody tr.needs-gallery-update {
  background: #fff7fb;
}

.staging-gallery-table tbody tr.needs-gallery-update:hover {
  background: #fff0f7;
}

.staging-deferred-loading {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px dashed rgba(109, 168, 206, 0.3);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(247, 251, 255, 0.96), rgba(255, 244, 249, 0.82));
}

.staging-deferred-loading strong,
.staging-deferred-loading span {
  display: block;
}

.staging-deferred-loading strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.staging-deferred-loading span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.staging-full-editor-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(242, 122, 154, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 244, 249, 0.96), rgba(238, 248, 255, 0.92));
}

.staging-full-editor-notice.is-open {
  border-color: rgba(57, 125, 170, 0.18);
  background: rgba(247, 251, 255, 0.94);
}

.staging-full-editor-notice strong,
.staging-full-editor-notice span {
  display: block;
}

.staging-full-editor-notice strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.staging-full-editor-notice span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.staging-gallery-table th:first-child,
.staging-gallery-table td:first-child {
  width: 84px;
}

.staging-table-thumb {
  display: block;
  width: 62px;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  object-fit: cover;
  background: #f4f7fa;
}

.staging-table-thumb-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.staging-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.status-chip.warn {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}

.staging-detail-dialog {
  width: min(1180px, calc(100vw - 56px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-float);
}

.staging-detail-dialog::backdrop {
  background: rgba(17, 24, 39, 0.32);
}

.staging-detail-frame {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(100vh - 48px);
}

.staging-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fb;
}

.staging-detail-head span,
.staging-detail-head strong {
  display: block;
}

.staging-detail-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.staging-detail-head strong {
  margin-top: 3px;
  font-size: 17px;
  font-weight: 900;
}

.staging-detail-body {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.staging-detail-images {
  display: grid;
  align-content: start;
  gap: 10px;
}

.staging-detail-main-image,
.staging-detail-image-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #f4f7fa;
}

.staging-detail-main-image {
  object-fit: cover;
}

.staging-detail-image-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

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

.staging-reference-strip img,
.staging-reference-strip span {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f8fafc;
}

.staging-reference-strip img {
  object-fit: cover;
}

.staging-reference-strip span {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.staging-detail-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
}

.staging-detail-info div,
.staging-detail-notes article {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.staging-detail-info span,
.staging-detail-notes span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.staging-detail-info strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.staging-detail-notes {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.staging-detail-notes p {
  margin: 5px 0 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.content-field-wide {
  grid-column: span 3;
}

.content-toggle {
  display: grid;
  min-height: 38px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.content-toggle input {
  position: relative;
  width: 42px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 999px;
  appearance: none;
  background: #edf1f6;
  box-shadow: inset 0 1px 3px rgba(35, 43, 58, 0.08);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.content-toggle input::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(35, 43, 58, 0.18);
  content: "";
  transition: transform 160ms ease;
}

.content-toggle input:checked {
  border-color: rgba(232, 135, 155, 0.42);
  background: var(--gradient-accent);
  box-shadow: 0 6px 16px rgba(232, 135, 155, 0.18);
}

.content-toggle input:checked::after {
  transform: translateX(18px);
}

.content-toggle input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.content-toggle span {
  order: -1;
  font-size: 12px;
  font-weight: 750;
}

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

.mini-card,
.notice-card,
.analytics-card {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(43, 58, 84, 0.09);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, #ffffff, var(--section-neutral));
  box-shadow: 0 10px 24px rgba(35, 43, 58, 0.055);
}

.notice-card {
  border-color: rgba(111, 169, 216, 0.16);
  background: linear-gradient(180deg, #ffffff, var(--section-blue));
}

.analytics-card {
  border-color: rgba(52, 185, 131, 0.16);
  background: linear-gradient(180deg, #ffffff, var(--section-green));
}

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

.mini-card span,
.mini-card small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.import-repair-todo-list {
  gap: 8px;
}

.import-repair-todo {
  border-color: rgba(232, 135, 155, 0.24);
  background: linear-gradient(135deg, #fff8fb, #f7fbff);
  box-shadow: none;
}

.import-repair-todo strong {
  color: #26324a;
}

.import-repair-todo em {
  display: block;
  margin-top: 8px;
  color: #8d3f58;
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
  line-height: 1.5;
}

.import-batch-report {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(244, 114, 182, 0.18);
  border-radius: 8px;
  background: #fff5f8;
}

.import-batch-report span:first-child {
  color: #9d174d;
  font-weight: 850;
}

.import-batch-report em {
  color: #be185d;
  font-size: 12px;
  font-style: normal;
}

.content-sync-card,
.content-history-card {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.content-sync-card strong,
.content-history-card strong,
.acceptance-handoff-card strong {
  font-size: 13px;
}

.content-sync-card span,
.content-history-card span,
.acceptance-handoff-card li {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.project-progress-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.project-progress-column {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: var(--radius-card);
  background: #ffffff;
}

.project-progress-head {
  display: grid;
  gap: 4px;
}

.project-progress-head strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.project-progress-head span {
  color: var(--muted);
  font-size: 11px;
}

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

.project-progress-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 3px 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 8px;
}

.project-progress-item span {
  grid-row: span 2;
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
}

.project-progress-item strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.project-progress-item small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.project-progress-item.is-done {
  border-color: rgba(25, 135, 84, 0.2);
  background: #f6fff9;
}

.project-progress-item.is-done span {
  background: #d9f8e5;
  color: #166534;
}

.project-progress-item.is-blocked {
  border-color: rgba(236, 72, 153, 0.18);
  background: #fff7fb;
}

.project-progress-item.is-blocked span {
  background: #ffe0ef;
  color: #9d174d;
}

.acceptance-handoff-card ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.acceptance-verification-card {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(109, 168, 206, 0.16);
  border-radius: var(--radius-card);
  background: #f7fbff;
}

.acceptance-verification-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.acceptance-verification-head > div {
  display: grid;
  gap: 4px;
}

.acceptance-verification-head strong {
  font-size: 13px;
}

.acceptance-verification-head span {
  color: var(--muted);
  font-size: 11px;
}

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

.acceptance-verification-row {
  display: grid;
  grid-template-columns: 72px minmax(120px, 0.8fr) minmax(0, 1.8fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 8px;
  background: #ffffff;
}

.acceptance-verification-row.is-passed {
  border-color: rgba(25, 135, 84, 0.22);
  background: #f5fff9;
}

.acceptance-verification-row.is-issue {
  border-color: rgba(220, 53, 69, 0.22);
  background: #fff7f8;
}

.acceptance-verification-row.is-blocked {
  border-color: rgba(160, 116, 0, 0.24);
  background: #fffaf0;
}

.acceptance-verification-row span,
.acceptance-verification-row small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.acceptance-verification-row strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.acceptance-verification-row > div:first-of-type {
  display: grid;
  gap: 3px;
}

.acceptance-verification-controls {
  display: grid;
  grid-template-columns: 92px minmax(100px, 0.8fr) minmax(160px, 1.4fr);
  gap: 8px;
}

.acceptance-verification-controls label {
  display: grid;
  gap: 4px;
  margin: 0;
}

.acceptance-verification-controls label span {
  font-size: 10px;
}

.acceptance-verification-controls select,
.acceptance-verification-controls input {
  width: 100%;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
}

.role-preview-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: end;
}

.role-preview-card label {
  margin: 0;
}

.staff-permission-summary {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.staff-permission-summary div,
.staff-permission-summary small {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 8px;
  background: #ffffff;
}

.staff-permission-summary span {
  color: var(--muted);
  font-size: 11px;
}

.staff-permission-summary strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 880;
}

.staff-permission-summary small {
  grid-column: 1 / -1;
  color: #8d3f58;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.5;
  background: #fff8fb;
}

.permission-matrix-card {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(109, 168, 206, 0.18);
  border-radius: var(--radius-card);
  background: #f7fbff;
}

.compact-head {
  margin-bottom: 0;
}

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

.permission-matrix-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.6fr) repeat(4, minmax(72px, 0.7fr));
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 8px;
  background: #ffffff;
}

.permission-matrix-row div,
.permission-matrix-row small {
  min-width: 0;
}

.permission-matrix-row strong,
.permission-matrix-row span,
.permission-matrix-row small {
  display: block;
}

.permission-matrix-row span,
.permission-matrix-row small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.permission-matrix-row strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.permission-matrix-row small {
  grid-column: 1 / -1;
  padding-top: 2px;
}

.deployment-check-grid {
  display: grid;
  gap: 10px;
}

.deployment-summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  background: var(--gradient-soft);
}

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

.deployment-summary-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.deployment-check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: var(--radius-card);
  background: #ffffff;
}

.deployment-check-row span:first-child {
  font-weight: 760;
}

.deployment-check-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.5;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag-list span,
.data-status-chip {
  display: inline-flex;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}

.compact-tags span {
  background: var(--pink-soft);
  color: var(--pink-strong);
}

.data-status-chip {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.customer-type-chip {
  display: inline-flex;
  max-width: 100%;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 10.4px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.customer-type-regular {
  border-color: rgba(104, 117, 138, 0.14);
  background: rgba(246, 248, 251, 0.96);
  color: #5e6a7a;
}

.customer-type-member {
  border-color: rgba(242, 122, 154, 0.35);
  background: linear-gradient(90deg, rgba(255, 234, 242, 0.98), rgba(238, 248, 255, 0.96));
  color: var(--pink-strong);
  box-shadow: 0 6px 14px rgba(242, 122, 154, 0.12);
}

.customer-type-trial {
  border-color: rgba(57, 125, 170, 0.24);
  background: rgba(238, 248, 255, 0.98);
  color: var(--blue-strong);
}

.staging-need-cell {
  display: grid;
  gap: 4px;
  align-items: center;
  justify-items: start;
}

.staging-need-chip {
  display: inline-flex;
  max-width: 100%;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.staging-need-yes {
  border-color: rgba(232, 82, 126, 0.42);
  background: linear-gradient(90deg, #ff4f87, #74b8e8);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(232, 82, 126, 0.18);
}

.staging-need-no {
  border-color: rgba(116, 129, 148, 0.14);
  background: rgba(246, 248, 251, 0.95);
  color: #7a8798;
  font-weight: 800;
}

.staging-need-detail {
  max-width: 100%;
  color: #9d174d;
  font-weight: 760;
}

.orders-panel tbody tr.customer-member-row td {
  background: #ffffff;
}

.orders-panel tbody tr.customer-member-row:hover td,
.orders-panel tbody tr.customer-member-row.selected td {
  background: #ffffff;
}

.orders-panel .tag-list {
  flex-wrap: nowrap;
  overflow: hidden;
}

.orders-panel .tag-list span {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.hidden-file-input {
  position: fixed;
  top: 0;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.analytics-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.analytics-card strong {
  display: block;
  margin-top: 8px;
  color: var(--pink);
  font-size: 24px;
  line-height: 1;
}

.data-toolbar {
  display: grid;
  grid-template-columns: 160px 160px auto auto auto;
  gap: 10px;
  align-items: end;
}

.data-toolbar label {
  min-width: 0;
}

.report-box {
  white-space: pre-line;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

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

.bar-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.bar-row div {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(237, 245, 250, 0.95);
}

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

.split-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: var(--radius-card);
  background: #ffffff;
  color: var(--muted);
}

.split-row strong {
  color: var(--text);
}

.audit-list {
  max-height: 560px;
  overflow: auto;
}

@media (max-width: 1280px) {
  body {
    min-width: 1120px;
    padding: 12px;
  }

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

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

  .filter-bar {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

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

  .search-field {
    grid-column: span 3;
  }

  .detail-panel {
    position: static;
  }

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

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

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

  .import-repair-groups {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .project-progress-board {
    grid-template-columns: minmax(0, 1fr);
  }

  .acceptance-verification-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .acceptance-verification-controls {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .permission-matrix-row > div:first-child,
  .permission-matrix-row small {
    grid-column: 1 / -1;
  }

  .staging-filter-grid,
  .staging-batch-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  .staging-execution-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .staging-image-queue-row {
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: stretch;
  }

  .staging-image-queue-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .staging-execution-filters,
  .staging-execution-summary,
  .staging-image-queue-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .staging-exec-actions {
    justify-content: flex-start;
  }

  .order-detail-dialog .detail-content {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 0.92fr) minmax(0, 0.82fr);
    grid-template-rows: 54px 70px minmax(150px, 1fr) 88px 40px;
    grid-template-areas:
      "hero status status payment"
      "summary summary actions payment"
      "staging staging overview history"
      "customer execution overview timeline"
      "copy copy save readonly";
  }

  .order-detail-dialog .detail-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .detail-status-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .order-detail-dialog .detail-status-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .staging-section {
    min-height: auto;
  }

  .staging-order-tools {
    grid-template-columns: minmax(0, 1fr);
  }

  .staging-order-tools label:nth-child(2) {
    grid-row: auto;
  }

  .staging-reference-preview-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .staging-detail-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .staging-detail-images {
    grid-template-columns: minmax(320px, 0.6fr) minmax(0, 0.4fr);
  }

  .staging-reference-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
  }

}

/* Final order detail cockpit override. Kept last so older responsive rules cannot break it. */
.order-detail-dialog {
  width: min(1240px, calc(100vw - 28px));
  height: min(720px, calc(100vh - 28px));
  max-height: none;
}

.order-detail-dialog-frame {
  height: 100%;
  max-height: none;
}

.order-detail-dialog-body {
  overflow: hidden;
  padding: 9px;
}

.order-detail-dialog .detail-content {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr) minmax(280px, 0.82fr);
  grid-template-rows: 54px 118px 118px minmax(82px, 1fr) 38px;
  grid-template-areas:
    "status status actions"
    "confirm payment actions"
    "customer staging overview"
    "execution staging history"
    "copy timeline save";
  gap: 7px;
}

.order-detail-dialog .detail-head {
  display: none;
}

.order-detail-dialog .detail-status-strip { grid-area: status; }
.order-detail-dialog .order-confirm-section { grid-area: confirm; }
.order-detail-dialog .payment-section { grid-area: payment; }
.order-detail-dialog .staging-section { grid-area: staging; }
.order-detail-dialog .customer-note-section { grid-area: customer; }
.order-detail-dialog .execution-note-section { grid-area: execution; }
.order-detail-dialog .order-detail-overview-section { grid-area: overview; }
.order-detail-dialog .customer-history-section { grid-area: history; }
.order-detail-dialog .copy-section { grid-area: copy; }
.order-detail-dialog .timeline-section { grid-area: timeline; }
.order-detail-dialog .action-grid { grid-area: actions; }
.order-detail-dialog #saveOrderEdits,
.order-detail-dialog #detailReadonlyNotice { grid-area: save; }

.order-detail-dialog .detail-section,
.order-detail-dialog .action-grid {
  gap: 5px;
  padding: 7px 8px 7px 10px;
  border-radius: 7px;
  box-shadow: none;
}

.order-detail-dialog .detail-section-head {
  min-height: 20px;
  padding-bottom: 4px;
  gap: 8px;
}

.order-detail-dialog .detail-section h3 {
  font-size: 12px;
  line-height: 1.15;
}

.order-detail-dialog .detail-section-head > span {
  font-size: 10px;
  line-height: 1.2;
}

.order-detail-dialog .detail-status-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.order-detail-dialog .detail-status-step {
  gap: 1px;
  padding: 7px 8px 5px;
  border-radius: 7px;
}

.order-detail-dialog .detail-status-step strong,
.order-detail-dialog .detail-status-step em {
  white-space: normal;
}

.order-detail-dialog .detail-status-step strong {
  font-size: 11px;
}

.order-detail-dialog .detail-status-step em {
  font-size: 10px;
}

.order-detail-dialog .detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.order-detail-dialog .detail-grid > div,
.order-detail-dialog .order-detail-fact,
.order-detail-dialog .customer-history-grid div,
.order-detail-dialog .customer-history-item {
  padding: 5px 6px;
  border-radius: 6px;
}

.order-detail-dialog .detail-grid span,
.order-detail-dialog .order-detail-fact span,
.order-detail-dialog label span,
.order-detail-dialog .customer-history-grid span,
.order-detail-dialog .customer-history-item span {
  font-size: 10px;
  line-height: 1.2;
}

.order-detail-dialog .detail-grid strong,
.order-detail-dialog .order-detail-fact strong,
.order-detail-dialog .customer-history-grid strong,
.order-detail-dialog .customer-history-item strong {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.22;
}

.order-detail-dialog input,
.order-detail-dialog select {
  height: 28px;
  padding: 0 7px;
  border-radius: 7px;
  font-size: 12px;
}

.order-detail-dialog textarea {
  min-height: 0;
  padding: 6px 7px;
  resize: none;
  border-radius: 7px;
  font-size: 11.5px;
  line-height: 1.3;
}

.order-detail-dialog .payment-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.order-detail-dialog .payment-section p {
  margin: 0;
  font-size: 10px;
  line-height: 1.25;
}

.order-detail-dialog .staging-order-tools {
  grid-template-columns: minmax(0, 1fr) minmax(88px, 0.6fr);
  gap: 5px;
  padding: 6px;
  border-radius: 6px;
}

.order-detail-dialog .staging-scene-summary {
  min-height: 24px;
  padding: 5px 6px;
  font-size: 10px;
  line-height: 1.25;
}

.order-detail-dialog .staging-reference-preview {
  gap: 4px;
  padding: 5px;
  border-radius: 6px;
}

.order-detail-dialog .staging-reference-preview-head strong,
.order-detail-dialog .staging-reference-preview-head span {
  font-size: 10px;
}

.order-detail-dialog .staging-reference-preview-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.order-detail-dialog .staging-reference-preview-strip img,
.order-detail-dialog .staging-reference-empty {
  min-height: 26px;
  border-radius: 5px;
}

.order-detail-dialog .staging-reference-empty {
  padding: 4px 6px;
  font-size: 10px;
  line-height: 1.2;
}

.order-detail-dialog .staging-section textarea {
  min-height: 48px;
}

.order-detail-dialog .customer-note-section textarea,
.order-detail-dialog .execution-note-section textarea {
  min-height: 48px;
}

.order-detail-dialog .staging-library-picker {
  padding: 4px 6px;
  border-radius: 6px;
}

.order-detail-dialog .staging-library-picker summary {
  font-size: 10px;
}

.order-detail-dialog .staging-library-picker select[multiple],
.order-detail-dialog .staging-order-actions {
  display: none;
}

.order-detail-dialog .action-grid {
  align-content: start;
  grid-template-columns: 1fr;
}

.order-detail-dialog .action-grid button,
.order-detail-dialog .copy-tools button,
.order-detail-dialog #saveOrderEdits {
  min-height: 29px;
  padding: 4px 8px;
  font-size: 11px;
}

.order-detail-dialog .order-detail-fact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.order-detail-dialog .order-detail-secondary {
  padding-top: 4px;
}

.order-detail-dialog .order-detail-secondary summary {
  font-size: 10px;
}

.order-detail-dialog .customer-history-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.order-detail-dialog .customer-history-list,
.order-detail-dialog .timeline {
  gap: 4px;
}

.order-detail-dialog .customer-history-item:nth-child(n+2) {
  display: none;
}

.order-detail-dialog .copy-tools {
  grid-template-columns: 1fr minmax(90px, 0.75fr) 1fr;
  gap: 5px;
}

.order-detail-dialog .timeline li {
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 10px;
  line-height: 1.25;
}

.order-detail-dialog .timeline strong {
  font-size: 10.5px;
}

.order-detail-dialog #saveOrderEdits {
  align-self: stretch;
  width: 100%;
}

/* Final responsive fit override: keep operational tables visible before navigation. */
@media (max-width: 1280px) {
  body {
    min-width: 0;
    padding: 6px;
  }

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

  .sidebar {
    gap: 6px;
    padding: 7px;
  }

  .brand {
    justify-content: center;
    padding: 6px 4px;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
  }

  .brand > div:not(.brand-mark),
  .nav-item small,
  .sidebar-note {
    display: none;
  }

  .nav-list,
  .nav-sublist,
  .nav-group {
    gap: 4px;
  }

  .nav-group summary {
    min-height: 22px;
    justify-content: center;
    padding: 0 3px;
    font-size: 10px;
    text-align: center;
  }

  .nav-group summary::after {
    display: none;
  }

  .nav-item,
  .nav-subitem {
    min-height: 29px;
    margin-left: 0;
    padding: 0 4px;
    border-left: 0;
    justify-items: center;
    text-align: center;
    font-size: 11px;
    line-height: 1.15;
  }

  .table-wrap,
  .workbench-table-wrap,
  .schedule-table-wrap,
  .staging-gallery-table-wrap {
    overflow-x: hidden;
  }

  table,
  .orders-panel table,
  .schedule-table,
  .staging-gallery-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
  }

  th,
  td,
  .orders-panel th,
  .orders-panel td {
    width: auto;
    padding: 4px 3px;
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
    font-size: 9.5px;
    line-height: 1.22;
  }

  #ordersWorkspace .order-grid-cell[data-order-column="unitPrice"],
  #ordersWorkspace .order-grid-cell[data-order-column="duration"],
  #ordersWorkspace .order-grid-cell[data-order-column="stagingFee"],
  #ordersWorkspace .order-grid-cell[data-order-column="extraPaid"],
  #ordersWorkspace .order-grid-cell[data-order-column="overtimeFee"],
  #ordersWorkspace .order-grid-cell[data-order-column="deposit"],
  #ordersWorkspace .order-grid-cell[data-order-column="finalPayment"],
  #ordersWorkspace .order-grid-cell[data-order-column="total"],
  #ordersWorkspace .order-grid-cell[data-order-column="finalDue"],
  #ordersWorkspace .order-grid-cell[data-order-column="damageFee"],
  #ordersWorkspace .order-grid-cell[data-order-column="headcount"],
  #ordersWorkspace .order-grid-cell[data-order-column="status"],
  #ordersWorkspace .order-grid-cell[data-order-column="customerType"],
  .workbench-grid-cell[data-order-column="unitPrice"],
  .workbench-grid-cell[data-order-column="duration"],
  .workbench-grid-cell[data-order-column="stagingFee"],
  .workbench-grid-cell[data-order-column="extraPaid"],
  .workbench-grid-cell[data-order-column="overtimeFee"],
  .workbench-grid-cell[data-order-column="deposit"],
  .workbench-grid-cell[data-order-column="finalPayment"],
  .workbench-grid-cell[data-order-column="total"],
  .workbench-grid-cell[data-order-column="finalDue"],
  .workbench-grid-cell[data-order-column="damageFee"],
  .workbench-grid-cell[data-order-column="headcount"],
  .workbench-grid-cell[data-order-column="status"],
  .workbench-grid-cell[data-order-column="customerType"] {
    overflow: hidden;
    overflow-wrap: normal;
    text-align: center;
    text-overflow: clip;
    white-space: nowrap;
    word-break: keep-all;
  }

  #ordersWorkspace .order-grid-cell[data-order-column="duration"] .cell-main,
  #ordersWorkspace .order-grid-cell[data-order-column="duration"] .cell-sub,
  .workbench-grid-cell[data-order-column="duration"] .cell-main,
  .workbench-grid-cell[data-order-column="duration"] .cell-sub {
    white-space: nowrap;
    word-break: keep-all;
  }

  .status-chip,
  .customer-type-chip,
  .schedule-state-chip,
  .data-status-chip {
    min-height: 18px;
    padding: 2px 4px;
    font-size: 9.5px;
    white-space: nowrap;
  }
}

@media (max-width: 1040px) {
  body {
    padding: 4px;
  }

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

  .sidebar {
    padding: 4px;
  }

  .nav-group summary {
    font-size: 9px;
  }

  .nav-item,
  .nav-subitem {
    min-height: 28px;
    padding: 0 2px;
    font-size: 10px;
  }

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

  th,
  td,
  .orders-panel th,
  .orders-panel td {
    padding: 3px 2px;
    font-size: 8.8px;
    line-height: 1.18;
  }
}

/* Final small-screen navigation drawer: keep tables wide on laptop screens. */
.sidebar-toggle,
.sidebar-hover-zone {
  display: none;
}

@media (max-width: 1600px) {
  body {
    min-width: 0;
    padding-left: 8px;
  }

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

  .main {
    grid-column: 1;
    min-width: 0;
  }

  .topbar {
    justify-content: flex-start;
    gap: 10px;
    z-index: 80;
  }

  .topbar > div:first-of-type {
    min-width: 0;
  }

  .top-actions {
    margin-left: auto;
  }

  .sidebar {
    position: fixed;
    top: 92px;
    bottom: 10px;
    left: 10px;
    z-index: 60;
    width: 220px;
    max-width: min(72vw, 240px);
    padding: 10px;
    transform: translateX(calc(-100% - 18px));
    transition: transform 0.09s ease-out, box-shadow 0.12s ease-out;
    box-shadow: 18px 0 40px rgba(18, 33, 54, 0);
    --sidebar-follow-y: 0px;
    --sidebar-follow-h: 0px;
  }

  .sidebar-follow-indicator {
    position: absolute;
    left: 7px;
    right: 7px;
    top: 0;
    z-index: 0;
    height: var(--sidebar-follow-h);
    border: 1px solid rgba(232, 135, 155, 0.22);
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(255, 241, 246, 0.96), rgba(238, 248, 255, 0.78));
    box-shadow: inset 3px 0 0 rgba(232, 135, 155, 0.62), 0 8px 18px rgba(45, 62, 90, 0.08);
    opacity: 0;
    pointer-events: none;
    transform: translateY(var(--sidebar-follow-y));
    transition: transform 0.18s ease, height 0.18s ease, opacity 0.14s ease;
  }

  .sidebar.has-follow-indicator .sidebar-follow-indicator {
    opacity: 1;
  }

  .sidebar .brand {
    display: none;
  }

  .sidebar .nav-item small,
  .sidebar .sidebar-note {
    display: block;
  }

  .sidebar .nav-group summary {
    min-height: 26px;
    justify-content: space-between;
    padding: 0 8px;
    font-size: 11px;
    text-align: left;
  }

  .sidebar .nav-group summary::after {
    display: block;
  }

  .sidebar .nav-item,
  .sidebar .nav-subitem {
    position: relative;
    z-index: 1;
    min-height: 34px;
    justify-items: start;
    padding: 0 10px;
    text-align: left;
    font-size: 12px;
    line-height: 1.2;
    transition: color 0.14s ease, transform 0.14s ease;
  }

  .sidebar .nav-item:hover {
    transform: translateX(2px);
  }

  .sidebar .nav-item.active,
  .sidebar .nav-item:hover {
    background: transparent;
    box-shadow: none;
  }

  .sidebar .nav-subitem {
    padding-left: 16px;
    border-left: 2px solid rgba(232, 135, 155, 0.18);
  }

  .sidebar .sidebar-note {
    padding: 9px;
  }

  body.is-sidebar-open .sidebar,
  body.is-sidebar-pinned .sidebar {
    transform: translateX(0);
    box-shadow: 18px 0 40px rgba(18, 33, 54, 0.18);
  }

  .sidebar-toggle {
    position: static;
    z-index: 82;
    display: inline-flex;
    flex: 0 0 auto;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid rgba(57, 125, 170, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    color: #2d5f86;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.08);
    cursor: pointer;
  }

  .sidebar-hover-zone {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 59;
    display: block;
    width: 34px;
    cursor: default;
    touch-action: pan-y;
  }
}

@media (max-width: 1040px) {
  .sidebar {
    width: 204px;
  }

}

/* Final drawer and order-page recovery: keep the menu usable after page scroll and never clip order content. */
@media (max-width: 1600px) {
  .sidebar {
    top: var(--sidebar-viewport-top, 12px);
    bottom: auto;
    display: flex;
    height: calc(100vh - var(--sidebar-visible-top, 12px) - 12px);
    height: calc(100dvh - var(--sidebar-visible-top, 12px) - 12px);
    max-height: calc(100vh - var(--sidebar-visible-top, 12px) - 12px);
    max-height: calc(100dvh - var(--sidebar-visible-top, 12px) - 12px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-padding-top: 8px;
  }

  .sidebar .nav-list {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    width: 100%;
  }

  .sidebar .sidebar-note {
    flex: 0 0 auto;
    margin-top: 8px;
  }

  .sidebar-follow-indicator {
    left: 8px;
    right: 8px;
  }

  #ordersWorkspace,
  #ordersWorkspace .orders-panel,
  #ordersWorkspace .import-preview-panel,
  #ordersWorkspace .service-consult-panel,
  #ordersWorkspace .order-column-panel {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  #ordersWorkspace .orders-panel {
    position: relative;
    display: block;
  }

  #ordersWorkspace .orders-panel::before {
    z-index: 0;
    pointer-events: none;
  }

  #ordersWorkspace .orders-panel > * {
    position: relative;
    z-index: 1;
  }

  #ordersWorkspace .filter-bar {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  }

  #ordersWorkspace .filter-bar .search-field {
    grid-column: span 2;
  }

  #ordersWorkspace .panel-head,
  #ordersWorkspace .filter-bar,
  #ordersWorkspace .table-status-row {
    position: relative;
    z-index: 1;
  }

  #ordersWorkspace .table-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    border-radius: 0 0 8px 8px;
  }

  #ordersWorkspace .orders-panel table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
  }

  #ordersWorkspace .orders-panel th,
  #ordersWorkspace .orders-panel td {
    width: auto !important;
    min-width: 0;
    overflow: visible;
    overflow-wrap: normal;
    text-overflow: clip;
    white-space: nowrap;
    word-break: keep-all;
  }

  #ordersWorkspace .order-grid-cell[data-order-column="customerRemark"],
  #ordersWorkspace .order-grid-cell[data-order-column="executionRemark"],
  #ordersWorkspace .order-grid-cell[data-order-column="stagingRequirement"],
  #ordersWorkspace .order-grid-cell[data-order-column="nextStep"] {
    min-width: 180px;
    max-width: 300px;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: normal;
  }

  #ordersWorkspace .order-grid-cell[data-order-column="date"],
  #ordersWorkspace .order-grid-cell[data-order-column="time"],
  #ordersWorkspace .order-grid-cell[data-order-column="status"] {
    min-width: 112px;
  }
}

/* Global viewport scale: keep the full admin surface visible on smaller desktop screens. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-width: 0;
  --admin-page-scale: 1;
}

.main {
  transform-origin: top left;
}

@media (min-width: 721px) and (max-width: 1360px) {
  .main {
    width: 1360px;
    max-width: none;
    zoom: var(--admin-page-scale);
  }
}

@media (min-width: 721px) and (max-width: 1360px) {
  body {
    --admin-page-scale: 0.94;
  }
}

@media (min-width: 721px) and (max-width: 1280px) {
  body {
    --admin-page-scale: 0.9;
  }
}

@media (min-width: 721px) and (max-width: 1180px) {
  body {
    --admin-page-scale: 0.84;
  }
}

@media (min-width: 721px) and (max-width: 1040px) {
  body {
    --admin-page-scale: 0.74;
  }
}

@media (min-width: 721px) and (max-width: 900px) {
  body {
    --admin-page-scale: 0.64;
  }
}

@media (min-width: 761px) and (max-width: 820px) {
  body {
    --admin-page-scale: 0.54;
  }
}

@media (min-width: 721px) and (max-width: 760px) {
  body {
    --admin-page-scale: 0.5;
  }
}
