/* ============================================================
   PEAKCUT — операторская платформа
   Общий дизайн-язык. Тёмный технический минимализм, один акцент.
   ============================================================ */

/* Токены (цвета/типографика/радиусы/тайминги) и @import шрифтов вынесены
   в tokens.css — он подключается ПЕРЕД этим файлом (см. base_pc.html). */

*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  background:var(--bg);
  color:var(--text);
  font-family:var(--sans);
  font-size:14px;
  line-height:1.45;
  -webkit-font-smoothing:antialiased;
  letter-spacing:.005em;
  min-height:100vh;
  position:relative;
}
/* нейтральная глубина: мягкая виньетка + слоистость, без цветных свечений */
body::before{
  content:"";position:fixed;inset:0;z-index:0;pointer-events:none;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255,255,255,.025), transparent 60%),
    radial-gradient(140% 120% at 50% 120%, rgba(0,0,0,.55), transparent 55%);
}
/* едва заметная зернистость */
body::after{
  content:"";position:fixed;inset:0;z-index:0;pointer-events:none;opacity:.04;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#app,.pc-shell{position:relative;z-index:1;}

::selection{background:var(--accent-ghost);color:var(--text);}

/* скроллбары */
*{scrollbar-width:thin;scrollbar-color:#2a313a transparent;}
*::-webkit-scrollbar{width:10px;height:10px;}
*::-webkit-scrollbar-thumb{background:#262d36;border-radius:20px;border:3px solid transparent;background-clip:padding-box;}
*::-webkit-scrollbar-thumb:hover{background:#323a45;background-clip:padding-box;}

a{color:inherit;text-decoration:none;}
button{font-family:inherit;color:inherit;}

.mono{font-family:var(--mono);font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;letter-spacing:-.01em;}
.tnum{font-variant-numeric:tabular-nums;}
.muted{color:var(--muted);}
.dim{color:var(--muted-2);}
.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

/* ============================================================
   ШАПКА
   ============================================================ */
.pc-header{
  position:sticky;top:0;z-index:50;
  display:flex;align-items:center;gap:28px;
  height:60px;padding:0 28px;
  background:rgba(11,13,16,.78);
  backdrop-filter:blur(14px) saturate(120%);
  border-bottom:1px solid var(--line-soft);
}
.pc-logo{display:flex;align-items:center;font-family:var(--display);font-weight:600;font-size:18px;letter-spacing:.04em;}
/* знак Populi — кабинетский словесный логотип (вектор в _brand.html), плитки больше нет */
.pc-logo .wordmark{color:var(--text);flex:none;}
/* квадратный знак «O» — только для рельса сайдбара <861px, elsewhere скрыт (shell.css) */
.pc-logo .logo-mark{display:none;color:var(--text);}
/* пометка «Admin» у знака: читаемость на тёмной шапке — светлее+жирнее (≈10.6:1, AA с запасом, чётче на 2x) */
.pc-logo span{color:#b9c0cc;font-weight:600;}

.pc-nav{display:flex;align-items:center;gap:2px;margin-left:6px;}
.pc-nav a{
  padding:7px 13px;border-radius:var(--r-sm);color:var(--muted);
  font-weight:500;font-size:13.5px;transition:color var(--t-fast) var(--ease),background var(--t-fast) var(--ease);
}
.pc-nav a:hover{color:var(--text);background:var(--surface);}
.pc-nav a.active{color:var(--text);background:var(--surface-2);}
.pc-nav a.active{box-shadow:inset 0 0 0 1px var(--line);}

.pc-header .spacer{flex:1;}

/* индикатор очереди обработки */
.queue-pill{
  display:flex;align-items:center;gap:10px;
  padding:6px 12px 6px 11px;border-radius:999px;
  background:var(--surface);border:1px solid var(--line);
  font-size:12.5px;color:var(--muted);cursor:pointer;
  transition:border-color var(--t-fast) var(--ease),background var(--t-fast) var(--ease);
}
.queue-pill:hover{border-color:#2e353f;background:var(--surface-2);}
.queue-pill .spin{
  width:13px;height:13px;border-radius:50%;flex:none;
  border:2px solid #2a3038;border-top-color:var(--accent);
  animation:spin 1s linear infinite;
}
.queue-pill .n{color:var(--text);font-family:var(--mono);font-size:12.5px;}
@keyframes spin{to{transform:rotate(360deg);}}
/* loading-состояние submit-кнопки (form[data-busy]) — спиннер справа, текст виден, клик заблокирован */
button.is-busy,.btn.is-busy{position:relative;pointer-events:none;opacity:.75;padding-right:30px;}
button.is-busy::after,.btn.is-busy::after{content:"";position:absolute;right:10px;top:50%;margin-top:-7px;
  width:13px;height:13px;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;
  animation:spin .6s linear infinite;opacity:.85;}

.icon-btn{
  width:34px;height:34px;border-radius:8px;display:grid;place-items:center;
  background:transparent;border:1px solid transparent;cursor:pointer;color:var(--muted);
  transition:all var(--t-fast) var(--ease);
}
.icon-btn:hover{color:var(--text);background:var(--surface);border-color:var(--line);}
.icon-btn.active{color:var(--text);background:var(--surface-2);border-color:var(--line);}
.icon-btn svg{width:17px;height:17px;}

/* плашка пользователя в шапке (профиль / роль) */
.pc-user{
  display:flex;align-items:center;gap:9px;padding:3px 12px 3px 3px;border-radius:999px;
  border:1px solid var(--line);background:var(--surface-2);color:var(--text);
  text-decoration:none;transition:all var(--t-fast) var(--ease);max-width:200px;
}
.pc-user:hover,.pc-user.active{border-color:#2e353f;background:var(--surface-3);}
.pc-user .ava{
  width:28px;height:28px;border-radius:50%;flex:none;display:grid;place-items:center;
  background:linear-gradient(135deg,var(--accent),#c08bff);color:#fff;font-weight:600;font-size:12.5px;
}
.pc-user .who{display:flex;flex-direction:column;line-height:1.15;min-width:0;}
.pc-user .who .nm{font-size:12.5px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.pc-user .who .rl{font-size:10px;color:var(--muted-2);}

.avatar{
  border-radius:50%;flex:none;display:grid;place-items:center;
  font-weight:600;color:#0b0d10;overflow:hidden;
  font-family:var(--sans);text-transform:uppercase;
}

/* ============================================================
   ЛЕЙАУТ
   ============================================================ */
.pc-main{max-width:var(--maxw);margin:0 auto;padding:30px 28px 90px;}
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:26px;}
.page-head h1{font-family:var(--display);font-weight:600;font-size:27px;letter-spacing:-.01em;margin:0;line-height:1.1;}
.page-head .sub{color:var(--muted);font-size:13.5px;margin-top:5px;}
.eyebrow{font-size:11px;font-weight:600;letter-spacing:.16em;text-transform:uppercase;color:var(--muted-2);}

.section-title{display:flex;align-items:center;gap:10px;margin:34px 0 16px;}
.section-title h2{font-size:13px;font-weight:600;letter-spacing:.13em;text-transform:uppercase;color:var(--muted);margin:0;}
.section-title .count{font-family:var(--mono);font-size:12px;color:var(--muted-2);}
.section-title .rule{flex:1;height:1px;background:var(--line-soft);}

/* ============================================================
   КНОПКИ
   ============================================================ */
.btn{
  display:inline-flex;align-items:center;gap:8px;justify-content:center;
  height:36px;padding:0 15px;border-radius:8px;
  background:var(--surface-2);border:1px solid var(--line);color:var(--text);
  font-size:13.5px;font-weight:500;cursor:pointer;white-space:nowrap;
  transition:all var(--t-fast) var(--ease);
}
.btn:hover{background:var(--surface-3);border-color:#2e353f;}
.btn:active{transform:translateY(1px);}
.btn svg{width:15px;height:15px;opacity:.85;}
.btn.ghost{background:transparent;border-color:transparent;color:var(--muted);}
.btn.ghost:hover{background:var(--surface);color:var(--text);}
.btn.accent{background:var(--accent);border-color:var(--accent);color:#fff;}
.btn.accent:hover{background:var(--accent-dim);border-color:var(--accent-dim);}
.btn.sm{height:30px;padding:0 11px;font-size:12.5px;border-radius:7px;}
/* компактная — действия внутри строки таблицы (36 px): «Учитель», «Проблемы» (DEC-193) */
.btn.xs{height:24px;padding:0 8px;font-size:11px;border-radius:6px;}
.btn.danger{color:var(--danger);}
.btn.danger:hover{border-color:rgba(240,88,79,.4);background:rgba(240,88,79,.08);}
.btn:focus-visible,a:focus-visible,input:focus-visible{outline:none;box-shadow:0 0 0 2px var(--bg),0 0 0 4px var(--accent);}

/* хоткей-чип */
kbd,.kbd{
  font-family:var(--mono);font-size:11px;line-height:1;color:var(--muted);
  background:var(--surface-3);border:1px solid var(--line);border-bottom-width:2px;
  border-radius:5px;padding:3px 6px;min-width:18px;text-align:center;display:inline-block;
}

/* ============================================================
   СТАТУС-ТОЧКИ + ЛЕГЕНДА
   ============================================================ */
.dot{width:7px;height:7px;border-radius:50%;flex:none;display:inline-block;box-shadow:0 0 0 0 transparent;}
.dot.ok{background:var(--ok);}
.dot.test{background:var(--accent);}
.dot.warn{background:var(--warn);}
.dot.pause{background:var(--warn);}
.dot.archive{background:var(--muted-2);}
.dot.danger{background:var(--danger);}
.dot.info{background:var(--info);}
.dot.idle{background:#39414c;}
.dot.live{position:relative;}
.dot.live::after{content:"";position:absolute;inset:-4px;border-radius:50%;border:1.5px solid currentColor;color:inherit;opacity:.0;}
.dot.pulse{animation:dotpulse 1.8s var(--ease) infinite;}
@keyframes dotpulse{0%{box-shadow:0 0 0 0 rgba(62,207,142,.5);}70%{box-shadow:0 0 0 6px rgba(62,207,142,0);}100%{box-shadow:0 0 0 0 rgba(62,207,142,0);}}

.status{display:inline-flex;align-items:center;gap:7px;color:var(--muted);font-size:13px;white-space:nowrap;}
.status .dot{margin-top:0;}

.legend{display:flex;flex-wrap:wrap;gap:6px 18px;}
.legend .it{display:inline-flex;align-items:center;gap:7px;color:var(--muted);font-size:12px;}

/* ============================================================
   ПОИСК + ФИЛЬТРЫ
   ============================================================ */
.search{
  position:relative;display:flex;align-items:center;
  height:38px;border-radius:9px;background:var(--surface);border:1px solid var(--line);
  padding:0 12px;gap:9px;transition:border-color var(--t-fast) var(--ease);min-width:240px;
}
.search:focus-within{border-color:#39414c;box-shadow:0 0 0 3px var(--accent-ghost);}
.search svg{width:15px;height:15px;color:var(--muted-2);flex:none;}
.search input{background:none;border:none;outline:none;color:var(--text);font-size:13.5px;width:100%;font-family:var(--sans);}
.search input::placeholder{color:var(--muted-2);}
.search .hint{margin-left:auto;}

.chips{display:flex;align-items:center;gap:7px;flex-wrap:wrap;}
.chip{
  display:inline-flex;align-items:center;gap:7px;height:32px;padding:0 12px;border-radius:8px;
  background:transparent;border:1px solid var(--line);color:var(--muted);font-size:13px;cursor:pointer;
  transition:all var(--t-fast) var(--ease);font-weight:500;
}
.chip:hover{color:var(--text);border-color:#2e353f;}
.chip.active{color:var(--text);background:var(--surface-2);border-color:#39414c;}
.chip .c{font-family:var(--mono);font-size:11.5px;color:var(--muted-2);}
.chip.active .c{color:var(--muted);}

/* ============================================================
   КАРТОЧКИ
   ============================================================ */
.card{
  background:var(--surface);border:1px solid var(--line-soft);border-radius:var(--r-lg);
  transition:border-color var(--t-fast) var(--ease),transform var(--t-fast) var(--ease),background var(--t-fast) var(--ease);
}
.card.hover:hover{border-color:#2b323b;background:var(--surface-2);transform:translateY(-2px);}

/* блок «требует внимания» */
.attn-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(285px,1fr));gap:14px;}
.attn{
  display:flex;flex-direction:column;gap:12px;padding:18px;border-radius:var(--r-lg);
  background:var(--surface);border:1px solid var(--line-soft);cursor:pointer;position:relative;overflow:hidden;
  transition:border-color var(--t-fast) var(--ease),background var(--t-fast) var(--ease),transform var(--t-fast) var(--ease);
}
.attn:hover{border-color:#2b323b;background:var(--surface-2);transform:translateY(-2px);}
.attn .top{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.attn .lbl{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);}
.attn .big{font-family:var(--display);font-weight:600;font-size:34px;line-height:1;letter-spacing:-.01em;}
.attn .big small{font-family:var(--mono);font-size:14px;font-weight:400;color:var(--muted);letter-spacing:0;margin-left:2px;}
.attn .desc{font-size:13px;color:var(--muted);}
.attn .desc b{color:var(--text);font-weight:500;}
.attn .arrow{color:var(--muted-2);transition:transform var(--t-fast) var(--ease),color var(--t-fast) var(--ease);}
.attn:hover .arrow{color:var(--text);transform:translateX(3px);}
.attn .accent-edge{position:absolute;left:0;top:0;bottom:0;width:2px;background:var(--accent);opacity:0;transition:opacity var(--t-fast) var(--ease);}
.attn.urgent .accent-edge{opacity:1;}
.attn.danger-edge .accent-edge{background:var(--danger);opacity:1;}

/* ============================================================
   ПРОГРЕСС
   ============================================================ */
.bar{height:4px;border-radius:99px;background:#20262e;overflow:hidden;width:100%;}
.bar>i{display:block;height:100%;border-radius:99px;background:var(--accent);transition:width var(--t-slow) var(--ease);}
.bar.ok>i{background:var(--ok);}
.bar.live>i{position:relative;}
.bar.live>i::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.18),transparent);animation:sheen 1.6s linear infinite;}
@keyframes sheen{from{transform:translateX(-100%);}to{transform:translateX(100%);}}

.frac{font-family:var(--mono);font-size:12px;color:var(--muted);}

/* ============================================================
   ТАБЛИЦЫ — без зебры, разделены воздухом/тонкой линией
   ============================================================ */
.tbl{width:100%;border-collapse:collapse;}
.tbl thead th{
  text-align:left;font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;
  color:var(--muted-2);padding:0 14px 12px;border-bottom:1px solid var(--line-soft);white-space:nowrap;
}
.tbl tbody td{padding:14px;border-bottom:1px solid var(--line-soft);vertical-align:middle;font-size:13.5px;}
.tbl tbody tr{transition:background var(--t-fast) var(--ease);}
.tbl tbody tr:hover{background:var(--surface-2);}
.tbl tbody tr:last-child td{border-bottom:none;}
.tbl .num{font-family:var(--mono);font-variant-numeric:tabular-nums;}
.tbl .row-actions{opacity:0;transition:opacity var(--t-fast) var(--ease);display:flex;gap:6px;justify-content:flex-end;}
.tbl tr:hover .row-actions{opacity:1;}

/* ============================================================
   ПЛАТФОРМЫ
   ============================================================ */
.plats{display:flex;align-items:center;gap:5px;}
.plat{
  width:22px;height:22px;border-radius:6px;flex:none;display:grid;place-items:center;
  font-family:var(--mono);font-size:9.5px;font-weight:600;letter-spacing:-.02em;
  background:var(--surface-3);color:var(--muted);border:1px solid var(--line);
  transition:all var(--t-fast) var(--ease);
}
.plat.tt{} .plat.yt{} .plat.vk{} .plat.tg{} .plat.ig{}
.plat.on{color:var(--text);border-color:#39414c;background:var(--surface-3);}
.plat.lg{width:30px;height:30px;font-size:11px;border-radius:7px;}

/* ============================================================
   БЕЙДЖИ / СЧЁТЧИКИ
   ============================================================ */
.badge{
  display:inline-flex;align-items:center;gap:6px;height:22px;padding:0 8px;border-radius:6px;
  background:var(--surface-3);border:1px solid var(--line);font-size:12px;color:var(--muted);font-weight:500;
}
.badge .mono{font-size:11.5px;color:var(--text);}
.badge.accent{border-color:rgba(145,70,255,.35);color:#c5a8ff;background:var(--accent-ghost);}
.badge.warn{border-color:rgba(230,179,74,.3);color:var(--warn);background:rgba(230,179,74,.08);}
.badge.stale{border-color:rgba(230,179,74,.3);color:var(--warn);background:rgba(230,179,74,.07);}

.metric{display:flex;flex-direction:column;gap:3px;}
.metric .v{font-family:var(--mono);font-size:18px;font-variant-numeric:tabular-nums;letter-spacing:-.01em;}
.metric .k{font-size:11px;color:var(--muted-2);text-transform:uppercase;letter-spacing:.08em;font-weight:600;}

/* ============================================================
   КЛИП 9:16 — миниатюра + превью
   ============================================================ */
.clip-thumb{
  position:relative;aspect-ratio:9/16;border-radius:10px;overflow:hidden;background:#0f1216;
  border:1px solid var(--line);flex:none;
}
.clip-thumb .bgblur{position:absolute;inset:-15%;filter:blur(22px) saturate(1.1);opacity:.55;
  background:linear-gradient(135deg,#2a2230,#202a33,#1c2622);}
.clip-thumb .play{position:absolute;inset:0;margin:auto;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;
  background:rgba(11,13,16,.55);backdrop-filter:blur(4px);border:1px solid rgba(255,255,255,.14);opacity:0;transition:opacity var(--t-fast) var(--ease);}
.clip-thumb:hover .play{opacity:1;}
.clip-thumb .dur{position:absolute;right:6px;bottom:6px;font-family:var(--mono);font-size:10px;background:rgba(11,13,16,.7);padding:2px 5px;border-radius:4px;color:#dfe4ec;}
.clip-thumb .cap{position:absolute;left:8px;right:8px;bottom:22px;text-align:center;font-weight:700;font-size:11px;line-height:1.25;text-shadow:0 2px 6px rgba(0,0,0,.8);text-transform:uppercase;letter-spacing:.01em;}
.clip-thumb .cap .hl{color:var(--accent);}

/* ============================================================
   ТОСТЫ
   ============================================================ */
.toasts{position:fixed;right:22px;bottom:22px;z-index:200;display:flex;flex-direction:column;gap:10px;align-items:flex-end;}
.toast{
  display:flex;align-items:center;gap:11px;padding:12px 15px;border-radius:10px;min-width:240px;max-width:360px;
  background:var(--surface-2);border:1px solid var(--line);box-shadow:0 16px 40px -16px rgba(0,0,0,.7);
  font-size:13px;animation:toastin var(--t-slow) var(--ease);
}
.toast .dot{margin-top:0;}
.toast b{font-weight:600;}
.toast .x{margin-left:auto;color:var(--muted-2);cursor:pointer;background:none;border:0;padding:0;font:inherit;line-height:1;}
.toast .x:hover{color:var(--text);}
.toast .x:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px;}
@keyframes toastin{from{opacity:0;transform:translateY(10px) scale(.98);}to{opacity:1;transform:none;}}
.toast.out{animation:toastout var(--t-mid) var(--ease) forwards;}
@keyframes toastout{to{opacity:0;transform:translateX(20px);}}

/* ============================================================
   СКЕЛЕТОНЫ
   ============================================================ */
.skel{background:linear-gradient(90deg,#171b21 25%,#1e242c 37%,#171b21 63%);background-size:400% 100%;animation:skel 1.4s ease infinite;border-radius:6px;}
/* на <img> у .thumb-img свой фон (#0c0f13, грузится позже) перебивал бы градиент —
   img.skel (специфичнее) возвращает шиммер, пока картинка грузится */
img.skel{background-image:linear-gradient(90deg,#171b21 25%,#1e242c 37%,#171b21 63%);background-size:400% 100%;}
@keyframes skel{0%{background-position:100% 0;}100%{background-position:-100% 0;}}

/* ============================================================
   ТУЛТИП (через title заменяем своим)
   ============================================================ */
[data-tip]{position:relative;}
[data-tip]:hover::after{
  content:attr(data-tip);position:absolute;left:50%;bottom:calc(100% + 8px);transform:translateX(-50%);
  background:#000;color:#e8ebf0;font-size:11.5px;font-family:var(--sans);white-space:nowrap;
  padding:5px 9px;border-radius:6px;border:1px solid var(--line);z-index:90;pointer-events:none;
  box-shadow:0 8px 20px -8px rgba(0,0,0,.8);animation:tipin var(--t-fast) var(--ease);
}
@keyframes tipin{from{opacity:0;transform:translate(-50%,4px);}to{opacity:1;transform:translate(-50%,0);}}

/* ============================================================
   ВХОД СТРАНИЦЫ — оркестрованный staggered reveal
   ============================================================ */
@media (prefers-reduced-motion:no-preference){
  .reveal{opacity:0;transform:translateY(10px);animation:reveal .52s var(--ease) forwards;animation-delay:calc(var(--i,0)*45ms);}
}
@keyframes reveal{to{opacity:1;transform:none;}}
/* страховка: контент всегда виден, даже если анимация заморожена (фон-вкладка/скрин).
   animation:none обязателен: fill:forwards держит анимацию transform/opacity
   «живой» навсегда, а Chromium на таком элементе держит stacking context (как
   will-change) — поповеры внутри reveal-карточек (паттерн .pop, work/78) уезжают
   ПОД следующие карточки, сколько z-index ни ставь. Растворяем контекст. */
body.reveal-settled .reveal{opacity:1!important;transform:none!important;animation:none!important;}

/* ============================================================
   PREFERS-REDUCED-MOTION — снимаем движение входа/выхода тостов и
   декоративные циклы; состояние остаётся читаемым. Тайминги видимости
   тостов (JS setTimeout) и загрузочные спиннеры не трогаем (FIND-A11Y-002).
   ============================================================ */
@media (prefers-reduced-motion:reduce){
  .toast{animation:none;}
  .toast.out{animation:none;}
  .reveal{opacity:1;transform:none;animation:none;}
  .dot.pulse{animation:none;}
  .bar.live>i::after{animation:none;}
  [data-tip]:hover::after{animation:none;}
}

/* утилиты */
.row{display:flex;align-items:center;gap:12px;}
.col{display:flex;flex-direction:column;}
.between{justify-content:space-between;}
.wrap{flex-wrap:wrap;}
.grow{flex:1;}
.gap-sm{gap:8px;}
.gap-lg{gap:20px;}
.divider{height:1px;background:var(--line-soft);width:100%;}
.vdiv{width:1px;align-self:stretch;background:var(--line-soft);}
.scroll-y{overflow-y:auto;}
.nowrap{white-space:nowrap;}
.right{margin-left:auto;}
.center{align-items:center;}
