:root {
  --bg: #eef3f7;
  --surface: #ffffff;
  --surface-soft: #f5f8fb;
  --surface-strong: #e7edf3;
  --ink: #111827;
  --muted: #647184;
  --line: #d8e1ea;
  --line-strong: #b8c5d4;
  --nav: #09111f;
  --nav-2: #111b2c;
  --nav-3: #172338;
  --gold: #f6b84b;
  --gold-soft: #fff3d6;
  --green: #13a37f;
  --green-soft: #def8ef;
  --blue: #2563eb;
  --blue-soft: #e4edff;
  --cyan: #18c5d9;
  --lime: #9fe870;
  --red: #e05252;
  --red-soft: #ffe4e4;
  --shadow: 0 24px 70px rgba(15, 23, 42, .12);
  --shadow-soft: 0 12px 30px rgba(15, 23, 42, .08);
  --glow: 0 20px 70px rgba(37, 99, 235, .16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    linear-gradient(118deg, rgba(37, 99, 235, .08), transparent 32%),
    repeating-linear-gradient(116deg, rgba(9, 17, 31, .035) 0 1px, transparent 1px 34px),
    var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; letter-spacing: 0; }

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
}

.main {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    linear-gradient(160deg, rgba(24, 197, 217, .13), transparent 36%),
    linear-gradient(180deg, var(--nav), var(--nav-2) 58%, var(--nav-3));
  color: #f8fbff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 1px solid rgba(255, 255, 255, .1);
  overflow: hidden;
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(122deg, transparent 0 28px, rgba(255,255,255,.055) 28px 29px, transparent 29px 58px);
  opacity: .5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  position: relative;
  z-index: 1;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  color: #06111e;
  font-weight: 820;
  box-shadow: 0 14px 34px rgba(24, 197, 217, .28);
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.15;
}

.brand-subtitle {
  color: rgba(248, 251, 255, .64);
  font-size: 12px;
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.nav a {
  min-height: 42px;
  border-radius: 8px;
  padding: 11px 12px;
  color: rgba(248, 251, 255, .72);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 680;
}

.nav a::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
}

.nav a:hover,
.nav a.active {
  background: rgba(255, 255, 255, .1);
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--cyan);
}

.nav a.active::after {
  background: var(--lime);
  box-shadow: 0 0 18px rgba(159, 232, 112, .75);
}

.sidebar-foot {
  margin-top: auto;
  color: rgba(248, 251, 255, .68);
  font-size: 12px;
  line-height: 1.45;
  display: grid;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.status-pill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, .1);
  color: #f8fbff;
  font-weight: 700;
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 14px rgba(159, 232, 112, .72);
}

.main { min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  border-bottom: 1px solid rgba(216, 225, 234, .88);
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  background: rgba(248, 251, 255, .88);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 30px rgba(15, 23, 42, .06);
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.18;
  font-weight: 820;
}

h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 780;
}

.subtitle,
.hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  line-height: 1.45;
}

.content {
  padding: 24px 28px 38px;
  display: grid;
  gap: 18px;
  min-width: 0;
}

.band,
.hero-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.band::before,
.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--lime), var(--gold));
  opacity: .82;
}

.filter-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.filter-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
}

.form-grid.compact {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  align-items: end;
}

.form-toggle {
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .66);
}

.filter-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.filter-field label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.filter-field input,
.filter-field select {
  width: 100%;
}

.filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 720;
}

.filter-errors {
  grid-column: 1 / -1;
  color: var(--red);
  font-size: 13px;
}

.hero-panel {
  padding: 20px;
  display: grid;
  gap: 18px;
}

.hero-panel .band-header {
  margin-bottom: 0;
}

.band-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(142px, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, .06), transparent),
    var(--surface-soft);
}

.kpi {
  min-height: 118px;
  padding: 15px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  border-right: 1px solid var(--line);
}

.kpi:hover {
  background: rgba(37, 99, 235, .045);
}

.kpi:last-child {
  border-right: 0;
}

.kpi-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 760;
  text-transform: uppercase;
}

.kpi-value {
  font-size: 27px;
  line-height: 1.05;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
  gap: 18px;
}

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

.instruction-band {
  background:
    linear-gradient(135deg, rgba(9, 17, 31, .94), rgba(23, 35, 56, .94)),
    var(--nav);
  color: #f8fbff;
  box-shadow: 0 28px 90px rgba(9, 17, 31, .2);
}

