
/* =========================================================
   НВО/ДЗИ използва нормалната навигация от base.html
========================================================= */

body:has(.nvo-page) {
  background: #efe7d8;
}

/*
  Страницата остава по цялата ширина,
  но header/navbar вече НЕ се скриват.
*/
body:has(.nvo-page) main.container {
  width: 100%;
  max-width: none !important;
  margin-top: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.nvo-page {
  --paper: #f5efe2;
  --paper-soft: #fffaf0;
  --ink: #172033;
  --muted: #657080;
  --line: #d8cbb8;
  --line-dark: #243044;
  --blue: #315a7d;
  --green: #4f7b55;
  --red: #b0523e;
  --gold: #c5912d;
  --shadow: 0 18px 0 rgba(23,32,51,.10);
  color: var(--ink);
  min-height: 100vh;
  padding: 22px;
  background:
    linear-gradient(90deg, rgba(23,32,51,.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(23,32,51,.045) 1px, transparent 1px),
    radial-gradient(circle at 16% 12%, rgba(197,145,45,.20), transparent 28%),
    radial-gradient(circle at 84% 8%, rgba(49,90,125,.16), transparent 30%),
    #efe7d8;
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
}


/* Защитен слой срещу глобални стилове от base.html: маха бял текст/сенки върху светлия дизайн */
.nvo-page,
.nvo-page :where(h1, h2, h3, h4, p, div, span, label, td, input, select) {
  color: var(--ink) !important;
  text-shadow: none !important;
}

.nvo-page :where(.nvo-subtitle, .nvo-panel-subtitle, .nvo-city, .nvo-rank-sub, .nvo-winner-meta) {
  color: var(--muted) !important;
}

.nvo-page :where(.nvo-label, .nvo-stat-label, .nvo-rank-label) {
  color: #3d4858 !important;
}

.nvo-page :where(.nvo-button, .nvo-table th, .nvo-winner-kicker),
.nvo-hero-card::after {
  color: #fff8ea !important;
  text-shadow: none !important;
}

.nvo-page canvas {
  opacity: 1 !important;
  filter: none !important;
}

.nvo-page .nvo-chart-box,
.nvo-page .nvo-chart-box * {
  color: #172033 !important;
  text-shadow: none !important;
}

.nvo-page canvas {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  background: #172033 !important;
  border-radius: 18px;
}

.nvo-wrap {
  width: min(1240px, 100%);
  margin: 0 auto;
}

.nvo-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(330px, .78fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.nvo-hero-card,
.nvo-filter-card,
.nvo-stat,
.nvo-panel {
  border: 2px solid var(--line-dark);
  background: var(--paper-soft);
  box-shadow: var(--shadow);
}

.nvo-hero-card {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  padding: 34px clamp(22px, 4vw, 52px);
  border-radius: 8px 34px 8px 34px;
  display: grid;
  align-content: end;
}

.nvo-hero-card::before {
  display: none !important;
}

.nvo-hero-card::after {
  content: "НВО / ДЗИ";
  position: absolute;
  left: -42px;
  top: 42px;
  padding: 9px 72px;
  transform: rotate(-12deg);
  border: 2px solid var(--line-dark);
  background: #d85f47;
  color: #fff8e8;
  font-weight: 950;
  letter-spacing: .12em;
  font-size: 12px;
  text-transform: uppercase;
}

.nvo-eyebrow {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px 11px 7px;
  border: 2px solid var(--line-dark);
  background: #f0c761;
  color: #172033;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
  box-shadow: 5px 5px 0 rgba(23,32,51,.14);
}

.nvo-title {
  max-width: 780px;
  margin: 0;
  font-size: clamp(34px, 6.2vw, 82px);
  line-height: .9;
  letter-spacing: -.065em;
  font-weight: 1000;
  text-wrap: balance;
}

.nvo-title em {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 700;
  letter-spacing: -.055em;
}

.nvo-gradient {
  color: var(--red);
  background: none;
}

.nvo-subtitle {
  max-width: 690px;
  margin: 20px 0 0;
  color: #465363 !important;
  font-size: 18px;
  line-height: 1.62;
}

.nvo-filter-card {
  border-radius: 34px 8px 34px 8px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255,250,240,.92), rgba(241,228,204,.92)),
    var(--paper-soft);
}

.nvo-filter-title {
  position: relative;
  margin: 0 0 18px;
  padding-bottom: 12px;
  font-size: 22px;
  font-weight: 1000;
  letter-spacing: -.035em;
}

.nvo-filter-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 54px;
  height: 4px;
  background: var(--red);
}

