:root {
  --ink: #102631;
  --muted: #6c7d84;
  --line: #dfe7e7;
  --paper: #ffffff;
  --canvas: #f4f7f5;
  --green: #0f806c;
  --green-dark: #096453;
  --green-soft: #e2f3ee;
  --navy: #173f5f;
  --amber: #c68120;
  --amber-soft: #fff2d8;
  --red: #c64b4b;
  --red-soft: #fdeaea;
  --blue: #2f6fa1;
  --blue-soft: #e9f2fa;
  --shadow: 0 16px 40px rgba(20, 48, 54, .08);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); min-width: 1180px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.text-danger { color: var(--red) !important; }

.topbar {
  height: 72px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; color: white; background: #102f40; border-bottom: 1px solid rgba(255,255,255,.08);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; background: #1da889; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.brand-title { font-weight: 700; letter-spacing: .04em; }
.brand-subtitle { color: #9fb5be; font-size: 12px; margin-top: 3px; }
.top-actions { display: flex; gap: 12px; align-items: center; }
.local-pill { display: inline-flex; align-items: center; font-size: 12px; color: #bcd0d6; border: 1px solid #335668; padding: 7px 11px; border-radius: 99px; transition: color .2s ease, border-color .2s ease, background .2s ease; }
.status-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #8299a3; margin-right: 7px; box-shadow: 0 0 0 3px rgba(130, 153, 163, .12); }
.backend-status.is-online { color: #c9f4e4; border-color: rgba(86, 211, 164, .55); background: rgba(29, 168, 137, .09); }
.backend-status.is-online .status-dot { background: #56d3a4; box-shadow: 0 0 0 3px rgba(86, 211, 164, .14); }
.backend-status.is-offline { color: #ffd8d8; border-color: rgba(255, 126, 126, .7); background: rgba(198, 75, 75, .22); }
.backend-status.is-offline .status-dot { background: #ff7e7e; box-shadow: 0 0 0 3px rgba(255, 126, 126, .17); }

.shell { min-height: calc(100vh - 72px); display: grid; grid-template-columns: 252px 1fr; }
.sidebar { position: sticky; top: 72px; align-self: start; height: calc(100vh - 72px); overflow: hidden; background: #fff; border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; }
.side-heading { padding: 0 7px 12px; display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 13px; }
.task-list { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 7px; overflow-y: auto; overscroll-behavior: contain; padding-right: 3px; }
.task-item { border: 1px solid transparent; border-radius: 10px; padding: 12px; background: transparent; text-align: left; color: var(--ink); }
.task-item:hover { background: #f4f8f7; }
.task-item.active { background: var(--green-soft); border-color: #c0e3d9; }
.task-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.task-item small { display: flex; justify-content: space-between; color: var(--muted); margin-top: 7px; font-size: 11px; }
.side-note { flex: 0 0 auto; margin-top: 12px; background: #f4f8f7; border-radius: 10px; padding: 13px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.side-note strong { color: var(--ink); font-size: 12px; }
.side-note p { margin: 6px 0 0; }

.main { min-width: 0; padding: 30px 34px 60px; }
.empty-view { min-height: calc(100vh - 162px); display: grid; grid-template-columns: minmax(380px, .85fr) minmax(620px, 1.15fr); gap: 44px; align-items: center; max-width: 1400px; margin: auto; }
.eyebrow, .section-kicker { color: var(--green); font-weight: 800; font-size: 10px; letter-spacing: .18em; }
.hero-copy h1 { font-family: Georgia, "Songti SC", serif; font-size: 44px; line-height: 1.23; letter-spacing: -.02em; margin: 16px 0 20px; font-weight: 700; }
.hero-copy > p { color: var(--muted); line-height: 1.85; max-width: 580px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 30px; color: var(--green-dark); font-size: 13px; font-weight: 600; }
.upload-card, .work-card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.upload-card { padding: 28px; }
.card-title-row, .work-card-head { display: flex; align-items: flex-start; justify-content: space-between; }
.card-title-row h2, .work-card-head h2 { margin: 6px 0 0; font-size: 22px; }
.step-label { color: var(--green); font-size: 12px; font-weight: 700; }
.file-limit { color: var(--muted); font-size: 11px; background: #f3f6f5; border-radius: 99px; padding: 6px 10px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 12px; color: #536970; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #d7e1df; border-radius: 8px; padding: 10px 11px; color: var(--ink); outline: none; background: #fff; }
.field textarea { min-height: 76px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .search-box:focus-within { border-color: #55ab99; box-shadow: 0 0 0 3px rgba(15,128,108,.09); }
.field.full { margin: 22px 0 15px; }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.file-box { position: relative; padding: 15px 15px 13px 48px; min-height: 92px; border: 1px dashed #bdcdca; border-radius: 10px; transition: .18s ease; cursor: pointer; }
.file-box:hover, .file-box.has-file { background: #f2faf7; border-color: var(--green); }
.file-box.template-locked { cursor: default; border-style: solid; border-color: #b9dbd2; background: #f2faf7; }
.file-box.template-locked:hover { border-color: #b9dbd2; }
.file-box.template-locked em { display: inline-flex; align-items: center; gap: 5px; color: var(--green-dark); }
.lock-mark { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; color: white; background: var(--green); font-size: 9px; }
.file-box input { position: absolute; opacity: 0; pointer-events: none; }
.file-box strong, .file-box small, .file-box em { display: block; }
.file-box strong { font-size: 13px; }
.file-box small { color: var(--muted); margin: 5px 0 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-box em { color: var(--green); font-size: 11px; font-style: normal; font-weight: 700; }
.file-number { position: absolute; left: 14px; top: 15px; color: #82a29c; font: 700 11px Georgia, serif; }
.form-hint { text-align: center; color: var(--muted); font-size: 11px; margin-top: 11px; }

.button { border: 0; border-radius: 8px; padding: 10px 15px; font-weight: 700; font-size: 13px; transition: .16s ease; }
.button.primary { background: var(--green); color: white; box-shadow: 0 6px 14px rgba(15,128,108,.16); }
.button.primary:hover { background: var(--green-dark); transform: translateY(-1px); }
.button.ghost { color: var(--ink); background: white; border: 1px solid #d7e1df; }
.topbar .button.ghost { background: transparent; color: #e7f2f3; border-color: #3b5c6c; }
.button.ghost:hover { border-color: #94aaa5; background: #f7faf9; }
.button.ghost.needs-update { color: #8a5a14; border-color: #e8c985; background: var(--amber-soft); }
.button.large { width: 100%; margin-top: 18px; padding: 13px; }
.button.small { padding: 7px 10px; font-size: 11px; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.icon-button { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 18px; }
.icon-button:hover { background: #eff4f2; color: var(--ink); }
.icon-button.danger:hover { background: var(--red-soft); color: var(--red); }

.task-view { max-width: 1500px; margin: auto; }
.task-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; }
.task-header h1 { font-size: 28px; margin: 6px 0; }
.task-header p, .breadcrumb { color: var(--muted); font-size: 12px; margin: 0; }
.task-actions { display: flex; gap: 9px; align-items: center; }
.summary-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 11px; margin-bottom: 17px; }
.summary-card { min-width: 0; background: white; border: 1px solid var(--line); border-radius: 11px; padding: 16px; color: var(--ink); text-align: left; box-shadow: none; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.summary-card:hover { transform: translateY(-2px); border-color: #9fc7ba; box-shadow: 0 9px 22px rgba(20,48,54,.08); }
.summary-card:focus-visible { outline: 3px solid rgba(15,128,108,.18); outline-offset: 2px; }
.summary-card span { color: var(--muted); font-size: 11px; }
.summary-card strong { display: block; margin-top: 8px; font: 700 25px Georgia, serif; }
.summary-card small { display: block; margin-top: 8px; color: #739088; font-size: 9px; font-weight: 700; }
.summary-card.accent { background: #11394a; color: white; border-color: #11394a; }
.summary-card.accent span { color: #b9cbd1; }
.summary-card.accent small { color: #b9d8d1; }

.inventory-audit { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 17px; padding: 13px 17px; border: 1px solid #d8e6e2; border-radius: 11px; background: #f8fbfa; }
.audit-title { min-width: 270px; }
.audit-title span { display: block; font-size: 12px; font-weight: 800; }
.audit-title small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.audit-metrics { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.audit-metrics span { padding: 7px 10px; border-radius: 7px; background: #edf2f0; color: #536970; font-size: 10px; }
.audit-metrics b { margin-left: 5px; color: var(--ink); font-size: 13px; }
.audit-metrics .audit-ok { background: var(--green-soft); color: var(--green-dark); }
.audit-metrics .audit-warn { background: var(--amber-soft); color: #8a5a14; }

.work-card { overflow: hidden; }
.work-card-head { padding: 21px 22px 17px; border-bottom: 1px solid var(--line); }
.work-card-head h2 { font-size: 19px; }
.stage-guidance { max-width: 760px; margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.status-tabs { display: flex; padding: 0 21px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.status-tab { position: relative; border: 0; background: transparent; padding: 15px 14px 13px; color: var(--muted); font-size: 12px; font-weight: 700; }
.status-tab.active { color: var(--green-dark); }
.status-tab.active::after { content: ""; position: absolute; height: 2px; background: var(--green); left: 12px; right: 12px; bottom: -1px; }
.status-tab b { background: #eff3f2; border-radius: 99px; padding: 2px 6px; font-size: 10px; margin-left: 5px; }
.table-toolbar { display: flex; align-items: center; padding: 13px 21px; gap: 16px; background: #fbfcfc; }
.search-box { width: 330px; display: flex; align-items: center; gap: 7px; background: white; border: 1px solid #dce5e3; border-radius: 8px; padding: 0 10px; }
.search-box input { border: 0; outline: 0; width: 100%; padding: 9px 0; background: transparent; }
.check-filter { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.result-count { margin-left: auto; color: var(--muted); font-size: 11px; }
.table-wrap { overflow: auto; }
table { width: 100%; min-width: 1320px; border-collapse: collapse; font-size: 12px; }
th { color: #61757b; background: #f6f8f7; text-align: left; padding: 11px 13px; font-size: 10px; letter-spacing: .04em; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px; border-bottom: 1px solid #e9eeee; vertical-align: top; }
tbody tr:hover { background: #fbfdfc; }
.col-index { width: 56px; }.col-action { width: 76px; }
.cell-main { max-width: 280px; font-weight: 700; line-height: 1.5; }
.cell-sub { color: var(--muted); margin-top: 4px; font-size: 10px; line-height: 1.5; }
.barcode { font-family: Consolas, monospace; letter-spacing: .02em; }
.source-mark { display: inline-block; margin-left: 4px; border-radius: 4px; padding: 1px 5px; font-size: 9px; font-weight: 800; }
.source-mark.yellow { color: #765300; background: #fff0a8; }
.recommend-hint { display: inline-block; margin-top: 6px; color: #296a94; background: var(--blue-soft); border-radius: 4px; padding: 3px 6px; font-size: 9px; font-weight: 700; }
.action-stack { display: flex; flex-direction: column; align-items: stretch; gap: 5px; min-width: 84px; }
.quick-approved { padding: 5px 7px; border-radius: 6px; color: var(--green-dark); background: var(--green-soft); font-size: 9px; font-weight: 800; text-align: center; }
.workflow-gate { padding: 5px 7px; border-radius: 6px; color: #8a5a14; background: var(--amber-soft); font-size: 9px; font-weight: 800; line-height: 1.4; text-align: center; }
.gate-hint { max-width: 220px; margin-top: 6px; padding: 5px 7px; border-radius: 5px; color: #8a5a14; background: var(--amber-soft); font-size: 9px; line-height: 1.45; }
.status-badge { display: inline-flex; align-items: center; border-radius: 99px; padding: 5px 8px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-existing { color: #14715f; background: var(--green-soft); }
.status-new_product { color: #25658e; background: var(--blue-soft); }
.status-possible_existing { color: #8a5a14; background: var(--amber-soft); }
.status-missing_data, .status-conflict { color: #a13b3b; background: var(--red-soft); }
.confirm-yes { color: var(--green); font-weight: 800; }.confirm-no { color: #9aacb0; }
.empty-table { padding: 50px; text-align: center; color: var(--muted); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 15px; padding: 15px; }
.pagination span { color: var(--muted); font-size: 11px; }

.backdrop { position: fixed; z-index: 20; inset: 0; background: rgba(10, 31, 38, .42); backdrop-filter: blur(2px); }
.drawer { position: fixed; z-index: 21; top: 0; right: 0; bottom: 0; width: 720px; background: white; box-shadow: -18px 0 44px rgba(9,32,39,.18); transform: translateX(102%); transition: transform .22s ease; display: grid; grid-template-rows: auto 1fr auto; }
.drawer.open { transform: translateX(0); }
.drawer-head, .drawer-foot { padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 6px 0 0; font-size: 21px; }
.drawer-foot { justify-content: flex-end; gap: 9px; border-bottom: 0; border-top: 1px solid var(--line); }
.drawer-content { overflow: auto; padding: 22px 24px 35px; }
.compare-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 19px; }
.master-review-drawer .compare-grid { grid-template-columns: repeat(2, 1fr); }
.compare-card { border: 1px solid var(--line); border-radius: 9px; padding: 12px; min-height: 112px; }
.compare-card h4 { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 9px; }
.compare-card strong { display: block; font-size: 12px; line-height: 1.55; }
.compare-card small { display: block; color: var(--muted); margin-top: 7px; line-height: 1.5; }
.drawer-section { margin-top: 21px; }
.drawer-section-title { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 9px; margin-bottom: 13px; }
.drawer-section-title h3 { margin: 0; font-size: 14px; }
.drawer-section-title span { color: var(--muted); font-size: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field.wide { grid-column: 1 / -1; }
.field-source { display: inline-block; margin-left: 6px; color: #7b8b90; font-size: 9px; font-style: normal; font-weight: 600; }
.field-source.recommended { color: #296a94; background: var(--blue-soft); border-radius: 4px; padding: 2px 5px; }
.field-source.review-required { color: #8a5a14; background: var(--amber-soft); }
.recommended-field input { border-color: #b9d7e9; background: #f5faff; }
.required-dot { color: var(--red); margin-left: 3px; }
.issue-list-inline { margin: 11px 0 0; padding: 10px 12px; background: var(--red-soft); color: #993d3d; border-radius: 8px; font-size: 11px; line-height: 1.7; }
.match-note { background: #f4f8f7; border-left: 3px solid var(--green); padding: 10px 12px; color: #4f686e; font-size: 11px; line-height: 1.6; margin-bottom: 13px; }
.confirm-box { display: flex; align-items: center; gap: 10px; border: 1px solid #cfe3dd; background: #f1f9f6; border-radius: 9px; padding: 12px; font-size: 12px; font-weight: 700; }
.advanced-fields { border: 1px solid var(--line); border-radius: 9px; padding: 0 13px 13px; }
.advanced-fields summary { cursor: pointer; padding: 13px 0; color: var(--green-dark); font-size: 12px; font-weight: 800; }

.modal-backdrop { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; background: rgba(10,31,38,.48); }
.modal { width: min(880px, calc(100vw - 80px)); max-height: calc(100vh - 80px); display: grid; grid-template-rows: auto 1fr; background: white; border-radius: 14px; overflow: hidden; box-shadow: 0 25px 70px rgba(0,0,0,.25); }
.modal-head { padding: 20px 23px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 5px 0 0; }
.modal-body { padding: 22px; overflow: auto; }
.validation-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 17px; }
.validation-stat { border: 1px solid var(--line); border-radius: 9px; padding: 14px; }
.validation-stat strong { display: block; font-size: 24px; margin-top: 5px; }
.issue-row { display: grid; grid-template-columns: 75px 1fr 110px; gap: 12px; padding: 10px 11px; border-bottom: 1px solid var(--line); font-size: 11px; }
.issue-row.error { border-left: 3px solid var(--red); }.issue-row.warning { border-left: 3px solid var(--amber); }
.export-files { display: grid; gap: 10px; }
.export-file { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.export-file strong { display: block; font-size: 13px; }.export-file small { color: var(--muted); }
.loading { padding: 45px; text-align: center; color: var(--muted); }
.spinner { display: inline-block; width: 22px; height: 22px; border: 3px solid #d8e5e1; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; z-index: 100; top: 86px; left: 50%; transform: translate(-50%, -15px); background: #143844; color: white; padding: 11px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #9c3f3f; }

.module-nav { display: grid; gap: 4px; padding: 0 0 18px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.module-link { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; border-radius: 8px; padding: 9px 10px; color: #5e7278; background: transparent; text-align: left; font-size: 11px; font-weight: 700; }
.module-link span { width: 22px; color: #9aabad; font: 700 9px Georgia, serif; }
.module-link:hover { color: var(--ink); background: #f4f8f7; }
.module-link.active { color: var(--green-dark); background: var(--green-soft); }
.module-link.active span { color: var(--green); }
.module-link.core-capability { position: relative; padding-right: 25px; }
.module-link.core-capability::after { content: ""; position: absolute; right: 11px; width: 5px; height: 5px; border-radius: 50%; background: #79b8a9; opacity: .75; }
.module-link.core-capability.active::after { background: var(--green); box-shadow: 0 0 0 3px rgba(15,128,108,.10); }

.dashboard-view, .task-view { max-width: 1500px; margin: auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 25px; }
.page-heading h1 { margin: 8px 0 7px; font-size: 31px; }
.page-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.core-capabilities { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: stretch; margin-bottom: 17px; }
.core-capabilities-head { padding: 18px 19px; border-radius: 13px; color: white; background: #11394a; }
.core-capabilities-head h2 { margin: 7px 0 8px; font-size: 20px; }
.core-capabilities-head p { margin: 0; color: #b9cbd1; font-size: 10px; line-height: 1.7; }
.core-capability-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.core-capability-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white; text-align: left; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.core-capability-card:hover { transform: translateY(-2px); border-color: #9fc7ba; box-shadow: 0 9px 22px rgba(20,48,54,.08); }
.core-capability-card > span { color: var(--green); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.core-capability-card strong, .core-capability-card small, .core-capability-card em { display: block; }
.core-capability-card strong { margin-top: 8px; font-size: 14px; }
.core-capability-card small { min-height: 48px; margin-top: 7px; color: var(--muted); font-size: 9px; line-height: 1.65; }
.core-capability-card em { margin-top: 10px; color: var(--green-dark); font-size: 9px; font-style: normal; font-weight: 800; }
.dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; margin-bottom: 17px; }
.dashboard-card { min-height: 112px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.dashboard-card.accent { color: white; border-color: #11394a; background: #11394a; }
.dashboard-card span { color: var(--muted); font-size: 11px; }
.dashboard-card.accent span { color: #b9cbd1; }
.dashboard-card strong { display: block; margin-top: 11px; font: 700 29px Georgia, serif; }
.dashboard-card small { display: block; margin-top: 8px; color: #87999e; }
.workflow-card { overflow: hidden; margin-bottom: 17px; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: var(--shadow); }
.workflow-line { display: flex; align-items: center; justify-content: center; gap: 13px; padding: 26px 20px 29px; }
.workflow-line button { display: flex; align-items: center; gap: 9px; border: 0; color: var(--ink); background: transparent; font-size: 11px; font-weight: 800; }
.workflow-line button:hover span { color: var(--green); }
.workflow-line b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--green-dark); background: var(--green-soft); }
.workflow-line i { color: #9db0b1; font-style: normal; }
.dashboard-split, .overview-grid, .history-layout, .version-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.panel-card { padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: 0 10px 28px rgba(20,48,54,.05); }
.panel-card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.panel-card-head h3 { margin: 5px 0 0; font-size: 15px; }
.panel-copy { color: var(--muted); font-size: 11px; line-height: 1.75; }
.version-pill { display: inline-flex; padding: 4px 8px; border-radius: 99px; color: var(--green-dark); background: var(--green-soft); font-size: 10px; font-weight: 800; }
.rule-boundaries { margin: 0; padding-left: 19px; color: #526970; font-size: 11px; line-height: 1.9; }
.empty-table.compact { padding: 18px 4px; text-align: left; }

.task-stage-nav { display: flex; gap: 3px; margin: 0 0 17px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.task-stage-nav button { flex: 1; border: 0; border-radius: 7px; padding: 9px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 800; }
.task-stage-nav button:hover { color: var(--ink); background: #f5f8f7; }
.task-stage-nav button.active { color: white; background: var(--green); }
.stage-panel { margin-top: 17px; }
#matchingPanel { scroll-margin-top: 90px; }
.overview-grid .panel-card { min-height: 245px; }
.progress-list { display: grid; gap: 10px; }
.progress-row { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #edf1f0; font-size: 11px; }
.progress-row b { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; color: var(--green-dark); background: var(--green-soft); }
.progress-row span:last-child { color: var(--muted); }
.form-hint.left { text-align: left; line-height: 1.6; }
.toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.procurement-context { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 25px; align-items: center; margin-bottom: 13px; padding: 19px 21px; border: 1px solid #bcded5; border-radius: 13px; background: #f1faf7; }
.procurement-context h2 { margin: 6px 0 7px; font-size: 21px; }
.procurement-context p { max-width: 850px; margin: 0; color: #526970; font-size: 10px; line-height: 1.7; }
.procurement-source-context { min-width: 280px; padding: 10px 12px; border-left: 3px solid var(--green); border-radius: 7px; color: #526970; background: white; font-size: 9px; line-height: 1.65; }
.procurement-source-context strong { color: var(--green-dark); }
.procurement-step-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; margin-bottom: 17px; }
.procurement-step-card { position: relative; min-height: 118px; padding: 16px 17px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; }
.procurement-step-card::after { content: attr(data-step); position: absolute; right: 12px; top: 10px; color: #deebe7; font: 700 31px Georgia, serif; }
.procurement-step-card.complete { border-color: #bcded5; background: #f7fcfa; }
.procurement-step-card.attention { border-color: #ecd6a8; background: #fffaf1; }
.procurement-step-card span { position: relative; z-index: 1; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.procurement-step-card strong { position: relative; z-index: 1; display: block; margin: 10px 0 6px; font: 700 27px Georgia, serif; }
.procurement-step-card small { position: relative; z-index: 1; color: var(--muted); font-size: 9px; line-height: 1.5; }
.procurement-work-card { margin-bottom: 17px; }
.procurement-primary-actions { max-width: 600px; }
.procurement-fixed-rules { display: flex; flex-wrap: wrap; gap: 8px; padding: 13px 21px; border-bottom: 1px solid var(--line); background: #f8fbfa; }
.procurement-fixed-rules span { padding: 7px 10px; border-radius: 7px; color: #526970; background: #edf2f0; font-size: 10px; }
.procurement-fixed-rules b { margin-right: 5px; color: var(--ink); }
.procurement-fixed-rules .tax-code-warning { color: #8a5a14; background: var(--amber-soft); }
.tax-code-warning em { margin-left: 5px; font-style: normal; font-weight: 800; }
.procurement-toolbar .search-box { width: 390px; }
.procurement-table { min-width: 1240px; }
.procurement-table .cell-main { max-width: 330px; }
.procurement-identifier { font-family: Consolas, monospace; color: var(--ink); font-weight: 700; }
.procurement-price { font: 700 14px Georgia, serif; color: var(--ink); }
.procurement-fixed-cell { display: grid; grid-template-columns: repeat(3, max-content); gap: 5px; }
.procurement-fixed-cell span { padding: 3px 5px; border-radius: 4px; color: #526970; background: #edf2f0; font-size: 8px; white-space: nowrap; }
.procurement-fixed-cell .tax { color: #8a5a14; background: var(--amber-soft); }
.procurement-issues { display: grid; gap: 4px; max-width: 260px; }
.procurement-issue { color: #8a5a14; font-size: 9px; line-height: 1.45; }
.procurement-issue.blocking { color: var(--red); }
.procurement-export-history { margin-top: 17px; }
.procurement-export-history .export-run { margin-top: 8px; }
.procurement-editor-note { margin-bottom: 14px; }
.procurement-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.procurement-editor-grid .wide { grid-column: 1 / -1; }
.procurement-editor-source { padding: 10px 12px; border-radius: 8px; color: #526970; background: #f4f8f7; font-size: 10px; line-height: 1.6; }
.procurement-editor-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }

.toolbar-select { max-width: 170px; border: 1px solid #dce5e3; border-radius: 8px; padding: 8px 9px; color: #526970; background: white; font-size: 10px; outline: 0; }
.col-check { width: 42px; text-align: center; }
td.col-check, .row-select { text-align: center; }
.table-wrap thead th { position: sticky; top: 0; z-index: 3; }
.table-wrap th:first-child, .table-wrap td:first-child { position: sticky; left: 0; z-index: 2; background: inherit; }
.table-wrap thead th:first-child { z-index: 4; background: #f6f8f7; }
.state-stack { display: grid; gap: 5px; min-width: 112px; }
.state-tag { display: inline-flex; width: fit-content; align-items: center; gap: 4px; padding: 4px 7px; border-radius: 5px; font-size: 9px; font-weight: 800; }
.entry-entered, .human-approved, .data-fully_consistent { color: #14715f; background: var(--green-soft); }
.entry-unentered { color: #25658e; background: var(--blue-soft); }
.entry-suspected_match, .data-fields_changed, .data-rule_anomaly, .human-pending_review { color: #8a5a14; background: var(--amber-soft); }
.entry-unable_to_determine, .entry-deleted_from_master, .data-required_missing, .data-illegal_code, .data-duplicate_product, .data-blocking_exception, .human-needs_correction { color: #a13b3b; background: var(--red-soft); }
.human-deferred, .human-accepted_current { color: #607278; background: #edf2f0; }
.row-excluded { opacity: .62; text-decoration: line-through; }
.code-option-note { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.field.invalid input, .field.invalid select { border-color: var(--red); background: #fff8f8; }
.locked-field input { color: #526970; background: #f1f4f3; cursor: not-allowed; }
.recommendation-box { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 5px; padding: 6px 8px; border-radius: 6px; color: #296a94; background: var(--blue-soft); font-size: 9px; }
.evidence-gap { display: block; margin-top: 5px; padding: 6px 8px; border-radius: 6px; color: #8a5a14; background: var(--amber-soft); font-size: 9px; }

.history-layout, .version-columns { margin-bottom: 17px; }
.tracking-explanation { display: flex; align-items: center; gap: 15px; margin-bottom: 17px; padding: 13px 16px; border: 1px solid #bcded5; border-radius: 10px; color: #526970; background: #f1faf7; font-size: 10px; line-height: 1.65; }
.tracking-explanation strong { flex: 0 0 auto; color: var(--green-dark); font-size: 11px; }
.stack-form { display: grid; gap: 12px; }
.compact-file { min-height: 74px; padding-left: 18px; }
.compare-builder { display: grid; align-content: start; gap: 11px; }
.version-list { display: grid; gap: 8px; max-height: 270px; overflow: auto; }
.version-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 11px; border: 1px solid #e3eaea; border-radius: 8px; }
.version-row strong { display: block; font-size: 11px; }
.version-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.comparison-history-card { margin-bottom: 17px; }
.comparison-history-list { max-height: 230px; }
.comparison-history-row { width: 100%; color: inherit; background: white; text-align: left; font: inherit; cursor: pointer; }
.comparison-history-row:hover { border-color: #9fc7ba; background: #f7fbf9; }
.comparison-history-row.active { border-color: var(--green); background: var(--green-soft); }
.comparison-results-card { margin-top: 17px; }
.comparison-summary { display: flex; flex-wrap: wrap; gap: 8px; padding: 13px 21px; border-bottom: 1px solid var(--line); }
.comparison-summary span { padding: 6px 9px; border-radius: 6px; color: #536970; background: #edf2f0; font-size: 10px; }
.comparison-empty-warning { color: var(--red); font-weight: 800; }
.comparison-table { min-width: 1180px; }
.diff-list { display: grid; gap: 5px; max-width: 390px; }
.diff-item { padding: 5px 7px; border-left: 2px solid var(--amber); color: #526970; background: #fffaf1; font-size: 9px; line-height: 1.45; }
.diff-item b { color: var(--ink); }
.master-current { margin-top: 5px; padding-top: 5px; border-top: 1px dashed #dfe7e7; }
.master-current.missing { color: var(--red); }

.draft-summary { display: grid; gap: 3px; min-width: 210px; }
.draft-summary .cell-sub { line-height: 1.55; }
.draft-issue-preview { display: grid; gap: 3px; max-width: 250px; }
.draft-issue-preview .issue-error { color: var(--red); }
.draft-issue-preview .issue-warning { color: #8a5a14; }
.draft-stage .master-only { display: none !important; }
.master-stage .draft-only { display: none !important; }
.master-stage .inventory-source-column { display: none; }
.drawer-stage-note { margin-bottom: 12px; padding: 9px 11px; border-radius: 7px; color: #526970; background: #f4f8f7; font-size: 10px; line-height: 1.55; }
.drawer-stage-note strong { color: var(--green-dark); }
.drawer-stage-note.gated { border-left: 3px solid var(--amber); color: #755b31; background: var(--amber-soft); }
.drawer-stage-note.gated strong { color: #8a5a14; }
.draft-approve-action { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px; border: 1px solid #bcded5; border-radius: 9px; background: #f1faf7; }
.draft-approve-action strong, .draft-approve-action span { display: block; }
.draft-approve-action strong { color: var(--green-dark); font-size: 12px; }
.draft-approve-action span { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.draft-approve-action .button { flex: 0 0 auto; }
.draft-readonly input, .draft-readonly select, .draft-readonly textarea { color: #526970; background: #f1f4f3; cursor: not-allowed; }

.anomaly-list { max-height: 680px; overflow: auto; }
.anomaly-row { display: grid; grid-template-columns: 100px minmax(220px,1fr) 120px 95px; gap: 13px; align-items: start; padding: 13px 20px; border-top: 1px solid var(--line); font-size: 10px; }
.anomaly-row.error { border-left: 3px solid var(--red); }
.anomaly-row.warning { border-left: 3px solid var(--amber); }
.anomaly-row strong { display: block; margin-bottom: 4px; font-size: 11px; }
.anomaly-row small { color: var(--muted); line-height: 1.55; }

.export-preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 21px; }
.export-preview-card { padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfc; }
.export-preview-card.disabled { opacity: .62; }
.export-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.export-card-head strong { display: block; font-size: 13px; }
.export-card-head span { flex: 0 0 auto; padding: 3px 6px; border-radius: 99px; color: var(--green-dark); background: var(--green-soft); font-size: 8px; font-weight: 800; }
.export-preview-card.disabled .export-card-head span { color: #7a6a4e; background: var(--amber-soft); }
.export-preview-card b { display: block; margin: 12px 0 6px; font: 700 28px Georgia, serif; }
.export-preview-card small { display: block; min-height: 47px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.export-card-state { margin-top: 10px; padding-top: 9px; border-top: 1px solid #e6ecea; font-size: 9px; font-weight: 800; line-height: 1.45; }
.export-card-state.ready { color: var(--green-dark); }
.export-card-state.blocked { color: #8a5a14; }
.export-rule-note { display: flex; align-items: center; gap: 16px; margin: 0 21px 20px; padding: 12px 14px; border-radius: 8px; color: #526970; background: #f4f8f7; font-size: 10px; }
.export-rule-note strong { color: var(--green-dark); }
.export-history-head { padding: 0 21px; }
#exportHistory { padding: 0 21px 21px; }
.export-run { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.export-run-head { display: flex; justify-content: space-between; padding: 11px 13px; background: #f7f9f8; font-size: 10px; }
.export-run-files { display: grid; gap: 7px; padding: 11px; }
.export-file-copy { min-width: 0; padding-right: 12px; }
.export-kind { display: inline-flex; margin-bottom: 5px; padding: 2px 6px; border-radius: 4px; color: var(--green-dark); background: var(--green-soft); font-size: 8px; font-weight: 800; }
.export-file-copy strong { overflow-wrap: anywhere; }
.export-file-copy small { display: block; margin-top: 4px; line-height: 1.5; }

.multi-pack-editor { display: grid; gap: 10px; }
.multi-pack-row { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfc; }
.multi-pack-row-head { display: flex; justify-content: space-between; margin-bottom: 9px; font-size: 10px; font-weight: 800; }
.button.text-danger { color: var(--red); background: transparent; box-shadow: none; }

@media (max-width: 1280px) {
  .main { padding-left: 24px; padding-right: 24px; }
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .empty-view { grid-template-columns: .75fr 1.25fr; gap: 24px; }
  .hero-copy h1 { font-size: 36px; }
  .dashboard-grid { grid-template-columns: repeat(3, 1fr); }
  .core-capabilities { grid-template-columns: 1fr; }
  .core-capability-grid { grid-template-columns: repeat(4, 1fr); }
  .procurement-context { grid-template-columns: 1fr; }
  .procurement-source-context { min-width: 0; }
  .workflow-line { gap: 7px; }
  .workflow-line button { gap: 5px; }
}

@media (max-height: 760px) {
  .sidebar { padding-top: 12px; padding-bottom: 12px; }
  .module-nav { gap: 2px; margin-bottom: 9px; padding-bottom: 9px; }
  .module-link { padding-top: 7px; padding-bottom: 7px; }
  .side-heading { padding-bottom: 7px; }
  .side-note { display: none; }
}
