:root {
  color-scheme: dark;
  --bg-1: #101820;
  --bg-2: #151a1f;
  --bg-3: #07090d;
  --card: rgba(26, 29, 34, 0.78);
  --card-strong: rgba(36, 39, 45, 0.88);
  --line: rgba(216, 220, 226, 0.15);
  --text: #f4f7fb;
  --ink: #f4f7fb;
  --muted: #c6cbd3;
  --accent: #d3aa58;
  --accent-strong: #a97a30;
  --accent-soft: rgba(211, 170, 88, 0.15);
  --good: #77e7be;
  --good-soft: rgba(119, 231, 190, 0.12);
  --warn: #f0ca70;
  --warn-soft: rgba(240, 202, 112, 0.14);
  --bad: #ef927e;
  --bad-soft: rgba(239, 146, 126, 0.13);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 17px;
  --radius-sm: 12px;
  --shadow: 0 30px 90px -42px rgba(0, 0, 0, 0.92);
  --metal-top: rgba(255, 255, 255, 0.26);
  --metal-low: rgba(122, 134, 148, 0.18);
}

body {
  position: relative;
  isolation: isolate;
  color: var(--text);
  background:
    radial-gradient(circle at 18% -8%, rgba(211, 170, 88, 0.16), transparent 28%),
    radial-gradient(circle at 86% 6%, rgba(112, 129, 148, 0.18), transparent 32%),
    linear-gradient(135deg, #3e434a 0%, #262b31 38%, #171b21 67%, #0a0c10 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 78%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 22%),
    linear-gradient(120deg, transparent 0%, rgba(211, 170, 88, 0.08) 42%, transparent 58%);
  mix-blend-mode: screen;
  opacity: 0.68;
}

.layout,
.content {
  background: transparent;
}

.content {
  padding: 24px 26px 32px;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(32, 36, 42, 0.91), rgba(12, 15, 19, 0.95)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 32%);
  border-right: 1px solid rgba(216, 220, 226, 0.14);
  box-shadow:
    inset -1px 0 0 rgba(255, 255, 255, 0.05),
    20px 0 60px -42px rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  gap: 12px;
}

.logo {
  width: min(218px, 100%);
  padding: 13px;
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.025)),
    rgba(10, 12, 16, 0.42);
  border: 1px solid rgba(216, 220, 226, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    0 18px 42px rgba(0, 0, 0, 0.24);
}

.logo img {
  filter: saturate(1.08) contrast(1.08) drop-shadow(0 12px 22px rgba(0, 0, 0, 0.36));
}

