:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --ink: #172033;
  --muted: #61708a;
  --panel: #ffffff;
  --line: #d6e1ef;
  --accent: #1565c0;
  --accent-2: #f59e0b;
  --accent-3: #16a34a;
  --accent-4: #0f766e;
  --accent-5: #7c3aed;
  --accent-6: #ef4444;
  --cyan: #0891b2;
  --rose: #e11d48;
  --ink-soft: #24324a;
  --risk: #c62828;
  --ok: #2e7d32;
  --soft: #eef3f9;
  --shadow: 0 12px 28px rgba(18, 38, 63, 0.055);
  --shadow-soft: 0 8px 18px rgba(18, 38, 63, 0.04);
  --shadow-lift: 0 18px 36px rgba(18, 38, 63, 0.09);
}

* {
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(135deg, rgba(21, 101, 192, 0.08), transparent 32%),
    linear-gradient(315deg, rgba(245, 158, 11, 0.08), transparent 30%),
    linear-gradient(90deg, rgba(21, 101, 192, 0.08) 0 1px, transparent 1px),
    linear-gradient(180deg, #edf4fb 0, #f8fbff 280px, var(--bg) 100%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%;
  color: var(--ink);
}

body[dir="rtl"] {
  font-family: Arial, "Segoe UI", sans-serif;
}

.auth-locked {
  min-height: 100vh;
}

.auth-locked > .topbar,
.auth-locked > main {
  visibility: hidden;
}

.access-remembered body.auth-locked > .topbar,
.access-remembered body.auth-locked > main {
  visibility: visible;
}

.access-remembered .access-gate {
  display: none;
}

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(13, 22, 38, 0.94), rgba(18, 55, 94, 0.90)),
    linear-gradient(315deg, rgba(245, 158, 11, 0.22), transparent 42%);
}

.access-gate[hidden] {
  display: none;
}

.access-card {
  width: min(440px, 100%);
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98));
  box-shadow: 0 28px 70px rgba(5, 14, 30, 0.38);
}

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

.access-kicker {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eaf3ff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.access-language-switch {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  min-height: 38px;
  padding: 4px;
  border: 1px solid #cbd9ea;
  border-radius: 9px;
  background: #ffffff;
  color: var(--muted);
}

.access-language-switch span {
  display: inline-grid;
  place-items: center;
  min-width: 58px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.access-language-switch span.active {
  background: #14365f;
  color: #ffffff;
  box-shadow: 0 5px 12px rgba(20, 54, 95, 0.16);
}

.access-card h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

.access-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.access-field {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--ink);
  font-weight: 800;
}

.access-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd9ea;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.access-field input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(21, 101, 192, 0.16);
}

.access-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.access-remember input {
  width: 18px;
  height: 18px;
}

.access-error {
  margin: 0 0 12px;
  color: var(--risk);
  font-weight: 800;
}

.access-submit {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #14365f, var(--accent));
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(21, 101, 192, 0.22);
}

.access-submit:hover,
.access-submit:focus-visible {
  background: linear-gradient(135deg, #0d2a50, #1f73d4);
  outline: none;
}

body[dir="rtl"] .access-card {
  text-align: right;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 20px 24px 24px;
  background:
    linear-gradient(135deg, rgba(15, 31, 54, 0.98) 0%, rgba(18, 55, 94, 0.98) 58%, rgba(15, 95, 101, 0.98) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(10, 24, 44, 0.16);
}

.topbar h1,
.topbar p {
  color: #ffffff;
}

.topbar .currency-note,
.topbar .currency-note span {
  color: #d8e8ff;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
  max-width: 980px;
}

.topbar-currency {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
}

.topbar-currency .currency-choice {
  min-width: 118px;
  min-height: 40px;
  border-color: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(9, 18, 32, 0.72);
  color: #e9f1ff;
  box-shadow: none;
}

.topbar-currency .currency-choice.active {
  border-color: rgba(255, 255, 255, 0.28);
  background: #3b4864;
  color: #ffffff;
}

.language-switch {
  display: inline-flex;
  gap: 4px;
  min-height: 52px;
  padding: 5px;
  border-color: rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #e9f1ff;
}

.language-switch span {
  display: inline-grid;
  place-items: center;
  min-width: 72px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  color: #cfe0f4;
  font-weight: 900;
}

.language-switch span.active {
  background: #ffffff;
  color: #14365f;
  box-shadow: 0 6px 14px rgba(8, 18, 32, 0.14);
}

h1 {
  margin: 0 0 4px;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: 0;
}

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

.section-heading h2 {
  margin: 0;
}

.section-time,
.table-control-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.section-time {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbff;
  white-space: nowrap;
}

p {
  margin: 0;
  color: var(--muted);
}

.currency-note {
  margin-top: 4px;
  font-size: 13px;
}

button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--accent);
  font-weight: 700;
}

