@font-face {
  font-family: "TT Firs Neue";
  src: url("/static/fonts/tt-firs-neue/TT_Firs_Neue_Normal.woff2") format("woff2"),
    url("/static/fonts/tt-firs-neue/TT_Firs_Neue_Normal.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "TT Firs Neue";
  src: url("/static/fonts/tt-firs-neue/TT_Firs_Neue_Medium.woff2") format("woff2"),
    url("/static/fonts/tt-firs-neue/TT_Firs_Neue_Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-main: "TT Firs Neue", "Avenir Next", "Segoe UI", sans-serif;
  --cloud-dancer: #f0eee9;
  --cloud-dancer-deep: #e5e1d9;
  --ink: #222126;
  --ink-soft: #5f5c56;
  --card-radius: 6px;
  --line: rgba(34, 33, 38, 0.1);
  --glass: rgba(255, 255, 255, 0.66);
  --shadow: 0 20px 50px rgba(38, 36, 32, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-main);
  color: var(--ink);
  background: radial-gradient(circle at 20% 0%, #fff 0%, var(--cloud-dancer) 55%, #e9e5dc 100%);
  overflow-x: hidden;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.bg-orb {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(46px);
  opacity: 0.35;
  z-index: -1;
}

.orb-a {
  top: -120px;
  right: -60px;
  background: #d4c8b0;
}

.orb-b {
  bottom: -130px;
  left: -50px;
  background: #d8dfdf;
}

.layout {
  width: min(1400px, 100% - 32px);
  margin: 0 auto 20px;
  padding: 16px 26px 26px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  min-width: 0;
  flex: 1;
}

.glass {
  backdrop-filter: blur(16px);
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  border-radius: 24px;
}

.sidebar {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #7a7468;
}

.brand-label {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.brand h1 {
  margin: 2px 0 0;
  font-family: var(--font-main);
  font-weight: 500;
  font-size: 26px;
}

nav {
  display: grid;
  gap: 8px;
}

nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 12px 14px;
  border-radius: 14px;
  transition: all 0.2s ease;
}

nav a:hover,
nav a.active {
  background: rgba(34, 33, 38, 0.08);
}

.key-box {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.key-box label {
  font-size: 12px;
  color: var(--ink-soft);
}

.key-box input {
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.8);
}

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

.global-header {
  width: min(1400px, 100% - 32px);
  margin: 18px auto 0;
  padding: 14px 20px;
}

.global-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.global-title {
  margin: 6px 0 0;
  font-family: "TT Firs Neue", sans-serif;
  font-weight: 450;
  font-style: normal;
  font-size: 32px;
  line-height: 100%;
  letter-spacing: -0.03em;
}

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

.global-nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.global-nav a:hover {
  background: rgba(34, 33, 38, 0.08);
}

.global-footer {
  width: min(1400px, 100% - 32px);
  margin: 0 auto 20px;
  padding: 12px 20px;
}

.global-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 13px;
}

.topbar {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.eyebrow {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.topbar h2 {
  margin: 6px 0 60px;
  font-family: "TT Firs Neue", sans-serif;
  font-weight: 450;
  font-style: normal;
  font-size: 40px;
  line-height: 100%;
  letter-spacing: -0.04em;
}

.display-title {
  font-family: "TT Firs Neue", sans-serif;
  font-weight: 450;
  font-style: normal;
  font-size: 40px;
  line-height: 100%;
  letter-spacing: -0.04em;
  margin: 0 0 60px;
}

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

.badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: #2f2d2a;
  color: #fff;
  font-size: 12px;
}

.badge-soft {
  background: rgba(47, 45, 42, 0.16);
  color: #2f2d2a;
}

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

.card {
  padding: 18px;
  border-radius: var(--card-radius);
  min-width: 0;
  box-shadow: none !important;
}

.card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.card h3 {
  margin: 8px 0 0;
  font-family: "TT Firs Neue", sans-serif;
  font-weight: 500;
  font-style: normal;
  font-size: 29px;
  line-height: 100%;
  letter-spacing: -0.02em;
  width: 131px;
  max-width: 100%;
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.card-clickable {
  cursor: pointer;
  transition: transform 0.15s ease;
}

.card-clickable:hover {
  transform: translateY(-2px);
  box-shadow: none;
}

.mini-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  text-decoration: none;
}

.panel-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  min-width: 0;
}

.panel-row > * {
  min-width: 0;
}

.panel {
  padding: 22px;
  border-radius: var(--card-radius);
  min-width: 0;
}

.panel h3 {
  margin: 0 0 20px;
  font-family: "TT Firs Neue", sans-serif;
  font-weight: 500;
  font-style: normal;
  font-size: 24px;
  line-height: 120%;
  letter-spacing: -0.02em;
}

.panel > h3 + .cards,
.panel > .mini + .cards,
.panel > h3 + .table-wrap,
.panel > .mini + .table-wrap {
  margin-top: 20px;
}

/* Унификация отступов и стилей заголовков для всех страниц дашборда */
.content > .topbar + section,
.content > .topbar + .panel,
.content > .topbar + .panel-row {
  margin-top: 20px;
}

/* Отключаем глобальные отступы section из theme.css внутри дашборда */
.content > section {
  margin: 0;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Восстанавливаем внутренние отступы для блоков-панелей */
.content > section.panel {
  padding: 22px !important;
}

.mini {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

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

.actions select,
.actions input[type="text"],
.actions input[type="number"] {
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.8);
  min-width: 220px;
}

input[type="file"] {
  max-width: 320px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  padding: 8px 10px;
}

.btn {
  border: 0;
  background: #2f2d2a;
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn.subtle {
  background: rgba(47, 45, 42, 0.12);
  color: #2f2d2a;
}

.health-grid {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.health-grid div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 6px;
}

.label {
  color: var(--ink-soft);
}

.integration-list p {
  margin: 8px 0;
}

.section-tile p {
  min-height: 66px;
}

.creative-grid {
  display: grid;
  gap: 8px;
}

.creative-grid input {
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.8);
}

.creative-results {
  margin-top: 10px;
}

.creative-results p {
  margin: 8px 0;
  color: var(--ink-soft);
}

.mini-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
}

.mini-list li {
  margin: 8px 0;
}

.table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  max-width: 100%;
}

.campaign-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
}

.campaign-table th,
.campaign-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

.campaign-table thead th {
  background: rgba(47, 45, 42, 0.08);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.campaign-table tbody tr:hover {
  background: rgba(47, 45, 42, 0.04);
}

.mini-title {
  margin: 16px 0 8px;
  font-size: 14px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1;
  border: 1px solid transparent;
}

.chip-risk-low {
  background: rgba(54, 128, 94, 0.12);
  color: #2f6c53;
  border-color: rgba(54, 128, 94, 0.2);
}

.chip-risk-medium {
  background: rgba(180, 126, 27, 0.14);
  color: #7e5b13;
  border-color: rgba(180, 126, 27, 0.24);
}

.chip-risk-high {
  background: rgba(162, 58, 58, 0.14);
  color: #8b2f2f;
  border-color: rgba(162, 58, 58, 0.24);
}

.chip-status-good {
  background: rgba(54, 128, 94, 0.12);
  color: #2f6c53;
  border-color: rgba(54, 128, 94, 0.2);
}

.chip-status-warn {
  background: rgba(180, 126, 27, 0.14);
  color: #7e5b13;
  border-color: rgba(180, 126, 27, 0.24);
}

.chip-status-bad {
  background: rgba(162, 58, 58, 0.14);
  color: #8b2f2f;
  border-color: rgba(162, 58, 58, 0.24);
}

.chip-status-neutral {
  background: rgba(47, 45, 42, 0.1);
  color: #4f4b44;
  border-color: rgba(47, 45, 42, 0.16);
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    order: 2;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
  .panel-row {
    grid-template-columns: 1fr;
  }
  .global-header__inner,
  .global-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
}
