:root {
  color-scheme: light;
  --brand-950: #082f33;
  --brand-900: #0b3b3f;
  --brand-800: #115e59;
  --brand-700: #0f766e;
  --brand-600: #0d9488;
  --brand-100: #ccfbf1;
  --brand-50: #f0fdfa;
  --ink-950: #102a32;
  --ink-800: #253f48;
  --ink-600: #5d747c;
  --ink-500: #789097;
  --line: #dfe8e9;
  --line-soft: #edf2f3;
  --surface: #ffffff;
  --surface-soft: #f7fafb;
  --canvas: #f2f6f6;
  --success: #16865f;
  --success-soft: #e9f8f1;
  --warning: #b7791f;
  --warning-soft: #fff7e6;
  --danger: #c2413b;
  --danger-soft: #fff0ef;
  --blue: #3478f6;
  --shadow-sm: 0 1px 2px rgba(16, 42, 50, .04), 0 5px 18px rgba(16, 42, 50, .035);
  --shadow-md: 0 12px 30px rgba(16, 42, 50, .075);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  background:
    radial-gradient(circle at 92% 0%, rgba(13, 148, 136, .055), transparent 24rem),
    var(--canvas);
  color: var(--ink-950);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid #bcd8d5;
  border-radius: var(--radius-sm);
  background: var(--brand-50);
  color: var(--brand-800);
  font-weight: 650;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

button:hover:not(:disabled) {
  border-color: #87bbb5;
  background: #e3f5f2;
  box-shadow: 0 5px 14px rgba(15, 118, 110, .09);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(52, 120, 246, .2);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cad8da;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink-950);
  transition: border-color .16s ease, box-shadow .16s ease;
}

input,
select {
  height: 40px;
  padding: 0 11px;
}


textarea {
  min-height: 86px;
  padding: 10px 11px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #9eb8bb;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, .1);
  outline: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(24px, 2vw, 32px);
  line-height: 1.2;
  letter-spacing: -.035em;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -.015em;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 18px 18px;
  overflow-y: auto;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 18%),
    var(--brand-950);
  border-right: 1px solid rgba(255, 255, 255, .06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 8px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(153, 246, 228, .28);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(94, 234, 212, .2), rgba(20, 184, 166, .08));
  color: #99f6e4;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .12em;
  box-shadow: inset 0 1px rgba(255, 255, 255, .08);
}

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

.brand span {
  color: rgba(204, 251, 241, .66);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .16em;
}

.brand strong {
  overflow: hidden;
  color: #fff;
  font-size: 17px;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar nav {
  display: grid;
  gap: 3px;
}

.sidebar nav > div {
  display: grid;
  gap: 3px;
}

.sidebar nav p {
  margin: 17px 12px 7px;
  color: rgba(204, 251, 241, .48);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}

.sidebar nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 43px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: rgba(240, 253, 250, .78);
  text-decoration: none;
  transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}

.sidebar nav a::before {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border: 2px solid rgba(153, 246, 228, .48);
  border-radius: 50%;
  content: "";
}

.sidebar nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .055);
  transform: translateX(2px);
}

.sidebar nav a.active {
  border-color: rgba(153, 246, 228, .13);
  background: linear-gradient(90deg, rgba(45, 212, 191, .2), rgba(45, 212, 191, .08));
  color: #fff;
  box-shadow: inset 3px 0 #5eead4;
}

.sidebar nav a.active::before {
  border-color: #99f6e4;
  background: #5eead4;
  box-shadow: 0 0 0 4px rgba(94, 234, 212, .12);
}

.nav-badge {
  min-width: 20px;
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: #ef6b61;
  color: #fff;
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.scope-note {
  margin-top: auto;
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(153, 246, 228, .12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .045);
}

.scope-note span {
  color: rgba(204, 251, 241, .55);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.scope-note strong {
  color: #fff;
  font-size: 14px;
}

.scope-note small {
  color: rgba(240, 253, 250, .6);
  line-height: 1.5;
}

main {
  width: 100%;
  max-width: 1800px;
  min-width: 0;
  margin: 0 auto;
  padding: 28px 32px 48px;
  overflow: clip;
}

.topbar {
  min-height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 18px;
}

.eyebrow,
.section-kicker {
  margin-bottom: 5px;
  color: var(--brand-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}

.page-subtitle {
  margin: 6px 0 0;
  color: var(--ink-600);
  font-size: 13px;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.auth-actions > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-800);
  font-weight: 650;
}

.auth-actions > span::before {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--brand-100), #dbeafe);
  color: var(--brand-800);
  content: "人";
  font-size: 12px;
  font-weight: 800;
}

.notice {
  position: relative;
  margin: 0 0 14px;
  padding: 10px 14px 10px 38px;
  border: 1px solid #d6e4e6;
  border-radius: 10px;
  background: rgba(255, 255, 255, .72);
  color: var(--ink-600);
  font-size: 13px;
}

.notice::before {
  position: absolute;
  top: 50%;
  left: 15px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(52, 120, 246, .1);
  content: "";
  transform: translateY(-50%);
}

.notice[data-tone="success"] {
  border-color: #cceade;
  background: var(--success-soft);
  color: #116044;
}

.notice[data-tone="success"]::before {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(22, 134, 95, .1);
}

.notice[data-tone="warning"] {
  border-color: #f0ddb6;
  background: var(--warning-soft);
  color: #805414;
}

.notice[data-tone="warning"]::before {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(183, 121, 31, .1);
}

.notice[data-tone="error"] {
  border-color: #f1ceca;
  background: var(--danger-soft);
  color: #983932;
}

.notice[data-tone="error"]::before {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(194, 65, 59, .1);
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(6, minmax(118px, 1fr)) 90px;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow-sm);
}

.toolbar-heading {
  grid-column: 1 / -1;
  align-self: center;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.toolbar-heading strong {
  font-size: 14px;
}

.toolbar-heading span {
  color: var(--ink-500);
  font-size: 11px;
}

.toolbar label {
  display: grid;
  gap: 5px;
  color: var(--ink-600);
  font-size: 11px;
  font-weight: 700;
}

.toolbar > button {
  border-color: var(--brand-700);
  background: var(--brand-700);
  color: #fff;
}

.toolbar > button:hover:not(:disabled) {
  border-color: var(--brand-800);
  background: var(--brand-800);
}

.multi-select {
  position: relative;
  width: 100%;
}

.multi-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  justify-content: flex-start;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-color: #b0c8cb;
  background: var(--surface);
  color: var(--ink-950);
  font-weight: 650;
  padding-right: 34px;
  position: relative;
}