select {
  min-height: 34px;
  border: 1px solid #d4e1f2;
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 8px;
  font-weight: 700;
}

.report-filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.report-toolbar {
  margin-bottom: 16px;
  padding: 10px;
  border: 1px solid #d8e6f6;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(239, 246, 255, 0.95));
  box-shadow: var(--shadow);
}

.report-toolbar .report-filter-bar {
  justify-content: flex-end;
}

.period-data-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #d8e6f6;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(247, 251, 255, 0.97));
  box-shadow: var(--shadow-soft);
}

.period-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.period-panel-head strong,
.period-panel-head span {
  display: block;
}

.period-panel-head strong {
  font-size: 16px;
}

.period-panel-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.period-panel-head p {
  max-width: 620px;
  text-align: right;
  font-size: 13px;
  line-height: 1.5;
}

.period-metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 8px;
}

.period-metric {
  min-height: 66px;
  padding: 10px;
  border: 1px solid #dce7f5;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 4px 12px rgba(18, 38, 63, 0.035);
}

.period-metric span,
.period-metric strong {
  display: block;
}

.period-metric span {
  color: var(--muted);
  font-size: 12px;
}

.period-metric strong {
  margin-top: 7px;
  font-size: 18px;
  line-height: 1.15;
}

.filter-button,
.filter-select {
  min-height: 44px;
  border: 1px solid #2e3b52;
  border-radius: 9px;
  background: #0d1626;
  color: #e9f1ff;
  font-size: 15px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.filter-button {
  min-width: 80px;
  padding: 0 20px;
}

.filter-select {
  min-width: 214px;
  padding: 0 42px 0 18px;
}

.filter-button.active,
.filter-select:focus {
  border-color: #6f7da0;
  background: #39445c;
  color: #ffffff;
}

.filter-button.currency-choice {
  min-width: 128px;
}

.report-context-panel {
  margin-top: 18px;
}

.report-context-panel .time-context {
  margin-top: 12px;
}

.context-conclusion {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.context-conclusion p {
  color: var(--muted);
}

main {
  padding: 18px 24px 36px;
  counter-reset: report-section;
}

.conclusion,
.panel,
.kpi-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.story-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.story-nav a {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "num title"
    "num note";
  gap: 2px 10px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid #cbd9ea;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(246, 250, 255, 0.92));
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.story-nav a:hover,
.story-nav a:focus-visible {
  transform: translateY(-1px);
  border-color: #9fc3ef;
  background: #ffffff;
  box-shadow: var(--shadow-lift);
  outline: none;
}

.story-nav span {
  grid-area: num;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, #14365f, #1f73d4);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.story-nav strong {
  grid-area: title;
  font-size: 15px;
}

.story-nav em {
  grid-area: note;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.conclusion,
.panel {
  box-shadow: var(--shadow);
}

.executive-summary {
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  border-color: #b8cce7;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 251, 255, 0.98) 70%, rgba(255, 250, 241, 0.98) 100%);
}

.executive-summary::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--accent);
}

.summary-kicker {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.summary-lead {
  max-width: 1180px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.55;
}

.summary-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.summary-points span {
  padding: 7px 10px;
  border: 1px solid #d5e2f3;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 5px 12px rgba(18, 38, 63, 0.035);
}

.command-center {
  margin-top: 16px;
  overflow: hidden;
  border-color: #cbd9ea;
  background:
    linear-gradient(90deg, rgba(22, 163, 74, 0.10), transparent 34%),
    linear-gradient(315deg, rgba(21, 101, 192, 0.08), transparent 40%),
    #ffffff;
  color: var(--ink);
}

.command-hero {
  display: grid;
  grid-template-columns: minmax(360px, 1.4fr) minmax(260px, 0.6fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 14px;
}

.command-copy {
  padding: 6px 2px;
}

.command-copy h2 {
  margin: 4px 0 8px;
  color: var(--ink);
  font-size: 26px;
  letter-spacing: 0;
}

.command-copy p {
  max-width: 900px;
  color: var(--muted);
  line-height: 1.55;
}

.command-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.command-tags span {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid #d5e2f3;
  background: linear-gradient(180deg, #f4f8ff 0%, #ffffff 100%);
  color: #24476d;
  font-size: 12px;
  font-weight: 800;
}

.command-total {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 132px;
  padding: 18px;
  border: 1px solid #cfe0f4;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(22, 163, 74, 0.12), transparent 44%),
    linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
  color: var(--ink);
  box-shadow: inset 4px 0 0 var(--accent-3), var(--shadow-soft);
}

.command-total span,
.command-total em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.command-total strong {
  font-size: 36px;
  line-height: 1.1;
}

.command-judgement strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.35;
}

.executive-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.executive-metric {
  position: relative;
  overflow: hidden;
  min-height: 94px;
  padding: 13px;
  border: 1px solid #dce7f5;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98));
  box-shadow: var(--shadow-soft);
}

.executive-metric span,
.executive-metric em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.executive-metric strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 20px;
  line-height: 1.15;
}

.executive-metric.blue {
  border-top: 4px solid var(--accent);
}

.executive-metric.amber {
  border-top: 4px solid var(--accent-2);
}

.executive-metric.green {
  border-top: 4px solid var(--accent-3);
}

.executive-metric.slate {
  border-top: 4px solid #475569;
}

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

.command-card {
  min-height: 240px;
  padding: 14px;
  border: 1px solid #d9e6f5;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.98) 100%);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.command-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.mix-row {
  padding: 10px 0;
  border-bottom: 1px solid #e8eef8;
}

.mix-row:last-child {
  border-bottom: 0;
}

.mix-row-head,
.mix-meta,
.flow-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mix-row-head span,
.flow-step-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.mix-row-head strong,
.flow-step-head strong {
  white-space: nowrap;
}

.mix-track,
.flow-track {
  height: 10px;
  margin: 8px 0 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #eaf0f7;
}

.mix-fill,
.flow-fill {
  height: 100%;
  border-radius: inherit;
}

.tone-0 {
  background: linear-gradient(90deg, var(--accent), #4f9cf9);
}

.tone-1 {
  background: linear-gradient(90deg, var(--accent-2), #fbbf24);
}

.tone-2 {
  background: linear-gradient(90deg, var(--accent-3), #4ade80);
}

.tone-3 {
  background: linear-gradient(90deg, var(--accent-4), #2dd4bf);
}

.mix-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.flow-list {
  display: grid;
  gap: 10px;
}

.flow-step {
  padding: 11px;
  border: 1px solid #e2eaf5;
  border-radius: 8px;
  background: #fff;
}

.flow-step p {
  margin-top: 5px;
  font-size: 12px;
}

.flow-step.inbound .flow-fill {
  background: linear-gradient(90deg, var(--accent-3), #86efac);
}

.flow-step.picking .flow-fill {
  background: linear-gradient(90deg, var(--accent), #60a5fa);
}

.flow-step.shipping .flow-fill {
  background: linear-gradient(90deg, #475569, #94a3b8);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.kpi-showcase {
  margin: 16px 0;
}

.trace-panel-intro {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #d7e4f4;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(21, 101, 192, 0.08), rgba(255, 255, 255, 0.98));
  color: var(--muted);
  box-shadow: var(--shadow-soft);
}

.trace-panel-intro strong {
  color: var(--ink);
  font-size: 15px;
}

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

.trace-link-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid #d9e6f5;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98));
  color: inherit;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(18, 38, 63, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.trace-link-card::after {
  content: "→";
  position: absolute;
  right: 14px;
  top: 12px;
  color: #9bb0cb;
  font-weight: 900;
}

.trace-link-card:nth-child(2) {
  border-left-color: var(--accent-2);
}

.trace-link-card:nth-child(3) {
  border-left-color: var(--accent-3);
}

.trace-link-card:nth-child(4) {
  border-left-color: var(--accent-5);
}

.trace-link-card:nth-child(5) {
  border-left-color: var(--accent-4);
}

.trace-link-card:hover,
.trace-link-card:focus-visible {
  transform: translateY(-2px);
  border-color: #9ec5fe;
  box-shadow: 0 12px 26px rgba(30, 96, 180, 0.12);
  outline: none;
}

.trace-link-card strong {
  color: var(--ink);
  font-size: 16px;
}

.trace-link-card span {
  color: var(--muted);
  line-height: 1.55;
}

.kpi-showcase-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1.1fr) minmax(320px, 1fr) minmax(280px, 0.9fr);
  gap: 14px;
  align-items: stretch;
}

.kpi-spotlight,
.kpi-source-card,
.kpi-scale-card,
.kpi-activity-card {
  border: 1px solid #d9e6f5;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98));
  box-shadow: 0 10px 24px rgba(18, 38, 63, 0.05);
}

.kpi-spotlight {
  grid-row: span 2;
  overflow: hidden;
  border-color: #b9d2ef;
  background: linear-gradient(145deg, #0f2544 0%, #174a7a 62%, #ffffff 62%, #ffffff 100%);
}

.kpi-spotlight-main {
  display: grid;
  align-content: space-between;
  width: 100%;
  min-height: 294px;
  padding: 20px;
  border: 0;
  background: transparent;
  color: #ffffff;
  text-align: left;
  cursor: pointer;
}

.kpi-spotlight .kpi-label,
.kpi-spotlight .kpi-detail-link {
  color: #d8e8ff;
}

.kpi-spotlight-main strong {
  display: block;
  margin: 12px 0;
  font-size: 36px;
  line-height: 1.08;
}

.kpi-spotlight-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.kpi-spotlight-meta span {
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #eff6ff;
  font-size: 12px;
  font-weight: 800;
}

.kpi-source-card,
.kpi-scale-card,
.kpi-activity-card {
  padding: 14px;
}

.kpi-source-card h3,
.kpi-scale-card h3,
.kpi-activity-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.source-split {
  display: flex;
  height: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #eaf0f7;
}

.source-split-fill.hq {
  background: var(--accent);
}

.source-split-fill.local {
  background: var(--accent-2);
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
}

.scale-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
}

.kpi-tile {
  overflow: hidden;
  border: 1px solid #e1eaf6;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 6px 14px rgba(18, 38, 63, 0.035);
}

.kpi-tile.source.hq {
  border-top: 4px solid var(--accent);
}

.kpi-tile.source.local {
  border-top: 4px solid var(--accent-2);
}

.kpi-tile-main {
  display: grid;
  gap: 7px;
  width: 100%;
  min-height: 104px;
  padding: 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

button.kpi-tile-main {
  cursor: pointer;
}

.kpi-tile-main small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.kpi-tile .kpi-value {
  margin: 0;
  font-size: 20px;
}

.kpi-activity-list {
  display: grid;
  gap: 9px;
}

.kpi-activity-row {
  overflow: hidden;
  border: 1px solid #e1eaf6;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 6px 14px rgba(18, 38, 63, 0.035);
}

.kpi-activity-main {
  width: 100%;
  padding: 11px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.kpi-activity-head,
.kpi-activity-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kpi-activity-head span {
  font-weight: 900;
}

.kpi-activity-head strong {
  white-space: nowrap;
}

.kpi-activity-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.kpi-activity-row.inbound .flow-fill {
  background: linear-gradient(90deg, var(--accent-3), #86efac);
}

.kpi-activity-row.picking .flow-fill {
  background: linear-gradient(90deg, var(--accent), #60a5fa);
}

.kpi-activity-row.shipping .flow-fill {
  background: linear-gradient(90deg, #475569, #94a3b8);
}

.time-context {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.time-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #dce7f5;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 4px 10px rgba(18, 38, 63, 0.03);
}

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

.time-chip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.kpi-label {
  color: var(--muted);
  font-size: 13px;
}

.kpi-card.has-detail {
  padding: 0;
  overflow: hidden;
  border-color: #d9e6f5;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98));
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.kpi-card-main {
  display: block;
  width: 100%;
  padding: 16px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

button.kpi-card-main {
  cursor: pointer;
}

button.kpi-card-main:hover,
button.kpi-card-main:focus-visible {
  background: #f8fbff;
  outline: none;
}

.kpi-card.has-detail:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(18, 38, 63, 0.08);
}

.kpi-value {
  margin-top: 8px;
  font-size: 25px;
  font-weight: 850;
}

.kpi-detail-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.kpi-detail {
  max-height: 360px;
  overflow: auto;
  border-top: 1px solid var(--line);
  padding: 10px 14px 14px;
  background: #fbfdff;
}

.kpi-detail-row {
  padding: 8px 0;
  border-bottom: 1px solid #e8eef8;
}

.kpi-detail-row:last-child {
  border-bottom: 0;
}

.kpi-detail-head,
.kpi-detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kpi-detail-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.kpi-detail-head strong {
  white-space: nowrap;
  font-size: 13px;
}

.kpi-detail-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.kpi-detail-track {
  height: 6px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9f0f8;
}

.kpi-detail-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f6feb, #60a5fa);
}

.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.panel {
  margin-top: 16px;
}

.panel > h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

.panel:not(.command-center) {
  border-color: #d7e1ef;
}

main > .panel:not(.command-center):not(.report-context-panel) {
  position: relative;
}

main > .panel:not(.command-center):not(.report-context-panel)::before {
  counter-increment: report-section;
  content: counter(report-section, decimal-leading-zero);
  position: absolute;
  top: 18px;
  left: 16px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #eaf3ff, #ffffff);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(21, 101, 192, 0.12);
}

main > .panel:not(.command-center):not(.report-context-panel) > h2,
main > .panel:not(.command-center):not(.report-context-panel) > .section-heading,
main > .panel:not(.command-center):not(.report-context-panel) > .panel-title-row {
  padding-left: 42px;
}

.priority-panel {
  border-color: #c8d9ef;
  background:
    linear-gradient(90deg, rgba(198, 40, 40, 0.08), transparent 42%),
    linear-gradient(135deg, #ffffff 0%, #fff7f7 46%, #f7fbff 100%);
}

.inventory-focus-panel {
  border-color: rgba(21, 101, 192, 0.26);
  background:
    linear-gradient(120deg, rgba(21, 101, 192, 0.16), transparent 32%),
    linear-gradient(300deg, rgba(15, 118, 110, 0.10), transparent 35%),
    #ffffff;
}

.arrival-pressure-panel {
  border-color: rgba(245, 158, 11, 0.38);
  background:
    linear-gradient(120deg, rgba(245, 158, 11, 0.18), transparent 34%),
    linear-gradient(300deg, rgba(21, 101, 192, 0.09), transparent 38%),
    #ffffff;
}

.execution-panel {
  border-color: #cbd9ea;
  background:
    linear-gradient(135deg, rgba(8, 145, 178, 0.08), transparent 36%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.execution-panel.receiving-panel {
  border-left: 5px solid var(--accent-3);
  background:
    linear-gradient(135deg, rgba(22, 163, 74, 0.09), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.execution-panel.picking-panel {
  border-left: 5px solid var(--accent);
  background:
    linear-gradient(135deg, rgba(21, 101, 192, 0.09), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.execution-panel.shipping-panel {
  border-left: 5px solid #475569;
  background:
    linear-gradient(135deg, rgba(71, 85, 105, 0.08), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.detail-panel {
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.07), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.kpi-drilldown {
  border-style: dashed;
  background: #fbfdff;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title-row h2 {
  margin: 0;
  font-size: 22px;
}

.panel-title-row button {
  min-height: 34px;
  border-color: #c7d3e6;
  background: #fff;
}

.collapsible-panel.collapsed {
  padding-bottom: 16px;
}

.collapsible-panel.collapsed .panel-title-row {
  margin-bottom: 0;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px 22px;
}

.section-grid.two {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.chart-grid {
  align-items: start;
}

.subpanel h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.subpanel {
  padding: 14px;
  border: 1px solid #e2eaf5;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.96));
  box-shadow: var(--shadow-soft);
}

.table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  contain: paint;
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #dbe5f2;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: #53627b;
  background: linear-gradient(180deg, rgba(240, 246, 255, 0.88), rgba(255, 255, 255, 0.88));
  font-size: 13px;
  font-weight: 700;
}

tbody tr {
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

tbody tr:nth-child(even) {
  background: rgba(248, 251, 255, 0.68);
}

tbody tr:hover {
  background: #f0f7ff;
}

body[dir="rtl"] th,
body[dir="rtl"] td {
  text-align: right;
}

.risk {
  color: var(--risk);
  font-weight: 700;
  margin-bottom: 8px;
}

.risk-level {
  display: inline-block;
  min-width: 52px;
  margin-inline-end: 8px;
  color: var(--panel);
  background: var(--risk);
  border-radius: 999px;
  padding: 2px 8px;
  text-align: center;
  font-size: 12px;
}

.muted,
.empty {
  color: var(--muted);
}

.bar-cell {
  min-width: 132px;
}

.bar-cell span {
  display: inline-block;
  margin-bottom: 4px;
  font-weight: 700;
}

.bar-track {
  height: 8px;
  border-radius: 999px;
  background: #e8eef7;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #55a7ff);
  box-shadow: 0 3px 8px rgba(21, 101, 192, 0.20);
}

.visual-summary,
.arrival-overview {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1.2fr);
  gap: 16px;
  margin-bottom: 18px;
}

.arrival-overview {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 190px;
  padding: 16px;
  border: 1px solid #d8e6f6;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(242, 248, 255, 0.98) 100%);
  box-shadow: var(--shadow-lift);
}

.donut {
  width: 150px;
  height: 150px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(15, 35, 65, 0.06), 0 16px 30px rgba(18, 38, 63, 0.13);
}

.donut-hole {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px solid #d8e6f6;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.donut-legend {
  display: grid;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.donut-legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #e0e9f5;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(18, 38, 63, 0.035);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.mini-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 12px;
}

.mini-metric {
  min-height: 92px;
  padding: 14px;
  border: 1px solid #d8e6f6;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(21, 101, 192, 0.06), transparent 44%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: var(--shadow-soft);
}

.mini-metric.warn {
  border-left-color: var(--accent-2);
  background: linear-gradient(180deg, #fff9ed 0%, #ffffff 100%);
}

.mini-metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.mini-metric strong {
  display: block;
  font-size: 20px;
  line-height: 1.25;
}

.mini-metric:nth-child(1) {
  border-left-color: var(--accent);
}

.mini-metric:nth-child(2) {
  border-left-color: var(--accent-2);
}

.mini-metric:nth-child(3) {
  border-left-color: var(--accent-5);
}

.mini-metric:nth-child(4) {
  border-left-color: var(--accent-4);
}

.monthly-card-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 12px;
  margin: 10px 0 20px;
}

.monthly-card {
  overflow: hidden;
  position: relative;
  border: 1px solid #dce7f5;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.98) 100%);
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.monthly-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #5aa7ff, var(--accent));
}

.monthly-card:nth-child(1),
.monthly-card:nth-child(2),
.monthly-card:nth-child(3),
.monthly-card:nth-child(4) {
  grid-column: span 2;
}

.monthly-card:nth-child(n + 5) {
  grid-column: span 1;
}

.monthly-card:nth-child(2)::before {
  background: linear-gradient(90deg, var(--cyan), #67e8f9);
}

.monthly-card:nth-child(3)::before {
  background: linear-gradient(90deg, var(--accent-5), #a78bfa);
}

.monthly-card:nth-child(4)::before {
  background: linear-gradient(90deg, var(--accent-3), #86efac);
}

.monthly-card:nth-child(5)::before {
  background: linear-gradient(90deg, #334155, #94a3b8);
}

.monthly-card:nth-child(6)::before {
  background: linear-gradient(90deg, var(--accent-2), #fcd34d);
}

.monthly-card:hover {
  transform: translateY(-2px);
  border-color: #bed4ef;
  box-shadow: var(--shadow-lift);
}

.monthly-card.focus {
  border-color: rgba(21, 101, 192, 0.42);
  background: linear-gradient(145deg, #f4f9ff 0%, #ffffff 100%);
}

.monthly-card.focus::before {
  background: linear-gradient(90deg, #0f6fd6, #58a6ff);
}

.monthly-card.warn {
  border-color: rgba(245, 158, 11, 0.5);
  background: linear-gradient(145deg, #fff9ed 0%, #ffffff 100%);
}

.monthly-card.warn::before {
  background: linear-gradient(90deg, #f59e0b, #fbd38d);
}

.monthly-card.open {
  box-shadow: 0 12px 28px rgba(18, 38, 63, 0.08);
}

.monthly-card-main {
  display: block;
  width: 100%;
  min-height: 132px;
  padding: 14px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

body[dir="rtl"] .monthly-card-main {
  text-align: right;
}

.monthly-card-main:hover,
.monthly-card-main:focus-visible {
  background: #f8fbff;
}

.monthly-card-title {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.monthly-card-main strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 23px;
  line-height: 1.15;
}

.monthly-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 38px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.monthly-card-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
  font-weight: 700;
}

.monthly-card-detail {
  border-top: 1px solid var(--line);
  padding: 8px 14px 10px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.monthly-detail-row {
  display: grid;
  grid-template-columns: 78px minmax(92px, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.monthly-detail-row:last-child {
  border-bottom: 0;
}

.monthly-detail-row strong {
  text-align: right;
  font-size: 14px;
}

body[dir="rtl"] .monthly-detail-row strong {
  text-align: left;
}

.monthly-detail-mom {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.monthly-support-grid {
  margin-bottom: 18px;
}

.monthly-full-table h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.monthly-trend-board {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) repeat(2, minmax(230px, 1fr)) minmax(220px, 0.85fr);
  gap: 14px;
  margin: 8px 0 16px;
}

.trend-copy,
.trend-chart {
  min-height: 190px;
  padding: 16px;
  border: 1px solid #d8e6f6;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 251, 255, 0.98) 100%);
  box-shadow: var(--shadow-soft);
}

.trend-copy {
  background:
    linear-gradient(135deg, rgba(21, 101, 192, 0.16), transparent 58%),
    linear-gradient(315deg, rgba(22, 163, 74, 0.08), transparent 44%),
    #ffffff;
}

.trend-copy h3,
.trend-chart h4 {
  margin: 0 0 10px;
}

.trend-copy p {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.trend-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trend-pills span {
  padding: 7px 9px;
  border: 1px solid #d5e2f3;
  border-radius: 999px;
  background: #ffffff;
  color: #24476d;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 5px 12px rgba(18, 38, 63, 0.04);
}

.trend-bars {
  display: grid;
  grid-template-columns: repeat(6, minmax(28px, 1fr));
  align-items: end;
  gap: 8px;
  height: 132px;
  padding-top: 8px;
}

.trend-bar-item {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 6px;
  min-width: 0;
  height: 100%;
}

.trend-bar {
  display: block;
  width: 100%;
  min-height: 8px;
  border-radius: 10px 10px 3px 3px;
  background: linear-gradient(180deg, #9dd4ff 0%, #1f73d4 100%);
  box-shadow: inset 0 -8px 12px rgba(15, 60, 120, 0.14), 0 7px 12px rgba(21, 101, 192, 0.16);
}

.trend-bar.share {
  background: linear-gradient(180deg, #ffd166 0%, #f59e0b 100%);
  box-shadow: inset 0 -8px 12px rgba(145, 80, 0, 0.14), 0 7px 12px rgba(245, 158, 11, 0.16);
}

.trend-bar-item em {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-donut-card {
  display: grid;
  align-content: start;
}

.trend-donut-wrap {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 134px;
}

.trend-donut {
  display: grid;
  place-items: center;
  width: 136px;
  height: 136px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(15, 35, 65, 0.06), 0 14px 28px rgba(18, 38, 63, 0.12);
}

.trend-donut-hole {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #d9e6f5;
  text-align: center;
}

.trend-donut-hole span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.trend-donut-hole strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
}

.trend-donut-legend {
  display: grid;
  gap: 10px;
}

.trend-donut-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
}

.trend-donut-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-hq {
  background: var(--accent);
}

.legend-local {
  background: var(--accent-2);
}

.insight-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  line-height: 1.75;
}

.insight-list li {
  margin: 0 0 10px;
}

.viz-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid #d8e6f6;
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.98) 100%);
  box-shadow: var(--shadow-soft);
}

.viz-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #56b4ff);
}

.viz-panel:nth-child(2n)::before {
  background: linear-gradient(90deg, var(--accent-2), #fcd34d);
}

.viz-panel:nth-child(3n)::before {
  background: linear-gradient(90deg, var(--accent-4), #5eead4);
}

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

.viz-head h3 {
  margin: 0;
  font-size: 17px;
}

.viz-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.viz-controls label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.viz-controls select {
  border-color: #d4e1f2;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(18, 38, 63, 0.035);
}

.viz-expand,
.viz-collapse {
  min-height: 34px;
  padding: 0 12px;
  border-color: #c7d3e6;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 4px 10px rgba(18, 38, 63, 0.035);
}

.viz-collapse {
  color: var(--muted);
}

.viz-panel.collapsed .viz-note,
.viz-panel.collapsed .chart-list {
  display: none;
}

.viz-panel.collapsed {
  padding-bottom: 14px;
}

.viz-note {
  margin: -2px 0 10px;
  font-size: 13px;
}

.chart-list {
  display: grid;
  gap: 10px;
}

.chart-row {
  padding: 10px 12px;
  border: 1px solid #e0e9f5;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 5px 14px rgba(18, 38, 63, 0.035);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.chart-row:hover {
  transform: translateY(-1px);
  border-color: #c9daf0;
  box-shadow: 0 10px 18px rgba(18, 38, 63, 0.06);
}

.chart-row[hidden] {
  display: none;
}

.chart-row-head,
.chart-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chart-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
}

.chart-value {
  color: var(--ink);
  font-weight: 850;
  white-space: nowrap;
}

.chart-track {
  height: 11px;
  border-radius: 999px;
  background: #e9f0f8;
  overflow: hidden;
  margin: 7px 0 5px;
}

.chart-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #4f9cf9);
  box-shadow: 0 4px 10px rgba(21, 101, 192, 0.20);
}

.chart-meta {
  color: var(--muted);
  font-size: 12px;
}

.interactive-table {
  margin-top: 18px;
}

.category-structure-table {
  display: grid;
  gap: 10px;
}

.category-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: -4px 0 2px;
  padding: 10px;
  border: 1px solid #d8e6f6;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 247, 255, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.category-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.category-controls input {
  width: 180px;
  min-height: 34px;
  border: 1px solid #d4e1f2;
  border-radius: 6px;
  padding: 0 8px;
  font-weight: 700;
}

.category-controls button {
  min-height: 34px;
}

.table-controls {
  display: grid;
  gap: 10px;
  margin: -4px 0 12px;
  padding: 10px;
  border: 1px solid #d8e6f6;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.table-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.table-summary-card {
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid #dbe6f5;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 255, 0.98));
  box-shadow: var(--shadow-soft);
}

.table-summary-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.table-summary-card strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-summary-card:first-child {
  border-color: rgba(21, 101, 192, 0.32);
  background:
    linear-gradient(135deg, rgba(21, 101, 192, 0.12), rgba(255, 255, 255, 0.98));
}

.table-summary-card:nth-child(2) {
  border-color: rgba(245, 158, 11, 0.32);
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(255, 255, 255, 0.98));
}

.table-summary-card:nth-child(3) {
  border-color: rgba(22, 163, 74, 0.30);
  background:
    linear-gradient(135deg, rgba(22, 163, 74, 0.10), rgba(255, 255, 255, 0.98));
}

.table-summary-card:nth-child(4) {
  border-color: rgba(124, 58, 237, 0.28);
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.09), rgba(255, 255, 255, 0.98));
}

.table-control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.table-control-row.primary {
  justify-content: space-between;
}

.top-buttons,
.table-filter-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.top-buttons span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.chip-button,
.tag-button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border-color: #c7d3e6;
  background: #fff;
  color: var(--muted);
  box-shadow: 0 4px 10px rgba(18, 38, 63, 0.025);
}

.chip-button.active,
.tag-button.active {
  border-color: rgba(21, 101, 192, 0.45);
  background: linear-gradient(180deg, #eaf3ff 0%, #ffffff 100%);
  color: var(--accent);
}

.tag-button {
  font-size: 12px;
  font-weight: 700;
}

.table-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.table-controls input {
  width: 96px;
  min-height: 34px;
  border: 1px solid #d4e1f2;
  border-radius: 6px;
  padding: 0 8px;
  font-weight: 700;
}

.table-controls input[type="search"] {
  width: 190px;
}

.table-controls button {
  min-height: 34px;
}

.table-result {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

tr[hidden] {
  display: none;
}

@media (max-width: 900px) {
  .kpi-grid,
  .kpi-showcase-grid,
  .trace-link-grid,
  .time-context,
  .monthly-card-grid,
  .monthly-trend-board,
  .table-summary-cards,
  .executive-metric-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .kpi-spotlight {
    grid-row: auto;
  }

  .monthly-card:nth-child(n) {
    grid-column: auto;
  }

  .section-grid,
  .section-grid.two,
  .visual-summary,
  .arrival-overview,
  .period-metric-grid,
  .command-hero,
  .command-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
  }

  .report-filter-bar {
    justify-content: flex-start;
    width: 100%;
  }

  .report-toolbar .report-filter-bar {
    justify-content: flex-start;
  }

  .filter-button,
  .filter-select {
    flex: 1 1 150px;
  }

  .topbar-currency,
  .language-switch {
    width: 100%;
  }

  .topbar-currency .currency-choice,
  .language-switch span {
    min-width: 0;
    flex: 1 1 0;
  }
}

@media (max-width: 560px) {

  .period-panel-head {
    flex-direction: column;
  }

  .period-panel-head p {
    text-align: left;
  }

  main {
    padding: 14px;
  }

  .kpi-grid,
  .kpi-showcase-grid,
  .trace-link-grid,
  .time-context,
  .monthly-card-grid,
  .monthly-trend-board,
  .table-summary-cards,
  .executive-metric-grid,
  .command-grid {
    grid-template-columns: 1fr;
  }

  .kpi-spotlight-main {
    min-height: 240px;
  }

  .kpi-spotlight-meta,
  .source-grid,
  .scale-grid {
    grid-template-columns: 1fr;
  }

  .command-copy h2,
  .command-total strong {
    font-size: 24px;
  }

  .donut-wrap {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .viz-head,
  .chart-row-head,
  .chart-meta,
  .category-controls,
  .table-controls,
  .table-control-row,
  .table-control-row.primary,
  .top-buttons,
  .table-filter-tags {
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-start;
  }

  .table-controls input,
  .table-controls select,
  .table-controls button,
  .category-controls input,
  .category-controls select,
  .category-controls button {
    width: 100%;
  }
}
