/* Дашборд DN Studio — стиль канала «Контуры времени»: почти чёрный фон, тёмно-синее стекло, золото. */
@font-face { font-family: "Playfair"; src: url("fonts/PlayfairDisplay.ttf") format("truetype"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("fonts/Montserrat.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #090F14; --bg2: #0F0F12; --navy: #202D38; --slate: #314751;
  --gold: #CE9350; --gold-soft: rgba(206,147,80,.16); --gold-line: rgba(206,147,80,.28);
  --text: #EDE6D6; --cream: #E4D0B6; --muted: rgba(237,230,214,.58); --faint: rgba(237,230,214,.32);
  --glass: rgba(32,45,56,.42); --glass-2: rgba(49,71,81,.30); --line: rgba(228,208,182,.10);
  --ok: #7FB69A; --warn: #E3A257; --bad: #D46A5E; --info: #8FA9C7;
  --s1: #CE9350; --s2: #8FA9C7; --s3: #7FB69A; --s4: #C98BB0;
  --r: 18px; --r-sm: 12px; --head: "Playfair", Georgia, serif; --body: "Montserrat", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
/* мягкие пятна света на фоне, медленно плавают */
.aurora { position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 35% at 18% 20%, rgba(206,147,80,.16), transparent 70%),
    radial-gradient(45% 40% at 85% 15%, rgba(49,71,81,.55), transparent 70%),
    radial-gradient(50% 45% at 70% 85%, rgba(32,45,56,.65), transparent 70%),
    radial-gradient(35% 30% at 10% 90%, rgba(206,147,80,.08), transparent 70%);
  animation: drift 40s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate3d(3%, -2%, 0) scale(1.06); } }

a { color: var(--gold); text-decoration: none; }
h1, h2, h3 { font-family: var(--head); font-weight: 500; margin: 0; letter-spacing: .01em; }
.eyebrow { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- каркас ---------- */
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; padding: 20px max(20px, env(safe-area-inset-right)) 40px max(20px, env(safe-area-inset-left)); max-width: 1600px; margin: 0 auto; }
.side { position: sticky; top: 20px; height: calc(100vh - 40px); display: flex; flex-direction: column; gap: 6px;
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 14px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font: 600 17px var(--head);
  color: var(--bg); background: linear-gradient(135deg, #E9B676, var(--gold) 55%, #9C6A33); box-shadow: 0 6px 22px rgba(206,147,80,.35); }
.brand b { font: 600 15px var(--head); display: block; }
.brand small { color: var(--faint); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--muted); font-weight: 500; transition: .2s; }
.nav a:hover { color: var(--text); background: var(--glass-2); }
.nav a.on { color: var(--text); background: linear-gradient(90deg, var(--gold-soft), transparent); box-shadow: inset 2px 0 0 var(--gold); }
.nav .soon { margin-left: auto; font-size: 10px; color: var(--faint); border: 1px solid var(--line); padding: 1px 6px; border-radius: 99px; }
.nav-group { margin: 12px 10px 4px; }
.chan { display: flex; align-items: center; gap: 9px; padding: 6px 10px; color: var(--muted); font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; box-shadow: 0 0 0 3px rgba(127,182,154,.15); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(227,162,87,.16); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(212,106,94,.18); }
.dot.info { background: var(--info); box-shadow: 0 0 0 3px rgba(143,169,199,.15); }
.dot.off { background: var(--faint); box-shadow: none; }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.side-foot .clock { font: 600 20px var(--head); }
.side-foot small { color: var(--faint); display: block; }
.link-btn { background: none; border: 0; color: var(--faint); font: inherit; font-size: 12px; cursor: pointer; padding: 6px 0 0; }
.link-btn:hover { color: var(--gold); }

main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* ---------- карточки ---------- */
.card { position: relative; background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); min-width: 0; overflow: hidden; }
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(140deg, rgba(228,208,182,.07), transparent 40%); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 21px; margin-top: 2px; }
.pill { font-size: 11.5px; padding: 4px 11px; border-radius: 99px; border: 1px solid var(--line); background: rgba(9,15,20,.35); color: var(--muted); white-space: nowrap; }
.pill.gold { color: var(--gold); border-color: var(--gold-line); }
.grid { display: grid; gap: 20px; }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.tile { background: rgba(9,15,20,.32); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; min-width: 0; }
.tile .k { color: var(--faint); font-size: 11.5px; }
.tile .v { font: 500 22px var(--head); margin-top: 2px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.big { font: 500 40px/1.1 var(--head); }
.sub { color: var(--muted); font-size: 13px; }
.note { color: var(--faint); font-size: 11.5px; margin-top: 10px; }

/* появление */
.reveal { opacity: 0; transform: translateY(10px); animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal, .aurora { animation: none; opacity: 1; transform: none; } }

/* ---------- верхняя строка ---------- */
.top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 18px; }
.top h1 { font-size: 25px; }
.top .sub b { color: var(--text); font-weight: 600; }
.top .chips { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: rgba(9,15,20,.35); border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; }
.chip b { font: 600 15px var(--head); display: block; }
.chip span { font-size: 10.5px; color: var(--faint); }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: rgba(9,15,20,.35); color: var(--muted); cursor: pointer; font-size: 16px; }
.icon-btn:hover { color: var(--gold); border-color: var(--gold-line); }
.burger { display: none; }

/* внимание */
.attn { display: flex; flex-direction: column; gap: 8px; }
.attn-item { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 11px; background: rgba(9,15,20,.30); border: 1px solid var(--line); }
.attn-item .t { flex: 1; min-width: 0; }
.calm { color: var(--muted); display: flex; gap: 10px; align-items: center; }