.multi-select-trigger-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.multi-select-trigger-count {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand-700);
  color: #fff;
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
}

.multi-select-trigger:hover:not(:disabled) {
  border-color: #8bb0b6;
  background: #e7f4f3;
}

.multi-select-trigger::after {
  content: "";
  position: absolute;
  right: 11px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 1px;
  transform: rotate(45deg);
  transition: transform .14s ease;
}

.multi-select-trigger[aria-expanded="true"]::after {
  transform: translateY(-2px) rotate(-135deg);
}

.multi-select-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 5px);
  z-index: 50;
  width: min(400px, calc(100vw - 32px));
  max-height: min(440px, 72vh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

/* Shop lists are commonly opened from the right side of the toolbar. */
#shopIdOptionsPanel,
#adSpendShopIdOptionsPanel {
  right: 0;
  left: auto;
}

.multi-select-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-700);
}

.multi-select-panel-title {
  font-size: 12px;
  font-weight: 700;
}

.multi-select-summary {
  color: var(--ink-600);
  font-size: 12px;
  white-space: nowrap;
}

.multi-select-search-wrap {
  position: relative;
}

.multi-select-search {
  width: 100%;
  height: 34px;
  padding-inline: 32px 10px;
  font-size: 13px;
  border-color: var(--line-soft);
}

.multi-select-search-wrap::before {
  content: "⌕";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-500);
  font-size: 12px;
  pointer-events: none;
}

.multi-select-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}

.multi-select-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 250px;
  min-height: 76px;
  overflow: auto;
  padding-right: 2px;
}

.multi-select-quick,
.multi-select-done {
  height: 31px;
  min-height: 31px;
  padding: 0 10px;
  border-color: var(--line);
  background: #fff;
  color: var(--ink-800);
}

.multi-select-quick:hover:not(:disabled),
.multi-select-done:hover:not(:disabled) {
  border-color: #9bc1c5;
  background: #eef8f6;
}

.multi-select-quick:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.multi-select-empty {
  padding: 10px;
  color: var(--ink-500);
  font-size: 11px;
}

.multi-select-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.multi-select-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 5px 9px;
  border-radius: 8px;
  color: var(--ink-700);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .13s ease, color .13s ease;
}

/* These rows sit inside toolbar labels. Override the toolbar's field-label
   grid typography so every group/shop option remains a horizontal control. */
.toolbar .multi-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
}

.multi-select-option:hover {
  background: var(--surface-soft);
}

.multi-select-option input[type='checkbox'] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.multi-select-checkmark {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  position: relative;
  border-radius: 5px;
  border: 1px solid #acbec0;
  background: #fff;
  transition: background .16s ease, border-color .16s ease;
}

.multi-select-option.is-checked .multi-select-checkmark {
  background: var(--brand-700);
  border-color: var(--brand-700);
  background-image: linear-gradient(120deg, transparent 35%, transparent 52%, #fff 52%, #fff 80%);
}

.multi-select-option.is-checked .multi-select-checkmark::after {
  content: "✓";
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  position: absolute;
  left: 4px;
  top: 0;
  line-height: 16px;
}

.multi-select-option:focus-within .multi-select-checkmark {
  outline: 3px solid rgba(52, 120, 246, .2);
  outline-offset: 2px;
}

.multi-select-option.is-checked,
.multi-select-option:hover {
  border-color: #c6dde0;
  color: var(--brand-800);
  font-weight: 650;
}

.multi-select-option-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.multi-select-option-subtext {
  color: var(--ink-500);
  font-size: 11px;
}

.multi-select-checkmark + .multi-select-option-text {
  margin-left: -2px;
}

.multi-select-option.is-checked {
  color: var(--brand-700);
  font-weight: 700;
}

.data-freshness {
  grid-column: 1 / -1;
  min-height: 18px;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.6;
}

.data-freshness.is-stale {
  color: var(--warning-700, #a26012);
}

.data-freshness.is-error {
  color: var(--danger-700, #b12f2a);
}

.panel,
.metric-card,
.insight-metrics article,
.page-insight,
.cards article {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel {
  margin-top: 16px;
  padding: 20px;
  border-radius: var(--radius);
}

.panel > header,
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.section-header {
  margin-bottom: 18px;
}

.section-header .section-kicker {
  margin-bottom: 3px;
}

.section-note {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-500);
  font-size: 11px;
}

.overview-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.analysis-panel {
  position: relative;
  overflow: hidden;
}

.analysis-panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #0f766e, #14b8a6 52%, #38bdf8);
  content: "";
}

.analysis-header {
  align-items: center;
}

.analysis-header .muted {
  max-width: 760px;
  margin: 4px 0 0;
}

.analysis-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

#analysisReset {
  min-height: 32px;
  padding: 6px 11px;
  border-color: #cbdedf;
  background: #fff;
  color: var(--brand-800);
  box-shadow: none;
  font-size: 12px;
}

.analysis-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  margin: 12px 0;
}

.analysis-breadcrumb button {
  min-height: 30px;
  padding: 5px 10px;
  border-color: #d7e5e6;
  background: var(--surface-soft);
  color: var(--ink-600);
  box-shadow: none;
  font-size: 12px;
}

.analysis-breadcrumb button:last-of-type {
  border-color: #b9d8d5;
  background: #eaf8f6;
  color: var(--brand-800);
}

.analysis-breadcrumb span {
  color: var(--ink-400);
  font-size: 12px;
}

.analysis-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}

.analysis-table {
  min-width: 1840px;
}

.analysis-table tbody tr.is-drillable {
  cursor: pointer;
}

.analysis-table tbody tr.is-drillable:focus-within,
.analysis-table tbody tr.is-drillable:hover {
  background: #effaf8;
}

.analysis-node-button {
  display: grid;
  gap: 3px;
  min-width: 150px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-900);
  box-shadow: none;
  text-align: left;
}

.analysis-node-button:hover:not(:disabled) {
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.analysis-node-button strong {
  color: var(--brand-800);
  font-size: 13px;
}

.analysis-node-button small {
  color: var(--ink-500);
  font-size: 10px;
}

.analysis-value-note {
  display: block;
  margin-top: 3px;
  color: var(--warning);
  font-size: 10px;
}

.analysis-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.analysis-insights article {
  min-height: 92px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: var(--surface-soft);
}

.analysis-insights span {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 700;
}

.analysis-insights strong {
  display: block;
  color: var(--ink-900);
  font-size: 14px;
  line-height: 1.5;
}

.analysis-insights article.is-warning {
  border-color: #ead9b6;
  background: var(--warning-soft);
}

.analysis-insights article.is-danger {
  border-color: #efd0cd;
  background: var(--danger-soft);
}

.trend-panel {
  position: relative;
  overflow: hidden;
}

.trend-panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-600), #7c3aed 68%, transparent);
  content: "";
}

