:root {
  --graphite: #202124;
  --black: #0d0d0d;
  --white: #fff;
  --raw: #f7f7f4;
  --warm: #f1efe9;
  --orange: #ff5a24;
  --secondary: #74746f;
  --caption: #a5a5a0;
  --border: #e5e5e0;
  --divider: #ecece8;
  --success: #248a3d;
  --sidebar-width: 248px;
  --radius-card: 12px;
  --font-cn: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-en: "Helvetica Neue", Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-width: 1100px; background: var(--warm); color: var(--graphite); font-family: var(--font-cn); font-size: 14px; }
body { letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.admin-shell { min-height: 100vh; display: flex; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); background: var(--black); color: var(--white); padding: 28px 22px 22px; display: flex; flex-direction: column; z-index: 5; }
.brand { padding: 3px 10px 28px; border-bottom: 1px solid rgba(255,255,255,.13); }
.brand-logo { font-family: var(--font-en); font-size: 26px; letter-spacing: 3px; font-weight: 600; }
.brand-cn { color: rgba(255,255,255,.55); font-size: 11px; letter-spacing: 1.5px; margin-top: 7px; }
.env-block { margin: 22px 10px 28px; display: flex; gap: 10px; align-items: center; }
.env-block b { display: block; font-family: var(--font-en); font-size: 11px; letter-spacing: 1px; }
.env-block small { color: rgba(255,255,255,.45); font-size: 11px; }
.env-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(255,90,36,.12); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { margin: 0 10px 9px; color: rgba(255,255,255,.35); font: 11px var(--font-en); letter-spacing: 1.4px; }
.nav-label:not(:first-child) { margin-top: 23px; }
.nav-link { min-height: 42px; display: flex; align-items: center; gap: 12px; padding: 0 11px; color: rgba(255,255,255,.56); font-size: 14px; border-left: 2px solid transparent; transition: .15s ease; }
.nav-link:hover { color: var(--white); background: rgba(255,255,255,.05); }
.nav-link.active { color: var(--white); background: rgba(255,255,255,.08); border-left-color: var(--orange); }
.nav-mark { width: 14px; height: 14px; display: inline-block; border: 1px solid currentColor; opacity: .8; }
.nav-link.active .nav-mark { background: var(--orange); border-color: var(--orange); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,.36); font: 10px var(--font-en); letter-spacing: 1px; }
.signal-line { width: 23px; height: 3px; background: var(--orange); display: inline-block; }