.instruction-band .hint {
  color: rgba(248, 251, 255, .68);
}

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

.instruction-step {
  min-height: 168px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
  background:
    linear-gradient(145deg, rgba(24, 197, 217, .12), transparent 42%),
    rgba(255, 255, 255, .07);
}

.instruction-step span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  color: #06111e;
  font-weight: 860;
}

.instruction-step strong {
  font-size: 14px;
}

.instruction-step p {
  margin: 0;
  color: rgba(248, 251, 255, .7);
  font-size: 13px;
  line-height: 1.48;
}

.table-wrap {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.table-wrap.compact {
  max-width: 720px;
}

.matrix-wrap {
  max-height: 72vh;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 12px 13px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: #eef4fb;
  color: #475569;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 820;
}

tbody tr:hover {
  background: #f6fbff;
}

.matrix-table {
  min-width: 1400px;
}

.matrix-table th:first-child,
.matrix-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  min-width: 150px;
}

.matrix-table th:nth-child(2),
.matrix-table td:nth-child(2) {
  position: sticky;
  left: 150px;
  z-index: 2;
  background: var(--surface);
  min-width: 180px;
}

.matrix-table th {
  z-index: 3;
}

.matrix-table .month-total,
.matrix-table td:nth-child(6n) {
  background: #eef7ff;
}

.percent-cell {
  color: var(--green);
}

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

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table-link {
  font-weight: 760;
  color: var(--blue);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.row-actions form {
  margin: 0;
}

.mini-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 720;
}

.mini-link.danger {
  border-color: rgba(224, 82, 82, .35);
  background: var(--red-soft);
  color: #b4232b;
}

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

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

.tab {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 12px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 740;
}

.tab.active {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

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

.quality-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 760;
  background: var(--green-soft);
  color: var(--green);
  white-space: nowrap;
}

.tag.warn {
  background: var(--gold-soft);
  color: #93662a;
}

.tag.danger {
  background: var(--red-soft);
  color: var(--red);
}

