:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --ink: #302c27;
  --muted: #736d66;
  --line: #e6e1da;
  --ground: #f8f6f4;
  --panel: #ffffff;
  --green: #99520b;
  --green-dark: #7e4309;
  --green-soft: #fff2df;
  --yellow: #8a6200;
  --yellow-soft: #fff4cc;
  --red: #a33b36;
  --red-soft: #fae9e7;
  --blue: #526d89;
  --blue-soft: #eef3f8;
  --shadow: 0 14px 36px rgba(48, 42, 35, 0.1);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--ground); }
body.auth-pending .app-shell, body.auth-required .app-shell { visibility: hidden; }
body.authenticated .auth-gate { display: none; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: #302a23; color: #fff; padding: 24px 16px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; background: #ffc557; color: #2f281f; border-radius: 8px; font-weight: 800; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 16px; }
.brand div > span { margin-top: 3px; color: #c4b8a9; font-size: 12px; }
.nav { display: grid; gap: 6px; }
.nav-item { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 6px; background: transparent; color: #d0c7bc; padding: 0 12px; text-align: left; }
.nav-item span { width: 18px; font-size: 17px; text-align: center; }
.nav-item:hover, .nav-item.active { color: #fff; background: #493f31; }
.sidebar-account { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 8px 0; border-top: 1px solid #504435; }
.sidebar-account strong, .sidebar-account span { display: block; max-width: 135px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account strong { font-size: 12px; }
.sidebar-account span { margin-top: 3px; color: #c2b8aa; font-size: 10px; }
.sidebar-logout { width: 30px; height: 30px; flex: 0 0 30px; border: 0; border-radius: 5px; color: #d0c7bc; background: transparent; font-size: 18px; }
.sidebar-logout:hover { color: #fff; background: #493f31; }

.auth-gate { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: #f2f0ed; }
.login-panel { width: min(100%, 390px); padding: 30px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand strong, .login-brand small { display: block; }
.login-brand small { margin-top: 3px; color: var(--muted); }
.login-copy { margin: 32px 0 18px; }
.login-copy h1 { font-size: 24px; }
.login-copy p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.login-panel .button { margin-top: 22px; }
.login-panel .form-note { color: var(--red); text-align: center; }
body.auth-readonly .row-actions,
body.auth-readonly [data-quick="intake"],
body.auth-readonly #open-intake,
body.auth-readonly #import-inventory { display: none !important; }

.main { min-width: 0; padding: 28px 36px 52px; }
.topbar { max-width: 1280px; margin: 0 auto 28px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.topbar p, .dialog-head p { margin: 0 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
h1, h2, h3, p { letter-spacing: 0; }
h1 { margin: 0; font-size: 28px; line-height: 1.2; }
h2 { margin: 0; font-size: 21px; }
h3 { margin: 0; font-size: 16px; }
.top-actions { display: flex; gap: 10px; }
.top-actions[hidden] { display: none; }
.button { min-height: 40px; border: 1px solid transparent; border-radius: 6px; padding: 0 15px; font-weight: 700; }
.button.primary { color: #fff; background: var(--green); }
.button.primary:hover { background: var(--green-dark); }
.button.secondary { color: #423b32; background: #fff; border-color: var(--line); }
.button.secondary:hover { border-color: #bcb6ae; }
.button.danger { color: var(--red); background: #fff; border-color: #e7c7c4; }
.button.full { width: 100%; }
.view-root { min-width: 0; max-width: 1280px; margin: 0 auto; }

.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--panel); border-radius: 8px; overflow: hidden; }
.metric { min-height: 112px; padding: 20px 22px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric-label { display: block; color: var(--muted); font-size: 13px; }
.metric-value { display: block; margin-top: 9px; font-size: 28px; font-weight: 800; }
.metric-note { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.inventory-panel { margin-top: 16px; min-height: 72px; display: flex; align-items: center; gap: 18px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.inventory-copy { min-width: 0; display: flex; align-items: center; gap: 12px; }
.inventory-copy > div { min-width: 0; }
.inventory-copy h3, .inventory-copy p { margin: 0; }
.inventory-copy p { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.inventory-icon { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 6px; color: var(--green); background: var(--green-soft); font-size: 13px; font-weight: 800; }
.inventory-counts { margin-left: auto; display: flex; gap: 7px; white-space: nowrap; }
.inventory-counts span, .inventory-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 12px; font-size: 11px; font-weight: 800; }
.audit-pass { color: var(--green); background: var(--green-soft); }
.audit-over { color: var(--red); background: var(--red-soft); }
.audit-missing { color: var(--yellow); background: var(--yellow-soft); }
.audit-not-applicable { color: var(--muted); background: var(--ground); }
.product-lines { display: grid; gap: 5px; min-width: 260px; white-space: normal; }
.product-lines > div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.product-lines span { font-weight: 700; }
.product-lines small { flex: 0 0 auto; color: var(--muted); }

.work-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; margin-top: 24px; align-items: start; }
.work-grid > * { min-width: 0; }
.queue, .side-band, .data-section, .settings-section { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.queue { min-width: 0; overflow: hidden; }
.section-head { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.section-head div { display: flex; align-items: center; gap: 8px; }
.count-badge { display: inline-flex; min-width: 24px; height: 22px; align-items: center; justify-content: center; border-radius: 11px; color: var(--green); background: var(--green-soft); font-size: 12px; font-weight: 800; }
.link-button { border: 0; padding: 5px; color: var(--green); background: transparent; font-weight: 700; }
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { color: var(--muted); background: #fbfbfa; font-size: 12px; text-align: left; font-weight: 700; }
.data-table th, .data-table td { min-height: 54px; padding: 13px 16px; border-bottom: 1px solid #f2efec; white-space: nowrap; }
.queue .data-table th, .queue .data-table td { padding-left: 10px; padding-right: 10px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fcfbfa; }
.cell-main { display: block; font-weight: 700; }
.cell-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.cell-sub.warning { color: var(--yellow); }
.money { font-weight: 800; }
.status-pill, .confidence { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 12px; font-size: 11px; font-weight: 800; }
.status-review, .status-duplicate { color: var(--yellow); background: var(--yellow-soft); }
.status-ready, .status-approved { color: var(--green); background: var(--green-soft); }
.status-paid { color: var(--blue); background: var(--blue-soft); }
.status-rejected { color: var(--red); background: var(--red-soft); }
.row-actions { display: flex; gap: 4px; }
.mini-button { min-height: 30px; border: 1px solid var(--line); border-radius: 5px; padding: 0 9px; color: #443d35; background: #fff; font-size: 12px; }
.mini-button:hover { border-color: var(--green); color: var(--green); }
.mini-button.primary { color: #fff; border-color: var(--green); background: var(--green); }
.mini-button.primary:hover { color: #fff; border-color: var(--green-dark); background: var(--green-dark); }
.mini-button.danger:hover { border-color: var(--red); color: var(--red); }
.mini-button:disabled { cursor: not-allowed; opacity: .52; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }

.side-band { overflow: hidden; }
.side-band .section-head { min-height: 56px; }
.activity-list { list-style: none; margin: 0; padding: 4px 20px; }
.activity-list li { display: grid; grid-template-columns: 9px 1fr; gap: 11px; padding: 14px 0; border-bottom: 1px solid #f2efec; }
.activity-list li:last-child { border-bottom: 0; }
.activity-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--green); }
.activity-list strong { display: block; font-size: 13px; }
.activity-list span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.quick-action { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-action button { min-height: 74px; display: grid; place-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-weight: 700; }
.quick-action button span { color: var(--green); font-size: 20px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.filter-bar input, .filter-bar select { min-height: 40px; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 0 12px; color: var(--ink); }
.filter-bar input { flex: 1; min-width: 220px; }
.data-section + .data-section { margin-top: 18px; }
.bi-toolbar { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.segmented { display: inline-grid; grid-template-columns: repeat(4, minmax(64px, 1fr)); padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.segmented button { min-height: 32px; border: 0; border-radius: 4px; padding: 0 13px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 700; }
.segmented button.active { color: #fff; background: var(--green); }
.bi-date-range { display: flex; align-items: end; gap: 8px; }
.bi-date-range label, .bi-filter { display: grid; gap: 5px; }
.bi-date-range label span, .bi-filter span { color: var(--muted); font-size: 11px; font-weight: 700; }
.bi-date-range input, .bi-filter select { min-height: 40px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; color: var(--ink); background: #fff; outline: none; }
.bi-date-range input:focus, .bi-filter select:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.bi-date-range i { align-self: center; margin-top: 17px; color: var(--muted); font-size: 12px; font-style: normal; }
.bi-filter-band { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)) auto; align-items: end; gap: 10px; margin-bottom: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.bi-filter select { width: 100%; min-width: 0; }
.bi-reset { white-space: nowrap; }
.bi-result-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.bi-result-line strong { color: var(--ink); }
.bi-result-actions { display: flex; align-items: center; gap: 12px; }
.bi-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.bi-metric { min-height: 94px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.bi-metric span, .bi-metric small { display: block; color: var(--muted); font-size: 12px; }
.bi-metric strong { display: block; margin-top: 8px; font-size: 23px; }
.bi-metric small { margin-top: 4px; }
.bi-chart-section { overflow: hidden; }
.bi-chart-caption { color: var(--muted); font-size: 11px; font-weight: 700; }
.bi-chart-scroll { overflow-x: auto; padding: 20px 18px 16px; }
.bi-chart { height: 278px; display: flex; align-items: stretch; gap: 10px; }
.bi-column { min-width: 96px; flex: 1 0 96px; display: grid; grid-template-rows: 24px 184px 36px 18px; align-items: end; text-align: center; }
.bi-column > strong { align-self: center; font-size: 12px; }
.bi-bar-track { height: 184px; display: flex; align-items: end; justify-content: center; border-bottom: 1px solid #d9d5cf; background: #fbfbfa; }
.bi-bar-track i { width: min(46px, 58%); min-height: 4px; display: block; border-radius: 5px 5px 0 0; background: var(--green); }
.tone-blue .bi-bar-track i { background: var(--blue); }
.tone-amber .bi-bar-track i { background: #b07b14; }
.bi-column > span { align-self: start; max-height: 34px; overflow: hidden; padding: 7px 4px 0; color: var(--ink); font-size: 11px; font-weight: 700; line-height: 1.25; }
.bi-column > small { align-self: end; overflow: hidden; color: var(--muted); font-size: 10px; white-space: nowrap; }
.bi-chart-limit { padding: 0 18px 15px; color: var(--muted); font-size: 11px; text-align: right; }
.reward-dashboard { margin-bottom: 18px; }
.reward-dashboard-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.reward-dashboard-head span, .reward-dashboard-head small { color: var(--muted); font-size: 11px; font-weight: 700; }
.reward-dashboard-head h3 { margin-top: 4px; font-size: 18px; }
.reward-dashboard-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.reward-dashboard-actions .button { white-space: nowrap; }
.reward-metrics { margin-bottom: 14px; }
.reward-dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.reward-chart { min-width: 0; overflow: hidden; }
.reward-chart .section-head { min-height: 58px; padding: 0 16px; }
.reward-chart-body { display: grid; gap: 16px; min-height: 394px; padding: 18px 16px; }
.reward-rank-row { min-width: 0; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 9px; align-items: start; }
.reward-rank-order { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 4px; color: var(--muted); background: var(--ground); font-size: 10px; font-weight: 800; }
.reward-rank-content { min-width: 0; }
.reward-rank-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.reward-rank-label span { min-width: 0; overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.reward-rank-label strong { flex: 0 0 auto; font-size: 12px; }
.reward-rank-content > small { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.reward-bar-track { height: 7px; margin-top: 7px; overflow: hidden; border-radius: 2px; background: #f2efec; }
.reward-bar-track i { height: 100%; display: block; border-radius: inherit; background: var(--green); }
.reward-chart.tone-blue .reward-bar-track i { background: var(--blue); }
.reward-chart.tone-amber .reward-bar-track i { background: #b07b14; }
.reward-rank-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; color: var(--muted); font-size: 10px; }
.catalog-tabs { display: flex; gap: 6px; }
.catalog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.tab-button { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--muted); }
.tab-button.active { color: #fff; border-color: var(--green); background: var(--green); }
.catalog-module-guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: #faf9f8; }
.catalog-module-card { min-width: 0; display: flex; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.catalog-module-card > span { flex: 0 0 26px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); background: var(--ground); font-size: 12px; font-weight: 800; }
.catalog-module-card div { min-width: 0; }
.catalog-module-card strong, .catalog-module-card small { display: block; }
.catalog-module-card strong { margin-bottom: 5px; font-size: 13px; }
.catalog-module-card small { color: var(--muted); font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.catalog-module-card.active { border-color: #eacb9b; background: var(--green-soft); }
.catalog-module-card.active > span { color: #fff; background: var(--green); }
.settings-section { max-width: 760px; padding: 24px; }
.settings-section h3 { margin-bottom: 20px; }
.settings-section .section-title h3 { margin: 0; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-actions { display: flex; gap: 10px; margin-top: 22px; }
.settings-divider { height: 1px; margin: 26px 0; background: var(--line); }
.role-guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.role-guide article { min-height: 88px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.role-guide strong, .role-guide span { display: block; }
.role-guide strong { font-size: 14px; }
.role-guide span { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.account-settings { overflow: hidden; }
.account-form { display: grid; grid-template-columns: 1fr 1fr .9fr .8fr 1fr auto; align-items: end; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: #fbfbfa; }
.account-form .field { margin: 0; }
.account-form-actions { display: flex; gap: 8px; }
.role-note { color: var(--muted); font-size: 11px; }
.notice { margin-top: 20px; padding: 14px 16px; border-left: 3px solid var(--yellow); background: #fff9e7; color: #5d4a15; font-size: 13px; line-height: 1.6; }
.payment-notice { border-left-color: var(--green); background: var(--green-soft); color: #463c2f; }

.dialog { width: min(92vw, 620px); padding: 0; border: 0; border-radius: 8px; box-shadow: var(--shadow); }
.dialog.wide-dialog { width: min(94vw, 940px); }
.dialog::backdrop { background: rgba(48, 42, 35, 0.48); }
.dialog-shell { background: #fff; }
.wide-dialog .dialog-shell { max-height: 92vh; overflow-y: auto; }
.dialog-head { min-height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 25px; }
.icon-button:hover { background: var(--ground); color: var(--ink); }
.intake-layout { display: grid; grid-template-columns: 1fr 1fr; min-height: 440px; }
.upload-column, .result-column { padding: 24px; }
.upload-column { border-right: 1px solid var(--line); }
.drop-zone { min-height: 210px; display: grid; place-items: center; overflow: hidden; border: 1px dashed #bbb5ae; border-radius: 8px; background: #faf9f8; cursor: pointer; }
.drop-zone.dragging { border-color: var(--green); background: var(--green-soft); }
.drop-zone img { width: 100%; height: 260px; object-fit: contain; background: #f3f0ed; }
.upload-placeholder { display: grid; gap: 7px; text-align: center; }
.upload-placeholder strong { font-size: 14px; }
.upload-placeholder small { color: var(--muted); }
.upload-tools { display: flex; align-items: center; gap: 12px; margin: 10px 0 16px; }
.upload-tools .button { min-height: 36px; padding: 8px 13px; }
.upload-tools small { color: var(--muted); }
.batch-upload-panel { margin: 0 0 16px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.batch-upload-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 7px; font-size: 12px; }
.batch-upload-panel > header span { color: var(--muted); font-variant-numeric: tabular-nums; }
.batch-upload-panel progress { display: block; width: calc(100% - 24px); height: 6px; margin: 0 12px 9px; accent-color: var(--green); }
.batch-upload-list { max-height: 176px; overflow: auto; border-top: 1px solid var(--line); }
.batch-upload-item { width: 100%; min-height: 42px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 9px; padding: 7px 10px; border: 0; border-bottom: 1px solid #f2efec; color: var(--ink); background: #fff; text-align: left; cursor: pointer; }
.batch-upload-item:last-child { border-bottom: 0; }
.batch-upload-item:hover, .batch-upload-item.active { background: var(--green-soft); }
.batch-upload-item:disabled { cursor: default; opacity: 1; }
.batch-upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.batch-upload-status { color: var(--muted); font-size: 11px; white-space: nowrap; }
.batch-upload-status.ready, .batch-upload-status.saved { color: var(--green); }
.batch-upload-status.failed { color: var(--red); }
.batch-retry { min-width: 30px; min-height: 28px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #fff; font-size: 11px; }
.field { display: grid; gap: 7px; margin-top: 16px; }
.field > span { color: #58524a; font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 10px 11px; color: var(--ink); background: #fff; outline: none; }
.field input, .field select { min-height: 42px; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.searchable-field { gap: 6px; }
.searchable-field input[type="search"] { min-height: 36px; padding-top: 7px; padding-bottom: 7px; background: #fbfbfa; font-size: 12px; }
.form-note { min-height: 18px; margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.section-title { display: flex; align-items: center; justify-content: space-between; }
.confidence.neutral { color: var(--muted); background: var(--ground); }
.confidence.high { color: var(--green); background: var(--green-soft); }
.confidence.low { color: var(--yellow); background: var(--yellow-soft); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.span-2 { grid-column: span 2; }
.reward-preview { margin-top: 22px; display: flex; align-items: center; justify-content: space-between; padding: 16px; border: 1px solid #e0dad1; border-radius: 8px; background: var(--green-soft); }
.reward-preview span { color: #625647; font-size: 13px; }
.reward-preview strong { color: var(--green); font-size: 24px; }
.reward-preview.compact { margin-top: 16px; padding: 12px 14px; }
.reward-preview.compact strong { font-size: 20px; }
.recognized-product-lines { margin-top: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; }
.recognized-product-lines > strong { display: block; padding: 9px 11px; color: var(--muted); background: #fbfbfa; font-size: 11px; }
.recognized-product-lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 11px; border-top: 1px solid #f2efec; font-size: 12px; }
.recognized-product-lines span { min-width: 0; }
.recognized-product-lines small { flex: 0 0 auto; color: var(--muted); }
.dialog-actions { min-height: 72px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 0 24px; border-top: 1px solid var(--line); }
.record-fields { padding: 8px 24px 24px; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 20; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 11px 16px; border-radius: 6px; background: #302920; color: #fff; font-size: 13px; transition: .2s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding: 20px 10px; }
  .brand { justify-content: center; padding: 0 0 25px; }
  .brand div, .nav-item:not(.active) { font-size: 0; }
  .nav-item { justify-content: center; padding: 0; font-size: 0; }
  .nav-item span { font-size: 19px; }
  .sidebar-account div { display: none; }
  .sidebar-account { justify-content: center; }
  .main { padding: 24px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(2n) { border-right: 0; }
  .metric:not(:last-child) { border-bottom: 1px solid var(--line); }
  .metric:last-child { grid-column: span 2; border-right: 0; }
  .bi-metrics { grid-template-columns: 1fr 1fr; }
  .bi-filter-band { grid-template-columns: 1fr 1fr; }
  .bi-reset { width: 100%; }
  .reward-dashboard-grid { grid-template-columns: 1fr; }
  .reward-chart-body { min-height: 0; }
  .work-grid { grid-template-columns: 1fr; }
  .catalog-module-guide { grid-template-columns: 1fr; }
  .catalog-section > .section-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .catalog-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .inventory-panel { align-items: flex-start; flex-wrap: wrap; }
  .inventory-counts { margin-left: 46px; }
}

@media (max-width: 640px) {
  .app-shell { display: block; padding-bottom: 68px; }
  .sidebar { position: fixed; z-index: 10; top: auto; bottom: 0; width: 100%; height: 62px; padding: 7px 8px; border-top: 1px solid #504435; }
  .brand, .sidebar-account { display: none; }
  .nav { height: 100%; grid-template-columns: repeat(6, 1fr); gap: 2px; }
  .nav-item, .nav-item:not(.active) { min-height: 46px; display: grid; place-content: center; gap: 1px; padding: 0; font-size: 9px; text-align: center; }
  .nav-item span { width: auto; font-size: 17px; }
  .main { padding: 18px 14px 30px; }
  .topbar { align-items: center; margin-bottom: 18px; }
  .topbar p { display: none; }
  h1 { font-size: 23px; }
  .top-actions .secondary { display: none; }
  .button { padding: 0 12px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 92px; padding: 15px; }
  .metric-value { font-size: 23px; }
  .work-grid { margin-top: 14px; gap: 14px; }
  .inventory-panel { gap: 10px; }
  .inventory-copy { width: 100%; }
  .inventory-counts { margin-left: 0; }
  .inventory-panel .button { margin-left: auto; }
  .bi-toolbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .segmented { width: 100%; }
  .bi-date-range { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; }
  .bi-date-range input { width: 100%; min-width: 0; }
  .bi-date-range .button { grid-column: 1 / -1; }
  .bi-filter-band { grid-template-columns: 1fr 1fr; padding: 12px; }
  .bi-filter-band .bi-reset { grid-column: 1 / -1; }
  .bi-result-line { align-items: flex-start; flex-direction: column; gap: 8px; }
  .bi-result-actions { width: 100%; justify-content: space-between; }
  .bi-metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .bi-metric { min-height: 82px; padding: 13px; }
  .bi-metric strong { font-size: 19px; }
  .bi-chart-scroll { padding: 16px 12px 12px; }
  .bi-chart { height: 262px; }
  .bi-column { grid-template-rows: 24px 168px 36px 18px; }
  .reward-dashboard-head { align-items: flex-start; flex-direction: column; gap: 6px; }
  .reward-dashboard-head h3 { font-size: 16px; }
  .reward-dashboard-actions { width: 100%; align-items: flex-start; flex-direction: column; gap: 8px; }
  .reward-dashboard-actions .button { width: 100%; }
  .reward-chart .section-head { min-height: 64px; align-items: center; flex-direction: row; }
  .catalog-tabs { width: 100%; overflow-x: auto; }
  .catalog-tabs .tab-button { flex: 1 0 auto; }
  .bi-bar-track { height: 168px; }
  .side-band { display: none; }
  .section-head { padding: 0 14px; }
  .data-section > .section-head { min-height: 112px; align-items: flex-start; flex-direction: column; justify-content: center; }
  .catalog-actions { width: 100%; flex-wrap: wrap; justify-content: flex-start; }
  .data-table th, .data-table td { padding: 12px; }
  .dialog, .dialog.wide-dialog { width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; }
  .dialog-shell { min-height: 100%; }
  .intake-layout { grid-template-columns: 1fr; }
  .upload-column { border-right: 0; border-bottom: 1px solid var(--line); }
  .drop-zone { min-height: 150px; }
  .drop-zone img { height: 200px; }
  .upload-tools { justify-content: space-between; }
  .settings-grid { grid-template-columns: 1fr; }
  .role-guide { grid-template-columns: 1fr; }
  .account-form { grid-template-columns: 1fr 1fr; }
  .account-form-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .settings-grid .span-2, .form-grid .span-2 { grid-column: auto; }
  .dialog-actions { position: sticky; bottom: 0; background: #fff; }
}

/* Captured receipts use the same review form and archive visual language. */
.employee-archives .data-table {table-layout:fixed;min-width:760px}
.employee-archives th:nth-child(1){width:18%}.employee-archives th:nth-child(2){width:20%}
.employee-archives th:nth-child(3){width:28%}.employee-archives th:nth-child(4){width:18%;text-align:center}
.employee-archives td:nth-child(4){text-align:center}.employee-archives th:last-child{width:16%}
.binding-status{display:inline-block;padding:4px 10px;border-radius:4px;background:#f5f3f0;color:#756f68;font-size:12px}
.binding-status.bound{background:#f1ebe4;color:#99520b}.capture-thumb{width:52px;height:64px;object-fit:contain;background:#f8f7f5;border:1px solid #e6e1db}
.capture-table td small{display:block;color:#847e77;margin-top:5px}.capture-table .capture-warning{color:#9c641f}.capture-table td:first-child{max-width:300px}.capture-table td:first-child strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.capture-source{padding:14px;background:#f8f6f3;border:1px solid #e7e2dc;border-radius:5px;font-size:13px;overflow-wrap:anywhere}
.capture-source p{margin:8px 0}.capture-raw{white-space:pre-wrap;max-height:220px;overflow:auto}
.capture-review .upload-tools,.capture-review .batch-upload-panel,.capture-review #recognized-product-lines,
.capture-review .field:has(#proof-product),.capture-review .field:has(#proof-quantity){display:none!important}
.capture-review #drop-zone{cursor:zoom-in}.capture-review #proof-preview{max-height:440px;object-fit:contain}
.collector-panel{padding:20px;margin-bottom:20px}.collector-header{display:flex;justify-content:space-between;gap:16px;align-items:center}.collector-header p{color:var(--muted);margin:8px 0;font-size:13px}.collector-controls{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:15px}.collector-controls input,.collector-controls select{padding:9px;border:1px solid var(--line);border-radius:4px;min-width:0}.collector-pair{margin-top:10px;color:var(--muted);font-size:13px}.collector-group-list{max-height:340px;overflow:auto;display:grid;gap:6px;margin-top:14px}.collector-group-list label{padding:10px;background:var(--ground);border-bottom:1px solid var(--line)}.collector-controls [hidden]{display:none!important}
.collector-connect-dialog{width:min(92vw,480px);height:fit-content;max-height:90vh;border:1px solid var(--line);border-radius:0;overflow-y:auto}
.collector-connect-dialog .dialog-shell{min-height:0}.collector-connect-dialog .dialog-head{min-height:64px;gap:16px}.collector-connect-dialog .dialog-head h2{font-size:16px;font-weight:600}
.collector-connect-body{padding:28px 28px 24px;text-align:center}.collector-connect-body h3{margin:18px 0 10px;font-size:20px;font-weight:600}.collector-connect-body>p{min-height:44px;margin:0;color:var(--muted);font-size:14px;line-height:1.7;overflow-wrap:anywhere}
.collector-connect-symbol{display:inline-grid;place-items:center;width:44px;height:44px;border:3px solid #ffe7c7;border-top-color:#ff9b19;border-radius:50%;animation:collector-connect-spin 1s linear infinite}
.collector-connect-dialog[data-state="success"] .collector-connect-symbol,.collector-connect-dialog[data-state="error"] .collector-connect-symbol{border:0;border-radius:0;animation:none;background:#fff2df;color:#99520b;font-size:27px;font-weight:600}
.collector-connect-dialog[data-state="error"] .collector-connect-symbol{background:var(--red-soft);color:var(--red)}
.collector-connect-note{margin-top:24px;padding:16px;text-align:left;border-left:3px solid #ff9b19;background:#fff8ee;font-size:13px;line-height:1.7}.collector-connect-note strong{color:#7e4309;font-weight:600}.collector-connect-note p{margin:6px 0 0;color:var(--muted)}
.collector-connect-dialog .dialog-actions{min-height:68px;justify-content:flex-start}.collector-connect-dialog [hidden]{display:none!important}
@keyframes collector-connect-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.collector-connect-symbol{animation:none}}
.capture-review .intake-layout{grid-template-columns:minmax(0,1fr) 360px;align-items:start}.capture-review .result-column{grid-column:1;grid-row:1}.capture-review .upload-column{grid-column:2;grid-row:1}.capture-review .dialog-actions{position:sticky;bottom:0;background:white;border-top:1px solid var(--line)}.capture-review #confidence-badge{display:none}.capture-review .result-column .section-title h3{font-size:16px}.capture-review #drop-zone{min-height:160px;background:#f6f4f0}.capture-review #proof-preview{height:auto;max-height:480px}
.capture-line{display:grid;grid-template-columns:minmax(0,1fr) 75px auto;gap:8px;margin:9px 0;align-items:center}
.capture-line select,.capture-line input{min-width:0;width:100%;padding:9px;border:1px solid #d9d3cb;border-radius:3px}
#capture-count:empty{display:none}#capture-count{margin-left:auto;font-size:12px;padding:2px 6px;background:#ffc557;color:#68471f;border-radius:4px}
@media(max-width:760px){.nav{overflow-x:auto}.capture-table{min-width:700px}.capture-line{grid-template-columns:minmax(0,1fr) 60px auto}.capture-source{font-size:12px}}
@media(max-width:900px){.capture-review .intake-layout{grid-template-columns:1fr}.capture-review .upload-column,.capture-review .result-column{grid-column:auto;grid-row:auto}.collector-header{align-items:flex-start}}
.dialog.collector-group-dialog,.dialog.capture-delete-dialog{height:fit-content;max-height:90dvh;border-radius:0}
.collector-group-dialog .dialog-shell,.capture-delete-dialog .dialog-shell{min-height:0}
.collector-group-dialog .record-fields{padding-top:20px}
.collector-group-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:16px}
.collector-group-toolbar>input{width:100%;min-width:0;height:36px;border:1px solid var(--line);padding:0 10px}
.collector-group-dialog .collector-checkbox,.collector-group-dialog .collector-group-list label,.capture-review .capture-binding-option{display:flex;align-items:center;gap:10px;line-height:1.6;cursor:pointer}
.collector-group-dialog input[type="checkbox"],.capture-review .capture-binding-option input[type="checkbox"]{flex:0 0 16px;width:16px;height:16px;min-height:0;margin:0;padding:0;box-shadow:none}
.collector-group-dialog .collector-checkbox{white-space:nowrap}
.collector-group-dialog .collector-group-list{max-height:min(48dvh,380px);gap:6px}
.collector-group-dialog .collector-group-list label{min-height:44px;padding:10px 12px;margin:0}
.collector-group-dialog .collector-group-list label span{min-width:0;overflow-wrap:anywhere}
.collector-group-dialog .dialog-actions{flex-wrap:wrap;justify-content:space-between;gap:12px;padding:16px 24px}
.dialog.collector-group-dialog{width:min(94vw,760px)}
.collector-group-dialog .dialog-head h2{margin:0;font-size:17px}.collector-group-dialog .dialog-head p{margin:6px 0 0;font-weight:400}
.collector-group-dialog .record-fields{max-height:calc(90dvh - 152px);overflow:auto;padding-bottom:20px}
.collector-group-dialog [hidden]{display:none!important}
.collector-plan-toolbar,.collector-plan-range{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:14px}
.collector-plan-toolbar>select{flex:1;min-width:150px}.collector-plan-range>label{font-size:13px;color:var(--muted)}
.collector-plan-toolbar select,.collector-plan-range select,.collector-plan-range input,.collector-plan-editor>input{min-width:0;max-width:100%;height:36px;border:1px solid var(--line);border-radius:0;background:#fff;padding:0 10px}
.collector-plan-range small,.collector-plan-editor small{color:var(--muted);font-size:12px;line-height:1.6}
.collector-plan-range>span{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.collector-plan-range input{max-width:200px}
.collector-plan-editor{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:8px;padding:12px;background:#fff8ee;border:1px solid #f1dfc5;margin-bottom:14px}
.collector-plan-editor label{font-size:13px}.collector-plan-editor small{grid-column:1/-1;overflow-wrap:anywhere}
.collector-group-feedback{margin:10px 0;color:var(--green);font-size:13px;line-height:1.6;overflow-wrap:anywhere}.collector-group-feedback:empty{display:none}
.collector-picked{margin-top:16px}.collector-picked:empty{display:none}
.collector-section-title,.collector-group-section h3{font-size:13px;font-weight:600;margin:0 0 10px;display:flex;align-items:center;justify-content:space-between}
.collector-selected-chips{display:flex;flex-wrap:wrap;gap:8px;max-height:94px;overflow:auto;padding-bottom:4px}
.collector-selected-chip{max-width:100%;display:flex;align-items:center;gap:10px;border:1px solid #f1d1a5;background:#fff2df;color:#7e4309;font-size:12px;padding:6px 9px;text-align:left;overflow-wrap:anywhere;border-radius:0}
.collector-selected-chip span{font-size:16px;line-height:1;flex-shrink:0}.collector-selected-chip:hover{border-color:#e08510;background:#ffe9c9}
.collector-group-dialog .collector-group-list{display:block;max-height:min(35dvh,340px);margin-top:18px}
.collector-group-section+.collector-group-section{margin-top:20px}
.collector-group-row{display:flex;align-items:center;gap:12px;border:1px solid var(--line);margin-bottom:6px;background:#fcfbf9}
.collector-group-row:has(input:checked){border-color:#f0ce9d;background:#fff8ee}
.collector-group-dialog .collector-group-row label{flex:1;min-width:0;border:0;background:transparent;margin:0;padding:10px 12px}
.collector-group-row label strong{display:block;font-size:13px;font-weight:500}.collector-group-row label small{display:block;color:var(--muted);font-size:12px;margin-top:3px;overflow-wrap:anywhere}
.collector-group-actions{display:flex;gap:10px;align-items:center;padding-right:12px;flex-shrink:0}
.collector-text-button,.collector-star{border:0;background:transparent;padding:4px 0;font-size:12px;color:var(--muted);border-radius:0}.collector-text-button:hover{color:#99520b;text-decoration:underline}
.collector-star{font-size:22px;padding:2px 4px;line-height:1;color:#8a8072}.collector-star.is-favorite{color:#c5760b}.collector-star:hover{color:#e08510}
.collector-group-hint,.collector-group-empty{margin:12px 0 0;font-size:12px;line-height:1.7;color:var(--muted)}
.collector-controls #collector-quick-plan{max-width:220px}.collector-group-toolbar>input:focus,.collector-plan-editor>input:focus{outline:2px solid #ffc557;outline-offset:1px}
@media(max-width:600px){.collector-plan-editor{grid-template-columns:minmax(0,1fr) auto auto}.collector-plan-editor label{grid-column:1/-1}.collector-group-actions{gap:6px;padding-right:8px}.collector-group-dialog .collector-group-row label{padding:9px 8px}.collector-plan-range input{max-width:100%}.collector-plan-range>span{width:100%}}
.capture-review .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.capture-review .field,.capture-review .capture-line,.capture-review .result-column,.capture-review .upload-column{min-width:0}
.capture-review .field input,.capture-review .field select,.capture-review .field textarea{min-width:0;max-width:100%}
.capture-review #capture-source{margin-top:12px}
.capture-review .capture-sender-id{display:grid;gap:5px}
.capture-review .capture-sender-id span{color:var(--muted);font-size:12px}
.capture-review .capture-sender-id code{font-size:12px;overflow-wrap:anywhere}
.capture-review #capture-lines{margin-top:20px}
.capture-review #capture-lines h3{margin:0;font-size:15px}
.capture-review .capture-line{grid-template-columns:minmax(0,1fr) 76px auto;align-items:center}
.capture-review #capture-add-line{margin-top:10px}
.capture-review #proof-text{min-height:90px}
.capture-review #capture-binding-choice{margin-top:16px}
.capture-review .capture-binding-option{align-items:flex-start;margin:0}
.capture-review .capture-binding-option input[type="checkbox"]{margin-top:3px}
.capture-delete-dialog .record-fields{padding-top:16px;line-height:1.7}
.capture-delete-dialog #capture-delete-error{color:var(--red)}
@media(max-width:600px){.collector-group-toolbar{grid-template-columns:minmax(0,1fr);gap:12px}.capture-review .capture-line{grid-template-columns:minmax(0,1fr) 64px auto}.capture-review .form-grid{grid-template-columns:minmax(0,1fr)}.capture-review .span-2{grid-column:auto}}

/* Share columns between the heading and every product row. */
.capture-review #capture-lines{--capture-columns:minmax(0,1fr) 64px 128px 44px;--capture-column-gap:8px}
.capture-review #capture-line-rows{display:grid;gap:12px}
.capture-review .capture-line-heading,.capture-review .capture-line{display:grid;grid-template-columns:var(--capture-columns);column-gap:var(--capture-column-gap);align-items:center;margin:0}
.capture-review .capture-line-heading{margin-bottom:8px}
.capture-line-heading>span,.capture-reward-hint{font-size:12px;color:var(--muted);line-height:1.5}
.capture-line-heading>span{white-space:nowrap}
.capture-number-field{display:contents}
.capture-number-field>span{display:none}
.capture-number-field>input{grid-row:1;height:40px}
.capture-number-field>*{grid-column:2}
.capture-number-field:last-of-type>*{grid-column:3}
.capture-review .capture-line>select,.capture-review .capture-line>.console-select{grid-column:1;grid-row:1;min-width:0}
.capture-review .capture-line>select,.capture-review .capture-line .console-select-trigger,.capture-review .capture-line>[aria-label="删除此商品"]{height:40px}
.capture-review .capture-line>[aria-label="删除此商品"]{grid-column:4;grid-row:1}
.capture-reward-hint{margin:10px 0 0}
.capture-review #recognition-note:empty{display:none}
.capture-review .reward-preview{margin-top:12px}
@media(max-width:600px){.capture-review #capture-lines{--capture-columns:minmax(0,1fr) 48px 86px 38px;--capture-column-gap:6px}.capture-line-heading>span{font-size:11px}.capture-review .capture-line>[aria-label="删除此商品"]{padding:6px}}

/* The three archive tabs share the existing console controls and brand palette. */
.incentive-catalog-intro{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:18px 0}
.incentive-catalog-intro>p{margin:0;color:var(--muted);font-size:13px;line-height:1.7}
.incentive-subtabs{display:flex;flex-shrink:0;border:1px solid var(--line);background:#fff}
.incentive-subtabs button{border:0;background:transparent;padding:7px 16px;color:var(--muted);white-space:nowrap}
.incentive-subtabs button+button{border-left:1px solid var(--line)}
.incentive-subtabs button.active{background:var(--green-soft);color:var(--green);font-weight:600}
.incentive-status{color:var(--green);font-size:12px}.incentive-status.muted{color:var(--muted)}
#record-dialog{max-height:90dvh;overflow:hidden}
#record-dialog .dialog-shell{display:flex;flex-direction:column;max-height:90dvh;min-height:0}
#record-dialog .record-fields{overflow:auto;min-height:0;padding-bottom:24px}
#record-dialog .dialog-head,#record-dialog .dialog-actions{flex-shrink:0}
.incentive-category-field{border:0;margin:20px 0 0;padding:0;min-width:0}
.incentive-category-field legend{font-size:12px;font-weight:600;color:var(--muted);margin-bottom:9px}
.incentive-category-picker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;border:1px solid var(--line);padding:12px;max-height:220px;overflow:auto}
.incentive-category-picker label{display:flex;align-items:flex-start;gap:8px;font-size:13px;line-height:1.6}
.incentive-category-picker input{width:15px;height:15px;margin-top:3px;accent-color:#e08510;flex-shrink:0}
.incentive-category-field p,.incentive-category-picker>p{color:var(--muted);font-size:12px;line-height:1.7;margin:8px 0 0;grid-column:1/-1}
.incentive-form-error,.capture-rule-issue{font-size:13px;color:var(--red);line-height:1.7;overflow-wrap:anywhere}
.incentive-form-error:empty,.capture-rule-issue:empty{display:none}
.capture-rule-issue{margin:4px 0 0;grid-column:1/-1}
.capture-rule-detail{font-size:12px;color:var(--muted);grid-column:1/-1;line-height:1.6;margin:0}
@media(max-width:760px){.incentive-catalog-intro{align-items:flex-start;flex-direction:column;gap:10px}.incentive-category-picker{grid-template-columns:minmax(0,1fr)}}

.incentive-pending-filter{display:flex;align-items:center;gap:6px;white-space:nowrap;font-size:13px;color:var(--text-secondary,#667085)}
.incentive-pending-filter input{width:14px;height:14px;margin:0;accent-color:#FF9B19}
.incentive-needs-configuration{color:#a9630b}

/* Keep archive columns visible; full values remain available on hover and in Edit. */
#catalog-table .data-table{table-layout:fixed;min-width:850px}
#catalog-table .data-table th,#catalog-table .data-table td{padding-left:10px;padding-right:10px;overflow:hidden;text-overflow:ellipsis}
#catalog-table .data-table th:last-child{width:112px}
#catalog-table .data-table th:nth-last-child(2){width:64px}
#catalog-table[data-catalog-type="products"] th:nth-child(1){width:8%}
#catalog-table[data-catalog-type="products"] th:nth-child(2){width:22%}
#catalog-table[data-catalog-type="products"] th:nth-child(3){width:15%}
#catalog-table[data-catalog-type="products"] th:nth-child(4){width:11%}
#catalog-table[data-catalog-type="products"] th:nth-child(5){width:12%}

#record-dialog.incentive-rule-dialog{width:min(94vw,820px)}
.incentive-rule-dialog .record-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:20px}
.incentive-rule-products{grid-column:1/-1;min-width:0;border:0;padding:0;margin:20px 0 0}
.incentive-rule-products legend{font-size:14px;font-weight:600}
#rule-products-count{margin-left:8px;color:#a9630b;font-size:12px;font-weight:400}
.incentive-rule-products>p,.incentive-product-rule-summary>p{font-size:12px;color:var(--muted);line-height:1.7;margin:8px 0 12px}
.incentive-product-toolbar{display:flex;gap:8px;margin-bottom:10px}
.incentive-product-toolbar input{min-width:0;flex:1;height:36px;padding:0 10px;border:1px solid var(--line);border-radius:0;font-size:12px}
.incentive-product-toolbar button{white-space:nowrap;border-radius:0}
.incentive-product-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border:1px solid var(--line);max-height:240px;overflow:auto;align-content:start}
.incentive-product-option{display:flex;align-items:flex-start;gap:9px;min-width:0;padding:12px;cursor:pointer;border-bottom:1px solid var(--line)}
.incentive-product-option:hover{background:#fff9ee}
.incentive-product-option:has(input:checked){background:#fff5e3}
.incentive-product-option input{width:15px;height:15px;flex-shrink:0;margin:3px 0 0;accent-color:#E08510}
.incentive-product-option>span{min-width:0;font-size:12px;line-height:1.65;overflow-wrap:anywhere}
.incentive-product-option strong{font-weight:500}
.incentive-product-option small{display:block;color:var(--muted);font-size:11px;margin-top:4px}
.incentive-product-list>.empty{grid-column:1/-1}
.incentive-rule-dialog .incentive-form-error{grid-column:1/-1}
.incentive-product-rule-summary{margin-top:20px;font-size:13px}
.incentive-product-rule-summary>div{display:flex;justify-content:space-between;gap:12px;border-top:1px solid var(--line);padding:10px 0}
.incentive-product-rule-summary>div strong{white-space:nowrap;color:#a9630b}
@media(max-width:760px){#record-dialog.incentive-rule-dialog{width:100%}.incentive-rule-dialog .record-fields,.incentive-product-list{grid-template-columns:minmax(0,1fr)}.incentive-product-toolbar{flex-wrap:wrap}.incentive-product-toolbar input{flex-basis:100%}}

body.auth-readonly.auth-catalog-manager #catalog-table .row-actions{display:flex!important}

/* Archive identities can be saved before their optional associations are configured. */
#record-dialog.party-archive-dialog{width:min(94vw,720px)}
#record-dialog.employee-archive-dialog{width:min(94vw,620px)}
#record-dialog.party-archive-dialog #record-fields{align-items:start;gap:20px}
#record-dialog.party-archive-dialog #record-fields>.field{display:flex;flex-direction:column;gap:8px;align-self:start}
#record-dialog.party-archive-dialog .field input,#record-dialog.party-archive-dialog .field select,#record-dialog.party-archive-dialog .console-select-trigger{height:36px;min-height:36px}
#record-dialog.party-archive-dialog .record-store-field,#record-dialog.party-archive-dialog #record-new-store,#record-dialog.party-archive-dialog .incentive-form-error{grid-column:1/-1}
.record-store-picker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;min-width:0}
@media(max-width:760px){#record-dialog.party-archive-dialog #record-fields,.record-store-picker{grid-template-columns:minmax(0,1fr)}#record-dialog.party-archive-dialog #record-fields{gap:16px}}

/* Keep the employee mode beside its label without shifting the store controls. */
.capture-employee-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:4px 12px}
.capture-store-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:4px 12px}
.capture-store-heading label{margin:0}
.capture-store-heading .mini-button{flex:0 0 auto;min-height:18px;padding:0 4px;font-size:12px;line-height:1.5;white-space:nowrap}
.capture-store-heading .mini-button:disabled{color:var(--muted);border-color:var(--line);background:#f3f1ed}
.capture-new-employee-option{display:inline-flex;align-items:center;gap:6px;font-size:12px;line-height:1.5;cursor:pointer}
.capture-new-employee-option[hidden]{display:none}
.field .capture-new-employee-option input[type="checkbox"]{width:16px;height:16px;min-height:0;margin:0;padding:0;accent-color:var(--brand,#ff9b19)}

.current-store-rules{grid-column:1/-1;margin-bottom:16px}
.current-store-rules>.field{margin-top:12px}
.current-store-rules>p{font-size:12px;color:var(--muted);line-height:1.6}