.main { width: calc(100% - var(--sidebar-width)); margin-left: var(--sidebar-width); min-height: 100vh; }
.topbar { height: 105px; background: var(--white); border-bottom: 1px solid var(--divider); display: flex; align-items: center; justify-content: space-between; padding: 0 42px; }
.crumb, .eyebrow { color: var(--caption); font: 11px var(--font-en); letter-spacing: 1.5px; text-transform: uppercase; }
.topbar h1 { margin: 9px 0 0; font-size: 25px; line-height: 1; font-weight: 600; }
.top-actions { position: relative; display: flex; align-items: center; gap: 14px; }
.mode-chip { height: 36px; border: 1px solid var(--border); background: var(--white); color: var(--secondary); padding: 0 13px; font-size: 12px; }
.mode-chip { display: flex; align-items: center; gap: 8px; font-family: var(--font-en); letter-spacing: .5px; }
.mode-chip i { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.account-menu-wrap { position: relative; }
.account-avatar { width: 36px; height: 36px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--graphite); color: var(--white); font-weight: 600; }
.account-avatar:hover { background: var(--orange); }
.account-menu { position: absolute; right: 0; top: 44px; width: 190px; padding: 6px; background: var(--white); border: 1px solid var(--border); z-index: 10; box-shadow: 0 4px 18px rgba(0,0,0,.08); }
.account-menu-user { display: grid; gap: 3px; padding: 9px 10px; border-bottom: 1px solid var(--divider); }
.account-menu-user small { color: var(--caption); font-size: 11px; }
.account-menu > button { display: block; width: 100%; border: 0; background: transparent; padding: 10px; text-align: left; color: var(--secondary); }
.account-menu > button:hover { background: var(--raw); color: var(--graphite); }
.hidden { display: none !important; }
.content { padding: 38px 42px 72px; max-width: 1800px; margin: auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 30px; }
.page-heading h2 { margin: 10px 0 7px; font-size: 32px; line-height: 1.2; font-weight: 600; }
.page-heading p { margin: 0; color: var(--secondary); font-size: 14px; }
.heading-actions { display: flex; gap: 10px; }
.button { min-height: 40px; padding: 0 17px; border-radius: 8px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; white-space: nowrap; transition: .14s ease; }
.button:hover { opacity: .78; transform: scale(.99); }
.button.primary { color: var(--white); background: var(--orange); border-color: var(--orange); }
.button.secondary { color: var(--graphite); background: var(--white); border-color: #d7d7d1; }
.button.text { background: transparent; border-color: transparent; padding-left: 0; color: var(--graphite); }
.button.full { width: 100%; margin-top: 15px; }
.workbench-identity { display: flex; justify-content: space-between; align-items: flex-start; background: var(--white); border: 1px solid var(--border); padding: 22px 24px; margin-bottom: 24px; }
.workbench-identity h3 { margin: 8px 0 5px; font-size: 20px; font-weight: 600; }
.workbench-identity p { margin: 0; color: var(--secondary); font-size: 13px; }
.workbench-section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin: 28px 0 14px; }
.workbench-section-heading h2 { margin: 8px 0 0; font-size: 22px; font-weight: 600; }
.quiet { color: var(--caption); font-size: 12px; }
.workbench-dept-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.workbench-dept { background: var(--white); border: 1px solid var(--border); padding: 20px; }
.workbench-dept-head, .workbench-dept-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.workbench-dept-head h3 { margin: 7px 0 0; font-size: 18px; font-weight: 500; }
.workbench-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--divider); margin: 22px 0 18px; border: 1px solid var(--divider); }
.workbench-metrics > div { background: var(--raw); padding: 13px 10px; }
.workbench-metrics span, .workbench-metrics b { display: block; }
.workbench-metrics span { color: var(--caption); font-size: 11px; }
.workbench-metrics b { margin-top: 9px; font: 600 22px var(--font-en); }
.workbench-dept-foot { align-items: center; color: var(--caption); font-size: 11px; }
.workbench-dept-foot .button { font-size: 12px; }
.workbench-lower-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-top: 22px; }
.workbench-task-row, .workbench-notification { display: flex; justify-content: space-between; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--divider); }
.workbench-task-row:last-child, .workbench-notification:last-child { border-bottom: 0; }
.workbench-task-row { cursor: pointer; }
.workbench-task-row:hover { background: var(--raw); }
.task-detail-grid { display: grid; grid-template-columns: 1fr; gap: 18px; max-width: 980px; }
.task-detail-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.task-detail-actions { display: flex; align-items: center; gap: 10px; }
.task-detail-description { white-space: pre-wrap; line-height: 1.7; color: var(--secondary); }
.task-detail-meta { display: flex; flex-wrap: wrap; gap: 12px; padding: 14px 0; border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider); color: var(--secondary); font-size: 12px; }
.task-messages { display: grid; gap: 12px; max-height: none; overflow: visible; }
.task-message { max-width: 78%; padding: 12px 14px; background: var(--raw); border: 1px solid var(--divider); border-radius: 12px; }
.task-message small { display: block; margin-top: 4px; color: var(--caption); }
.task-message p { margin: 9px 0 0; white-space: pre-wrap; line-height: 1.6; }
.task-message-file { max-width: 340px; }
.task-message-image { display: block; margin-top: 10px; }
.task-message-image img { display: block; width: 240px; max-width: 100%; max-height: 240px; object-fit: contain; border: 1px solid var(--border); background: var(--raw); }
.task-message-attachment { display: block; margin-top: 10px; color: var(--ink); text-decoration: none; padding: 10px 12px; border: 1px solid var(--border); background: var(--raw); }
.report-subsection { margin-top: 18px; padding: 16px; border: 1px solid var(--divider); background: var(--raw); }
.report-subsection .panel-head { margin-bottom: 12px; }
.report-table-tabs { display: flex; gap: 8px; margin: 18px 0 12px; }
.report-filter-bar { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; align-items: end; margin: 16px 0 12px; padding: 14px; border: 1px solid var(--divider); background: var(--raw); }
.report-filter-bar .field { margin: 0; }
.report-filter-bar .button { margin-bottom: 1px; }
.report-table-section[hidden] { display: none; }
.report-table-section { margin-top: 12px; border: 1px solid var(--divider); padding: 14px; background: var(--raw); }
.report-table-scroll { overflow-x: auto; }
.report-entry-table { width: 100%; min-width: 1060px; border-collapse: collapse; table-layout: fixed; }
.report-entry-table th, .report-entry-table td { border: 1px solid var(--divider); padding: 7px; vertical-align: middle; }
.report-entry-table th { background: var(--white); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.report-entry-table input { width: 100%; min-width: 90px; box-sizing: border-box; border: 1px solid var(--border); padding: 7px 8px; background: var(--white); }
.report-entry-table select { width: 100%; min-width: 90px; box-sizing: border-box; border: 1px solid var(--border); padding: 7px 8px; background: var(--white); }
.report-table-actions { display: flex; gap: 8px; }
.report-row-actions { min-width: 260px; white-space: nowrap; }
.report-row-actions .button { margin-right: 4px; }
.report-row-log { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; white-space: normal; }
.report-entry-table td:last-child, .report-entry-table th:last-child { width: 260px; white-space: nowrap; }
.report-log-modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(15, 18, 22, .42); }
.report-log-dialog { width: min(620px, 100%); max-height: 78vh; overflow: auto; padding: 22px; background: var(--white); border: 1px solid var(--divider); box-shadow: 0 18px 50px rgba(0,0,0,.18); }
.report-log-list { display: grid; gap: 8px; margin-top: 16px; }
.report-log-item { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 12px; border-bottom: 1px solid var(--divider); }
.report-log-item span { color: var(--muted); font-size: 12px; }
.report-log-item strong { font-size: 13px; }
.report-log-details { grid-column: 1 / -1; padding: 8px 10px; background: var(--raw); color: var(--ink); font-size: 12px; line-height: 1.7; }
.finance-review-panel { margin: 18px 0; }
.finance-review-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; }
.finance-review-item { display: grid; gap: 6px; min-height: 92px; padding: 14px; text-align: left; border: 1px solid var(--divider); background: var(--raw); color: var(--ink); cursor: pointer; }
.finance-review-item:hover { border-color: var(--accent); background: var(--white); }
.finance-review-item span { color: var(--muted); font-size: 13px; }
.finance-review-item b { font-size: 22px; }
.finance-review-item small { color: var(--muted); }
.finance-review-detail { margin-top: 18px; }
.workbench-task-row.task-pinned { border-color: var(--accent); background: #fffaf5; }
.workbench-task-row .button.compact { padding: 4px 6px; font-size: 11px; }
.task-message-form { position: sticky; bottom: 0; display: grid; gap: 10px; margin-top: 16px; padding-top: 14px; background: var(--white); }
.task-message-form textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border); padding: 10px; resize: vertical; }
.task-files { margin-top: 22px; }
.task-files .panel-head { align-items: center; }
.task-files input[type=file] { display: none; }
.task-files [data-task-files] { display: flex; flex-wrap: wrap; gap: 10px; }
.task-file { display: grid; gap: 5px; width: 112px; color: var(--secondary); font-size: 11px; text-decoration: none; }
.task-file img { width: 112px; height: 88px; object-fit: cover; border: 1px solid var(--border); background: var(--raw); }
.task-file-icon { display: grid; place-items: center; width: 112px; height: 88px; border: 1px solid var(--border); background: var(--raw); color: var(--secondary); }
@media (max-width: 900px) { .task-detail-grid { grid-template-columns: 1fr; } }
.workbench-task-row b, .workbench-notification b { display: block; font-size: 13px; font-weight: 500; }
.workbench-task-row small, .workbench-notification small { display: block; margin-top: 7px; color: var(--caption); font-size: 11px; }
.workbench-task-state { display: flex; align-items: center; gap: 8px; }
.workbench-task-state select { height: 30px; border: 1px solid var(--border); background: var(--white); color: var(--secondary); font-size: 11px; }
.workbench-notice { margin-bottom: 18px; }
.workbench-notice div { display: flex; flex-direction: column; gap: 4px; }
.workbench-notice small { color: var(--secondary); }
.workbench-task-form { display: grid; gap: 14px; padding: 14px; margin-bottom: 14px; background: var(--raw); border: 1px solid var(--border); }
.task-form-top { display: flex; align-items: end; gap: 14px; }
.task-title-input { width: 226px; height: 42px; border: 1px solid var(--border); background: var(--white); padding: 0 12px; color: var(--graphite); }
.task-due-field { width: 226px; }
.task-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.task-form-footer .button { margin-left: auto; }
.task-form-actions { display: flex; gap: 8px; margin-left: auto; }
.workbench-task-form input, .workbench-task-form textarea { min-width: 0; width: 100%; border: 1px solid var(--border); background: var(--white); padding: 10px 12px; color: var(--graphite); box-sizing: border-box; }
.workbench-task-form input { height: 42px; }
.workbench-task-form textarea { resize: vertical; min-height: 96px; }
.workbench-task-form .field { position: relative; margin: 0; }
.workbench-task-form .field small { display: block; margin-top: 7px; }
.mention-menu { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% - 3px); max-height: 220px; overflow: auto; padding: 6px; background: var(--white); border: 1px solid var(--border); box-shadow: 0 8px 22px rgba(0,0,0,.08); }
.mention-option { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 9px 10px; border: 0; background: transparent; text-align: left; color: var(--graphite); cursor: pointer; }
.mention-option:hover { background: var(--raw); }
.mention-option b { font-weight: 500; }
.mention-option small { color: var(--caption); }
.workbench-ai-brief-panel { margin-top: 22px; }
.ai-toolbar { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.ai-toolbar .button:disabled { opacity: .55; cursor: wait; }
.ai-preview { margin-top: 14px; padding: 16px; border: 1px solid var(--border); background: var(--raw); }
.ai-preview-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ai-preview-summary { margin: 12px 0; color: var(--secondary); line-height: 1.6; }
.ai-preview-grid { display: grid; gap: 8px; margin-top: 12px; }
.ai-preview-row { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--divider); }
.ai-preview-row span, .ai-preview-followup b { color: var(--caption); font-size: 12px; }
.ai-preview-row b { font-weight: 500; white-space: pre-wrap; word-break: break-word; }
.ai-preview-followup { display: grid; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--divider); }
.ai-preview-followup span { color: var(--secondary); font-size: 12px; }
.ai-loading, .ai-error { padding: 12px 0; color: var(--secondary); }
.ai-error { color: var(--signal); display: flex; align-items: center; gap: 10px; }
textarea { width: 100%; resize: vertical; min-height: 120px; border: 1px solid var(--border); padding: 12px; color: var(--graphite); background: var(--white); font: inherit; outline: none; }
textarea:focus { border-color: var(--graphite); }
@media (max-width: 1250px) { .workbench-dept-grid { grid-template-columns: 1fr; } .workbench-lower-grid { grid-template-columns: 1fr; } .task-form-top { flex-wrap: wrap; } .task-title-input, .task-due-field { width: 100%; } .task-form-footer { align-items: flex-start; flex-direction: column; } .task-form-footer .button { margin-left: 0; } }