.btn {
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #ffffff, #f6f9fc);
  color: var(--ink);
  border-radius: 8px;
  min-height: 38px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 760;
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn:hover {
  border-color: var(--cyan);
  transform: translateY(-1px);
  box-shadow: var(--glow);
}

.btn.primary {
  border-color: #0f172a;
  background: linear-gradient(135deg, #0f172a, #1d4ed8 58%, #13a37f);
  color: #ffffff;
}

.btn.danger {
  border-color: rgba(224, 82, 82, .35);
  background: linear-gradient(180deg, #fff5f5, #ffe4e4);
  color: #b4232b;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .52;
  transform: none;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form {
  display: grid;
  gap: 13px;
  max-width: 980px;
}

.wide-form {
  max-width: 980px;
}

.inline-map-form {
  margin: 0;
  min-width: min(320px, 68vw);
}

.inline-map-form .form-control {
  width: 100%;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.form p {
  display: grid;
  gap: 6px;
  margin: 0;
}

.danger-zone {
  border-color: rgba(224, 82, 82, .34);
  box-shadow: 0 16px 38px rgba(224, 82, 82, .08);
}

.form label {
  font-weight: 740;
  color: #3d423e;
}

.form .helptext {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

input,
select,
textarea {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 11px;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

textarea {
  min-height: 96px;
  padding-top: 10px;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--blue);
}

.messages {
  display: grid;
  gap: 8px;
}

.message {
  background: var(--green-soft);
  color: var(--green);
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(47, 111, 94, .18);
}

.executive-hero {
  min-height: 244px;
  border-radius: 8px;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 22px;
  align-items: stretch;
  background:
    repeating-linear-gradient(122deg, rgba(255,255,255,.09) 0 1px, transparent 1px 32px),
    linear-gradient(135deg, rgba(9, 17, 31, .98), rgba(24, 38, 64, .98) 48%, rgba(15, 118, 110, .94)),
    #09111f;
  color: #f8fbff;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 28px 90px rgba(9, 17, 31, .26);
  overflow: hidden;
}

.executive-hero-copy {
  display: grid;
  align-content: center;
  gap: 12px;
  max-width: 780px;
}

.eyebrow {
  width: fit-content;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(24, 197, 217, .14);
  color: #b8fbff;
  border: 1px solid rgba(24, 197, 217, .28);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.executive-hero h2 {
  font-size: 35px;
  line-height: 1.06;
  max-width: 720px;
}

.executive-hero p {
  margin: 0;
  max-width: 650px;
  color: rgba(248, 251, 255, .72);
  line-height: 1.55;
  font-size: 15px;
}

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

.signal {
  min-height: 94px;
  border-radius: 8px;
  padding: 14px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, .085);
  border: 1px solid rgba(255, 255, 255, .1);
}

.signal span {
  color: rgba(248, 251, 255, .66);
  font-size: 12px;
  font-weight: 760;
}

.signal strong {
  font-size: 20px;
  line-height: 1.12;
}

.executive-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.metric-card {
  min-height: 152px;
  border-radius: 8px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  background:
    linear-gradient(140deg, rgba(37, 99, 235, .055), transparent 45%),
    var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.metric-card:hover {
  border-color: rgba(37, 99, 235, .42);
  transform: translateY(-2px);
  box-shadow: var(--glow);
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-value {
  font-size: 32px;
  line-height: 1;
  font-weight: 880;
  font-variant-numeric: tabular-nums;
}

.metric-delta {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #6b6f76;
  font-size: 13px;
  font-weight: 800;
}

.metric-delta em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.metric-delta.up { color: var(--green); }
.metric-delta.down { color: var(--red); }

.executive-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, .8fr);
  gap: 18px;
}

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

.insight-panel {
  min-width: 0;
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, .045), transparent 42%),
    var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

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

.combo-chart {
  min-height: 260px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(58px, 1fr);
  gap: 10px;
  align-items: end;
  overflow-x: auto;
  padding: 12px 4px 4px;
}

.combo-column {
  min-width: 58px;
  display: grid;
  gap: 8px;
  align-items: end;
}

.bars {
  height: 188px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
  border-bottom: 1px solid var(--line);
}

.bar {
  width: 14px;
  min-height: 3px;
  border-radius: 5px 5px 0 0;
  display: block;
}

.bar.margin { background: linear-gradient(180deg, var(--lime), var(--green)); }
.bar.sales { background: linear-gradient(180deg, var(--cyan), var(--blue)); }

.combo-label,
.combo-value {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.combo-value {
  color: #373d39;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

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

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.margin { background: var(--green); }
.legend-dot.sales { background: var(--blue); }

.funnel {
  display: grid;
  gap: 15px;
  align-content: center;
}

.funnel-row {
  display: grid;
  gap: 7px;
}

.funnel-meta,
.rank-title,
.rank-foot,
.department-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.funnel-meta span,
.rank-foot,
.department-top span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.funnel-meta strong,
.rank-foot strong {
  font-variant-numeric: tabular-nums;
}

.funnel-track,
.rank-track,
.department-meter {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5edf6;
}

.funnel-track span,
.rank-track span,
.department-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
}

.funnel-row:nth-child(2) .funnel-track span { background: linear-gradient(90deg, var(--blue), var(--green)); }
.funnel-row:nth-child(3) .funnel-track span { background: linear-gradient(90deg, var(--green), var(--lime)); }
.funnel-row:nth-child(4) .funnel-track span { background: linear-gradient(90deg, var(--gold), var(--red)); }

.rank-list,
.department-stack {
  display: grid;
  gap: 13px;
}

.rank-row,
.department-card {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.rank-title strong,
.department-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-title span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.rank-track span { background: linear-gradient(90deg, var(--gold), var(--lime)); }
.rank-track.alt span { background: linear-gradient(90deg, var(--cyan), var(--blue)); }

.department-card {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.department-card:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.department-meter span { background: linear-gradient(90deg, var(--blue), var(--green)); }

.empty-state {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
}

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

.entity {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  min-height: 126px;
  display: grid;
  gap: 8px;
  align-content: start;
  box-shadow: var(--shadow-soft);
}

.fields {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

pre {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: #0f172a;
  color: #e5edf6;
  border-radius: 8px;
  padding: 14px;
  border: 1px solid #2d352f;
}

.json-preview {
  margin: 0;
  max-height: 260px;
  font-size: 12px;
  line-height: 1.45;
}

.compact-value {
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1.15;
  word-break: break-word;
}

.warn-notice {
  margin-top: 16px;
  border-color: rgba(245, 158, 11, 0.36);
  background: rgba(255, 251, 235, 0.86);
  color: #78350f;
}

.mapping-action-panel {
  margin-top: 18px;
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, .18);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, .08), rgba(20, 184, 166, .08)),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.mapping-action-panel h3 {
  margin: 0 0 4px;
  font-size: 20px;
}

.mapping-action-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.mapping-action-list {
  display: grid;
  gap: 12px;
}

.mapping-action-card {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, .9fr);
  gap: 18px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .82);
}

.mapping-action-copy {
  display: grid;
  gap: 7px;
}

.mapping-action-copy strong {
  font-size: clamp(22px, 2vw, 32px);
  line-height: 1.08;
}

.mapping-action-copy small {
  color: var(--muted);
  font-weight: 700;
}

.mapping-action-control {
  display: grid;
  gap: 10px;
}

.mapping-action-control label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.field-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.field-summary-card {
  min-height: 104px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .92), rgba(248, 250, 252, .78));
  box-shadow: var(--shadow-soft);
}

.field-summary-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.field-summary-card strong {
  color: var(--text);
  font-size: clamp(18px, 1.8vw, 28px);
  line-height: 1.15;
  word-break: break-word;
}

.json-details,
.raw-source-details {
  max-width: 100%;
}

.json-details summary,
.raw-source-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 900;
}

.json-details summary {
  display: inline-flex;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
}

.json-details[open] summary {
  margin-bottom: 8px;
}

.raw-source-details {
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, .58);
}

.raw-source-details[open] summary {
  margin-bottom: 12px;
}

.cell-long {
  white-space: normal;
  word-break: break-word;
  min-width: 240px;
  max-width: 520px;
  color: var(--muted);
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.mono-list {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--muted);
  font-size: 12px;
}

.mapping-line {
  display: block;
  margin: 2px 0;
  color: var(--text);
  font-size: 13px;
}

.mapping-table td {
  vertical-align: top;
}

.mapping-current {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.mapping-current.warn {
  color: #b45309;
}

.status-pill.danger {
  background: rgba(239, 68, 68, .12);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, .24);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    repeating-linear-gradient(122deg, rgba(255,255,255,.06) 0 1px, transparent 1px 34px),
    var(--nav);
}

.login-box {
  width: min(430px, 100%);
  border-radius: 8px;
  background: var(--surface);
  padding: 26px;
  box-shadow: 0 28px 80px rgba(0,0,0,.32);
  border: 1px solid rgba(255,255,255,.1);
}

.login-box .form {
  margin-top: 18px;
}

.report-tabs {
  align-items: center;
  flex-wrap: wrap;
}

.excel-shell {
  border: 1px solid #aeb9c4;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(26, 83, 93, .04) 0 180px, transparent 180px),
    #fff;
  box-shadow: 0 16px 38px rgba(15, 23, 42, .08);
}

.excel-scroll {
  max-width: 100%;
  overflow: auto;
}

.excel-report {
  min-width: 1280px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.excel-report th,
.excel-report td {
  height: 34px;
  padding: 7px 10px;
  border-right: 1px solid #c7d0d9;
  border-bottom: 1px solid #c7d0d9;
  background: #ffffff;
  white-space: nowrap;
}

.excel-report thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #164e5b;
  color: #ffffff;
  text-transform: none;
  font-size: 12px;
  font-weight: 820;
  text-align: center;
}

.excel-report .source-head,
.excel-report .metric-head {
  position: sticky;
  z-index: 7;
}

.excel-report .source-head {
  left: 0;
  min-width: 150px;
  background: #164e5b;
}

.excel-report .metric-head {
  left: 150px;
  min-width: 250px;
  background: #164e5b;
}

.excel-report .source-group {
  position: sticky;
  left: 0;
  z-index: 4;
  min-width: 150px;
  background: linear-gradient(180deg, #174f5b, #113d49);
  color: #f7fbff;
  text-align: center;
  font-size: 17px;
  font-style: italic;
  font-weight: 760;
  text-transform: none;
  white-space: normal;
  line-height: 1.2;
}

.excel-report .metric-label {
  position: sticky;
  left: 150px;
  z-index: 3;
  min-width: 250px;
  background: #eef2f6;
  color: #25313d;
  font-weight: 650;
  text-align: left;
}

.excel-report .total-col,
.excel-report .month-total {
  background: #fff2c6;
  font-weight: 800;
}

.excel-report .highlight-row td,
.excel-report .highlight-row .metric-label {
  background: #dff3d4;
  font-weight: 820;
}

.excel-report .highlight-row .total-col,
.excel-report .highlight-row .month-total {
  background: #d7efc5;
}

.period-matrix thead th.month-total {
  background: #efb746;
  color: #fff;
}

.period-matrix th.source-head,
.period-matrix td.source-group {
  left: 0;
  background: linear-gradient(180deg, #174f5b, #113d49);
  color: #f7fbff;
}

.period-matrix th.metric-head,
.period-matrix td.metric-label {
  left: 150px;
}

.period-matrix .source-group:empty {
  background: #174f5b;
}

.source-report .source-group {
  background: #dce8f3;
  color: #1b3142;
  font-style: normal;
}

.classic-dashboard {
  display: grid;
  gap: 24px;
}

.classic-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  border: 1px solid #d5ded8;
  background: #f7fbf8;
}

.classic-kpi {
  min-height: 136px;
  padding: 18px 14px;
  display: grid;
  place-items: center;
  gap: 12px;
  border-right: 1px solid #d5ded8;
  border-bottom: 1px solid #d5ded8;
}

.classic-kpi-label {
  color: #17372f;
  font-size: 13px;
  font-weight: 820;
  text-align: center;
}

.classic-kpi-value {
  color: #0d251f;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 880;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.classic-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 18px;
}

.classic-chart-panel,
.mini-chart-card {
  border: 1px solid #ccd3d9;
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .08);
}

.mini-chart-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
  color: #17372f;
}

