: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);
  transition: grid-template-columns .22s ease;
}

.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;
  transition: opacity .2s ease, transform .22s ease, padding .22s ease, border-color .22s ease;
}

.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);
}

.load-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 820;
}

.load-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.load-badge.loaded {
  border-color: rgba(22, 163, 74, .28);
  background: #ecfdf3;
  color: #166534;
}

.load-badge.loaded::before {
  background: #16a34a;
}

.load-badge.ready,
.load-badge.partial {
  border-color: rgba(245, 158, 11, .35);
  background: #fffbeb;
  color: #92400e;
}

.load-badge.ready::before,
.load-badge.partial::before {
  background: #f59e0b;
}

.load-badge.review {
  border-color: rgba(37, 99, 235, .28);
  background: #eff6ff;
  color: #1d4ed8;
}

.load-badge.review::before,
.load-badge.running::before {
  background: #2563eb;
}

.load-badge.running {
  border-color: rgba(37, 99, 235, .28);
  background: #eff6ff;
  color: #1d4ed8;
}

.load-badge.failed {
  border-color: rgba(224, 82, 82, .35);
  background: var(--red-soft);
  color: #b4232b;
}

.load-badge.failed::before {
  background: #e05252;
}

.load-badge.idle {
  border-color: #dbe3ec;
  background: #f8fafc;
  color: #64748b;
}

.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);
}

.topbar-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-title {
  min-width: 0;
}

.sidebar-toggle {
  width: 42px;
  min-width: 42px;
  height: 42px;
  border: 1px solid rgba(120, 137, 158, .42);
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(246, 249, 252, .94));
  color: #0f172a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}

.sidebar-toggle:hover {
  border-color: rgba(37, 99, 235, .48);
  box-shadow: 0 14px 30px rgba(37, 99, 235, .14);
  transform: translateY(-1px);
}

.sidebar-toggle-icon {
  display: block;
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
  transform: translateX(-1px);
  transition: transform .18s ease;
}

.sidebar-toggle-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

html.sidebar-collapsed .layout {
  grid-template-columns: 0 minmax(0, 1fr);
}

html.sidebar-collapsed .sidebar {
  padding-left: 0;
  padding-right: 0;
  border-right-color: transparent;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-100%);
}

html.sidebar-collapsed .sidebar-toggle-icon {
  transform: translateX(1px) rotate(180deg);
}

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;
}

.quick-filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(0, 2fr);
  gap: 14px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.quick-filter-groups {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 14px;
}

.quick-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.quick-filter-group > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.quick-filter-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .055);
}

.quick-filter-chip:hover {
  border-color: rgba(37, 99, 235, .38);
  background: var(--blue-soft);
}

.quick-filter-chip.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #fff;
}

.city-pair-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, .45fr) minmax(360px, 1.2fr);
  gap: 12px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(19, 163, 127, .08), transparent 48%),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.city-pair-info {
  display: grid;
  gap: 4px;
}

.city-pair-fixed {
  min-height: 64px;
  display: grid;
  gap: 5px;
  align-content: center;
  border: 1px solid rgba(19, 163, 127, .24);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--green-soft);
}

.city-pair-fixed span {
  color: #0f766e;
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.city-pair-fixed strong {
  color: #075347;
  font-size: 16px;
}

.city-pair-form {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

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

.table-list-filter {
  grid-template-columns: minmax(260px, 1fr) minmax(210px, .7fr) auto;
  max-width: 820px;
  margin: 2px 0 10px;
}

.table-filter-summary {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.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 > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.section-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 860;
}

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

.combo-select {
  position: relative;
  min-width: 0;
}

.combo-select-control {
  min-width: 0;
}

.combo-select-input {
  width: 100%;
  min-height: 38px;
  padding: 8px 34px 8px 10px;
  border: 1px solid rgba(149, 164, 190, .64);
  border-radius: 8px;
  background:
    linear-gradient(45deg, transparent 50%, #64748b 50%) calc(100% - 17px) 16px / 7px 7px no-repeat,
    linear-gradient(135deg, #64748b 50%, transparent 50%) calc(100% - 12px) 16px / 7px 7px no-repeat,
    rgba(255, 255, 255, .86);
  color: var(--text);
  font: inherit;
}

.combo-select-multiple .combo-select-control {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  min-height: 38px;
  padding: 4px 34px 4px 6px;
  border: 1px solid rgba(149, 164, 190, .64);
  border-radius: 8px;
  background:
    linear-gradient(45deg, transparent 50%, #64748b 50%) calc(100% - 17px) 16px / 7px 7px no-repeat,
    linear-gradient(135deg, #64748b 50%, transparent 50%) calc(100% - 12px) 16px / 7px 7px no-repeat,
    rgba(255, 255, 255, .86);
}

.combo-select-multiple .combo-select-input {
  flex: 1 1 120px;
  width: auto;
  min-width: 90px;
  min-height: 28px;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.combo-select-input:focus {
  border-color: rgba(37, 99, 235, .58);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
  outline: none;
}

.combo-select-multiple .combo-select-control:focus-within {
  border-color: rgba(37, 99, 235, .58);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.combo-select-multiple .combo-select-input:focus {
  box-shadow: none;
}

.combo-select-input::placeholder {
  color: rgba(100, 116, 139, .72);
  opacity: 1;
}

.combo-select-chips {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.combo-select-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid rgba(20, 184, 166, .26);
  border-radius: 999px;
  background: rgba(20, 184, 166, .10);
  color: #0f766e;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 760;
}

.combo-select-chip span {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.combo-native-select {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  width: 1px !important;
  height: 1px;
  min-height: 0 !important;
  overflow: hidden;
}

.combo-select-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  display: none;
  max-height: 260px;
  overflow: auto;
  padding: 5px;
  border: 1px solid rgba(149, 164, 190, .72);
  border-radius: 8px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 18px 36px rgba(15, 23, 42, .16);
}

.combo-select.open .combo-select-menu {
  display: grid;
  gap: 2px;
}

.combo-select-option {
  width: 100%;
  min-height: 32px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.combo-select-option.multi {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
}

.combo-select-option.multi::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 1px solid rgba(100, 116, 139, .48);
  border-radius: 4px;
  background: rgba(255, 255, 255, .9);
}

.combo-select-option.multi.selected::before {
  border-color: #0f766e;
  background:
    linear-gradient(135deg, transparent 0 38%, #fff 39% 52%, transparent 53%),
    linear-gradient(45deg, transparent 0 46%, #fff 47% 60%, transparent 61%),
    #0f766e;
}

.combo-select-option:hover,
.combo-select-option.active {
  background: rgba(37, 99, 235, .10);
}

.combo-select-option.selected {
  color: #0f766e;
  font-weight: 800;
}

.combo-select-reset {
  color: var(--muted);
}

.combo-select-option.hidden,
.combo-select-option[hidden] {
  display: none !important;
}

.combo-select-group {
  padding: 7px 9px 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
  text-transform: uppercase;
}

.combo-select-empty {
  padding: 9px;
  color: var(--muted);
  font-size: 12px;
}

.combo-select-done {
  position: sticky;
  bottom: 0;
  width: 100%;
  min-height: 34px;
  margin-top: 4px;
  border: 1px solid rgba(20, 184, 166, .36);
  border-radius: 6px;
  background: linear-gradient(135deg, #16275d, #1d64d8 58%, #14a789);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 820;
}

.combo-select-done:hover {
  filter: brightness(1.04);
}

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

.advanced-filters {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(248, 251, 255, .78);
}

.advanced-filters summary {
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 820;
}

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

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
  background: rgba(255, 255, 255, .74);
}

.checkbox-control {
  width: auto !important;
}

.saved-filter-panel {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: grid;
  gap: 10px;
}

.saved-filter-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

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

.saved-filter-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .76);
}

.saved-filter-item.active {
  border-color: rgba(36, 96, 220, .38);
  background: rgba(36, 96, 220, .08);
}

.saved-filter-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.saved-filter-item form {
  margin: 0;
}

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

.saved-filter-edit-form {
  border: 1px solid rgba(37, 99, 235, .22);
  border-radius: 8px;
  padding: 10px;
  background: rgba(37, 99, 235, .045);
}

.custom-filter-builder {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.custom-filter-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.custom-filter-rows {
  display: grid;
  gap: 8px;
}

.custom-filter-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(150px, .7fr) minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.custom-filter-row .btn {
  box-shadow: none;
}

.raw-filter-row {
  grid-template-columns: minmax(260px, 1.4fr) minmax(220px, 1fr) auto;
}

.uon-raw-advanced .hint {
  margin-top: 6px;
}

.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;
}

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

.compact-filter {
  min-width: 150px;
}

.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;
}

.recommended-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.recommended-report-card,
.recommended-report-mini {
  color: inherit;
  text-decoration: none;
}

.recommended-report-card {
  min-height: 260px;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(20, 184, 166, .075), transparent 44%),
    var(--surface);
  box-shadow: var(--shadow-soft);
  display: grid;
  align-content: space-between;
  gap: 14px;
}

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

.report-card-top {
  display: grid;
  gap: 10px;
}

.report-card-top strong {
  font-size: 20px;
  line-height: 1.15;
}

.report-card-body {
  display: grid;
  gap: 10px;
  color: var(--text);
}

.report-card-body p,
.report-card-foot span,
.recommended-report-mini em {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-style: normal;
}

.report-card-foot {
  display: grid;
  gap: 12px;
}

.report-card-foot em {
  color: var(--blue);
  font-style: normal;
  font-weight: 850;
}

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

.recommended-report-mini {
  min-height: 132px;
  border-radius: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(248, 251, 255, .82);
  display: grid;
  align-content: start;
  gap: 8px;
  box-shadow: var(--shadow-soft);
}

.recommended-report-mini span {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 9px;
  color: #0f766e;
  background: rgba(20, 184, 166, .12);
  font-size: 11px;
  font-weight: 850;
}

.recommended-report-mini strong {
  font-size: 16px;
  line-height: 1.2;
}

.visual-builder {
  gap: 18px;
}

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

.visual-controls label {
  display: grid;
  gap: 8px;
}

.visual-controls span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.visual-summary {
  color: var(--muted);
  line-height: 1.45;
}

.visual-chart {
  min-height: 400px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(145deg, rgba(37, 99, 235, .045), transparent 48%),
    rgba(255, 255, 255, .88);
  overflow-x: auto;
}

.visual-chart svg {
  width: 100%;
  min-width: 760px;
  height: auto;
}

.chart-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.chart-value {
  fill: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.chart-axis {
  stroke: rgba(100, 113, 132, .35);
  stroke-width: 1;
}

.pie-layout {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(260px, 1fr);
  gap: 24px;
  align-items: center;
}

.pie-chart {
  width: min(320px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: inset 0 0 0 14px rgba(255, 255, 255, .72), var(--shadow-soft);
}

.pie-legend {
  display: grid;
  gap: 8px;
}

.pie-legend-row {
  min-height: 34px;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}

.pie-legend-row i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.pie-legend-row strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.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;
}

.safety-note {
  margin: 14px 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(132, 204, 22, .34);
  border-radius: 8px;
  background: rgba(132, 204, 22, .12);
  color: #f8fbff;
  font-size: 13px;
  line-height: 1.5;
}

.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;
}

.matrix-drilldown {
  display: inline-flex;
  justify-content: flex-end;
  min-width: 54px;
  color: var(--blue);
  font-weight: 820;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.matrix-drilldown:hover {
  color: #0f172a;
}

.table-note {
  max-width: 280px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

.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;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 12px;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(37, 99, 235, .22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(241, 247, 255, .94)),
    var(--surface-soft);
  color: #163f8f;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .10);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}

.mini-link:hover {
  border-color: rgba(37, 99, 235, .42);
  background:
    linear-gradient(180deg, #ffffff, #eef5ff),
    var(--surface-soft);
  box-shadow: 0 12px 26px rgba(37, 99, 235, .16);
  transform: translateY(-1px);
}

.mini-link:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(37, 99, 235, .12);
}

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

.audit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.audit-actions form {
  display: inline-flex;
  margin: 0;
}

.button-link {
  cursor: pointer;
  font: inherit;
}

.muted-action {
  color: #52647c;
  background: #f7f9fc;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.top-pagination {
  margin-top: 0;
  margin-bottom: 12px;
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.two-column-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

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

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

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.loaded {
  color: #126c46;
  background: #e8fff5;
  border-color: #b8ead3;
}

.status-badge.idle {
  color: #52647c;
  background: #f5f8fc;
  border-color: #d7e0ec;
}

.status-badge.warning {
  color: #9a4f00;
  background: #fff7e7;
  border-color: #ffd89a;
}

.status-badge.error {
  color: #a11f2b;
  background: #fff0f2;
  border-color: #f3b8c0;
}

.muted-small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.raw-json {
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

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

.relationship-node {
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.relationship-node strong {
  font-size: 20px;
  color: var(--ink);
}

.relationship-node span,
.node-label {
  color: var(--muted);
}

.node-label {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.subsection-title {
  margin: 22px 0 10px;
  font-size: 17px;
}

.compact-table {
  margin-bottom: 8px;
}

.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.success-action {
  border-color: rgba(13, 148, 136, .72);
  background: linear-gradient(135deg, #0f766e, #10b981 56%, #7ddf64);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(16, 185, 129, .22);
}

.btn.success-action:hover {
  border-color: rgba(5, 150, 105, .86);
  background: linear-gradient(135deg, #0d6b64, #059669 56%, #8be56f);
  box-shadow: 0 18px 40px rgba(16, 185, 129, .28);
}

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

.btn.compact {
  min-height: 36px;
  padding: 0 10px;
  font-size: 12px;
}

.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;
}

.mw-extra-entry {
  max-width: 900px;
}

.form.mw-extra-entry-form {
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
}

.mw-extra-entry-context,
.mw-extra-entry-services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mw-extra-entry-context > p,
.mw-extra-entry-service p {
  min-width: 0;
}

.mw-extra-entry-service {
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.mw-extra-entry-service legend {
  padding: 0 5px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.mw-extra-entry-service.is-transfer {
  border-top: 3px solid #3b82f6;
}

.mw-extra-entry-service.is-insurance {
  border-top: 3px solid #22a36b;
}

.mw-extra-entry-service .form-grid {
  gap: 12px;
}

.mw-extra-entry-state {
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
}

.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);
}

.message.error {
  background: var(--red-soft);
  color: #991b1b;
  border-color: rgba(224, 82, 82, .28);
}

.message.warning {
  background: var(--gold-soft);
  color: #78350f;
  border-color: rgba(245, 158, 11, .32);
}

.message.info {
  background: var(--blue-soft);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, .24);
}

.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-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.metric-card-link {
  color: inherit;
  text-decoration: none;
}

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

.metric-card.active {
  border-color: rgba(37, 99, 235, .55);
  box-shadow: var(--glow);
}

#bridges-table,
#excel-audit {
  scroll-margin-top: 18px;
}

.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-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.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;
  align-items: start;
}

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

.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;
  align-content: start;
}

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

.panel-head > .mini-link {
  flex: 0 0 auto;
  margin-top: 2px;
}

.executive-grid.three .panel-head {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 10px;
}

.executive-grid.three .panel-head > div {
  min-width: 0;
}

.executive-grid.three .panel-head .mini-link {
  margin-left: 0;
  white-space: normal;
}

.executive-grid.three .panel-action-link {
  width: fit-content;
  min-width: 156px;
  min-height: 36px;
  padding: 0 14px;
  border-color: rgba(24, 197, 217, .34);
  background:
    linear-gradient(135deg, rgba(24, 197, 217, .12), rgba(37, 99, 235, .10)),
    #f8fbff;
  color: #0f3f77;
  box-shadow: none;
}

.executive-grid.three .panel-action-link:hover {
  border-color: rgba(37, 99, 235, .48);
  background:
    linear-gradient(135deg, rgba(24, 197, 217, .18), rgba(37, 99, 235, .14)),
    #ffffff;
}

.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); }

.plans-shell {
  display: grid;
  gap: 18px;
}

.plans-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.plans-tabs,
.schedule-actions,
.pf-asof-switcher,
.month-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pf-asof-switcher {
  margin-right: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
}

.pf-asof-switcher .mini-link.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .20);
}

.month-switcher {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.month-switcher strong {
  min-width: 76px;
  text-align: center;
  font-size: 15px;
}

.plan-table-wrap,
.schedule-table-wrap,
.plan-days-wrap {
  overflow-x: auto;
}

.plan-table,
.schedule-table,
.plan-days {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.plan-table th,
.plan-table td,
.schedule-table th,
.schedule-table td,
.plan-days th,
.plan-days td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: middle;
}

.plan-table th,
.schedule-table th,
.plan-days th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: rgba(241, 245, 249, .72);
}

.plan-input {
  width: 118px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  font: inherit;
  font-weight: 760;
  color: var(--text);
  background: #fff;
}

.plan-calculated,
.schedule-total {
  font-weight: 860;
  color: #0f766e;
  font-variant-numeric: tabular-nums;
}

.plan-not-applicable,
.pf-not-applicable {
  color: #8a96af !important;
  font-weight: 850;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
}

.schedule-panel {
  padding: 14px;
}

.schedule-table {
  min-width: 1120px;
}

.schedule-name {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 190px;
  background: #fff;
}

.schedule-table th:not(.schedule-name),
.schedule-table td:not(.schedule-name) {
  width: 42px;
  min-width: 42px;
  padding: 5px;
  text-align: center;
}

.schedule-table th span,
.plan-days th span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  text-transform: lowercase;
}

.schedule-cell label {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, .22);
  cursor: pointer;
  color: var(--muted);
  background: rgba(248, 250, 252, .78);
  transition: background .14s ease, border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}

.schedule-cell input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.schedule-cell label:hover {
  border-color: rgba(37, 99, 235, .38);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
  transform: translateY(-1px);
}

.schedule-cell-mark {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .55);
}

.schedule-cell-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.schedule-cell.working label {
  color: #065f46;
  background: linear-gradient(135deg, rgba(20, 184, 166, .22), rgba(132, 204, 22, .22));
  border-color: rgba(20, 184, 166, .38);
  font-weight: 900;
}

.schedule-cell.working .schedule-cell-mark {
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #14b8a6, #22c55e);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .13);
}

.schedule-cell.weekend,
.schedule-table th.weekend,
.plan-days th.weekend {
  background: rgba(248, 113, 113, .16);
}

.schedule-cell.weekend:not(.working) label {
  background: rgba(255, 241, 242, .72);
}

.plan-group-title {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
}

.plan-fact-card {
  gap: 14px;
}

.plan-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}

.plan-metric {
  display: grid;
  gap: 4px;
  min-height: 104px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.plan-metric strong {
  font-size: 25px;
  line-height: 1;
}

.plan-metric em,
.plan-metric small {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 760;
}

.plan-metric.good {
  border-color: rgba(16, 185, 129, .32);
  background: linear-gradient(135deg, rgba(16, 185, 129, .12), #fff 55%);
}

.plan-metric.warn {
  border-color: rgba(245, 158, 11, .32);
  background: linear-gradient(135deg, rgba(245, 158, 11, .14), #fff 55%);
}

.plan-metric.bad {
  border-color: rgba(239, 68, 68, .28);
  background: linear-gradient(135deg, rgba(239, 68, 68, .12), #fff 55%);
}

.plan-days {
  min-width: 1180px;
}

.plan-days th,
.plan-days td {
  min-width: 42px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.plan-days th:first-child,
.plan-days td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 110px;
  text-align: left;
  background: #fff;
  font-weight: 860;
}

.plan-days th.working {
  background: rgba(20, 184, 166, .14);
}

.pf-dashboard {
  --pf-text: #1f2d50;
  --pf-muted: #6f7c99;
  --pf-line: #e9eef6;
  --pf-soft: #f7f9fd;
  --pf-blue: #1677ff;
  --pf-green: #18a84f;
  --pf-orange: #ff6a1a;
  --pf-purple: #6124db;
  --pf-red: #ff3b3b;
  --pf-shadow: 0 8px 26px rgba(31, 45, 80, .06);
  color: var(--pf-text);
}

.pf-toolbar {
  margin-bottom: -2px;
}

.pf-card {
  min-width: 0;
  border: 1px solid var(--pf-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--pf-shadow);
}

.pf-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
}

.pf-kpi {
  position: relative;
  display: grid;
  gap: 18px;
  min-height: 176px;
  padding: 20px 132px 22px 24px;
}

.pf-kpi-title {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 15px;
  font-weight: 900;
}

.pf-kpi-icon {
  position: relative;
  width: 23px;
  height: 23px;
  border-radius: 8px;
  background: currentColor;
  opacity: .16;
}

.pf-kpi-icon::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: #fff;
}

.pf-kpi-line {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.pf-kpi-line strong {
  color: currentColor;
  font-size: 36px;
  line-height: 1;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.pf-kpi-line span {
  color: var(--pf-text);
  min-width: 0;
  font-size: 13px;
  line-height: 1.18;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.pf-kpi-line em {
  position: absolute;
  top: 76px;
  right: 24px;
  display: grid;
  min-width: 108px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 59, 59, .08);
  color: var(--pf-red);
  text-align: center;
  font-size: 16px;
  line-height: 1.05;
  font-style: normal;
  font-weight: 950;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pf-kpi-line em small {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 900;
}

.pf-kpi-line em.is-good {
  color: #12a150;
  background: rgba(18, 161, 80, .1);
}

.pf-progress {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9edf5;
}

.pf-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: currentColor;
}

.pf-kpi-foot {
  color: #5c6b8d;
  font-size: 13px;
  font-weight: 900;
}

.pf-tone-blue { color: var(--pf-blue); }
.pf-tone-green { color: var(--pf-green); }
.pf-tone-orange { color: var(--pf-orange); }
.pf-tone-purple { color: var(--pf-purple); }

.pf-grid {
  display: grid;
  gap: 14px;
}

.pf-grid-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.pf-table-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px 18px 18px;
}

.pf-table-card h2 {
  margin: 0;
  color: var(--pf-text);
  font-size: 18px;
  line-height: 1.1;
  font-weight: 950;
}

.pf-table-scroll {
  overflow-x: auto;
}

.pf-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--pf-text);
  font-size: 13px;
  font-weight: 760;
}

.pf-table th,
.pf-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--pf-line);
  text-align: left;
  vertical-align: middle;
}