.eyebrow,
.content .eyebrow {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand h1,
.topbar h2,
.home-title h3 {
  color: var(--text);
  letter-spacing: 0;
}

.brand h1 {
  background: linear-gradient(90deg, #ffffff 0%, #ead59d 48%, #d3aa58 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.muted,
.bullet-list,
.quote-price-block span,
.quote-component span,
.quote-price-block small,
.quote-component small,
.machining-operation-row span,
.machining-baseline-review-row label,
.machining-baseline-metrics span,
.machining-baseline-metrics small,
.machining-baseline-stat-grid span,
.machining-baseline-stat-grid small,
.machining-baseline-compare span,
.machining-baseline-compare small,
.baseline-gate-list span,
.operation-reference-head span,
.operation-reference-candidates span,
.operation-reference-candidates small,
.quote-history-metrics span,
.quote-band-list span,
.form-grid label,
.login-form label,
.compact-form label {
  color: var(--muted);
}

.nav-button {
  padding: 13px 16px;
  border-radius: 999px;
  border: 1px solid rgba(216, 220, 226, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(12, 14, 18, 0.2);
  color: rgba(244, 247, 251, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.nav-button.active,
.nav-button:hover,
.nav-button:focus-visible {
  color: #15130e;
  background: linear-gradient(180deg, #f0d98b 0%, #d3aa58 48%, #a97a30 100%);
  border-color: rgba(255, 230, 162, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.56),
    0 18px 36px rgba(211, 170, 88, 0.18);
}

.topbar,
.login-panel,
.sidebar-card,
.hero,
.card,
.metric,
.stack-item,
.report-block,
.summary,
.alert-banner,
.quote-missing-fields,
.quote-price-block,
.quote-component,
.machining-operation-row,
.machining-baseline-review-row,
.machining-baseline-action-panel,
.machining-baseline-compare > div,
.baseline-gate-list li,
.operation-reference-row,
.operation-reference-candidates > div,
.quote-history-metrics div,
.process-hero-card,
.process-signal-card,
.process-zone-card,
.process-flow-indicator,
.process-plan-card,
.report.empty,
.toast {
  color: var(--text);
  border: 1px solid rgba(216, 220, 226, 0.13);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(22, 25, 30, 0.76);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    var(--shadow);
  backdrop-filter: blur(16px);
}

.topbar {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.sidebar-card {
  border-color: rgba(216, 220, 226, 0.11);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(14, 17, 21, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hero,
.card {
  overflow: hidden;
}

.hero::before,
.card::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
}

.home-action {
  color: var(--text);
  border-color: rgba(216, 220, 226, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)),
    rgba(23, 26, 31, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 20px 46px rgba(0, 0, 0, 0.3);
}

.home-action:hover,
.home-action:focus-visible {
  border-color: rgba(211, 170, 88, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 24px 48px rgba(211, 170, 88, 0.12);
}

.home-action small {
  color: var(--muted);
}

.home-action-primary {
  background:
    linear-gradient(180deg, rgba(240, 217, 139, 0.16), rgba(211, 170, 88, 0.055)),
    rgba(24, 27, 32, 0.84);
  border-color: rgba(211, 170, 88, 0.28);
}

.metric strong,
.metric-value,
.quote-price-block strong,
.machining-baseline-compare strong,
.machining-baseline-metrics strong,
.machining-baseline-stat-grid strong {
  color: #fff8df;
}

.primary-button {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 230, 162, 0.42);
  background: linear-gradient(180deg, #f0d98b 0%, #d3aa58 47%, #a97a30 100%);
  color: #15130e;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 18px 34px rgba(211, 170, 88, 0.22);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
}

.secondary-button,
.ghost-button,
.backend-details > summary {
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(216, 220, 226, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.03)),
    rgba(12, 14, 18, 0.44);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 14px 30px rgba(0, 0, 0, 0.22);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.backend-details > summary:hover {
  transform: translateY(-1px);
}

button:disabled,
.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.link-button {
  color: #f1d58e;
  text-decoration-color: rgba(211, 170, 88, 0.48);
}

.link-button:hover {
  color: #ffffff;
  text-decoration-color: rgba(255, 238, 188, 0.9);
}

.form-grid input,
.form-grid textarea,
.form-grid select,
.login-form input,
.compact-form input,
.compact-form textarea,
.compact-form select,
.sidebar select,
input,
textarea,
select {
  border: 1px solid rgba(216, 220, 226, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(9, 11, 15, 0.62);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

input::placeholder,
textarea::placeholder {
  color: rgba(198, 203, 211, 0.58);
}

select option {
  background: #151a1f;
  color: var(--text);
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible,
.nav-button:focus-visible,
.home-action:focus-visible {
  outline: 2px solid rgba(211, 170, 88, 0.52);
  outline-offset: 2px;
}

.pill {
  border: 1px solid rgba(216, 220, 226, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)),
    rgba(18, 21, 26, 0.62);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.pill.good,
.alert-success .alert-chip,
.baseline-gate-list li.passed {
  border-color: rgba(119, 231, 190, 0.3);
  background: var(--good-soft);
  color: var(--good);
}

.pill.warn,
.alert-warning .alert-chip,
.baseline-gate-list li.blocked {
  border-color: rgba(240, 202, 112, 0.34);
  background: var(--warn-soft);
  color: var(--warn);
}

.pill.bad,
.pill.danger,
.alert-danger .alert-chip {
  border-color: rgba(239, 146, 126, 0.34);
  background: var(--bad-soft);
  color: var(--bad);
}

.tag,
.alert-chip {
  border: 1px solid rgba(211, 170, 88, 0.22);
  background: rgba(211, 170, 88, 0.12);
  color: #f0d98b;
}

.alert-banner-summary,
.alert-banner-detail,
.alert-banner-action,
.alert-banner-meta {
  color: var(--text);
}

.alert-banner-meta {
  color: var(--muted);
}

.alert-success,
.alert-warning,
.alert-danger,
.alert-info,
.quote-status.good,
.quote-status.warn,
.quote-status.bad,
.settlement-hint-success,
.settlement-hint-warning,
.settlement-hint-danger,
.process-zone-risk,
.process-zone-safe,
.process-plan-card-highlight {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(22, 25, 30, 0.76);
}

.alert-success,
.settlement-hint-success,
.quote-status.good,
.process-zone-safe,
.closed-loop-sample-quote {
  border-left-color: rgba(119, 231, 190, 0.64);
}

.alert-warning,
.settlement-hint-warning,
.quote-status.warn,
.process-zone-risk,
.closed-loop-sample-photo {
  border-left-color: rgba(240, 202, 112, 0.64);
}

.alert-danger,
.settlement-hint-danger,
.quote-status.bad {
  border-left-color: rgba(239, 146, 126, 0.64);
}

.closed-loop-sample-process,
.process-writeback-task {
  border-left-color: rgba(132, 178, 245, 0.6);
}

.quote-writeback-task {
  border-left-color: rgba(119, 231, 190, 0.64);
}

.machining-baseline-metrics > div,
.machining-baseline-stat-grid > div,
.operation-reference-candidates > div,
.machining-baseline-compare > div,
.baseline-gate-list li,
.quote-history-metrics div {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.json-preview {
  background: rgba(4, 6, 9, 0.72);
  color: #e9eef6;
  border-color: rgba(216, 220, 226, 0.12);
}

.process-zone-bar {
  background: rgba(255, 255, 255, 0.1);
}

.process-zone-fill-risk {
  background: linear-gradient(90deg, #ef927e, #d3aa58);
}

.process-zone-fill-safe {
  background: linear-gradient(90deg, #77e7be, #d3aa58);
}

.toast {
  background:
    linear-gradient(180deg, rgba(240, 217, 139, 0.16), rgba(255, 255, 255, 0.035)),
    rgba(17, 20, 25, 0.92);
  border-color: rgba(211, 170, 88, 0.28);
  color: var(--text);
}

@media (max-width: 1200px) {
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(216, 220, 226, 0.14);
  }
}

@media (max-width: 900px) {
  .content {
    padding: 18px 16px 24px;
  }

  .topbar {
    padding: 16px;
  }

  .sidebar {
    padding: 18px 16px;
  }
}

/* Marketing-style layout preview: top navigation, centered sections, tighter work cards. */
.layout {
  display: block;
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: grid;
  gap: 12px;
  padding: 12px clamp(18px, 4vw, 64px);
  border-right: 0;
  border-bottom: 1px solid rgba(216, 220, 226, 0.14);
  background:
    linear-gradient(180deg, rgba(24, 26, 30, 0.94), rgba(10, 12, 15, 0.9)),
    rgba(10, 12, 15, 0.9);
  box-shadow: 0 18px 42px -34px rgba(0, 0, 0, 0.86);
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  min-width: 0;
}

.sidebar .logo {
  width: clamp(98px, 22vw, 132px);
  flex: 0 0 auto;
  padding: 9px 11px;
  border-radius: 18px;
}

.sidebar .brand > div:last-child {
  min-width: 0;
}

.sidebar .brand h1 {
  font-size: clamp(21px, 1.9vw, 28px);
  line-height: 1.08;
  white-space: nowrap;
}

.sidebar .brand .eyebrow {
  margin-bottom: 4px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.sidebar .brand .muted {
  margin: 6px 0 0;
  max-width: 240px;
  font-size: 12px;
  line-height: 1.35;
}

.nav {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 2px 0 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 11px;
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
  scroll-snap-align: start;
}

.sidebar-card:not(.actor-card) {
  display: none !important;
}

.actor-card {
  margin: 0;
  padding: 10px 12px;
  border-radius: 20px;
  gap: 6px;
}

.actor-card .eyebrow,
#actor-permission-list {
  display: none !important;
}

.actor-card label {
  gap: 5px;
  font-size: 12px;
}

.actor-card select {
  min-height: 38px;
  padding: 8px 10px;
}

#actor-role-summary {
  display: none !important;
  margin: 0;
  max-height: 2.8em;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.35;
}

.content {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 30px clamp(18px, 4vw, 64px) 56px;
}

.topbar {
  margin-bottom: 20px;
  padding: 14px 18px;
  border-radius: 24px;
}

.topbar h2 {
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.15;
}

.topbar-status {
  align-content: center;
}

.status-text {
  max-width: 620px;
}

.page.active {
  gap: 22px;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 4px 0 18px;
}

.page-head h2 {
  margin: 0;
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1.05;
}

.grid.two,
.report-grid,
.quote-workspace,
.process-plan-compare,
.closed-loop-sample-grid {
  align-items: start;
}

.grid.two > *,
.report-grid > *,
.quote-workspace > *,
.process-plan-compare > *,
.closed-loop-sample-grid > * {
  min-width: 0;
}

.card,
.hero,
.stack-item,
.report-block {
  border-radius: 24px;
}

.card {
  padding: 20px;
}

.card-head {
  margin-bottom: 14px;
}

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

.order-work-refresh-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

.order-work-refresh-status {
  min-height: 16px;
  max-width: 260px;
  text-align: right;
  line-height: 1.35;
}

.order-work-refresh-status[data-tone="good"] {
  color: #2f6f4f;
}

.order-work-refresh-status[data-tone="bad"] {
  color: #a43d3d;
}

.page[data-page="machining"] > .grid.two {
  grid-template-columns: minmax(500px, 1.18fr) minmax(360px, 0.82fr);
  gap: 22px;
  align-items: start;
}

.page[data-page="machining"] > .grid.two > .card {
  align-self: start;
}

#machining-quote-result:empty {
  display: none;
}

.page[data-page="machining"] .form-grid {
  gap: 12px 14px;
}

.page[data-page="machining"] .form-grid input,
.page[data-page="machining"] .form-grid textarea,
.page[data-page="machining"] .form-grid select {
  padding: 10px 12px;
}

.home-workbench {
  padding-top: 0;
}

.home-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-action {
  min-height: 96px;
  padding: 16px;
}

body[data-current-page="dashboard"] .content {
  padding-top: 20px;
}

body[data-current-page="dashboard"] .topbar {
  margin-bottom: 14px;
}

.page[data-page="dashboard"].active {
  gap: 16px;
}

.page[data-page="dashboard"] .home-workbench {
  position: relative;
  overflow: hidden;
  grid-template-columns: minmax(286px, 380px) minmax(0, 1fr);
  align-items: stretch;
  gap: 18px;
  padding: 20px;
  border-radius: 28px;
  border: 1px solid rgba(216, 220, 226, 0.13);
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.07), transparent 24%, transparent 70%, rgba(211, 170, 88, 0.1)),
    linear-gradient(180deg, rgba(23, 27, 33, 0.88), rgba(17, 21, 26, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    var(--shadow);
}

.page[data-page="dashboard"] .home-workbench::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.26;
}

.page[data-page="dashboard"] .home-title,
.page[data-page="dashboard"] .home-actions {
  position: relative;
  z-index: 1;
}

.page[data-page="dashboard"] .home-title {
  display: grid;
  min-height: 100%;
  padding: 22px 20px;
  align-content: start;
  border-radius: 24px;
  border: 1px solid rgba(216, 220, 226, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.03)),
    rgba(12, 15, 18, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.page[data-page="dashboard"] .home-title h3 {
  max-width: none;
  font-size: clamp(30px, 3.3vw, 46px);
  line-height: 1.04;
}

.page[data-page="dashboard"] .home-title-action {
  grid-column: auto;
  width: 100%;
  min-height: 112px;
  margin-top: 18px;
  padding: 18px;
  justify-content: flex-start;
  text-align: left;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 22px 46px rgba(211, 170, 88, 0.18);
}

.page[data-page="dashboard"] .home-title-action span {
  font-size: clamp(22px, 2vw, 30px);
}

.page[data-page="dashboard"] .home-title-action small {
  font-size: 13px;
}

.home-title-metrics {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.home-title-metrics span {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(238, 210, 151, 0.16);
  background: rgba(255, 255, 255, 0.045);
}

.home-title-metrics strong {
  color: #fff8df;
  font-size: 16px;
}

.home-title-metrics small {
  color: rgba(223, 229, 235, 0.74);
  line-height: 1.35;
}

.page[data-page="dashboard"] .home-actions {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 12px;
  align-content: start;
}

.page[data-page="dashboard"] .home-action {
  position: relative;
  overflow: hidden;
  min-height: 96px;
  padding: 14px;
  border-radius: 18px;
  color: #172029;
  background:
    linear-gradient(135deg, rgba(255, 247, 226, 0.98), rgba(238, 210, 151, 0.92) 48%, rgba(174, 123, 48, 0.92)),
    #efd297;
  border-color: rgba(244, 214, 143, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 22px 46px rgba(211, 170, 88, 0.18);
}

.page[data-page="dashboard"] .home-action::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 13px;
  width: 34px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(17, 24, 31, 0.72), rgba(187, 58, 48, 0.72));
  opacity: 0.62;
  pointer-events: none;
  transition: width 160ms ease, opacity 160ms ease;
}

.page[data-page="dashboard"] .home-action:hover::after,
.page[data-page="dashboard"] .home-action:focus-visible::after {
  width: 48px;
  opacity: 0.82;
}

.page[data-page="dashboard"] .home-action span {
  color: #172029;
  font-size: clamp(16px, 1.2vw, 20px);
}

.page[data-page="dashboard"] .home-action small {
  color: #59451e;
}

.page[data-page="dashboard"] .home-action-primary {
  min-height: 124px;
  background:
    linear-gradient(135deg, rgba(255, 247, 226, 0.98), rgba(238, 210, 151, 0.92) 48%, rgba(174, 123, 48, 0.92)),
    #efd297;
  border-color: rgba(244, 214, 143, 0.52);
}

.page[data-page="dashboard"] .home-action-primary::after {
  width: 56px;
  height: 5px;
  background: linear-gradient(90deg, rgba(17, 24, 31, 0.72), rgba(187, 58, 48, 0.72));
  opacity: 0.62;
}

.page[data-page="dashboard"] .home-action-primary span {
  color: #11181f;
  font-size: clamp(20px, 1.5vw, 25px);
}

.page[data-page="dashboard"] .home-action-primary small {
  color: #59451e;
}

.page[data-page="dashboard"] .home-actions .home-action-wide {
  grid-column: span 2;
}

.page[data-page="dashboard"] .home-status-panel {
  position: relative;
  z-index: 1;
  grid-template-columns: minmax(150px, 0.2fr) minmax(220px, 1fr) auto;
  margin-top: 2px;
  padding: 12px 14px;
  border-radius: 18px;
  border-color: rgba(216, 220, 226, 0.14);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)),
    rgba(8, 11, 14, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.home-status-current .eyebrow {
  margin: 0;
  color: rgba(223, 229, 235, 0.68);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.home-status-current h2 {
  color: #ffffff;
  font-size: clamp(18px, 1.5vw, 23px);
}

.page[data-page="dashboard"] .home-status-panel .status-text {
  color: rgba(232, 238, 244, 0.78);
  font-size: 13px;
}

.page[data-page="dashboard"] .home-status-actions .pill,
.page[data-page="dashboard"] .home-status-actions .ghost-button {
  min-height: 36px;
  padding: 7px 12px;
  white-space: nowrap;
}

.training-health-strip {
  grid-column: 1 / -1;
}

.order-risk-dashboard {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(245, 185, 92, 0.24);
  border-radius: 8px;
  background: rgba(246, 249, 251, 0.94);
  color: #17212b;
}

.order-risk-head,
.order-risk-card,
.work-evaluation-actions {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.order-risk-head h3 {
  margin: 0;
  color: #1c2732;
  font-size: 22px;
}

.order-risk-dashboard .muted,
.work-evaluation-actions span {
  color: #52606d;
}

.order-risk-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
}

.order-risk-metrics > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(17, 24, 31, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.order-risk-metrics span,
.work-evaluation-actions span {
  font-size: 12px;
}

.order-risk-metrics strong {
  color: #16212b;
  font-size: 24px;
}

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

.order-risk-card {
  padding: 12px;
  border: 1px solid rgba(17, 24, 31, 0.08);
  border-left: 4px solid rgba(31, 122, 77, 0.55);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.order-risk-card.medium {
  border-left-color: rgba(154, 106, 31, 0.68);
}

.order-risk-card.high {
  border-left-color: rgba(154, 50, 40, 0.72);
}

.order-risk-card h4 {
  margin: 8px 0 4px;
  color: #17212b;
}

.order-risk-empty {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(17, 24, 31, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.dashboard-backstage {
  margin-top: 0;
  border: 1px solid rgba(216, 220, 226, 0.13);
  border-radius: 22px;
  background: rgba(17, 21, 26, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.dashboard-backstage[open] {
  display: grid;
  gap: 16px;
  padding-bottom: 16px;
}

.dashboard-backstage > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  color: #eef3f7;
  cursor: pointer;
  list-style: none;
}

.dashboard-backstage > summary::-webkit-details-marker {
  display: none;
}

.dashboard-backstage > summary::after {
  content: "展开";
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(238, 210, 151, 0.24);
  color: #f4d68f;
  font-size: 12px;
}

.dashboard-backstage[open] > summary {
  border-bottom: 1px solid rgba(216, 220, 226, 0.1);
}

.dashboard-backstage[open] > summary::after {
  content: "收起";
}

.dashboard-backstage[open] .backstage-hero,
.dashboard-backstage[open] .grid.two,
.dashboard-backstage[open] > .card {
  margin-inline: 16px;
}

.dashboard-backstage .backstage-hero {
  grid-template-columns: minmax(230px, 0.34fr) minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
}

.dashboard-backstage .backstage-hero h3 {
  font-size: clamp(22px, 1.8vw, 32px);
  line-height: 1.05;
}

.dashboard-backstage .metrics {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.dashboard-backstage .metrics:empty {
  display: none;
}

.dashboard-backstage .backstage-hero:has(.metrics:empty) {
  grid-template-columns: 1fr;
}

.dashboard-backstage .metric {
  min-height: 104px;
  padding: 12px;
  border-radius: 18px;
}

.dashboard-backstage .metric strong {
  margin-top: 2px;
  font-size: clamp(22px, 2vw, 34px);
  color: #fff8df;
}

.dashboard-backstage .metric .muted {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.dashboard-backstage .grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-backstage .card {
  padding: 18px;
}

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

.dashboard-backstage .report-block,
.dashboard-backstage .stack-item {
  min-height: 86px;
  padding: 12px;
}

@media (min-width: 1180px) {
  .sidebar {
    grid-template-columns: minmax(300px, 350px) minmax(0, 1fr) minmax(172px, 204px);
    align-items: center;
    gap: clamp(12px, 1.8vw, 22px);
  }

  .nav {
    flex-wrap: nowrap;
    align-content: center;
    gap: 7px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
  }

  .nav-button {
    min-height: 38px;
    padding: 8px 9px;
    font-size: 11.5px;
  }

  .actor-card {
    justify-self: end;
    width: min(210px, 100%);
    padding: 8px 10px;
  }

  .sidebar .logo {
    width: clamp(112px, 9vw, 132px);
    padding: 9px 11px;
  }

  .sidebar .brand h1 {
    font-size: clamp(23px, 1.8vw, 28px);
  }

  .sidebar .brand .muted {
    max-width: 230px;
  }
}

@supports selector(.card:has(.stack)) {
  .page[data-page="machining"] > .grid.two:has(#machining-quote-result:empty) {
    grid-template-columns: minmax(0, 980px);
    justify-content: start;
  }

  .page[data-page="machining"] > .grid.two > .card:has(#machining-quote-result:empty) {
    display: none;
  }
}

@media (max-width: 1179px) {
  .sidebar {
    grid-template-columns: 1fr;
  }

  .sidebar .brand {
    max-width: 100%;
  }

  .nav {
    flex-wrap: nowrap;
  }

  .actor-card {
    width: min(100%, 520px);
  }

  .page[data-page="dashboard"] .home-workbench {
    grid-template-columns: 1fr;
  }

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

  .page[data-page="dashboard"] .home-actions {
    grid-template-columns: repeat(3, minmax(132px, 1fr));
  }

  .dashboard-backstage .backstage-hero,
  .dashboard-backstage .grid.two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    gap: 9px;
    padding: 10px 14px;
  }

  .sidebar .brand {
    gap: 12px;
  }

  .sidebar .logo {
    width: clamp(92px, 25vw, 112px);
    padding: 7px 9px;
    border-radius: 17px;
  }

  .sidebar .brand h1 {
    font-size: clamp(19px, 4.8vw, 23px);
    white-space: nowrap;
  }

  .sidebar .brand .eyebrow {
    font-size: 9.5px;
  }

  .sidebar .brand .muted {
    display: none;
  }

  .nav {
    margin-inline: -14px;
    padding: 0 14px 5px;
    mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 32px), transparent 100%);
  }

  .nav-button {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .actor-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    padding: 8px 10px;
  }

  .actor-card label {
    display: grid;
    grid-template-columns: auto minmax(126px, 1fr);
    align-items: center;
    gap: 9px;
  }

  .actor-card select {
    width: 100%;
    min-height: 34px;
    padding: 6px 9px;
  }

  #actor-role-summary {
    max-height: 1.35em;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .content {
    padding: 16px 14px 32px;
  }

  .topbar {
    padding: 12px 14px;
  }

  .page-head {
    display: grid;
  }

  .card-head {
    flex-wrap: wrap;
  }

  .order-work-refresh-controls {
    align-items: flex-start;
    width: 100%;
  }

  .order-work-refresh-status {
    max-width: 100%;
    text-align: left;
  }

  .page[data-page="machining"] > .grid.two,
  .home-actions {
    grid-template-columns: 1fr;
  }

  .page[data-page="dashboard"] .home-workbench {
    padding: 16px;
  }

  .page[data-page="dashboard"] .home-title {
    padding: 18px;
  }

  .page[data-page="dashboard"] .home-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page[data-page="dashboard"] .home-status-panel {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .page[data-page="dashboard"] .home-status-panel .status-text {
    text-align: left;
  }

  .home-status-actions {
    justify-content: start;
  }

  .page[data-page="dashboard"] .home-action {
    min-height: 96px;
  }

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

@media (max-width: 560px) {
  .dashboard-backstage .metrics,
  .dashboard-backstage .report-grid {
    grid-template-columns: 1fr;
  }

  .page[data-page="dashboard"] .home-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .page[data-page="dashboard"] .home-action {
    min-height: 84px;
    padding: 12px;
  }

  .page[data-page="dashboard"] .home-action::after {
    right: 12px;
    bottom: 10px;
    width: 26px;
  }

  .page[data-page="dashboard"] .home-action-primary {
    min-height: 102px;
  }

  .page[data-page="dashboard"] .home-title-action {
    min-height: 92px;
    margin-top: 12px;
    padding: 14px;
  }

  .page[data-page="dashboard"] .home-status-panel {
    gap: 9px;
    padding: 11px 12px;
  }

  .page[data-page="dashboard"] .home-status-actions .pill,
  .page[data-page="dashboard"] .home-status-actions .ghost-button {
    min-height: 34px;
    padding: 6px 10px;
  }

  .home-title-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 12px;
  }

  .home-title-metrics span {
    padding: 8px;
    border-radius: 13px;
  }

  .home-title-metrics strong {
    font-size: 14px;
  }

  .home-title-metrics small {
    font-size: 11px;
  }

  .actor-card {
    border-radius: 16px;
  }

  .actor-card label {
    grid-template-columns: auto minmax(140px, 1fr);
    font-size: 12px;
  }

  #actor-role-summary {
    display: none;
  }

  .topbar .eyebrow {
    display: none;
  }

  .topbar h2 {
    font-size: 25px;
  }

  .status-text {
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  .page[data-page="dashboard"] .home-actions {
    grid-template-columns: 1fr;
  }

  .page[data-page="dashboard"] .home-actions .home-action-wide {
    grid-column: span 1;
  }

  .home-title-metrics {
    grid-template-columns: 1fr;
  }
}

/* Department workspace layout: left rail for spaces, header for work items. */
.layout {
  display: grid;
  grid-template-columns: minmax(286px, 340px) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 70;
  display: block;
  height: 100vh;
  min-width: 0;
  overflow-y: auto;
  padding: 18px 16px;
  border-right: 1px solid rgba(216, 220, 226, 0.16);
  border-bottom: 0;
  background:
    linear-gradient(180deg, rgba(32, 37, 42, 0.97), rgba(18, 22, 26, 0.98)),
    rgba(18, 22, 26, 0.98);
}

.sidebar .brand {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.sidebar .logo {
  width: 92px;
  padding: 0;
  border-radius: 0;
}

.sidebar .brand h1 {
  white-space: normal;
  font-size: 22px;
}

.sidebar-card:not(.actor-card) {
  display: grid !important;
}

.actor-card,
.sidebar-card {
  border-radius: 10px;
}

.actor-card .eyebrow {
  display: block !important;
}

#actor-permission-list {
  display: none !important;
}

#actor-role-summary {
  display: block !important;
  max-height: none;
  font-size: 12px;
}

.content {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  padding: 22px clamp(18px, 3.4vw, 48px) 56px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(170px, 230px) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 10px;
}

.topbar-work-nav {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 5px;
  scrollbar-width: thin;
}

.topbar-work-nav .nav-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.18;
  white-space: nowrap;
}

.department-tree {
  display: grid;
  gap: 9px;
}

#admin-entry-button.sidebar-admin-entry {
  width: 100%;
  min-height: 48px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: #eef3f7;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: none;
  cursor: pointer;
}

#admin-entry-button.sidebar-admin-entry > span {
  display: inline-block;
  background: linear-gradient(180deg, #fff8d8 0%, #e8c76a 45%, #b9852c 100%);
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#admin-entry-button.sidebar-admin-entry:hover,
#admin-entry-button.sidebar-admin-entry:focus-visible {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border-color: rgba(187, 58, 48, 0.28);
  outline: 2px solid rgba(211, 170, 88, 0.52);
  outline-offset: 2px;
  box-shadow: none;
}

#admin-entry-button.sidebar-admin-entry.active {
  border-color: rgba(187, 58, 48, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  box-shadow: none;
}

.department-tree-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 4px 2px;
  color: #eef3f7;
}

.department-tree-head strong {
  color: #ffd89a;
  font-size: 13px;
}

.department-node {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.department-node summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 11px;
  cursor: pointer;
  color: #f3f7fa;
  font-weight: 800;
}

.department-node summary small {
  color: rgba(232, 238, 244, 0.66);
  font-size: 11px;
  white-space: nowrap;
}

.department-people {
  display: grid;
  gap: 6px;
  padding: 0 8px 9px;
}

.department-person,
.department-member-chip {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: #f5f8fb;
  text-align: left;
  cursor: pointer;
}

.department-person small {
  color: rgba(232, 238, 244, 0.68);
  font-size: 11px;
}

.department-person.department-head {
  border-color: rgba(245, 185, 92, 0.28);
  background: rgba(245, 185, 92, 0.1);
}

.department-person.active,
.department-member-chip.active {
  border-color: rgba(64, 160, 114, 0.7);
  background: rgba(64, 160, 114, 0.18);
}

.department-empty {
  padding: 8px 10px;
  border-radius: 8px;
  color: rgba(232, 238, 244, 0.66);
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
}

.department-work-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.work-evaluation-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(245, 185, 92, 0.24);
  border-radius: 8px;
  background: rgba(246, 249, 251, 0.92);
  color: #17212b;
}

.work-evaluation-panel[hidden] {
  display: none;
}

.work-evaluation-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.work-evaluation-panel-head h3 {
  margin: 0;
  color: #1c2732;
  font-size: 22px;
}

.work-evaluation-panel .muted {
  color: #52606d;
}

.work-evaluation-actions {
  padding: 12px;
  border: 1px solid rgba(17, 24, 31, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.work-evaluation-actions > div:first-child {
  display: grid;
  gap: 4px;
}

.work-evaluation-actions strong {
  color: #17212b;
}

.work-evaluation-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
}

.work-evaluation-summary > div,
.work-evaluation-row {
  border: 1px solid rgba(17, 24, 31, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.work-evaluation-summary > div {
  display: grid;
  gap: 4px;
  padding: 12px;
}

.work-evaluation-summary span {
  color: #52606d;
  font-size: 12px;
}

.work-evaluation-summary strong {
  color: #16212b;
  font-size: 24px;
}

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

.work-evaluation-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.work-evaluation-rank {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  border-radius: 8px;
  background: rgba(35, 85, 118, 0.08);
  color: #21303c;
  min-height: 92px;
}

.work-evaluation-rank span,
.work-evaluation-rank small {
  font-size: 12px;
}

.work-evaluation-rank strong {
  font-size: 28px;
  line-height: 1;
}

.work-evaluation-rank small {
  min-width: 30px;
  padding: 3px 7px;
  border-radius: 999px;
  text-align: center;
  color: #fff;
  background: #6b7280;
}

.work-evaluation-rank small.good { background: #1f7a4d; }
.work-evaluation-rank small.ok { background: #2b6f9f; }
.work-evaluation-rank small.watch { background: #9a6a1f; }
.work-evaluation-rank small.bad { background: #9a3228; }

.work-evaluation-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.work-evaluation-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.work-evaluation-title h4 {
  margin: 0;
  color: #17212b;
}

.work-evaluation-title span {
  color: #52606d;
  font-size: 12px;
}

.sidebar-performance-card {
  display: grid;
  gap: 8px;
}

.sidebar-ranking-list {
  display: grid;
  gap: 6px;
}

.sidebar-ranking-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-ranking-row.active {
  border-color: rgba(64, 160, 114, 0.7);
  background: rgba(64, 160, 114, 0.16);
}

.sidebar-ranking-row span {
  color: rgba(232, 238, 244, 0.65);
  font-size: 12px;
}

.sidebar-ranking-row strong {
  min-width: 0;
  overflow: hidden;
  color: #eef3f8;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-ranking-row small {
  color: #f5b95c;
  font-size: 12px;
  font-weight: 800;
}

.sidebar-ranking-current {
  margin: 0;
  font-size: 12px;
}

.actor-duty-panel,
.actor-task-panel,
.actor-module-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(17, 24, 31, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.54);
}

.actor-duty-panel h4,
.actor-task-panel h4,
.actor-module-panel h4 {
  margin: 0;
  color: #1d2833;
}

.actor-duty-panel .muted,
.actor-task-panel .muted,
.actor-module-panel .muted,
.actor-workbench-task-main .muted,
.department-config-item .muted,
.department-work-main .muted,
.department-work-action-hint {
  color: #52606d;
}

.actor-module-panel .workspace-action-button {
  color: #11181f;
}

.actor-module-panel .workspace-action-button span,
.actor-module-panel .workspace-action-button small {
  color: #52606d;
}

.actor-duty-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: actor-duty;
}

.actor-duty-steps li {
  min-width: 0;
  padding: 10px 11px;
  border-radius: 8px;
  border: 1px solid rgba(64, 160, 114, 0.18);
  background: rgba(247, 250, 252, 0.82);
  color: #26333f;
  font-size: 13px;
  line-height: 1.45;
}

.actor-duty-steps li::before {
  counter-increment: actor-duty;
  content: counter(actor-duty) ". ";
  color: #247a55;
  font-weight: 900;
}

.actor-task-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.actor-workbench-task-list {
  display: grid;
  gap: 10px;
}

.actor-workbench-task {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 300px);
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(83, 106, 128, 0.14);
  background: rgba(255, 255, 255, 0.7);
}

.actor-workbench-task-main {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.actor-workbench-task-main h5 {
  margin: 0;
  color: #1f2b36;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.department-work-button-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.department-work-button-grid.compact {
  align-content: start;
}

.department-work-button-grid button {
  width: 100%;
  min-height: 36px;
  white-space: normal;
}

.department-work-action-hint {
  margin: 0;
  font-size: 12px;
}

.department-work-summary > div,
.department-config-item,
.department-work-item {
  border: 1px solid rgba(17, 24, 31, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
}

.department-work-summary > div {
  display: grid;
  gap: 5px;
  padding: 13px;
}

.department-work-summary span {
  color: #52606d;
  font-size: 12px;
}

.department-work-summary strong {
  color: #15202b;
  font-size: 26px;
}

.department-config-list,
.department-work-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.department-config-item {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.department-config-item textarea {
  width: 100%;
  min-height: 82px;
  resize: vertical;
}

.department-member-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.department-member-chip {
  width: auto;
  min-height: 32px;
  color: #24313d;
  background: rgba(255, 255, 255, 0.72);
}

.department-work-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 270px);
  gap: 14px;
  padding: 13px;
}

.department-work-item.unassigned {
  border-color: rgba(179, 72, 58, 0.28);
  background: linear-gradient(180deg, rgba(252, 238, 236, 0.72), rgba(255, 255, 255, 0.55));
}

.department-work-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.department-work-main h4 {
  color: #1d2833;
  line-height: 1.25;
}

.department-work-main .tag {
  width: fit-content;
}

.department-work-action {
  display: grid;
  align-content: start;
  gap: 8px;
}

.department-work-action strong {
  color: #27323d;
  font-size: 13px;
}

.department-work-action select,
.department-config-item textarea {
  border: 1px solid rgba(98, 109, 120, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #11181f;
  padding: 9px 10px;
}

@media (max-width: 1180px) {
  .work-evaluation-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-evaluation-row {
    grid-template-columns: 1fr;
  }

  .work-evaluation-rank {
    grid-template-columns: auto auto auto;
    justify-content: start;
    justify-items: start;
    min-height: auto;
    padding: 10px;
  }

  .work-evaluation-title {
    display: grid;
  }

  .layout {
    display: block;
  }

  .sidebar {
    position: relative;
    height: auto;
    padding: 14px;
  }

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

  .topbar-status {
    justify-items: start;
  }

  .status-text {
    text-align: left;
  }

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

  .department-work-item {
    grid-template-columns: 1fr;
  }

  .actor-workbench-task {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .sidebar .brand {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .order-risk-head,
  .order-risk-card,
  .work-evaluation-actions {
    display: grid;
  }

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

  .sidebar .logo {
    width: 78px;
  }

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

  .actor-duty-steps {
    grid-template-columns: 1fr;
  }

  .topbar-work-nav {
    margin-inline: -4px;
    padding-inline: 4px;
  }
}

/* Final shell alignment: match the marketing system's top brand header while keeping the department rail visible. */
:root {
  --app-header-height: 82px;
  --app-sidebar-width: clamp(288px, 23vw, 340px);
}

.layout {
  display: grid;
  grid-template-columns: var(--app-sidebar-width) minmax(0, 1fr);
  grid-template-rows: var(--app-header-height) minmax(0, 1fr);
  min-height: 100vh;
  min-width: 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 120;
  grid-column: 1 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(8px, 1vw, 14px);
  height: var(--app-header-height);
  margin: 0;
  padding: 0 clamp(18px, 3.4vw, 56px);
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(23, 27, 32, 0.94), rgba(11, 14, 18, 0.92)),
    rgba(11, 14, 18, 0.92);
  box-shadow: 0 18px 42px -34px rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(18px);
}

.app-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.app-brand .logo {
  width: clamp(142px, 11vw, 178px);
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.app-brand .logo img {
  display: block;
  width: 100%;
  height: auto;
}

.app-brand > div:last-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.brand-rule {
  display: block;
  width: 64px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.app-brand strong {
  overflow: hidden;
  color: #ffffff;
  font-size: clamp(12.5px, 1vw, 15px);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-brand small {
  overflow: hidden;
  color: rgba(211, 170, 88, 0.92);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header .topbar-work-nav {
  min-width: 0;
  padding: 2px 2px 4px;
  gap: 5px;
  scrollbar-width: none;
}

.app-header .topbar-work-nav::-webkit-scrollbar {
  display: none;
}

.app-header .topbar-work-nav .nav-button {
  min-height: 34px;
  padding: 5px 7px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.1;
}

.app-header .topbar-status {
  display: grid;
  justify-items: end;
  gap: 4px;
  min-width: 0;
}

.current-work {
  display: grid;
  justify-items: end;
  gap: 1px;
  min-width: 0;
}

.current-work .eyebrow {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.current-work h2 {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: #ffffff;
  font-size: 22px;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header .actions {
  display: flex;
  justify-content: end;
  gap: 7px;
  min-width: 0;
}

.app-header .pill,
.app-header .ghost-button {
  min-height: 34px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  white-space: nowrap;
}

.app-header .status-text {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: rgba(232, 238, 244, 0.64);
  font-size: 11px;
  line-height: 1.2;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar {
  grid-column: 1;
  grid-row: 2;
  position: sticky;
  top: var(--app-header-height);
  z-index: 75;
  display: block;
  height: calc(100vh - var(--app-header-height));
  overflow-y: auto;
  padding: 16px 14px 18px;
  border-right: 1px solid rgba(216, 220, 226, 0.16);
  border-bottom: 0;
  background:
    linear-gradient(180deg, rgba(31, 36, 42, 0.96), rgba(15, 18, 23, 0.98)),
    rgba(15, 18, 23, 0.98);
  box-shadow:
    inset -1px 0 0 rgba(255, 255, 255, 0.05),
    18px 0 54px -44px rgba(0, 0, 0, 0.9);
}

.sidebar .brand {
  display: none;
}

.sidebar .department-tree {
  margin-top: 0;
}

.sidebar-card:not(.actor-card) {
  display: grid !important;
  margin-top: 12px;
}

.actor-card {
  width: 100%;
  margin-top: 12px;
}

.content {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 22px clamp(18px, 3.2vw, 52px) 56px;
}

body[data-current-page="dashboard"] .content {
  padding-top: 22px;
}

body[data-current-page="dashboard"] .topbar {
  margin-bottom: 0;
}

@media (max-width: 1280px) {
  .app-header {
    grid-template-columns: minmax(300px, 430px) minmax(0, 1fr);
    padding-inline: 18px;
  }

  .app-brand .logo {
    width: clamp(148px, 15vw, 184px);
  }

  .app-brand strong {
    font-size: 13px;
  }

  .app-brand small {
    font-size: 9.5px;
  }
}

@media (max-width: 1120px) and (min-width: 761px) {
  :root {
    --app-header-height: 118px;
    --app-sidebar-width: clamp(252px, 34vw, 300px);
  }

  .app-header {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-content: center;
    height: var(--app-header-height);
    padding: 10px 16px;
  }

  .app-brand {
    grid-column: 1;
    grid-row: 1;
  }

  .app-brand .logo {
    width: clamp(142px, 20vw, 176px);
  }

  .app-brand strong {
    font-size: 13px;
  }

  .app-brand small {
    font-size: 9.5px;
  }

  .app-header .topbar-work-nav {
    grid-column: 1;
    grid-row: 2;
  }

  .app-header .topbar-work-nav .nav-button {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 11px;
  }

  .sidebar {
    padding-inline: 12px;
  }

  .content {
    padding: 18px 14px 46px;
  }

  .page[data-page="dashboard"] .home-workbench {
    grid-template-columns: 1fr;
  }

  .home-title-metrics,
  .page[data-page="dashboard"] .home-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  :root {
    --app-header-height: auto;
    --app-sidebar-width: 100%;
  }

  .layout {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .app-header {
    position: sticky;
    grid-column: 1;
    grid-row: 1;
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
    min-height: 82px;
    padding: 12px 16px;
  }

  .app-header .topbar-status,
  .current-work {
    justify-items: start;
  }

  .app-header .actions {
    justify-content: start;
  }

  .app-header .status-text {
    text-align: left;
  }

  .sidebar {
    grid-column: 1;
    grid-row: 3;
    position: relative;
    top: auto;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(216, 220, 226, 0.16);
  }

  .content {
    grid-column: 1;
    grid-row: 2;
    padding: 18px 16px 46px;
  }
}

@media (max-width: 640px) {
  .app-brand {
    align-items: flex-start;
    gap: 10px;
  }

  .app-brand .logo {
    width: min(42vw, 150px);
  }

  .app-brand strong {
    white-space: normal;
  }

  .app-brand small {
    display: none;
  }
}

.actor-card label {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
}

.actor-card select,
#actor-selector {
  width: 100%;
  min-width: 0;
  min-height: 40px;
}

.sidebar-department-button {
  width: 100%;
  justify-content: center;
  min-height: 40px;
  padding-inline: 12px;
  margin-top: 4px;
}

.department-tree-empty {
  padding: 12px;
  line-height: 1.55;
}

.actor-login-modal[hidden] {
  display: none !important;
}

.actor-login-modal {
  position: fixed;
  inset: 0;
  z-index: 520;
  display: grid;
  place-items: center;
  padding: 18px;
}

.actor-login-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 10, 0.72);
  backdrop-filter: blur(10px);
}

.actor-login-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(420px, 100%);
  gap: 14px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 22px;
  border: 1px solid rgba(216, 220, 226, 0.16);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(31, 36, 42, 0.98), rgba(12, 15, 19, 0.98)),
    rgba(12, 15, 19, 0.98);
  box-shadow: 0 22px 70px -32px rgba(0, 0, 0, 0.9);
}

.actor-login-panel h2 {
  margin: 0;
  color: #fff;
  font-size: 22px;
  line-height: 1.25;
}

.actor-login-panel label {
  display: grid;
  gap: 8px;
  color: rgba(238, 243, 247, 0.92);
}

.actor-login-picker-field select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
}

.actor-login-panel .action-row {
  justify-content: start;
}

.admin-login-panel {
  width: min(560px, 100%);
}

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

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

.admin-auth-form .action-row {
  flex-wrap: wrap;
}

.admin-dashboard-card {
  border-color: rgba(245, 158, 11, 0.28);
}

.admin-comment-grid {
  margin-top: 16px;
}

.admin-stat-pill {
  display: grid;
  gap: 5px;
}

.admin-stat-pill strong {
  color: #f6b94f;
}

.admin-comment-item {
  border-left: 3px solid #f59e0b;
}

/* Readability pass: keep workspace pages in a carbon, gold, and light-steel palette. */
:root {
  --read-carbon: #0b0f14;
  --read-carbon-2: #151a1f;
  --read-gold: #d3aa58;
  --read-gold-light: #fff0bd;
  --read-gold-deep: #9f742b;
  --read-text: #f7f2e4;
  --read-muted: #d9dee5;
  --read-ink: #11181f;
}

.page,
.actor-login-panel,
.admin-login-panel {
  color: var(--read-text);
}

.page h1,
.page h2,
.page h3,
.page h4,
.page h5,
.card-head h3,
.hero h3,
.actor-login-panel h2,
.actor-duty-panel h4,
.actor-task-panel h4,
.actor-module-panel h4,
.actor-workbench-task-main h5,
.department-work-main h4,
.department-work-action strong,
.department-work-summary strong {
  color: var(--read-gold-light);
  background: linear-gradient(92deg, #fff8dd 0%, #f3d180 48%, #d3aa58 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page p,
.page li,
.page dd,
.page td,
.page th,
.page label,
.page small,
.page span,
.page output,
.page figcaption,
.actor-login-panel p,
.actor-login-panel label,
.actor-login-panel small,
.admin-login-panel p,
.admin-login-panel label,
.admin-login-panel small {
  color: var(--read-text);
}

.page .muted,
.page .helper,
.page .hint,
.page .empty,
.page .subtle,
.page .department-empty,
.page .department-work-action-hint,
.page .actor-workbench-task-main .muted,
.page .department-work-main .muted,
.page .department-config-item .muted,
.actor-login-panel .muted,
.admin-login-panel .muted {
  color: var(--read-muted);
}

.page .card,
.page .stack-item,
.page .metric,
.page .summary,
.page .report-block,
.page .alert-banner,
.page .quote-price-block,
.page .quote-component,
.page .quote-history-metrics > div,
.page .quote-band-list span,
.page .manual-response-summary > div,
.page .manual-response-request,
.page .manual-response-slot,
.page .marketing-auto-summary > div,
.page .marketing-auto-request,
.page .marketing-auto-task,
.page .customer-path-task,
.page .order-work-task,
.page .department-work-summary > div,
.page .department-config-item,
.page .department-work-item,
.page .actor-duty-panel,
.page .actor-task-panel,
.page .actor-module-panel,
.page .actor-workbench-task,
.page .department-member-chip,
.page .department-person,
.page .workspace-action-button {
  color: var(--read-text);
  border-color: rgba(211, 170, 88, 0.28);
  background:
    linear-gradient(180deg, rgba(24, 29, 35, 0.96), rgba(9, 13, 18, 0.92)),
    var(--read-carbon);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 189, 0.1),
    0 16px 34px -28px rgba(0, 0, 0, 0.82);
}

.page .workspace-action-button strong,
.page .workspace-action-button span,
.page .workspace-action-button small,
.page .department-work-summary span,
.page .department-member-chip small,
.page .department-person small,
.page .actor-duty-steps li,
.page .tag,
.page .pill {
  color: var(--read-text);
}

.page .workspace-action-button strong,
.page .tag,
.page .pill,
.page .department-work-summary span {
  color: var(--read-gold-light);
}

.page .workspace-action-button span,
.page .workspace-action-button small,
.page .department-member-chip small,
.page .department-person small,
.page .actor-duty-steps li {
  color: var(--read-muted);
}

.page .actor-duty-steps li {
  border-color: rgba(211, 170, 88, 0.26);
  background: rgba(255, 240, 189, 0.08);
}

.page .actor-duty-steps li::before {
  color: var(--read-gold-light);
}

.page .department-work-item.unassigned,
.page .manual-response-slot.good,
.page .manual-response-slot.bad,
.page .marketing-auto-task.good,
.page .marketing-auto-task.bad,
.page .alert-success,
.page .alert-danger,
.page .settlement-hint-success,
.page .settlement-hint-danger,
.page .quote-status.good,
.page .quote-status.warn,
.page .quote-status.bad {
  border-color: rgba(211, 170, 88, 0.34);
  background:
    linear-gradient(180deg, rgba(34, 30, 21, 0.92), rgba(12, 15, 19, 0.92)),
    var(--read-carbon);
  color: var(--read-text);
}

.page .pill,
.page .pill.good,
.page .pill.warn,
.page .pill.bad,
.page .pill.danger,
.page .tag,
.page .tag.good,
.page .tag.watch,
.page .tag.pending,
.page .tag.bad,
.page .alert-chip,
.page .quote-status {
  border-color: rgba(211, 170, 88, 0.38);
  background: rgba(211, 170, 88, 0.13);
  color: var(--read-gold-light);
}

.page input:not([type="file"]),
.page textarea,
.page select,
.actor-login-panel input,
.actor-login-panel textarea,
.actor-login-panel select,
.admin-login-panel input,
.admin-login-panel textarea,
.admin-login-panel select {
  border-color: rgba(211, 170, 88, 0.38);
  background: rgba(6, 9, 13, 0.88);
  color: var(--read-text);
}

.page input::placeholder,
.page textarea::placeholder,
.actor-login-panel input::placeholder,
.actor-login-panel textarea::placeholder,
.admin-login-panel input::placeholder,
.admin-login-panel textarea::placeholder {
  color: rgba(217, 222, 229, 0.68);
}

.primary-button,
.page .primary-button,
.actor-login-panel .primary-button,
.admin-login-panel .primary-button {
  border-color: rgba(255, 240, 189, 0.42);
  background: linear-gradient(180deg, var(--read-gold-light), var(--read-gold), var(--read-gold-deep));
  color: var(--read-ink);
  box-shadow: 0 16px 34px -24px rgba(211, 170, 88, 0.72);
}

.primary-button *,
.page .primary-button *,
.actor-login-panel .primary-button *,
.admin-login-panel .primary-button * {
  color: var(--read-ink);
  -webkit-text-fill-color: var(--read-ink);
}

.secondary-button,
.ghost-button,
.page .secondary-button,
.page .ghost-button,
.actor-login-panel .secondary-button,
.actor-login-panel .ghost-button,
.admin-login-panel .secondary-button,
.admin-login-panel .ghost-button {
  border-color: rgba(211, 170, 88, 0.34);
  background: linear-gradient(180deg, rgba(29, 35, 42, 0.94), rgba(11, 15, 20, 0.94));
  color: var(--read-gold-light);
}

.secondary-button *,
.ghost-button *,
.page .secondary-button *,
.page .ghost-button *,
.actor-login-panel .secondary-button *,
.actor-login-panel .ghost-button *,
.admin-login-panel .secondary-button *,
.admin-login-panel .ghost-button * {
  color: var(--read-gold-light);
  -webkit-text-fill-color: var(--read-gold-light);
}

.page a {
  color: var(--read-gold-light);
}

.page .training-health-strip-inner,
.page .training-health-metrics div,
.page .training-material-row,
.page .manual-quote-panel,
.page .manual-quote-evaluation,
.page .manual-quote-eval-card,
.page .manual-quote-eval-card.watch,
.page .manual-response-empty,
.page .marketing-auto-empty,
.page .quote-process-price-row,
.page .quote-material-history-row {
  color: var(--read-text);
  border-color: rgba(211, 170, 88, 0.28);
  background:
    linear-gradient(180deg, rgba(24, 29, 35, 0.96), rgba(9, 13, 18, 0.92)),
    var(--read-carbon);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 189, 0.1),
    0 16px 34px -28px rgba(0, 0, 0, 0.82);
}

.page .training-health-head h4,
.page .training-health-metrics strong,
.page .training-material-row strong,
.page .manual-quote-head h4,
.page .manual-response-head h4,
.page .marketing-auto-head h4,
.page .manual-response-empty strong,
.page .marketing-auto-empty strong,
.page .quote-process-price-row strong,
.page .quote-material-history-row strong {
  color: var(--read-gold-light);
  background: linear-gradient(92deg, #fff8dd 0%, #f3d180 48%, #d3aa58 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page .training-health-metrics span,
.page .training-health-metrics small,
.page .training-material-row span,
.page .training-material-row small,
.page .manual-quote-row > span,
.page .manual-quote-eval-card span,
.page .manual-quote-eval-card small,
.page .manual-response-summary span,
.page .manual-response-slot p,
.page .manual-response-slot small,
.page .manual-response-request-head small,
.page .manual-response-request-head span,
.page .manual-response-empty span,
.page .marketing-auto-summary span,
.page .marketing-auto-task p,
.page .marketing-auto-task small,
.page .marketing-auto-request-head small,
.page .marketing-auto-request-head span,
.page .marketing-auto-empty span,
.page .quote-process-price-row span,
.page .quote-material-history-row span,
.page .quote-material-history-row small {
  color: var(--read-muted);
}

.page .manual-response-slot-top span,
.page .marketing-auto-task-top span {
  border-color: rgba(211, 170, 88, 0.38);
  background: rgba(211, 170, 88, 0.13);
  color: var(--read-gold-light);
}

.page[data-page="guide"] .guide-print-button {
  border-color: rgba(255, 240, 189, 0.48);
  background: linear-gradient(180deg, var(--read-gold-light), var(--read-gold), var(--read-gold-deep));
  color: var(--read-ink);
}

.page[data-page="guide"] .guide-print-button * {
  color: var(--read-ink);
  -webkit-text-fill-color: var(--read-ink);
}

.department-person.active,
.department-member-chip.active {
  border-color: rgba(255, 240, 189, 0.58);
  background: rgba(211, 170, 88, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 189, 0.14),
    0 14px 28px -24px rgba(211, 170, 88, 0.7);
}

/* Personal login clarity and first-use guidance. */
.login-form > .secondary-button {
  width: 100%;
}

.sidebar-login-card {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 15px;
  border: 1px solid rgba(211, 170, 88, 0.48);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(211, 170, 88, 0.16), rgba(255, 255, 255, 0.035) 52%),
    rgba(10, 14, 19, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 189, 0.12),
    0 18px 34px -28px rgba(0, 0, 0, 0.9);
}

.sidebar-login-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-login-head .eyebrow {
  margin: 0;
  color: rgba(255, 230, 162, 0.88);
}

.sidebar-login-status {
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid rgba(246, 176, 73, 0.42);
  border-radius: 999px;
  background: rgba(154, 91, 12, 0.24);
  color: #ffe2a2;
  font-size: 11px;
  font-weight: 800;
}

.sidebar-login-status.authenticated {
  border-color: rgba(86, 211, 145, 0.44);
  background: rgba(30, 128, 78, 0.24);
  color: #bff4d6;
}

.sidebar-login-name {
  color: #ffffff;
  font-size: 18px;
  line-height: 1.25;
}

.sidebar-login-meta,
.sidebar-login-help {
  margin: 0;
  color: rgba(232, 238, 244, 0.78) !important;
  font-size: 12px;
  line-height: 1.55;
}

.sidebar-login-actions {
  display: grid;
  gap: 8px;
}

.sidebar-login-actions button {
  width: 100%;
  min-height: 40px;
  justify-content: center;
}

.department-tree-head > div {
  min-width: 0;
}

.department-tree-login-hint {
  display: block;
  margin-top: 3px;
  color: rgba(255, 226, 162, 0.82);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.first-use-banner {
  display: grid;
  grid-template-columns: minmax(250px, 1.05fr) minmax(330px, 1.25fr) auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid rgba(211, 170, 88, 0.42);
  border-radius: 22px;
  background:
    radial-gradient(circle at 10% 20%, rgba(211, 170, 88, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(28, 34, 41, 0.98), rgba(10, 14, 19, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 189, 0.12),
    0 24px 46px -36px rgba(0, 0, 0, 0.94);
}

.first-use-copy {
  min-width: 0;
}

.first-use-copy h2 {
  margin: 0;
  color: #fff6dc;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.18;
}

.first-use-copy > p:last-child {
  margin: 9px 0 0;
  color: rgba(232, 238, 244, 0.78);
  font-size: 13px;
  line-height: 1.55;
}

.first-use-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.first-use-steps li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 2px 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(211, 170, 88, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.first-use-steps span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f3d180, #b98231);
  color: #171107;
  font-size: 12px;
  font-weight: 900;
}

.first-use-steps strong {
  color: #fff1c6;
  font-size: 13px;
}

.first-use-steps small {
  color: rgba(232, 238, 244, 0.66);
  font-size: 11px;
  line-height: 1.35;
}

.first-use-actions {
  display: grid;
  gap: 8px;
  min-width: 142px;
}

.first-use-actions button {
  width: 100%;
  justify-content: center;
  white-space: nowrap;
}

body[data-authenticated="true"] .first-use-banner {
  display: none !important;
}

@media (max-width: 1280px) {
  .first-use-banner {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .first-use-banner {
    padding: 16px;
  }

  .first-use-steps,
  .first-use-actions {
    grid-template-columns: 1fr;
  }
}

/* Operation access: explain why a section is read-only and how to continue. */
.operation-access-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid rgba(211, 170, 88, 0.46);
  border-radius: 20px;
  background:
    radial-gradient(circle at 8% 22%, rgba(211, 170, 88, 0.2), transparent 34%),
    linear-gradient(135deg, rgba(31, 36, 42, 0.98), rgba(12, 16, 21, 0.98));
  box-shadow: 0 22px 44px -34px rgba(0, 0, 0, 0.95);
}

.operation-access-banner[hidden] {
  display: none !important;
}

.operation-access-banner h3 {
  margin: 0;
  color: #fff2c8;
  font-size: clamp(18px, 2vw, 24px);
}

.operation-access-banner p:last-child {
  margin: 7px 0 0;
  max-width: 860px;
  line-height: 1.55;
}

.operation-access-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.order-work-operating-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 2px 0 12px;
}

.order-work-operating-guide > div {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 3px 9px;
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(211, 170, 88, 0.26);
  border-radius: 15px;
  background: rgba(211, 170, 88, 0.07);
}

.order-work-operating-guide span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f2d382, #bc8432);
  color: #191207;
  font-weight: 900;
}

.order-work-operating-guide strong {
  color: #fff0c1;
  font-size: 14px;
}

.order-work-operating-guide small {
  color: rgba(232, 238, 244, 0.68);
  line-height: 1.4;
}

.order-work-source-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-left: 3px solid #d3aa58;
  border-radius: 0 10px 10px 0;
  background: rgba(211, 170, 88, 0.08);
  color: rgba(242, 234, 211, 0.82);
  line-height: 1.55;
}

.permission-blocked .permission-note {
  padding: 10px 12px;
  border: 1px solid rgba(211, 170, 88, 0.28);
  border-radius: 10px;
  background: rgba(211, 170, 88, 0.08);
  color: rgba(255, 232, 176, 0.9);
}

@media (max-width: 900px) {
  .operation-access-banner,
  .order-work-operating-guide {
    grid-template-columns: 1fr;
  }

  .operation-access-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .operation-access-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .operation-access-actions button {
    width: 100%;
  }
}
/* Quote intake: make the next action visible after a drawing is selected. */
.quote-step-guide {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(211, 170, 88, 0.42);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(211, 170, 88, 0.15), rgba(12, 16, 21, 0.9));
}

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

.quote-step-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 2px 9px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
  opacity: 0.66;
}

.quote-step-item > span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.72);
  font-weight: 900;
}

.quote-step-item strong {
  color: #fff3ce;
  font-size: 13px;
}

.quote-step-item small {
  color: rgba(232, 238, 244, 0.66);
  font-size: 11px;
  line-height: 1.35;
}

.quote-step-item.active,
.quote-step-item.complete {
  border-color: rgba(211, 170, 88, 0.5);
  background: rgba(211, 170, 88, 0.13);
  opacity: 1;
}

.quote-step-item.active > span,
.quote-step-item.complete > span {
  background: linear-gradient(180deg, #f3d180, #b98231);
  color: #171107;
}

.quote-step-item.complete > span::after {
  content: "✓";
  font-size: 14px;
}

.quote-step-item.complete > span {
  font-size: 0;
}

.quote-file-next-step {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 239, 197, 0.9);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.quote-file-next-step[data-state="ready"] {
  background: rgba(30, 128, 78, 0.24);
  color: #c9f6dd;
}

.quote-required {
  display: inline-flex;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(222, 92, 65, 0.2);
  color: #ffc8bb;
  font-size: 10px;
  font-weight: 800;
  vertical-align: middle;
}

.page .quote-missing-fields {
  border-color: rgba(211, 170, 88, 0.42);
  background: linear-gradient(180deg, rgba(35, 31, 22, 0.97), rgba(13, 16, 20, 0.96));
}

.page .quote-missing-fields.needs-attention {
  border-color: rgba(239, 146, 126, 0.68);
  box-shadow: 0 0 0 3px rgba(239, 146, 126, 0.1);
}

.quote-optional-details {
  border: 1px solid rgba(211, 170, 88, 0.24);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.quote-optional-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.quote-optional-details > summary::-webkit-details-marker {
  display: none;
}

.quote-optional-details > summary::after {
  content: "展开填写";
  flex: 0 0 auto;
  color: #f2d486;
  font-size: 12px;
  font-weight: 800;
}

.quote-optional-details[open] > summary::after {
  content: "收起";
}

.quote-optional-details > summary strong {
  color: #fff1c6;
}

.quote-optional-details > summary span {
  color: rgba(232, 238, 244, 0.66);
  font-size: 12px;
}

.quote-optional-details .manual-quote-panel {
  margin: 0 12px 12px;
}

.quote-submit-block {
  display: grid;
  gap: 8px;
  padding: 15px;
  border: 1px solid rgba(211, 170, 88, 0.46);
  border-radius: 16px;
  background: rgba(211, 170, 88, 0.1);
}

.quote-submit-block .primary-button {
  width: 100%;
  min-height: 54px;
  justify-content: center;
  font-size: 16px;
}

.quote-submit-block p {
  margin: 0;
  color: rgba(232, 238, 244, 0.7);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.quote-empty-state {
  border-style: dashed;
  border-color: rgba(211, 170, 88, 0.35) !important;
}

@media (max-width: 720px) {
  .quote-step-grid {
    grid-template-columns: 1fr;
  }

  .quote-optional-details > summary {
    align-items: flex-start;
    flex-direction: column;
  }
}
