:root {
  --accent: #2fd08a;
  --accent-rgb: 47, 208, 138;
  --gold: #e8b84a;
  --gold-rgb: 232, 184, 74;
  --sky: #2bb3d6;
  --bg: #050d0a;
  --text: #eef5f1;
  --text-2: rgba(238, 245, 241, .68);
  --text-3: rgba(238, 245, 241, .44);
  --danger: #ff6b6b;
  --warn: #f5b942;
  --ok: var(--accent);
  --glass: rgba(255, 255, 255, .055);
  --glass-2: rgba(255, 255, 255, .09);
  --line: rgba(255, 255, 255, .11);
  --line-2: rgba(255, 255, 255, .2);
  --radius: 22px;
  --sidebar-w: 300px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);
  font-family: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 18px;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { overflow-x: hidden; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(var(--accent-rgb), .35); }

/* ---------- Фон ---------- */
#fluid { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60vw 50vh at 85% -10%, rgba(var(--accent-rgb), .16), transparent 60%),
    radial-gradient(50vw 50vh at -10% 110%, rgba(var(--gold-rgb), .10), transparent 60%);
}
.ornament-layer {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23e8b84a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M60 60c-6-15-24-18-30-6-4 9 3 18 12 15 6-2 6-9 2-11M60 60c6-15 24-18 30-6 4 9-3 18-12 15-6-2-6-9-2-11M60 60c-6 15-24 18-30 6-4-9 3-18 12-15 6 2 6 9 2 11M60 60c6 15 24 18 30 6 4-9-3-18-12-15-6 2-6 9-2 11'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 120px;
  mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 75%);
}

/* ---------- Стекло ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 20px 50px -24px rgba(0, 0, 0, .7);
  position: relative;
}
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .09), transparent 38%);
}

/* ---------- Боковая панель ---------- */
.sidebar {
  position: fixed; z-index: 5; top: 16px; left: 16px; bottom: 16px; width: var(--sidebar-w);
  border-radius: 28px; padding: 26px 18px 18px; display: flex; flex-direction: column; gap: 26px;
}
.brand { display: flex; align-items: center; gap: 14px; padding: 0 8px; }
.brand-mark { width: 46px; height: 46px; color: var(--accent); flex: none;
  filter: drop-shadow(0 0 12px rgba(var(--accent-rgb), .45)); }
.brand-name { font-weight: 700; letter-spacing: .14em; font-size: 21px; }
.brand-sub { font-size: 13px; color: var(--gold); opacity: .85; letter-spacing: .01em; }

.nav { position: relative; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 16px; border: 0; background: none; cursor: pointer;
  text-align: left; color: var(--text-2); transition: color .25s var(--ease);
}
.nav-item:hover { color: var(--text); }
.nav-item[aria-current="page"] { color: var(--text); }
.nav-num { width: 26px; font-size: 14px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.nav-item[aria-current="page"] .nav-num { color: var(--accent); }
.nav-label { flex: 1; font-size: 17px; font-weight: 500; line-height: 1.2; }
.nav-label small { display: block; font-size: 12px; font-weight: 400; color: var(--text-3); margin-top: 2px; }
.nav-badge {
  min-width: 26px; height: 26px; padding: 0 8px; border-radius: 13px; display: grid; place-items: center;
  font-size: 13px; font-weight: 600; background: rgba(255, 107, 107, .16); color: #ff9c9c;
}
.nav-badge.soft { background: rgba(var(--accent-rgb), .14); color: var(--accent); }
.nav-capsule {
  position: absolute; z-index: 0; left: 0; right: 0; top: 0; height: 52px; border-radius: 16px;
  background: rgba(255, 255, 255, .09); border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 20px -8px rgba(var(--accent-rgb), .35);
  transition: transform .5s var(--spring), height .5s var(--spring);
  transform-origin: center;
}
.nav-capsule.stretch { animation: stretch .5s var(--ease); }
@keyframes stretch { 40% { scale: 1.04 1.12; } 100% { scale: 1 1; } }

.nav-mobile { display: none; }
.sidebar-foot { margin-top: auto; }
.sources { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 18px; background: rgba(0, 0, 0, .18); border: 1px solid var(--line); }
.source-row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.source-row svg { width: 18px; height: 18px; }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; background: var(--text-3); }
.dot.on { background: var(--accent); box-shadow: 0 0 10px var(--accent); }

