@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=Space+Grotesk:wght@400;600;700&display=swap");

:root {
  --bg: #eef3f6;
  --ink: #132235;
  --muted: #607284;
  --nav: #213447;
  --nav-border: #2f465e;
  --accent: #19b1ad;
  --accent-strong: #0e8f8b;
  --accent-soft: #e4f6f5;
  --panel: #ffffff;
  --border: #d8e1ea;
  --shadow: 0 12px 30px rgba(17, 34, 56, 0.12);
  --radius: 16px;
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "DM Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
  background:
    radial-gradient(900px 400px at 10% -10%, #d8f3f2 0%, rgba(216, 243, 242, 0) 70%),
    radial-gradient(900px 450px at 100% 0%, #e9eef9 0%, rgba(233, 238, 249, 0) 70%),
    var(--bg);
}

body.app-loading {
  overflow: hidden;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background:
    radial-gradient(900px 400px at 10% -10%, #d8f3f2 0%, rgba(216, 243, 242, 0) 70%),
    radial-gradient(900px 450px at 100% 0%, #e9eef9 0%, rgba(233, 238, 249, 0) 70%),
    var(--bg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.app-loading .loading-screen {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.loading-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-screen__spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(19, 34, 53, 0.2);
  border-top-color: var(--accent);
  animation: loading-spin 0.8s linear infinite;
}

.loading-screen__text {
  margin: 0;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.5px;
  color: var(--muted);
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  background: linear-gradient(135deg, #1e364a, #152637);
  color: #f4f8fb;
  border-bottom: 1px solid var(--nav-border);
  box-shadow: 0 6px 18px rgba(15, 27, 41, 0.22);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(25, 177, 173, 0.2);
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.6px;
  display: block;
}

.brand-sub {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(244, 248, 251, 0.68);
  display: block;
}

.nav-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-chip {
  background: rgba(244, 248, 251, 0.16);
  color: #f4f8fb;
  border: 1px solid rgba(244, 248, 251, 0.25);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.nav-button {
  font-size: 12px;
  padding: 8px 12px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(244, 248, 251, 0.15);
  color: rgba(244, 248, 251, 0.78);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
}

.nav-link:hover {
  border-color: rgba(25, 177, 173, 0.65);
  color: #ffffff;
  background: rgba(25, 177, 173, 0.2);
}

.nav-details {
  position: relative;
}

.nav-summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-summary::-webkit-details-marker {
  display: none;
}

.nav-details[open] .nav-link {
  border-color: rgba(25, 177, 173, 0.8);
  color: #ffffff;
  background: rgba(25, 177, 173, 0.22);
}

.nav-summary-icon {
  font-size: 12px;
  opacity: 0.7;
}

.dropdown-menu {
  position: absolute;
  top: 44px;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  min-width: 180px;
  padding: 8px;
  box-shadow: 0 18px 32px rgba(12, 26, 41, 0.18);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 20;
}

.dropdown-link {
  padding: 9px 12px;
  border-radius: 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.dropdown-link:hover {
  background: rgba(25, 177, 173, 0.12);
  color: #0f5d5b;
}

.page-container {
  max-width: 1400px;
  margin: 24px auto 40px;
  padding: 0 24px 40px;
  overflow-x: hidden;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.page-hero {
  background: linear-gradient(120deg, #ffffff, #f3fbfb);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.page-hero::after {
  content: "";
  position: absolute;
  top: -120px;
  right: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(25, 177, 173, 0.22), rgba(25, 177, 173, 0));
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
}

.page-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 720px;
}

.badges {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  background: var(--accent-soft);
  color: #0f5d5b;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.badge.dark {
  background: rgba(25, 177, 173, 0.16);
  color: #0f5d5b;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.panel--section {
  padding: 14px 16px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.summary-grid--modern {
  grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr);
}

.summary-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.summary-layout > .panel {
  height: 100%;
}

.summary-layout__pie {
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-layout__placeholder {
  display: flex;
  align-items: stretch;
}

.summary-placeholder {
  width: 100%;
  min-height: 260px;
  border: 2px solid var(--border);
  border-radius: 22px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
  background: #ffffff;
}

.summary-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #f7fbff;
}

.summary-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fbfd;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.summary-card--milestone {
  background: linear-gradient(180deg, #f8fbfd 0%, #eef8f8 100%);
}

.summary-card--performance {
  background: linear-gradient(180deg, #f9fbfe 0%, #eff4fb 100%);
}

.summary-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.summary-tabs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-chip {
  background: rgba(25, 177, 173, 0.12);
  color: #0f5d5b;
  border: 1px solid rgba(25, 177, 173, 0.3);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.summary-title {
  margin: 0;
  font-size: 14px;
  font-family: var(--font-display);
}

.summary-note {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.summary-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(216, 225, 234, 0.6);
}

.summary-item-label {
  color: #1b344a;
  font-weight: 600;
}

.summary-count {
  font-weight: 700;
  color: var(--ink);
}

.summary-link {
  color: #0f5d5b;
  text-decoration: none;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #bfe9e7;
  background: #e8f6f5;
}

.summary-link:hover {
  background: #d8f0ef;
  border-color: #8bd6d2;
}

.summary-layout__table .summary-link {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: inherit !important;
  font-weight: 700;
}

.summary-layout__table .summary-link:hover {
  background: transparent !important;
  border-color: transparent !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.summary-group {
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid rgba(216, 225, 234, 0.6);
  background: #ffffff;
  padding: 10px;
}

.summary-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-empty {
  font-size: 12px;
  color: var(--muted);
}

.summary-table-wrap {
  margin-top: 8px;
  overflow-x: auto;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.summary-table th,
.summary-table td {
  padding: 6px 6px;
  border-bottom: 1px solid rgba(216, 225, 234, 0.6);
  text-align: left;
  white-space: nowrap;
}

.summary-table th {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.summary-issue {
  font-weight: 600;
  color: #1d374c;
}

.summary-step-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(25, 177, 173, 0.3);
  background: rgba(25, 177, 173, 0.08);
  color: #0f5d5b;
  font-weight: 600;
}

.summary-step-count {
  font-weight: 700;
}

.summary-step-percent {
  color: var(--muted);
}

.summary-step-sep {
  color: var(--muted);
}


.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
}

.panel-meta {
  font-size: 12px;
  color: var(--muted);
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.inline-form .level-toggle-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.panel-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.panel-form .input-field {
  width: 100%;
}

.panel-form--inline {
  grid-template-columns: minmax(240px, 1fr) auto;
}

.input-field {
  flex: 1 1 220px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 14px;
  font-family: var(--font-body);
}

.input-field:focus {
  outline: 2px solid rgba(25, 177, 173, 0.3);
  border-color: var(--accent);
}

.primary-button {
  border: none;
  background: linear-gradient(135deg, #1bb6b1, #149a96);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.primary-button:hover {
  filter: brightness(1.05);
}

.ghost-button {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.ghost-button:hover {
  background: #f0f5f8;
}

.topbar .ghost-button {
  background: transparent;
  color: #f4f8fb;
  border-color: rgba(244, 248, 251, 0.35);
}

.topbar .ghost-button:hover {
  background: rgba(244, 248, 251, 0.12);
}

.nav-form {
  margin: 0;
}

.filter-panel {
  padding: 18px;
}

.filter-panel--compact {
  padding: 14px;
}

.filter-panel--compact .filter-row {
  gap: 12px;
}

.filter-panel--compact .filter-label {
  font-size: 11px;
  letter-spacing: 0.8px;
}

.filter-panel--compact .filter-columns {
  margin-top: 10px;
  padding-top: 10px;
}

.filter-panel--compact .filter-title {
  margin-bottom: 6px;
}

.filter-panel--compact .filter-help {
  margin-bottom: 6px;
}

.filter-panel--compact .primary-button,
.filter-panel--compact .ghost-button {
  padding: 8px 12px;
  font-size: 13px;
}

.filter-panel--compact .choices__inner {
  min-height: 36px;
  padding: 4px 6px;
}

.filter-panel--compact .choices__list--multiple .choices__item {
  padding: 3px 6px;
  font-size: 11px;
}

.summary-filter .filter-row {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: center;
}

.summary-filter .filter-field {
  grid-column: span 5;
}

.summary-filter .filter-actions {
  grid-column: span 2;
  justify-self: end;
}

.summary-filter .filter-field select.input-field {
  flex: 0 0 auto;
  min-height: 40px;
  height: 40px;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.panel-grid > .panel {
  grid-column: span 6;
}

.panel-grid--split {
  align-items: stretch;
}

.panel-grid--split .panel-grid__left {
  grid-column: span 7;
}

.panel-grid--split .panel-grid__right {
  grid-column: span 5;
  display: grid;
  gap: 16px;
  grid-template-rows: 1fr 1fr;
  height: 100%;
}

.panel-grid--split .panel-grid__right > .panel {
  height: 100%;
}

.panel-grid--split .filter-panel .filter-row {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
}

.panel-grid--split .filter-panel .filter-field {
  grid-column: span 5;
}

.panel-grid--split .filter-panel .filter-actions {
  grid-column: span 2;
  align-self: end;
  justify-self: end;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.filter-field {
  grid-column: span 5;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-field--wide {
  grid-column: span 12;
}

.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.filter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  grid-column: span 2;
  justify-self: end;
}

.filter-columns {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.filter-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  display: block;
  margin-bottom: 10px;
}

.filter-help {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}

.multi-select {
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  font-size: 13px;
  font-family: var(--font-body);
  background: #ffffff;
}

.multi-select:focus {
  outline: 2px solid rgba(25, 177, 173, 0.25);
  border-color: var(--accent);
}

.multi-select option {
  padding: 4px 6px;
}

.choices {
  width: 100%;
}

.choices[data-type*="select-one"]::after {
  display: none;
}

.choices__inner {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 40px;
  padding: 6px 8px;
  font-size: 13px;
  font-family: var(--font-body);
  max-width: 100%;
}

.choices__input {
  font-family: var(--font-body);
  font-size: 13px;
}

.choices__list--multiple .choices__item {
  background: #e8f6f5;
  color: #0f5d5b;
  border: 1px solid #bfe9e7;
  border-radius: 8px;
  font-size: 12px;
  padding: 4px 8px;
  margin: 2px 4px 2px 0;
}

.choices__list--multiple {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.choices__list--multiple .choices__item.is-highlighted {
  background: #d8f0ef;
  border-color: #8bd6d2;
}

.choices__list--dropdown {
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 20px rgba(12, 26, 41, 0.12);
  max-height: 240px;
  overflow-y: auto;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
  background: #e8f6f5;
  color: #0f5d5b;
}

.status-text {
  font-size: 13px;
  color: var(--muted);
}

.note {
  background: #f6fbff;
  border: 1px dashed #b9d9e6;
  border-radius: 12px;
  padding: 10px 14px;
  color: #2d4d62;
  font-size: 13px;
  margin-top: 10px;
}

.table-wrap {
  margin-top: 8px;
  overflow-x: auto;
  max-height: 520px;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.dash-table-container .dash-spreadsheet-container {
  border-radius: 12px;
  overflow: hidden;
}

@media (max-width: 900px) {
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .dropdown-menu {
    position: static;
    width: 100%;
    margin-top: 8px;
  }

  .page-title {
    font-size: 24px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid--modern {
    grid-template-columns: 1fr;
  }

  .summary-layout {
    grid-template-columns: 1fr;
  }

  .filter-row {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .filter-field {
    grid-column: span 6;
  }

  .filter-actions {
    grid-column: span 6;
    justify-self: start;
  }

  .panel-form {
    grid-template-columns: 1fr;
  }

  .panel-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .panel-grid > .panel {
    grid-column: span 6;
  }

  .panel-grid--split .panel-grid__left,
  .panel-grid--split .panel-grid__right {
    grid-column: span 6;
  }
}


.data-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  font-size: 12px;
  background: #ffffff;
}

.data-table--freeze {
  --freeze-col-1: 240px;
  --freeze-col-2: 200px;
}

.data-table--freeze th:nth-child(1),
.data-table--freeze td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 4;
  min-width: var(--freeze-col-1);
  max-width: var(--freeze-col-1);
  background: #ffffff;
}

.data-table--freeze th:nth-child(2),
.data-table--freeze td:nth-child(2) {
  position: sticky;
  left: var(--freeze-col-1);
  z-index: 3;
  min-width: var(--freeze-col-2);
  max-width: var(--freeze-col-2);
  background: #ffffff;
}

.data-table--freeze thead th:nth-child(1),
.data-table--freeze thead th:nth-child(2) {
  background: linear-gradient(135deg, #1c3244, #223d52);
  color: #ffffff;
}

.data-table--freeze thead th:nth-child(1),
.data-table--freeze thead th:nth-child(2) {
  z-index: 5;
}

.data-table--freeze tbody tr:nth-child(odd) td:nth-child(1),
.data-table--freeze tbody tr:nth-child(odd) td:nth-child(2) {
  background: #f7f9fb;
}

.data-table--freeze tbody tr:hover td:nth-child(1),
.data-table--freeze tbody tr:hover td:nth-child(2) {
  background: #edf6f5;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table--center th,
.data-table--center td {
  text-align: center !important;
  vertical-align: middle;
}

.data-table--center th:first-child,
.data-table--center td:first-child {
  text-align: center !important;
}

.table--full-center th,
.table--full-center td {
  text-align: center !important;
  vertical-align: middle;
}


.data-table th {
  text-align: left;
  padding: 10px 12px;
  background: linear-gradient(135deg, #1c3244, #223d52);
  color: #ffffff;
  border: 1px solid #1c3244;
  font-weight: 700;
}

.data-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}

.data-table tbody tr:nth-child(odd) {
  background: #f7f9fb;
}

.data-table tbody tr:hover {
  background: #edf6f5;
}

.site-kpi-link {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
}

.site-kpi-link:hover {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.data-table td.editable-cell {
  background: #f1fbfb;
}

.table-input {
  width: 100%;
  min-width: 120px;
  max-width: 240px;
  border-radius: 8px;
  border: 1px solid #cfe3e8;
  padding: 6px 8px;
  font-size: 12px;
  font-family: var(--font-body);
}


.table-input:focus {
  outline: 2px solid rgba(25, 177, 173, 0.25);
  border-color: var(--accent);
}

.table-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.pagination {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-panel {
  max-width: 520px;
  margin: 0 auto;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form .input-field {
  flex: 0 0 auto;
  height: 44px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
}

.page-link {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.page-link:hover {
  background: #e8f6f5;
  color: #0f5d5b;
}

.page-link.disabled {
  opacity: 0.5;
  cursor: default;
}

.page-status {
  font-size: 12px;
  color: var(--muted);
}

body.theme-dark {
  --bg: #0f1721;
  --ink: #e6edf5;
  --muted: #9bb0c3;
  --nav: #0f1b28;
  --nav-border: #1d2a38;
  --accent: #2bc7c2;
  --accent-strong: #1ab1ac;
  --accent-soft: #0f2c31;
  --panel: #111c27;
  --border: #243243;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  background:
    radial-gradient(900px 400px at 10% -10%, rgba(43, 199, 194, 0.18) 0%, rgba(15, 23, 33, 0) 70%),
    radial-gradient(900px 450px at 100% 0%, rgba(64, 93, 130, 0.28) 0%, rgba(15, 23, 33, 0) 70%),
    var(--bg);
}

body.theme-dark .page-hero {
  background: linear-gradient(120deg, #111f2b, #0f2228);
  border-color: var(--border);
}

body.theme-dark .page-hero::after {
  background: radial-gradient(circle, rgba(43, 199, 194, 0.2), rgba(43, 199, 194, 0));
}

body.theme-dark .dropdown-menu {
  background: #111c27;
  border-color: var(--border);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.45);
}

body.theme-dark .dropdown-link {
  color: var(--ink);
}

body.theme-dark .dropdown-link:hover {
  background: rgba(43, 199, 194, 0.12);
  color: #d9fffd;
}

body.theme-dark .summary-block {
  background: #131f2a;
}

body.theme-dark .summary-placeholder {
  background: #0f1b25;
  border-color: #2a3d50;
}

body.theme-dark .summary-card {
  background: #101a24;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.theme-dark .summary-card--milestone {
  background: linear-gradient(180deg, #111c27 0%, #0f2328 100%);
}

body.theme-dark .summary-card--performance {
  background: linear-gradient(180deg, #111c27 0%, #0f1f2b 100%);
}

body.theme-dark .summary-item {
  background: #0f1b25;
  border-color: rgba(36, 50, 67, 0.8);
}

body.theme-dark .summary-item-label {
  color: #cfe0ef;
}

body.theme-dark .summary-group {
  background: #0f1b25;
  border-color: rgba(36, 50, 67, 0.8);
}

body.theme-dark .summary-table th {
  color: #a6b7c8;
}

body.theme-dark .summary-table td {
  border-bottom-color: rgba(36, 50, 67, 0.8);
}

body.theme-dark .summary-issue {
  color: #d8e7f5;
}

body.theme-dark .summary-step-link {
  color: #bff4f2;
  border-color: rgba(43, 199, 194, 0.35);
  background: rgba(43, 199, 194, 0.12);
}

body.theme-dark .summary-step-percent,
body.theme-dark .summary-step-sep,
body.theme-dark .summary-note {
  color: var(--muted);
}

body.theme-dark .summary-link {
  background: rgba(43, 199, 194, 0.12);
  border-color: rgba(43, 199, 194, 0.35);
  color: #bff4f2;
}

body.theme-dark .summary-layout__table .summary-link {
  background: transparent !important;
  border-color: transparent !important;
  color: inherit !important;
}

body.theme-dark .input-field,
body.theme-dark .multi-select,
body.theme-dark .choices__inner,
body.theme-dark .choices__list--dropdown {
  background: #0f1b25;
  color: var(--ink);
  border-color: var(--border);
}

body.theme-dark .choices__input {
  background: transparent;
  color: var(--ink);
}

body.theme-dark .choices__list--single .choices__item,
body.theme-dark .choices__list--dropdown .choices__item {
  color: var(--ink);
}

body.theme-dark .choices__placeholder {
  color: var(--muted);
  opacity: 0.9;
}

body.theme-dark .choices__list--dropdown .choices__item--selectable.is-highlighted {
  background: rgba(43, 199, 194, 0.15);
  color: #d9fffd;
}

body.theme-dark .choices__list--multiple .choices__item {
  background: rgba(43, 199, 194, 0.14);
  color: #bff4f2;
  border-color: rgba(43, 199, 194, 0.35);
}

body.theme-dark .inline-form .level-toggle-option {
  color: #9fb9cf;
}

body.theme-dark .ghost-button {
  background: #0f1b25;
  color: var(--ink);
  border-color: var(--border);
}

body.theme-dark .ghost-button:hover {
  background: #132433;
}

body.theme-dark .topbar .ghost-button {
  background: transparent;
  color: #f4f8fb;
  border-color: rgba(244, 248, 251, 0.35);
}

body.theme-dark .note {
  background: #0f2231;
  border-color: #284459;
  color: #cfe0ef;
}

body.theme-dark .data-table {
  background: #0f1b25;
}

body.theme-dark .data-table td {
  border-color: var(--border);
}

body.theme-dark .data-table tbody tr:nth-child(odd) {
  background: #111f2b;
}

body.theme-dark .data-table tbody tr:hover {
  background: #142635;
}

body.theme-dark .site-kpi-link:hover {
  color: inherit;
}

body.theme-dark .data-table td.editable-cell {
  background: #132733;
}

body.theme-dark .data-table--freeze td:nth-child(1),
body.theme-dark .data-table--freeze td:nth-child(2) {
  background: #0f1b25;
}

body.theme-dark .data-table--freeze tbody tr:nth-child(odd) td:nth-child(1),
body.theme-dark .data-table--freeze tbody tr:nth-child(odd) td:nth-child(2) {
  background: #111f2b;
}

body.theme-dark .table-input {
  background: #0f1b25;
  color: var(--ink);
  border-color: #2a3d50;
}

body.theme-dark .table-input:focus {
  border-color: var(--accent);
}

body.theme-dark .page-link {
  background: #0f1b25;
  border-color: var(--border);
  color: var(--ink);
}

body.theme-dark .page-link:hover {
  background: rgba(43, 199, 194, 0.12);
  color: #d9fffd;
}

body.theme-dark .dash-table-container .dash-spreadsheet-inner th,
body.theme-dark .dash-table-container .dash-spreadsheet-inner td {
  background: #0f1b25;
  color: var(--ink);
  border-color: var(--border);
}

body.theme-dark .dash-table-container .dash-spreadsheet-inner td.dash-cell {
  background: #0f1b25 !important;
  color: var(--ink) !important;
}

body.theme-dark .dash-table-container .dash-spreadsheet-inner .dash-cell,
body.theme-dark .dash-table-container .dash-spreadsheet-inner .dash-cell-value {
  background: #0f1b25 !important;
  color: var(--ink) !important;
}

body.theme-dark .dash-table-container .dash-spreadsheet-inner tr:nth-child(odd) td.dash-cell {
  background: #111f2b !important;
}

body.theme-dark .dash-table-container .dash-spreadsheet-inner tr:nth-child(odd) .dash-cell,
body.theme-dark .dash-table-container .dash-spreadsheet-inner tr:nth-child(odd) .dash-cell-value {
  background: #111f2b !important;
}

body.theme-dark .dash-table-container .dash-spreadsheet-inner tr:nth-child(odd) td {
  background: #111f2b;
}

body.theme-dark .dash-table-container .dash-spreadsheet-inner td[style*="background"] {
  background: #0f1b25 !important;
  background-color: #0f1b25 !important;
}

body.theme-dark .dash-table-container .dash-spreadsheet-inner tr:nth-child(odd) td[style*="background"] {
  background: #111f2b !important;
  background-color: #111f2b !important;
}

body.theme-dark .dash-table-container .dash-spreadsheet-inner td .dash-cell-value[style*="background"] {
  background: transparent !important;
  background-color: transparent !important;
}

body.theme-dark .dash-table-container .dash-spreadsheet-inner .dash-cell-value,
body.theme-dark .dash-table-container .dash-spreadsheet-inner .dash-cell-value--selected,
body.theme-dark .dash-table-container .dash-spreadsheet-inner .dash-cell-value--editable,
body.theme-dark .dash-table-container .dash-spreadsheet-inner .dash-cell-value--focused {
  background: transparent !important;
  color: inherit !important;
}

body.theme-dark .dash-table-container .dash-spreadsheet-inner .dash-cell.focused .dash-cell-value,
body.theme-dark .dash-table-container .dash-spreadsheet-inner .dash-cell.cell--selected .dash-cell-value,
body.theme-dark .dash-table-container .dash-spreadsheet-inner .dash-cell.selected .dash-cell-value,
body.theme-dark .dash-table-container .dash-spreadsheet-inner .dash-cell.active .dash-cell-value {
  box-shadow: none !important;
  outline: none !important;
}

body.theme-dark .dash-table-container .dash-spreadsheet-inner tr:hover td {
  background: #142635;
}

body.theme-dark .dash-table-container .dash-spreadsheet-inner td.focused,
body.theme-dark .dash-table-container .dash-spreadsheet-inner td.cell--selected,
body.theme-dark .dash-table-container .dash-spreadsheet-inner td.selected,
body.theme-dark .dash-table-container .dash-spreadsheet-inner td.dash-cell.focused,
body.theme-dark .dash-table-container .dash-spreadsheet-inner td.dash-cell.cell--selected,
body.theme-dark .dash-table-container .dash-spreadsheet-inner td.dash-cell.selected,
body.theme-dark .dash-table-container .dash-spreadsheet-inner td.dash-cell.active {
  background: inherit !important;
  color: inherit !important;
  box-shadow: none !important;
  outline: none !important;
}

.kpi-page {
  gap: 18px;
}

.kpi-filter {
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid #cddced;
  background: linear-gradient(135deg, #fbfdff, #eef4fb);
  box-shadow: 0 10px 20px rgba(16, 38, 62, 0.08);
}

.kpi-filter-form {
  display: grid;
  grid-template-columns: minmax(280px, 420px) auto;
  gap: 14px;
  align-items: end;
}

.kpi-filter-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.kpi-filter .filter-label {
  color: #4a5f74;
}

.kpi-filter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.kpi-top-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
}

.kpi-site-badge {
  border: 1px solid #cb6b27;
  border-radius: 12px;
  background: linear-gradient(165deg, #f59545 0%, #e9722b 100%);
  color: #ffffff;
  padding: 14px 16px;
  min-height: 78px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  text-align: center;
  box-shadow: 0 8px 16px rgba(205, 106, 35, 0.24);
}

.kpi-site-badge strong {
  font-size: 28px;
  letter-spacing: 0.3px;
  font-family: var(--font-display);
}

.kpi-site-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.7px;
  opacity: 0.92;
}

.kpi-site-badge small {
  display: block;
  font-size: 10px;
  line-height: 1.35;
  opacity: 0.92;
}

.kpi-card-grid {
  display: grid;
  gap: 12px;
}

.kpi-card-grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi-card-grid--last-wide {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.35fr);
}

.kpi-card {
  border: 1px solid #cad8ea;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 8px 16px rgba(18, 40, 64, 0.08);
}

.kpi-card h3 {
  margin: 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  color: #f8fbff;
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.25;
}

.kpi-card--payload h3 {
  background: linear-gradient(135deg, #4d79bf 0%, #3f67ab 100%);
}

.kpi-card--prb h3 {
  background: linear-gradient(135deg, #3e66ad 0%, #2f5598 100%);
}

.kpi-value {
  margin: 0;
  min-height: 86px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 28px;
  line-height: 1.12;
  font-weight: 700;
  color: #0f233a;
  word-break: break-word;
}

.kpi-value--text {
  font-size: 16px;
  line-height: 1.35;
  font-weight: 600;
}

.kpi-placeholder {
  border: 1px solid #9bc57b;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fcf5 100%);
  min-height: 84px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 15px;
  color: #35522c;
}

.kpi-placeholder--top {
  border-style: dashed;
}

.kpi-placeholder--table {
  justify-content: flex-start;
  align-items: stretch;
  text-align: left;
  padding: 10px 12px;
  border: 0;
}

.kpi-site-info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.kpi-site-info-table th,
.kpi-site-info-table td {
  border: 1px solid #bcd2e6;
  padding: 6px 8px;
  color: #173553;
}

.kpi-site-info-table th {
  background: #eef6ff;
  font-weight: 700;
}

.kpi-site-info-table tbody tr:nth-child(even) td {
  background: #f8fbff;
}

.kpi-placeholder--chart {
  min-height: 82px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.kpi-payload-panel {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #cad8ea;
  background: linear-gradient(145deg, #ffffff 0%, #f3f8ff 100%);
  box-shadow: 0 10px 18px rgba(18, 40, 64, 0.08);
}

.kpi-payload-canvas-wrap {
  position: relative;
  height: 260px;
}

.kpi-placeholder--empty {
  min-height: 180px;
  font-size: 18px;
}

.kpi-sector-panel {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #cad8ea;
  background: linear-gradient(145deg, #ffffff 0%, #f3f8ff 100%);
  box-shadow: 0 10px 18px rgba(18, 40, 64, 0.08);
}

.kpi-sector-panel .panel-title {
  font-size: 20px;
}

.kpi-sector-panel .panel-meta {
  color: #5a7288;
}

.kpi-sector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 12px;
}

.kpi-sector-card {
  border: 1px solid #cedbeb;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kpi-sector-card h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: #153151;
  line-height: 1.2;
}

.kpi-sector-canvas-wrap {
  position: relative;
  height: 260px;
}

body.theme-dark .kpi-filter {
  border-color: #2e4156;
  background: linear-gradient(145deg, #0e1923, #132433);
  box-shadow: 0 10px 20px rgba(5, 12, 20, 0.35);
}

body.theme-dark .kpi-filter .filter-label {
  color: #9fb9cf;
}

body.theme-dark .kpi-site-badge {
  border-color: #bd5e22;
  background: linear-gradient(165deg, #cd7537 0%, #a95522 100%);
}

body.theme-dark .kpi-site-badge small {
  color: #f4dccf;
}

body.theme-dark .kpi-card {
  border-color: #32485e;
  background: #0f1b25;
  box-shadow: 0 10px 16px rgba(4, 9, 16, 0.38);
}

body.theme-dark .kpi-card--payload h3 {
  background: linear-gradient(135deg, #35588f 0%, #2d4b7d 100%);
}

body.theme-dark .kpi-card--prb h3 {
  background: linear-gradient(135deg, #2e4f84 0%, #253f6c 100%);
}

body.theme-dark .kpi-value {
  color: #d8e7f6;
}

body.theme-dark .kpi-placeholder {
  border-color: #5f9250;
  background: linear-gradient(145deg, #11202b, #102430);
  color: #b7d8a8;
}

body.theme-dark .kpi-payload-panel {
  border-color: #32485e;
  background: linear-gradient(145deg, #0e1923, #122332);
  box-shadow: 0 10px 18px rgba(4, 9, 16, 0.38);
}

body.theme-dark .kpi-site-info-table th,
body.theme-dark .kpi-site-info-table td {
  border-color: #33516d;
  color: #d4e5f7;
}

body.theme-dark .kpi-site-info-table th {
  background: #183248;
}

body.theme-dark .kpi-site-info-table tbody tr:nth-child(even) td {
  background: #102637;
}

body.theme-dark .kpi-sector-panel {
  border-color: #32485e;
  background: linear-gradient(145deg, #0e1923, #122332);
  box-shadow: 0 10px 18px rgba(4, 9, 16, 0.38);
}

body.theme-dark .kpi-sector-panel .panel-meta {
  color: #9fb9cf;
}

body.theme-dark .kpi-sector-card {
  background: #0f1b25;
  border-color: #32485e;
}

body.theme-dark .kpi-sector-card h4 {
  color: #d7e7f6;
}

body.theme-dark .loading-screen {
  background:
    radial-gradient(900px 400px at 10% -10%, rgba(13, 48, 57, 0.45) 0%, rgba(13, 48, 57, 0) 70%),
    radial-gradient(900px 450px at 100% 0%, rgba(35, 48, 73, 0.45) 0%, rgba(35, 48, 73, 0) 70%),
    #07121c;
}

body.theme-dark .loading-screen__spinner {
  border-color: rgba(214, 231, 246, 0.25);
  border-top-color: #32cbc7;
}

body.theme-dark .loading-screen__text {
  color: #9fb9cf;
}

@media (max-width: 1220px) {
  .kpi-card-grid--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-value {
    font-size: 26px;
  }

  .kpi-value--text {
    font-size: 15px;
  }

  .kpi-sector-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
}

@media (max-width: 900px) {
  .kpi-filter-form {
    grid-template-columns: 1fr;
  }

  .kpi-top-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card-grid--four {
    grid-template-columns: 1fr;
  }

  .kpi-sector-card h4 {
    font-size: 18px;
  }

  .kpi-sector-canvas-wrap {
    height: 230px;
  }
}