.nvo-grid {
  display: grid;
  gap: 13px;
}

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

.nvo-field {
  display: grid;
  gap: 7px;
}

.nvo-label {
  color: #3d4858 !important;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.nvo-input,
.nvo-select {
  width: 100%;
  border: 2px solid var(--line-dark);
  background: #fff8ea;
  color: var(--ink) !important;
  -webkit-text-fill-color: var(--ink) !important;
  opacity: 1 !important;
  border-radius: 4px 15px 4px 15px;
  padding: 12px 13px;
  outline: none;
  font-weight: 850;
  box-shadow: inset 0 -3px 0 rgba(23,32,51,.07);
}


.nvo-input::placeholder {
  color: #7a8492 !important;
  -webkit-text-fill-color: #7a8492 !important;
  opacity: 1 !important;
}

.nvo-select option {
  color: #172033 !important;
  background: #fff8ea !important;
}

.nvo-panel-title,
.nvo-filter-title,
.nvo-title,
.nvo-title em,
.nvo-stat-value,
.nvo-rank-value,
.nvo-winner-name,
.nvo-school {
  color: var(--ink) !important;
  text-shadow: none !important;
}

.nvo-title em,
.nvo-gradient {
  color: var(--red) !important;
}

.nvo-input:focus,
.nvo-select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(176,82,62,.14), inset 0 -3px 0 rgba(23,32,51,.07);
}

.nvo-button {
  width: 100%;
  border: 2px solid var(--line-dark);
  cursor: pointer;
  color: #fff8ea !important;
  -webkit-text-fill-color: #fff8ea !important;
  background: var(--ink);
  border-radius: 18px 4px 18px 4px;
  padding: 14px 16px;
  font-weight: 1000;
  letter-spacing: .02em;
  box-shadow: 7px 7px 0 rgba(176,82,62,.35);
  transition: transform .16s ease, box-shadow .16s ease;
}

.nvo-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 10px 10px 0 rgba(176,82,62,.35);
}

.nvo-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.nvo-stat {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  border-radius: 6px 24px 6px 24px;
  padding: 18px;
  background: #fff8ea;
}

.nvo-stat:nth-child(2n) {
  transform: translateY(10px);
  background: #f2e2c4;
}

.nvo-stat:nth-child(3n) {
  background: #e7efe2;
}

.nvo-stat::before {
  content: "";
  position: absolute;
  right: 14px;
  top: 14px;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: var(--red);
  opacity: .16;
}

.nvo-stat-icon {
  display: none;
}

.nvo-stat-label {
  color: #3d4858 !important;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nvo-stat-value {
  margin-top: 19px;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: .9;
  font-weight: 1000;
  letter-spacing: -.06em;
}

.nvo-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.nvo-panel {
  min-width: 0;
  border-radius: 26px 8px 26px 8px;
  padding: 20px;
  background: rgba(255,248,234,.94);
}

.nvo-section-grid .nvo-panel:nth-child(even) {
  border-radius: 8px 26px 8px 26px;
}

.nvo-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  border-bottom: 2px solid rgba(23,32,51,.13);
  padding-bottom: 13px;
}

.nvo-panel-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.05;
  font-weight: 1000;
  letter-spacing: -.04em;
}

.nvo-panel-subtitle {
  margin: 6px 0 0;
  color: var(--muted) !important;
  font-size: 13px;
  line-height: 1.4;
}

.nvo-chart-box {
  position: relative;
  height: 330px;
  border-radius: 18px 4px 18px 4px;
  border: 1px dashed rgba(23,32,51,.24);
  background:
    linear-gradient(180deg, rgba(255,255,255,.58), rgba(255,255,255,.18)),
    #fbf3e4;
  padding: 10px;
}

.nvo-table-wrap {
  overflow: auto;
  border-radius: 18px 4px 18px 4px;
  border: 2px solid var(--line-dark);
  background: #fff8ea;
}

.nvo-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 850px;
}

.nvo-table th {
  text-align: left;
  color: #fff8ea !important;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--ink);
  padding: 13px 14px;
  white-space: nowrap;
}

.nvo-table td {
  padding: 13px 14px;
  border-top: 1px solid rgba(23,32,51,.13);
  color: var(--ink) !important;
  vertical-align: middle;
}

.nvo-table tbody tr:nth-child(even) {
  background: rgba(216,203,184,.24);
}

.nvo-rank {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line-dark);
  border-radius: 50%;
  background: #f0c761;
  color: var(--ink);
  font-weight: 1000;
}