.classic-chart-panel svg,
.mini-chart-card svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.lead-chart-panel {
  padding: 24px;
}

.chart-grid-line {
  stroke: #d8dce1;
  stroke-width: 1;
}

.chart-axis {
  stroke: #6f7782;
  stroke-width: 1.4;
}

.chart-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line.blue {
  stroke: #4285f4;
}

.chart-line.red {
  stroke: #d62f27;
}

.chart-line.dark {
  stroke: #0f2d27;
}

.chart-line.trend {
  stroke: #858585;
  stroke-width: 3;
  stroke-dasharray: 14 10;
}

.chart-dot {
  stroke: #fff;
  stroke-width: 1.6;
}

.chart-dot.blue {
  fill: #4285f4;
}

.chart-dot.red {
  fill: #d62f27;
}

.chart-dot.dark {
  fill: #0f2d27;
}

.chart-value,
.chart-axis-label,
.chart-date,
.chart-vertical-label {
  font-size: 12px;
  font-weight: 700;
  text-anchor: middle;
}

.chart-axis-label {
  fill: #1f2937;
  text-anchor: end;
}

.chart-date,
.chart-vertical-label {
  fill: #27313c;
}

.blue-label {
  fill: #4285f4;
}

.red-label {
  fill: #d62f27;
}