.trend-header {
  align-items: center;
}

.trend-header .muted {
  margin: 4px 0 0;
  font-size: 12px;
}

.trend-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.trend-switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.trend-switch button {
  min-height: 32px;
  padding-inline: 12px;
  border-color: transparent;
  background: transparent;
  color: var(--ink-600);
  box-shadow: none;
  font-size: 12px;
}

.trend-switch button:hover:not(:disabled) {
  border-color: transparent;
  background: #fff;
  box-shadow: none;
}

.trend-switch button.active {
  border-color: #bddbd7;
  background: #fff;
  color: var(--brand-800);
  box-shadow: 0 2px 7px rgba(16, 42, 50, .08);
}

.trend-chart {
  position: relative;
  width: 100%;
  min-height: 300px;
}

.trend-chart svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 280px;
  overflow: visible;
}

.trend-grid-line {
  stroke: #e8efef;
  stroke-width: 1;
}

.trend-axis-label {
  fill: var(--ink-500);
  font-size: 11px;
  font-family: inherit;
}

.trend-area {
  fill: rgba(13, 148, 136, .1);
}

.trend-line {
  stroke-width: 2.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.trend-point {
  stroke: #fff;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.trend-hover-guide {
  stroke: #66868a;
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: 0;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.trend-hover-guide.visible {
  opacity: .72;
}

.trend-hover-target {
  fill: transparent;
  cursor: crosshair;
}

.trend-hover-target:focus {
  outline: none;
}

.trend-tooltip {
  position: absolute;
  z-index: 4;
  width: min(250px, calc(100% - 16px));
  padding: 12px 14px;
  border: 1px solid rgba(118, 149, 151, .28);
  border-radius: 12px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 12px 32px rgba(22, 52, 57, .18);
  color: var(--ink-800);
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.trend-tooltip-date {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-950);
  font-size: 13px;
}

.trend-tooltip-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 25px;
  font-size: 12px;
}

.trend-tooltip-row i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.trend-tooltip-row span {
  color: var(--ink-600);
}

.trend-tooltip-row strong {
  color: var(--ink-950);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.trend-tooltip-row strong.missing {
  color: var(--warning);
  font-weight: 600;
}

.trend-tooltip-note {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--warning);
  font-size: 11px;
  line-height: 1.45;
}

.trend-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(247, 250, 251, .4), var(--surface-soft));
  color: var(--ink-500);
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  min-height: 24px;
  padding-left: 76px;
  color: var(--ink-600);
  font-size: 12px;
}

.trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.trend-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.trend-legend .trend-legend-note {
  margin-left: auto;
  color: var(--warning);
}

.metric-card {
  position: relative;
  min-height: 164px;
  padding: 20px;
  overflow: hidden;
  border-radius: var(--radius);
}

.metric-card::after {
  position: absolute;
  right: -26px;
  bottom: -40px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 148, 136, .1), transparent 68%);
  content: "";
}

.metric-head {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.metric-head > span {
  color: var(--ink-600);
  font-size: 13px;
  font-weight: 650;
}

.metric-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: 15px;
  font-style: normal;
  font-weight: 800;
}

.metric-card > strong {
  position: relative;
  z-index: 1;
  display: block;
  margin: 18px 0 8px;
  color: var(--ink-950);
  font-size: clamp(24px, 2vw, 34px);
  line-height: 1.1;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

.metric-card > small {
  position: relative;
  z-index: 1;
  display: block;
  color: var(--ink-500);
  font-size: 11px;
}

.metric-card.is-warning {
  border-color: #ead9b6;
  background: linear-gradient(145deg, #fff, #fffbf1);
}

.metric-card.is-warning .metric-icon {
  background: var(--warning-soft);
  color: var(--warning);
}

.metric-card.is-danger {
  border-color: #efd0cd;
  background: linear-gradient(145deg, #fff, #fff7f6);
}

.metric-card.is-success {
  border-color: #cce8db;
  background: linear-gradient(145deg, #fff, #f3fcf8);
}

.metric-progress {
  position: relative;
  z-index: 1;
  height: 6px;
  margin: 12px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eff0;
}

.metric-progress > span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-700), #2dd4bf);
  transition: width .35s ease;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, .7fr);
  gap: 16px;
  margin-top: 16px;
}

.overview-grid .panel {
  height: 100%;
  margin-top: 0;
}

.performance-panel {
  min-height: 265px;
}

.performance-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--line-soft);
}

.performance-metrics article {
  min-height: 108px;
  padding: 16px;
  background: #fff;
}

.performance-metrics span,
.operation-stats span,
.insight-metrics span,
.cards span {
  display: block;
  color: var(--ink-600);
  font-size: 12px;
}

.performance-metrics strong {
  display: block;
  margin: 9px 0 5px;
  font-size: 24px;
  line-height: 1.15;
}

.performance-metrics small {
  color: var(--ink-500);
  font-size: 10px;
}

.performance-metrics article.is-warning {
  background: var(--warning-soft);
}

.performance-metrics article.is-danger {
  background: var(--danger-soft);
}

.operation-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.operation-stats article {
  padding: 2px 16px;
  border-left: 2px solid #dbe7e8;
}

.operation-stats strong {
  display: block;
  margin-top: 5px;
  font-size: 19px;
}

.readiness-panel {
  min-height: 265px;
}

.readiness-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  align-items: center;
  gap: 11px;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
}

.readiness-item:first-of-type {
  border-top: 0;
}

.readiness-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(183, 121, 31, .1);
}

.readiness-item > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.readiness-item strong {
  color: #8a5c17;
  font-size: 13px;
}

.readiness-item small {
  color: var(--ink-500);
  font-size: 11px;
  text-align: right;
}

.readiness-item.is-ready .readiness-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(22, 134, 95, .1);
}

.readiness-item.is-ready strong {
  color: var(--success);
}

.platform-panel {
  padding: 22px;
}

.manifest-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.manifest-meta > span {
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--ink-500);
  font-size: 10px;
}

.manifest-meta strong {
  color: var(--ink-800);
  font-weight: 700;
}

.platform-content {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
  gap: 30px;
}

.platform-ring {
  --shopee: 41.67%;
  --lazada: 54.86%;
  width: 144px;
  height: 144px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#ef6544 0 var(--shopee), #5b6cf0 var(--shopee) var(--lazada), #18232a var(--lazada) 100%);
  box-shadow: inset 0 0 0 1px rgba(16, 42, 50, .05);
}