.pf-grid-summary .pf-table th,
.pf-grid-summary .pf-table td {
  padding: 10px 8px;
  font-size: 12px;
}

.pf-grid-summary .pf-table thead th {
  overflow-wrap: normal;
  font-size: 10px;
  white-space: normal;
}

.pf-table thead th {
  color: #566481;
  font-size: 11px;
  font-weight: 900;
}

.pf-table tbody th {
  color: var(--pf-text);
  font-weight: 950;
}

.pf-table tbody tr:last-child th,
.pf-table tbody tr:last-child td {
  border-bottom: 0;
}

.pf-department-table th:first-child {
  width: 30%;
}

.pf-department-table th,
.pf-department-table td {
  overflow-wrap: anywhere;
  white-space: normal;
}

.pf-department-table td strong {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  line-height: 1.15;
  font-weight: 950;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.pf-percent {
  display: inline-flex;
  min-width: 54px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255, 59, 59, .08);
  color: var(--pf-red);
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.pf-percent.is-good {
  background: rgba(18, 161, 80, .11);
  color: #15944c;
}

.pf-percent.is-warn {
  background: rgba(255, 143, 31, .12);
  color: #f07418;
}

.pf-percent.is-bad {
  background: rgba(255, 59, 59, .08);
  color: var(--pf-red);
}

.pf-percent.is-neutral,
.pf-plan-missing {
  background: #eef2f7;
  color: #64718d;
  font-style: normal;
  font-weight: 850;
}

.pf-plan-missing {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 6px;
}

.pf-total-row th,
.pf-total-row td {
  background: #fbfcff;
  font-weight: 950;
}

.pf-rank {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid #ff6242;
  border-radius: 50%;
  color: #ff6242;
  font-size: 12px;
  line-height: 1;
  font-weight: 950;
}

.pf-department-table,
.pf-deviation-table {
  min-width: 100%;
  table-layout: fixed;
}

.pf-deviation-table td,
.pf-deviation-table th {
  padding-right: 7px;
  padding-left: 7px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.pf-deviation-table td {
  white-space: nowrap;
}

.pf-deviation-table th:nth-child(1) { width: 8%; }
.pf-deviation-table th:nth-child(2) { width: 30%; }
.pf-deviation-table th:nth-child(3) { width: 20%; }
.pf-deviation-table th:nth-child(4) { width: 24%; }
.pf-deviation-table th:nth-child(5) { width: 18%; }

.pf-deviation-table td:nth-child(4) {
  white-space: normal;
  line-height: 1.2;
}

.pf-delta {
  color: var(--pf-text);
  font-weight: 950;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pf-delta.is-bad {
  color: var(--pf-red);
}

.pf-delta.is-good {
  color: #129447;
}

.pf-empty {
  color: var(--pf-muted);
  text-align: center;
}

.pf-manager-card {
  padding: 15px 16px 18px;
}

.pf-manager-table {
  min-width: 1240px;
  table-layout: fixed;
}

.pf-manager-table th,
.pf-manager-table td {
  padding: 9px 10px;
  text-align: center;
  white-space: nowrap;
}

.pf-manager-table .pf-name-col {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 188px;
  min-width: 188px;
  background: #fff;
  text-align: left;
}

.pf-manager-table thead .pf-name-col {
  z-index: 5;
  background: #fff;
}

.pf-manager-table .pf-metric-head {
  position: relative;
  border-left: 2px solid #e1e8f3 !important;
  text-align: center;
  font-size: 14px;
  font-weight: 950;
  text-transform: uppercase;
}

.pf-manager-table .pf-metric-head.pf-tone-blue {
  color: var(--pf-blue) !important;
}

.pf-manager-table .pf-metric-head.pf-tone-green {
  color: var(--pf-green) !important;
}

.pf-manager-table .pf-metric-head.pf-tone-orange {
  color: var(--pf-orange) !important;
}

.pf-manager-table .pf-metric-head.pf-tone-purple {
  color: var(--pf-purple) !important;
}

.pf-manager-table .pf-metric-head::after {
  content: "";
  position: absolute;
  right: 20px;
  bottom: 0;
  left: 20px;
  height: 1px;
  background: #dfe7f2;
}

.pf-manager-table .pf-manager-block-start {
  border-left: 2px solid #e1e8f3 !important;
}

.pf-manager-table thead tr:nth-child(2) .pf-manager-block-start {
  border-left-color: #e1e8f3 !important;
}

.pf-manager-table .pf-group-row th {
  position: static;
  background: #fff;
  color: var(--pf-blue);
  text-align: left;
  font-size: 15px;
  text-transform: uppercase;
}

.pf-manager-table .pf-total-row .pf-name-col {
  background: #fbfcff;
}

.pf-weekly-sprint,
.pf-sprint-section {
  margin-top: 14px;
}

.pf-weekly-sprint {
  display: grid;
  gap: 16px;
  padding: 18px 20px;
}

.pf-sprint-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.pf-sprint-header h2,
.pf-sprint-section h2 {
  margin: 0;
  color: var(--pf-text);
  font-size: 18px;
  line-height: 1.15;
  font-weight: 950;
  letter-spacing: 0;
}

.pf-sprint-header p {
  margin: 8px 0 0;
  color: #63708f;
  font-size: 13px;
  font-weight: 850;
}

.pf-sprint-target {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--pf-text);
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.pf-sprint-toggle {
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid var(--pf-line);
  border-radius: 7px;
  background: #fff;
  color: #5d6a87;
  font: inherit;
  font-weight: 900;
  box-shadow: 0 4px 14px rgba(31, 45, 80, .04);
}

.pf-sprint-toggle.is-active {
  border-color: var(--pf-blue);
  background: var(--pf-blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(22, 119, 255, .22);
}

.pf-sprint-toggle:disabled {
  color: #a1acc2;
}

.pf-sprint-cards {
  display: grid;
  grid-template-columns: minmax(158px, .62fr) repeat(4, minmax(170px, 1fr));
  gap: 12px;
}

.pf-sprint-days-card,
.pf-sprint-metric {
  min-width: 0;
  border: 1px solid var(--pf-line);
  border-radius: 8px;
  background: #fff;
}

.pf-sprint-days-card {
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 16px 18px;
}

.pf-sprint-days-card h3,
.pf-sprint-metric h3 {
  margin: 0;
  color: var(--pf-text);
  font-size: 16px;
  line-height: 1.15;
  font-weight: 950;
}

.pf-sprint-days-card span,
.pf-sprint-metric span,
.pf-sprint-metric p {
  color: #5f6e91;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 850;
}

.pf-sprint-days-card strong {
  color: var(--pf-text);
  font-size: 24px;
  line-height: 1;
  font-weight: 950;
}

.pf-sprint-day-breakdown {
  display: grid;
  gap: 10px;
}

.pf-sprint-day-breakdown span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.pf-sprint-day-breakdown strong {
  font-size: 22px;
}

.pf-sprint-metric {
  display: grid;
  gap: 10px;
  min-height: 136px;
  padding: 16px 18px 14px;
}

.pf-sprint-metric h3,
.pf-sprint-metric-line strong {
  color: currentColor;
}

.pf-sprint-metric-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.pf-sprint-metric-line strong {
  font-size: clamp(24px, 2.2vw, 32px);
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pf-sprint-metric-line em {
  color: var(--pf-text);
  font-size: clamp(11px, .9vw, 13px);
  line-height: 1.2;
  font-style: normal;
  font-weight: 950;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pf-sprint-metric p {
  margin: 0;
}

.pf-sprint-section {
  display: grid;
  gap: 12px;
  padding: 16px 20px 18px;
}

.pf-sprint-department-table {
  min-width: 1160px;
  table-layout: fixed;
}

.pf-sprint-manager-table {
  min-width: 1280px;
  table-layout: fixed;
}

.pf-sprint-department-table th,
.pf-sprint-department-table td,
.pf-sprint-manager-table th,
.pf-sprint-manager-table td {
  padding: 13px 14px;
  border-color: #e8eef7;
  text-align: center;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.pf-sprint-department-table thead th,
.pf-sprint-manager-table thead th {
  background: #fff;
  white-space: normal;
  line-height: 1.12;
}

.pf-sprint-department-table tbody th,
.pf-sprint-manager-table tbody th {
  text-align: left;
  font-weight: 950;
}

.pf-sprint-left-head {
  width: 190px;
  border-right: 1px solid #e8eef7;
  color: var(--pf-text);
  font-size: 16px !important;
  font-weight: 950 !important;
  text-align: left !important;
  vertical-align: top !important;
}

.pf-sprint-days-head,
.pf-sprint-days-col {
  width: 112px;
  border-right: 2px solid #e3eaf5 !important;
  color: var(--pf-text) !important;
  background: #fbfdff !important;
  text-align: center !important;
  vertical-align: middle !important;
  font-size: 12px !important;
  font-weight: 950 !important;
  line-height: 1.12 !important;
}

.pf-sprint-metric-head {
  position: relative;
  border-left: 2px solid #e1e8f3 !important;
  border-bottom-color: #dfe7f2;
  background: #fff;
  text-align: center !important;
  font-size: 15px !important;
  font-weight: 950 !important;
  text-transform: uppercase;
}

.pf-sprint-metric-head.pf-tone-blue {
  color: var(--pf-blue) !important;
}

.pf-sprint-metric-head.pf-tone-green {
  color: var(--pf-green) !important;
}

.pf-sprint-metric-head.pf-tone-orange {
  color: var(--pf-orange) !important;
}

.pf-sprint-metric-head.pf-tone-purple {
  color: var(--pf-purple) !important;
}

.pf-sprint-metric-head::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: 0;
  left: 22px;
  height: 1px;
  background: #dfe7f2;
}

.pf-sprint-department-table thead tr:nth-child(2) th,
.pf-sprint-manager-table thead tr:nth-child(2) th {
  color: #53617f;
  font-size: 11px;
  font-weight: 900;
}

.pf-sprint-subhead {
  color: #5f6c88 !important;
  text-align: center !important;
}

.pf-sprint-block-start {
  border-left: 2px solid #e1e8f3 !important;
}

.pf-sprint-cell {
  color: #243351;
  font-weight: 880;
}

.pf-sprint-need {
  font-size: 20px !important;
  font-weight: 950 !important;
}

.pf-sprint-need.pf-tone-blue {
  color: var(--pf-blue) !important;
}

.pf-sprint-need.pf-tone-green {
  color: var(--pf-green) !important;
}

.pf-sprint-need.pf-tone-orange {
  color: var(--pf-orange) !important;
}

.pf-sprint-need.pf-tone-purple {
  color: var(--pf-purple) !important;
}

.pf-sprint-days-cell {
  border-right: 2px solid #e3eaf5 !important;
  background: #fbfdff;
  color: var(--pf-text);
  text-align: center !important;
  font-weight: 950 !important;
}

.pf-sprint-department-table tbody th {
  color: var(--pf-blue);
  background: #fbfdff;
  border-right: 1px solid #e8eef7;
  text-transform: uppercase;
  white-space: normal;
  line-height: 1.1;
}

.pf-sprint-manager-card {
  padding-top: 17px;
}

.pf-sprint-manager-table .pf-sprint-dept-col {
  width: 130px;
  border-right: 1px solid #e8eef7;
  text-align: left;
}

.pf-sprint-manager-table .pf-sprint-name-col {
  width: 190px;
  border-right: 1px solid #e8eef7;
  text-align: left;
}

.pf-sprint-manager-table .pf-sprint-status-col {
  width: 122px;
  border-left: 2px solid #e1e8f3;
  text-align: center;
}

.pf-sprint-dept-name {
  color: var(--pf-blue) !important;
  background: #fbfdff !important;
  border-right: 1px solid #e8eef7;
  text-transform: uppercase;
  vertical-align: top !important;
  white-space: normal !important;
  line-height: 1.1;
}

.pf-sprint-group-start > th,
.pf-sprint-group-start > td {
  border-top: 2px solid #edf2f9;
}

.pf-sprint-manager-table tbody .pf-sprint-name-col {
  color: #243351;
  background: #fff;
}

.pf-sprint-department-table .pf-total-row th,
.pf-sprint-manager-table .pf-total-row th,
.pf-sprint-department-table .pf-total-row td,
.pf-sprint-manager-table .pf-total-row td {
  border-top: 2px solid #edf2f9;
}

.pf-sprint-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--pf-text);
  font-weight: 900;
}

.pf-sprint-status::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffc226;
  box-shadow: 0 0 0 3px rgba(255, 194, 38, .14);
}

.pf-sprint-status.is-good::before {
  background: #1fb65d;
  box-shadow: 0 0 0 3px rgba(31, 182, 93, .13);
}

.pf-sprint-status.is-bad::before {
  background: #ff2f3f;
  box-shadow: 0 0 0 3px rgba(255, 47, 63, .12);
}

.pf-sprint-total-status {
  color: #97a2b8;
  text-align: center !important;
}

@media (max-width: 1420px) {
  .pf-kpi-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
}

@media (max-width: 1700px) {
  .pf-grid-summary {
    grid-template-columns: 1fr;
  }
}

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

  .pf-kpi {
    padding: 17px;
  }

  .pf-kpi-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .pf-kpi-line strong {
    font-size: 34px;
  }

  .pf-kpi-line em {
    position: static;
    width: fit-content;
    min-width: 104px;
  }

  .pf-sprint-header {
    display: grid;
  }

  .pf-sprint-target {
    flex-wrap: wrap;
  }

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

  .pf-sprint-metric-line {
    display: grid;
    gap: 8px;
  }
}

@media (max-width: 560px) {
  .pf-sprint-cards {
    grid-template-columns: 1fr;
  }
}

.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;
  align-content: start;
}

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

.rank-row-link {
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  transition: background .16s ease, box-shadow .16s ease;
}

.rank-row-link:hover {
  background: rgba(37, 99, 235, .055);
  box-shadow: 0 0 0 8px rgba(37, 99, 235, .055);
}

.clickable-table-row {
  cursor: pointer;
}

.clickable-table-row:hover td {
  background: rgba(37, 99, 235, .045);
}

.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;
}

.classic-rank-title {
  align-items: flex-start;
}

.classic-rank-title strong {
  line-height: 1.2;
}

.classic-rank-title span,
.classic-rank-title .rank-text-link {
  flex: 0 0 auto;
  color: #07936f;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
  text-align: right;
}

.classic-rank-foot {
  align-items: flex-start;
}

.classic-rank-foot span,
.classic-rank-foot strong,
.classic-rank-foot a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 820;
  line-height: 1.25;
}

.classic-rank-foot strong,
.classic-rank-foot .rank-margin-link {
  flex: 0 0 auto;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rank-text-link,
.rank-foot-link,
.rank-margin-link {
  border-radius: 7px;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}

.rank-text-link:hover,
.rank-foot-link:hover,
.rank-margin-link:hover {
  color: #0f3f77;
  background: rgba(24, 197, 217, .10);
  box-shadow: 0 0 0 5px rgba(24, 197, 217, .10);
}

.source-rank-title {
  gap: 12px;
  align-items: flex-start;
}

.source-rank-title strong {
  line-height: 1.2;
}

.source-rank-title .rank-margin,
.department-rank-title .rank-margin {
  flex: 0 0 auto;
  min-width: 86px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(19, 163, 127, .10);
  color: #08725b;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.source-rank-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.source-rank-metrics span,
.source-rank-metrics a {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(143, 158, 177, .24);
  border-radius: 8px;
  background: rgba(248, 251, 255, .76);
}

.source-rank-metrics em,
.source-rank-metrics strong {
  display: block;
}

.source-rank-metrics em {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 760;
}

.source-rank-metrics strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.manager-rank-title span {
  color: #08725b;
}

.manager-rank-metrics a {
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.manager-rank-metrics a:hover {
  border-color: rgba(37, 99, 235, .30);
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .10);
  transform: translateY(-1px);
}

.manager-rank-metrics a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.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 {
  gap: 9px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.department-rank-title {
  align-items: flex-start;
}

.department-rank-title strong {
  line-height: 1.2;
}

.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;
}

.process-notice {
  margin-top: 16px;
  border-color: rgba(37, 99, 235, .28);
  background: rgba(228, 237, 255, .86);
  color: #1e3a8a;
}

.error-notice {
  margin-top: 16px;
  border-color: rgba(224, 82, 82, .32);
  background: rgba(255, 228, 228, .86);
  color: #991b1b;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 17, 31, .52);
  z-index: 1000;
}

.loading-overlay.visible {
  display: flex;
}

.loading-panel {
  width: min(520px, 100%);
  display: flex;
  gap: 16px;
  align-items: center;
  border-radius: 8px;
  border: 1px solid rgba(37, 99, 235, .22);
  background: #fff;
  padding: 20px;
  box-shadow: var(--shadow);
}

.loading-panel strong {
  display: block;
  font-size: 20px;
  margin-bottom: 6px;
}

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

.loading-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid var(--blue-soft);
  border-top-color: var(--blue);
  flex: 0 0 auto;
  animation: loading-spin .8s linear infinite;
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

.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;
}

.quick-create-box {
  display: grid;
  gap: 9px;
  margin-top: 6px;
  padding: 12px;
  border: 1px dashed rgba(37, 99, 235, .36);
  border-radius: 10px;
  background: rgba(239, 246, 255, .72);
}

.quick-create-box strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}

.quick-create-box span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.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) {
  .mw-extra-entry-context,
  .mw-extra-entry-services {
    grid-template-columns: 1fr;
  }

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

  .quick-filter-groups {
    justify-content: flex-start;
  }

  .city-pair-panel,
  .city-pair-form {
    grid-template-columns: 1fr;
  }

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

  .advanced-filter-grid,
  .saved-filter-form,
  .custom-filter-row {
    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,
  .recommended-report-strip,
  .visual-controls,
  .pie-layout {
    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;
  }

  .quick-filter-group {
    align-items: flex-start;
    flex-direction: column;
  }

  .advanced-filter-grid,
  .saved-filter-form,
  .custom-filter-row {
    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);
}

.instruction-band {
  background:
    linear-gradient(135deg, rgba(9, 17, 31, .98), rgba(20, 35, 59, .98)),
    var(--nav);
  color: #f8fbff;
}

.instruction-band .band-header h2,
.instruction-band .instruction-step strong {
  color: #f8fbff;
}

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

.instruction-band .instruction-step {
  border-color: rgba(255, 255, 255, .18);
  background:
    linear-gradient(145deg, rgba(24, 197, 217, .18), rgba(37, 99, 235, .08) 44%, rgba(255, 255, 255, .08)),
    rgba(255, 255, 255, .08);
}

.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-main {
    width: 100%;
  }

  .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));
  }

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

  .visual-controls {
    grid-template-columns: repeat(2, minmax(0, 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);
  }

  html.sidebar-collapsed .sidebar {
    display: none;
  }

  .sidebar-toggle {
    width: 38px;
    min-width: 38px;
    height: 38px;
  }

  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,
  .metric-grid.compact,
  .two-column-grid,
  .relationship-flow,
  .executive-kpis,
  .executive-signals,
  .classic-kpi-grid,
  .cards-grid,
  .visual-controls,
  .pie-layout {
    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;
  }
}

/* Plan-fact accepted layout refinements. Presentation only: no report logic changes. */
.pf-dashboard {
  max-width: 100%;
  overflow-x: hidden;
}

.pf-dashboard .pf-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(218px, 1fr));
  gap: 16px;
}

.pf-dashboard .pf-kpi {
  position: relative;
  min-height: 168px;
  padding: 20px 16px 18px;
  gap: 16px;
}