.dark-label {
  fill: #10251f;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: #26313d;
  font-weight: 720;
}

.legend-dot,
.legend-line {
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

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

.legend-dot.blue {
  background: #4285f4;
}

.legend-dot.red {
  background: #d62f27;
}

.legend-line {
  width: 28px;
  height: 0;
  border-top: 3px dashed #858585;
}

.premium-report-band {
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(247, 251, 253, .96)),
    var(--surface);
}

.premium-report-hero {
  min-height: 178px;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: start;
  background:
    radial-gradient(circle at 85% 12%, rgba(24, 197, 217, .24), transparent 34%),
    radial-gradient(circle at 12% 0%, rgba(159, 232, 112, .16), transparent 32%),
    repeating-linear-gradient(122deg, rgba(255,255,255,.08) 0 1px, transparent 1px 30px),
    linear-gradient(135deg, #09111f, #172338 54%, #0f766e);
  color: #f8fbff;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.premium-report-hero h2 {
  margin-top: 14px;
  color: #f8fbff;
  font-size: 34px;
  line-height: 1.08;
}

.premium-report-hero p {
  max-width: 620px;
  margin: 8px 0 0;
  color: rgba(248, 251, 255, .72);
  line-height: 1.55;
}

.premium-report-hero .report-tabs {
  align-self: start;
  padding: 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(12px);
}

.premium-report-hero .report-tabs .btn {
  color: #f8fbff;
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .22);
}