.platform-ring::before {
  grid-area: 1 / 1;
  width: 102px;
  height: 102px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(16, 42, 50, .08);
  content: "";
}

.platform-ring > div {
  z-index: 1;
  grid-area: 1 / 1;
  display: grid;
  text-align: center;
}

.platform-ring strong {
  font-size: 26px;
  line-height: 1.15;
}

.platform-ring span {
  color: var(--ink-500);
  font-size: 11px;
}

.platform-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.platform-item {
  min-height: 104px;
  padding: 15px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface-soft);
}

.platform-item > span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-600);
  font-size: 12px;
}

.platform-item i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef6544;
}

.platform-item.lazada i {
  background: #5b6cf0;
}

.platform-item.tiktok i {
  background: #18232a;
}

.platform-item strong {
  display: inline-block;
  margin: 10px 4px 0 0;
  font-size: 24px;
}

.platform-item small {
  color: var(--ink-500);
}

.utility-panel {
  padding: 0;
  overflow: hidden;
}

.utility-panel summary {
  padding: 14px 18px;
  color: var(--ink-600);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.utility-panel summary::-webkit-details-marker {
  display: none;
}

.utility-panel summary::after {
  float: right;
  color: var(--ink-500);
  content: "＋";
}

.utility-panel[open] summary::after {
  content: "－";
}

.utility-panel .list {
  margin: 0;
  padding: 0 18px 18px;
}

.page-insight {
  min-height: 128px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  margin-bottom: 16px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background:
    linear-gradient(125deg, rgba(240, 253, 250, .96), rgba(255, 255, 255, .98)),
    #fff;
}

.page-insight h2 {
  margin-bottom: 6px;
  font-size: 21px;
}

.page-insight p:last-child {
  max-width: 680px;
  margin: 0;
  color: var(--ink-600);
  font-size: 13px;
}

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

.page-insight .insight-metrics {
  min-width: min(100%, 560px);
}

.insight-metrics article {
  min-height: 82px;
  padding: 14px;
  border-radius: 10px;
}

.insight-metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.insight-metrics article.success,
.cards article.success {
  border-color: #cce8db;
  background: var(--success-soft);
}

.insight-metrics article.warning,
.cards article.warning {
  border-color: #ebd9b5;
  background: var(--warning-soft);
}

.insight-metrics article.danger,
.cards article.danger {
  border-color: #efd0cd;
  background: var(--danger-soft);
}

.spu-summary {
  margin-top: 14px;
}

.direction-banner {
  display: grid;
  gap: 5px;
  margin-top: 0;
  padding: 14px 16px;
  border: 1px solid #efd7a3;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #fff9eb, #fffdf8);
  color: #78511a;
}

.cost-scope-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid #bfe2dd;
  border-radius: var(--radius);
  background: linear-gradient(100deg, #edf9f7, #f8fcff);
}

.cost-scope-banner strong,
.cost-scope-banner span {
  display: block;
}

.cost-scope-banner div > span {
  margin-top: 4px;
  color: var(--ink-600);
  font-size: 12px;
}

.cost-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.cost-kpis article {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.cost-kpis span,
.cost-kpis strong,
.cost-kpis small {
  display: block;
}

.cost-kpis span,
.cost-kpis small {
  color: var(--ink-500);
  font-size: 12px;
}

.cost-kpis strong {
  margin: 6px 0 4px;
  font-size: 28px;
}

.cost-actions {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.cost-actions label {
  min-width: 150px;
  color: var(--ink-600);
  font-size: 11px;
}

.cost-tabs {
  margin: 14px 0 10px;
}

#standardCostBulkDialog textarea {
  width: min(820px, 82vw);
  min-height: 260px;
  margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.status-strip article {
  position: relative;
  min-width: 0;
  padding: 14px 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, var(--surface), #f5fbfa);
  box-shadow: var(--shadow-sm);
}

.status-strip article::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--brand-500);
  content: "";
}

.status-strip span,
.status-strip strong {
  display: block;
}

.access-admin-hero {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  min-height: 150px;
  margin-bottom: 14px;
  padding: 28px 30px;
  overflow: hidden;
  border: 1px solid #bfe2dd;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 88% 18%, rgba(52, 120, 246, .14), transparent 15rem),
    linear-gradient(125deg, #effcf9, #f7fbff 58%, #ffffff);
  box-shadow: var(--shadow-sm);
}

.access-admin-hero::after {
  position: absolute;
  right: 38px;
  bottom: -68px;
  width: 190px;
  height: 190px;
  border: 22px solid rgba(13, 148, 136, .07);
  border-radius: 50%;
  content: "";
}

.access-admin-hero > * {
  position: relative;
  z-index: 1;
}

.access-admin-hero h2 {
  margin: 2px 0 7px;
  font-size: clamp(22px, 2.2vw, 31px);
  letter-spacing: -.02em;
}

.access-admin-hero p:last-child {
  max-width: 760px;
  margin: 0;
  color: var(--ink-600);
}

.access-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.access-kpis article {
  position: relative;
  padding: 18px 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.access-kpis article::after {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: #b8c8cd;
  content: "";
}

.access-kpis .access-ready::after {
  background: var(--success);
}

.access-kpis .access-warning::after {
  background: var(--warning);
}

.access-kpis span,
.access-kpis strong {
  display: block;
}

.access-kpis span {
  color: var(--ink-500);
  font-size: 12px;
}

.access-kpis strong {
  margin-top: 5px;
  color: var(--ink-950);
  font-size: 28px;
  line-height: 1.15;
}

.access-search {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.access-search label {
  min-width: 170px;
  color: var(--ink-600);
  font-size: 11px;
}

.access-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 8px;
}

.access-guide span {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-600);
  font-size: 11px;
}

.access-table {
  min-width: 1050px !important;
}

.shop-management-table {
  min-width: 1380px !important;
}

.shop-management-filters {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.shop-management-filters label:first-child {
  min-width: 220px;
}

.evaluation-marker-panel {
  margin-top: 16px;
}

.evaluation-marker-layout {
  display: grid;
  grid-template-columns: minmax(320px, .78fr) minmax(440px, 1.22fr);
  gap: 18px;
  margin-top: 16px;
}

.evaluation-marker-form,
.evaluation-marker-history {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.evaluation-marker-form {
  display: grid;
  align-content: start;
  gap: 12px;
}

.evaluation-marker-form label {
  display: grid;
  gap: 6px;
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 650;
}

.evaluation-marker-form textarea {
  min-height: 180px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  line-height: 1.55;
}

.evaluation-marker-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.evaluation-marker-history-head h3 {
  margin: 0;
  font-size: 15px;
}

.evaluation-marker-batches {
  display: grid;
  gap: 9px;
  max-height: 520px;
  overflow: auto;
}

.evaluation-marker-batch {
  overflow: hidden;
  border: 1px solid #d5e2e3;
  border-radius: 9px;
  background: #fff;
}

.evaluation-marker-batch > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
}

.evaluation-marker-batch > summary::-webkit-details-marker {
  display: none;
}

.evaluation-marker-batch-title strong,
.evaluation-marker-batch-title small {
  display: block;
}

.evaluation-marker-batch-title small {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 10px;
}

.evaluation-marker-result-list {
  margin: 0;
  padding: 0 12px 10px;
  border-top: 1px solid var(--line-soft);
  list-style: none;
}

.evaluation-marker-result-list li {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) auto minmax(180px, 1.2fr);
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 11px;
}

.evaluation-marker-result-list li:last-child {
  border-bottom: 0;
}

.evaluation-marker-order-number {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  color: var(--ink-900);
}

@media (max-width: 980px) {
  .evaluation-marker-layout {
    grid-template-columns: 1fr;
  }

  .evaluation-marker-result-list li {
    grid-template-columns: 1fr auto;
  }

  .evaluation-marker-result-list li span:last-child {
    grid-column: 1 / -1;
  }
}

.access-user-cell strong,
.access-user-cell small,
.access-grants-cell,
.access-table td:nth-child(4) small {
  display: block;
}

.access-user-cell small,
.access-table td:nth-child(4) small {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 10px;
}

.access-grants-cell {
  min-width: 285px;
}

.access-grant-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 420px;
  margin: 4px 0;
  padding: 7px 8px 7px 10px;
  border: 1px solid #d6e6e6;
  border-radius: 9px;
  background: #f7fbfb;
  font-size: 11px;
}

.access-chip-action {
  min-height: 24px;
  padding: 0 7px;
  border-color: #efcbc7;
  background: #fff7f6;
  color: var(--danger);
  font-size: 10px;
}

.empty-table-cell {
  padding: 36px 14px;
  color: var(--ink-500);
  text-align: center;
}

.access-date-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.access-date-range label {
  display: grid;
  gap: 5px;
}

.access-group-field {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid #cad8da;
  border-radius: var(--radius-sm);
}

.access-group-field legend {
  padding: 0 5px;
  color: var(--ink-600);
  font-size: 12px;
  font-weight: 650;
}

.access-group-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 255px;
  overflow: auto;
}

