:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-muted: #f8fafb;
  --border: #d9e0e6;
  --border-strong: #bcc7d1;
  --text: #17212b;
  --muted: #5f6b76;
  --blue: #1769aa;
  --blue-strong: #10588f;
  --blue-soft: #eaf3fa;
  --green: #197149;
  --green-soft: #eaf6ef;
  --amber: #9a5b09;
  --amber-soft: #fff5df;
  --red: #b33a3a;
  --red-soft: #fff0f0;
  --shadow: 0 1px 2px rgb(15 23 42 / 8%);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input,
select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled,
select:disabled { cursor: not-allowed; opacity: 0.58; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
h1,
h2,
h3,
p { margin: 0; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgb(23 105 170 / 24%);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 12px;
  color: #fff;
  background: var(--blue);
  border-radius: 6px;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-inner,
.main-inner {
  width: min(1600px, calc(100% - 32px));
  margin: 0 auto;
}

.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0 14px;
}

.title-group {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: var(--blue);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark > span {
  position: absolute;
  bottom: 9px;
  width: 5px;
  border-radius: 2px 2px 1px 1px;
  background: currentColor;
  content: "";
}

.brand-mark::before { left: 9px; height: 11px; }
.brand-mark > span { left: 18px; height: 18px; }
.brand-mark::after { left: 27px; height: 25px; }

.title-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.title-copy strong {
  color: var(--text);
  font-size: 23px;
  font-weight: 720;
  line-height: 1.25;
}

.title-copy span { color: var(--muted); font-size: 13px; }

.header-side {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 14px;
}

.snapshot-meta {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  gap: 6px 18px;
  margin: 0;
  font-size: 12px;
}

.snapshot-meta div { display: grid; min-width: 0; gap: 2px; }
.snapshot-meta dt { color: var(--muted); }
.snapshot-meta dd { margin: 0; color: var(--text); font-weight: 650; white-space: nowrap; }

.account-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}

.account-actions form { margin: 0; }
.account-name {
  max-width: 150px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-navigation,
.dashboard-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.app-nav-link,
.dashboard-tab {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 16px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  font-size: 13px;
  font-weight: 620;
  white-space: nowrap;
}

.app-nav-link:hover,
.dashboard-tab:hover { color: var(--blue); background: var(--surface-muted); }
.app-nav-link[aria-current="page"],
.dashboard-tab[aria-selected="true"] { color: var(--blue); border-bottom-color: var(--blue); }

.main-inner { padding: 18px 0 36px; }
.page-shell { min-height: calc(100vh - 120px); }

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.site-footer-inner {
  width: min(1600px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0 22px;
  text-align: center;
  font-size: 12px;
}

.site-footer a:hover { color: var(--blue); text-decoration: underline; }

.control-band {
  display: grid;
  grid-template-columns: minmax(138px, 160px) minmax(138px, 160px) minmax(230px, 1fr) minmax(230px, 1fr) auto;
  align-items: end;
  gap: 14px;
  padding: 14px 0 18px;
  border-bottom: 1px solid var(--border);
}

.field,
.form-field,
.stacked-form > div {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.field-label,
label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.field-label { display: inline-flex; align-items: center; gap: 7px; }
.label-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.product-dot { background: var(--blue); }
.option-dot { background: var(--green); }
.period-dot { background: var(--amber); }

input,
select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  overflow: hidden;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  text-overflow: ellipsis;
}

input:focus,
select:focus { border-color: var(--blue); }
select:disabled { color: #81909c; background: #f1f4f6; }
input[type="file"] { padding: 7px 9px; }
input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 5px 8px;
  color: var(--blue);
  background: var(--blue-soft);
  border: 0;
  border-radius: 4px;
  font-weight: 650;
}

.button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  color: #34414d;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
}

.button:hover { color: var(--blue); border-color: var(--blue); }
.button-primary { color: #fff; background: var(--blue); border-color: var(--blue); }
.button-primary:hover { color: #fff; background: var(--blue-strong); border-color: var(--blue-strong); }
.button-secondary { background: var(--surface); }
.mapping-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.mapping-select-cell { min-width: 260px; }
.mapping-select-cell select { min-width: 240px; }
.button-quiet { min-height: 30px; padding: 5px 9px; color: var(--muted); border-color: var(--border); }
.button-wide { width: 100%; }
.button-feishu { color: #fff; background: #3370ff; border-color: #3370ff; }
.button-feishu:hover { color: #fff; background: #245fe7; border-color: #245fe7; }
.query-button { min-width: 74px; min-height: 40px; }

.dashboard-tabs { margin-top: 8px; border-bottom: 1px solid var(--border); }
.dashboard-tab { min-height: 46px; }
.dashboard-panel[hidden] { display: none; }
.panel { padding-top: 20px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.kpi-card {
  min-height: 142px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--blue);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.kpi-card.finance { border-top-color: var(--green); }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.kpi-title-copy { display: grid; gap: 2px; }
.kpi-eyebrow { color: var(--muted); font-size: 11px; font-weight: 650; }
.kpi-label { color: var(--text); font-size: 13px; font-weight: 700; }
.kpi-badge {
  padding: 4px 8px;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.finance .kpi-badge { color: var(--green); background: var(--green-soft); }
.kpi-value-row { display: flex; align-items: baseline; gap: 7px; margin-top: 12px; }
.kpi-value {
  min-height: 34px;
  color: var(--text);
  font-size: 27px;
  font-weight: 740;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.finance .kpi-value { color: var(--green); }
.kpi-unit { color: var(--muted); font-size: 12px; font-weight: 650; }
.kpi-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
  padding-top: 10px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.kpi-comparison { display: grid; gap: 1px; }
.kpi-comparison strong { color: var(--text); font-weight: 700; }

.section-block,
.form-panel,
.data-section {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.section-block + .section-block,
.data-section + .data-section { margin-top: 16px; }

.panel-heading,
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.heading-copy,
.section-title { display: flex; align-items: center; min-width: 0; gap: 10px; }
.heading-copy > div,
.section-title > div { min-width: 0; }
h2 { color: var(--text); font-size: 17px; font-weight: 720; line-height: 1.3; }
h3 { color: var(--text); font-size: 15px; line-height: 1.3; }
.heading-icon,
.section-marker {
  display: inline-block;
  width: 5px;
  height: 30px;
  flex: 0 0 5px;
  background: var(--blue);
  border-radius: 3px;
}

.heading-icon.blue,
.marker-blue { background: var(--blue); }
.marker-amber { background: var(--amber); }
.marker-green { background: var(--green); }
.selection-context,
.section-heading p,
.form-panel-title p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.heading-copy .pa-selection-context {
  max-width: min(100%, 1080px);
  color: #0f172a;
  font-size: 11.5px;
  font-weight: 750;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.heading-copy .pa-selection-context::before { content: "投放广告商品："; font-weight: 800; }
.panel-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.panel-note,
.section-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }

.table-shell,
.table-scroll {
  width: 100%;
  max-height: 560px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  scrollbar-width: thin;
}

.data-table {
  width: 100%;
  min-width: 1000px;
  border-collapse: separate;
  border-spacing: 0;
  color: #2c3742;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.daily-table { min-width: 3480px; }
.pa-table { min-width: 2430px; }

.data-table.detail-table { width: max-content; min-width: 100%; font-size: 14px; }
.detail-table th, .detail-table td { min-width: 100px; }
.detail-table .detail-fixed-column { position: sticky; z-index: 4; background: var(--surface); }
.detail-table .detail-fixed-1 { left: 0; min-width: 116px; }
.detail-table .detail-fixed-2 { left: var(--detail-first-width, 116px); min-width: 76px; }
.detail-table .detail-fixed-3 { left: var(--detail-second-offset, 192px); min-width: 160px; max-width: 260px; }
.data-table.detail-table th { font-size: 14px; }
.data-table.detail-table th.detail-fixed-column { z-index: 6; background: #e7edf2; }
.data-table.detail-table th[data-detail-group] { background: var(--detail-header-color); }
.detail-table tbody tr:hover .detail-fixed-column { background: #f3f7fa; }
.detail-table .detail-summary-label { position: sticky; left: 0; z-index: 4; background: #eef2f5; }
.detail-table .detail-bar-cell { position: relative; isolation: isolate; }
.detail-data-bar { position: absolute; left: 0; top: 0; bottom: 0; z-index: -1; pointer-events: none; }
.detail-data-bar.is-negative { left: auto; right: 0; }
.detail-table [hidden] { display: none !important; }
.detail-column-picker { position: relative; }
.detail-column-picker > summary { padding: 8px 12px; cursor: pointer; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.detail-column-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: min(620px, 85vw); max-height: 460px; overflow: auto; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: 0 12px 30px #0f172a26; font-size: 14px; }
.detail-column-menu > p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.detail-column-menu fieldset { display: grid; min-width: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 8px 12px; margin: 12px 0 0; padding: 10px; border: 1px solid var(--border); border-radius: 6px; }
.detail-column-menu legend { padding: 0 6px; font-size: 14px; font-weight: 700; }
.detail-column-menu label { display: flex; min-width: 0; gap: 8px; align-items: center; font-size: 14px; font-weight: 500; line-height: 1.5; cursor: pointer; }
.detail-column-menu input[type="checkbox"] { flex: 0 0 16px; width: 16px; height: 16px; min-height: 16px; margin: 0; padding: 0; accent-color: var(--blue); }
.detail-column-menu label span { min-width: 0; overflow-wrap: anywhere; }
.detail-column-actions { display: flex; gap: 8px; }
.detail-column-actions button { padding: 5px 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); cursor: pointer; }
.detail-column-menu .detail-column-error { margin: 12px 0 0; color: var(--red); }
.inventory-column-picker { position: relative; }
.inventory-column-picker > summary { padding: 8px 12px; cursor: pointer; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.inventory-column-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: min(360px, 85vw); max-height: 460px; overflow: auto; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: 0 12px 30px #0f172a26; font-size: 14px; }
.inventory-column-menu > p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.inventory-column-actions { display: flex; gap: 8px; margin-bottom: 10px; }
.inventory-column-actions button { padding: 5px 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); cursor: pointer; }
.inventory-column-choices { display: grid; gap: 8px; }
.inventory-column-choices label { display: flex; min-width: 0; gap: 8px; align-items: center; font-size: 14px; font-weight: 500; line-height: 1.5; cursor: pointer; }
.inventory-column-choices input { flex: 0 0 16px; width: 16px; height: 16px; min-height: 16px; margin: 0; padding: 0; accent-color: var(--blue); }
.inventory-column-choices span { min-width: 0; overflow-wrap: anywhere; }
.inventory-column-menu .inventory-column-error { margin: 12px 0 0; color: var(--red); }
@media (max-width: 600px) {
  .inventory-column-picker[open] { width: 100%; }
  .inventory-column-menu { position: static; width: 100%; max-height: none; margin-top: 8px; }
}

.data-table th,
.data-table td {
  height: 42px;
  padding: 8px 11px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  border-right: 1px solid #e6ebef;
  border-bottom: 1px solid #e6ebef;
}

.data-table th:last-child,
.data-table td:last-child { border-right: 0; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 44px;
  color: #34414d;
  background: #eef2f5;
  font-weight: 700;
}

.header-note {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
}

.data-table th:first-child,
.data-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: 1px 0 0 #e2e8ed;
}

.data-table th:first-child { z-index: 4; background: #e7edf2; }
.data-table tbody tr:hover td { background: #f3f7fa; }
.data-table tbody tr:hover td:first-child { background: #f3f7fa; }

.data-table th.metric-blue,
.data-table td.metric-blue { color: #1d4ed8; background: #f4f8ff; }
.data-table th.metric-blue { background: #e7f1ff; }
.data-table th.metric-amber,
.data-table td.metric-amber { color: #a16207; background: #fffbeb; }
.data-table th.metric-amber { background: #fff4d8; }
.data-table th.metric-green,
.data-table td.metric-green { color: #047857; background: #ecfdf5; }
.data-table th.metric-green { background: #c9f5dc; }
.data-table tbody tr:hover td.metric-blue { background: #eaf2ff; }
.data-table tbody tr:hover td.metric-amber { background: #fff5df; }
.data-table tbody tr:hover td.metric-green { background: #e3f8eb; }

.data-table .strong { font-weight: 760; }
.calendar-red,
.negative { color: var(--red) !important; font-weight: 700; }
.keyword-cell,
.text-left {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty-row td,
.empty-cell { height: 112px; color: #87939e; }
.empty-state {
  display: grid;
  min-height: 150px;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  text-align: center;
}

.export-options { position: relative; }
.export-options summary { color: var(--blue); cursor: pointer; font-size: 12px; font-weight: 700; white-space: nowrap; }
.export-option-list {
  position: absolute;
  z-index: 10;
  top: 28px;
  right: 0;
  display: flex;
  width: 340px;
  max-height: 315px;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  box-shadow: 0 8px 18px rgb(18 39 51 / 14%);
}

.export-option-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.export-option-toolbar strong { color: var(--text); font-size: 12px; }
.export-option-toolbar div { display: inline-flex; gap: 8px; }
.export-option-toolbar button { padding: 0; border: 0; color: var(--blue); background: transparent; cursor: pointer; font-size: 12px; font-weight: 650; }
.export-option-toolbar button:hover { text-decoration: underline; }
.export-column-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.export-option-list label { display: flex; align-items: center; gap: 6px; color: #475467; font-size: 12px; font-weight: 500; }
.export-option-list input { width: auto; min-height: auto; }
.export-selected { width: 100%; }

.dashboard-intro { margin-bottom: 16px; }
.dashboard-intro-compact { margin-bottom: 16px; }
.dashboard-intro h1 { color: var(--text); font-size: 24px; line-height: 1.25; }
.eyebrow { display: block; margin-bottom: 5px; color: var(--blue); font-size: 12px; font-weight: 750; }
.dashboard-intro p { margin-top: 5px; color: var(--muted); font-size: 13px; }

.form-panel-title { margin-bottom: 18px; }
.upload-panel { margin-bottom: 16px; }
.upload-form { display: flex; align-items: flex-end; gap: 16px; }
.upload-form .form-field { flex: 1; }
.stacked-form { display: grid; gap: 14px; }
.form-field small,
.stacked-form .helptext { color: var(--muted); font-size: 12px; font-weight: 400; }
.stacked-form .errorlist { margin: 0; padding-left: 18px; color: var(--red); font-size: 12px; }
.two-column-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }

.data-section { overflow: hidden; padding: 0; }
.data-section .section-heading { min-height: 66px; margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.data-section .table-scroll { border: 0; border-radius: 0; }
.table-subtext { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.button-compact { min-height: 30px; padding: 5px 10px; font-size: 12px; }
[data-system-task-row] td:last-child > form { display: flex; flex-direction: column; align-items: center; }
.system-task-feedback { max-width: 360px; }
.system-task-feedback:empty { display: none; }
.system-task-feedback.is-error { color: var(--red); }

.status {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.status-ok,
.status-succeeded { color: var(--green); background: var(--green-soft); border-color: #8ac4a5; }
.status-muted,
.status-pending,
.status-processing { color: #475569; background: #f8fafc; border-color: #cbd5e1; }
.status-failed { color: var(--red); background: var(--red-soft); border-color: #e5a5a5; }
.status-partial { color: #a16207; background: #fffbeb; border-color: #f5cf7a; }
.status-duplicate { color: var(--amber); background: var(--amber-soft); border-color: #e4bd70; }
.issue { margin-bottom: 3px; text-align: left; white-space: normal; }
.issue-warning { color: var(--amber); }
.issue-error { color: var(--red); }
.issue-info { color: var(--muted); }

.messages {
  position: fixed;
  z-index: 90;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: min(calc(100vw - 32px), 380px);
  gap: 8px;
  pointer-events: none;
}
.message {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px 11px 13px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  pointer-events: auto;
  transition: opacity 160ms ease, transform 160ms ease;
}
.message.is-dismissing { opacity: 0; transform: translateY(8px); }
.message-success { color: #155d43; background: var(--green-soft); border-color: #a4d8c2; }
.message-error { color: #8e2532; background: #ffebed; border-color: #e7b4bb; }
.message-warning { color: #805700; background: #fff5de; border-color: #e4c988; }
.message-info { color: #1a557c; background: #eaf3fb; border-color: #b6d2e8; }
.message-dismiss {
  width: 24px;
  min-width: 24px;
  height: 24px;
  margin: -4px -5px -4px 0;
  padding: 0;
  border: 0;
  border-radius: 5px;
  color: currentColor;
  background: transparent;
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
}
.message-dismiss:hover { background: rgb(15 23 42 / 8%); }

.login-page { min-height: 100vh; background: #eef4f8; }
.login-shell {
  display: grid;
  width: 100%;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-layout { width: min(100%, 430px); }
.login-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-brand > span:last-child { display: grid; gap: 3px; }
.login-brand strong { color: var(--text); font-size: 18px; line-height: 1.2; }
.login-brand small { color: var(--muted); font-size: 12px; }
.login-panel { padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 12px 26px rgb(30 49 61 / 11%); }
.login-title { margin-bottom: 22px; }
.login-title h1 { color: var(--text); font-size: 22px; }
.login-title p { margin-top: 5px; color: var(--muted); }
.login-divider { position: relative; margin: 18px 0; text-align: center; }
.login-divider::before { position: absolute; top: 50%; right: 0; left: 0; height: 1px; background: #eaecf0; content: ""; }
.login-divider span { position: relative; z-index: 1; padding: 0 10px; color: #98a2b3; background: var(--surface); font-size: 12px; }

@media (max-width: 1240px) {
  .header-top { align-items: flex-start; flex-direction: column; gap: 16px; }
  .header-side { width: 100%; justify-content: space-between; }
  .snapshot-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .snapshot-meta dd { overflow: hidden; text-overflow: ellipsis; }
  .control-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .query-button { width: max-content; }
}

.product-master-page .product-master-create-form { gap: 8px; }
.product-master-page .master-column-action { min-height: 36px; white-space: nowrap; }
.product-master-page [data-product-master-edit-only] { display: none; }
.product-master-page.is-master-editing .product-master-create-form { display: flex; }
.product-master-page.is-master-editing .product-master-save-form { display: flex; }
.product-master-page .master-table-actions { margin-left: auto; }
.product-master-page .product-master-table { min-width: 2520px; }
.product-master-page .product-master-table th.master-store-heading { min-width: 150px; }
.product-master-page .product-master-table th.master-option-heading { min-width: 178px; }
.product-master-page .master-column-title {
  display: block;
  color: #334155;
  font-size: 12px;
  font-weight: 740;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
}
.product-master-page .master-store-cell,
.product-master-page .master-option-cell {
  min-width: 0;
  padding: 8px;
  vertical-align: middle;
}
.product-master-page .master-store-cell { width: 150px; }
.product-master-page .master-option-cell { width: 178px; }
.product-master-page .master-store-cell.is-default { background: #f0f7ff; }
.product-master-page .master-store-fixed {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid #b8d6fa;
  border-radius: 6px;
  color: #075985;
  background: #eaf4ff;
  font-size: 12px;
  font-weight: 720;
  white-space: nowrap;
}
.product-master-page .master-store-scope {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid #dbe4ed;
  border-radius: 6px;
  color: #1e293b;
  background: #fff;
  font: inherit;
}
.product-master-page .master-option-cell .master-id-input {
  width: 100%;
  min-width: 0;
  text-align: left;
}
.product-master-page .master-store-select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid #dbe4ed;
  border-radius: 6px;
  color: #1e293b;
  background: rgb(255 255 255 / 90%);
  font: inherit;
}
.product-master-page .master-store-select:focus {
  border-color: var(--blue);
  outline: 0;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 13%);
}
.product-master-page .master-option-cell .master-id-input:disabled {
  border-color: #e2e8f0;
  color: #94a3b8;
  background: #f8fafc;
  cursor: not-allowed;
}
.product-master-page .master-column-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  box-shadow: 0 20px 55px rgb(15 23 42 / 24%);
}
.product-master-page .master-column-dialog::backdrop { background: rgb(15 23 42 / 36%); }
.product-master-page .master-column-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 18px;
  border-bottom: 1px solid #e5eaf0;
}
.product-master-page .master-column-dialog-header h2 {
  margin: 0;
  color: #1e293b;
  font-size: 15px;
  font-weight: 740;
}
.product-master-page .master-dialog-close {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  color: #64748b;
  background: transparent;
  font-size: 22px;
  line-height: 1;
}
.product-master-page .master-dialog-close:hover { color: #1e293b; background: #f1f5f9; }
.product-master-page .master-column-dialog-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}
.product-master-page .master-column-dialog .field { width: 100%; }
.product-master-page .master-column-dialog-hint {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}
.product-master-page .master-column-dialog select {
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid #cbd8e6;
  border-radius: 6px;
  color: #1e293b;
  background: #fff;
  font: inherit;
}
.product-master-page .master-column-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 18px 18px;
}

@media (max-width: 760px) {
  .header-inner,
  .main-inner { width: min(100% - 22px, 1600px); }
  .header-top { padding: 18px 0 12px; }
  .title-copy strong { font-size: 20px; }
  .title-copy span { font-size: 12px; }
  .header-side { align-items: stretch; flex-direction: column; gap: 10px; }
  .snapshot-meta { grid-template-columns: 1fr 1fr; gap: 8px; }
  .snapshot-meta div { padding: 8px 10px; background: var(--surface-muted); border-radius: 6px; }
  .account-actions { justify-content: space-between; padding: 0; border-left: 0; }
  .app-navigation,
  .dashboard-tabs { margin: 0 -11px; padding: 0 11px; }
  .app-nav-link,
  .dashboard-tab { min-height: 42px; padding: 0 12px; }
  .main-inner { padding-top: 13px; }
  .control-band { grid-template-columns: 1fr; padding: 15px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
  .query-button { width: 100%; }
  .panel { padding-top: 14px; }
  .kpi-grid,
  .two-column-grid { grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }
  .kpi-card { min-height: 142px; }
  .section-block { padding: 14px 12px; border-radius: 8px; }
  .panel-heading,
  .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .panel-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .panel-note { white-space: normal; }
  .table-shell,
  .table-scroll { max-height: 64vh; border-radius: 6px; }
  .data-table th,
  .data-table td { height: 43px; padding: 8px 10px; }
  .data-table th { height: 45px; }
  .export-options { margin-right: auto; }
  .export-option-list { right: auto; left: 0; max-width: min(340px, calc(100vw - 44px)); }
  .upload-form { align-items: stretch; flex-direction: column; }
  .upload-form .button { width: 100%; }
  .login-shell { padding: 16px; }
  .login-panel { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Align the online UI with the final visual layer of excel_dashboard.html. */
:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #172033;
  --muted: #64748b;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --green: #059669;
  --green-soft: #ecfdf5;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --violet: #7c3aed;
  --violet-soft: #f5f3ff;
  --shadow: 0 1px 2px rgb(15 23 42 / 5%);
  --shadow-card: 0 10px 30px rgb(30 64 175 / 6%), 0 1px 3px rgb(15 23 42 / 6%);
}

html { background: var(--bg); }
body {
  color: var(--text);
  background: linear-gradient(180deg, #f8fbff 0, var(--bg) 440px);
  line-height: 1.5;
}

button,
input,
select,
.button,
.export-button {
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgb(37 99 235 / 20%);
  outline-offset: 2px;
}

.skip-link {
  border-radius: 8px;
  background: var(--blue-dark);
  box-shadow: 0 8px 20px rgb(30 64 175 / 24%);
}

.app-header {
  position: relative;
  border-bottom: 1px solid rgb(226 232 240 / 90%);
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 1px 3px rgb(15 23 42 / 4%);
}

.app-header::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), #38bdf8 52%, #22c55e);
  content: "";
}

.header-inner,
.main-inner { width: min(1560px, calc(100% - 40px)); }

.header-top {
  align-items: center;
  gap: 30px;
  padding: 20px 0;
}

.title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: inline-grid;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  place-items: center;
  overflow: visible;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 15px;
  color: #ffffff;
  background: linear-gradient(145deg, #2563eb, #1d4ed8 62%, #1e40af);
  box-shadow: 0 10px 22px rgb(37 99 235 / 24%);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark > span { content: none; display: none; }
.brand-mark svg { width: 27px; height: 27px; }

.title-copy { gap: 5px; }
.title-copy strong {
  color: #0f172a;
  font-size: 26px;
  font-weight: 760;
  line-height: 1.2;
}
.title-copy span { color: #64748b; font-size: 13.5px; }

.header-side { align-items: center; gap: 12px; }
.snapshot-meta {
  display: flex;
  flex: 0 1 auto;
  grid-template-columns: none;
  gap: 9px;
}
.snapshot-meta div {
  min-width: 108px;
  padding: 9px 13px;
  border: 1px solid #e8edf4;
  border-radius: 11px;
  background: #f8fafc;
}
.snapshot-meta dt {
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0;
}
.snapshot-meta dd {
  margin-top: 2px;
  overflow: hidden;
  color: #334155;
  font-size: 12.5px;
  font-weight: 720;
  text-overflow: ellipsis;
}

.account-actions {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 36px;
  padding-left: 12px;
  border-left-color: #e2e8f0;
}
.account-name { color: #64748b; font-size: 12px; }
.account-menu { position: relative; }
.account-trigger {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 0 9px 0 10px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  color: #475569;
  background: #ffffff;
  cursor: pointer;
  list-style: none;
}
.account-trigger::-webkit-details-marker { display: none; }
.account-trigger:hover,
.account-menu[open] > .account-trigger { border-color: #93c5fd; color: var(--blue-dark); background: var(--blue-soft); }
.account-caret { width: 14px; height: 14px; flex: 0 0 auto; transition: transform 160ms ease; }
.account-menu[open] .account-caret { transform: rotate(180deg); }
.account-dropdown {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  width: max-content;
  min-width: 148px;
  padding: 5px;
  border: 1px solid #dbe3ed;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgb(15 23 42 / 14%);
}
.account-menu:not([open]) .account-dropdown { display: none; }
.account-dropdown form { margin: 0; }
.account-menu-link {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: #475569;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.account-menu-link:hover,
.account-menu-link[aria-current="page"] { color: var(--blue-dark); background: var(--blue-soft); }
.account-logout { color: #b91c1c; }
.account-logout:hover { color: #b91c1c; background: #fef2f2; }
.account-menu-divider { height: 1px; margin: 5px 4px; background: #e2e8f0; }

.app-navigation,
.dashboard-tabs {
  gap: 8px;
  padding-bottom: 15px;
  border: 0;
  scrollbar-width: none;
}
.app-navigation::-webkit-scrollbar,
.dashboard-tabs::-webkit-scrollbar { display: none; }

.app-nav-link,
.dashboard-tab {
  display: inline-flex;
  min-height: 43px;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #64748b;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 700;
}
.dashboard-tab svg { width: 18px; height: 18px; flex: 0 0 auto; }
.app-nav-link:hover,
.dashboard-tab:hover {
  border-color: #bfdbfe;
  color: var(--blue-dark);
  background: var(--blue-soft);
  transform: translateY(-1px);
}
.app-nav-link[aria-current="page"],
.dashboard-tab[aria-selected="true"],
.dashboard-tab[aria-current="page"] {
  border-color: var(--blue);
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  box-shadow: 0 7px 16px rgb(37 99 235 / 20%);
}

.main-inner { padding: 20px 0 46px; }
.control-band {
  grid-template-columns: minmax(155px, .7fr) minmax(155px, .7fr) minmax(220px, 1.25fr) minmax(220px, 1.25fr) auto;
  gap: 16px;
  padding: 17px 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgb(255 255 255 / 96%);
  box-shadow: var(--shadow-card);
}
.field { gap: 7px; }
.field-label,
.field label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}
.label-dot {
  width: 7px;
  height: 7px;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 10%);
}
.product-dot { background: var(--blue); }
.option-dot { background: var(--green); box-shadow: 0 0 0 3px rgb(16 185 129 / 10%); }
.period-dot { background: var(--violet); box-shadow: 0 0 0 3px rgb(124 58 237 / 10%); }

input:not([type="checkbox"]),
select {
  min-height: 44px;
  padding: 8px 36px 8px 13px;
  border-color: #d7e0ea;
  border-radius: 10px;
  color: #1e293b;
  background-color: #f8fafc;
  font-size: 13px;
  font-weight: 620;
}
input:not([type="checkbox"]):hover,
select:hover { border-color: #93c5fd; background-color: #ffffff; }
input:not([type="checkbox"]):focus,
select:focus {
  border-color: var(--blue);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 10%);
}
input[type="file"] { padding: 7px 9px; }
.button {
  min-height: 38px;
  border-color: #d7e0ea;
  border-radius: 8px;
  color: #475569;
  background: #ffffff;
  font-weight: 720;
}
.button:hover { border-color: #93c5fd; color: var(--blue-dark); background: var(--blue-soft); }
.button-primary { color: #ffffff; background: var(--blue); border-color: var(--blue); }
.button-primary:hover { color: #ffffff; background: var(--blue-dark); border-color: var(--blue-dark); }
.button-quiet { min-height: 32px; border-radius: 7px; }
.query-button { min-height: 44px; padding-inline: 17px; }

.dashboard-tabs { margin-top: 18px; }
.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.dashboard-toolbar .dashboard-tabs {
  flex: 1 1 auto;
  margin-top: 0;
  padding-bottom: 0;
}
.dashboard-toolbar .snapshot-meta {
  flex: 0 1 auto;
  width: auto;
  margin-left: auto;
  justify-content: flex-end;
}
.dashboard-panel[hidden] { display: none; }
.panel { padding-top: 20px; }

.kpi-grid { gap: 14px; margin-bottom: 18px; }
.kpi-card {
  position: relative;
  display: flex;
  min-height: 190px;
  overflow: hidden;
  flex-direction: column;
  padding: 22px 24px 0;
  border: 1px solid #dce6f2;
  border-top: 1px solid #dce6f2;
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgb(15 23 42 / 6%), 0 1px 3px rgb(15 23 42 / 5%);
}
.kpi-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  content: "";
}
.kpi-card.finance { border-color: #d9e9e2; }
.kpi-card.finance::before { background: linear-gradient(90deg, #059669, #6ee7b7); }
.kpi-top { align-items: center; }
.kpi-heading { display: flex; min-width: 0; align-items: center; gap: 11px; }
.kpi-icon {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 11px;
  color: var(--blue);
  background: #eff6ff;
}
.kpi-icon svg { width: 20px; height: 20px; }
.finance .kpi-icon { border-color: #a7f3d0; color: var(--green); background: #ecfdf5; }
.kpi-title-copy { min-width: 0; }
.kpi-eyebrow { color: #94a3b8; font-size: 10.5px; font-weight: 760; letter-spacing: 0; }
.kpi-label { margin-top: 2px; color: #1e293b; font-size: 14px; font-weight: 760; }
.kpi-badge {
  padding: 5px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: var(--blue-dark);
  background: #eff6ff;
  font-size: 11px;
  font-weight: 740;
}
.finance .kpi-badge { border-color: #fde68a; color: #92400e; background: #fffbeb; }
.kpi-value-row { gap: 8px; margin-top: 22px; }
.kpi-value {
  min-height: 44px;
  color: #1d4ed8;
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
}
.finance .kpi-value { color: var(--green); }
.kpi-unit { color: #64748b; font-size: 14px; font-weight: 700; }
.kpi-footer {
  position: relative;
  min-height: 45px;
  align-items: center;
  margin: auto -24px 0;
  padding: 10px 24px;
  border-top: 1px solid #e8edf4;
  background: #f8fafc;
}
.kpi-comparison { display: flex; align-items: center; gap: 6px; }
.kpi-comparison > span { color: #94a3b8; }
.kpi-comparison > strong { color: #334155; font-weight: 760; }

.kpi-sku-picker { flex: 0 0 auto; }
.kpi-sku-picker > summary { list-style: none; }
.kpi-sku-picker > summary::-webkit-details-marker { display: none; }
.kpi-sku-button {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 9px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1d4ed8;
  background: #ffffff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 720;
  white-space: nowrap;
}
.kpi-sku-button:hover { border-color: #2563eb; background: #eff6ff; }
.kpi-sku-button.is-disabled {
  border-color: #e2e8f0;
  color: #94a3b8;
  background: #f8fafc;
  cursor: not-allowed;
}
.kpi-sku-panel {
  position: absolute;
  right: 24px;
  bottom: 100%;
  z-index: 3;
  width: min(260px, calc(100% - 48px));
  max-height: 132px;
  overflow: auto;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid #dbe3ed;
  border-radius: 10px;
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 16px 32px rgb(15 23 42 / 14%);
}
.kpi-sku-panel-title { margin: 0 0 6px; color: #475467; font-size: 11.5px; font-weight: 760; }
.kpi-sku-list { margin: 0; padding: 0; list-style: none; }
.kpi-sku-list li { padding: 2px 0; color: #1e293b; font-size: 11.5px; line-height: 1.35; word-break: break-all; }

.section-block,
.form-panel {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.section-block + .section-block { margin-top: 18px; padding-top: 22px; }
.panel-heading { align-items: center; margin-bottom: 17px; }
.section-heading { align-items: center; }
.heading-copy,
.section-title { gap: 11px; }
.heading-copy p,
.section-heading p,
.form-panel-title p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.heading-icon {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
}
.heading-icon svg { width: 20px; height: 20px; }
.heading-icon.blue { color: var(--blue); background: var(--blue-soft); }
.heading-icon.amber { color: var(--amber); background: var(--amber-soft); }
.heading-copy .selection-context {
  max-width: min(100%, 1080px);
  color: #0f172a;
  font-size: 11.5px;
  font-weight: 750;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.heading-copy .selection-context::before { content: "当前："; font-weight: 800; }
.heading-copy .pa-selection-context::before { content: "投放广告商品："; }
.heading-copy .selection-context:empty { display: none; }
.panel-actions { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.panel-note {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  color: #2563eb;
  background: #eff6ff;
  font-size: 11.5px;
  font-weight: 700;
}

.export-button,
.export-options > summary {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #1d4ed8;
  background: #ffffff;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 720;
  white-space: nowrap;
}
.export-button:hover,
.export-options > summary:hover { border-color: #2563eb; background: #eff6ff; }
.export-button svg { width: 15px; height: 15px; }
.table-edit-controls {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
}
.table-edit-button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #1d4ed8;
  background: #ffffff;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 720;
  white-space: nowrap;
}
.table-edit-button:hover:not(:disabled) { border-color: #2563eb; background: #eff6ff; }
.table-edit-button:disabled { cursor: not-allowed; opacity: 0.48; }
.table-edit-button svg { width: 15px; height: 15px; }
.table-edit-button.is-editing { border-color: #86efac; color: #047857; background: #ecfdf5; }
.table-edit-button.is-editing:hover { border-color: #10b981; background: #d1fae5; }
.table-edit-dialog {
  width: min(390px, calc(100vw - 32px));
  margin: auto;
  padding: 0;
  border: 1px solid #dbe3ed;
  border-radius: 10px;
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 24px 64px rgb(15 23 42 / 24%);
}
.table-edit-dialog::backdrop { background: rgb(15 23 42 / 30%); }
.table-edit-dialog-body { padding: 20px; }
.table-edit-dialog h3 { margin: 0; font-size: 16px; }
.table-edit-dialog-message {
  margin: 8px 0 18px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}
.table-edit-dialog-message.is-error { color: #b91c1c; }
.table-edit-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.table-edit-dialog-button {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #475569;
  background: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}
.table-edit-dialog-button:hover:not(:disabled) { border-color: #94a3b8; background: #f8fafc; }
.table-edit-dialog-button:disabled { cursor: not-allowed; opacity: 0.5; }
.table-edit-dialog-save { border-color: #059669; color: #ffffff; background: #059669; }
.table-edit-dialog-save:hover:not(:disabled) { border-color: #047857; background: #047857; }
.table-edit-dialog-discard { color: #b91c1c; }
.table-edit-dialog-discard:hover:not(:disabled) { border-color: #fca5a5; background: #fef2f2; }
.export-options > summary { list-style: none; }
.export-options > summary::-webkit-details-marker { display: none; }
.export-options > .export-button { text-decoration: none; }
.export-option-list {
  border-color: #dbe3ed;
  border-radius: 10px;
  box-shadow: 0 16px 32px rgb(15 23 42 / 14%);
}
.export-option-list input[type="checkbox"] { accent-color: var(--blue); }

.table-shell,
.table-scroll {
  max-height: 590px;
  border-color: #dce4ee;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 75%);
  scrollbar-color: #cbd5e1 #f8fafc;
}
.table-shell::-webkit-scrollbar,
.table-scroll::-webkit-scrollbar { width: 9px; height: 9px; }
.table-shell::-webkit-scrollbar-track,
.table-scroll::-webkit-scrollbar-track { background: #f8fafc; }
.table-shell::-webkit-scrollbar-thumb,
.table-scroll::-webkit-scrollbar-thumb { border: 2px solid #f8fafc; border-radius: 999px; background: #cbd5e1; }
.data-table { color: #334155; font-size: 12px; }
.daily-table { min-width: 3700px; }
.pa-table { min-width: 3040px; }
.inventory-table { min-width: 1440px; }
.data-table th,
.data-table td {
  height: 46px;
  padding: 9px 12px;
  border-right-color: #edf1f5;
  border-bottom-color: #edf1f5;
}
.data-table th {
  height: 48px;
  color: #475569;
  background: #f1f5f9;
  box-shadow: inset 0 -1px 0 #dce4ee;
  font-size: 11.5px;
  font-weight: 760;
}
.data-table th:first-child {
  color: #334155;
  background: #e8eef5;
  box-shadow: inset 0 -1px 0 #d2dce8, 2px 0 5px rgb(15 23 42 / 4%);
}
.data-table td:first-child { box-shadow: 2px 0 5px rgb(15 23 42 / 4%); }
.data-table tbody td { background: #ffffff; }
.data-table tbody tr:hover td,
.data-table tbody tr:hover td:first-child {
  background: #edf6ff !important;
  box-shadow: inset 0 1px 0 #dbeafe, inset 0 -1px 0 #dbeafe;
}
.data-table tbody tr:hover td:first-child { box-shadow: inset 0 1px 0 #dbeafe, inset 0 -1px 0 #dbeafe, 2px 0 5px rgb(15 23 42 / 5%); }
.data-table.table-editing .table-editable-cell {
  position: relative;
  cursor: text;
}
.data-table.table-editing th.table-editable-column {
  position: sticky;
  color: #ffffff;
  background: #2563eb;
  box-shadow: inset 0 -1px 0 #1d4ed8;
}
.data-table.table-editing th.table-editable-column::after {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: #93c5fd;
  content: "";
}
.data-table.table-editing th.table-editable-column .header-note { color: #dbeafe; }
.data-table.table-editing .table-editable-cell:focus-visible,
.data-table.table-editing .table-editable-cell.is-active {
  box-shadow: inset 0 0 0 2px #2563eb;
}
.data-table.table-editing .table-editable-cell.is-dirty {
  box-shadow: inset 0 -2px 0 #10b981;
}
.data-table.table-editing .table-editable-cell.is-active.is-dirty {
  box-shadow: inset 0 0 0 2px #2563eb;
}
.data-table.table-editing .table-editable-cell[contenteditable="true"] { outline: none; }
.data-table th.metric-blue { color: #1d4ed8; background: #e7f1ff; }
.data-table td.metric-blue { color: #1d4ed8; background: #f4f8ff; font-weight: 650; }
.data-table th.metric-amber { color: #a16207; background: #fff4d8; }
.data-table td.metric-amber { color: #a16207; background: #fffbeb; font-weight: 650; }
.data-table th.metric-green { color: #047857; background: #c9f5dc; }
.data-table td.metric-green { color: #047857; background: #ecfdf5; font-weight: 760; }
.inventory-table th.inventory-status-column { color: #7c3aed; background: #f1eafe; }
.inventory-table td.inventory-status-column { background: #faf7ff; }
.data-table .strong { font-weight: 760; }
.keyword-cell,
.text-left { color: #334155; }
.keyword-cell { max-width: 280px; }
.calendar-red,
.negative { color: var(--red) !important; font-weight: 700; }
.product-cell { min-width: 280px; max-width: 440px; overflow: hidden; font-weight: 650; text-overflow: ellipsis; }
.data-table .table-note-cell {
  min-width: 220px;
  max-width: 360px;
  color: #334155;
  line-height: 1.5;
  word-break: break-word;
  white-space: normal;
}
.data-table th.table-note-column { min-width: 220px; }
.status {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}
.status.success { border-color: #a7f3d0; color: #047857; background: #ecfdf5; }
.status.warning { border-color: #fde68a; color: #a16207; background: #fffbeb; }
.status.danger { border-color: #fecaca; color: #b91c1c; background: #fef2f2; }
.status.neutral { border-color: #cbd5e1; color: #475569; background: #f8fafc; }

.data-section {
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.data-section .section-heading { min-height: 70px; margin: 0; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.data-section .table-scroll { border: 0; border-radius: 0; }
.section-marker { width: 5px; height: 34px; border-radius: 3px; }
.two-column-grid { gap: 18px; }
.dashboard-intro { margin-bottom: 18px; }
.dashboard-intro h1,
.login-title h1 { color: #0f172a; font-size: 24px; font-weight: 760; }
.eyebrow { color: var(--blue); font-size: 12px; font-weight: 750; }
.upload-form { display: block; }
.upload-file-action-row {
  display: grid;
  min-width: 0;
  grid-template-columns: max-content minmax(116px, 190px) max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: 12px;
}
.upload-file-action-row label { white-space: nowrap; }
.upload-file-action-row input[type="file"] { min-width: 0; flex: 1 1 auto; }
.upload-file-action-row .button { min-height: 44px; flex: 0 0 auto; }
.upload-critical-notice {
  max-width: 980px;
  margin: 10px 0 0;
  padding: 8px 10px;
  border-left: 3px solid var(--amber);
  color: #7c4a03;
  background: var(--amber-soft);
  font-size: 12px;
  line-height: 1.55;
}
.upload-critical-notice code,
.report-upload-dialog code { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.report-upload-dialog { width: min(500px, calc(100vw - 32px)); }
.report-upload-summary { display: grid; gap: 10px; margin: 14px 0 18px; }
.report-upload-summary > div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
.report-upload-summary dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.report-upload-summary dd { min-width: 0; margin: 0; color: var(--text); font-size: 13px; }
.report-upload-summary ul,
.report-upload-error-list { display: grid; max-height: 152px; gap: 5px; margin: 0; padding-left: 18px; overflow: auto; }
.report-upload-summary li { overflow-wrap: anywhere; }
.report-upload-natural-note { margin: -4px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.report-upload-error-list { margin: 0 0 18px; color: var(--red); font-size: 12px; line-height: 1.5; }
.import-history-table { min-width: 1210px; table-layout: fixed; }
.import-history-table .import-filename-column { width: 290px; }
.import-history-table .import-store-column { width: 94px; }
.import-history-table .import-kind-column { width: 118px; }
.import-history-table .import-source-column { width: 104px; }
.import-history-table .import-status-column { width: 94px; }
.import-history-table .import-coverage-column { width: 208px; }
.import-history-table .import-row-count-column { width: 76px; }
.import-history-table .import-processed-column { width: 132px; }
.import-history-table .import-issues-column { width: 106px; }
.import-history-table th,
.import-history-table td { overflow: hidden; }
.import-filename {
  display: block;
  overflow: hidden;
  cursor: help;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.import-filename:focus-visible { border-radius: 3px; outline: 2px solid rgb(37 99 235 / 36%); outline-offset: 2px; }
.import-issues-cell { text-align: center; }
.import-issues-button { min-width: 86px; }
.import-issues-count { margin-left: 4px; color: #64748b; font-variant-numeric: tabular-nums; }
.import-issues-dialog { width: min(620px, calc(100vw - 32px)); }
.import-issues-dialog-filename {
  margin: 7px 0 14px;
  overflow-wrap: anywhere;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}
.import-issues-dialog-content { max-height: min(430px, 52vh); overflow: auto; }
.import-issues-list { display: grid; gap: 9px; margin: 0 0 18px; padding: 0; list-style: none; }
.import-issue { padding: 10px 11px; border: 1px solid #dce4ee; border-left-width: 3px; border-radius: 6px; background: #f8fafc; }
.import-issue-warning { border-left-color: #d89b14; }
.import-issue-error { border-left-color: #d14343; }
.import-issue-info { border-left-color: #7190a8; }
.import-issue-meta { display: flex; align-items: center; gap: 8px; color: #64748b; font-size: 11px; font-weight: 700; }
.import-issue-severity { color: #334155; }
.import-issue p { margin: 5px 0 0; overflow-wrap: anywhere; color: #334155; font-size: 13px; line-height: 1.55; }
.maintenance-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.maintenance-page-header > div { min-width: 0; }
.page-back-button {
  flex: 0 0 auto;
  gap: 5px;
  margin-top: 2px;
}
.page-back-button svg { width: 16px; height: 16px; }
.messages { gap: 9px; }
.message { border-radius: 10px; box-shadow: var(--shadow); }

.empty-state {
  min-height: 180px;
  align-content: center;
  gap: 9px;
  border-color: #bfdbfe;
  border-radius: 12px;
  color: #475569;
  background: linear-gradient(145deg, #f8fbff, #f1f6fd);
  font-size: 13px;
  font-weight: 650;
}
.empty-state::before {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: var(--blue);
  background: #dbeafe;
  content: "i";
  font-size: 18px;
  font-style: italic;
  font-weight: 800;
}

.login-page { background: linear-gradient(180deg, #f8fbff 0, var(--bg) 440px); }
.login-brand { gap: 14px; }
.login-brand .brand-mark { width: 46px; height: 46px; border-radius: 13px; }
.login-brand .brand-mark svg { width: 24px; height: 24px; }
.login-panel {
  padding: 30px;
  border-color: #dce6f2;
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

/* Password-only sign-in is kept distinct from the operational data surfaces. */
.login-page { background: #edf2f4; }
.login-shell { padding: 32px; }
.login-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(360px, 1fr);
  width: min(100%, 920px);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid #d7e1e5;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 20px 46px rgb(28 52 63 / 14%);
}
.login-identity {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  padding: 34px;
  color: #17343b;
  background: #e8f1f7;
}
.login-brand { align-self: start; margin: 0; color: inherit; }
.login-brand > span:last-child { display: block; color: inherit; font-size: 16px; font-weight: 760; }
.login-brand .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  color: #ffffff;
  background: var(--blue);
}
.login-brand .brand-mark svg { width: 22px; height: 22px; }
.login-identity-copy { align-self: center; max-width: 290px; }
.login-identity-kicker,
.login-identity-footer { color: #527081; font-size: 12px; font-weight: 700; }
.login-identity-kicker { display: block; margin-bottom: 14px; }
.login-identity h1 {
  color: #17343b;
  font-size: 32px;
  font-weight: 760;
  line-height: 1.26;
}
.login-identity-footer { align-self: end; color: #6a8694; letter-spacing: 0; text-transform: uppercase; }
.login-panel {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 52px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.login-title { margin-bottom: 30px; }
.login-title h2 { margin-top: 6px; color: #17343b; font-size: 27px; font-weight: 760; line-height: 1.25; }
.login-title p { margin-top: 8px; color: #64777c; }
.login-form { display: grid; gap: 18px; }
.login-field { display: grid; gap: 7px; }
.login-field label { color: #365057; font-size: 13px; font-weight: 720; }
.login-field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #c6d4d7;
  border-radius: 6px;
  color: #172f34;
  background: #ffffff;
  outline: 0;
}
.login-field input::placeholder { color: #9baaad; }
.login-field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(23 105 170 / 16%); }
.login-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 720;
}
.login-submit:hover { background: var(--blue-strong); border-color: var(--blue-strong); }
.login-form-errors,
.login-form .field-error {
  color: #9c2636;
  font-size: 12px;
}
.login-form-errors {
  padding: 10px 12px;
  border: 1px solid #f0bec5;
  border-radius: 6px;
  background: #fff2f3;
}
.login-form-errors ul,
.login-form .field-error ul { margin: 0; padding-left: 18px; }

@media (max-width: 1240px) {
  .header-top { align-items: center; flex-direction: row; gap: 20px; }
  .header-side { width: auto; justify-content: flex-end; }
  .control-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .dashboard-toolbar { align-items: stretch; flex-direction: column; gap: 12px; }
  .dashboard-toolbar .dashboard-tabs { width: 100%; }
  .dashboard-toolbar .snapshot-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    margin-left: 0;
  }
  .dashboard-toolbar .snapshot-meta div { min-width: 0; }
}

@media (max-width: 760px) {
  .header-inner,
  .main-inner { width: min(100% - 22px, 1560px); }
  .header-top { align-items: flex-start; flex-direction: column; gap: 14px; padding: 22px 0 16px; }
  .brand-mark { width: 43px; height: 43px; border-radius: 12px; }
  .brand-mark svg { width: 23px; height: 23px; }
  .title-copy strong { font-size: 20px; }
  .title-copy span { font-size: 12.5px; }
  .header-side { width: auto; align-self: flex-end; align-items: center; flex-direction: row; gap: 0; }
  .dashboard-toolbar .snapshot-meta { grid-template-columns: 1fr 1fr; gap: 7px; }
  .dashboard-toolbar .snapshot-meta div { padding: 8px 11px; }
  .account-actions { justify-content: flex-end; padding: 0; border-left: 0; }
  .app-navigation,
  .dashboard-tabs { margin-inline: 0; padding-bottom: 12px; }
  .dashboard-toolbar .dashboard-tabs { padding-bottom: 0; }
  .app-nav-link,
  .dashboard-tab { min-height: 40px; padding: 0 12px; }
  .main-inner { padding-top: 13px; }
  .upload-file-action-row { grid-template-columns: max-content minmax(0, 1fr); gap: 8px; }
  .upload-file-action-row .button { grid-column: 1 / -1; }
  .maintenance-page-header { flex-direction: column; gap: 12px; }
  .page-back-button { align-self: flex-start; margin-top: 0; }
  .control-band { grid-template-columns: 1fr; padding: 15px; border-radius: 13px; }
  .query-button { width: 100%; }
  .panel { padding-top: 14px; }
  .kpi-grid,
  .two-column-grid { grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }
  .kpi-card { min-height: 190px; padding: 18px 18px 0; border-radius: 14px; }
  .kpi-value { font-size: 34px; }
  .kpi-footer { margin-inline: -18px; padding-inline: 18px; }
  .section-block,
  .form-panel { padding: 16px; border-radius: 14px; }
  .panel-heading,
  .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .panel-actions { flex-wrap: wrap; }
  .table-shell,
  .table-scroll { max-height: 64vh; border-radius: 10px; }
  .data-table th,
  .data-table td { height: 43px; padding: 8px 10px; }
  .data-table th { height: 45px; }
  .export-option-list { right: auto; left: 0; max-width: min(340px, calc(100vw - 44px)); }
  .data-section { border-radius: 14px; }
  .data-section .section-heading { padding: 14px 16px; }
  .login-shell { padding: 16px; }
  .login-layout { grid-template-columns: 1fr; min-height: 0; }
  .login-identity { min-height: 184px; padding: 24px; }
  .login-identity-copy { align-self: end; }
  .login-identity h1 { font-size: 25px; }
  .login-identity-footer { display: none; }
  .login-panel { padding: 30px 24px; border-radius: 0; }
}

@media (max-width: 430px) {
  .title-group { align-items: flex-start; gap: 11px; }
  .dashboard-toolbar .snapshot-meta { grid-template-columns: 1fr; }
  .dashboard-tab { gap: 6px; padding: 0 10px; font-size: 12px; }
  .dashboard-tab svg { width: 16px; height: 16px; }
  .section-block,
  .form-panel { padding: 14px 12px; }
}

/* Maintenance pages use a denser, quieter workspace treatment than dashboard KPI cards. */
.maintenance-page .maintenance-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  margin: 0 0 16px;
  padding: 0 0 16px;
  border-bottom: 1px solid #dce4ee;
}

.maintenance-page .maintenance-page-header > div { min-width: 0; }
.maintenance-page .maintenance-page-header .eyebrow {
  margin-bottom: 4px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 750;
}

.maintenance-page .maintenance-page-header h1 {
  color: #0f172a;
  font-size: 24px;
  font-weight: 760;
  line-height: 1.25;
}

.maintenance-page .page-back-button {
  min-height: 36px;
  margin: 0;
  border-color: #cbd5e1;
  border-radius: 7px;
  color: #475569;
  box-shadow: none;
}

.maintenance-page .page-back-button:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #eff6ff;
}

.maintenance-page .form-panel,
.maintenance-page .data-section {
  border-color: #dce4ee;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 6%);
}

.maintenance-page .form-panel { padding: 18px; }
.maintenance-page .upload-panel { margin-bottom: 16px; }
.maintenance-page .form-panel-title { margin-bottom: 14px; }
.maintenance-page .section-title { gap: 10px; }
.maintenance-page .section-marker { width: 4px; height: 30px; border-radius: 2px; }
.maintenance-page .section-title h2 { font-size: 16px; font-weight: 740; }
.maintenance-page .section-heading p,
.maintenance-page .form-panel-title p { color: #64748b; font-size: 12px; }
.maintenance-page .section-meta { color: #64748b; font-size: 12px; font-weight: 650; }

.maintenance-page .data-section .section-heading {
  min-height: 64px;
  padding: 14px 18px;
}

.maintenance-page .table-scroll { max-height: min(590px, 62vh); }
.maintenance-page .data-table th,
.maintenance-page .data-table td { height: 43px; padding: 8px 11px; }
.maintenance-page .data-table th { height: 45px; }
.maintenance-page .data-table th:first-child {
  color: #475569;
  background: #f1f5f9;
  box-shadow: inset 0 -1px 0 #dce4ee;
}
.maintenance-page .data-table td:first-child { box-shadow: none; }
.maintenance-page .data-table tbody tr:hover td:first-child {
  box-shadow: inset 0 1px 0 #dbeafe, inset 0 -1px 0 #dbeafe;
}

.maintenance-page .mapping-actions {
  display: flex;
  justify-content: flex-end;
  margin: 0;
  padding: 12px 18px;
  border-top: 1px solid #e5eaf0;
  background: #f8fafc;
}

.maintenance-page .mapping-actions .button { min-height: 36px; }
.maintenance-page .mapping-select-cell { min-width: 250px; }
.maintenance-page .mapping-select-cell select { min-width: 230px; min-height: 38px; }

.user-management-role-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid #dce4ee;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 6%);
}
.role-summary-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  min-width: 0;
  padding: 12px 16px;
  border-right: 1px solid #e5eaf0;
}
.role-summary-item:last-child { border-right: 0; }
.role-summary-item span { color: #64748b; font-size: 12px; font-weight: 700; }
.role-summary-item strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.role-summary-item.role-admin strong { color: #7c3aed; }
.role-summary-item.role-dashe_admin strong { color: #b45309; }
.role-summary-item.role-editor strong { color: #047857; }
.role-summary-item.role-viewer strong { color: #2563eb; }

.user-management-page .user-create-panel { margin-bottom: 16px; }
.user-create-form { display: flex; align-items: end; gap: 12px; }
.user-create-fields {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: 0.8fr 1.1fr 1fr 1fr;
  gap: 12px;
}
.user-create-fields .field { min-width: 0; }
.user-create-fields input,
.user-create-fields select { width: 100%; min-width: 0; }
.user-create-fields .field-invalid input,
.user-create-fields .field-invalid select { border-color: #dc2626; box-shadow: 0 0 0 2px rgb(220 38 38 / 12%); }
.user-create-form > .button { min-height: 38px; flex: 0 0 auto; }
.password-form-panel .errorlist {
  margin: 5px 0 0;
  padding-left: 16px;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.45;
}
.form-errors { margin-bottom: 10px; color: #b91c1c; font-size: 12px; }
.user-create-error-dialog {
  width: min(calc(100vw - 32px), 460px);
  padding: 0;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #334155;
  background: #ffffff;
  box-shadow: 0 24px 48px rgb(15 23 42 / 22%);
}
.user-create-error-dialog::backdrop { background: rgb(15 23 42 / 32%); }
.user-create-error-dialog-body { padding: 20px; }
.user-create-error-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.user-create-error-dialog-heading h2 { margin: 3px 0 0; color: #991b1b; font-size: 17px; }
.user-create-error-close {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 6px;
  color: #64748b;
  background: transparent;
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
}
.user-create-error-close:hover { color: #991b1b; background: #fef2f2; }
.user-create-error-list { display: grid; gap: 8px; margin: 18px 0 0; padding: 12px 14px 12px 31px; border: 1px solid #fee2e2; border-radius: 6px; color: #991b1b; background: #fff7f7; font-size: 13px; line-height: 1.5; }
.user-create-error-list strong { display: inline-block; min-width: 74px; margin-right: 6px; }
.user-create-error-dialog-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.user-management-table { min-width: 900px; }
.user-management-table th:nth-child(1) { min-width: 180px; }
.user-management-table th:nth-child(2) { min-width: 210px; }
.user-management-table th:nth-child(3),
.user-management-table th:nth-child(4) { min-width: 110px; }
.user-management-table th:nth-child(5),
.user-management-table th:nth-child(6) { min-width: 165px; }
.user-management-table th:nth-child(7) { min-width: 180px; }
.user-name-cell { font-weight: 720; }
.user-row-actions { display: inline-flex; align-items: center; gap: 8px; }
.user-status-form { margin: 0; }
[data-user-role-form] { margin: 0; }
[data-user-role-select] { min-width: 108px; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; font: inherit; }
[data-user-role-select]:disabled { opacity: 0.6; cursor: wait; }
.button-status { min-height: 30px; padding: 4px 10px; font-size: 12px; }
.button-status:disabled { cursor: wait; opacity: 0.62; }
.button-status-disable { color: #b42318; border-color: #f1b9b3; background: #fff7f6; }
.button-status-disable:hover { color: #8e1e15; border-color: #e47f76; background: #fff0ee; }
.button-status-enable { color: #067647; border-color: #a9d9c3; background: #f1fbf6; }
.button-status-enable:hover { color: #045c37; border-color: #6dbd99; background: #e7f8ef; }
.button-status-delete { color: #b42318; border-color: #f2cbc7; background: #ffffff; }
.button-status-delete:hover { color: #8e1e15; border-color: #e47f76; background: #fff5f4; }
.user-management-table tr { transition: opacity 160ms ease, transform 160ms ease; }
.user-management-table tr.is-removing { opacity: 0; transform: translateX(8px); }
.user-status-self { color: #94a3b8; font-size: 12px; }
.role-badge {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 720;
}
.role-badge.role-admin { border-color: #ddd6fe; color: #6d28d9; background: #f5f3ff; }
.role-badge.role-editor { border-color: #a7f3d0; color: #047857; background: #ecfdf5; }
.role-badge.role-viewer { border-color: #bfdbfe; color: #1d4ed8; background: #eff6ff; }
.password-page .password-form-panel { width: min(100%, 480px); margin: 34px auto 0; }
.password-form-panel .stacked-form { gap: 14px; }
.password-form-panel .helptext { display: none; }
.password-form-panel input { width: 100%; }

.product-fixed-values-page .fixed-values-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid #e5eaf0;
  border-bottom: 1px solid #e5eaf0;
  background: #f8fafc;
}

.product-fixed-values-page .fixed-values-toolbar label {
  color: #475569;
  font-size: 13px;
  font-weight: 680;
  white-space: nowrap;
}

.product-fixed-values-page .fixed-values-toolbar input[type="date"] {
  width: 156px;
  min-height: 36px;
  padding: 6px 9px;
}

.product-fixed-values-page .fixed-values-toolbar .button { min-height: 36px; }
.product-fixed-values-page .fixed-values-table { min-width: 1640px; }
.product-fixed-values-page .fixed-values-table th:not(:first-child) { min-width: 140px; }
.product-fixed-values-page .fixed-values-table th:nth-child(2) { min-width: 250px; }
.product-fixed-values-page .fixed-values-table td { background: #fff; }
.product-fixed-values-page .fixed-values-table input {
  min-width: 118px;
  min-height: 34px;
  padding: 5px 8px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.product-fixed-values-page .fixed-value-product-map { min-width: 250px; }
.product-fixed-values-page .fixed-value-product-map select { min-width: 230px; min-height: 34px; }

.master-dashboard-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}
.master-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
}
.master-heading-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  color: var(--blue);
  background: var(--blue-soft);
}
.master-heading-icon svg { width: 24px; height: 24px; }
.master-heading h1 { margin: 2px 0 3px; color: var(--text); font-size: 21px; line-height: 1.2; }
.master-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.master-snapshot-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, auto));
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 3px 10px rgb(15 23 42 / 4%);
}
.master-snapshot-meta div { min-width: 0; padding: 9px 12px; border-right: 1px solid var(--border); }
.master-snapshot-meta div:last-child { border-right: 0; }
.master-snapshot-meta dt { color: var(--muted); font-size: 10.5px; font-weight: 680; white-space: nowrap; }
.master-snapshot-meta dd { margin: 2px 0 0; color: var(--text); font-size: 15px; font-weight: 760; font-variant-numeric: tabular-nums; }
.master-snapshot-meta div:nth-child(2) dd { color: var(--green); }
.master-snapshot-meta div:nth-child(3) dd { color: var(--blue); }
.master-snapshot-meta div:nth-child(4) dd { color: #a16207; }

.product-master-page .master-control-band {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgb(255 255 255 / 96%);
  box-shadow: var(--shadow-card);
}
.product-master-page .product-master-create-form,
.product-master-page .product-master-save-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.product-master-page .product-master-create-form { flex: 1 1 auto; }
.product-master-page .product-master-save-form { flex: 0 0 auto; }
.product-master-page .master-control-inline-field { display: flex; align-items: center; gap: 9px; }
.product-master-page .master-control-inline-field .field-label { flex: 0 0 auto; white-space: nowrap; }
.product-master-page .product-master-create-form .master-create-field { width: min(350px, 30vw); }
.product-master-page .product-master-save-form .master-effective-date-field { width: auto; }
.product-master-page .product-master-save-form .master-exchange-rate-field { width: auto; }
.product-master-page .product-master-create-form input,
.product-master-page .product-master-save-form input { width: 100%; }
.product-master-page .master-control-inline-field input { min-width: 0; }
.product-master-page .master-effective-date-field input { width: 150px; flex: 0 0 150px; }
.product-master-page .master-exchange-rate-field input { width: 96px; flex: 0 0 96px; }
.product-master-page .master-control-divider { width: 1px; height: 30px; margin: 0 5px; background: #dbe4ed; }
.product-master-page .product-master-section { overflow: visible; }
.product-master-page .master-section-heading { padding: 17px 20px; border-bottom: 1px solid #e5eaf0; }
.product-master-page .table-scroll { max-height: min(760px, 74vh); }
.product-master-page .product-master-table { min-width: 2860px; }
.product-master-page .product-master-table th { min-width: 124px; }
.product-master-page .product-master-table th:nth-child(1) { min-width: 68px; }
.product-master-page .product-master-table th:nth-child(2) { min-width: 230px; }
.product-master-page .product-master-table th:nth-child(3) { min-width: 132px; }
.product-master-page .product-master-table th:nth-child(4) { min-width: 168px; }
.product-master-page .product-master-table th:nth-child(6) { min-width: 168px; }
.product-master-page .product-master-table th:nth-child(7),
.product-master-page .product-master-table th:nth-child(9),
.product-master-page .product-master-table th:nth-child(16) { min-width: 94px; }
.product-master-page .product-master-table td { background: #fff; }
.product-master-page .product-master-table td.metric-blue { background: #f6faff; }
.product-master-page .product-master-table td.metric-green { background: #f4fcf8; }
.product-master-page .product-master-table td.metric-amber { background: #fffdf7; }
.product-master-page .product-master-table input {
  width: 100%;
  min-width: 104px;
  min-height: 34px;
  padding: 5px 8px;
  border-color: #dbe4ed;
  border-radius: 6px;
  color: #1e293b;
  background: rgb(255 255 255 / 82%);
  font: inherit;
  font-variant-numeric: tabular-nums;
}
.product-master-page .product-master-table input:hover { border-color: #a9bdd1; }
.product-master-page .product-master-table input:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgb(37 99 235 / 13%); }
.product-master-page .product-master-table input,
.product-master-page .product-master-table select { text-align: center; }
.product-master-page .product-master-table select { text-align-last: center; }
.product-master-page .product-master-table .master-option-cell .master-id-input { text-align: center; }
.product-master-page .product-master-table .master-sort-input { min-width: 52px; }
.product-master-page .product-master-table .master-name-input { min-width: 220px; font-weight: 700; }
.product-master-page .product-master-table .master-id-input { min-width: 142px; }
.product-master-page .product-master-table .master-sku-input { min-width: 132px; }
.product-master-page .product-master-table .master-sheet-input { min-width: 154px; }
.product-master-page .product-master-table:not(.product-master-editing) input:not([type="hidden"]):disabled,
.product-master-page .product-master-table:not(.product-master-editing) select:disabled {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #334155;
  cursor: default;
  opacity: 1;
  -webkit-text-fill-color: #334155;
}
.product-master-page .product-master-table:not(.product-master-editing) select:disabled {
  appearance: none;
  padding-right: 0;
}
.product-master-page .product-master-table.product-master-editing th.table-editable-column {
  border-top-color: #0369a1;
  box-shadow: inset 0 3px 0 #0369a1;
}
.product-master-page .product-master-table.product-master-editing th.table-editable-column::after {
  display: block;
  margin-top: 2px;
  color: #075985;
  content: "可编辑";
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.product-master-page .product-master-table td:nth-child(2),
.product-master-page .product-master-table th:nth-child(2) { position: sticky; left: 68px; }
.product-master-page .product-master-table td:nth-child(2) { z-index: 2; background: #fff; box-shadow: 2px 0 5px rgb(15 23 42 / 4%); }
.product-master-page .product-master-table th:nth-child(2) { z-index: 4; background: #e8eef5; box-shadow: 2px 0 5px rgb(15 23 42 / 4%); }
.product-master-page .product-master-table th.master-dashboard-heading { min-width: 76px; }
.product-master-page .master-toggle-cell { text-align: center; }
.product-master-page .master-toggle-cell input { width: 18px; min-width: 18px; height: 18px; vertical-align: middle; accent-color: var(--green); }
.product-master-page .master-status-cell { text-align: center; white-space: nowrap; }
.product-master-page .master-action-heading,
.product-master-page .master-action-cell { min-width: 78px; text-align: center; }
.product-master-page .master-action-cell { white-space: nowrap; }
.product-master-page .master-delete-button { min-width: 56px; }
.product-master-page .master-delete-button:disabled { cursor: not-allowed; opacity: 0.5; }
.master-delete-form { display: none; }
.master-delete-dialog .table-edit-dialog-save { border-color: #b42318; background: #b42318; }
.master-delete-dialog .table-edit-dialog-save:hover:not(:disabled) { border-color: #8e1e15; background: #8e1e15; }
.product-master-page .master-derived-value { color: #a16207; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.product-master-page .master-store-cell { width: 132px; min-width: 132px; max-width: 148px; padding: 9px 10px; vertical-align: top; }
.product-master-page .master-option-cell { width: 168px; min-width: 168px; max-width: 184px; padding: 9px 10px; vertical-align: top; }
.product-master-page .master-column-title {
  display: grid;
  gap: 2px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.product-master-page .master-column-title-main { font-weight: 760; }
.product-master-page .master-column-title-meta {
  color: #64748b;
  font-size: 11px;
  font-weight: 620;
  line-height: 1.25;
}
.product-master-page .master-store-heading { position: sticky; }
.product-master-page .master-store-list { display: grid; gap: 7px; min-width: 248px; margin-bottom: 7px; }
.product-master-page .master-product-store {
  display: grid;
  grid-template-columns: minmax(132px, 1fr) minmax(106px, 0.8fr) 28px;
  align-items: end;
  gap: 7px;
  padding: 7px;
  border: 1px solid #c9dfd1;
  border-radius: 6px;
  background: rgb(244 252 248 / 78%);
}
.product-master-page .master-product-store:first-child { grid-template-columns: minmax(132px, 1fr) minmax(106px, 0.8fr); }
.product-master-page .master-option-list { display: grid; gap: 7px; min-width: 368px; }
.product-master-page .master-option-mapping {
  display: grid;
  grid-template-columns: minmax(104px, 0.85fr) minmax(152px, 1.25fr) auto 28px;
  align-items: end;
  gap: 7px;
  padding: 7px;
  border: 1px solid #d8e5f2;
  border-radius: 6px;
  background: rgb(255 255 255 / 72%);
}
.product-master-page .master-option-field { display: grid; min-width: 0; gap: 4px; }
.product-master-page .master-option-field > span {
  overflow: hidden;
  color: #52667d;
  font-size: 10.5px;
  font-weight: 680;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-master-page .master-option-mapping input,
.product-master-page .master-option-mapping select,
.product-master-page .master-product-store select {
  min-width: 0;
  min-height: 30px;
  padding: 4px 7px;
}
.product-master-page .master-product-store select,
.product-master-page .master-option-mapping select {
  width: 100%;
  border: 1px solid #dbe4ed;
  border-radius: 6px;
  color: #1e293b;
  background: rgb(255 255 255 / 90%);
  font: inherit;
}
.product-master-page .master-scope-locked {
  display: flex;
  min-height: 30px;
  align-items: center;
  padding: 4px 7px;
  border: 1px solid #c9dfd1;
  border-radius: 6px;
  color: #047857;
  background: #ecfdf5;
  font-size: 12px;
  font-weight: 700;
}
.product-master-page .master-option-mapping .status { align-self: center; white-space: nowrap; }
.product-master-page .master-mapping-remove {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 1px solid #d6dee8;
  border-radius: 5px;
  color: #64748b;
  background: #fff;
  font-size: 20px;
  line-height: 1;
}
.product-master-page .master-mapping-remove:hover { border-color: #fca5a5; color: #b91c1c; background: #fff7f7; }
.product-master-page .master-add-option {
  margin-top: 7px;
  padding: 4px 0;
  border: 0;
  color: #2563eb;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}
.product-master-page .master-add-store { color: #047857; }
.product-master-page .master-add-store:hover { color: #065f46; }
.product-master-page .master-add-option:hover { color: #1d4ed8; text-decoration: underline; }
.product-master-save-form .button:disabled,
[data-manual-input-form] .button:disabled { cursor: wait; opacity: 0.65; }

@media (max-width: 1240px) {
  .master-dashboard-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .master-snapshot-meta { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  .user-create-form { align-items: stretch; flex-direction: column; }
  .user-create-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .user-create-form > .button { align-self: flex-end; }
}

.product-mappings-page .data-section + .data-section { margin-top: 16px; }
.product-mappings-page .business-product-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid #e5eaf0;
  background: #f8fafc;
}
.product-mappings-page .business-product-actions > p {
  max-width: 440px;
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}
.product-mappings-page .business-product-create-form {
  display: flex;
  align-items: center;
  gap: 10px;
}
.product-mappings-page .business-product-create-form label {
  flex: 0 0 auto;
  color: #475569;
  font-size: 13px;
  font-weight: 680;
  white-space: nowrap;
}
.product-mappings-page .business-product-create-form input {
  width: min(380px, 100%);
  min-height: 36px;
  padding: 6px 9px;
}
.product-mappings-page .business-product-create-form .button { min-height: 36px; }
.product-mappings-page .business-product-table { min-width: 620px; }
.product-mappings-page .business-product-table th:not(:first-child),
.product-mappings-page .business-product-table td:not(:first-child) {
  width: 150px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.product-mappings-page .product-name-edit-cell { min-width: 360px; }
.product-mappings-page .product-name-edit-cell input {
  width: min(100%, 480px);
  min-height: 34px;
  padding: 5px 8px;
  color: #1e293b;
  font: inherit;
}
.product-mappings-page .unified-mapping-table { min-width: 1580px; }
.product-mappings-page .unified-mapping-table th:nth-child(1) { min-width: 120px; }
.product-mappings-page .unified-mapping-table th:nth-child(2) { min-width: 230px; }
.product-mappings-page .unified-mapping-table th:nth-child(3) { min-width: 360px; }
.product-mappings-page .unified-mapping-table th:nth-child(4) { min-width: 150px; }
.product-mappings-page .unified-mapping-table th:nth-child(5) { min-width: 210px; }
.product-mappings-page .unified-mapping-table th:nth-child(6) { min-width: 280px; }
.product-mappings-page .unified-mapping-table th:nth-child(7) { min-width: 130px; }
.product-mappings-page .mapping-source-name {
  max-width: 460px;
  overflow-wrap: anywhere;
}
.product-mappings-page .option-classification {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.product-mappings-page .option-classification-official_rocket {
  border-color: #bae6fd;
  color: #0369a1;
  background: #f0f9ff;
}
.product-mappings-page .option-classification-official_marketplace {
  border-color: #bbf7d0;
  color: #15803d;
  background: #f0fdf4;
}
.product-mappings-page .option-classification-return_resale {
  border-color: #fde68a;
  color: #a16207;
  background: #fffbeb;
}
.product-mappings-page .option-classification-unknown {
  border-color: #dbe3ee;
  color: #64748b;
  background: #f8fafc;
}
.product-mappings-page .option-relationship {
  color: #475569;
  font-size: 12px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.product-mappings-page .status + .status { margin-left: 5px; }
.product-mappings-page .mapping-group + .mapping-group { margin-top: 12px; }
.product-mappings-page .mapping-group-pending { border-bottom: 1px solid #e5eaf0; }
.product-mappings-page .mapping-group-heading,
.product-mappings-page .mapping-group-mapped > summary {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
}
.product-mappings-page .mapping-group-heading { background: #fffbeb; }
.product-mappings-page .mapping-group-heading h3,
.product-mappings-page .mapping-group-mapped strong {
  color: #334155;
  font-size: 14px;
  font-weight: 740;
}
.product-mappings-page .mapping-group-heading p,
.product-mappings-page .mapping-group-mapped small {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}
.product-mappings-page .mapping-group-mapped { background: #fff; }
.product-mappings-page .mapping-group-mapped > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.product-mappings-page .mapping-group-mapped > summary::-webkit-details-marker { display: none; }
.product-mappings-page .mapping-group-mapped > summary > span:first-child { min-width: 0; }
.product-mappings-page .mapping-group-mapped > summary > svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: #64748b;
  transition: transform 160ms ease;
}
.product-mappings-page .mapping-group-mapped[open] > summary { border-bottom: 1px solid #e5eaf0; background: #f8fafc; }
.product-mappings-page .mapping-group-mapped[open] > summary > svg { transform: rotate(180deg); }

@media (max-width: 760px) {
  .maintenance-page .maintenance-page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
  }

  .maintenance-page .page-back-button { align-self: flex-start; }
  .maintenance-page .form-panel { padding: 16px; }
  .user-management-role-summary { grid-template-columns: 1fr; }
  .role-summary-item { border-right: 0; border-bottom: 1px solid #e5eaf0; }
  .role-summary-item:last-child { border-bottom: 0; }
  .user-create-fields { grid-template-columns: 1fr; }
  .user-create-form > .button { width: 100%; }
  .password-page .password-form-panel { margin-top: 16px; }
  .maintenance-page .data-section .section-heading { padding: 14px 16px; }
  .maintenance-page .mapping-actions { padding: 12px 16px; }
  .product-fixed-values-page .fixed-values-toolbar { justify-content: flex-start; flex-wrap: wrap; padding: 12px 16px; }
  .master-dashboard-toolbar { display: flex; align-items: stretch; flex-direction: column; gap: 12px; }
  .master-heading { align-items: flex-start; }
  .master-heading h1 { font-size: 20px; }
  .master-snapshot-meta { grid-template-columns: 1fr 1fr; width: 100%; }
  .master-snapshot-meta div:nth-child(2) { border-right: 0; }
  .master-snapshot-meta div:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }
  .product-master-page .master-control-band { align-items: stretch; flex-direction: column; padding: 14px; }
  .product-master-page .product-master-create-form,
  .product-master-page .product-master-save-form { align-items: stretch; width: 100%; }
  .product-master-page .product-master-create-form .master-create-field { width: 100%; flex: 1 1 auto; }
  .product-master-page .product-master-save-form { justify-content: flex-start; }
  .product-master-page .product-master-save-form .master-effective-date-field,
  .product-master-page .product-master-save-form .master-exchange-rate-field { width: 100%; }
  .product-master-page .master-control-divider { width: 100%; height: 1px; margin: 2px 0; }
  .product-master-page .master-section-heading { padding: 14px 16px; }
  .product-mappings-page .business-product-actions { align-items: stretch; flex-direction: column; padding: 12px 16px; }
  .product-mappings-page .business-product-create-form { align-items: stretch; flex-wrap: wrap; }
  .product-mappings-page .business-product-create-form input { flex: 1 1 220px; }
  .product-mappings-page .mapping-group-heading,
  .product-mappings-page .mapping-group-mapped > summary { padding-inline: 16px; }
}

/* 商品多选下拉（阶段：多选商品） */
.multi-select { position: relative; min-width: 260px; }
.multi-select-button { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 38px; padding: 0 12px; border: 1px solid var(--line, #cbd5e1); border-radius: 8px; background: #fff; cursor: pointer; font-size: 13px; color: inherit; }
.multi-select-button span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.multi-select-menu { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60; max-height: 260px; overflow-y: auto; padding: 6px 0; background: #fff; border: 1px solid var(--line, #cbd5e1); border-radius: 10px; box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12); }
.multi-select-menu[hidden] { display: none; }
.multi-select-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; font-size: 13px; color: inherit; }
.multi-select-item:hover { background: #f1f5f9; }
.multi-select-all { border-bottom: 1px solid #e2e8f0; font-weight: 600; }

/* ==== TASK-002: KPI / 环形图 / 库存图表 / 汇总行 ==== */
.kpi-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-grid-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1280px) {
  .kpi-grid-three, .kpi-grid-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
.kpi-grid-three, .kpi-grid-four { grid-template-columns: 1fr; }
}
.kpi-card.revenue { border-color: #dbe7fb; }
.kpi-card.revenue::before { background: linear-gradient(90deg, #1d4ed8, #7c3aed); }
.kpi-card.revenue .kpi-badge { color: #1d4ed8; background: #e0eaff; }
.kpi-card.tone-danger { border-color: #f5d9d9; }
.kpi-card.tone-danger::before { background: linear-gradient(90deg, #dc2626, #f87171); }
.kpi-card.tone-danger .kpi-value { color: #dc2626; }
.kpi-card.tone-warning { border-color: #f3e2c4; }
.kpi-card.tone-warning::before { background: linear-gradient(90deg, #d97706, #fbbf24); }
.kpi-card.tone-warning .kpi-value { color: #b45309; }
.kpi-card.tone-info { border-color: #cfe0f8; }
.kpi-card.tone-info::before { background: linear-gradient(90deg, #1d4ed8, #60a5fa); }
.kpi-card.tone-info .kpi-value { color: #1d4ed8; }
.kpi-card.tone-sky { border-color: #cfe3f4; }
.kpi-card.tone-sky::before { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.kpi-card.tone-sky .kpi-value { color: #0369a1; }
.kpi-comparison strong { font-variant-numeric: tabular-nums; }

.chart-section { padding-bottom: 18px; }
.donut-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 900px) { .donut-grid { grid-template-columns: 1fr; } }
.donut-box { display: grid; gap: 10px; }
.donut-title { margin: 0; color: #334155; font-size: 13px; font-weight: 700; }
.donut-canvas-wrap { position: relative; height: 180px; }
.donut-canvas-wrap[data-empty="true"]::after {
  content: "当前选择没有可展示的数据";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 12px;
}
.donut-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  list-style: none;
  font-size: 12px;
  color: #475569;
}
.donut-list:empty { display: none; }
.donut-list li { display: flex; align-items: center; gap: 8px; }
.donut-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; }
.donut-name { overflow: hidden; min-width: 0; text-overflow: ellipsis; white-space: nowrap; }
.donut-value { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }

.inventory-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}
.bar-canvas-wrap { position: relative; overflow-x: auto; overflow-y: hidden; }
.bar-canvas-inner { position: relative; height: 260px; min-width: 100%; }

.data-table tfoot td,
#manager-dashboard #mdp-root .mdp-month-table tfoot td,
#manager-dashboard #mdp-root .mdp-allocation-table tfoot td {
  padding: 10px 12px;
  background: #f1f5f9;
  border-top: 2px solid #cbd5e1;
  color: #0f172a;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.data-table tfoot .metric-blue { color: #1d4ed8; }
.data-table tfoot .metric-amber { color: #92400e; }
.data-table tfoot .metric-green { color: #15803d; }

/* ==== 实机演示微调（2026-09-15 第二轮） ==== */
.daily-table { min-width: 1560px; }
#daily-finance-table { min-width: 1080px; }
.product-cell { min-width: 120px; max-width: 220px; }
.multi-select-button { min-height: 44px; background: #f8fafc; border-color: #d7e0ea; border-radius: 10px; color: #1e293b; font-weight: 620; }
.multi-select-item input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: #2563eb; }
.donut-list { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.donut-list li { display: inline-flex; min-width: 0; }
.donut-value { margin-left: 2px; }
.data-table tfoot td.tfoot-muted { color: #94a3b8; font-weight: 420; }
.data-table tfoot td.tfoot-label { text-align: center; }
.data-table tfoot td.metric-blue { font-weight: 720; }

.monthly-page { max-width: 1480px; }
[data-monthly-status]:empty { display: none; }
.monthly-toolbar { margin-bottom: 22px; }
.monthly-toolbar .dashboard-tabs { width: 100%; }
.monthly-hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  padding: 32px 36px;
  border: 1px solid #d8e5f4;
  border-radius: 18px;
  background: linear-gradient(120deg, #ffffff 45%, #eaf3ff 100%);
  box-shadow: 0 9px 28px rgb(36 86 139 / 7%);
}
.monthly-eyebrow { color: #4f80c5; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.monthly-hero h1 { margin: 5px 0 7px; color: #17243a; font-size: clamp(26px, 3vw, 37px); line-height: 1.2; }
.monthly-hero p { max-width: 640px; color: #61738a; font-size: 14px; }
.monthly-month-form { flex: 0 0 auto; display: grid; gap: 7px; }
.monthly-month-label { color: #52667f; font-size: 12px; font-weight: 750; }
.monthly-month-controls { display: flex; gap: 9px; }
.monthly-month-controls select { min-width: 96px; padding: 9px 12px; border: 1px solid #cbd9e8; border-radius: 9px; color: #20344e; background: #ffffff; font: inherit; cursor: pointer; }
.monthly-product-select { min-width: 210px; width: 210px; }
.monthly-product-select .multi-select-button { min-height: 43px; border-color: #cbd9e8; border-radius: 9px; background: #ffffff; font-size: inherit; font-weight: 400; }
.monthly-product-select .multi-select-menu { min-width: 260px; }
.monthly-year-select { position: relative; min-width: 116px; }
.monthly-year-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 9px 12px; border: 1px solid #cbd9e8; border-radius: 9px; color: #20344e; background: #ffffff; font: inherit; text-align: left; cursor: pointer; }
.monthly-year-toggle::after { content: ""; flex: 0 0 auto; border-top: 6px solid #6d839c; border-right: 5px solid transparent; border-left: 5px solid transparent; }
.monthly-year-toggle:hover, .monthly-year-toggle[aria-expanded="true"] { border-color: #8fb4dc; }
.monthly-year-list { position: absolute; z-index: 30; top: calc(100% + 5px); left: 0; width: 100%; max-height: 170px; margin: 0; padding: 5px; border: 1px solid #cbd9e8; border-radius: 9px; background: #ffffff; box-shadow: 0 12px 28px rgb(22 53 92 / 14%); list-style: none; overflow-y: auto; }
.monthly-year-list[hidden] { display: none; }
.monthly-year-option { padding: 8px 10px; border-radius: 6px; color: #29405d; font-size: 13px; cursor: pointer; }
.monthly-year-option:hover, .monthly-year-option.is-active { color: #12588f; background: #eef5ff; }
.monthly-year-option[aria-selected="true"] { color: #ffffff; background: #1769aa; font-weight: 750; }
.monthly-month-controls .button { white-space: nowrap; }
.monthly-section-tabs { display: flex; gap: 8px; margin: 24px 0 20px; border-bottom: 1px solid #dbe4ee; }
.monthly-section-tabs button { padding: 12px 21px; border: 0; border-bottom: 3px solid transparent; color: #64758a; background: transparent; font-weight: 750; }
.monthly-section-tabs button:hover { color: #1769aa; }
.monthly-section-tabs button[aria-selected="true"] { border-bottom-color: #1769aa; color: #12588f; }
.monthly-panel { display: grid; gap: 20px; }
.monthly-section-intro { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 1px 0 4px; }
.monthly-section-intro h2 { margin-top: 3px; font-size: 22px; color: #17243a; }
.monthly-count, .monthly-status { padding: 5px 11px; border: 1px solid #cfe0f6; border-radius: 99px; background: #edf5ff; color: #386aa3; font-size: 12px; font-weight: 750; }
.monthly-product { min-width: 0; margin-bottom: 11px; padding: 26px; border: 1px solid #dce6f1; border-radius: 17px; background: #ffffff; box-shadow: 0 7px 22px rgb(22 53 92 / 5%); scroll-margin-top: 20px; }
.monthly-product-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.monthly-product-heading h3 { margin-top: 3px; font-size: 23px; color: #192941; }
.monthly-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.monthly-metric { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; min-height: 125px; padding: 17px 19px; border: 1px solid #e4ebf3; border-radius: 11px; background: #f9fbfd; }
.monthly-metric > span { color: #60748c; font-size: 12px; font-weight: 730; }
.monthly-metric-value { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 5px; margin: 7px 0 1px; }
.monthly-metric-value > strong { color: #1b365a; font-size: 28px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.monthly-metric-change { font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.monthly-metric-change.is-up { color: #14a66e; }
.monthly-metric-change.is-down { color: #db4c56; }
.monthly-metric-change.is-flat { color: #7b8a9a; }
.monthly-metric > small { color: #8795a7; font-size: 11px; }
.monthly-return-metric { background: #f8f9fe; }
.monthly-return-form { width: 100%; margin-top: 7px; }
.monthly-return-form > div { display: flex; gap: 5px; }
.monthly-return-form input { width: 100%; min-width: 0; height: 30px; padding: 4px 7px; border: 1px solid #cdd9e9; border-radius: 6px; background: #ffffff; font-size: 12px; }
.monthly-return-form button { flex: 0 0 auto; padding: 4px 9px; border: 0; border-radius: 6px; color: #ffffff; background: #1769aa; font-size: 12px; font-weight: 700; }
.monthly-return-form button:hover { background: #10588f; }
.monthly-chart-grid { display: grid; grid-template-columns: 1fr; gap: 15px; margin-top: 18px; }
.monthly-print-heading { display: none; }
.monthly-pdf-page { position: fixed; top: 0; left: 0; z-index: -10000; pointer-events: none; box-sizing: border-box; background: #ffffff; color: #243d5b; font-family: "Microsoft YaHei", "PingFang SC", sans-serif; font-size: 14px; line-height: 1.6; }
.monthly-pdf-page .monthly-print-heading { display: block; margin-bottom: 16px; }
.monthly-pdf-page .monthly-print-heading h1 { margin: 0; color: #192941; font-size: 24px; }
.monthly-pdf-page .monthly-print-heading p { margin: 4px 0 0; font-size: 13px; }
.monthly-pdf-page .monthly-product-heading { margin-bottom: 14px; }
.monthly-pdf-page .monthly-product-heading h3 { margin: 0; font-size: 22px; }
.monthly-pdf-page .monthly-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.monthly-pdf-page .monthly-metric { min-height: 88px; padding: 12px 16px; }
.monthly-pdf-page .monthly-chart-card { margin-top: 14px; padding: 14px 18px; }
.monthly-pdf-page .monthly-chart-title { margin-bottom: 10px; }
.monthly-pdf-page .monthly-chart-title h4 { margin: 0; }
.monthly-pdf-page .monthly-chart-scroll { overflow: visible; }
.monthly-pdf-page .monthly-chart-wrap, .monthly-pdf-page .monthly-pie-wrap { min-width: 0; max-width: none; width: 100%; height: 180px; }
.monthly-pdf-page .monthly-pie-wrap { height: 210px; }
.monthly-pdf-page .monthly-chart-wrap img, .monthly-pdf-page .monthly-pie-wrap img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; margin: 0 auto; }
.monthly-pdf-page .monthly-chart-empty { min-height: 220px; height: 220px; }
.monthly-pdf-page .monthly-append-heading { flex-direction: row; align-items: center; margin-bottom: 14px; }
.monthly-pdf-page .monthly-append-heading h2 { font-size: 22px; }
.monthly-pdf-page .monthly-report-table { width: 100% !important; min-width: 0; font-size: 13px; }
.monthly-pdf-page .monthly-report-table td { padding: 0; }
.monthly-pdf-page .monthly-report-table th { padding: 12px 14px; }
.monthly-pdf-page .monthly-pdf-cell { min-height: 23px; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
#monthly-products-panel > .monthly-section-intro { align-items: center; flex-wrap: wrap; }
.monthly-print-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; font-size: 13px; color: #61738a; }
.monthly-print-actions .monthly-count, .monthly-print-actions .button { white-space: nowrap; }
#monthly-print-status:not(:empty) { flex-basis: 100%; text-align: right; }
#monthly-print-status:empty { display: none; }
.monthly-append-section { min-width: 0; padding: 26px; border: 1px solid #dce6f1; border-radius: 17px; background: #ffffff; }
.monthly-append-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.monthly-append-heading h2 { margin: 0; color: #192941; font-size: 23px; }
.monthly-append-heading > span { color: #61738a; font-size: 12px; }
.monthly-development-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.monthly-development-actions [role="status"] { color: #61738a; font-size: 12px; }
.monthly-table-scroll { overflow-x: auto; border: 1px solid #dce6f1; border-radius: 10px; }
.monthly-report-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; line-height: 1.6; }
.monthly-report-table th, .monthly-report-table td { padding: 14px 16px; border-right: 1px solid #dce6f1; border-bottom: 1px solid #dce6f1; vertical-align: top; overflow-wrap: anywhere; }
.monthly-report-table th { position: relative; color: #58748c; background: #f3f7fd; font-weight: 700; text-align: left; }
.monthly-report-table th:last-child, .monthly-report-table td:last-child { border-right: 0; }
.monthly-report-table tr:last-child td { border-bottom: 0; }
.monthly-report-table tbody tr:nth-child(even) { background: #f9fbfe; }
.monthly-development-table td { padding: 0; }
.monthly-development-cell { min-height: 64px; padding: 14px 16px; white-space: pre-wrap; outline: none; }
.monthly-development-cell[contenteditable="plaintext-only"]:focus { background: #eef5ff; box-shadow: inset 0 0 0 2px #86b7f0; }
.monthly-development-operation-column { width: 80px; text-align: center; }
.monthly-delete-development-row { margin: 12px 8px; padding: 5px 10px; border: 1px solid #efc9ce; border-radius: 6px; color: #b43e4b; background: #fff6f7; font-size: 12px; cursor: pointer; }
.monthly-column-resizer { position: absolute; inset: 0 0 0 auto; width: 10px; cursor: col-resize; touch-action: none; }
.monthly-column-resizer::after { content: ""; position: absolute; right: 3px; top: 12px; bottom: 12px; width: 2px; background: #b7cce5; }
.monthly-column-resizer:focus-visible { outline: 2px solid #4f80ed; }
.monthly-inventory-sources { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 16px; color: #61738a; font-size: 12px; }
.monthly-inventory-table { min-width: 700px; }
.monthly-inventory-table.is-resizable { min-width: 0; }
.monthly-pdf-page .monthly-inventory-table col { width: 20% !important; }
.monthly-inventory-table td:not(:first-child), .monthly-inventory-table th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .monthly-append-section { padding: 16px; }
  .monthly-append-heading { flex-direction: column; align-items: flex-start; }
}
@media print {
  @page monthly-report { size: A4 landscape; margin: 12mm; }
  html:has(> .monthly-report-body) { background: #ffffff; }
  .monthly-report-body { page: monthly-report; background: #ffffff; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .monthly-report-body .app-header, .monthly-report-body .skip-link, .monthly-report-body .site-footer,
  .monthly-report-body .messages, .monthly-report-body .monthly-toolbar, .monthly-report-body .monthly-hero,
  .monthly-report-body .monthly-section-tabs, .monthly-report-body .monthly-print-actions,
  .monthly-report-body .monthly-section-intro, .monthly-report-body .monthly-count,
  .monthly-report-body .monthly-return-form, .monthly-report-body .monthly-development-actions,
  .monthly-report-body .monthly-column-resizer, .monthly-report-body .monthly-development-operation-column,
  .monthly-report-body .monthly-eyebrow, .monthly-report-body #monthly-ads-panel { display: none !important; }
  .monthly-report-body .monthly-page { max-width: none; width: 100%; padding: 0; margin: 0; }
  .monthly-report-body .monthly-print-heading { display: block; margin-bottom: 18px; }
  .monthly-report-body .monthly-print-heading h1 { margin: 0; font-size: 24px; }
  .monthly-report-body .monthly-print-heading p { margin: 5px 0 0; font-size: 13px; }
  .monthly-report-body #monthly-products-panel { display: block !important; }
  .monthly-report-body .monthly-product { break-before: page; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .monthly-report-body .monthly-product:first-of-type { break-before: auto; }
  .monthly-report-body .monthly-product-heading { break-after: avoid; margin-bottom: 14px; }
  .monthly-report-body .monthly-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); break-inside: avoid; }
  .monthly-report-body .monthly-metric { min-height: 88px; padding: 12px 16px; }
  .monthly-report-body .monthly-chart-grid { display: block; }
  .monthly-report-body .monthly-chart-card { break-inside: avoid; margin-top: 14px; padding: 14px 18px; }
  .monthly-report-body .monthly-chart-title { margin-bottom: 10px; }
  .monthly-report-body .monthly-chart-scroll, .monthly-report-body .monthly-table-scroll { overflow: visible; }
  .monthly-report-body .monthly-chart-wrap { min-width: 0; width: 100%; height: 220px; }
  .monthly-report-body .monthly-pie-wrap { min-width: 0; width: 100%; height: 240px; }
  .monthly-report-body .monthly-append-section { break-before: page; padding: 0; border: 0; border-radius: 0; }
  .monthly-report-body .monthly-append-heading { break-after: avoid; }
  .monthly-report-body .monthly-development-table { width: 100% !important; }
  .monthly-report-body .monthly-development-table col:not(.monthly-development-operation-column) { width: var(--monthly-print-column-width) !important; }
  .monthly-report-body .monthly-inventory-table { min-width: 0; }
  .monthly-report-body .monthly-inventory-table { width: 100% !important; }
  .monthly-report-body .monthly-inventory-table col { width: 20% !important; }
  .monthly-report-body .monthly-report-table { font-size: 12px; }
  .monthly-report-body .monthly-report-table thead { display: table-header-group; }
  .monthly-report-body .monthly-report-table tr { break-inside: avoid; }
  .monthly-report-body .monthly-development-cell { min-height: 0; }
  .monthly-report-body [data-monthly-status], .monthly-report-body [data-monthly-retry] { display: none !important; }
}
.monthly-chart-card { min-width: 0; padding: 21px; border: 1px solid #e0e8f2; border-radius: 12px; background: #ffffff; }
.monthly-chart-title { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-bottom: 17px; }
.monthly-chart-title h4 { margin-top: 3px; color: #253850; font-size: 17px; }
.monthly-chart-title > span { color: #8b9bae; font-size: 11px; white-space: nowrap; }
.monthly-chart-scroll { overflow-x: auto; }
.monthly-chart-wrap { position: relative; min-width: 850px; height: 330px; }
.monthly-chart-wrap.is-empty::after { content: "暂无可绘制的逐日数据"; position: absolute; inset: 0; display: grid; place-items: center; color: #8b9bad; background: #f9fbfe; border: 1px dashed #dce5ef; border-radius: 8px; }
.monthly-pie-wrap { position: relative; width: 100%; min-width: 680px; max-width: 820px; height: 350px; margin: 0 auto; }
.monthly-chart-empty { display: grid; min-height: 270px; place-items: center; padding: 20px; border: 1px dashed #dce5ef; border-radius: 8px; color: #8596a9; text-align: center; background: #f9fbfe; }
.monthly-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; margin-top: 13px; color: #53667c; font-size: 12px; }
.monthly-legend span, .monthly-sales-list span { display: inline-flex; align-items: center; gap: 7px; }
.monthly-dot { display: inline-block; flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; }
.monthly-dot.blue { background: #4f80ed; }
.monthly-dot.cyan { background: #4ebfe8; }
.monthly-dot.violet { background: #9767e9; }
.monthly-sales-list { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 18px; margin-top: 13px; color: #53667c; font-size: 12px; }
.monthly-sales-list b { color: #243d5b; font-variant-numeric: tabular-nums; }
.monthly-sales-list em { color: #8796a7; font-style: normal; }
.monthly-no-products { padding: 65px 20px; border: 1px dashed #d1deeb; border-radius: 12px; color: #72869c; text-align: center; background: #ffffff; }
.monthly-upload-card { min-width: 0; padding: 24px; border: 1px solid #dce6f1; border-radius: 13px; background: #ffffff; box-shadow: 0 4px 14px rgb(22 53 92 / 4%); }
.monthly-upload-heading { display: flex; align-items: flex-start; gap: 13px; }
.monthly-upload-heading h3 { color: #223550; font-size: 18px; }
.monthly-upload-heading p { margin-top: 4px; color: #7889a0; font-size: 12px; }
.monthly-step { display: grid; flex: 0 0 auto; width: 34px; height: 34px; place-items: center; border-radius: 9px; background: #e7f1fc; color: #246cac; font-size: 12px; font-weight: 850; }
.monthly-analysis-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; margin-top: 22px; }
.monthly-analysis-fields label { display: grid; gap: 6px; color: #4f637a; font-size: 12px; font-weight: 750; }
.monthly-analysis-fields small { display: inline; color: #91a0b1; font-weight: 550; }
.monthly-analysis-fields input { min-width: 0; width: 100%; min-height: 41px; padding: 8px 11px; border: 1px solid #d2deeb; border-radius: 8px; background: #f8fafc; color: #304760; }
.monthly-analysis-fields input:disabled { opacity: 1; color: #8fa0b1; }
.monthly-file-field { grid-column: 1 / -1; }
.monthly-file-field input { padding: 9px; background: #ffffff; }
#monthly-file-name { color: #7c8da1; font-size: 12px; font-weight: 500; }
.monthly-analyze-button { margin-top: 18px; }
.monthly-analysis-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.monthly-analysis-kpis > div { display: grid; gap: 6px; min-height: 85px; padding: 15px; border: 1px solid #e4ebf3; border-radius: 9px; background: #f9fbfd; }
.monthly-analysis-kpis span { color: #72859a; font-size: 12px; }
.monthly-analysis-kpis strong { color: #a7b5c5; font-size: 23px; }
.monthly-analysis-kpis strong.is-positive { color: #14a66e; }
.monthly-analysis-kpis strong.is-negative { color: #db4c56; }
.monthly-analysis-message { margin: 10px 0 0; color: #287254; font-size: 12px; }
.monthly-analysis-message.is-error { color: #bf3341; }
.monthly-analysis-count { margin: 15px 0 0; color: #637b95; font-size: 12px; }
.monthly-analysis-empty { display: grid; min-height: 160px; place-items: center; margin-top: 18px; padding: 20px; border: 1px dashed #dae4ef; border-radius: 9px; color: #91a0b1; text-align: center; background: #fbfcfe; font-size: 12px; }
.monthly-analysis-table-wrap { max-height: 580px; overflow: auto; margin-top: 18px; border: 1px solid #e2e9f2; border-radius: 9px; }
.monthly-analysis-table { width: 100%; border-collapse: collapse; color: #596f87; font-size: 12px; }
.monthly-analysis-table th { position: sticky; top: 0; z-index: 1; padding: 10px 12px; background: #f3f7fb; color: #6c819a; font-weight: 750; text-align: left; white-space: nowrap; }
.monthly-analysis-table td { padding: 9px 12px; border-top: 1px solid #edf1f6; white-space: nowrap; }
.monthly-analysis-table tr.is-loss td:nth-child(4), .monthly-analysis-table tr.is-loss td:last-child { color: #ca4652; }
.monthly-analysis-table-empty { padding: 42px 12px !important; color: #91a0b1; text-align: center; }
.monthly-export-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.monthly-export-actions button { padding: 10px 15px; border: 1px solid #d2dfed; border-radius: 8px; color: #637b95; background: #f4f8fc; font-weight: 720; }
.monthly-export-actions button:not(:disabled) { color: #1769aa; background: #edf5ff; cursor: pointer; }
@media (max-width: 1000px) {
  .monthly-hero { display: grid; }
  .monthly-metrics, .monthly-analysis-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .monthly-hero { display: grid; padding: 22px; }
  .monthly-month-form { width: 100%; }
  .monthly-month-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monthly-month-controls select, .monthly-year-select { width: 100%; min-width: 0; }
  .monthly-product-select { grid-column: 1 / -1; width: 100%; min-width: 0; }
  .monthly-product-select .multi-select-menu { min-width: 0; }
  .monthly-month-controls .button { grid-column: 1 / -1; }
  .monthly-product { padding: 16px; }
  .monthly-metrics, .monthly-analysis-fields { grid-template-columns: 1fr; }
  .monthly-file-field { grid-column: auto; }
  .monthly-chart-card { padding: 15px; }
  .monthly-chart-wrap { height: 300px; }
  .monthly-pie-wrap { height: 320px; }
  .monthly-chart-empty { height: 230px; min-height: 230px; }
  .monthly-product-heading { align-items: flex-start; }
  .monthly-section-tabs button { flex: 1; padding: 11px 7px; }
}
/* ===== 管理者看板（manager dashboard） ===== */
#manager-dashboard{--primary-color: #2563eb;
            --primary-hover: #1d4ed8;
            --bg-color: #f8fafc;
            --card-bg: #ffffff;
            --text-main: #1e293b;
            --text-muted: #64748b;
            --border-color: #cbd5e1;
            --excel-header-gold: #eab308;
            --excel-header-orange: #f97316;
            --excel-header-green: #84cc16;
            --excel-header-blue: #38bdf8;
            --highlight-bg: #e2e8f0;}#manager-dashboard .dashboard-container{max-width: 1650px;
            margin: 0 auto;}#manager-dashboard .header-nav{display: flex;
            justify-content: space-between;
            align-items: center;
            background: var(--card-bg);
            padding: 16px 24px;
            border-radius: 12px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
            margin-bottom: 20px;}#manager-dashboard .nav-tabs{display: flex;
            gap: 12px;}#manager-dashboard .tab-btn{padding: 8px 16px;
            border-radius: 8px;
            border: none;
            background: #f1f5f9;
            color: var(--text-muted);
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;}#manager-dashboard .tab-btn.active{background: var(--primary-color);
            color: white;}#manager-dashboard .manager-badge{background: #fef3c7;
            color: #d97706;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: bold;
            margin-left: 6px;}#manager-dashboard .system-info{font-size: 14px;
            color: var(--text-muted);}#manager-dashboard .section-card{background: var(--card-bg);
            padding: 24px;
            border-radius: 12px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
            margin-bottom: 24px;}#manager-dashboard .section-title{font-size: 16px;
            font-weight: 700;
            margin-bottom: 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;}#manager-dashboard .product-selector{display: flex;
            align-items: center;
            gap: 10px;
            font-size: 14px;
            font-weight: normal;}#manager-dashboard .product-selector select{padding: 6px 12px;
            border-radius: 6px;
            border: 1px solid var(--border-color);
            font-weight: bold;
            color: var(--primary-color);}#manager-dashboard .btn-export{background: #f1f5f9;
            border: 1px solid var(--border-color);
            padding: 6px 12px;
            border-radius: 6px;
            font-size: 12px;
            cursor: pointer;}#manager-dashboard .table-responsive{overflow-x: auto;}#manager-dashboard table{width: 100%;
            border-collapse: collapse;
            font-size: 13px;
            text-align: center;}#manager-dashboard table.table-bordered th, #manager-dashboard table.table-bordered td{border: 1px solid var(--border-color);
            padding: 10px 12px;}#manager-dashboard .module-1-table{max-width: 600px;
            margin: 0 auto;
            text-align: left;}#manager-dashboard .module-1-table td{padding: 8px 16px;}#manager-dashboard .group-header{font-weight: bold;
            background-color: #fafafa;
            vertical-align: middle;
            text-align: center;
            width: 130px;}#manager-dashboard .text-red{color: #ef4444;
            font-weight: 500;}#manager-dashboard .highlight-row{background-color: #e2e8f0 !important;
            font-weight: bold;}#manager-dashboard .gold-header{background-color: #eab308 !important;
            color: #000;}#manager-dashboard .m2-header-july{background-color: #eab308; color: #000;}#manager-dashboard .m2-header-aug{background-color: #f97316; color: #fff;}#manager-dashboard .m2-header-rate{background-color: #84cc16; color: #000;}#manager-dashboard .m3-header-yellow{background-color: #fef08a;}#manager-dashboard .m3-header-blue{background-color: #bae6fd;}#manager-dashboard .m3-header-darkblue{background-color: #93c5fd;}#manager-dashboard .m3-header-green{background-color: #dcfce7;}#manager-dashboard .rank-badge{display: inline-block;
            width: 20px;
            height: 20px;
            line-height: 20px;
            text-align: center;
            border-radius: 50%;
            background: #e2e8f0;
            font-size: 11px;
            font-weight: bold;}#manager-dashboard .rank-1{background: #fef08a; color: #854d0e;}#manager-dashboard .rank-2{background: #e2e8f0; color: #475569;}#manager-dashboard .rank-3{background: #ffedd5; color: #9a3412;}

    

#manager-dashboard html{color-scheme:light}#manager-dashboard #mdp-root{--mdp-blue:#2563eb;--mdp-surface:#fff;--mdp-border:#cbd5e1;--mdp-muted:#64748b;--mdp-red:#ef4444}#manager-dashboard #mdp-root [hidden]{display:none!important}#manager-dashboard #mdp-root .mdp-heading-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;min-width:0}#manager-dashboard #mdp-root .mdp-heading-actions button:disabled, #manager-dashboard #mdp-root #mdp-month-export:disabled{opacity:.5;cursor:not-allowed}#manager-dashboard #mdp-root button:focus-visible, #manager-dashboard #mdp-root input:focus-visible, #manager-dashboard #mdp-root select:focus-visible{outline:3px solid #90bde0;outline-offset:2px}#manager-dashboard #mdp-root .mdp-editing .section-title{color:#2563eb}#manager-dashboard #mdp-root .mdp-demo-notice{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;font-size:12px;color:#64748b;margin:0 2px 20px}#manager-dashboard #mdp-root .mdp-demo-error{color:var(--mdp-red)}#manager-dashboard #mdp-root .header-nav{gap:16px;flex-wrap:wrap}#manager-dashboard #mdp-root .nav-tabs{flex-wrap:wrap}#manager-dashboard #mdp-root .nav-tabs .tab-btn{cursor:default;white-space:nowrap}#manager-dashboard #mdp-root .section-title{gap:16px;flex-wrap:wrap}#manager-dashboard #mdp-root .product-selector{flex-wrap:wrap}#manager-dashboard #mdp-root .product-selector label{display:flex;align-items:center;gap:10px;flex-wrap:wrap}#manager-dashboard #mdp-root .product-selector select{min-width:135px}#manager-dashboard #mdp-root .mdp-panel-foot{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;font-size:12px;color:#64748b;margin-top:14px}#manager-dashboard #mdp-root .mdp-trial-note{font-size:12px;color:#64748b;padding:0 2px 20px}#manager-dashboard #mdp-root .mdp-unknown{color:#64748b}#manager-dashboard #mdp-root .mdp-negative{color:#ef4444}#manager-dashboard #mdp-root .mdp-table{font-variant-numeric:tabular-nums}#manager-dashboard #mdp-root .mdp-table th, #manager-dashboard #mdp-root .mdp-table td{white-space:nowrap}#manager-dashboard #mdp-root .mdp-profit-table{width:100%;max-width:600px}#manager-dashboard #mdp-root .mdp-category{font-weight:700;background:#fafafa;vertical-align:middle;text-align:center;width:130px}#manager-dashboard #mdp-root .mdp-profit-table .mdp-line-label{text-align:left}#manager-dashboard #mdp-root .mdp-profit-table .mdp-line-value{text-align:right}#manager-dashboard #mdp-root .mdp-profit-table .mdp-total-row td, #manager-dashboard #mdp-root .mdp-profit-table .mdp-net-row td{background:#e2e8f0;font-weight:700}#manager-dashboard #mdp-root .mdp-profit-table .mdp-net-row .mdp-line-value>span:not(.mdp-unknown){color:#15803d}#manager-dashboard #mdp-root .mdp-money-edit{display:flex;align-items:center;justify-content:flex-end;gap:7px}#manager-dashboard #mdp-root input{font:inherit;border:1px solid #cbd5e1;border-radius:4px;background:#fff;padding:5px 7px;height:30px;text-align:right;width:88px}#manager-dashboard #mdp-root .mdp-money-edit input{width:125px}#manager-dashboard #mdp-root input::placeholder{color:#64748b;opacity:1}#manager-dashboard #mdp-root .mdp-inline-meta{display:block;font-size:11px;color:#64748b;white-space:normal;font-weight:400;margin-top:3px}#manager-dashboard #mdp-root .mdp-month-table{min-width:1960px}#manager-dashboard #mdp-root .mdp-month-table th:first-child, #manager-dashboard #mdp-root .mdp-month-table td:first-child{position:sticky;left:0;z-index:1}#manager-dashboard #mdp-root .mdp-month-table tbody td:first-child{background:#fff}#manager-dashboard #mdp-root .mdp-month-table tbody td:first-child{font-weight:700}#manager-dashboard #mdp-root .mdp-rank{display:inline-block;width:20px;height:20px;line-height:20px;text-align:center;border-radius:50%;background:#e2e8f0;font-size:11px;font-weight:700;color:#475569}#manager-dashboard #mdp-root .mdp-top-rank{background:#fef08a;color:#854d0e}#manager-dashboard #mdp-root .mdp-missing-day{display:block;font-size:11px;color:#d97706;margin-top:2px;font-weight:400}#manager-dashboard #mdp-root .mdp-allocation-table{min-width:1840px}#manager-dashboard #mdp-root .mdp-allocation-table tbody td:first-child{font-weight:700}#manager-dashboard #mdp-root .mdp-allocation-net>span:not(.mdp-unknown){color:#16a34a;font-weight:700}
@media(max-width:650px){{padding:10px}#manager-dashboard #mdp-root .header-nav{padding:14px}#manager-dashboard #mdp-root .section-card{padding:16px}#manager-dashboard #mdp-root .nav-tabs{gap:8px}#manager-dashboard #mdp-root .tab-btn{font-size:12px;padding:7px 10px}#manager-dashboard #mdp-root .mdp-heading-actions{width:100%;justify-content:flex-start}#manager-dashboard #mdp-root .mdp-profit-table{min-width:500px}#manager-dashboard #mdp-root input, #manager-dashboard #mdp-root select{font-size:16px}}


#manager-dashboard #mdp-root .mdp-month-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
}
#manager-dashboard #mdp-root .mdp-month-heading small {
  color: #64748b;
  font-size: 12px;
  font-weight: 400;
}

/* 管理者看板模块二「毛利率排名」列头排序（三态循环：商品顺序 / 高到低 / 低到高） */
#manager-dashboard #mdp-root .mdp-sortable { cursor: pointer; }
#manager-dashboard #mdp-root .mdp-sortable:hover { box-shadow: inset 0 0 0 2px #2563eb; }
#manager-dashboard #mdp-root .mdp-sortable[data-rank-state="desc"],
#manager-dashboard #mdp-root .mdp-sortable[data-rank-state="asc"] { box-shadow: inset 0 0 0 2px #2563eb; }
#manager-dashboard #mdp-root .mdp-sortable[data-rank-state="product"] #mdp-rank-label::after { content: " ⇅"; opacity: 0; }
#manager-dashboard #mdp-root .mdp-sortable[data-rank-state="product"]:hover #mdp-rank-label::after { opacity: 0.6; }

/* 管理者看板月份选择（紧凑，参考运营月报控件） */
#manager-dashboard .mdp-month-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 2px 16px;font-size:12px;color:#64748b}
#manager-dashboard .mdp-month-bar .mdp-month-caption{font-weight:600;color:#475569}
#manager-dashboard .mdp-month-bar select{width:auto;min-width:0;padding:5px 8px;border:1px solid #cbd9e8;border-radius:6px;background:#fff;color:#20344e;font:inherit;font-size:12px;cursor:pointer}
#manager-dashboard .mdp-month-bar .mdp-month-hint{color:#94a3b8}
#manager-dashboard .mdp-month-bar .mdp-month-rate{margin-left:auto}
#manager-dashboard .mdp-empty{padding:28px 4px;font-size:13px;color:#64748b}

/* 审计记录 */
.audit-log-page .audit-filters{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;margin:0 0 14px}
.audit-log-page .audit-filters .field{min-width:150px}
.audit-log-page .audit-filters select{min-width:150px}
.audit-log-page .audit-submit{height:34px}
.audit-log-page .audit-reset{align-self:flex-end;padding-bottom:8px;font-size:13px;color:#5f5e5a}
.audit-log-page .audit-summary{margin:0 0 10px;font-size:13px;color:#5f5e5a}
.audit-log-page .audit-table{font-size:13px}
.audit-log-page .audit-table th{white-space:nowrap}
.audit-log-page .audit-table td{vertical-align:top}
.audit-log-page .audit-time,.audit-log-page .audit-actor{white-space:nowrap;color:#444441}
.audit-log-page .audit-object{min-width:240px}
.audit-log-page .audit-note{max-width:220px;color:#5f5e5a}
.audit-badge{display:inline-block;padding:2px 8px;border-radius:999px;font-size:12px;white-space:nowrap}
.audit-badge-new{background:#e1f5ee;color:#0f6e56}
.audit-badge-edit{background:#e6f1fb;color:#185fa5}
.audit-badge-delete{background:#fcebeb;color:#a32d2d}
.audit-badge-close{background:#faeeda;color:#854f0b}
.audit-badge-toggle{background:#eeedfe;color:#534ab7}
.audit-change{display:flex;gap:6px;align-items:baseline;margin:2px 0}
.audit-change[hidden]{display:none}
.audit-change-field{min-width:74px;color:#5f5e5a}
.audit-change-old{color:#8a8a86;text-decoration:line-through}
.audit-change-arrow{color:#b4b2a9}
.audit-change-new{color:#0f6e56;font-weight:500}
.audit-expand{margin-top:4px;padding:0;border:0;background:none;color:#185fa5;font-size:12px;cursor:pointer}
.audit-pager{display:flex;gap:10px;align-items:center;justify-content:flex-end;margin-top:12px;font-size:13px}
.audit-disabled{opacity:.45;pointer-events:none}
.audit-empty{padding:32px;text-align:center;font-size:13px;color:#8a8a86}
.audit-log-page .audit-filters input[type="date"]{height:34px;padding:0 10px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;font:inherit;font-size:13px;color:#2c2c2a}
.audit-log-page .audit-range-error{margin:0 0 10px;font-size:13px;color:#a32d2d}