.pf-dashboard .pf-kpi-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  padding-right: 92px;
}

.pf-dashboard .pf-kpi-line strong {
  font-size: clamp(30px, 2.55vw, 36px);
}

.pf-dashboard .pf-kpi-line span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.pf-dashboard .pf-kpi-line em {
  position: absolute;
  top: 72px;
  right: 16px;
  min-width: 82px;
  max-width: 92px;
  padding: 8px 8px;
  font-size: 14px;
  white-space: normal;
}

.pf-dashboard .pf-grid-summary .pf-table thead th {
  background: #fff !important;
  border-bottom: 1px solid #dfe7f2;
  color: #5f6e91;
  font-size: 11px;
  line-height: 1.15;
  text-align: left;
}

.pf-dashboard .pf-grid-summary .pf-table tbody th {
  background: #fff !important;
  color: var(--pf-text);
}

.pf-dashboard .pf-grid-summary .pf-table tbody tr:nth-child(even):not(.pf-total-row) td,
.pf-dashboard .pf-grid-summary .pf-table tbody tr:nth-child(even):not(.pf-total-row) th {
  background: #fcfdff !important;
}

.pf-dashboard .pf-grid-summary .pf-table td {
  background: #fff;
}

.pf-dashboard .pf-grid-summary .pf-total-row th,
.pf-dashboard .pf-grid-summary .pf-total-row td {
  background: #fbfcff !important;
}

.pf-dashboard .pf-deviation-table td {
  text-align: right;
}

.pf-dashboard .pf-deviation-table th:first-child,
.pf-dashboard .pf-deviation-table td:first-child {
  text-align: center;
}

.pf-dashboard .pf-deviation-table thead th:nth-child(4),
.pf-dashboard .pf-deviation-table thead th:nth-child(5) {
  text-align: right;
}

.pf-dashboard .pf-department-table thead th:not(:first-child),
.pf-dashboard .pf-department-table tbody td {
  text-align: center;
}

.pf-dashboard .pf-sprint-department-table tbody td {
  text-align: center !important;
}

.pf-dashboard .pf-department-table th:first-child,
.pf-dashboard .pf-deviation-table th:nth-child(2),
.pf-dashboard .pf-deviation-table td:nth-child(3) {
  text-align: left;
}

.pf-dashboard .pf-manager-table thead th,
.pf-dashboard .pf-sprint-manager-table thead th,
.pf-dashboard .pf-sprint-department-table thead th {
  background: #fff !important;
}

.pf-dashboard .pf-manager-table .pf-group-row th {
  background: #fff !important;
  border-top: 2px solid #eef3fa;
  border-bottom: 1px solid #eef3fa;
  color: var(--pf-blue);
}

.pf-dashboard .pf-manager-table tbody tr:not(.pf-group-row):nth-child(even) td,
.pf-dashboard .pf-manager-table tbody tr:not(.pf-group-row):nth-child(even) th.pf-name-col {
  background: #fcfdff;
}

.pf-dashboard .pf-manager-table td,
.pf-dashboard .pf-sprint-manager-table td,
.pf-dashboard .pf-sprint-department-table td {
  text-align: right;
}

.pf-dashboard .pf-manager-table .pf-name-col,
.pf-dashboard .pf-sprint-manager-table .pf-sprint-name-col,
.pf-dashboard .pf-sprint-manager-table .pf-sprint-dept-col,
.pf-dashboard .pf-sprint-dept-name,
.pf-dashboard .pf-sprint-department-table tbody th {
  text-align: left !important;
}

.pf-dashboard .pf-manager-table .pf-name-col {
  box-sizing: border-box;
  width: 184px;
  min-width: 184px;
  max-width: 184px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-dashboard .pf-manager-table .pf-manager-block-start,
.pf-dashboard .pf-manager-table .pf-metric-head,
.pf-dashboard .pf-sprint-block-start,
.pf-dashboard .pf-sprint-metric-head {
  border-left-width: 2px !important;
  border-left-color: #dfe7f2 !important;
}

.pf-dashboard .pf-sprint-cards {
  grid-template-columns: minmax(128px, .52fr) repeat(4, minmax(210px, 1fr));
}

.pf-dashboard .pf-sprint-metric {
  overflow: hidden;
}

.pf-dashboard .pf-sprint-metric-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 6px;
}

.pf-dashboard .pf-sprint-metric-line strong,
.pf-dashboard .pf-sprint-metric-line em {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.pf-dashboard .pf-sprint-metric-line strong {
  font-size: clamp(24px, 2vw, 30px);
}

.pf-dashboard .pf-sprint-metric-line em {
  justify-self: start;
}

.pf-dashboard .pf-sprint-manager-table .pf-sprint-status-col,
.pf-dashboard .pf-sprint-manager-table tbody td:last-child,
.pf-dashboard .pf-sprint-manager-table .pf-total-row .pf-sprint-total-status {
  border-left: 2px solid #dfe7f2 !important;
}

.pf-dashboard .pf-sprint-manager-table .pf-sprint-status-col {
  background: #fff !important;
}

.pf-dashboard .pf-sprint-manager-table tbody td:last-child {
  text-align: center !important;
}

.pf-dashboard .pf-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.pf-dashboard .pf-grid-summary-scoped {
  grid-template-columns: minmax(0, 1fr);
}

.pf-dashboard .pf-scope-summary-card,
.pf-dashboard .pf-scoped-deviation-card {
  padding: 20px 22px 22px;
}

.pf-scope-summary-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.pf-scope-summary-heading h2 {
  margin-top: 5px;
  font-size: clamp(18px, 2vw, 23px);
}

.pf-scope-summary-heading p {
  margin: 0;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.pf-scope-eyebrow {
  color: var(--pf-blue);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.pf-scope-summary-card.is-online .pf-scope-eyebrow {
  color: var(--pf-purple);
}

.pf-scope-summary-table {
  min-width: 1180px;
  table-layout: fixed;
}

.pf-scope-summary-table.is-online {
  min-width: 760px;
}

.pf-scope-summary-table th,
.pf-scope-summary-table td {
  padding: 12px 11px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pf-scope-summary-table .pf-scope-name-col {
  position: sticky;
  left: 0;
  z-index: 3;
  box-sizing: border-box;
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  overflow: hidden;
  background: #fff !important;
  box-shadow: 1px 0 0 #dfe7f2;
  text-align: left;
  text-overflow: ellipsis;
}

.pf-scope-summary-table thead .pf-scope-name-col {
  z-index: 5;
}

.pf-scope-summary-table .pf-metric-head {
  border-left: 2px solid #dfe7f2;
  text-align: center;
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.pf-scope-summary-table .pf-manager-block-start {
  border-left: 2px solid #dfe7f2;
}

.pf-scope-summary-table tbody td {
  font-weight: 850;
}

.pf-scope-summary-table tbody tr:hover td,
.pf-scope-summary-table tbody tr:hover th {
  background: #f8fbff !important;
}

.pf-scoped-deviation-table {
  min-width: 840px;
  table-layout: fixed;
}

.pf-scoped-deviation-table th,
.pf-scoped-deviation-table td {
  padding: 12px 11px;
  vertical-align: middle;
}

.pf-scoped-deviation-table th:nth-child(1) { width: 52px; text-align: center; }
.pf-scoped-deviation-table th:nth-child(2) { width: 24%; }
.pf-scoped-deviation-table th:nth-child(3) { width: 18%; }
.pf-scoped-deviation-table th:nth-child(4) { width: 24%; text-align: right; }
.pf-scoped-deviation-table th:nth-child(5) { width: 16%; text-align: center; }
.pf-scoped-deviation-table th:nth-child(6) { width: 18%; text-align: right; }

.pf-scoped-deviation-table td:nth-child(1),
.pf-scoped-deviation-table td:nth-child(5) {
  text-align: center;
}

.pf-scoped-deviation-table td:nth-child(4),
.pf-scoped-deviation-table td:nth-child(6) {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pf-dashboard .pf-weekly-sprint.is-online .pf-sprint-cards {
  grid-template-columns: minmax(150px, .55fr) repeat(2, minmax(240px, 1fr));
}

@media (max-width: 900px) {
  .pf-dashboard .pf-kpi-line {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .pf-dashboard .pf-kpi-line em {
    max-width: none;
    width: fit-content;
  }

  .pf-dashboard .pf-weekly-sprint.is-online .pf-sprint-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .pf-dashboard .pf-scope-summary-card,
  .pf-dashboard .pf-scoped-deviation-card {
    padding: 16px;
  }

  .pf-scope-summary-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .pf-scope-summary-heading p {
    text-align: left;
  }

  .pf-scope-summary-table .pf-scope-name-col {
    width: 168px;
    min-width: 168px;
    max-width: 168px;
  }
}

/* Lead capacity forecast */
.lead-capacity-page {
  display: grid;
  gap: 16px;
}

.lead-capacity-month {
  width: fit-content;
}

.lead-radar {
  display: grid;
  gap: 16px;
  border: 1px solid #dfe7f2;
  border-radius: 14px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 12px 30px rgba(20, 35, 60, .07);
  padding: 20px;
  color: #16233f;
  font-variant-numeric: tabular-nums;
}

.lead-radar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.lead-radar-title h2,
.lead-panel-title h2 {
  margin: 0;
  color: #16233f;
  font-weight: 950;
}

.lead-radar-title h2 {
  font-size: 22px;
  line-height: 1.15;
}

.lead-radar-title p {
  margin: 6px 0 0;
  color: #63708e;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
}

.lead-radar-chip {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 107, 26, .26);
  border-radius: 8px;
  background: rgba(255, 107, 26, .1);
  color: #ff6b1a;
  padding: 8px 12px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 950;
}

.lead-radar-chip::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

.lead-radar-chip.is-good {
  border-color: rgba(21, 148, 76, .22);
  background: rgba(21, 148, 76, .1);
  color: #15944c;
}

.lead-radar-chip.is-bad {
  border-color: rgba(255, 59, 59, .24);
  background: rgba(255, 59, 59, .09);
  color: #ff3b3b;
}

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

.lead-radar-kpi {
  min-width: 0;
  border: 1px solid #dfe7f2;
  border-radius: 10px;
  background: #fff;
  padding: 14px;
}

.lead-radar-kpi span {
  display: block;
  color: #63708e;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 850;
  text-transform: uppercase;
}

.lead-radar-kpi strong {
  display: block;
  margin-top: 8px;
  color: #16233f;
  font-size: 28px;
  line-height: 1;
  font-weight: 950;
}

.lead-radar-kpi small {
  display: block;
  margin-top: 8px;
  color: #63708e;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 760;
}

.lead-radar-kpi.is-blue strong,
.lead-radar-kpi.is-info strong {
  color: #1f78ff;
}

.lead-radar-kpi.is-green strong {
  color: #15944c;
}

.lead-radar-kpi.is-orange strong {
  color: #ff6b1a;
}

.lead-radar-kpi.is-red strong {
  color: #ff3b3b;
}

.lead-radar-main {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr);
  gap: 16px;
}

.lead-radar-panel {
  min-width: 0;
  border: 1px solid #dfe7f2;
  border-radius: 10px;
  background: #fff;
  padding: 16px;
}

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

.lead-panel-title h2 {
  font-size: 17px;
  line-height: 1.2;
}

.lead-panel-title span {
  color: #63708e;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.lead-trend-chart {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  min-height: 220px;
  border-bottom: 1px solid #dfe7f2;
  padding-top: 8px;
}

.lead-bar-day {
  display: grid;
  min-width: 0;
  align-items: end;
  gap: 8px;
  text-align: center;
}

.lead-bar {
  position: relative;
  display: block;
  min-height: 10px;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, #3d8bff, #1f78ff);
}

.lead-bar.is-muted {
  background: #c7d2e5;
}

.lead-bar.is-spike {
  background: linear-gradient(180deg, #ffc046, #ff8f1f);
}

.lead-bar em {
  position: absolute;
  right: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(50%);
  color: #16233f;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.lead-bar-day small {
  color: #63708e;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.lead-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  color: #63708e;
  font-size: 12px;
  font-weight: 760;
}

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

.lead-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #1f78ff;
}

.lead-legend-dot.is-muted {
  background: #c7d2e5;
}

.lead-legend-dot.is-spike {
  background: #ff8f1f;
}

.lead-alerts {
  display: grid;
  gap: 10px;
}

.lead-alert {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 10px;
  border: 1px solid #dfe7f2;
  border-radius: 8px;
  background: #fbfcff;
  padding: 12px;
}

.lead-alert i {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: #ff6b1a;
}

.lead-alert.is-bad i {
  background: #ff3b3b;
}

.lead-alert.is-good i {
  background: #15944c;
}

.lead-alert strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 950;
}

.lead-alert span {
  display: block;
  margin-top: 4px;
  color: #63708e;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
}

.lead-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.lead-capacity-table {
  width: 100%;
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  font-weight: 760;
}

.lead-capacity-table th,
.lead-capacity-table td {
  border-bottom: 1px solid #dfe7f2;
  padding: 12px 10px;
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}

.lead-capacity-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  text-align: left;
  font-weight: 950;
}

.lead-capacity-table thead th {
  color: #566481;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.lead-capacity-table tbody tr:last-child th,
.lead-capacity-table tbody tr:last-child td {
  border-bottom: 0;
}

.lead-total-row th,
.lead-total-row td {
  background: #fbfcff;
  font-weight: 950;
}

.lead-status {
  display: inline-flex;
  min-width: 78px;
  justify-content: center;
  border-radius: 6px;
  padding: 4px 8px;
  background: rgba(255, 107, 26, .12);
  color: #ff6b1a;
  font-weight: 950;
}

.lead-status.is-bad {
  background: rgba(255, 59, 59, .1);
  color: #ff3b3b;
}

.lead-status.is-good {
  background: rgba(21, 148, 76, .11);
  color: #15944c;
}

.lead-capacity-table .is-bad {
  color: #ff3b3b;
  font-weight: 950;
}

.lead-capacity-table .is-good {
  color: #15944c;
  font-weight: 950;
}

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

  .lead-radar-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .lead-radar {
    padding: 16px;
  }

  .lead-radar-head,
  .lead-panel-title {
    display: grid;
  }

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

  .lead-trend-chart {
    gap: 6px;
  }

  .lead-bar-day small {
    font-size: 10px;
  }
}

.main-dashboard {
  --md-bg: #f3f6fa;
  --md-surface: #ffffff;
  --md-soft: #f8fafc;
  --md-blue-soft: #eff6ff;
  --md-ink: #111827;
  --md-muted: #64748b;
  --md-line: #d9e2ec;
  --md-line-soft: #e8eef5;
  --md-nav: #111827;
  --md-blue: #2563eb;
  --md-green: #059669;
  --md-orange: #d97706;
  --md-red: #dc2626;
  --md-purple: #6d28d9;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: var(--md-surface);
  color: var(--md-ink);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}

.md-filter-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 16px 20px;
  border-bottom: 1px solid var(--md-line);
  background: var(--md-soft);
}

.md-quick-area {
  display: grid;
  gap: 10px;
}

.md-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.md-quick-row strong {
  min-width: 76px;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.md-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--md-line);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.md-chip.active {
  border-color: #b8d2ff;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px #c7dbff;
}

.md-filter-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(142px, 1fr)) auto;
  gap: 8px;
  align-items: end;
  min-width: 680px;
}

.md-field {
  display: grid;
  gap: 5px;
}

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

.md-field input,
.md-field select {
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--md-line);
  border-radius: 8px;
  background: #fff;
  color: #172033;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.md-apply {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--md-blue);
  color: #fff;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 850;
}

.md-active-scope {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--md-muted);
  font-size: 12px;
}

.md-active-scope b {
  color: #1f2937;
}

.md-dash-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  padding: 20px;
  background: #fbfcfe;
}

.md-sidebar {
  display: grid;
  gap: 16px;
  align-content: start;
}

.md-main-result {
  padding: 20px;
  border-radius: 8px;
  background: var(--md-nav);
  color: #fff;
}

.md-main-result span {
  display: block;
  margin-bottom: 10px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 850;
}