.premium-report-hero .report-tabs .btn.primary {
  color: #06111e;
  background: linear-gradient(135deg, var(--lime), var(--cyan));
  border-color: rgba(255, 255, 255, .22);
  box-shadow: 0 14px 34px rgba(24, 197, 217, .18);
}

.premium-report-band .classic-dashboard {
  padding: 20px;
}

.premium-report-band .classic-kpi-grid {
  border: 0;
  border-radius: 8px;
  gap: 12px;
  background: transparent;
  overflow: visible;
}

.premium-report-band .classic-kpi {
  position: relative;
  min-height: 146px;
  overflow: hidden;
  border: 1px solid rgba(143, 158, 177, .34);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(37, 99, 235, .07), transparent 46%),
    rgba(255, 255, 255, .88);
  box-shadow: 0 18px 46px rgba(15, 23, 42, .08);
}

.premium-report-band .classic-kpi::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--lime));
}

.premium-report-band .classic-kpi.metric-5::before,
.premium-report-band .classic-kpi.metric-6::before,
.premium-report-band .classic-kpi.metric-7::before {
  background: linear-gradient(90deg, var(--gold), var(--lime), var(--green));
}

.premium-report-band .classic-kpi-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.premium-report-band .classic-kpi-value {
  color: #071a16;
  font-size: 32px;
}

.premium-report-band .classic-chart-grid {
  gap: 20px;
}

.premium-line-card {
  position: relative;
  min-height: 360px;
  padding: 18px 18px 12px;
  border-color: rgba(143, 158, 177, .32);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(250, 253, 255, .92)),
    var(--surface);
}

.premium-line-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--lime), var(--gold));
  border-radius: 8px 8px 0 0;
}

.mini-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.mini-chart-head h3 {
  margin: 0;
  color: #091f1b;
  font-size: 16px;
}

.mini-chart-head span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: #0f766e;
  background: rgba(24, 197, 217, .1);
  border: 1px solid rgba(24, 197, 217, .22);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.mini-chart-card.premium-line-card {
  overflow-x: hidden;
}

.mini-chart-card.premium-line-card svg {
  min-width: 0;
  overflow: visible;
}

.premium-line-card .chart-grid-line {
  stroke: rgba(100, 113, 132, .22);
}

.premium-line-card .chart-axis {
  stroke: rgba(15, 23, 42, .42);
}

.premium-line-card .chart-line.dark {
  stroke: #0f766e;
  stroke-width: 3.2;
  filter: drop-shadow(0 8px 12px rgba(15, 118, 110, .16));
}

.premium-line-card .chart-dot.dark {
  fill: #0f766e;
  stroke: #f8fbff;
  stroke-width: 2;
}

.premium-line-card .chart-value {
  font-size: 11px;
  font-weight: 850;
}

.premium-line-card .chart-date {
  fill: #516071;
  font-size: 13px;
  font-weight: 850;
}