.access-group-option {
  display: grid !important;
  grid-template-columns: 17px minmax(0, 1fr);
  align-items: center;
  gap: 8px !important;
  padding: 8px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--ink-800) !important;
  cursor: pointer;
  font-weight: 500 !important;
}

.access-group-option:has(input:checked) {
  border-color: #8acbc4;
  background: var(--brand-50);
  color: var(--brand-800) !important;
}

.access-group-option input {
  width: 17px;
  height: 17px;
}

.status-strip span {
  margin-bottom: 7px;
  color: var(--ink-500);
  font-size: 12px;
}

.status-strip strong {
  color: var(--ink-900);
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.direction-banner strong {
  font-size: 13px;
}

.direction-banner span {
  font-size: 12px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}

.compact-cards {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 16px;
}

.cards article {
  min-height: 96px;
  padding: 16px;
  border-radius: 10px;
}

.cards strong {
  display: block;
  margin-top: 9px;
  font-size: 23px;
  line-height: 1.18;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}

.ad-insight {
  min-height: 118px;
}

.deadline-chip {
  min-width: 190px;
  display: grid;
  gap: 3px;
  padding: 14px 16px;
  border: 1px solid #cce8db;
  border-radius: 11px;
  background: var(--success-soft);
}

.deadline-chip span,
.deadline-chip small {
  color: var(--ink-500);
  font-size: 10px;
}

.deadline-chip strong {
  color: #116044;
  font-size: 16px;
}

.ad-toolbar {
  grid-template-columns: minmax(132px, .7fr) repeat(3, minmax(170px, 1fr)) 92px;
}

.ad-metrics {
  grid-template-columns: 1.45fr repeat(5, minmax(0, 1fr));
}

.ad-metrics .completion-card {
  border-color: #bfe1dc;
  background: linear-gradient(145deg, #f0fdfa, #fff);
}

.ad-metrics .metric-action {
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.ad-metrics .metric-action:hover,
.ad-metrics .metric-action:focus-visible {
  transform: translateY(-1px);
  border-color: #d59b91;
  box-shadow: 0 8px 22px rgba(194, 65, 59, .12);
}

.ad-metrics .metric-action small {
  display: block;
  margin-top: 7px;
  color: var(--ink-500);
  font-size: 10px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 16px;
  padding: 4px;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.tabs button {
  min-height: 34px;
  border-color: transparent;
  background: transparent;
  color: var(--ink-600);
  box-shadow: none;
}

.tabs button:hover:not(:disabled) {
  border-color: transparent;
  background: var(--surface-soft);
  box-shadow: none;
}

.tabs button.active {
  border-color: var(--brand-700);
  background: var(--brand-700);
  color: #fff;
}

.quality-score {
  min-width: 240px;
  padding: 14px 16px;
  border: 1px solid #cce8db;
  border-radius: 11px;
  background: #fff;
}

.quality-score > span {
  color: var(--ink-500);
  font-size: 11px;
}

.quality-score > strong {
  display: block;
  margin: 4px 0;
  font-size: 25px;
}

.quality-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.coverage {
  margin: 14px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px;
}

.coverage div,
.list div {
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--ink-600);
  font-size: 12px;
}

.list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.table-scroll {
  width: 100%;
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-scroll table {
  min-width: 980px;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7fafb;
  color: var(--ink-600);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

tbody tr {
  transition: background .14s ease;
}

tbody tr:hover {
  background: #f8fbfb;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td {
  color: var(--ink-800);
}

.progress-cell {
  min-width: 150px;
}

.table-progress {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.table-progress > i {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eff0;
}

.table-progress > i::before {
  width: var(--progress, 0%);
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--brand-600);
  content: "";
}

.table-progress.warning > i::before {
  background: var(--warning);
}

.table-progress.error > i::before {
  background: var(--danger);
}

.table-progress span {
  min-width: 42px;
  color: var(--ink-600);
  font-size: 11px;
  text-align: right;
}

.muted {
  color: var(--ink-500);
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #edf2f6;
  color: #506675;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-pill.success {
  background: var(--success-soft);
  color: #15704f;
}

.status-pill.warning {
  background: var(--warning-soft);
  color: #966318;
}

.status-pill.error {
  background: var(--danger-soft);
  color: #a63b35;
}

.type-pill {
  display: inline-flex;
  padding: 4px 8px;
  border: 1px solid #d6e4e6;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--ink-600);
  font-size: 11px;
  font-weight: 650;
}

.negative {
  color: var(--danger);
  font-weight: 750;
}

.positive {
  color: var(--success);
  font-weight: 750;
}

.row-actions {
  min-width: 130px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--ink-500);
}

.row-actions button {
  min-height: 29px;
  padding: 0 9px;
  font-size: 11px;
}

.panel-actions {
  align-items: flex-end !important;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.filter-row label {
  display: grid;
  gap: 4px;
  color: var(--ink-600);
  font-size: 11px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 12px;
}

form {
  display: grid;
  gap: 10px;
}

dialog {
  width: min(600px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(8, 47, 51, .25);
}

dialog::backdrop {
  background: rgba(9, 31, 35, .55);
  backdrop-filter: blur(3px);
}

dialog form {
  padding: 24px;
}

dialog.wide-dialog {
  width: min(1180px, calc(100vw - 32px));
}

.bulk-ad-table-scroll {
  max-height: min(58vh, 560px);
}

.bulk-ad-table {
  min-width: 1040px !important;
}

.bulk-ad-table td:first-child {
  min-width: 150px;
}

.bulk-ad-table input[type="number"] {
  width: 105px;
}

.bulk-ad-table input[type="text"] {
  width: 190px;
}

.bulk-ad-table .bulk-ad-net {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bulk-ad-table .bulk-zero-cell {
  text-align: center;
}

.bulk-ad-table .bulk-zero-cell input {
  width: 18px;
  height: 18px;
}

dialog header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 5px;
}

dialog label {
  display: grid;
  gap: 5px;
  color: var(--ink-600);
  font-size: 12px;
  font-weight: 650;
}

.quiet {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.dialog-actions button {
  min-width: 120px;
}

.dialog-actions button:last-child {
  border-color: var(--brand-700);
  background: var(--brand-700);
  color: #fff;
}

.dialog-error {
  margin: 4px 0 0;
  padding: 10px 12px;
  border: 1px solid #f1c5bd;
  border-radius: 8px;
  background: #fff2ef;
  color: #a83b2c;
  font-size: 12px;
  line-height: 1.5;
}

.dialog-error[hidden] {
  display: none;
}

.rate-input {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.field-help {
  margin: -3px 0 3px;
  color: var(--ink-500);
  font-size: 11px;
}

.calculated-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 13px;
  border: 1px solid #b8ddd8;
  border-radius: 10px;
  background: var(--brand-50);
}

.calculated-field strong {
  color: var(--brand-700);
  font-size: 21px;
}

.calculated-field small {
  grid-column: 1 / -1;
  color: var(--ink-500);
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.timeline {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.timeline article {
  display: grid;
  gap: 4px;
  padding: 11px 13px;
  border-left: 3px solid var(--brand-600);
  border-radius: 0 8px 8px 0;
  background: var(--surface-soft);
}

.timeline span {
  color: var(--ink-500);
  font-size: 11px;
}

.no-access {
  max-width: 720px;
}

.no-access p {
  margin: 8px 0;
  color: var(--ink-600);
}

.coverage-banner {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid #b8ddd8;
  border-radius: 10px;
  background: var(--brand-50);
  color: #174d47;
}

.odc-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px;
}

.odc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
}

.odc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.odc-toolbar label {
  display: grid;
  gap: 5px;
  font-size: 12px;
}

@media (max-width: 1480px) {
  main {
    padding-inline: 24px;
  }

  .toolbar {
    grid-template-columns: repeat(6, minmax(110px, 1fr)) 80px;
    gap: 9px;
  }

  .ad-toolbar {
    grid-template-columns: minmax(120px, .7fr) repeat(3, minmax(140px, 1fr)) 80px;
  }

  .metric-card {
    min-height: 156px;
  }

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

@media (max-width: 1180px) {
  body {
    grid-template-columns: 216px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 14px;
  }

  .overview-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .trend-legend {
    padding-left: 0;
  }

  .page-insight {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-insight .insight-metrics {
    width: 100%;
    min-width: 0;
  }

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

  .toolbar-heading {
    grid-column: 1 / -1;
  }

  .toolbar > button {
    min-width: 90px;
  }
}

@media (max-width: 860px) {
  body {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 15px;
  }

  .brand {
    padding-bottom: 0;
  }

  .sidebar nav {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .sidebar nav > div {
    display: flex;
  }

  .sidebar nav p,
  .scope-note {
    display: none;
  }

  .sidebar nav a {
    min-width: max-content;
  }

  main {
    padding: 22px 16px 40px;
  }

  .topbar {
    align-items: flex-start;
  }

  .platform-content {
    grid-template-columns: 1fr;
  }

  .platform-ring {
    margin: 0 auto;
  }

  .multi-select-panel {
    width: min(340px, calc(100vw - 46px));
    max-height: min(420px, 68vh);
  }

  .multi-select-list {
    max-height: 255px;
  }

  .manifest-meta {
    justify-content: flex-start;
  }

  .insight-metrics,
  .analysis-insights,
  .platform-legend,
  .performance-metrics,
  .operation-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ad-metrics,
  .quality-metrics,
  .compact-cards,
  .status-strip,
  .access-kpis,
  .cost-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .access-admin-hero,
  .access-search {
    align-items: stretch;
    flex-direction: column;
  }

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

@media (max-width: 600px) {
  .topbar {
    flex-direction: column;
  }

  .auth-actions {
    width: 100%;
    justify-content: space-between;
  }

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

  .overview-kpis,
  .insight-metrics,
  .analysis-insights,
  .platform-legend,
  .performance-metrics,
  .operation-stats,
  .ad-metrics,
  .quality-metrics,
  .compact-cards,
  .status-strip,
  .access-kpis,
  .cost-kpis {
    grid-template-columns: 1fr;
  }

  .access-admin-hero {
    align-items: flex-start;
    padding: 22px;
  }

  .access-date-range {
    grid-template-columns: 1fr;
  }

  .access-group-options {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 144px;
  }

  .panel {
    padding: 16px;
  }

  .panel > header,
  .section-header {
    flex-direction: column;
  }

  .trend-controls {
    width: 100%;
    justify-content: space-between;
  }

  .trend-chart {
    min-height: 250px;
  }

  .trend-chart svg {
    min-height: 230px;
  }

  .trend-legend .trend-legend-note {
    width: 100%;
    margin-left: 0;
  }

  .manifest-meta {
    justify-content: flex-start;
  }

  .page-insight {
    padding: 18px;
  }

  .deadline-chip,
  .quality-score {
    width: 100%;
  }

  .tabs {
    width: 100%;
  }

  .tabs button {
    flex: 1 1 calc(50% - 6px);
  }

  .odc-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .odc-shell {
    padding: 16px;
  }
}

/* Decision cockpit: derived metrics, diagnosis, actions and what-if analysis. */
.cockpit-command {
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(228, 249, 244, .95), rgba(255, 252, 244, .96));
  border-color: rgba(48, 128, 117, .22);
}

.cockpit-health {
  display: grid;
  min-width: 150px;
  padding: 14px 18px;
  border: 1px solid rgba(48, 128, 117, .2);
  border-radius: 18px;
  background: rgba(255, 255, 255, .78);
}

.cockpit-health strong { font-size: 2rem; color: var(--ink); }
.cockpit-health small,
.cockpit-health span { color: var(--muted); }

.cockpit-brief-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.cockpit-brief-grid article {
  display: grid;
  gap: 7px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .72);
}

.cockpit-brief-grid article > span,
.cockpit-brief-grid small { color: var(--muted); }
.cockpit-brief-grid strong { font-size: 1.15rem; }

.cockpit-data-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--warning);
  border-radius: 8px;
  background: rgba(255, 247, 226, .78);
}

.cockpit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 24px;
  margin-bottom: 24px;
}

.waterfall {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.waterfall-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(140px, 2fr) minmax(100px, auto);
  gap: 12px;
  align-items: center;
}

.waterfall-track {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf3f3;
}

.waterfall-bar { display: block; height: 100%; border-radius: inherit; }
.waterfall-bar.positive { background: linear-gradient(90deg, #2f7f74, #75d5c5); }
.waterfall-bar.negative { background: linear-gradient(90deg, #d96d62, #efad82); }

.ranking-columns {
  display: grid;
  gap: 14px;
}

.ranking-block {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbfb;
}

.ranking-block h3 { margin: 0 0 10px; font-size: .95rem; }
.ranking-block ol { margin: 0; padding-left: 22px; }
.ranking-block li { margin: 7px 0; color: var(--muted); }
.ranking-block li strong { color: var(--ink); }

.cockpit-actions,
.cockpit-scenario { margin-bottom: 24px; }
.action-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.action-filters button.active { background: var(--accent); color: #fff; }
.severity-chip { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-weight: 700; font-size: .78rem; }
.severity-chip.CRITICAL { color: #9b2e25; background: #fde4df; }
.severity-chip.HIGH { color: #a95817; background: #fff0d2; }
.severity-chip.MEDIUM { color: #79611a; background: #fff8d8; }
.severity-chip.LOW { color: #2f7067; background: #e6f5f1; }
.action-title { display: grid; gap: 3px; min-width: 250px; }
.action-title small { color: var(--muted); max-width: 520px; }
.action-table select { min-width: 108px; }
.action-table button { white-space: nowrap; }

.scenario-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin: 18px 0;
}

.scenario-controls label { display: grid; gap: 8px; color: var(--muted); }
.scenario-controls output { color: var(--ink); font-weight: 700; }
.scenario-controls input[type="range"] { width: 100%; accent-color: var(--accent); }
.cockpit-scenario header > div:last-child { display: grid; text-align: right; }
.cockpit-scenario header > div:last-child strong { font-size: 1.8rem; }

@media (max-width: 1100px) {
  .cockpit-brief-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cockpit-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .cockpit-brief-grid,
  .scenario-controls { grid-template-columns: 1fr; }
  .waterfall-row { grid-template-columns: 1fr; }
  .cockpit-scenario header > div:last-child { text-align: left; }
}

.after-sales-view {
  display: grid;
  gap: 20px;
}

.after-sales-view[hidden],
.after-sales-tab-panel[hidden] { display: none !important; }

.after-sales-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 26px;
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, .2), transparent 28%),
    linear-gradient(135deg, #174f49 0%, #2f7f74 60%, #58a797 100%);
  box-shadow: 0 18px 42px rgba(26, 81, 74, .2);
}

.after-sales-hero h1 { margin: 4px 0 8px; }
.after-sales-hero p { margin: 0; max-width: 720px; color: rgba(255, 255, 255, .82); }
.after-sales-hero .eyebrow { color: rgba(255, 255, 255, .68); }
.after-sales-hero button { flex: 0 0 auto; background: #fff; color: #18584f; }

.after-sales-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .86);
}

.after-sales-tabs button {
  border-color: transparent;
  background: transparent;
}

.after-sales-tabs button.active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 7px 18px rgba(47, 127, 116, .18);
}

.after-sales-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.after-sales-metric {
  min-height: 104px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.after-sales-metric span { display: block; margin-bottom: 10px; color: var(--muted); }
.after-sales-metric strong { font-size: 1.65rem; }

.after-sales-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.after-sales-project-list,
.after-sales-mine-list,
.after-sales-config-list { display: grid; gap: 12px; }

.after-sales-project-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.after-sales-project-card h3 { margin: 0 0 5px; font-size: 1rem; }
.after-sales-project-card p { margin: 0; color: var(--muted); }
.after-sales-project-card .card-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.after-sales-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(235px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.after-sales-board-column {
  min-height: 260px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f6f9f9;
}

.after-sales-board-column > header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 700;
}

.after-sales-board-card {
  width: 100%;
  margin-bottom: 9px;
  padding: 12px;
  text-align: left;
  border: 1px solid #dce8e6;
  border-radius: 12px;
  background: #fff;
}

.after-sales-board-card strong,
.after-sales-board-card small { display: block; }
.after-sales-board-card small { margin-top: 5px; color: var(--muted); }

.after-sales-dialog {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(15, 42, 39, .28);
}

.after-sales-dialog::backdrop { background: rgba(15, 33, 31, .58); }
.after-sales-dialog form,
.after-sales-dialog-body { padding: 24px; }
.after-sales-dialog header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.after-sales-dialog header h2 { margin: 0; }

.after-sales-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.after-sales-form-grid label { display: grid; gap: 7px; }
.after-sales-form-grid .full { grid-column: 1 / -1; }
.after-sales-form-grid textarea { min-height: 96px; resize: vertical; }

.after-sales-order-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.after-sales-order-results {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.after-sales-order-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafcfc;
}

.after-sales-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(270px, .55fr);
  gap: 18px;
  margin-top: 18px;
}

.after-sales-detail-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.after-sales-detail-panel h3 { margin-top: 0; }
.after-sales-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.after-sales-inline-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.after-sales-inline-form > * { flex: 1 1 150px; }
.after-sales-inline-form button { flex: 0 0 auto; }

.inventory-aging-view { display: grid; gap: 14px; }
.inventory-aging-status { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 10px 14px; border: 1px solid #cce8db; border-radius: 12px; background: #f2fbf6; color: #23795c; }
.inventory-aging-status strong { color: var(--text); font-size: 15px; }
.inventory-aging-status span { color: inherit; font-size: 12px; line-height: 1.45; }
.inventory-aging-status span::before { content: "•"; margin-right: 7px; font-size: 18px; vertical-align: -1px; }
.inventory-aging-status[data-tone="warning"] { border-color: #ead39b; background: #fffaf0; color: #8a621e; }
.inventory-aging-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.inventory-aging-tabs button { border: 1px solid transparent; background: transparent; color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 800; }
.inventory-aging-tabs button.active { color: var(--primary); background: #eef9f5; border-color: #bfe3d3; }
.inventory-aging-forecast { display: grid; gap: 14px; }
.inventory-forecast-primary, .inventory-forecast-filters .filter-row { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.inventory-forecast-filters label { display: grid; gap: 5px; color: var(--muted); font-weight: 700; }
.inventory-forecast-primary label { min-width: 142px; }
.inventory-forecast-primary label:nth-child(4) { min-width: min(280px, 100%); flex: 1 1 210px; }
.inventory-forecast-primary button { min-width: 78px; }
.inventory-forecast-advanced { margin-top: 10px; border-top: 1px solid var(--line); }
.inventory-forecast-advanced summary { padding: 9px 0 4px; color: var(--primary); cursor: pointer; font-size: 12px; font-weight: 800; }
.inventory-forecast-advanced .filter-row { padding-top: 8px; }
.inventory-forecast-advanced label { min-width: 130px; }
.inventory-forecast-filters > .muted { margin: 8px 0 0; }
.inventory-forecast-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.inventory-forecast-metrics article { min-height: 98px; padding: 14px; }
.inventory-forecast-metrics small { display: block; margin-top: 6px; color: var(--muted); }
.inventory-forecast-curve { min-height: 210px; padding: 8px; border-radius: 10px; background: linear-gradient(180deg, #f6fbf9, #fff); overflow-x: auto; }
.inventory-forecast-svg { display: block; min-width: 620px; width: 100%; height: 210px; }
.inventory-forecast-area { fill: rgba(229, 136, 66, .14); }
.inventory-forecast-line { fill: none; stroke: #d9544d; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.inventory-forecast-dot { fill: #d9544d; stroke: #fff; stroke-width: 2; }.inventory-forecast-dot.partial { fill: #e58842; stroke-dasharray: 2 1; }
.inventory-forecast-axis { fill: var(--muted); font-size: 11px; }.inventory-forecast-missing { fill: #a7771a; font-size: 10px; }
.inventory-forecast-risk { font-weight: 800; }
.inventory-forecast-risk.red { color: #c53d36; }.inventory-forecast-risk.orange { color: #cc741d; }.inventory-forecast-risk.yellow { color: #977008; }.inventory-forecast-risk.green { color: #25815e; }.inventory-forecast-risk.gray { color: var(--muted); }
.inventory-aging-filters header { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
.inventory-aging-filters .filter-row { display: grid; grid-template-columns: repeat(6, minmax(135px, 1fr)); gap: 12px; align-items: end; }
.inventory-aging-filters label { display: grid; gap: 6px; color: var(--muted); font-weight: 700; }
.inventory-aging-filters label:last-of-type { grid-column: span 2; }
.inventory-aging-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.inventory-aging-metrics article { min-height: 116px; }
.inventory-aging-metrics small { display: block; margin-top: 10px; color: var(--muted); }
.inventory-aging-unavailable { border-color: #ead39b; background: #fffaf0; }
.inventory-aging-empty { padding: 12px 4px; color: #75571d; line-height: 1.7; }
.inventory-aging-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.inventory-aging-grid.rankings { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.inventory-aging-warning-list, .inventory-aging-distribution, .inventory-aging-rankings { display: grid; gap: 10px; }
.inventory-aging-warning { display: grid; grid-template-columns: 110px minmax(130px, 1fr); gap: 4px 12px; padding: 13px; border-left: 4px solid #d7a221; border-radius: 10px; background: #fffbef; }
.inventory-aging-warning.orange { border-left-color: #e18729; background: #fff6ec; }
.inventory-aging-warning.red { border-left-color: #d9584a; background: #fff1ef; }
.inventory-aging-warning-title { font-weight: 800; }
.inventory-aging-warning-value { font-weight: 800; text-align: right; }
.inventory-aging-warning .muted { grid-column: 1 / -1; }
.inventory-aging-distribution-row { display: grid; grid-template-columns: 82px minmax(100px, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; }
.inventory-aging-bar { height: 9px; overflow: hidden; border-radius: 999px; background: #e9efee; }
.inventory-aging-bar i { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, #dfbc42, #d75d4c); }
.inventory-aging-ranking-row { padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.inventory-aging-row { cursor: pointer; }
.inventory-aging-row:hover td { background: #f1faf7; }

@media (max-width: 1240px) {
  .inventory-aging-filters .filter-row { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .inventory-aging-filters label:last-of-type { grid-column: auto; }
  .inventory-aging-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inventory-forecast-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .after-sales-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .after-sales-overview-grid,
  .after-sales-detail-grid { grid-template-columns: 1fr; }
  .inventory-aging-grid, .inventory-aging-grid.rankings { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .after-sales-hero { display: grid; padding: 20px; }
  .after-sales-metrics,
  .after-sales-form-grid { grid-template-columns: 1fr; }
  .after-sales-form-grid .full { grid-column: auto; }
  .after-sales-order-search { grid-template-columns: 1fr; }
  .after-sales-project-card { grid-template-columns: 1fr; }
  .inventory-aging-filters .filter-row, .inventory-aging-metrics { grid-template-columns: 1fr; }
  .inventory-forecast-metrics { grid-template-columns: 1fr; }
  .inventory-aging-status { display: grid; gap: 2px; }
  .inventory-forecast-primary label, .inventory-forecast-primary label:nth-child(4), .inventory-forecast-primary button, .inventory-forecast-advanced label { width: 100%; min-width: 0; }
}