.md-main-result strong {
  display: block;
  font-size: 42px;
  font-weight: 950;
  line-height: 1.08;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.md-main-result small {
  display: block;
  margin-top: 14px;
  color: #dbe4ef;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.md-panel {
  border: 1px solid var(--md-line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.md-panel-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--md-line);
}

.md-panel-head h2,
.md-panel-head h3 {
  margin: 0 0 4px;
  color: var(--md-ink);
  font-size: 20px;
  font-weight: 850;
  line-height: 1.25;
  letter-spacing: 0;
}

.md-panel-head p {
  margin: 0;
  color: var(--md-muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

.md-attention-list {
  display: grid;
  gap: 0;
  padding: 10px 16px;
}

.md-alert {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid #eef2f7;
  color: #263242;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.md-alert:last-child {
  border-bottom: 0;
}

.md-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--md-orange);
}

.md-dot.critical {
  background: var(--md-red);
}

.md-dot.watch {
  background: #b7791f;
}

.md-empty {
  padding: 14px 0;
  color: var(--md-muted);
  font-size: 13px;
  font-weight: 750;
}

.md-best-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.md-best {
  padding: 12px;
  border: 1px solid var(--md-line-soft);
  border-radius: 8px;
  background: #fff;
}

.md-best span {
  display: block;
  margin-bottom: 8px;
  color: var(--md-muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.md-best strong {
  display: block;
  color: var(--md-ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
}

.md-content {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.md-dept-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.md-dept {
  display: grid;
  align-content: space-between;
  gap: 10px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--md-line-soft);
  border-radius: 8px;
  background: var(--md-soft);
}

.md-dept span {
  color: var(--md-muted);
  font-size: 12px;
  font-weight: 850;
}

.md-dept strong {
  color: var(--md-ink);
  font-size: 20px;
  font-weight: 950;
  line-height: 1.2;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.md-dept b {
  color: var(--md-purple);
  font-size: 15px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.md-matrix {
  position: relative;
  overflow: auto;
  max-height: 620px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

.md-matrix:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .28);
  outline-offset: -3px;
}

.md-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  font-size: 14px;
}

.md-table th,
.md-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #e7edf4;
  color: var(--md-ink);
  text-align: right;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.md-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 0;
  background: var(--md-soft);
}

.md-sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.md-sort-button:hover,
.md-sort-button.is-active {
  color: var(--md-blue);
}

.md-sort-button:focus-visible {
  outline: 2px solid var(--md-blue);
  outline-offset: -2px;
}

.md-sort-icon {
  width: 14px;
  color: #94a3b8;
  font-size: 14px;
  font-style: normal;
  line-height: 1;
}

.md-sort-icon::before {
  content: "↕";
}

.md-sort-button.is-active .md-sort-icon {
  color: currentColor;
}

.md-sort-button.is-desc .md-sort-icon::before {
  content: "↓";
}

.md-sort-button.is-asc .md-sort-icon::before {
  content: "↑";
}

.md-sort-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.md-table th:first-child,
.md-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 224px;
  min-width: 224px;
  max-width: 224px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  box-shadow: 2px 0 0 #e7edf4, 8px 0 12px rgba(15, 23, 42, .035);
}

.md-table th:first-child {
  z-index: 5;
  background: var(--md-soft);
}

.md-table th:first-child .md-sort-button {
  justify-content: flex-start;
}

.md-table tbody tr {
  background: #fff;
}

.md-table tbody td:first-child {
  background: #fff;
}

.md-table tbody tr:nth-child(even),
.md-table tbody tr:nth-child(even) td:first-child {
  background: #fbfdff;
}

.md-table tbody tr:hover,
.md-table tbody tr:hover td:first-child {
  background: var(--md-blue-soft);
}

.md-table td:first-child {
  color: #1f2937;
  font-weight: 900;
}

.md-total-row td,
.md-total-row td:first-child {
  background: #edf4fb;
  font-weight: 950;
}

.md-table .is-money {
  color: var(--md-purple);
  font-weight: 950;
}

.md-table .is-good {
  color: var(--md-green);
  font-weight: 900;
}

.md-table .is-warn {
  color: var(--md-orange);
  font-weight: 900;
}

.md-source-table {
  min-width: 920px;
}

@media (max-width: 1500px) {
  .md-filter-strip {
    grid-template-columns: 1fr;
  }

  .md-filter-fields {
    min-width: 0;
  }

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

@media (max-width: 1080px) {
  .md-filter-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .md-apply {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .main-dashboard {
    border-radius: 8px;
  }

  .md-filter-strip,
  .md-dash-grid {
    padding: 12px;
  }

  .md-filter-fields,
  .md-dept-cards {
    grid-template-columns: 1fr;
  }

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

  .md-main-result strong {
    font-size: 34px;
  }

  .md-chip {
    width: 100%;
    justify-content: center;
  }

  .md-quick-row strong {
    width: 100%;
  }
}

/* Yearly charts */
.yg-page {
  --yg-bg: #f1f5f9;
  --yg-panel: #ffffff;
  --yg-soft: #f8fafc;
  --yg-border: #dce5ef;
  --yg-ink: #182133;
  --yg-muted: #758199;
  --yg-purple: #6f3df4;
  --yg-blue: #1f6fe5;
  --yg-green: #0f8a67;
  --yg-red: #df353c;
  display: grid;
  gap: 16px;
  color: var(--yg-ink);
  font-variant-numeric: tabular-nums;
}

.yg-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: 24px;
  align-items: start;
}

.yg-heading h2 {
  margin: 0;
  color: #131b2c;
  font-size: 30px;
  line-height: 1.12;
  font-weight: 900;
}

.yg-heading p,
.yg-summary-head p,
.yg-chart-section header p,
.yg-decision-strip p {
  margin: 8px 0 0;
  max-width: 920px;
  color: var(--yg-muted);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700;
}

.yg-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.yg-tab {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--yg-border);
  border-radius: 999px;
  padding: 0 18px;
  background: #fff;
  color: #1f2937;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
}

.yg-tab.active {
  border-color: rgba(111, 61, 244, .30);
  background: #eee9ff;
  color: #4b31c6;
}

.yg-controls {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(170px, 1fr) 100px auto;
  gap: 10px;
  align-items: end;
}

.yg-controls label {
  display: grid;
  gap: 6px;
}

.yg-controls span {
  color: var(--yg-muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.yg-controls select,
.yg-controls input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--yg-border);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
  color: #111827;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
}

.yg-apply {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: #111827;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.yg-summary,
.yg-chart-section,
.yg-decision-strip {
  border: 1px solid var(--yg-border);
  border-radius: 8px;
  background: var(--yg-panel);
  box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
  overflow: hidden;
}

.yg-summary-head,
.yg-chart-section header,
.yg-decision-strip {
  padding: 20px 22px;
}

.yg-summary h2,
.yg-chart-section h2,
.yg-decision-strip h2 {
  margin: 0;
  color: #172033;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 930;
}

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

.yg-kpi {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid #e5ebf3;
  border-radius: 8px;
  padding: 16px;
  background: var(--yg-soft);
}

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

.yg-kpi strong {
  color: #121a2b;
  font-size: 28px;
  line-height: 1.05;
  font-weight: 950;
}

.yg-kpi em {
  color: var(--yg-muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 850;
}

.yg-tone-purple strong { color: var(--yg-purple); }
.yg-tone-red strong { color: var(--yg-red); }
.yg-tone-dark strong { color: #111827; }

.yg-chart-section header {
  border-bottom: 1px solid #e8eef5;
}

.yg-chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(300px, 1fr));
  gap: 12px;
  padding: 18px 22px 22px;
}

.yg-chart-card {
  min-height: 258px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  border: 1px solid var(--yg-border);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  color: var(--yg-purple);
}

.yg-chart-card.is-focus {
  border-color: rgba(111, 61, 244, .55);
  box-shadow: inset 0 0 0 2px rgba(111, 61, 244, .10), 0 16px 34px rgba(111, 61, 244, .12);
}

.yg-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.yg-card-top h3 {
  margin: 0;
  color: #1d2638;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 930;
}

.yg-card-top span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 900;
}

.yg-card-top strong {
  color: var(--yg-purple);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 950;
  white-space: nowrap;
}

.yg-card-top .is-good {
  color: var(--yg-green);
}

.yg-card-top .is-bad {
  color: var(--yg-red);
}

.yg-sparkline {
  width: 100%;
  min-height: 170px;
  overflow: visible;
}

.yg-sparkline circle {
  fill: currentColor;
}

.yg-value {
  fill: #182133;
  font-size: 15px;
  font-weight: 930;
}

.yg-month {
  fill: #6c778d;
  font-size: 16px;
  font-weight: 900;
}

.yg-empty {
  grid-column: 1 / -1;
  padding: 18px;
  color: var(--yg-muted);
  font-weight: 850;
}

@media (max-width: 1320px) {
  .yg-hero,
  .yg-controls {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .yg-heading h2 {
    font-size: 24px;
  }

  .yg-tabs,
  .yg-controls {
    gap: 8px;
  }

  .yg-tab {
    width: 100%;
    justify-content: center;
  }

  .yg-kpis,
  .yg-chart-grid {
    grid-template-columns: 1fr;
    padding-left: 12px;
    padding-right: 12px;
  }

  .yg-summary-head,
  .yg-chart-section header,
  .yg-decision-strip {
    padding: 16px 12px;
  }
}

/* Yearly charts v2: screenshot-matched BI screen */
body.yearly-screen {
  margin: 0;
  background: #f6f8fc;
  color: #121a33;
}

body.yearly-screen .layout {
  display: block;
  min-height: 100vh;
}

body.yearly-screen .sidebar,
body.yearly-screen .topbar {
  display: none;
}

body.yearly-screen .main,
body.yearly-screen .content {
  display: block;
  padding: 0;
  min-width: 0;
}

.yg-app {
  --yg-ink: #121a33;
  --yg-muted: #69758d;
  --yg-faint: #8b95a9;
  --yg-line: #e4e9f2;
  --yg-card: #ffffff;
  --yg-soft: #f7f9fc;
  --yg-purple: #6b35e8;
  --yg-blue: #0d6eea;
  --yg-green: #07955f;
  --yg-orange: #ff7900;
  --yg-teal: #0aa0a6;
  --yg-red: #e00012;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  background: #f6f8fc;
  color: var(--yg-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}

.yg-side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 26px 14px 18px;
  border-right: 1px solid #edf1f7;
  background: rgba(255, 255, 255, .92);
  box-shadow: 10px 0 34px rgba(18, 26, 51, .045);
}

.yg-logo {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  padding: 0 10px 20px;
}

.yg-logo-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 2px solid #8a5cf6;
  border-radius: 999px;
  color: #6b35e8;
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
}

.yg-logo strong {
  color: #10192f;
  font-size: 13px;
  line-height: 1.1;
  font-weight: 900;
}

.yg-nav {
  display: grid;
  gap: 8px;
}

.yg-nav a,
.yg-collapse {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 8px;
  padding: 0 12px;
  color: #17223b;
  font-size: 14px;
  font-weight: 760;
}

.yg-nav a span,
.yg-collapse span {
  width: 18px;
  display: inline-grid;
  place-items: center;
  color: #53617b;
  font-size: 17px;
  line-height: 1;
}

.yg-nav a.active {
  background: #efe8ff;
  color: #6b35e8;
  font-weight: 900;
}

.yg-nav a.active span {
  color: #6b35e8;
}

.yg-nav-bottom {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid #eef2f7;
}

.yg-collapse {
  margin-top: auto;
  color: #24304a;
}

.yg-main {
  min-width: 0;
  padding: 24px 26px 28px;
}

.yg-top {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.yg-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.yg-title-row h1 {
  margin: 0;
  color: #11182e;
  font-size: 28px;
  line-height: 1.12;
  font-weight: 940;
  letter-spacing: 0;
}

.yg-info {
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #9ca6b8;
  border-radius: 999px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 900;
}

.yg-filter-row {
  display: grid;
  grid-template-columns: 300px 270px 410px 154px 130px;
  gap: 14px;
  align-items: end;
}

.yg-filter {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.yg-filter > span {
  color: #33405b;
  font-size: 12px;
  font-weight: 880;
  text-transform: uppercase;
}

.yg-filter select,
.yg-year input {
  width: 100%;
  height: 44px;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  padding: 0 16px;
  background: #fff;
  color: #111827;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 8px 22px rgba(18, 26, 51, .035);
}

.yg-periods {
  height: 44px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  overflow: hidden;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #fff;
}

.yg-periods button {
  border: 0;
  border-right: 1px solid #e6ebf3;
  background: transparent;
  color: #29344d;
  cursor: default;
  font-size: 13px;
  font-weight: 850;
}

.yg-periods button:last-child {
  border-right: 0;
}

.yg-periods button.active {
  background: #efe8ff;
  color: #6b35e8;
}

.yg-year {
  position: relative;
  display: block;
}

.yg-year span {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  font-size: 13px;
}

.yg-year input {
  padding-right: 38px;
}

.yg-export {
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #fff;
  color: #1d2840;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 8px 22px rgba(18, 26, 51, .035);
}

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

.yg-metric-card {
  min-height: 196px;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 7px;
  overflow: hidden;
  border: 1px solid #e2e8f1;
  border-radius: 8px;
  padding: 17px 18px 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(18, 26, 51, .04);
}

.yg-metric-card > span {
  color: #4e5a72;
  font-size: 12px;
  font-weight: 860;
}

.yg-metric-card strong {
  font-size: 26px;
  line-height: 1.08;
  font-weight: 950;
  letter-spacing: 0;
  white-space: nowrap;
}

.yg-metric-card small {
  color: #47536b;
  font-size: 12px;
  font-weight: 760;
}

.yg-metric-card em,
.yg-detail-card > em {
  font-style: normal;
  font-size: 12px;
  font-weight: 920;
}

.yg-metric-card em.good,
.yg-detail-card > em.good,
.yg-compare em.good {
  color: #008b5f;
}

.yg-metric-card em.bad,
.yg-detail-card > em.bad,
.yg-compare em.bad {
  color: #e00012;
}

.yg-metric-card svg {
  align-self: end;
  width: 100%;
  height: 50px;
  color: currentColor;
}

.yg-metric-card polygon.area {
  fill: currentColor;
  opacity: .10;
}

.yg-metric-card polyline,
.yg-detail-card polyline {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.yg-metric-card circle,
.yg-detail-card circle {
  fill: currentColor;
}

.yg-accent-purple { color: var(--yg-purple); }
.yg-accent-blue { color: var(--yg-blue); }
.yg-accent-green { color: var(--yg-green); }
.yg-accent-orange { color: var(--yg-orange); }
.yg-accent-teal { color: var(--yg-teal); }
.yg-accent-bg-purple { background: var(--yg-purple); }
.yg-accent-bg-blue { background: var(--yg-blue); }
.yg-accent-bg-green { background: var(--yg-green); }
.yg-accent-bg-orange { background: var(--yg-orange); }
.yg-accent-bg-teal { background: var(--yg-teal); }

.yg-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 18px;
  align-items: start;
}

.yg-details {
  overflow: hidden;
  border: 1px solid #e2e8f1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(18, 26, 51, .04);
}

.yg-section-head {
  min-height: 74px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 18px 14px;
}

.yg-section-head h2,
.yg-panel h2 {
  margin: 0;
  color: #172037;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 940;
}

.yg-section-head p,
.yg-panel p {
  margin: 5px 0 0;
  color: #68748c;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 760;
}

.yg-chart-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #58647c;
  font-size: 12px;
  font-weight: 800;
}

.yg-switch {
  min-width: 78px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: #6b35e8;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: inset -11px 0 0 rgba(255,255,255,.88);
}

.yg-table-button {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #fff;
  color: #26314a;
  font-size: 12px;
  font-weight: 850;
}

.yg-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 14px 14px;
}

.yg-detail-card {
  min-height: 266px;
  border: 1px solid #e2e8f1;
  border-radius: 8px;
  padding: 15px 15px 8px;
  background: #fff;
  color: var(--yg-purple);
}

.yg-detail-card h3 {
  margin: 0 0 5px;
  color: #162038;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 940;
}

.yg-detail-card svg {
  width: 100%;
  height: 205px;
  margin-top: 4px;
  overflow: visible;
}

.yg-detail-card line.grid {
  stroke: #e9eef5;
  stroke-width: 1;
}

.yg-detail-card polygon.area {
  fill: currentColor;
  opacity: .11;
}

.yg-detail-card .axis {
  fill: #40506b;
  font-size: 10px;
  font-weight: 760;
}

.yg-detail-card .value {
  fill: currentColor;
  font-size: 11px;
  font-weight: 950;
}

.yg-detail-card .month {
  fill: #26344e;
  font-size: 11px;
  font-weight: 850;
}

.yg-insights {
  display: grid;
  gap: 12px;
}

.yg-panel {
  border: 1px solid #e2e8f1;
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(18, 26, 51, .04);
}

.yg-insight-list {
  display: grid;
  gap: 8px;
  margin-top: 13px;
}

.yg-insight {
  min-height: 56px;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: center;
  border-radius: 8px;
  padding: 10px;
  background: #f7f8fb;
}

.yg-insight span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 21px;
  font-weight: 950;
}

.yg-insight.bad span {
  background: #ffe9eb;
  color: #e00012;
}

.yg-insight.good span {
  background: #e9f9f0;
  color: #07955f;
}

.yg-insight.warn span {
  background: #fff2dc;
  color: #ff8a00;
}

.yg-insight strong {
  display: block;
  color: #172037;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 920;
}

.yg-best-list {
  display: grid;
  gap: 11px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.yg-best-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #172037;
  font-size: 13px;
  font-weight: 880;
}

.yg-best-list span {
  color: #24304a;
  white-space: nowrap;
}

.yg-worst {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}

.yg-worst span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ef333c;
  color: #fff;
  font-size: 20px;
  font-weight: 950;
}

.yg-worst strong {
  font-size: 15px;
  font-weight: 930;
}

.yg-worst em {
  color: #e00012;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.yg-compare-list {
  display: grid;
  gap: 10px;
  margin-top: 15px;
}

.yg-compare {
  display: grid;
  grid-template-columns: 104px 1fr 92px;
  gap: 10px;
  align-items: center;
}

.yg-compare span {
  color: #27324b;
  font-size: 12px;
  font-weight: 800;
}

.yg-compare div {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ecf4;
}

.yg-compare i {
  display: block;
  min-width: 8px;
  max-width: 100%;
  height: 100%;
  border-radius: inherit;
}

.yg-compare em {
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.yg-compare-note {
  margin-top: 16px !important;
}

@media (max-width: 1500px) {
  .yg-app {
    grid-template-columns: 178px minmax(0, 1fr);
  }

  .yg-filter-row {
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(320px, 410px);
  }

  .yg-year,
  .yg-export {
    max-width: 180px;
  }

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

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

@media (max-width: 980px) {
  .yg-app {
    grid-template-columns: 1fr;
  }

  .yg-side {
    position: static;
    height: auto;
  }

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

  .yg-filter-row,
  .yg-detail-grid,
  .yg-kpi-row {
    grid-template-columns: 1fr;
  }
}

/* Yearly charts v3: keep portal sidebar, rebuild only right workspace */
body.yearly-charts-page {
  background: #f6f8fc;
}

body.yearly-charts-page .topbar {
  display: none;
}

body.yearly-charts-page .content {
  padding: 24px 26px 32px;
  display: block;
  overflow-x: hidden;
}

.yc-page {
  --yc-ink: #121a33;
  --yc-muted: #66738b;
  --yc-soft: #f7f9fc;
  --yc-line: #e2e8f1;
  --yc-purple: #6b35e8;
  --yc-blue: #0d6eea;
  --yc-green: #07955f;
  --yc-orange: #ff7900;
  --yc-teal: #0aa0a6;
  --yc-red: #df1724;
  color: var(--yc-ink);
  font-variant-numeric: tabular-nums;
}

.yc-report-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.yc-report-top h1 {
  margin: 0;
  color: #121a33;
  font-size: 26px;
  line-height: 1.16;
  font-weight: 940;
}

.yc-report-top p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--yc-muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 760;
}

.yc-sidebar-toggle {
  margin-top: 1px;
}

.yc-filter-form {
  margin-bottom: 20px;
}

.yc-view-tabs {
  display: inline-flex;
  min-height: 42px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(18, 26, 51, .035);
}

.yc-view-tabs button {
  min-width: 110px;
  border: 0;
  border-right: 1px solid #e4e9f1;
  padding: 0 18px;
  background: #fff;
  color: #43506a;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.yc-view-tabs button:last-child {
  border-right: 0;
}

.yc-view-tabs button.active {
  background: var(--yc-purple);
  color: #fff;
}

.yc-filter-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(210px, 1fr)) 132px auto;
  gap: 12px;
  align-items: end;
}

.yc-filter-control,
.yc-period-input {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.yc-filter-control > span,
.yc-period-input > span {
  color: #34405a;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.yc-filter-control select,
.yc-period-input input {
  width: 100%;
  height: 44px;
  min-width: 0;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: #111827;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 8px 22px rgba(18, 26, 51, .035);
}

.yc-filter-control .combo-select,
.yc-filter-control .combo-select-control {
  width: 100%;
  min-width: 0;
}

.yc-filter-control .combo-select-input {
  min-height: 44px;
  border-color: #dfe5ee;
  color: #111827;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 8px 22px rgba(18, 26, 51, .035);
}

.yc-filter-control .combo-select-menu {
  max-height: min(520px, calc(100vh - 160px));
}

.yc-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
}

.yc-apply-btn,
.yc-reset-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.yc-apply-btn {
  border: 1px solid var(--yc-purple);
  background: var(--yc-purple);
  color: #fff;
  cursor: pointer;
}

.yc-reset-btn {
  border: 1px solid #dfe5ee;
  background: #fff;
  color: #43506a;
}

.yc-focus-caption {
  margin: -4px 0 14px;
  color: #59657b;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 820;
}

.yc-filter-error,
.yc-safe-empty {
  border: 1px solid #f0d7a9;
  border-radius: 8px;
  background: #fffaf0;
  color: #6f4b0c;
}

.yc-filter-error {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
  padding: 13px 16px;
  font-size: 13px;
}

.yc-safe-empty {
  min-height: 240px;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 28px;
  text-align: center;
}

.yc-safe-empty strong {
  color: #172037;
  font-size: 20px;
}

.yc-safe-empty p {
  margin: 0;
  color: #66738b;
  font-size: 13px;
}

.yc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.yc-kpi-card {
  min-width: 0;
  min-height: 184px;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(48px, 1fr);
  gap: 6px;
  overflow: hidden;
  border: 1px solid var(--yc-line);
  border-radius: 8px;
  padding: 16px 16px 12px;
  background: #fff;
  color: var(--yc-purple);
  box-shadow: 0 12px 26px rgba(18, 26, 51, .04);
}

.yc-kpi-card.selected {
  border-color: rgba(107, 53, 232, .36);
  box-shadow: 0 14px 30px rgba(107, 53, 232, .10);
}

.yc-kpi-label {
  color: #4d5971;
  font-size: 12px;
  font-weight: 860;
  min-height: 30px;
  line-height: 1.2;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yc-kpi-value {
  min-width: 0;
  color: currentColor;
  font-size: clamp(22px, 1.72vw, 30px);
  line-height: 1.08;
  font-weight: 950;
  letter-spacing: 0;
  white-space: nowrap;
}

.yc-kpi-note {
  color: #47536b;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 760;
}

.yc-delta {
  font-size: 12px;
  line-height: 1.25;
  font-weight: 920;
}

.yc-delta.good,
.yc-chart-card p.good,
.yc-compare-row em.good {
  color: #008b5f;
}

.yc-delta.bad,
.yc-chart-card p.bad,
.yc-compare-row em.bad {
  color: #df1724;
}

.yc-kpi-card svg {
  align-self: end;
  width: 100%;
  height: 54px;
  color: currentColor;
}

.yc-kpi-card .area,
.yc-chart-card .area {
  fill: currentColor;
  opacity: .10;
}

.yc-kpi-card polyline,
.yc-chart-card polyline {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.yc-kpi-card polyline {
  stroke-width: 3;
}

.yc-kpi-card circle,
.yc-chart-card circle {
  fill: currentColor;
}

.yc-accent-purple { color: var(--yc-purple); }
.yc-accent-blue { color: var(--yc-blue); }
.yc-accent-green { color: var(--yc-green); }
.yc-accent-orange { color: var(--yc-orange); }
.yc-accent-teal { color: var(--yc-teal); }
.yc-fill-purple { background: var(--yc-purple); }
.yc-fill-blue { background: var(--yc-blue); }
.yc-fill-green { background: var(--yc-green); }
.yc-fill-orange { background: var(--yc-orange); }
.yc-fill-teal { background: var(--yc-teal); }

.yc-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.yc-details-card,
.yc-panel {
  border: 1px solid var(--yc-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(18, 26, 51, .04);
}

.yc-section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 20px 20px 16px;
}

.yc-section-header h2,
.yc-panel h2 {
  margin: 0;
  color: #172037;
  font-size: 20px;
  line-height: 1.18;
  font-weight: 940;
}

.yc-section-header p,
.yc-panel p {
  margin: 5px 0 0;
  color: var(--yc-muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 760;
}

.yc-chart-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #58647c;
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}

.yc-switch {
  min-width: 72px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: #6b35e8;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: inset -11px 0 0 rgba(255, 255, 255, .88);
}

.yc-table-btn {
  height: 34px;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: #26314a;
  font-size: 12px;
  font-weight: 850;
}

.yc-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 0 20px 20px;
}

.yc-chart-grid.is-daily {
  grid-template-columns: minmax(0, 1fr);
}

.yc-chart-card {
  min-width: 0;
  min-height: 324px;
  overflow: hidden;
  border: 1px solid var(--yc-line);
  border-radius: 8px;
  padding: 16px 18px 12px;
  background: #fff;
  color: var(--yc-purple);
}

.yc-chart-card.selected {
  border-color: var(--yc-line);
}

.yc-chart-card.yc-accent-purple { color: var(--yc-purple); }
.yc-chart-card.yc-accent-blue { color: var(--yc-blue); }
.yc-chart-card.yc-accent-green { color: var(--yc-green); }
.yc-chart-card.yc-accent-orange { color: var(--yc-orange); }
.yc-chart-card.yc-accent-teal { color: var(--yc-teal); }

.yc-chart-card h3 {
  margin: 0;
  color: #162038;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 940;
}

.yc-chart-card p {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 920;
}

.yc-chart-plot {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  grid-template-rows: 206px 28px;
  column-gap: 10px;
  margin-top: 12px;
}

.yc-chart-scroll {
  min-width: 0;
  grid-column: 2;
  grid-row: 1 / span 2;
  overflow: hidden;
}

.yc-chart-plot.is-daily .yc-chart-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 5px;
  scrollbar-gutter: stable;
}

.yc-chart-inner {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 206px 28px;
}

.yc-chart-plot.is-weeks .yc-chart-inner {
  grid-template-rows: 196px 38px;
}

.yc-chart-plot.is-weeks .yc-point-value {
  max-width: 52px;
  font-size: 9px;
}

.yc-chart-inner > .yc-plot-area {
  grid-column: 1;
  grid-row: 1;
}

.yc-chart-inner > .yc-month-row {
  grid-column: 1;
  grid-row: 2;
}

.yc-y-axis {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.yc-y-axis span {
  position: absolute;
  right: 0;
  color: #41506a;
  font-size: 11px;
  line-height: 1;
  font-weight: 760;
  white-space: nowrap;
  transform: translateY(-50%);
}

.yc-plot-area {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  overflow: visible;
}

.yc-plot-area svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  color: currentColor;
}

.yc-plot-area .grid {
  stroke: #e8edf5;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.yc-plot-area polyline {
  stroke-width: 2.8;
  vector-effect: non-scaling-stroke;
}

.yc-dot {
  position: absolute;
  z-index: 2;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 2px 6px rgba(18, 26, 51, .15);
  transform: translate(-50%, -50%);
}

.yc-point-value {
  position: absolute;
  z-index: 3;
  max-width: 128px;
  overflow: visible;
  padding: 0 2px;
  color: currentColor;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 950;
  text-align: center;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 7px));
}