/* ролики */
.videos { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.video { background: rgba(9,15,20,.30); border: 1px solid var(--line); border-radius: 15px; padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: border-color .25s, transform .25s; }
.video:hover { border-color: var(--gold-line); transform: translateY(-2px); }
.video h3 { font-size: 19px; }
.steps { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; }
.steps i { height: 6px; border-radius: 3px; background: rgba(228,208,182,.10); position: relative; overflow: hidden; }
.steps i.done { background: rgba(206,147,80,.55); }
.steps i.now { background: var(--gold); box-shadow: 0 0 12px rgba(206,147,80,.6); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.steps-lbl { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); }
.wait { display: flex; gap: 8px; align-items: flex-start; line-height: 1.45; }
.wait .dot { margin-top: 6px; }
.v-foot { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; color: var(--faint); font-size: 12px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 10px; border: 1px solid var(--gold-line); color: var(--gold); background: rgba(206,147,80,.08); font: 600 12.5px var(--body); cursor: pointer; transition: .2s; }
.btn:hover { background: rgba(206,147,80,.18); }
.btn.ghost { border-color: var(--line); color: var(--muted); background: transparent; }
.btn.solid { background: linear-gradient(135deg, #E9B676, var(--gold)); color: var(--bg); border-color: transparent; }

/* полосы лимитов */
.bar { height: 8px; border-radius: 4px; background: rgba(228,208,182,.09); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #9C6A33, var(--gold)); width: 0; transition: width 1.2s cubic-bezier(.2,.7,.2,1); }
.bar.warn > i { background: linear-gradient(90deg, #B5793A, var(--warn)); }
.bar.bad > i { background: linear-gradient(90deg, #9b4a41, var(--bad)); }
.limit { display: flex; flex-direction: column; gap: 6px; }
.limit .row { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; }
.limit .row b { font: 600 16px var(--head); }

/* кольца сервера */
.rings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ring { text-align: center; background: rgba(9,15,20,.30); border: 1px solid var(--line); border-radius: 14px; padding: 12px 6px; }
.ring svg { width: 84px; height: 84px; display: block; margin: 0 auto 4px; }
.ring circle { fill: none; stroke-width: 7; }
.ring .bg { stroke: rgba(228,208,182,.09); }
.ring .fg { stroke: var(--gold); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 1.4s cubic-bezier(.2,.7,.2,1); }
.ring text { fill: var(--text); font: 600 16px var(--head); text-anchor: middle; dominant-baseline: central; }
.ring b { display: block; font-size: 13px; }
.ring span { color: var(--faint); font-size: 11px; }
.flags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.flag { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); background: rgba(9,15,20,.3); }

/* графики */
.chart { width: 100%; height: 170px; display: block; margin-top: 12px; }
.chart text { fill: var(--faint); font: 10px var(--body); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip { position: fixed; pointer-events: none; background: rgba(9,15,20,.92); border: 1px solid var(--gold-line); border-radius: 10px; padding: 8px 11px; font-size: 12px; z-index: 50; display: none; max-width: 240px; }

/* подписки */
.subs { display: flex; flex-direction: column; gap: 8px; }
.sub-row { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 13px; background: rgba(9,15,20,.30); border: 1px solid var(--line); }
.days { width: 52px; text-align: center; flex: none; border-radius: 10px; padding: 5px 0; background: rgba(206,147,80,.08); border: 1px solid var(--gold-line); }
.days b { font: 600 19px var(--head); display: block; line-height: 1.1; }
.days span { font-size: 10px; color: var(--faint); }
.days.soon { background: rgba(227,162,87,.16); border-color: rgba(227,162,87,.5); }
.days.late { background: rgba(212,106,94,.18); border-color: rgba(212,106,94,.5); }
.sub-row .info { flex: 1; min-width: 0; }
.sub-row .info b { display: block; }
.sub-row .info span { color: var(--faint); font-size: 12px; }
.sub-row .amt { font: 600 16px var(--head); white-space: nowrap; }
.sub-row .acts { display: flex; gap: 6px; }
.mini { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.mini:hover { color: var(--gold); border-color: var(--gold-line); }
form.sub-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; padding: 14px; border-radius: 13px; border: 1px dashed var(--gold-line); }
form.sub-form label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--faint); }
input, select { background: rgba(9,15,20,.55); border: 1px solid var(--line); border-radius: 9px; color: var(--text); font: 14px var(--body); padding: 8px 10px; min-width: 0; }
input:focus, select:focus { outline: none; border-color: var(--gold); }
.form-acts { display: flex; gap: 8px; align-items: end; }
.err { color: var(--bad); font-size: 12px; }

/* таблица роликов */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--faint); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.placeholder { color: var(--faint); display: flex; align-items: center; gap: 10px; }

/* ---------- телефон ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 12px max(12px, env(safe-area-inset-right)) 30px max(12px, env(safe-area-inset-left)); }
  .side { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 270px; height: auto; border-radius: 0 var(--r) var(--r) 0; transform: translateX(-105%); transition: transform .3s; }
  .side.open { transform: none; }
  .burger { display: inline-block; }
  .top { padding: 12px 14px; }
  .top h1 { font-size: 21px; }
  .top .chips { margin-left: 0; width: 100%; }
  .chip { flex: 1; min-width: 90px; }
  .card { padding: 16px; }
  .big { font-size: 34px; }
  .sub-row { flex-wrap: wrap; }
}