/* ---------- Основная область ---------- */
.main { position: relative; z-index: 2; margin-left: calc(var(--sidebar-w) + 32px); padding: 44px 48px 80px 24px; max-width: 1500px; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; flex-wrap: wrap; }
.eyebrow { font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
h1 { font-size: clamp(32px, 3.4vw, 46px); line-height: 1.08; margin: 0; font-weight: 600; letter-spacing: -.01em; }
.subtitle { color: var(--text-2); margin-top: 8px; font-size: 18px; }
h2 { font-size: 22px; margin: 36px 0 14px; font-weight: 600; display: flex; align-items: center; gap: 12px; }
h2 .count { font-size: 15px; color: var(--text-3); font-weight: 500; }

/* Плитки */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tile { border-radius: var(--radius); padding: 22px 24px; min-width: 0; cursor: pointer; transition: transform .3s var(--ease), border-color .3s; }
.tile:hover { transform: translateY(-3px); border-color: var(--line-2); }
.tile-label { color: var(--text-2); font-size: 16px; }
.tile-value { font-size: clamp(34px, 3.2vw, 46px); font-weight: 600; line-height: 1.1; margin: 8px 0 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile-note { color: var(--text-3); font-size: 14px; }
.tile.danger .tile-value { color: #ff8e8e; }
.tile.warn .tile-value { color: var(--warn); }
.tile.ok .tile-value { color: var(--accent); }
.tile.important { border-color: transparent; }
.tile.important::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--ang, 0deg), transparent 0 70%, rgba(var(--accent-rgb), .95) 80%, transparent 90%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: run 4s linear infinite;
}
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes run { to { --ang: 360deg; } }

/* Карточки обещаний */
.list { display: flex; flex-direction: column; gap: 12px; }
.card { border-radius: var(--radius); padding: 20px 22px; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: start; }
.avatar { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; font-weight: 600; font-size: 17px;
  background: linear-gradient(140deg, rgba(var(--accent-rgb), .3), rgba(var(--gold-rgb), .18)); border: 1px solid var(--line-2); }
.card-main { min-width: 0; }
.card-title { font-size: 19px; font-weight: 500; line-height: 1.35; }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 8px; color: var(--text-2); font-size: 15px; align-items: center; }
.card-meta svg { width: 17px; height: 17px; vertical-align: -3px; margin-right: 4px; }
.quote { margin-top: 12px; padding: 10px 14px; border-left: 2px solid rgba(var(--gold-rgb), .6); background: rgba(var(--gold-rgb), .05); border-radius: 0 12px 12px 0; color: var(--text-2); font-size: 15px; font-style: italic; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; font-size: 14px; font-weight: 500; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); white-space: nowrap; }
.chip.overdue { color: #ffadad; background: rgba(255, 107, 107, .12); border-color: rgba(255, 107, 107, .3); }
.chip.soon { color: #ffd88a; background: rgba(245, 185, 66, .12); border-color: rgba(245, 185, 66, .3); }
.chip.done { color: var(--accent); background: rgba(var(--accent-rgb), .12); border-color: rgba(var(--accent-rgb), .3); }
.chip.muted { color: var(--text-3); }
.card-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.card.is-done { opacity: .55; }
.card.is-done .card-title { text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .35); }

/* Кнопки */
.btn { height: 44px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .07); cursor: pointer; font-weight: 500; font-size: 16px; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14); transition: background .2s, transform .15s, border-color .2s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { background: rgba(255, 255, 255, .12); }
.btn:active { transform: scale(.97); }
.btn.primary { background: rgba(var(--accent-rgb), .9); color: #03140c; border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 8px 24px -10px rgba(var(--accent-rgb), .8); }
.btn.primary:hover { background: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); box-shadow: none; }
.btn.ghost:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.btn.sm { height: 38px; font-size: 15px; padding: 0 14px; border-radius: 12px; }