.yc-point-value.edge-start {
  text-align: center;
  transform: translate(-50%, calc(-100% - 7px));
}

.yc-point-value.edge-end {
  text-align: center;
  transform: translate(-50%, calc(-100% - 7px));
}

.yc-month-row {
  display: grid;
  grid-column: 2;
  grid-row: 2;
  align-items: start;
  min-width: 0;
  padding-top: 5px;
}

.yc-month-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: #26344e;
  font-size: 13px;
  line-height: 1.1;
  font-weight: 850;
  text-align: center;
  white-space: nowrap;
}

.yc-month-row small {
  color: #71809a;
  font-size: 9px;
  font-weight: 820;
}

.yc-chart-plot.is-weeks .yc-month-row span {
  font-size: 11px;
  line-height: 1.05;
}

.yc-right-column {
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) minmax(240px, .85fr) minmax(240px, .85fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: stretch;
}

/* Daily plan-fact charts: visual continuation of the yearly charts report. */
.pfc-page {
  max-width: 1680px;
}

.pfc-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}

.pfc-filter-bar {
  display: grid;
  grid-template-columns: minmax(340px, 460px) minmax(0, 1fr);
  align-items: flex-start;
  column-gap: 20px;
  margin-bottom: 14px;
}

.pfc-focus-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  width: 100%;
}

.pfc-focus-control {
  display: grid;
  gap: 7px;
  width: 100%;
}

.pfc-focus-control > span {
  color: #34405a;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.pfc-focus-control select {
  width: 100%;
  height: 44px;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: #111827;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 8px 22px rgba(18, 26, 51, .035);
}

.pfc-focus-control .combo-select-input {
  min-height: 44px;
  border-color: #dfe5ee;
  color: #111827;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 8px 22px rgba(18, 26, 51, .035);
}

.pfc-focus-control .combo-select-menu {
  max-height: min(680px, calc(100vh - 140px));
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 rgba(226, 232, 240, .55);
  padding: 7px;
  border-color: #d9e0ea;
  border-radius: 8px;
  box-shadow: 0 20px 42px rgba(18, 26, 51, .22);
}

.pfc-focus-control .combo-select-menu::-webkit-scrollbar {
  width: 9px;
}

.pfc-focus-control .combo-select-menu::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, .55);
  border-radius: 999px;
}

.pfc-focus-control .combo-select-menu::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border: 2px solid rgba(255, 255, 255, .92);
  border-radius: 999px;
}

.pfc-focus-control .combo-select-group {
  padding: 12px 12px 5px;
  color: #16213b;
  font-size: 14px;
  font-weight: 950;
  text-transform: none;
}

.pfc-focus-control .combo-select-option {
  min-height: 38px;
  padding: 9px 12px 9px 28px;
  border-radius: 5px;
  font-size: 14px;
}

.pfc-focus-control .combo-select-option-center {
  padding-left: 12px;
  color: #24324d;
  font-weight: 850;
}

.pfc-focus-control .combo-select-option.selected {
  background: rgba(98, 183, 85, .22);
  color: #15213a;
}

.pfc-focus-nav {
  display: flex;
  gap: 6px;
}

.pfc-focus-nav-button {
  width: 40px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid #d9e4f1;
  border-radius: 8px;
  background: #fff;
  color: #236fc8;
  box-shadow: 0 3px 12px rgba(37, 69, 111, .045);
  cursor: pointer;
  font-size: 27px;
  font-weight: 500;
  line-height: 1;
}

.pfc-focus-nav-button:hover:not(:disabled) {
  border-color: #9fc8f5;
  background: #f1f7ff;
}

.pfc-focus-nav-button:disabled {
  border-color: #e5eaf1;
  color: #b4bdcb;
  cursor: not-allowed;
}

.pfc-focus-nav-button:focus-visible {
  outline: 3px solid rgba(25, 118, 223, .24);
  outline-offset: 2px;
}