/* Workbench UI direction: calm operations cockpit, preserving existing behavior. */
.workbench-identity {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  padding: 26px 30px;
  background: linear-gradient(135deg, #fff 0%, #fffaf5 100%);
  box-shadow: 0 12px 30px rgba(32, 33, 36, .06);
}
.workbench-identity::after {
  content: '';
  position: absolute;
  right: -42px;
  top: -72px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(255, 90, 36, .08);
}
.workbench-identity > div, .workbench-identity > .status { position: relative; z-index: 1; }
.workbench-identity h3 { font-size: 22px; letter-spacing: -.3px; }
.workbench-identity p { margin-top: 8px; }
.workbench-identity > .status { margin-top: 2px; border-radius: 999px; padding: 0 12px; }
.workbench-section-heading { margin-top: 34px; margin-bottom: 16px; }
.workbench-section-heading h2 { font-size: 24px; letter-spacing: -.4px; }
.workbench-dept-grid { gap: 16px; }
.workbench-dept {
  border: 0;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(32, 33, 36, .045);
  transition: transform .16s ease, box-shadow .16s ease;
}
.workbench-dept:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(32, 33, 36, .08); }
.workbench-dept-head h3 { font-size: 19px; font-weight: 600; }
.workbench-dept-head .status { border-radius: 999px; }
.workbench-metrics { overflow: hidden; border: 0; border-radius: 12px; background: var(--divider); }
.workbench-metrics > div { padding: 15px 12px; background: #fbfbf9; }
.workbench-metrics b { font-size: 24px; }
.workbench-dept-foot { padding-top: 2px; }
.workbench-dept-foot .button { color: var(--orange); font-weight: 600; }
.workbench-ai-brief-panel, .workbench-lower-grid > .panel {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(32, 33, 36, .045);
}
.workbench-ai-brief-panel { margin-top: 24px; }
.workbench-lower-grid { gap: 16px; margin-top: 24px; }
.workbench-lower-grid > .panel { padding: 24px; }
.workbench-lower-grid .panel-head { align-items: center; margin-bottom: 14px; }
.workbench-lower-grid .panel-head h3 { font-size: 20px; }
.workbench-lower-grid .eyebrow { color: var(--orange); }
.workbench-task-row, .workbench-notification { margin: 0 -8px; padding: 15px 8px; border-bottom-color: #f0f0eb; border-radius: 10px; }
.workbench-task-row:hover, .workbench-notification:hover { background: #fffaf5; }
.workbench-task-row b, .workbench-notification b { font-size: 14px; }
.workbench-task-state { flex-shrink: 0; }
.workbench-task-state .status { border-radius: 999px; }
.workbench-task-form { border: 1px solid #f0d9cc; border-radius: 14px; background: #fffaf5; }
.workbench-task-form input, .workbench-task-form textarea { border-radius: 8px; }
.workbench-task-form .button.primary { box-shadow: 0 6px 14px rgba(255, 90, 36, .18); }
.empty-state { border-radius: 12px; }
.main:has(.workbench-identity) .page-heading h2 { display: none; }
.main:has(.workbench-identity) .page-heading { margin-bottom: 18px; }
.workbench-identity { display: none; }
@media (max-width: 1250px) {
  .workbench-identity { padding: 22px; }
}
.loading-block, .error-state { min-height: 260px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; color: var(--secondary); }
.error-state b { color: var(--graphite); font-size: 18px; }
.error-state span { color: var(--secondary); }
.toolbar { min-height: 62px; display: flex; align-items: center; gap: 10px; background: var(--white); border: 1px solid var(--divider); padding: 10px 14px; margin-bottom: 14px; }
.toolbar select, .toolbar input { height: 38px; border: 1px solid var(--border); color: var(--graphite); background: var(--white); padding: 0 11px; outline: none; }
.toolbar select:focus, .toolbar input:focus, .field input:focus, .field select:focus { border-color: var(--graphite); }
.search { height: 38px; width: 285px; display: flex; align-items: center; border: 1px solid var(--border); padding-left: 10px; color: var(--caption); }
.search input { width: 100%; border: 0; padding-left: 5px; }
.toolbar-count { margin-left: auto; color: var(--caption); font: 11px var(--font-en); letter-spacing: 1px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.stat-tile { min-height: 132px; background: var(--white); border: 1px solid var(--border); padding: 20px 22px; display: flex; flex-direction: column; }
.stat-tile span { color: var(--secondary); font-size: 13px; }
.stat-tile strong { margin-top: auto; color: var(--graphite); font: 600 28px var(--font-en); }
.stat-tile small { color: var(--caption); margin-top: 6px; font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel { background: var(--white); border: 1px solid var(--border); padding: 22px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.panel-head h3, .form-panel h3 { margin: 7px 0 0; font-size: 19px; font-weight: 600; }
.panel-head > a { font-size: 12px; color: var(--secondary); }

.table-wrap { width: 100%; overflow-x: auto; background: var(--white); border: 1px solid var(--border); }
table { width: 100%; min-width: 980px; border-collapse: collapse; text-align: left; }
th { height: 42px; padding: 0 14px; color: var(--caption); background: var(--raw); border-bottom: 1px solid var(--border); font: 11px var(--font-en); letter-spacing: .55px; text-transform: uppercase; white-space: nowrap; }
td { height: 64px; padding: 9px 14px; border-bottom: 1px solid var(--divider); color: var(--graphite); font-size: 13px; vertical-align: middle; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td small, td > small, .product-cell small, .person-cell + small { display: block; color: var(--caption); font-size: 11px; margin-top: 5px; }
.mono { font-family: var(--font-en); letter-spacing: .3px; }
.product-cell, .person-cell { display: flex; align-items: center; gap: 10px; }
.product-cell img { width: 42px; height: 48px; object-fit: cover; background: var(--raw); }
.person-cell span, .advisor-avatar { display: inline-flex; align-items: center; justify-content: center; background: var(--graphite); color: var(--white); width: 34px; height: 34px; border-radius: 50%; font-size: 14px; }
.amount { font-family: var(--font-en); font-weight: 600; }
.row-link { color: var(--secondary); font-size: 12px; }
.row-link:hover { color: var(--orange); }
.status { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 6px; background: var(--raw); color: var(--secondary); font: 11px var(--font-en); letter-spacing: .25px; }
.status-active, .status-confirmed { background: #eaf5ed; color: var(--success); }
.status-waiting-confirmation, .status-sample-waiting-approval { background: #fff1ea; color: var(--orange); }
.status-draft { background: var(--warm); color: var(--secondary); }
.status-inactive, .status-expired { color: var(--caption); }

.notice-bar { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; margin-bottom: 15px; background: var(--white); border: 1px solid var(--border); }
.notice-bar small { color: var(--caption); }
.notice-bar a { margin-left: auto; color: var(--secondary); font-size: 12px; }
.editor-form { display: flex; flex-direction: column; gap: 18px; }
.form-grid { display: grid; gap: 18px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-panel { min-height: 100%; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
.field > span, .process-choice > span { color: var(--secondary); font-size: 12px; }
.field input, .field select { height: 42px; width: 100%; padding: 0 12px; color: var(--graphite); border: 1px solid var(--border); background: var(--white); outline: none; }
.read-only-note { padding: 12px 14px; border-left: 3px solid var(--orange); color: var(--secondary); background: var(--raw); font-size: 12px; line-height: 1.6; }
.chip-list { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.data-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 10px; border: 1px solid var(--border); color: var(--secondary); font-size: 12px; }
.data-chip i { width: 14px; height: 14px; border: 1px solid var(--border); border-radius: 50%; }
.size-table > div, .tier-list > div, .rule-row { min-height: 38px; display: grid; grid-template-columns: 70px 1fr 70px; align-items: center; border-bottom: 1px solid var(--divider); font-size: 12px; }
.size-table > div:last-child, .tier-list > div:last-child { border: 0; }
.size-table span, .tier-list span, .rule-row span { color: var(--caption); }
.size-table input, .rule-row input { width: 62px; height: 30px; border: 1px solid var(--border); padding: 0 6px; color: var(--secondary); background: var(--raw); }
.color-editor-row { position: relative; display: grid; grid-template-columns: 88px 1fr auto; gap: 16px; align-items: start; padding: 16px 0; border-bottom: 1px solid var(--divider); }
.color-editor-row:last-child { border-bottom: 0; }
.color-editor-preview { display: flex; flex-direction: column; gap: 6px; color: var(--caption); font-size: 11px; }
.color-editor-preview img { width: 88px; height: 112px; object-fit: cover; border: 1px solid var(--border); background: var(--raw); }
.color-editor-fields { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 10px 12px; }
.color-editor-fields .field { margin: 0; }
.color-editor-fields .field span { font-size: 11px; }
.color-remove { padding-top: 24px; }
.process-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0; }
.process-list span, .permission-list span { padding: 5px 7px; background: var(--raw); color: var(--secondary); font: 10px var(--font-en); }
.tier-list { margin-bottom: 18px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }

.admin-image-preview { position: relative; width: 88px; height: 112px; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--border); background: var(--raw); color: var(--caption); }
.admin-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.admin-image-preview.is-empty { border-style: dashed; }
.admin-image-preview span { font-size: 11px; }
.image-upload-actions { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.image-upload-actions small, [data-upload-status] { color: var(--caption); font-size: 11px; }
.button.compact { min-height: 32px; height: 32px; padding: 0 10px; font-size: 11px; }
.color-editor-preview .admin-image-preview { width: 88px; height: 112px; }
.color-editor-preview .button { margin-top: 7px; }
.color-editor-preview small { display: block; margin-top: 6px; }
.detail-image-row { display: grid; grid-template-columns: 88px 1fr auto; gap: 14px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--divider); }
.detail-image-row:last-child { border-bottom: 0; }
.detail-image-row .admin-image-preview { width: 88px; height: 70px; }
.detail-image-meta { display: flex; flex-direction: column; gap: 6px; color: var(--graphite); font-size: 13px; }
.detail-image-meta small { color: var(--caption); font-size: 11px; }
.detail-image-actions { display: flex; gap: 10px; align-items: center; }
[data-detail-images] .panel-head { margin-bottom: 8px; }

.simulator { display: flex; flex-direction: column; gap: 14px; }
.process-choice { display: flex; align-items: center; flex-wrap: wrap; gap: 15px; margin-top: 4px; }
.process-choice label, .toggle-row label { color: var(--secondary); font-size: 13px; }
.toggle-row { display: flex; gap: 22px; padding-top: 16px; border-top: 1px solid var(--divider); }
.sim-result { margin-top: 20px; background: var(--white); border: 1px solid var(--border); }
.result-top { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--graphite); color: var(--white); }
.result-top > div { min-height: 115px; padding: 20px; border-right: 1px solid rgba(255,255,255,.13); }
.result-top span { display: block; color: rgba(255,255,255,.58); font-size: 12px; }
.result-top strong { display: block; margin-top: 23px; font: 600 25px var(--font-en); }
.breakdown-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); }
.breakdown-grid > div { padding: 22px; background: var(--white); }
.breakdown-grid h3 { margin: 7px 0; font-size: 17px; }
.breakdown-grid p { color: var(--secondary); margin: 0; line-height: 1.7; }
.breakdown-grid b { display: block; margin-top: 12px; color: var(--orange); font-family: var(--font-en); }
.success-line, .warning-line { padding: 14px 20px; border-top: 1px solid var(--divider); color: var(--success); font: 12px var(--font-en); letter-spacing: .5px; }
.warning-line { color: var(--orange); }

.detail-grid, .project-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.detail-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.detail-side { display: flex; flex-direction: column; gap: 18px; }
.sticky-panel { position: sticky; top: 24px; }
.detail-status { display: flex; justify-content: space-between; align-items: center; padding-bottom: 20px; border-bottom: 1px solid var(--divider); }
.detail-status h3 { margin: 8px 0 0; font-size: 17px; font-weight: 500; }
.detail-status > b { font: 12px var(--font-en); color: var(--secondary); }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 21px 25px; padding-top: 20px; }
.info-grid span, .meta-list dt { display: block; color: var(--caption); font-size: 11px; margin-bottom: 7px; }
.info-grid b { font-size: 13px; font-weight: 500; }
.fee-list > div { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--divider); font-size: 13px; }
.fee-list b { font-family: var(--font-en); font-weight: 500; }
.fee-list .discount { color: var(--orange); }
.fee-list .subtotal { margin-top: 8px; font-weight: 500; }
.fee-list .total-line { border: 0; margin-top: 5px; padding-top: 20px; font-weight: 600; font-size: 15px; }
.fee-list .total-line b { font-size: 30px; }
.plain-list { list-style: none; padding: 0; margin: 0; color: var(--secondary); line-height: 2; }
.plain-list li::before { content: '—'; margin-right: 9px; color: var(--caption); }
.lead-time { display: flex; align-items: baseline; gap: 12px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--divider); }
.lead-time b { font: 600 20px var(--font-en); }
.lead-time small { color: var(--caption); }
.version-item { display: grid; grid-template-columns: 40px 1fr; gap: 4px 10px; padding: 14px 0; border-bottom: 1px solid var(--divider); color: var(--secondary); }
.version-item.current { border-left: 2px solid var(--orange); padding-left: 10px; }
.version-item b { grid-row: span 2; font: 600 17px var(--font-en); color: var(--graphite); }
.version-item strong { font: 600 13px var(--font-en); color: var(--graphite); }
.version-item small { grid-column: 2; color: var(--caption); font-size: 11px; }
.project-hero { display: flex; justify-content: space-between; align-items: flex-start; }
.project-hero h3 { margin: 10px 0 7px; }
.project-hero p { margin: 0; color: var(--secondary); }
.project-id { font: 12px var(--font-en); color: var(--secondary); text-align: right; }
.project-id small { display: block; margin-top: 8px; color: var(--caption); }
.admin-timeline { padding: 4px 15px; }
.timeline-node { position: relative; display: flex; gap: 18px; min-height: 72px; padding-left: 17px; border-left: 1px solid var(--border); }
.timeline-node:last-child { min-height: 45px; }
.timeline-dot { position: absolute; left: -6px; top: 3px; width: 11px; height: 11px; border: 2px solid var(--caption); background: var(--white); border-radius: 50%; }
.timeline-node.completed .timeline-dot { border-color: var(--success); background: var(--success); }
.timeline-node.current .timeline-dot { border-color: var(--orange); background: var(--orange); }
.timeline-node b { display: block; font-size: 14px; font-weight: 500; }
.timeline-node small { display: block; margin-top: 6px; color: var(--caption); font-size: 12px; }
.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.module-link { min-height: 150px; display: flex; flex-direction: column; padding: 18px; background: var(--white); border: 1px solid var(--border); }
.module-link:hover { border-color: var(--graphite); }
.module-link span { color: var(--caption); font: 10px var(--font-en); letter-spacing: 1px; }
.module-link b { margin-top: 16px; font-size: 16px; font-weight: 500; }
.module-link strong { margin-top: auto; font: 600 22px var(--font-en); }
.module-link small { color: var(--secondary); margin-top: 5px; }
.advisor { text-align: center; }
.advisor .eyebrow { display: block; text-align: left; }
.advisor-avatar { width: 54px; height: 54px; margin: 22px auto 10px; font-size: 19px; }
.advisor h3 { margin: 0; font-size: 19px; font-weight: 500; }
.advisor p { margin: 7px 0 10px; color: var(--secondary); }
.meta-list { margin: 20px 0 0; }
.meta-list > div { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--divider); }
.meta-list dd { margin: 0; font-family: var(--font-en); font-size: 12px; }
.payment-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 0 0 20px; background: var(--border); border: 1px solid var(--border); }
.payment-summary-grid > div { min-height: 96px; padding: 16px; background: var(--raw); }
.payment-summary-grid span, .payment-terms-row span { display: block; color: var(--caption); font-size: 11px; }
.payment-summary-grid strong { display: block; margin-top: 16px; font: 600 20px var(--font-en); }
.payment-terms-row { display: flex; justify-content: space-between; gap: 20px; padding: 16px 0 20px; border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider); margin-bottom: 18px; align-items: end; }
.payment-terms-row b { display: block; margin-top: 7px; font-weight: 500; }
.payment-terms-row small { display: block; margin-top: 6px; color: var(--caption); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form select, .inline-form input { height: 36px; border: 1px solid var(--border); background: var(--white); padding: 0 9px; color: var(--graphite); min-width: 120px; }
.inline-form input { width: 130px; }
.inline-form .button { min-height: 36px; }
.production-event-form { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--divider); }
.compact-timeline { padding: 12px 15px 0; }
.person-cell b { font-weight: 500; }
.role-tag { color: var(--secondary); font-size: 12px; }
.permission-list { display: flex; flex-wrap: wrap; gap: 5px; max-width: 430px; }
.role-matrix { margin-top: 20px; }
.matrix-row { display: grid; grid-template-columns: 160px 1fr; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--divider); font-size: 12px; }
.matrix-row b { font-weight: 500; }
.matrix-row span { color: var(--secondary); font-family: var(--font-en); font-size: 11px; line-height: 1.7; }
.empty-state { min-height: 210px; padding: 34px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--white); color: var(--secondary); }
.empty-icon { color: var(--caption); font-size: 34px; font-weight: 300; line-height: 1; }
.empty-state b { margin-top: 13px; font-size: 15px; font-weight: 500; }
.empty-state small { margin: 8px 0 15px; color: var(--caption); }
.toast { position: fixed; right: 28px; bottom: 28px; z-index: 20; padding: 12px 16px; background: rgba(32,33,36,.94); color: var(--white); border-radius: 8px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .18s ease; font-size: 13px; }
.toast.show { opacity: 1; transform: translateY(0); }
.login-page { min-height: 100vh; display: grid; place-items: center; background: var(--black); }
.login-box { width: 420px; padding: 40px; background: var(--white); border: 1px solid rgba(255,255,255,.16); }
.login-box .brand-logo { color: var(--graphite); }
.login-box .brand-cn { color: var(--secondary); margin-bottom: 54px; }
.login-box h1 { margin: 12px 0 8px; font-size: 28px; font-weight: 600; }
.login-box p { margin: 0 0 28px; color: var(--secondary); line-height: 1.7; font-size: 13px; }
.login-box .full { margin-top: 10px; }
.login-error { min-height: 18px; color: var(--orange); font-size: 12px; }
.login-note { display: block; margin-top: 26px; color: var(--caption); font: 10px var(--font-en); letter-spacing: .35px; }