/* Сегменты */
.seg { display: inline-flex; padding: 4px; border-radius: 16px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); gap: 2px; }
.seg button { border: 0; background: none; padding: 8px 16px; border-radius: 12px; cursor: pointer; color: var(--text-2); font-size: 15px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: rgba(255, 255, 255, .12); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); }

/* Вывод */
.insight { border-radius: var(--radius); padding: 22px 26px; margin-top: 18px; display: flex; gap: 18px; align-items: center;
  background: linear-gradient(120deg, rgba(var(--accent-rgb), .16), rgba(var(--gold-rgb), .08)); border-color: rgba(var(--accent-rgb), .3); }
.insight svg { width: 40px; height: 40px; color: var(--gold); flex: none; }
.insight b { font-weight: 600; }

/* Таблица */
.table-wrap { border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
th, td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--text-3); font-weight: 500; font-size: 14px; letter-spacing: .02em; }
td.num { font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; min-width: 120px; }
.bar span { display: block; height: 100%; border-radius: 4px; background: var(--accent); transform-origin: left; animation: grow 1s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }

/* Формы */
textarea, .input { width: 100%; border-radius: 16px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); padding: 14px 16px; outline: none; transition: border-color .2s; }
textarea:focus, .input:focus { border-color: rgba(var(--accent-rgb), .6); }
textarea { min-height: 220px; resize: vertical; line-height: 1.55; }
.panel { border-radius: var(--radius); padding: 24px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hint { color: var(--text-3); font-size: 15px; }
.empty { text-align: center; padding: 48px 24px; border-radius: var(--radius); color: var(--text-2); }
.empty svg { width: 56px; height: 56px; color: var(--gold); opacity: .7; margin-bottom: 8px; }

/* Источники */
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.src { border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.src-head { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 500; }
.src-head svg { width: 26px; height: 26px; color: var(--accent); }

/* Модальное окно и тост */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(2, 8, 6, .55); backdrop-filter: blur(6px); }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(640px, 100%); border-radius: 28px; padding: 28px; background: rgba(20, 30, 26, .72); animation: pop .35s var(--spring); }
.modal h3 { margin: 0 0 6px; font-size: 24px; font-weight: 600; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.toast { position: fixed; z-index: 60; bottom: 24px; left: 50%; translate: -50% 0; padding: 14px 22px; border-radius: 18px; background: rgba(20, 30, 26, .8); animation: pop .3s var(--spring); }
.toast[hidden] { display: none; }

/* Появление */
.rise { animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  :root { --sidebar-w: 250px; }
  .main { padding: 32px 24px 64px 12px; }
}
@media (max-width: 820px) {
  :root { font-size: 17px; }
  .sidebar { position: sticky; top: 0; left: 0; right: 0; bottom: auto; width: auto; margin: 12px; padding: 16px; border-radius: 22px; gap: 14px; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .brand-sub, .nav, .sidebar-foot { display: none; }
  .nav-mobile { display: block; flex: 1; min-width: 180px; height: 46px; border-radius: 14px; padding: 0 14px; }
  .main { margin-left: 0; padding: 16px 14px 60px; }
  .card { grid-template-columns: auto 1fr; }
  .card-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 16px; }
  .tile-value { font-size: 34px; }
  .insight { flex-wrap: wrap; }
  .insight .spacer { display: none; }
  table { font-size: 14px; } th, td { padding: 10px 10px; }
  .bar { min-width: 60px; }
}