.nvo-school {
  font-weight: 1000;
  letter-spacing: -.015em;
}

.nvo-city {
  color: var(--muted) !important;
  font-size: 13px;
  margin-top: 3px;
}

.nvo-score {
  display: inline-flex;
  align-items: center;
  border-bottom: 4px solid rgba(79,123,85,.24);
  color: #31563a !important;
  font-weight: 1000;
}

.nvo-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border: 2px solid var(--line-dark);
  border-radius: 999px;
  background: #e9d3a9;
  color: var(--ink) !important;
  font-weight: 950;
  font-size: 12px;
  white-space: nowrap;
}

.nvo-full {
  grid-column: 1 / -1;
}

.nvo-empty {
  color: var(--muted);
  text-align: center;
  padding: 40px 20px;
}

.nvo-loader {
  display: none;
  margin: 18px 0;
  padding: 14px 16px;
  border: 2px solid var(--line-dark);
  border-radius: 18px 4px 18px 4px;
  background: #fff8ea;
  color: var(--ink) !important;
  font-weight: 950;
  box-shadow: 7px 7px 0 rgba(23,32,51,.10);
}

.nvo-loader.show {
  display: block;
}

.nvo-rank-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.nvo-rank-card {
  min-height: 132px;
  border: 2px solid var(--line-dark);
  background: #f2e2c4;
  border-radius: 18px 4px 18px 4px;
  padding: 18px;
}

.nvo-rank-card:nth-child(2) {
  background: #e4ecd8;
  border-radius: 4px 18px 4px 18px;
}

.nvo-rank-card-wide {
  grid-column: 1 / -1;
  background: #e3edf2;
}

.nvo-rank-label {
  color: #3d4858 !important;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.nvo-rank-value {
  color: var(--ink);
  font-size: 36px;
  line-height: .95;
  font-weight: 1000;
  letter-spacing: -.06em;
}

.nvo-rank-sub {
  margin-top: 8px;
  color: #5a6675;
  font-size: 13px;
  line-height: 1.35;
}

.nvo-winner-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  border: 2px solid var(--line-dark);
  border-radius: 24px 4px 24px 4px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(240,199,97,.65), rgba(255,248,234,.92) 48%, rgba(227,237,242,.92)),
    #fff8ea;
  box-shadow: 9px 9px 0 rgba(49,90,125,.16);
}

.nvo-winner-kicker {
  width: fit-content;
  border: 2px solid var(--line-dark);
  background: var(--red);
  color: #fff8ea !important;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nvo-winner-name {
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1.03;
  font-weight: 1000;
  letter-spacing: -.045em;
}

.nvo-winner-meta {
  color: var(--muted) !important;
  font-weight: 750;
}

.nvo-winner-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 1100px) {
  .nvo-hero,
  .nvo-section-grid {
    grid-template-columns: 1fr;
  }

  .nvo-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .nvo-stat:nth-child(2n) {
    transform: none;
  }
}

@media (max-width: 640px) {
  .nvo-page {
    padding: 12px;
  }

  .nvo-hero-card,
  .nvo-filter-card,
  .nvo-panel {
    border-radius: 20px 6px 20px 6px;
    padding: 16px;
  }

  .nvo-hero-card {
    min-height: 330px;
  }

  .nvo-hero-card::before {
    width: 96px;
    height: 96px;
  }

  .nvo-filter-grid,
  .nvo-cards,
  .nvo-rank-grid {
    grid-template-columns: 1fr;
  }

  .nvo-rank-card-wide {
    grid-column: auto;
  }

  .nvo-chart-box {
    height: 280px;
  }
}
.nvo-export-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  grid-column: 1 / -1;
  margin-top: 2px;
}

.nvo-export-button {
  width: 100%;
  border: 2px solid var(--line-dark);
  cursor: pointer;
  color: var(--ink) !important;
  -webkit-text-fill-color: var(--ink) !important;
  background: #f0c761;
  border-radius: 14px 4px 14px 4px;
  padding: 12px 14px;
  font-weight: 1000;
  letter-spacing: .02em;
  box-shadow: 5px 5px 0 rgba(49,90,125,.22);
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.nvo-export-button:nth-child(2) {
  background: #e4ecd8;
}

.nvo-export-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 rgba(49,90,125,.22);
}

.nvo-export-button:disabled {
  cursor: wait;
  opacity: .65;
  transform: none;
}

@media (max-width: 640px) {
  .nvo-export-row {
    grid-template-columns: 1fr;
  }
}