@media (max-width: 1280px) {
  :root { --sidebar-width: 220px; }
  .content, .topbar { padding-left: 28px; padding-right: 28px; }
  .stat-grid { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
  .detail-grid, .project-layout { grid-template-columns: minmax(0, 1fr) 280px; }
}

/* Workbench redesign: an operations cockpit with clear scan paths and restrained depth. */
.content:has(.workbench-dept-grid) { padding-top: 30px; }
.content:has(.workbench-dept-grid) .page-heading { margin-bottom: 10px; }
.content:has(.workbench-dept-grid) .page-heading h2 { display: none; }
.content:has(.workbench-dept-grid) .page-heading p { color: var(--secondary); }
.content:has(.workbench-dept-grid) .workbench-identity { display: none; }
.content:has(.workbench-dept-grid) .workbench-section-heading { margin: 22px 0 14px; align-items: center; }
.content:has(.workbench-dept-grid) .workbench-section-heading h2 { margin-top: 6px; font-size: 25px; letter-spacing: -.45px; }
.content:has(.workbench-dept-grid) .workbench-section-heading .quiet { max-width: 260px; text-align: right; line-height: 1.55; }
.content:has(.workbench-dept-grid) .workbench-dept-grid { gap: 16px; }
.content:has(.workbench-dept-grid) .workbench-dept { position: relative; overflow: hidden; min-height: 214px; padding: 22px; border: 1px solid #e2e1db; border-radius: 16px; box-shadow: 0 8px 24px rgba(32,33,36,.045); transition: transform .18s ease, box-shadow .18s ease; }
.content:has(.workbench-dept-grid) .workbench-dept::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--orange); opacity: .86; }
.content:has(.workbench-dept-grid) .workbench-dept:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(32,33,36,.09); }
.content:has(.workbench-dept-grid) .workbench-dept-head h3 { margin-top: 8px; font-size: 20px; letter-spacing: -.25px; }
.content:has(.workbench-dept-grid) .workbench-dept-head .eyebrow { color: var(--orange); }
.content:has(.workbench-dept-grid) .workbench-metrics { margin: 24px 0 19px; border: 0; border-radius: 10px; overflow: hidden; background: #ebeae4; }
.content:has(.workbench-dept-grid) .workbench-metrics > div { padding: 13px 12px; background: #fafaf7; }
.content:has(.workbench-dept-grid) .workbench-metrics span { color: var(--caption); }
.content:has(.workbench-dept-grid) .workbench-metrics b { margin-top: 8px; font-size: 25px; }
.content:has(.workbench-dept-grid) .workbench-dept-foot { padding-top: 1px; }
.content:has(.workbench-dept-grid) .workbench-dept-foot .button { color: var(--orange); font-weight: 600; }
.content:has(.workbench-dept-grid) .workbench-ai-brief-panel { margin-top: 20px; padding: 22px 24px; border: 1px solid #e2e1db; border-radius: 16px; box-shadow: 0 8px 24px rgba(32,33,36,.04); }
.content:has(.workbench-dept-grid) .workbench-lower-grid { gap: 16px; margin-top: 20px; }
.content:has(.workbench-dept-grid) .workbench-lower-grid > .panel { padding: 22px 24px; border: 1px solid #e2e1db; border-radius: 16px; box-shadow: 0 8px 24px rgba(32,33,36,.04); }
.content:has(.workbench-dept-grid) .workbench-lower-grid .panel-head { margin-bottom: 12px; }
.content:has(.workbench-dept-grid) .workbench-lower-grid .panel-head h3 { font-size: 20px; letter-spacing: -.25px; }
.content:has(.workbench-dept-grid) .workbench-task-row, .content:has(.workbench-dept-grid) .workbench-notification { margin: 0 -8px; padding: 14px 8px; border-bottom-color: #efeee9; border-radius: 9px; }
.content:has(.workbench-dept-grid) .workbench-task-row:hover, .content:has(.workbench-dept-grid) .workbench-notification:hover { background: #fffaf5; }
.content:has(.workbench-dept-grid) .workbench-task-row b, .content:has(.workbench-dept-grid) .workbench-notification b { font-weight: 600; }
.content:has(.workbench-dept-grid) .workbench-task-state .status { border-radius: 999px; }
@media (max-width: 1250px) {
  .content:has(.workbench-dept-grid) .workbench-section-heading { align-items: flex-start; gap: 14px; }
  .content:has(.workbench-dept-grid) .workbench-section-heading .quiet { text-align: left; }
}
.workbench-metric-button { min-width: 0; padding: 13px 12px; border: 0; background: #fafaf7; color: var(--graphite); text-align: left; cursor: pointer; }
.workbench-metric-button:hover { background: #fffaf5; }
.workbench-metric-button span, .workbench-metric-button b, .workbench-metric-button small { display: block; }
.workbench-metric-button span { color: var(--caption); font-size: 11px; }
.workbench-metric-button b { margin-top: 8px; font: 600 25px var(--font-en); }
.workbench-metric-button small { margin-top: 5px; color: var(--orange); font-size: 10px; }
.workbench-task-panel { margin-top: 16px; padding: 22px 24px; border: 1px solid #e2e1db; border-radius: 16px; box-shadow: 0 8px 24px rgba(32,33,36,.04); }
.workbench-task-panel > .panel-head { margin-bottom: 4px; }
.workbench-task-panel > p { margin: 0 0 14px; }
.workbench-assignee-list { display: grid; gap: 12px; }
.workbench-assignee-group { border-top: 1px solid var(--divider); }
.workbench-assignee-head { display: flex; justify-content: space-between; align-items: center; padding: 13px 0 8px; }
.workbench-assignee-head span { color: var(--caption); font-size: 12px; }
.workbench-assignee-task { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--graphite); text-align: left; cursor: pointer; }
.workbench-assignee-task:hover { background: #fffaf5; }
.workbench-assignee-task > span { min-width: 0; }
.workbench-assignee-task b, .workbench-assignee-task small { display: block; }
.workbench-assignee-task b { font-weight: 600; }
.workbench-assignee-task small { margin-top: 5px; color: var(--caption); font-size: 11px; }
.workbench-task-panel-empty { padding: 22px 0; color: var(--secondary); }
.warehouse-report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0 22px; padding: 18px; border: 1px solid var(--divider); border-radius: 12px; background: var(--raw); }
.warehouse-report-grid .field { margin: 0; }
.warehouse-report-grid input { width: 100%; min-height: 42px; box-sizing: border-box; }
@media (max-width: 720px) { .warehouse-report-grid { grid-template-columns: 1fr; } }

/* Task composer: make the creation path read top-to-bottom before the user acts. */
.content:has(#workbench-tasks) .workbench-task-form { gap: 18px; padding: 20px; margin: 0 0 18px; border: 1px solid #f0d9cc; border-radius: 14px; background: #fffaf6; }
.content:has(#workbench-tasks) .task-form-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .8fr); gap: 14px; align-items: end; }
.content:has(#workbench-tasks) .task-title-input, .content:has(#workbench-tasks) .task-due-field { width: 100%; }
.content:has(#workbench-tasks) .workbench-task-form input, .content:has(#workbench-tasks) .workbench-task-form textarea { border-color: #e7d8cf; border-radius: 9px; background: #fff; }
.content:has(#workbench-tasks) .workbench-task-form input:focus, .content:has(#workbench-tasks) .workbench-task-form textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,90,36,.1); outline: none; }
.content:has(#workbench-tasks) .workbench-task-form .field > span { display: block; margin-bottom: 7px; color: var(--secondary); font-size: 12px; font-weight: 500; }
.content:has(#workbench-tasks) .workbench-task-form .mention-field { display: grid; grid-template-columns: 1fr; }
.content:has(#workbench-tasks) .workbench-task-form .mention-field textarea { min-height: 112px; padding: 13px 14px; line-height: 1.6; }
.content:has(#workbench-tasks) .workbench-task-form .mention-field small { margin-top: 8px; color: var(--caption); }
.content:has(#workbench-tasks) .task-form-footer { align-items: center; padding-top: 2px; }
.content:has(#workbench-tasks) .task-form-footer > small { max-width: 55%; line-height: 1.5; }
.content:has(#workbench-tasks) .task-form-actions { align-items: center; }
.content:has(#workbench-tasks) .task-form-actions .button { min-height: 40px; padding: 0 18px; }
.content:has(#workbench-tasks) .empty-state { min-height: 160px; padding: 28px 20px; border-top: 1px solid var(--divider); background: transparent; }
.content:has(#workbench-tasks) .empty-icon { font-size: 28px; }
.content:has(#workbench-tasks) .empty-state b { margin-top: 10px; font-size: 14px; }
@media (max-width: 720px) {
  .content:has(#workbench-tasks) .task-form-top { grid-template-columns: 1fr; }
  .content:has(#workbench-tasks) .task-form-footer { align-items: flex-start; flex-direction: column; }
  .content:has(#workbench-tasks) .task-form-footer > small { max-width: none; }
  .content:has(#workbench-tasks) .task-form-actions { width: 100%; justify-content: flex-end; }
}