@media (max-width: 1120px) {
  .filter-form {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .form-grid,
  .form-grid.compact {
    grid-template-columns: 1fr 1fr;
  }

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

  .executive-kpis,
  .executive-grid,
  .executive-grid.three {
    grid-template-columns: 1fr;
  }

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

  .premium-report-hero {
    grid-template-columns: 1fr;
  }

  .premium-report-hero .report-tabs {
    width: 100%;
  }

  .kpi {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .grid-2,
  .schema,
  .classic-chart-grid,
  .instruction-grid {
    grid-template-columns: 1fr;
  }

  .classic-kpi-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

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

  .form-grid,
  .form-grid.compact {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .content {
    padding: 16px;
  }

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

  .executive-hero {
    padding: 18px;
  }

  .premium-report-hero {
    padding: 18px;
  }

  .premium-report-hero h2 {
    font-size: 28px;
  }

  .executive-hero h2 {
    font-size: 27px;
  }

  .executive-signals,
  .executive-kpis,
  .classic-kpi-grid {
    grid-template-columns: 1fr;
  }

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

  .panel-head,
  .metric-delta {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Premium responsive pass */
html {
  background: #e9eff5;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  background:
    linear-gradient(118deg, rgba(18, 197, 217, .08), transparent 30%),
    linear-gradient(150deg, rgba(246, 184, 75, .07), transparent 34%),
    repeating-linear-gradient(116deg, rgba(15, 23, 42, .032) 0 1px, transparent 1px 36px),
    #e9eff5;
}

.main {
  background: rgba(255, 255, 255, .18);
}

.sidebar {
  box-shadow: 18px 0 48px rgba(9, 17, 31, .14);
}

.nav a {
  border: 1px solid transparent;
}

.nav a:hover,
.nav a.active {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .12);
}

.topbar {
  min-width: 0;
}

.topbar .actions {
  justify-content: flex-end;
}

.band,
.hero-panel,
.filter-panel,
.insight-panel,
.metric-card,
.entity,
.classic-chart-panel,
.mini-chart-card {
  border-color: rgba(143, 158, 177, .36);
  box-shadow: 0 18px 52px rgba(15, 23, 42, .09);
}

.band {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(250, 253, 255, .96)),
    var(--surface);
}

.filter-panel {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
}

.filter-field input,
.filter-field select,
input,
select,
textarea {
  border-color: rgba(120, 137, 158, .45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .84);
}

.btn,
.tab,
.mini-link {
  min-width: 0;
  white-space: nowrap;
}

.btn {
  min-height: 42px;
  padding: 0 16px;
}

.table-wrap,
.excel-scroll,
.combo-chart,
.classic-chart-panel,
.mini-chart-card {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.table-wrap::after,
.excel-shell::after {
  content: "Прокрутите таблицу в сторону";
  display: none;
  padding: 8px 12px 10px;
  color: var(--muted);
  font-size: 12px;
}

.classic-kpi-grid {
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(19, 163, 127, .055), transparent 46%),
    #f8fcfa;
}

.classic-kpi {
  background: rgba(255, 255, 255, .55);
}

.classic-chart-panel,
.mini-chart-card {
  overflow-x: auto;
}

.mini-chart-card svg {
  min-width: 560px;
}

.lead-chart-panel svg {
  min-width: 820px;
}

.form {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  align-items: start;
}

.form p {
  min-width: 0;
}

.form p:has(textarea),
.form-actions {
  grid-column: 1 / -1;
}

.danger-zone .band-header {
  align-items: center;
}

.login-box .form {
  grid-template-columns: 1fr;
  max-width: none;
}

.login-box .form p,
.login-box .form button {
  grid-column: 1;
}

.login-box input {
  width: 100%;
}

.mobile-menu-toggle,
.mobile-menu-button {
  display: none;
}

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

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

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

  .filter-form {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .filter-actions {
    grid-column: 1 / -1;
  }

  .executive-kpis,
  .kpis {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .classic-kpi-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
}

@media (max-width: 900px) {
  .layout {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: auto;
    padding: 12px 12px 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 16px 40px rgba(9, 17, 31, .22);
  }

  .sidebar::after {
    opacity: .24;
  }

  .brand {
    padding: 0 0 10px;
    border-bottom: 0;
    grid-column: 1;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-title {
    font-size: 14px;
  }

  .brand-subtitle {
    display: none;
  }

  .mobile-menu-button {
    grid-column: 2;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    padding: 0 14px;
    background: rgba(255, 255, 255, .12);
    color: #ffffff;
    font-size: 13px;
    font-weight: 820;
    cursor: pointer;
  }

  .mobile-menu-toggle:checked + .mobile-menu-button {
    background: linear-gradient(135deg, var(--blue), var(--green));
    border-color: rgba(255, 255, 255, .28);
  }

  .nav {
    grid-column: 1 / -1;
    display: none;
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 10px 0 0;
    border-top: 1px solid rgba(255, 255, 255, .12);
    max-height: min(68vh, 560px);
    overflow-y: auto;
  }

  .nav a {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    justify-content: space-between;
  }

  .nav a::after {
    display: none;
  }

  .nav a.active {
    box-shadow: inset 3px 0 0 var(--cyan);
    background: rgba(255, 255, 255, .18);
  }

  .mobile-menu-toggle:checked ~ .nav {
    display: grid;
  }

  .sidebar-foot {
    grid-column: 1 / -1;
    display: none;
    margin-top: 0;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, .12);
  }

  .mobile-menu-toggle:checked ~ .sidebar-foot {
    display: grid;
  }

  .sidebar-foot div:not(.status-pill),
  .sidebar-foot form {
    display: block;
  }

  .status-pill {
    min-height: 28px;
    padding: 5px 8px;
    font-size: 11px;
  }

  .topbar {
    position: static;
    padding: 16px 14px;
    gap: 12px;
    background: rgba(248, 251, 255, .96);
  }

  h1 {
    font-size: 22px;
  }

  .content {
    padding: 14px;
    gap: 14px;
  }

  .band,
  .hero-panel,
  .filter-panel,
  .insight-panel {
    padding: 14px;
  }

  .band-header,
  .panel-head,
  .danger-zone .band-header {
    display: grid;
    gap: 12px;
  }

  .actions,
  .topbar .actions,
  .report-tabs,
  .form-actions,
  .filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .actions .btn,
  .report-tabs .btn,
  .form-actions .btn,
  .filter-actions .btn,
  .danger-zone .btn {
    width: 100%;
  }

  .filter-form,
  .form,
  .form-grid,
  .form-grid.compact,
  .instruction-grid,
  .schema,
  .grid-2,
  .executive-hero,
  .executive-grid,
  .executive-grid.three,
  .classic-chart-grid {
    grid-template-columns: 1fr;
  }

  .filter-actions,
  .form p:has(textarea),
  .form-actions {
    grid-column: auto;
  }

  .kpis,
  .executive-kpis,
  .executive-signals,
  .classic-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .executive-hero {
    min-height: 0;
  }

  .executive-hero h2 {
    font-size: 28px;
  }

  .table-wrap::after,
  .excel-shell::after {
    display: block;
  }

  table {
    min-width: 720px;
  }

  .matrix-table,
  .excel-report {
    min-width: 1040px;
  }

  .excel-report .source-head,
  .excel-report .source-group {
    min-width: 112px;
  }

  .excel-report .metric-head,
  .excel-report .metric-label {
    left: 112px;
    min-width: 190px;
  }

  .period-matrix th.metric-head,
  .period-matrix td.metric-label {
    left: 112px;
  }

  .matrix-table th:first-child,
  .matrix-table td:first-child {
    min-width: 112px;
  }

  .matrix-table th:nth-child(2),
  .matrix-table td:nth-child(2) {
    left: 112px;
    min-width: 190px;
  }

  .classic-kpi {
    min-height: 118px;
  }

  .mapping-action-card {
    grid-template-columns: 1fr;
  }

  .classic-kpi-value,
  .metric-value,
  .kpi-value {
    font-size: 26px;
  }

  .chart-value {
    font-size: 11px;
  }
}

@media (max-width: 560px) {
  .topbar .actions,
  .actions,
  .report-tabs,
  .form-actions,
  .filter-actions,
  .kpis,
  .executive-kpis,
  .executive-signals,
  .classic-kpi-grid,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .topbar .actions .btn {
    justify-content: center;
  }

  h1 {
    font-size: 20px;
  }

  h2 {
    font-size: 16px;
  }

  .subtitle,
  .hint {
    font-size: 12px;
  }

  .content {
    padding: 10px;
  }

  .band,
  .hero-panel,
  .filter-panel,
  .insight-panel,
  .classic-chart-panel,
  .mini-chart-card {
    padding: 12px;
  }

  .btn {
    min-height: 42px;
  }

  .tab {
    min-height: 36px;
  }

  .filter-field label,
  .kpi-label,
  .metric-label,
  .classic-kpi-label {
    font-size: 11px;
  }

  .form label {
    font-size: 13px;
  }

  input,
  select,
  textarea {
    min-height: 44px;
    font-size: 16px;
  }

  .classic-kpi {
    min-height: 108px;
  }

  .mapping-action-panel,
  .mapping-action-card,
  .field-summary-card,
  .raw-source-details {
    padding: 12px;
  }

  .mapping-action-copy strong {
    font-size: 22px;
  }

  .classic-kpi-value,
  .metric-value,
  .kpi-value {
    font-size: 25px;
  }

  .lead-chart-panel svg {
    min-width: 720px;
  }

  .mini-chart-card:not(.premium-line-card) svg {
    min-width: 520px;
  }

  .chart-value {
    display: none;
  }

  .premium-line-card .chart-date {
    font-size: 18px;
    font-weight: 850;
  }

  .premium-line-card .chart-line.dark {
    stroke-width: 5;
  }

  .premium-line-card .chart-dot.dark {
    r: 6px;
  }

  .chart-legend {
    justify-content: flex-start;
    gap: 10px;
    font-size: 12px;
  }
}