.pfc-filter-options {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.pfc-period-control {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.pfc-filter-label {
  color: #34405a;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.pfc-periods,
.pfc-scale-options {
  display: inline-flex;
  max-width: 100%;
  min-height: 44px;
  overflow-x: auto;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #fff;
}

.pfc-periods a,
.pfc-scale-options a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  border-right: 1px solid #e4e9f1;
  color: #43506a;
  font-size: 12px;
  font-weight: 880;
  text-decoration: none;
  white-space: nowrap;
}

.pfc-periods a:last-child,
.pfc-scale-options a:last-child {
  border-right: 0;
}

.pfc-periods a.active,
.pfc-scale-options a.active {
  background: var(--yc-purple);
  color: #fff;
}

.pfc-scale-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.pfc-scale-row > span {
  color: #66738b;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.pfc-period-caption {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin: 0 0 18px;
  color: var(--yc-muted);
  font-size: 13px;
}

.pfc-period-caption strong {
  color: var(--yc-ink);
}

.pfc-warning {
  margin-bottom: 18px;
}

.pfc-details {
  overflow: hidden;
}

.pfc-legend {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: #59657b;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.pfc-legend i {
  width: 26px;
  border-top: 2px dashed #8c96a8;
}

.pfc-chart-grid.is-month {
  grid-template-columns: 1fr;
}

.pfc-chart-card {
  min-height: 372px;
}

.pfc-unavailable {
  color: #9a6500;
}

.pfc-plot-shell {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.pfc-y-axis {
  height: 218px;
}

.pfc-chart-scroll {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0 5px;
  scrollbar-gutter: stable;
}

.pfc-chart-inner {
  display: grid;
  grid-template-rows: 218px 34px;
}

.pfc-plot-area {
  grid-column: auto;
  grid-row: auto;
}

.pfc-day-row {
  grid-column: auto;
  grid-row: auto;
  padding-top: 7px;
}

.pfc-day-row span {
  font-size: 11px;
}

.pfc-day-row .month-start {
  color: var(--yc-purple);
  font-weight: 950;
}

.pfc-target-line {
  stroke: #8993a6;
  stroke-width: 1.6;
  stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
}

.pfc-month-boundary {
  position: absolute;
  inset-block: 0;
  z-index: 1;
  border-left: 2px dashed rgba(107, 53, 232, .38);
}

.pfc-chart-footer {
  display: grid;
  grid-template-columns: .75fr .9fr 1.2fr 1.15fr;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e7ebf2;
}

.pfc-chart-footer span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.pfc-chart-footer small {
  color: #7a8599;
  font-size: 10px;
  font-weight: 820;
  text-transform: uppercase;
}

.pfc-chart-footer strong {
  color: #26314a;
  font-size: 12px;
  line-height: 1.25;
}

.pfc-chart-footer .good {
  color: #008b5f;
}

.pfc-chart-footer .bad {
  color: #df1724;
}

.pfc-chart-footer .neutral {
  color: #66738b;
}

.pfc-empty-chart {
  min-height: 250px;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  color: #66738b;
  text-align: center;
}

.pfc-empty-chart strong {
  color: #172037;
  font-size: 22px;
}

.pfc-empty-chart span {
  max-width: 360px;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .pfc-filter-bar {
    grid-template-columns: 1fr;
    row-gap: 16px;
  }

  .pfc-focus-control {
    width: 100%;
  }

  .pfc-focus-stack {
    width: 100%;
  }

}

@media (max-width: 720px) {
  .pfc-periods,
  .pfc-scale-options {
    width: 100%;
  }

  .pfc-scale-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .pfc-chart-grid {
    padding-inline: 12px;
  }

  .pfc-chart-card {
    padding-inline: 12px;
  }

  .pfc-chart-footer {
    grid-template-columns: 1fr;
  }
}

.yc-panel {
  padding: 18px;
  min-width: 0;
}

.yc-insight-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.yc-insight {
  min-height: 58px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border-radius: 8px;
  padding: 10px;
  background: #f7f8fb;
}

.yc-insight > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 950;
}

.yc-insight.bad > span {
  background: #ffe9eb;
  color: #df1724;
}

.yc-insight.good > span {
  background: #e9f9f0;
  color: #07955f;
}

.yc-insight.warn > span {
  background: #fff2dc;
  color: #ff8a00;
}

.yc-insight strong {
  display: block;
  color: #172037;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 920;
}

.yc-month-list {
  display: grid;
  gap: 12px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.yc-month-list li,
.yc-worst {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: #172037;
  font-size: 13px;
  font-weight: 880;
}

.yc-month-list span {
  white-space: nowrap;
}

.yc-worst {
  margin-top: 14px;
}

.yc-worst > span {
  width: 30px;
  min-width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ef333c;
  color: #fff;
  font-size: 20px;
  font-weight: 950;
}

.yc-worst strong {
  margin-right: auto;
  font-size: 15px;
  font-weight: 930;
}

.yc-worst em {
  color: #df1724;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.yc-compare-list {
  display: grid;
  gap: 10px;
  margin-top: 15px;
}

.yc-compare-row {
  display: grid;
  grid-template-columns: 104px minmax(80px, 1fr) 100px;
  gap: 10px;
  align-items: center;
}

.yc-compare-row span {
  min-width: 0;
  overflow: hidden;
  color: #27324b;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yc-compare-row div {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ecf4;
}

.yc-compare-row i {
  display: block;
  min-width: 7px;
  max-width: 100%;
  height: 100%;
  border-radius: inherit;
}

.yc-compare-row em {
  overflow: hidden;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yc-small-note {
  margin-top: 14px !important;
}

.yc-empty {
  padding: 18px;
  color: var(--yc-muted);
  font-weight: 850;
}

@media (max-width: 1500px) {
  .yc-filter-bar {
    grid-template-columns: repeat(2, minmax(240px, 1fr)) 132px;
  }

  .yc-filter-actions {
    align-self: end;
  }

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

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

@media (max-width: 1300px) {
  .yc-chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  body.yearly-charts-page .content {
    padding: 16px 12px 24px;
  }

  .yc-filter-bar,
  .yc-kpi-grid,
  .yc-chart-grid,
  .yc-right-column {
    grid-template-columns: 1fr;
  }

  .yc-report-top {
    align-items: stretch;
    flex-direction: column;
  }

  .yc-section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .yc-chart-tools {
    flex-wrap: wrap;
    white-space: normal;
  }

  .yc-control {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .yc-view-tabs {
    width: 100%;
  }

  .yc-view-tabs button {
    min-width: 0;
    flex: 1;
  }

  .yc-filter-actions {
    flex-wrap: wrap;
  }
}

/* Month weeks report: dense calendar matrix from the selected BI reference. */
body.month-weeks-page {
  background: #fbfcff;
}

body.month-weeks-page .layout {
  min-height: 100vh;
}

body.month-weeks-page .main {
  min-height: 100vh;
}

body.month-weeks-page .content {
  min-width: 0;
  padding: 16px 16px 24px;
  overflow: visible;
}

.mw-page {
  --mw-ink: #1f2a44;
  --mw-muted: #6d768a;
  --mw-soft: #f9fbff;
  --mw-line: #edf0f6;
  --mw-line-strong: #e0e5ef;
  --mw-purple: #7244de;
  --mw-purple-strong: #6036d7;
  --mw-purple-soft: #f5f1ff;
  --mw-blue: #5b83ef;
  --mw-teal: #2fb6ad;
  --mw-orange: #f1a35f;
  --mw-green: #2ba36b;
  min-width: 0;
  color: var(--mw-ink);
  font-variant-numeric: tabular-nums;
}

.mw-filter-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 56px;
  min-width: 0;
  margin-bottom: 14px;
}

.mw-control,
.mw-period-control {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.mw-control > span,
.mw-period-control legend {
  flex: 0 0 auto;
  padding: 0;
  color: #697386;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
}

.mw-control select {
  width: 100%;
  height: 44px;
  padding: 0 42px 0 16px;
  border: 1px solid var(--mw-line-strong);
  border-radius: 8px;
  background:
    linear-gradient(45deg, transparent 50%, #9aa3b5 50%) calc(100% - 20px) 18px / 8px 8px no-repeat,
    linear-gradient(135deg, #9aa3b5 50%, transparent 50%) calc(100% - 15px) 18px / 8px 8px no-repeat,
    #fff;
  color: var(--mw-ink);
  appearance: none;
  box-shadow: 0 8px 20px rgba(31, 42, 68, .045), inset 0 0 0 1px rgba(255, 255, 255, .7);
  font-size: 14px;
  font-weight: 760;
}

.mw-focus-control {
  flex: 0 0 326px;
}

.mw-period-control {
  flex: 0 0 auto;
}

.mw-segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(88px, 1fr));
  height: 46px;
  overflow: hidden;
  border: 1px solid var(--mw-line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(31, 42, 68, .04);
}

.mw-segmented button {
  min-width: 88px;
  padding: 0 16px;
  border: 0;
  border-right: 1px solid var(--mw-line-strong);
  background: #fff;
  color: #4d576d;
  font-size: 13px;
  font-weight: 780;
  cursor: pointer;
}

.mw-segmented button:last-child { border-right: 0; }

.mw-segmented button.active {
  background: var(--mw-purple-soft);
  color: var(--mw-purple-strong);
  box-shadow: inset 0 0 0 1px rgba(114, 68, 222, .22);
}

.mw-context-control {
  flex: 0 0 178px;
}

.mw-context-control.is-hidden {
  display: none;
}

.mw-year-control {
  flex: 0 0 180px;
}

.mw-week-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 10px 0 14px;
  border: 1px solid var(--mw-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(31, 42, 68, .035);
  color: #3f485d;
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
  cursor: pointer;
}

.mw-week-toggle::after {
  content: "";
  width: 30px;
  height: 2px;
  border-radius: 999px;
  background: #e8ecf3;
}

.mw-week-toggle input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.mw-week-toggle i {
  position: relative;
  width: 43px;
  height: 24px;
  flex: 0 0 43px;
  border-radius: 999px;
  background: #dfe5ef;
  transition: background .15s ease;
}

.mw-week-toggle i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(31, 42, 68, .24);
  transition: transform .15s ease;
}

.mw-week-toggle input:checked + i {
  background: var(--mw-purple);
}

.mw-week-toggle input:checked + i::after {
  transform: translateX(19px);
}

.mw-updated {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  color: #2f3749;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 760;
  white-space: nowrap;
}

.mw-refresh {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #455067;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.mw-refresh:hover {
  background: #f1f4fa;
}

.mw-control select:focus-visible,
.mw-segmented button:focus-visible,
.mw-week-toggle:focus-within,
.mw-refresh:focus-visible,
.mw-table-shell:focus-visible {
  outline: 3px solid rgba(114, 68, 222, .22);
  outline-offset: 2px;
}

.mw-table-shell {
  width: 100%;
  max-height: calc(100vh - 88px);
  overflow: auto;
  border: 1px solid var(--mw-line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(31, 42, 68, .035);
  scrollbar-gutter: stable;
}

.mw-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--mw-ink);
  font-size: 12px;
  line-height: 1.18;
}

.mw-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.mw-table th,
.mw-table td {
  height: 30px;
  padding: 6px 8px;
  border-right: 1px solid var(--mw-line);
  border-bottom: 1px solid var(--mw-line);
  background: #fff;
  white-space: nowrap;
}

.mw-table thead th {
  z-index: 7;
  text-align: center;
  text-transform: uppercase;
}

.mw-month-header th {
  position: sticky;
  top: 0;
  height: 44px;
  background: #fcfdff;
  color: #424d62;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 860;
}

.mw-week-header th {
  position: sticky;
  top: 44px;
  height: 36px;
  min-width: 56px;
  background: #fff;
  color: #48536a;
  font-size: 11px;
  font-weight: 820;
}

.mw-table .mw-metric-head {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 10;
  width: 198px;
  min-width: 198px;
  padding-left: 16px;
  background: #fcfdff;
  text-align: left;
}

.mw-total-head,
.mw-plan-head {
  min-width: 88px;
}

.mw-total-head small,
.mw-plan-head small {
  display: block;
  margin-top: 2px;
  color: #7b8496;
  font-size: 10px;
  font-weight: 720;
  text-transform: none;
}

.mw-table .mw-summary-col {
  min-width: 76px;
  background: #fbfbfe;
}

.mw-table .mw-summary-fact {
  min-width: 88px;
  color: var(--mw-purple);
  background: #fff;
  font-weight: 900;
}

.mw-table .mw-plan-col {
  min-width: 82px;
  color: #1f2a44;
  font-weight: 780;
}

.mw-table .mw-progress-col {
  min-width: 86px;
  color: var(--mw-purple);
  font-weight: 880;
}

.mw-progress-value {
  display: inline-block;
  min-width: 32px;
  text-align: right;
}

.mw-progress-track {
  display: inline-block;
  width: 28px;
  height: 5px;
  margin-left: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9e3ff;
  vertical-align: 2px;
}

.mw-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8b68ef, var(--mw-purple-strong));
}

.mw-section-row th,
.mw-section-row td {
  height: 40px;
  background: #fbfcff;
  font-weight: 860;
}

.mw-section-row th {
  position: sticky;
  left: 0;
  z-index: 5;
  width: 198px;
  min-width: 198px;
  padding-left: 16px;
  color: #334056;
  text-align: left;
}

.mw-section-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.mw-section-icon {
  position: relative;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 7px;
  background: #f2edff;
  color: var(--mw-purple);
}

.mw-section-icon::before,
.mw-section-icon::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.mw-section-icon::after {
  inset: 4px 9px;
  border-width: 0 2px;
  border-radius: 0;
  opacity: .72;
}

.mw-section-row.mw-tone-blue .mw-section-icon {
  background: #eef3ff;
  color: var(--mw-blue);
}

.mw-section-row.mw-tone-teal .mw-section-icon {
  background: #eafafa;
  color: var(--mw-teal);
}

.mw-section-row.mw-tone-orange .mw-section-icon {
  background: #fff4e8;
  color: var(--mw-orange);
}

.mw-section-row.mw-tone-green .mw-section-icon {
  background: #ecfbf4;
  color: var(--mw-green);
}

.mw-data-row th {
  position: sticky;
  left: 0;
  z-index: 4;
  width: 198px;
  min-width: 198px;
  padding-left: 62px;
  background: #fff;
  color: #455168;
  text-align: left;
  font-size: 12px;
  font-weight: 660;
  text-transform: none;
}

.mw-number {
  min-width: 56px;
  color: #253049;
  text-align: right;
  font-weight: 680;
}

.mw-group-conversion td {
  background: linear-gradient(90deg, rgba(255, 240, 226, .62), rgba(255, 255, 255, .92));
}

.mw-group-conversion tr:nth-child(3) td,
.mw-group-conversion tr:nth-child(4) td {
  background: #f5fbf8;
}

.mw-group-conversion .mw-summary-col {
  background: #fffaf5;
}

.mw-data-row.is-placeholder th,
.mw-data-row.is-placeholder td {
  color: #98a2b3;
}

.mw-table .is-current {
  background: #fbf9ff;
  box-shadow: inset 2px 0 0 #bca8f7, inset -2px 0 0 #bca8f7;
  color: #1f2a44;
}

.mw-table thead .is-current {
  color: var(--mw-purple-strong);
  background: var(--mw-purple-soft);
}

.mw-table .good { color: #159564; font-weight: 900; }
.mw-table .warn { color: #b96b2c; font-weight: 900; }
.mw-table .bad { color: #c74755; font-weight: 900; }
.mw-table .muted { color: #98a2b3; }

.mw-table tbody tr:last-child th,
.mw-table tbody tr:last-child td { border-bottom: 0; }

.mw-period-month .mw-table {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
}

.mw-period-month .mw-table .mw-metric-head,
.mw-period-month .mw-section-row th,
.mw-period-month .mw-data-row th {
  width: 300px;
  min-width: 300px;
}

.mw-period-month .mw-data-row th {
  padding-left: 84px;
  font-size: 13px;
  font-weight: 640;
}

.mw-period-month .mw-section-row th {
  padding-left: 36px;
}

.mw-period-month .mw-month-header th {
  height: 52px;
  background: #fff;
  font-size: 12px;
}

.mw-period-month .mw-week-header th {
  height: 42px;
  min-width: 0;
  background: #fff;
  font-size: 14px;
  font-weight: 760;
  text-transform: none;
}

.mw-period-month .mw-table th,
.mw-period-month .mw-table td {
  height: 34px;
  padding: 7px 12px;
}

.mw-period-month .mw-section-row th,
.mw-period-month .mw-section-row td {
  height: 44px;
  background: #fcfdff;
}

.mw-period-month .mw-number {
  min-width: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 680;
}

.mw-period-month .mw-table .mw-plan-col,
.mw-period-month .mw-table .mw-progress-col,
.mw-period-month .mw-table .mw-plan-head {
  display: none;
}

.mw-period-month .mw-table .mw-total-head {
  display: table-cell;
  min-width: 0;
  background: #fcfdff;
  color: var(--mw-purple-strong);
  font-weight: 880;
}

.mw-period-month .mw-table .mw-summary-fact {
  display: table-cell;
  min-width: 0;
  background: #fbf9ff;
  color: var(--mw-purple-strong);
  font-weight: 860;
}

.mw-period-month .is-key-row th,
.mw-period-month .is-key-row td {
  background: #fff;
  color: #16223a;
  font-weight: 820;
}

.mw-period-month .is-key-row td:not(.is-current):not(.mw-summary-fact) {
  background: #fff;
}

.mw-period-month .is-key-row .mw-summary-fact {
  background: #f4f0ff;
  color: var(--mw-purple-strong);
}

.mw-period-month .is-detail-row th {
  padding-left: 108px;
  color: #788398;
  font-size: 12px;
  font-weight: 600;
}

.mw-period-month .is-detail-row td {
  color: #788398;
  font-weight: 620;
}

.mw-period-month .mw-table .is-current {
  background: rgba(245, 237, 255, .72);
  box-shadow: none;
}

.mw-period-month .mw-table thead .is-current {
  color: var(--mw-purple-strong);
  background: rgba(245, 237, 255, .84);
  box-shadow: inset 0 -3px 0 var(--mw-purple-strong);
}

.mw-period-month .mw-group-conversion td {
  background: linear-gradient(90deg, rgba(255, 247, 236, .74), rgba(255, 255, 255, .94));
}

.mw-period-month .mw-group-conversion .is-current {
  background: linear-gradient(90deg, rgba(246, 239, 255, .8), rgba(244, 235, 255, .76));
}

@media (max-width: 1380px) {
  .mw-filter-bar {
    flex-wrap: wrap;
    gap: 12px 18px;
  }
  .mw-updated {
    width: 100%;
    margin-left: 0;
    padding: 0;
    text-align: right;
    justify-content: flex-end;
  }
  .mw-table-shell { max-height: calc(100vh - 142px); }
}

@media (max-width: 760px) {
  body.month-weeks-page .content { padding: 12px; }
  .mw-filter-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .mw-control,
  .mw-focus-control,
  .mw-period-control,
  .mw-context-control,
  .mw-year-control,
  .mw-week-toggle {
    width: 100%;
    flex: 1 1 auto;
  }
  .mw-control,
  .mw-period-control {
    display: grid;
    gap: 7px;
  }
  .mw-segmented { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mw-segmented button { min-width: 0; }
  .mw-week-toggle {
    justify-content: space-between;
    margin-left: 0;
  }
  .mw-updated {
    justify-content: space-between;
    width: 100%;
    margin-left: 0;
    text-align: left;
  }
  .mw-table-shell { max-height: calc(100vh - 330px); }
  .mw-table .mw-metric-head,
  .mw-section-row th,
  .mw-data-row th {
    width: 168px;
    min-width: 168px;
  }
  .mw-data-row th { padding-left: 42px; }
}

/* Month view matched to the approved compact weekly dashboard reference. */
body.month-weeks-page .topbar {
  display: none;
}

html.sidebar-collapsed body.month-weeks-page .layout {
  grid-template-columns: 268px minmax(0, 1fr);
}

html.sidebar-collapsed body.month-weeks-page .sidebar {
  display: flex;
  padding: 22px 16px;
  border-right-color: rgba(255, 255, 255, .1);
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

body.month-weeks-page .content {
  padding: 16px 20px 28px;
}

.mw-period-month {
  --mw-ink: #101a36;
  --mw-muted: #64708d;
  --mw-line: #e7ebf3;
  --mw-line-strong: #dfe5ef;
  --mw-purple: #6438ee;
  --mw-purple-strong: #5728e7;
  --mw-purple-soft: #f4efff;
}

.mw-period-month .mw-filter-bar {
  gap: 16px;
  min-height: 44px;
  margin-bottom: 16px;
}

.mw-period-month .mw-control,
.mw-period-month .mw-period-control {
  gap: 10px;
}

.mw-period-month .mw-control > span,
.mw-period-month .mw-period-control legend {
  color: #5f6a85;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.mw-period-month .mw-focus-control {
  flex-basis: 284px;
}

.mw-period-month .mw-context-control {
  flex-basis: 160px;
}

.mw-period-month .mw-year-control {
  flex-basis: 148px;
}

.mw-period-month .mw-control select,
.mw-period-month .mw-segmented {
  height: 40px;
  border-color: #dce3ee;
  box-shadow: 0 3px 12px rgba(35, 45, 78, .035);
}

.mw-period-month .mw-control select {
  padding-left: 14px;
  font-size: 13px;
  font-weight: 700;
}

.mw-period-month .mw-segmented {
  grid-template-columns: repeat(3, minmax(76px, 1fr));
}

.mw-period-month .mw-segmented button {
  min-width: 76px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 680;
}

.mw-period-month .mw-segmented button.active {
  background: #6537ee;
  color: #fff;
  box-shadow: 0 6px 16px rgba(100, 56, 238, .24);
}

.mw-period-month .mw-week-toggle {
  min-height: 40px;
  padding-left: 10px;
  border-color: transparent;
  box-shadow: none;
  font-size: 11px;
  font-weight: 650;
}

.mw-period-month .mw-week-toggle::after {
  width: 20px;
}

.mw-period-month .mw-week-toggle i {
  width: 39px;
  height: 22px;
  flex-basis: 39px;
}

.mw-period-month .mw-week-toggle i::after {
  width: 16px;
  height: 16px;
}

.mw-period-month .mw-week-toggle input:checked + i::after {
  transform: translateX(17px);
}

.mw-period-month .mw-updated {
  gap: 8px;
  color: #68748f;
  font-size: 11px;
  font-weight: 600;
}

.mw-period-month .mw-refresh {
  width: 32px;
  height: 32px;
  color: #6f7b97;
  font-size: 22px;
}

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

.mw-kpi-card {
  position: relative;
  min-width: 0;
  min-height: 108px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 16px 28px;
  border: 1px solid #e2e7f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(35, 45, 78, .045);
}

.mw-kpi-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: transparent;
}

.mw-kpi-icon img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
}

.mw-kpi-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.mw-kpi-copy strong {
  overflow: hidden;
  color: #101a36;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mw-kpi-copy b {
  overflow: hidden;
  color: #111b38;
  font-size: 23px;
  line-height: 1.12;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mw-kpi-copy small {
  color: #66728f;
  font-size: 11px;
  font-weight: 520;
}

.mw-kpi-status {
  align-self: end;
  padding-bottom: 4px;
  color: #12a84d;
  font-size: 11px;
  font-weight: 720;
  white-space: nowrap;
}

.mw-period-month .mw-table-shell {
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
  border-color: #dfe5ef;
  box-shadow: 0 8px 24px rgba(35, 45, 78, .035);
  scrollbar-gutter: auto;
}

.mw-period-month .mw-table {
  min-width: 980px;
  color: #111b38;
  font-size: 11px;
  line-height: 1.12;
}

.mw-period-month .mw-table th,
.mw-period-month .mw-table td {
  height: 16px;
  padding: 0 10px;
  border-right-color: #e8ecf3;
  border-bottom-color: transparent;
}

.mw-period-month .mw-month-header th {
  height: 34px;
  border-bottom: 1px solid #e6eaf2;
  color: #222d49;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.mw-period-month .mw-week-header th {
  top: 34px;
  height: 32px;
  border-bottom: 1px solid #e1e6ef;
  color: #101a36;
  font-size: 12px;
  font-weight: 740;
}

.mw-period-month .mw-table .mw-metric-head,
.mw-period-month .mw-section-row th,
.mw-period-month .mw-data-row th {
  width: 332px;
  min-width: 332px;
}

.mw-period-month .mw-table .mw-metric-head {
  padding-left: 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.mw-period-month .mw-table .mw-total-head {
  background: #f8f5ff;
  font-size: 12px;
  line-height: 1.1;
}

.mw-period-month .mw-table .mw-total-head small {
  color: #5f35dd;
  font-size: 10px;
  font-weight: 700;
}

.mw-period-month .mw-section-row th,
.mw-period-month .mw-section-row td {
  height: 22px;
  padding-top: 3px;
  padding-bottom: 0;
  border-top: 1px solid #e3e8f0;
  background: #fff;
}

.mw-period-month .mw-section-row:first-child th,
.mw-period-month .mw-section-row:first-child td {
  height: 19px;
  padding-top: 0;
  border-top: 0;
}

.mw-period-month .mw-section-row th {
  padding-left: 14px;
  color: #20305c;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.mw-period-month .mw-section-title {
  gap: 10px;
}

.mw-period-month .mw-section-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
  border-radius: 5px;
}

.mw-period-month .mw-section-icon::before,
.mw-period-month .mw-section-icon::after {
  transform: scale(.82);
}

.mw-period-month .mw-tone-purple .mw-section-title,
.mw-period-month .mw-tone-purple .mw-section-icon {
  color: #5f36e9;
}

.mw-period-month .mw-tone-blue .mw-section-title {
  color: #1679be;
}

.mw-period-month .mw-tone-teal .mw-section-title {
  color: #2140a5;
}

.mw-period-month .mw-tone-orange .mw-section-title {
  color: #173277;
}

.mw-period-month .mw-tone-green .mw-section-title {
  color: #19a25b;
}

.mw-period-month .mw-data-row th {
  height: 16px;
  padding-left: 50px;
  color: #30405f;
  font-size: 11px;
  line-height: 1.12;
  font-weight: 540;
}

.mw-period-month .mw-number {
  color: #16213f;
  font-size: 11px;
  font-weight: 560;
}

.mw-period-month .is-key-row th,
.mw-period-month .is-key-row td {
  color: #0e1833;
  font-weight: 780;
}

.mw-period-month .mw-table .is-current {
  background: rgba(245, 240, 255, .72);
}

.mw-period-month .mw-table thead .is-current {
  background: #f4efff;
  color: #5d31e8;
  box-shadow: inset 0 -2px 0 #6438ee;
}

.mw-period-month .mw-table .mw-summary-col,
.mw-period-month .mw-table .mw-summary-fact {
  background: #faf8ff;
  color: #5d31e8;
  font-weight: 640;
}

.mw-period-month .is-key-row .mw-summary-value,
.mw-period-month .mw-row-avg_check .mw-summary-value,
.mw-period-month .mw-row-extra_sum .mw-summary-value,
.mw-period-month .mw-row-planned_profit_share .mw-summary-value {
  display: inline-block;
  min-width: 72px;
  padding: 1px 10px;
  border: 1px solid #e0d7ff;
  border-radius: 6px;
  background: #f0eaff;
  color: #5b2be9;
  font-weight: 800;
  line-height: 13px;
}

.mw-period-month .mw-group-conversion td,
.mw-period-month .mw-group-conversion .is-current,
.mw-period-month .mw-group-conversion .mw-summary-col {
  background: #fff;
}

.mw-period-month .mw-data-row.is-placeholder th,
.mw-period-month .mw-data-row.is-placeholder td {
  color: #9aa4b7;
}

.mw-period-month .mw-cell-progress {
  display: grid;
  width: 100%;
  max-width: 116px;
  grid-template-columns: max-content minmax(24px, 1fr);
  align-items: center;
  gap: 6px;
  margin: 0 auto;
  color: inherit;
}

.mw-period-month .mw-cell-progress > span {
  min-width: 0;
  text-align: right;
}

.mw-period-month .mw-cell-progress > i {
  width: 100%;
  min-width: 24px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e9ef;
}

.mw-period-month .mw-cell-progress > i > i {
  display: block;
  max-width: 100%;
  height: 100%;
  border-radius: inherit;
  background: currentColor;
}

.mw-period-month .mw-cell-progress.is-summary > i {
  background: #e5defa;
}

.mw-period-month .mw-cell-progress.is-empty {
  display: block;
  max-width: none;
  text-align: center;
}

.mw-period-month .good { color: #0ba743; }
.mw-period-month .warn { color: #c87219; }
.mw-period-month .bad { color: #f21b1b; }
.mw-period-month .muted { color: #96a0b3; }

@media (max-width: 1380px) {
  .mw-period-month .mw-filter-bar {
    gap: 12px;
  }

  .mw-period-month .mw-updated {
    width: auto;
    margin-left: auto;
  }

  .mw-kpi-card {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
  }

  .mw-kpi-icon {
    width: 48px;
    height: 48px;
  }

  .mw-kpi-status {
    grid-column: 2;
    justify-self: start;
    padding: 0;
  }
}

/* Year view: a compact month matrix matching the approved annual reference. */
.mw-period-year {
  --mw-ink: #15213d;
  --mw-muted: #66748e;
  --mw-line: #e6edf6;
  --mw-line-strong: #dce6f2;
  --mw-purple: #1976df;
  --mw-purple-strong: #1269d2;
  --mw-purple-soft: #f1f6ff;
}

body.month-weeks-page .mw-period-year .mw-filter-bar {
  gap: 18px;
  min-height: 44px;
  margin-bottom: 16px;
}

.mw-period-year .mw-control,
.mw-period-year .mw-period-control {
  gap: 10px;
}

.mw-period-year .mw-control > span,
.mw-period-year .mw-period-control legend {
  color: #5f6a85;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.mw-period-year .mw-focus-control {
  flex-basis: 280px;
}

.mw-period-year .mw-year-control {
  flex-basis: 148px;
}

.mw-period-year .mw-control select,
.mw-period-year .mw-segmented {
  height: 40px;
  border-color: #d9e4f1;
  box-shadow: 0 3px 12px rgba(37, 69, 111, .045);
}

.mw-period-year .mw-control select {
  padding-left: 14px;
  font-size: 13px;
  font-weight: 700;
}

.mw-period-year .mw-segmented {
  grid-template-columns: repeat(3, minmax(76px, 1fr));
}

.mw-period-year .mw-segmented button {
  min-width: 76px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 680;
}

.mw-period-year .mw-segmented button.active {
  background: #1476df;
  color: #fff;
  box-shadow: 0 6px 16px rgba(20, 118, 223, .2);
}

.mw-period-year .mw-week-toggle {
  min-height: 40px;
  padding-left: 10px;
  border-color: transparent;
  box-shadow: none;
  font-size: 11px;
  font-weight: 650;
}

.mw-period-year .mw-week-toggle i {
  width: 39px;
  height: 22px;
  flex-basis: 39px;
}

.mw-period-year .mw-week-toggle i::after {
  width: 16px;
  height: 16px;
}

.mw-period-year .mw-week-toggle input:checked + i {
  background: #1476df;
}

.mw-period-year .mw-week-toggle input:checked + i::after {
  transform: translateX(17px);
}

.mw-period-year .mw-updated {
  gap: 8px;
  color: #68748f;
  font-size: 11px;
  font-weight: 600;
}

.mw-period-year .mw-refresh {
  width: 32px;
  height: 32px;
  color: #1476df;
  font-size: 22px;
}

.mw-period-year .mw-kpi-grid {
  gap: 16px;
  margin-bottom: 16px;
}

.mw-period-year .mw-kpi-card {
  min-height: 104px;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 18px;
  padding: 16px 22px;
  border-color: #e3eaf3;
  box-shadow: 0 5px 16px rgba(29, 63, 109, .055);
}

.mw-period-year .mw-kpi-copy {
  gap: 3px;
}

.mw-period-year .mw-kpi-copy strong {
  color: #1b2743;
  font-size: 12px;
  font-weight: 760;
}

.mw-period-year .mw-kpi-copy b {
  color: #10203e;
  font-size: 25px;
  font-weight: 720;
}

.mw-period-year .mw-kpi-copy small {
  color: #687792;
}

.mw-period-year .mw-kpi-status {
  position: absolute;
  right: 22px;
  bottom: 15px;
  padding: 0;
  color: #18a45b;
  font-size: 11px;
  font-weight: 760;
}

.mw-period-year .mw-table-shell {
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
  border-color: #dfe8f3;
  border-radius: 8px;
  box-shadow: 0 5px 16px rgba(29, 63, 109, .035);
}

.mw-period-year .mw-table {
  width: 100%;
  min-width: 1280px;
  table-layout: fixed;
  color: #172442;
  font-size: 11px;
  line-height: 1.15;
}

.mw-period-year .mw-table .mw-metric-head,
.mw-period-year .mw-section-row th,
.mw-period-year .mw-data-row th {
  width: 250px;
  min-width: 250px;
}

.mw-period-year .mw-table th,
.mw-period-year .mw-table td {
  height: 18px;
  padding: 0 8px;
  border-right-color: #e8eef6;
  border-bottom-color: transparent;
}

.mw-period-year .mw-month-header th {
  height: 34px;
  border-bottom: 1px solid #e4ebf4;
  background: #fff;
  color: #24334f;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.mw-period-year .mw-week-header th {
  top: 34px;
  height: 32px;
  border-bottom: 1px solid #dfe8f3;
  background: #fff;
  color: #1b2a46;
  font-size: 11px;
  font-weight: 740;
}

.mw-period-year .mw-table .mw-metric-head {
  padding-left: 14px;
  text-align: left;
}

.mw-period-year .mw-table .mw-total-head,
.mw-period-year .mw-table .mw-summary-col,
.mw-period-year .mw-table .mw-summary-fact {
  width: 120px;
  min-width: 120px;
  background: #f4f8ff;
  color: #1b72dc;
}

.mw-period-year .mw-table .mw-total-head {
  font-size: 12px;
  line-height: 1.1;
}

.mw-period-year .mw-table .mw-total-head small {
  color: #1c70d6;
  font-size: 10px;
  font-weight: 700;
}

.mw-period-year .mw-section-row th,
.mw-period-year .mw-section-row td {
  height: 25px;
  padding-top: 4px;
  padding-bottom: 1px;
  border-top: 1px solid #e6edf5;
  background: #fff;
}

.mw-period-year .mw-section-row:first-child th,
.mw-period-year .mw-section-row:first-child td {
  height: 22px;
  padding-top: 0;
  border-top: 0;
}

.mw-period-year .mw-section-row th {
  padding-left: 14px;
  color: #24334f;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.mw-period-year .mw-section-title {
  gap: 10px;
}

.mw-period-year .mw-section-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
  border-radius: 5px;
}

.mw-period-year .mw-section-icon::before,
.mw-period-year .mw-section-icon::after {
  transform: scale(.82);
}

.mw-period-year .mw-tone-purple .mw-section-title,
.mw-period-year .mw-tone-purple .mw-section-icon,
.mw-period-year .mw-tone-blue .mw-section-title,
.mw-period-year .mw-tone-blue .mw-section-icon,
.mw-period-year .mw-tone-teal .mw-section-title,
.mw-period-year .mw-tone-teal .mw-section-icon {
  color: #2478df;
}

.mw-period-year .mw-tone-orange .mw-section-title,
.mw-period-year .mw-tone-orange .mw-section-icon {
  color: #f2a51a;
}

.mw-period-year .mw-tone-green .mw-section-title,
.mw-period-year .mw-tone-green .mw-section-icon {
  color: #22a65d;
}

.mw-period-year .mw-tone-purple .mw-section-icon,
.mw-period-year .mw-tone-blue .mw-section-icon,
.mw-period-year .mw-tone-teal .mw-section-icon {
  background: #eaf3ff;
}

.mw-period-year .mw-tone-orange .mw-section-icon {
  background: #fff4dc;
}

.mw-period-year .mw-tone-green .mw-section-icon {
  background: #eaf9f0;
}

.mw-period-year .mw-data-row th {
  height: 18px;
  padding-left: 50px;
  color: #30405f;
  font-size: 11px;
  font-weight: 540;
}

.mw-period-year .mw-number {
  color: #1a2945;
  font-size: 11px;
  font-weight: 560;
}

.mw-period-year .is-key-row th,
.mw-period-year .is-key-row td {
  color: #0e1833;
  font-weight: 780;
}

.mw-period-year .mw-group-conversion td {
  background: #fff;
}

.mw-period-year .mw-table col.is-current {
  background: #f1f6ff;
}

.mw-period-year .mw-table td.is-current,
.mw-period-year .mw-table thead th.is-current {
  background: transparent;
  box-shadow: none;
}

.mw-period-year .mw-table thead th.is-current {
  color: #1a73db;
}

.mw-period-year .is-key-row .mw-summary-value,
.mw-period-year .mw-row-avg_check .mw-summary-value,
.mw-period-year .mw-row-extra_sum .mw-summary-value,
.mw-period-year .mw-row-planned_profit_share .mw-summary-value {
  display: inline-block;
  min-width: 72px;
  padding: 1px 10px;
  border: 1px solid #d8e8ff;
  border-radius: 6px;
  background: #ebf4ff;
  color: #1b73dc;
  font-weight: 800;
  line-height: 13px;
}

.mw-period-year .mw-data-row.is-placeholder th,
.mw-period-year .mw-data-row.is-placeholder td {
  color: #9aa4b7;
}

@media (max-width: 1380px) {
  .mw-period-year .mw-filter-bar {
    gap: 12px;
  }

  .mw-period-year .mw-kpi-card {
    min-height: 112px;
  }
}

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

@media (max-width: 900px) {
  body.month-weeks-page .content {
    padding: 14px;
  }

  html.sidebar-collapsed body.month-weeks-page .sidebar {
    display: grid;
    padding: 12px 12px 10px;
  }

  .mw-period-month .mw-filter-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mw-period-month .mw-control,
  .mw-period-month .mw-focus-control,
  .mw-period-month .mw-period-control,
  .mw-period-month .mw-context-control,
  .mw-period-month .mw-year-control,
  .mw-period-month .mw-week-toggle {
    width: 100%;
    flex-basis: auto;
  }

  .mw-period-month .mw-updated {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 620px) {
  .mw-kpi-grid,
  .mw-period-month .mw-filter-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  .mw-period-month .mw-updated {
    grid-column: auto;
    justify-content: space-between;
  }

  .mw-period-month .mw-table .mw-metric-head,
  .mw-period-month .mw-section-row th,
  .mw-period-month .mw-data-row th {
    width: 184px;
    min-width: 184px;
  }

  .mw-period-month .mw-data-row th {
    padding-left: 38px;
  }
}

/* Month view: blue visual treatment from the approved reference. */
.mw-period-month {
  --mw-ink: #15213d;
  --mw-muted: #66748e;
  --mw-line: #e6edf6;
  --mw-line-strong: #dce6f2;
  --mw-purple: #1976df;
  --mw-purple-strong: #1269d2;
  --mw-purple-soft: #f1f6ff;
}

body.month-weeks-page .content {
  background: #fbfcfe;
}

.mw-period-month .mw-filter-bar {
  gap: 18px;
  margin-bottom: 22px;
}

.mw-period-month .mw-control select,
.mw-period-month .mw-segmented {
  border-color: #d9e4f1;
  box-shadow: 0 3px 12px rgba(37, 69, 111, .045);
}

.mw-period-month .mw-segmented button.active {
  background: #1476df;
  box-shadow: 0 6px 16px rgba(20, 118, 223, .2);
}

.mw-period-month .mw-week-toggle input:checked + i {
  background: #1476df;
}

.mw-period-month .mw-refresh {
  color: #1476df;
}

.mw-kpi-grid {
  gap: 16px;
  margin-bottom: 16px;
}

.mw-kpi-card {
  min-height: 124px;
  gap: 18px;
  padding: 18px 24px;
  border-color: #e3eaf3;
  box-shadow: 0 5px 16px rgba(29, 63, 109, .055);
}

.mw-kpi-copy {
  gap: 4px;
}

.mw-kpi-copy strong {
  color: #1b2743;
  font-size: 12px;
  font-weight: 760;
}

.mw-kpi-copy b {
  color: #10203e;
  font-size: 26px;
  font-weight: 720;
}

.mw-kpi-copy small {
  color: #687792;
}

.mw-kpi-status {
  color: #18a45b;
  font-weight: 760;
}

.mw-period-month .mw-table-shell {
  border-color: #dfe8f3;
  border-radius: 8px;
  box-shadow: 0 5px 16px rgba(29, 63, 109, .035);
}

.mw-period-month .mw-table {
  color: #172442;
  line-height: 1.18;
}

.mw-period-month .mw-table th,
.mw-period-month .mw-table td {
  border-right-color: #e8eef6;
}

.mw-period-month .mw-month-header th {
  height: 35px;
  border-bottom-color: #e4ebf4;
  color: #24334f;
}

.mw-period-month .mw-week-header th {
  height: 33px;
  border-bottom-color: #dfe8f3;
  color: #1b2a46;
}

.mw-period-month .mw-table .mw-total-head {
  background: #f4f8ff;
  color: #1c70d6;
}

.mw-period-month .mw-table .mw-total-head small {
  color: #1c70d6;
}

.mw-period-month .mw-section-row th,
.mw-period-month .mw-section-row td {
  height: 25px;
  padding-top: 4px;
  padding-bottom: 1px;
  border-top-color: #e6edf5;
}

.mw-period-month .mw-section-row:first-child th,
.mw-period-month .mw-section-row:first-child td {
  height: 22px;
}

.mw-period-month .mw-section-row th {
  color: #24334f;
}

.mw-period-month .mw-tone-purple .mw-section-title,
.mw-period-month .mw-tone-purple .mw-section-icon,
.mw-period-month .mw-tone-blue .mw-section-title,
.mw-period-month .mw-tone-blue .mw-section-icon,
.mw-period-month .mw-tone-teal .mw-section-title,
.mw-period-month .mw-tone-teal .mw-section-icon {
  color: #2478df;
}

.mw-period-month .mw-tone-orange .mw-section-title,
.mw-period-month .mw-tone-orange .mw-section-icon {
  color: #f2a51a;
}

.mw-period-month .mw-tone-green .mw-section-title,
.mw-period-month .mw-tone-green .mw-section-icon {
  color: #22a65d;
}

.mw-period-month .mw-tone-purple .mw-section-icon,
.mw-period-month .mw-tone-blue .mw-section-icon,
.mw-period-month .mw-tone-teal .mw-section-icon {
  background: #eaf3ff;
}

.mw-period-month .mw-tone-orange .mw-section-icon {
  background: #fff4dc;
}

.mw-period-month .mw-tone-green .mw-section-icon {
  background: #eaf9f0;
}

.mw-period-month .mw-data-row th {
  height: 17px;
  color: #30405f;
  line-height: 1.18;
}

.mw-period-month .mw-number {
  color: #1a2945;
}

.mw-period-month .mw-table .is-current,
.mw-period-month .mw-group-conversion .is-current {
  background: #f1f6ff;
}

.mw-period-month .mw-table thead .is-current {
  background: #f0f6ff;
  color: #1a73db;
  box-shadow: inset 0 -2px 0 #1976df;
}

.mw-period-month .mw-table .mw-summary-col,
.mw-period-month .mw-table .mw-summary-fact,
.mw-period-month .mw-group-conversion .mw-summary-col {
  background: #f6f9ff;
  color: #1b72dc;
}

.mw-period-month .is-key-row .mw-summary-value,
.mw-period-month .mw-row-avg_check .mw-summary-value,
.mw-period-month .mw-row-extra_sum .mw-summary-value,
.mw-period-month .mw-row-planned_profit_share .mw-summary-value {
  border-color: #d8e8ff;
  background: #ebf4ff;
  color: #1b73dc;
}

.mw-period-month .mw-cell-progress.is-summary > i {
  background: #dceafd;
}

/* Completion values are intentionally text-only: color carries the state. */
.mw-period-month .mw-cell-progress:not(.is-empty) {
  display: block;
  width: auto;
  max-width: none;
  margin: 0;
  text-align: center;
}

.mw-period-month .mw-cell-progress:not(.is-empty) > span {
  display: block;
  text-align: center;
}

.mw-period-month .mw-cell-progress > i {
  display: none;
}

.mw-period-month .mw-number.good,
.mw-period-month .mw-summary-fact.good {
  color: #15a653;
}

.mw-period-month .mw-number.warn,
.mw-period-month .mw-summary-fact.warn {
  color: #dc9800;
}

.mw-period-month .mw-number.bad,
.mw-period-month .mw-summary-fact.bad {
  color: #e92d3a;
}

/* The current week is one table-column background, never a stack of cells. */
.mw-period-month .mw-table col.is-current {
  background: #f1f6ff;
}

.mw-period-month .mw-table td.is-current,
.mw-period-month .mw-table thead th.is-current {
  background: transparent;
  box-shadow: none;
}

.mw-period-month .mw-table thead th.is-current {
  color: #1a73db;
  box-shadow: inset 0 -2px 0 #1976df;
}

@media (max-width: 1380px) {
  .mw-period-month .mw-filter-bar {
    gap: 12px;
  }

  .mw-kpi-card {
    min-height: 116px;
  }
}

/* Keep annual cards readable beside the persistent navigation on compact screens. */
@media (max-width: 1300px) {
  .mw-period-year .mw-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mw-period-year .mw-kpi-card {
    grid-template-columns: 64px minmax(0, 1fr) auto;
  }
}

.mw-period-year .mw-table .is-future,
.mw-period-year .mw-number.muted.is-future {
  color: #9aa4b7;
}

/* Month/weeks controls: one alignment system for every screen width. */
.mw-filter-bar {
  display: block;
}

.mw-filter-controls {
  display: grid;
  grid-template-columns: minmax(250px, 300px) max-content minmax(116px, 142px) minmax(104px, 126px);
  grid-template-areas:
    "focus period context year"
    "nav . . .";
  align-items: center;
  min-width: 0;
  column-gap: 14px;
  row-gap: 10px;
}

.mw-period-month .mw-filter-controls {
  grid-template-columns: minmax(250px, 300px) max-content minmax(116px, 142px) minmax(104px, 126px) max-content;
  grid-template-areas:
    "focus period context year action"
    "nav . . . .";
}

.mw-extra-service-action {
  grid-area: action;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 6px;
  background: linear-gradient(135deg, #12a36f, #53c976);
  box-shadow: 0 7px 16px rgba(19, 155, 105, .18);
  color: #fff;
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
  white-space: nowrap;
}

.mw-extra-service-action:hover {
  color: #fff;
  filter: brightness(.98);
  transform: translateY(-1px);
}

.mw-extra-service-action:focus-visible {
  outline: 3px solid rgba(25, 118, 223, .28);
  outline-offset: 2px;
}

.mw-focus-stack {
  display: contents;
}

.mw-focus-stack .mw-focus-control {
  grid-area: focus;
  width: 100%;
  flex-basis: auto;
}

.mw-filter-controls .mw-control,
.mw-filter-controls .mw-period-control {
  display: flex;
  align-items: center;
  align-self: center;
  min-height: 40px;
}

.mw-filter-controls .mw-context-control.is-hidden {
  display: none;
}

.mw-filter-controls .mw-period-control {
  grid-area: period;
}

.mw-filter-controls .mw-period-control > .mw-control-label {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  padding: 0;
  color: #5f6a85;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.mw-focus-nav {
  grid-area: nav;
  display: flex;
  gap: 6px;
  margin: 0 0 0 46px;
}

.mw-focus-nav-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid #d9e4f1;
  border-radius: 6px;
  background: #fff;
  color: #236fc8;
  box-shadow: 0 3px 12px rgba(37, 69, 111, .045);
  cursor: pointer;
  font-size: 27px;
  font-weight: 500;
  line-height: 1;
}

.mw-focus-nav-button:hover:not(:disabled) {
  border-color: #9fc8f5;
  background: #f1f7ff;
}

.mw-focus-nav-button:disabled {
  border-color: #e5eaf1;
  color: #b4bdcb;
  cursor: not-allowed;
}

.mw-focus-nav-button:focus-visible {
  outline: 3px solid rgba(25, 118, 223, .24);
  outline-offset: 2px;
}

.mw-filter-controls > .mw-context-control {
  grid-area: context;
}

.mw-filter-controls > .mw-year-control {
  grid-area: year;
}

.mw-filter-controls > .mw-week-toggle {
  grid-area: toggle;
  align-self: center;
}

.mw-filter-controls > .mw-updated {
  grid-area: updated;
  align-self: center;
  justify-self: end;
  min-height: 40px;
  margin: 0;
}

@media (max-width: 1500px) {
  .mw-filter-controls {
    grid-template-columns: minmax(220px, 1fr) max-content minmax(108px, 126px) minmax(98px, 112px);
    column-gap: 12px;
  }

  .mw-period-month .mw-filter-controls {
    grid-template-columns: minmax(220px, 1fr) max-content minmax(108px, 126px) minmax(98px, 112px) max-content;
  }
}

@media (max-width: 1200px) {
  .mw-filter-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "focus focus"
      "nav nav"
      "period period"
      "context year";
  }

  .mw-period-month .mw-filter-controls {
    grid-template-areas:
      "focus focus"
      "nav nav"
      "period period"
      "context year"
      "action action";
  }

  .mw-filter-controls .mw-control,
  .mw-filter-controls .mw-period-control,
  .mw-filter-controls .mw-week-toggle {
    width: 100%;
    min-width: 0;
  }
}

.portal-role-card {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid rgba(125, 211, 252, .18);
  border-radius: 10px;
  background: rgba(15, 118, 110, .12);
}

.portal-role-card strong {
  color: #f8fafc;
  font-size: 12px;
}

.portal-role-card span {
  color: #a7b8ca;
  font-size: 11px;
  line-height: 1.35;
}

.access-owner-strip,
.access-card,
.access-audit-card,
.access-denied-card {
  min-width: 0;
  border: 1px solid #dfe6ef;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .05);
}

.access-owner-strip {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 18px 22px;
}

.access-owner-strip div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.access-owner-strip span,
.access-card header span,
.access-employees > span {
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.access-owner-strip strong {
  color: #0f172a;
  font-size: 20px;
}

.access-owner-strip p {
  min-width: 0;
  max-width: 680px;
  margin: 0;
  color: #64748b;
  overflow-wrap: anywhere;
}

.access-grid {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.access-card {
  min-width: 0;
  padding: 20px;
}

.access-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.access-card h2 {
  margin: 5px 0 0;
  color: #111827;
  font-size: 19px;
}

.access-state {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 10px;
}

.access-state.enabled {
  background: #dcfce7;
  color: #15803d;
}

.access-employees {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 64px;
  margin: 16px 0;
  padding: 12px;
  border-radius: 10px;
  background: #f8fafc;
}

.access-employees > span {
  width: 100%;
}

.access-employees b {
  padding: 4px 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
}

.access-form,
.access-form label {
  display: grid;
  gap: 6px;
}

.access-form {
  gap: 12px;
}

.access-credential-status {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  background: #f0fdf4;
}

.access-credential-status b {
  color: #15803d;
  font-size: 12px;
}

.access-credential-status span {
  color: #64748b;
  font-size: 11px;
  line-height: 1.4;
}

.access-card.has-credential-draft {
  border-color: #93c5fd;
  box-shadow: 0 12px 30px rgba(37, 99, 235, .1);
}

.access-card.has-credential-draft .access-actions::before {
  content: "Есть несохранённые новые данные";
  color: #b45309;
  font-size: 11px;
  font-weight: 800;
}

.access-field-block {
  display: grid;
  gap: 6px;
}

.access-field-heading,
.access-password-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.access-field-heading label,
.access-password-toolbar > span {
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.access-generator {
  flex: 0 0 auto;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.access-generator:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.access-generator:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .2);
  outline-offset: 3px;
  border-radius: 4px;
}

.access-form input[type="text"],
.access-form input[type="password"] {
  width: 100%;
  min-width: 0;
}

.access-form input[readonly] {
  background: #f8fafc;
  cursor: default;
}

.access-form label > span {
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

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

.access-password-note {
  margin: 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
}

.access-saved-password {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
}

.access-saved-password-value {
  display: flex;
  align-items: center;
  gap: 8px;
}

.access-saved-password-value input {
  min-width: 0;
  flex: 1 1 auto;
  letter-spacing: .08em;
}

.access-saved-password-value .btn {
  flex: 0 0 auto;
  padding: 8px 10px;
  font-size: 11px;
}

.access-active-control {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
}

.access-actions,
.access-account-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.access-account-footer {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.access-account-buttons {
  flex-wrap: wrap;
}

.access-account-buttons form {
  margin: 0;
}

.access-login-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
}

.access-login-status b {
  padding: 4px 7px;
  border-radius: 999px;
}

.access-login-status span {
  color: #64748b;
}

.access-login-status.available b {
  background: #dcfce7;
  color: #15803d;
}

.access-login-status.locked b {
  background: #fee2e2;
  color: #b91c1c;
}

.access-account-footer > span {
  color: #64748b;
  font-size: 11px;
}

.access-revoke {
  border-color: #fecaca;
  background: #fff7f7;
  color: #dc2626;
}

.access-revoke:hover {
  border-color: #fca5a5;
  background: #fee2e2;
}

.access-restore {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.access-restore:hover {
  border-color: #86efac;
  background: #dcfce7;
}

.access-audit-card {
  width: 100%;
  margin-top: 18px;
  padding: 20px;
}

.access-audit-card header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.access-audit-card h2,
.access-audit-card p {
  margin: 0;
}

.access-audit-card p {
  color: #64748b;
}

.access-audit-table {
  overflow: auto;
}

.access-audit-table table {
  width: 100%;
  border-collapse: collapse;
}

.access-audit-table th,
.access-audit-table td {
  padding: 10px 12px;
  border-top: 1px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
}

.access-audit-table th {
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
}

.access-denied-card {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  max-width: 720px;
  padding: 28px;
}

.access-denied-icon {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
  font-size: 24px;
  font-weight: 900;
}

.access-denied-card h2 {
  margin: 0 0 8px;
}

.access-denied-card p {
  margin: 0 0 18px;
  color: #64748b;
}

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

@media (max-width: 720px) {
  .access-owner-strip,
  .access-audit-card header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .access-field-heading,
  .access-password-toolbar,
  .access-account-buttons,
  .access-saved-password-value {
    align-items: flex-start;
    flex-direction: column;
  }

  .access-saved-password-value .btn {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .mw-filter-controls {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "focus"
      "nav"
      "period"
      "context"
      "year";
  }

  .mw-period-month .mw-filter-controls {
    grid-template-areas:
      "focus"
      "nav"
      "period"
      "context"
      "year"
      "action";
  }

  .mw-focus-nav {
    margin-left: 0;
  }

  .mw-filter-controls > .mw-updated {
    justify-self: stretch;
  }
}

/* Annual and quarterly views share the approved compact matrix treatment. */
.mw-period-year .mw-filter-controls {
  grid-template-columns: minmax(250px, 300px) max-content minmax(104px, 126px) max-content minmax(230px, 1fr);
  grid-template-areas: "focus period year toggle updated";
}

.mw-period-quarter.mw-period-year .mw-filter-controls {
  grid-template-columns: minmax(250px, 300px) max-content minmax(116px, 142px) minmax(104px, 126px) max-content minmax(230px, 1fr);
  grid-template-areas: "focus period context year toggle updated";
}

.mw-period-year .mw-focus-nav {
  display: none;
}

@media (max-width: 1700px) {
  .mw-period-year .mw-filter-controls {
    grid-template-columns: minmax(220px, 1fr) max-content minmax(98px, 112px) minmax(214px, 1fr);
    grid-template-areas:
      "focus period year toggle"
      ". . . updated";
  }

  .mw-period-quarter.mw-period-year .mw-filter-controls {
    grid-template-columns: minmax(220px, 1fr) max-content minmax(108px, 126px) minmax(98px, 112px) minmax(214px, 1fr);
    grid-template-areas:
      "focus period context year toggle"
      ". . . . updated";
  }
}

@media (max-width: 1400px) {
  .mw-period-year .mw-filter-controls {
    grid-template-columns: minmax(220px, 1fr) max-content minmax(98px, 112px);
    grid-template-areas:
      "focus period year"
      ". toggle updated";
  }

  .mw-period-quarter.mw-period-year .mw-filter-controls {
    grid-template-columns: minmax(220px, 1fr) max-content minmax(108px, 126px) minmax(98px, 112px);
    grid-template-areas:
      "focus period context year"
      ". toggle toggle updated";
  }
}

@media (max-width: 1200px) {
  .mw-period-year .mw-filter-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "focus focus"
      "period period"
      "year toggle"
      "updated updated";
  }

  .mw-period-quarter.mw-period-year .mw-filter-controls {
    grid-template-areas:
      "focus focus"
      "period period"
      "context year"
      "toggle toggle"
      "updated updated";
  }
}

/* Year-over-year comparison */
.year-over-year-page {
  --yoy-blue: #0877f9;
  --yoy-blue-soft: #b9d9ff;
  --yoy-blue-faint: #eaf4ff;
  --yoy-ink: #152448;
  --yoy-muted: #647392;
  --yoy-line: #dfe7f1;
  --yoy-green: #16b763;
  --yoy-red: #ef4f5a;
  --yoy-orange: #f6a50b;
  background: #f7f9fc;
  overflow-x: hidden;
}

.year-over-year-page .topbar {
  display: none;
}

.year-over-year-page .content {
  display: block;
  padding: 20px 22px 34px;
}

.yoy-page {
  width: 100%;
  min-width: 0;
  color: var(--yoy-ink);
}

.yoy-page .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.yoy-filter-bar {
  display: grid;
  grid-template-columns:
    minmax(180px, .78fr)
    minmax(210px, .95fr)
    minmax(400px, 1.5fr)
    minmax(345px, 1.28fr)
    minmax(210px, .78fr)
    minmax(290px, 1.05fr);
  gap: 18px;
  align-items: end;
  padding: 2px 8px 18px;
}

.yoy-filter-field,
.yoy-period-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.yoy-filter-field > span,
.yoy-period-field > span,
.yoy-compare-period > span {
  color: var(--yoy-muted);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.2;
}

.yoy-filter-field select,
.yoy-date-range input,
.yoy-sort-control select {
  width: 100%;
  min-width: 0;
  height: 50px;
  border: 1px solid var(--yoy-line);
  border-radius: 10px;
  background: #fff;
  color: var(--yoy-ink);
  padding: 0 42px 0 16px;
  font-size: 15px;
  font-weight: 720;
  outline: none;
  box-shadow: 0 1px 2px rgba(20, 36, 72, .02);
}

.yoy-filter-field select:focus,
.yoy-date-range input:focus,
.yoy-sort-control select:focus {
  border-color: rgba(8, 119, 249, .62);
  box-shadow: 0 0 0 3px rgba(8, 119, 249, .1);
}

.yoy-period-tabs,
.yoy-metric-tabs {
  display: flex;
  min-width: 0;
}

.yoy-period-tabs button,
.yoy-metric-tabs button {
  min-width: 0;
  border: 1px solid var(--yoy-line);
  border-right-width: 0;
  background: #fff;
  color: #465475;
  cursor: pointer;
  font-weight: 760;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.yoy-period-tabs button:first-child,
.yoy-metric-tabs button:first-child {
  border-radius: 9px 0 0 9px;
}

.yoy-period-tabs button:last-child,
.yoy-metric-tabs button:last-child {
  border-right-width: 1px;
  border-radius: 0 9px 9px 0;
}

.yoy-period-tabs button {
  flex: 1 1 0;
  height: 50px;
  padding: 0 14px;
  font-size: 15px;
}

.yoy-period-tabs button.active,
.yoy-metric-tabs button.active {
  border-color: var(--yoy-blue);
  background: var(--yoy-blue);
  color: #fff;
  box-shadow: 0 5px 14px rgba(8, 119, 249, .22);
}

.yoy-period-tabs button.active + button,
.yoy-metric-tabs button.active + button {
  border-left-color: var(--yoy-blue);
}

.yoy-date-range {
  display: grid;
  grid-template-columns: minmax(145px, 1fr) 12px minmax(145px, 1fr);
  gap: 8px;
  align-items: center;
}

.yoy-date-range label {
  min-width: 0;
}

.yoy-date-range input {
  padding-right: 12px;
  font-variant-numeric: tabular-nums;
}

.yoy-date-range > i {
  color: var(--yoy-muted);
  font-size: 18px;
  font-style: normal;
  text-align: center;
}

.yoy-compare-period {
  display: grid;
  gap: 7px;
  align-content: end;
  min-height: 50px;
  padding-bottom: 4px;
}

.yoy-compare-period strong {
  color: var(--yoy-ink);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.yoy-freshness {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  min-height: 50px;
  color: var(--yoy-muted);
  font-size: 13px;
  font-weight: 680;
  white-space: nowrap;
}

.yoy-refresh {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  padding: 7px;
  cursor: pointer;
  border-radius: 50%;
}

.yoy-refresh:hover {
  background: var(--yoy-blue-faint);
}

.yoy-refresh img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.yoy-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.yoy-kpi-card,
.yoy-card {
  min-width: 0;
  border: 1px solid var(--yoy-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(21, 36, 72, .025);
}

.yoy-kpi-card {
  min-height: 172px;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 22px 24px;
}

.yoy-kpi-card > img {
  display: block;
  width: 78px;
  height: 78px;
  object-fit: contain;
}

.yoy-kpi-content {
  min-width: 0;
}

.yoy-kpi-content h2 {
  color: var(--yoy-ink);
  font-size: 16px;
  line-height: 1.25;
  margin-bottom: 10px;
}

.yoy-kpi-years {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  margin-bottom: 12px;
}

.yoy-kpi-years > div {
  min-width: 0;
  padding-right: 18px;
}

.yoy-kpi-years > div + div {
  border-left: 1px solid var(--yoy-line);
  padding-right: 0;
  padding-left: 22px;
}

.yoy-kpi-years span {
  display: block;
  color: var(--yoy-muted);
  font-size: 13px;
  font-weight: 720;
  margin-bottom: 5px;
}

.yoy-kpi-years strong {
  display: block;
  color: var(--yoy-ink);
  font-size: clamp(18px, 1.45vw, 29px);
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.yoy-kpi-delta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  min-height: 20px;
  font-size: 14px;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.yoy-state-good {
  color: var(--yoy-green) !important;
}

.yoy-state-bad {
  color: var(--yoy-red) !important;
}

.yoy-state-neutral {
  color: var(--yoy-muted) !important;
}

.yoy-kpi-card.is-muted {
  opacity: .62;
}

.yoy-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.56fr) minmax(410px, 1fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 20px;
}

.yoy-card {
  padding: 20px 22px;
}

.yoy-section-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.yoy-section-head h2,
.yoy-insights-card h2 {
  color: var(--yoy-ink);
  font-size: 18px;
  line-height: 1.3;
}

.yoy-ranking-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
}

.yoy-metric-tabs button {
  min-width: 115px;
  height: 43px;
  padding: 0 18px;
  font-size: 14px;
}

.yoy-sort-control {
  min-width: min(310px, 42%);
}

.yoy-sort-control select {
  height: 43px;
  font-size: 13px;
  font-weight: 720;
}

.yoy-ranking-legend {
  display: grid;
  grid-template-columns: max-content max-content 1fr 72px 72px;
  align-items: center;
  gap: 20px;
  min-height: 58px;
  border-bottom: 1px solid var(--yoy-line);
  color: var(--yoy-muted);
  font-size: 13px;
  font-weight: 680;
}

.yoy-ranking-legend span,
.yoy-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.yoy-ranking-legend i,
.yoy-chart-legend i {
  display: inline-block;
  width: 15px;
  height: 8px;
  border-radius: 1px;
}

.yoy-ranking-legend i.current,
.yoy-chart-legend i.current {
  background: var(--yoy-blue);
}

.yoy-ranking-legend i.previous {
  background: var(--yoy-blue-soft);
}

.yoy-chart-legend i.previous {
  height: 0;
  border-top: 2px dashed #73b3ff;
  border-radius: 0;
}

.yoy-ranking-legend em {
  justify-self: end;
  color: var(--yoy-muted);
  font-style: normal;
  font-weight: 780;
}

.yoy-ranking-row {
  display: grid;
  grid-template-columns: 42px 145px minmax(260px, 1fr) 92px 82px;
  gap: 12px;
  align-items: center;
  min-height: 78px;
  border-bottom: 1px solid var(--yoy-line);
}

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

.yoy-rank {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border: 1px solid #d7e1ed;
  border-radius: 50%;
  color: var(--yoy-muted);
  font-size: 13px;
  font-weight: 820;
}

.yoy-manager-name {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.yoy-manager-name strong,
.yoy-manager-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yoy-manager-name strong {
  font-size: 14px;
}

.yoy-manager-name span {
  color: var(--yoy-muted);
  font-size: 13px;
}

.yoy-bars {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.yoy-bar-line {
  position: relative;
  height: 22px;
  display: flex;
  align-items: center;
  min-width: 0;
}

.yoy-bar-line i {
  display: block;
  min-width: 2px;
  height: 100%;
}

.yoy-bar-line i.current {
  background: var(--yoy-blue);
}

.yoy-bar-line i.previous {
  background: var(--yoy-blue-soft);
}

.yoy-bar-line strong {
  margin-left: 9px;
  color: #354465;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.yoy-row-delta {
  justify-self: end;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.yoy-chart-column {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.yoy-main-grid.is-without-managers {
  grid-template-columns: minmax(0, 1fr);
}

.yoy-main-grid.is-without-managers .yoy-chart-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: none;
}

.yoy-chart-card {
  min-height: 268px;
  padding: 18px 20px 14px;
}

.yoy-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 10px;
  color: var(--yoy-muted);
  font-size: 12px;
  font-weight: 680;
}

.yoy-granularity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--yoy-line);
  border-radius: 9px;
  color: #344365;
  font-size: 13px;
  font-weight: 720;
  white-space: nowrap;
}

.yoy-chart {
  position: relative;
  height: 190px;
  margin-top: 13px;
  padding: 22px 20px 28px 56px;
}

.yoy-axis-title {
  position: absolute;
  top: 2px;
  left: 0;
  color: var(--yoy-muted);
  font-size: 11px;
  font-weight: 680;
}

.yoy-y-axis {
  position: absolute;
  inset: 22px auto 28px 0;
  width: 48px;
  color: var(--yoy-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.yoy-y-axis span {
  position: absolute;
  right: 7px;
  transform: translateY(-50%);
  white-space: nowrap;
}

.yoy-plot {
  position: relative;
  width: 100%;
  height: 100%;
}

.yoy-plot svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.yoy-plot line.grid {
  stroke: #e4ebf3;
  stroke-width: .6;
  vector-effect: non-scaling-stroke;
}

.yoy-plot polyline {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.yoy-plot polyline.current {
  stroke: var(--yoy-blue);
}

.yoy-plot polyline.previous {
  stroke: #75b5ff;
  stroke-dasharray: 8 7;
}

.yoy-chart-dot {
  position: absolute;
  right: -5px;
  width: 11px;
  height: 11px;
  border: 3px solid #fff;
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 0 2px currentColor;
}

.yoy-chart-dot.current {
  color: var(--yoy-blue);
  background: var(--yoy-blue);
}

.yoy-chart-dot.previous {
  color: #9ac8fb;
  background: #9ac8fb;
}

.yoy-x-axis {
  position: absolute;
  right: 20px;
  bottom: 0;
  left: 56px;
  height: 23px;
  color: var(--yoy-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.yoy-x-axis span {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.yoy-x-axis span:first-child {
  transform: none;
}

.yoy-x-axis span:last-child {
  transform: translateX(-100%);
}

.yoy-end-label {
  position: absolute;
  left: calc(100% + 16px);
  transform: translateY(-50%);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.yoy-end-label.current {
  color: var(--yoy-blue);
}

.yoy-end-label.previous {
  color: #73adf2;
}

.yoy-cumulative-chart {
  padding-right: 95px;
}

.yoy-cumulative-chart .yoy-x-axis {
  right: 95px;
}

.yoy-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(340px, .92fr);
  gap: 20px;
  align-items: stretch;
}

.yoy-bottom-grid.is-without-managers {
  grid-template-columns: minmax(0, 1fr);
}

.yoy-bottom-grid.is-without-managers .yoy-insights-card {
  min-height: 240px;
}

.yoy-table-card {
  overflow: hidden;
  padding: 18px 0 0;
}

.yoy-table-card .yoy-section-head {
  padding: 0 22px 12px;
}

.yoy-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.yoy-table-wrap table {
  width: 100%;
  min-width: 910px;
  border-collapse: collapse;
  color: var(--yoy-ink);
  table-layout: fixed;
}

.yoy-table-wrap th,
.yoy-table-wrap td {
  height: 40px;
  border-bottom: 1px solid var(--yoy-line);
  padding: 8px 12px;
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.yoy-table-wrap thead th {
  color: #576684;
  font-size: 11px;
  font-weight: 780;
}

.yoy-table-wrap th:first-child,
.yoy-table-wrap td:first-child {
  width: 210px;
  text-align: left;
}

.yoy-table-wrap tbody th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  overflow: hidden;
  background: #fff;
  text-overflow: ellipsis;
}

.yoy-table-wrap tfoot th,
.yoy-table-wrap tfoot td {
  border-bottom: 0;
  background: #f3f7fc;
  font-weight: 820;
}

.yoy-table-wrap tfoot th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
}

.yoy-sparkline {
  display: block;
  width: 88px;
  height: 25px;
  margin-left: auto;
}

.yoy-sparkline polyline {
  fill: none;
  stroke: var(--yoy-blue);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.yoy-insights-card {
  min-height: 330px;
  display: flex;
  flex-direction: column;
  padding: 22px 26px;
}

.yoy-insights-card header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.yoy-insights-card header img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.yoy-insights-card ul {
  display: grid;
  gap: 14px;
  margin: 20px 0 24px;
  padding-left: 25px;
  color: #465475;
  font-size: 14px;
  line-height: 1.5;
}

.yoy-insights-card li::marker {
  color: var(--yoy-ink);
}

.yoy-insights-card a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  color: var(--yoy-blue);
  font-size: 14px;
  font-weight: 800;
}

.yoy-insights-card a span {
  font-size: 23px;
  line-height: 1;
}

.yoy-empty {
  min-height: 170px;
  display: grid;
  place-items: center;
  color: var(--yoy-muted);
  font-size: 14px;
  text-align: center;
}

@media (max-width: 2300px) {
  .yoy-filter-bar {
    grid-template-columns:
      minmax(175px, .7fr)
      minmax(205px, .85fr)
      minmax(365px, 1.4fr)
      minmax(320px, 1.2fr)
      minmax(195px, .75fr);
  }

  .yoy-freshness {
    grid-column: 1 / -1;
    min-height: 30px;
  }

  .yoy-kpi-card {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 13px;
    padding: 19px 18px;
  }

  .yoy-kpi-card > img {
    width: 60px;
    height: 60px;
  }
}

@media (max-width: 2200px) {
  .yoy-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .yoy-kpi-card {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .yoy-kpi-card > img {
    width: 68px;
    height: 68px;
  }

  .yoy-kpi-years strong {
    font-size: 26px;
  }
}

@media (min-width: 1451px) {
  html.sidebar-collapsed .yoy-filter-bar {
    grid-template-columns:
      minmax(170px, .78fr)
      minmax(200px, .95fr)
      minmax(380px, 1.5fr)
      minmax(330px, 1.28fr)
      minmax(200px, .78fr)
      minmax(275px, 1.05fr);
  }

  html.sidebar-collapsed .yoy-freshness {
    grid-column: auto;
  }

  html.sidebar-collapsed .yoy-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  html.sidebar-collapsed .yoy-kpi-card {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    padding: 18px 16px;
  }

  html.sidebar-collapsed .yoy-kpi-card > img {
    width: 56px;
    height: 56px;
  }

  html.sidebar-collapsed .yoy-kpi-years strong {
    font-size: clamp(19px, 1.35vw, 27px);
  }

  html.sidebar-collapsed .yoy-insights-card {
    min-height: 475px;
  }

  html.sidebar-collapsed .yoy-table-wrap th,
  html.sidebar-collapsed .yoy-table-wrap td {
    height: 42px;
  }
}

@media (max-width: 1450px) {
  .year-over-year-page .content {
    padding: 16px 18px 30px;
  }

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

  .yoy-period-field,
  .yoy-date-range {
    grid-column: span 2;
  }

  .yoy-freshness {
    grid-column: auto;
  }

  .yoy-kpi-years strong {
    font-size: 25px;
  }

  .yoy-main-grid,
  .yoy-bottom-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .yoy-chart-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
  }
}

@media (max-width: 900px) {
  .year-over-year-page .content {
    padding: 12px 12px 26px;
  }

  .yoy-filter-bar {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding-right: 0;
    padding-left: 0;
  }

  .yoy-period-field,
  .yoy-date-range {
    grid-column: auto;
  }

  .yoy-freshness {
    justify-content: space-between;
    white-space: normal;
  }

  .yoy-kpi-grid,
  .yoy-chart-column,
  .yoy-main-grid.is-without-managers .yoy-chart-column {
    grid-template-columns: minmax(0, 1fr);
  }

  .yoy-ranking-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .yoy-metric-tabs {
    overflow-x: auto;
  }

  .yoy-metric-tabs button {
    min-width: 105px;
  }

  .yoy-sort-control {
    min-width: 0;
    width: 100%;
  }

  .yoy-ranking-card {
    overflow-x: auto;
  }

  .yoy-ranking-card > * {
    min-width: 760px;
  }

  .yoy-ranking-row {
    grid-template-columns: 42px 135px minmax(250px, 1fr) 88px 76px;
  }
}

@media (max-width: 560px) {
  .yoy-period-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .yoy-period-tabs button,
  .yoy-period-tabs button:first-child,
  .yoy-period-tabs button:last-child {
    border: 1px solid var(--yoy-line);
    border-radius: 8px;
  }

  .yoy-period-tabs button.active {
    border-color: var(--yoy-blue);
  }

  .yoy-date-range {
    grid-template-columns: minmax(0, 1fr);
  }

  .yoy-date-range > i {
    display: none;
  }

  .yoy-kpi-grid {
    gap: 12px;
  }

  .yoy-kpi-card {
    min-height: 150px;
    grid-template-columns: 54px minmax(0, 1fr);
    padding: 16px;
  }

  .yoy-kpi-card > img {
    width: 52px;
    height: 52px;
  }

  .yoy-kpi-years strong {
    font-size: 20px;
  }

  .yoy-card {
    padding: 16px;
  }

  .yoy-chart-card {
    padding-right: 10px;
    padding-left: 10px;
  }

  .yoy-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .yoy-granularity {
    width: fit-content;
  }

  .yoy-end-label {
    display: none;
  }

  .yoy-cumulative-chart {
    padding-right: 20px;
  }

  .yoy-cumulative-chart .yoy-x-axis {
    right: 20px;
  }
}

/* Match the annual reference: a single compact control line above the KPIs. */
.mw-period-year .mw-filter-controls {
  grid-template-columns: 250px max-content 126px max-content max-content;
  grid-template-areas: "focus period year toggle updated";
  column-gap: 8px;
}

.mw-period-quarter.mw-period-year .mw-filter-controls {
  grid-template-columns: 250px max-content 142px 126px max-content max-content;
  grid-template-areas: "focus period context year toggle updated";
}

@media (max-width: 1700px) {
  .mw-period-quarter.mw-period-year .mw-filter-controls {
    grid-template-columns: 250px max-content 142px 126px max-content;
    grid-template-areas: "focus period context year toggle";
  }

  .mw-period-quarter.mw-period-year .mw-updated {
    display: none;
  }
}

@media (max-width: 1400px) {
  .mw-period-year .mw-filter-controls {
    grid-template-columns: minmax(220px, 1fr) max-content 112px;
    grid-template-areas:
      "focus period year"
      ". toggle toggle";
  }

  .mw-period-quarter.mw-period-year .mw-filter-controls {
    grid-template-columns: minmax(220px, 1fr) max-content 126px 112px;
    grid-template-areas:
      "focus period context year"
      ". toggle toggle toggle";
  }

  .mw-period-year .mw-updated {
    display: none;
  }
}

@media (max-width: 1200px) {
  .mw-period-year .mw-filter-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "focus focus"
      "period period"
      "year toggle";
  }

  .mw-period-quarter.mw-period-year .mw-filter-controls {
    grid-template-areas:
      "focus focus"
      "period period"
      "context year"
      "toggle toggle";
  }
}
