/* ============================================================
   LibreTime Core — SPA prototype
   Тёмная тема, лёгкая футуристика. Поверх LibreTime UI.
   ============================================================ */

:root {
  color-scheme: dark;

  /* Слои: дальше — темнее и нейтральнее, ближе — светлее. Не синий «туман». */
  --bg:            #101010;
  --bg-2:          #141414;
  --surface:       #1c1c1c;
  --surface-solid: #1c1c1c;
  --surface-2:     #242424;
  --surface-3:     #2c2c2c;
  --line:          rgba(255, 255, 255, 0.08);
  --line-2:        rgba(255, 255, 255, 0.14);

  --text:   #e6e6e6;
  --muted:  #9a9a9a;
  --faint:  #6e6e6e;

  --accent:    #4d8fd1;
  --accent-2:  #3a6ea8;
  --accent-dim: rgba(77, 143, 209, 0.14);
  --brand:     #d35113;
  --ok:        #3ccf91;
  --warn:      #f2ba4b;
  --danger:    #ef6672;
  --violet:    #9b7cf0;

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --r-xl: 26px;

  --ease:   cubic-bezier(0.4, 0, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.3, 0.64, 1);
  --dur:    0.22s;
  --dur-lg: 0.42s;

  --font: 'Inter', 'SF Pro Display', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  --sidebar-w: 264px;
  --sidebar-collapsed: 76px;

  --shadow:    0 18px 50px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 34px 90px rgba(0, 0, 0, 0.6);

  /* — мост к переменным LibreTime UI, чтобы его компоненты жили в нашей теме — */
  --lt-bg:            var(--bg-2);
  --lt-surface:       var(--surface-solid);
  --lt-surface-2:     var(--surface-2);
  --lt-surface-3:     var(--surface-3);
  --lt-border:        var(--line);
  --lt-border-hover:  var(--line-2);
  --lt-accent:        var(--accent);
  --lt-accent-dim:    var(--accent-dim);
  --lt-accent-glow:   rgba(77, 143, 209, 0.22);
  --lt-success:       var(--ok);
  --lt-success-dim:   rgba(60, 207, 145, 0.12);
  --lt-success-border:rgba(60, 207, 145, 0.35);
  --lt-danger:        var(--danger);
  --lt-danger-dim:    rgba(239, 102, 114, 0.12);
  --lt-danger-border: rgba(239, 102, 114, 0.35);
  --lt-warning:       var(--warn);
  --lt-warning-dim:   rgba(242, 186, 75, 0.12);
  --lt-text:          var(--text);
  --lt-text-muted:    var(--muted);
  --lt-text-faint:    var(--faint);
  --lt-placeholder:   #5a5a5a;
  --lt-radius-sm:     var(--r-sm);
  --lt-radius:        var(--r);
  --lt-radius-lg:     var(--r-lg);
  --lt-radius-xl:     var(--r-xl);
  --lt-ease:          var(--ease);
  --lt-ease-spring:   var(--spring);
  --lt-duration:      var(--dur);
  --lt-duration-fast: 0.14s;
  --lt-font:          var(--font);
  --lt-font-mono:     var(--mono);
  --lt-shadow-sm:     0 2px 8px rgba(0, 0, 0, 0.35);
  --lt-shadow:        var(--shadow);
  --lt-shadow-lg:     var(--shadow-lg);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--line-2); }
::selection { background: rgba(77, 143, 209, 0.28); }

/* Обводка фокуса — не на полях LibreTime UI: у .lt-input уже линия из центра. */
:focus-visible:not(.lt-input):not(.lt-textarea):not(.lt-select):not(.lt-btn):not(.lt-eye-toggle):not(.lt-dropdown-trigger) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.lt-input:focus, .lt-input:focus-visible,
.lt-textarea:focus, .lt-textarea:focus-visible,
.lt-select:focus, .lt-select:focus-visible,
.lt-eye-toggle:focus, .lt-eye-toggle:focus-visible {
  outline: none;
}

/* ============================================================
   Фон
   ============================================================ */

.fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: var(--bg); }

.fx-aurora {
  position: absolute;
  border-radius: 50%;
  opacity: 0.22;
}
.fx-aurora-a {
  width: 36vw; height: 36vw; left: -10vw; top: -16vw;
  background: radial-gradient(circle, rgba(211, 81, 19, 0.35), transparent 70%);
  animation: drift-a 26s var(--ease) infinite alternate;
}
.fx-aurora-b {
  width: 28vw; height: 28vw; right: -8vw; top: 8vh;
  background: radial-gradient(circle, rgba(77, 143, 209, 0.22), transparent 70%);
  animation: drift-b 32s var(--ease) infinite alternate;
}
.fx-aurora-c {
  width: 40vw; height: 32vw; left: 28vw; bottom: -24vw;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 72%);
  animation: drift-c 38s var(--ease) infinite alternate;
}
@keyframes drift-a { to { transform: translate3d(6vw, 5vh, 0) scale(1.15); } }
@keyframes drift-b { to { transform: translate3d(-7vw, 8vh, 0) scale(1.2); } }
@keyframes drift-c { to { transform: translate3d(-5vw, -6vh, 0) scale(1.1); } }

.fx-grid {
  position: absolute; inset: -1px;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 20%, transparent 82%);
}

.fx-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 120% 90% at 50% 0%, transparent 40%, rgba(0, 0, 0, 0.6) 100%);
}

.screen { position: relative; z-index: 1; min-height: 100vh; }

/* ============================================================
   Примитивы
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 15px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn:hover { border-color: rgba(255, 255, 255, 0.24); background: rgba(255, 255, 255, 0.08); }
.btn:active { transform: scale(0.985); }

.btn-primary { border-color: var(--accent-2); background: var(--accent-2); color: #fff; font-weight: 600; }
.btn-primary:hover { background: #2b83dd; border-color: #2b83dd; }
.btn-brand { border-color: var(--brand); background: rgba(224, 122, 58, 0.16); color: #f5b98a; }
.btn-brand:hover { background: rgba(224, 122, 58, 0.24); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { border-color: rgba(239, 102, 114, 0.4); background: rgba(239, 102, 114, 0.12); color: #ffb2ba; }
.btn-danger:hover { background: rgba(239, 102, 114, 0.2); border-color: rgba(239, 102, 114, 0.6); }
.btn-sm { min-height: 30px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted); cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); background: rgba(255, 255, 255, 0.07); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 8px; }

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.panel-pad { padding: 20px 22px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2, .panel-head h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.panel-head p { font-size: 12px; color: var(--faint); margin-top: 2px; }
.panel-body { padding: 18px 22px; }
.panel-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

.eyebrow { font-size: 10px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono  { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px;
  border: 1px solid var(--line-2); border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 11px; font-weight: 500; color: var(--muted);
  white-space: nowrap;
}
.badge-ok      { color: #8fe6bf; border-color: rgba(60, 207, 145, 0.35); background: rgba(60, 207, 145, 0.1); }
.badge-warn    { color: #f6d18c; border-color: rgba(242, 186, 75, 0.35); background: rgba(242, 186, 75, 0.1); }
.badge-danger  { color: #ffb2ba; border-color: rgba(239, 102, 114, 0.35); background: rgba(239, 102, 114, 0.1); }
.badge-accent  { color: #a9d8fb; border-color: rgba(86, 175, 236, 0.35); background: rgba(86, 175, 236, 0.1); }
.badge-brand   { color: #f5b98a; border-color: rgba(224, 122, 58, 0.35); background: rgba(224, 122, 58, 0.1); }
.badge-violet  { color: #cfc0fb; border-color: rgba(155, 124, 240, 0.35); background: rgba(155, 124, 240, 0.1); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge .dot.live { animation: pulse-dot 1.8s var(--ease) infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.dot-led { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--faint); }
.dot-led.ok { background: var(--ok); }
.dot-led.warn { background: var(--warn); }
.dot-led.danger { background: var(--danger); }
.dot-led.off { background: var(--surface-3); }

/* — Поля: подчёркивание из центра, как в LibreTime UI — */
.field { display: flex; flex-direction: column; min-width: 0; }
.field > label, .flabel {
  display: flex; align-items: center; gap: 7px;
  min-height: 15px; line-height: 15px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 7px;
  transition: color var(--dur) var(--ease);
}
.field:focus-within > label { color: var(--accent); }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap::before, .input-wrap::after {
  content: ''; position: absolute; bottom: 0; height: 2px; width: 0;
  background: var(--accent); z-index: 2; pointer-events: none;
  transition: width 260ms var(--ease);
}
.input-wrap::before { left: 50%; }
.input-wrap::after  { right: 50%; }
.input-wrap:focus-within::before, .input-wrap:focus-within::after { width: calc(50% - var(--r)); }
.input-wrap.is-error::before, .input-wrap.is-error::after { background: var(--danger); width: calc(50% - var(--r)); }

.input, .textarea, .select {
  width: 100%;
  min-height: 42px; padding: 10px 13px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: rgba(6, 9, 14, 0.5);
  color: var(--text); font-size: 13.5px;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.select { appearance: none; cursor: pointer; padding-right: 34px; }
.input::placeholder, .textarea::placeholder { color: #46536a; }
.input:hover, .textarea:hover, .select:hover { border-color: rgba(255, 255, 255, 0.2); }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: rgba(86, 175, 236, 0.4); background: rgba(6, 9, 14, 0.75);
}
.input:disabled, .textarea:disabled, .input[readonly], .textarea[readonly] {
  color: var(--muted); background: rgba(255, 255, 255, 0.025);
  border-color: var(--line); border-style: dashed; cursor: not-allowed;
}
.input:disabled:hover, .textarea:disabled:hover { border-color: var(--line); }
.select-wrap { position: relative; }
.hint { font-size: 11.5px; color: var(--faint); margin-top: 6px; line-height: 1.45; }
.hint.error { color: #ffb2ba; }

.input-wrap .in-icon { position: absolute; left: 13px; color: var(--faint); pointer-events: none; z-index: 3; transition: color var(--dur) var(--ease); }
.input-wrap:focus-within .in-icon { color: var(--accent); }
.input-wrap .input.has-icon { padding-left: 40px; }
.input-wrap .in-btn {
  position: absolute; right: 8px; z-index: 3;
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--faint); cursor: pointer;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.input-wrap .in-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

/* — Свои выпадашки: один вид у обычного селекта и мультиселекта — */
.xsel { position: relative; min-width: 0; }
.xsel-native { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }
.xsel::before, .xsel::after {
  content: ''; position: absolute; bottom: 0; height: 2px; width: 0;
  background: var(--accent); z-index: 3; pointer-events: none;
  transition: width 260ms var(--ease);
}
.xsel::before { left: 50%; }
.xsel::after { right: 50%; }
.xsel.open::before, .xsel.open::after { width: calc(50% - var(--r)); }
.xsel-btn {
  position: relative; width: 100%; min-height: 42px;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 34px 7px 13px; text-align: left;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: rgba(6, 9, 14, 0.5);
  color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.xsel-btn:hover { border-color: rgba(255, 255, 255, 0.2); }
.xsel.open .xsel-btn { border-color: rgba(86, 175, 236, 0.4); background: rgba(6, 9, 14, 0.75); }
.xsel.is-disabled .xsel-btn {
  color: var(--muted); background: rgba(255, 255, 255, 0.025);
  border-color: var(--line); border-style: dashed; cursor: not-allowed;
}
.xsel-sm { width: 76px; }
.xsel-sm .xsel-btn { min-height: 30px; padding: 4px 26px 4px 10px; font-size: 12px; border-radius: 9px; }
.xsel-sm .xsel-arw { right: 8px; }
.xsel-val { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xsel-ph { color: #46536a; }
.xsel-arw { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); display: grid; color: var(--faint); transition: transform var(--dur) var(--ease), color var(--dur) var(--ease); }
.xsel.open .xsel-arw { transform: translateY(-50%) rotate(180deg); color: var(--accent); }
.xsel-tags { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.xtag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px;
  border-radius: 99px; font-size: 12px;
  color: #a9d8fb; background: rgba(86, 175, 236, 0.12); border: 1px solid rgba(86, 175, 236, 0.26);
}
.xtag i { display: grid; color: rgba(169, 216, 251, 0.65); transition: color var(--dur) var(--ease); }
.xtag i:hover { color: #fff; }
.xsel-pop {
  position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 6px);
  display: none; min-width: 100%;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: rgba(13, 18, 27, 0.98); backdrop-filter: blur(16px);
  box-shadow: var(--shadow); overflow: hidden;
}
.xsel-pop.xsel-float { position: fixed; z-index: 99970; right: auto; min-width: 0; display: block; animation: pop-in 0.18s var(--ease) both; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-5px); } }
.xsel-search { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--faint); }
.xsel-search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font-size: 13px; }
.xsel-list { max-height: 248px; overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
.xsel-opt { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; font-size: 13px; color: var(--muted); cursor: pointer; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.xsel-opt:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.xsel-opt.on { color: #dceeff; background: rgba(86, 175, 236, 0.1); }
.xsel-check { width: 13px; display: grid; place-items: center; color: var(--accent); opacity: 0; transition: opacity var(--dur) var(--ease); }
.xsel-opt.on .xsel-check { opacity: 1; }
.xsel-empty { padding: 22px; text-align: center; font-size: 12.5px; color: var(--faint); }

/* — Загрузка картинок — */
.uploads { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); }
.upload {
  position: relative; padding: 10px; cursor: pointer;
  border: 1px dashed var(--line-2); border-radius: var(--r);
  background: rgba(6, 9, 14, 0.4);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.upload:hover, .upload.drag { border-color: rgba(86, 175, 236, 0.5); background: rgba(86, 175, 236, 0.06); }
.upload.is-set { border-style: solid; }
.up-img {
  position: relative; display: grid; place-items: center; gap: 6px;
  border-radius: 10px; overflow: hidden;
  background: rgba(255, 255, 255, 0.03); background-size: cover; background-position: center;
  color: var(--faint); font-size: 11.5px; text-align: center;
}
.upload[data-ratio="poster"] .up-img { aspect-ratio: 2 / 3; }
.upload[data-ratio="wide"] .up-img { aspect-ratio: 16 / 9; }
.up-img.has { color: transparent; }
.up-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; font-size: 12.5px; font-weight: 500; }
.up-meta { font-size: 11px; color: var(--faint); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-clear {
  width: 24px; height: 24px; display: none; place-items: center; flex: none;
  border: 1px solid var(--line); border-radius: 8px; background: rgba(6, 9, 14, 0.6); color: var(--faint); cursor: pointer;
}
.upload.is-set .up-clear { display: grid; }
.up-clear:hover { color: #ffb2ba; border-color: rgba(239, 102, 114, 0.4); }

.toggle { position: relative; display: inline-flex; align-items: center; gap: 11px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .track {
  position: relative; width: 42px; height: 24px; flex: none;
  border: 1px solid var(--line-2); border-radius: 99px;
  background: rgba(6, 9, 14, 0.6);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.toggle .thumb {
  position: absolute; top: 50%; left: 3px; width: 17px; height: 17px;
  border-radius: 50%; background: var(--faint);
  transform: translateY(-50%);
  transition: transform var(--dur) var(--spring), background var(--dur) var(--ease);
}
.toggle input:checked + .track { background: var(--accent-2); border-color: var(--accent-2); }
.toggle input:checked + .track .thumb { transform: translate(18px, -50%); background: #fff; }
.toggle .tlabel { font-size: 13px; color: var(--muted); transition: color var(--dur) var(--ease); }
.toggle input:checked ~ .tlabel { color: var(--text); }

.check { position: relative; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: 13px; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box {
  width: 18px; height: 18px; flex: none;
  border: 1.5px solid var(--line-2); border-radius: 6px;
  background: rgba(6, 9, 14, 0.6);
  display: grid; place-items: center;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.check .box svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 3; opacity: 0; transform: scale(0.5); transition: all var(--dur) var(--spring); }
.check input:checked + .box { background: var(--accent-2); border-color: var(--accent-2); }
.check input:checked + .box svg { opacity: 1; transform: scale(1); }

/* Простая таблица (там, где lt-table избыточна) */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th {
  position: sticky; top: 0; z-index: 2;
  padding: 11px 14px; text-align: left;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--faint);
  background: rgba(11, 15, 23, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); vertical-align: middle; }
.tbl tbody tr { transition: background var(--dur) var(--ease); }
.tbl tbody tr:hover { background: rgba(86, 175, 236, 0.05); }
.tbl tbody tr.row-link { cursor: pointer; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); }

.poster {
  position: relative;
  width: 38px; height: 54px; flex: none;
  border-radius: 6px; overflow: hidden;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform var(--dur) var(--spring);
}
tr:hover .poster { transform: scale(1.05); }
.poster-lg { width: 132px; height: 190px; border-radius: 14px; font-size: 30px; }

.title-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.title-cell .tc-name { font-weight: 500; }
.title-cell .tc-sub { font-size: 11.5px; color: var(--faint); }

/* ============================================================
   Авторизация
   ============================================================ */

.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; position: relative; }
#authCanvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.auth-card {
  position: relative; z-index: 1;
  width: min(396px, 100%);
  padding: 34px 32px 30px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  background: rgba(11, 15, 23, 0.82);
  backdrop-filter: blur(26px) saturate(130%);
  -webkit-backdrop-filter: blur(26px) saturate(130%);
  box-shadow: var(--shadow-lg);
  animation: card-in 0.55s var(--spring) both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(0.97); } }
/* Ошибку показываем спокойно: подсветка поля и строка сверху, без тряски */
.field.is-error > label { color: #ffb2ba; }
.field.is-error .input,
.field.is-error .textarea,
.field.is-error .select { border-color: rgba(239, 102, 114, 0.55); background: rgba(239, 102, 114, 0.06); }
.field.is-error .in-icon { color: var(--danger); }
.field.is-error .input-wrap::before,
.field.is-error .input-wrap::after { background: var(--danger); width: calc(50% - var(--r)); }

.auth-step { display: grid; gap: 15px; }
.auth-step.enter { animation: step-in 0.4s var(--ease) both; }
@keyframes step-in { from { opacity: 0; transform: translateX(20px); } }

.auth-alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 13px;
  border: 1px solid rgba(239, 102, 114, 0.35); border-radius: var(--r);
  background: rgba(239, 102, 114, 0.1);
  font-size: 12.5px; color: #ffc4ca;
  animation: alert-in 0.24s var(--ease) both;
}
@keyframes alert-in { from { opacity: 0; transform: translateY(-4px); } }
.auth-alert svg { flex: none; margin-top: 1px; color: var(--danger); }

.auth-sep {
  display: flex; align-items: center; gap: 12px; margin: 6px 0 2px;
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint);
}
.auth-sep::before, .auth-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.auth-link { color: var(--accent); cursor: pointer; }
.auth-link:hover { text-decoration: underline; }
.code-input { font-family: var(--mono); letter-spacing: 0.42em; font-size: 16px; }

.passkey-stage { display: grid; place-items: center; gap: 16px; padding: 18px 0 6px; text-align: center; }
.passkey-ring {
  position: relative; width: 112px; height: 112px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(86, 175, 236, 0.07);
}
.passkey-ring::before, .passkey-ring::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid rgba(86, 175, 236, 0.5);
  animation: ripple 2.2s var(--ease) infinite;
}
.passkey-ring::after { animation-delay: 1.1s; }
@keyframes ripple { 0% { transform: scale(0.7); opacity: 0.9; } 100% { transform: scale(1.35); opacity: 0; } }
.passkey-ring svg { color: var(--accent); }

.auth-success { display: grid; place-items: center; gap: 14px; padding: 22px 0; text-align: center; }
.auth-success h2 { font-size: 18px; font-weight: 600; }
.auth-success p { font-size: 12.5px; color: var(--muted); }
.tick { width: 72px; height: 72px; border-radius: 50%; border: 1.5px solid rgba(60, 207, 145, 0.5); display: grid; place-items: center; background: rgba(60, 207, 145, 0.1); animation: tick-pop 0.5s var(--spring) both; }
@keyframes tick-pop { from { transform: scale(0.5); opacity: 0; } }
.tick svg { stroke: var(--ok); stroke-width: 2.5; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 0.5s var(--ease) 0.18s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.auth-blocked { text-align: center; display: grid; gap: 13px; place-items: center; }
.auth-blocked h2 { font-size: 18px; font-weight: 600; }
.auth-blocked p { font-size: 12.5px; color: var(--muted); }
.auth-blocked .lock {
  width: 66px; height: 66px; border-radius: 20px; display: grid; place-items: center;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); color: var(--faint);
}
.ip-line {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px;
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

/* ============================================================
   Шелл
   ============================================================ */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns var(--dur-lg) var(--ease);
}
.shell.collapsed { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr); }
.shell.resizing { transition: none; user-select: none; }

.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  background: #161616;
  overflow: hidden;
}
.side-brand {
  display: flex; align-items: center; gap: 11px;
  height: 68px; padding: 0 20px; flex: none;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.side-brand img.mark { width: 28px; height: 28px; flex: none; }
.side-brand img.word { height: 21px; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.shell.collapsed .side-brand { padding: 0 24px; }
.shell.collapsed .side-brand img.word { opacity: 0; transform: translateX(-8px); pointer-events: none; }

/* ручка изменения ширины */
.side-grip {
  position: absolute; top: 0; right: 0; bottom: 0; width: 10px; z-index: 30;
  cursor: col-resize;
}
.side-grip::after {
  content: ''; position: absolute; top: 50%; right: 2px;
  width: 4px; height: 46px; border-radius: 99px;
  background: var(--accent); opacity: 0; transform: translateY(-50%) scaleY(0.4);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--spring);
}
.side-grip.ready::after, .side-grip.dragging::after { opacity: 0.85; transform: translateY(-50%) scaleY(1); }
.side-grip.ready { background: rgba(86, 175, 236, 0.08); }
.shell.collapsed .side-grip { display: none; }

.side-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 14px 12px 20px; position: relative;
}

.side-group { margin-bottom: 4px; }
.side-group-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 12px 10px 7px;
  border: 0; background: none; cursor: pointer;
  font-size: 10px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--faint); white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.side-group-btn:hover { color: var(--muted); }
.side-group-btn .arw { transition: transform var(--dur) var(--ease); }
.side-group.closed .side-group-btn .arw { transform: rotate(-90deg); }
.side-group-btn .cap { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; transition: opacity var(--dur) var(--ease); }
.shell.collapsed .side-group-btn { padding: 10px 10px 6px; justify-content: center; }
.shell.collapsed .side-group-btn .cap { opacity: 0; width: 0; }
.shell.collapsed .side-group-btn .arw { display: none; }

.side-group-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--dur-lg) var(--ease); }
.side-group.closed .side-group-body { grid-template-rows: 0fr; }
.side-group-body > .side-nav { overflow: hidden; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-marker {
  position: absolute; top: 0; left: 0; width: 100%; height: 38px; z-index: 0;
  border-radius: 10px;
  background: var(--accent-dim);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  transition: transform 0.42s var(--spring), opacity var(--dur) var(--ease), height var(--dur) var(--ease), width var(--dur) var(--ease);
  opacity: 0; pointer-events: none;
}
.side-marker::before {
  content: ''; position: absolute; left: -1px; top: 50%; width: 2.5px; height: 18px;
  border-radius: 99px; background: var(--accent);
  transform: translateY(-50%);
}

.side-item {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 11px;
  height: 38px; padding: 0 11px;
  border-radius: 11px;
  color: var(--muted); font-size: 13.5px;
  cursor: pointer; white-space: nowrap;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.side-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.045); }
.side-item.active { color: var(--accent); font-weight: 600; }
.side-item.active:hover { background: transparent; color: var(--accent); }
.side-item .ico { flex: none; width: 18px; height: 18px; display: grid; place-items: center; }
.side-item .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; transition: opacity var(--dur) var(--ease); }
.side-item .cnt {
  font-family: var(--mono); font-size: 10.5px; color: var(--faint);
  padding: 1px 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.06);
}
.side-item .cnt.hot { color: #ffb2ba; background: rgba(239, 102, 114, 0.16); }
.shell.collapsed .side-item .lbl, .shell.collapsed .side-item .cnt { opacity: 0; pointer-events: none; }
.shell.collapsed .side-item { padding: 0 15px; }

.side-site { margin-top: 2px; }
.side-site-btn .arw { transition: transform var(--dur) var(--ease); color: var(--faint); }
.side-site.open .side-site-btn .arw { transform: rotate(90deg); }
.side-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-lg) var(--ease); }
.side-site.open .side-sub { grid-template-rows: 1fr; }
.side-sub-inner { min-height: 0; overflow: hidden; }
.side-sub .side-item { height: 32px; font-size: 12.5px; padding-left: 41px; }
.side-sub .side-item::before {
  content: ''; position: absolute; left: 22px; top: 50%; width: 5px; height: 1px; background: var(--line-2);
}

.side-foot { flex: none; border-top: 1px solid var(--line); padding: 12px 12px 56px; display: grid; gap: 8px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; cursor: pointer; transition: background var(--dur) var(--ease); }
.side-user:hover { background: rgba(255, 255, 255, 0.04); }
.avatar {
  width: 32px; height: 32px; flex: none; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-2); color: #fff; font-weight: 600; font-size: 12px;
}
.side-user .who { min-width: 0; transition: opacity var(--dur) var(--ease); }
.side-user .who b { display: block; font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.side-user .who span { font-size: 10.5px; color: var(--faint); }
.shell.collapsed .side-user .who { opacity: 0; }

/* — Топбар — */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 11px;
  height: 68px; padding: 0 clamp(16px, 1.6vw, 24px); flex: none;
  border-bottom: 1px solid var(--line);
  background: #181818;
  overflow: visible;
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--faint); min-width: 92px; flex: 0 1 auto; overflow: hidden; white-space: nowrap; }
.crumbs a { cursor: pointer; transition: color var(--dur) var(--ease); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { opacity: 0.5; }
.crumbs .cur { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar-spacer { flex: 1; }

/* — Живое состояние в шапке — */
.hostbar, .onlinebar {
  display: flex; align-items: center; gap: 11px; flex: 0 0 auto; white-space: nowrap;
  height: 42px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.hostbar:hover, .onlinebar:hover { border-color: var(--line-2); background: var(--surface-3); }

.hm { display: grid; grid-template-columns: auto; gap: 2px; min-width: 42px; }
.hm b { font-size: 9px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.hm em { font-style: normal; font-size: 12.5px; line-height: 1; }
.hm-bar { display: block; height: 3px; border-radius: 99px; background: rgba(255, 255, 255, 0.09); overflow: hidden; }
.hm-bar u { display: block; height: 100%; border-radius: 99px; text-decoration: none; transition: width 0.6s var(--ease), background var(--dur) var(--ease); }
.hm-bar-ghost { background: transparent; }
.hm-up { min-width: 108px; }
.hm-up em { font-size: 12.5px; letter-spacing: 0.01em; }

.onlinebar { gap: 11px; }
.ol-now, .ol-day { display: flex; align-items: baseline; gap: 6px; }
.ol-now .dot-led { align-self: center; animation: pulse-dot 2.2s var(--ease) infinite; }
.ol-now b { font-size: 14px; }
.ol-day b { font-size: 13px; color: var(--muted); }
.ol-now span, .ol-day span { font-size: 10px; color: var(--faint); }

.alertbar { display: flex; gap: 5px; }
.hbtn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 9px; font-size: 12px;
  border: 1px solid var(--line); border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted); cursor: pointer; white-space: nowrap;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.hbtn:hover, .hbtn.on { color: var(--text); border-color: var(--line-2); background: rgba(255, 255, 255, 0.07); }
.hbtn .hb-c {
  font-family: var(--mono); font-style: normal; font-size: 10.5px;
  min-width: 18px; height: 18px; padding: 0 4px;
  display: inline-grid; place-items: center;
  border-radius: 99px; background: rgba(255, 255, 255, 0.08); color: var(--muted);
}
.hbtn .hb-c.hot    { background: rgba(239, 102, 114, 0.18); color: #ffb2ba; }
.hbtn .hb-c.warm   { background: rgba(242, 186, 75, 0.18); color: #f6d18c; }
.hbtn .hb-c.violet { background: rgba(155, 124, 240, 0.18); color: #cfc0fb; }
.hbtn .hb-c.zero   { opacity: 0.5; }

.hpop {
  position: fixed; z-index: 85;
  width: min(392px, calc(100vw - 24px));
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-in 0.24s var(--spring) both;
}
.hpop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.hpop-head b { display: block; font-size: 13.5px; font-weight: 600; }
.hpop-head span { font-size: 11px; color: var(--faint); }
.hpop-list { max-height: 344px; overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
.hpop-row {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 9px 9px; border-radius: 10px; cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.hpop-row:hover { background: rgba(255, 255, 255, 0.05); }
.hpop-ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.hpop-ico.danger { color: #ffb2ba; background: rgba(239, 102, 114, 0.14); }
.hpop-ico.warn   { color: #f6d18c; background: rgba(242, 186, 75, 0.14); }
.hpop-ico.accent { color: #a9d8fb; background: rgba(86, 175, 236, 0.14); }
.hpop-ico.violet { color: #cfc0fb; background: rgba(155, 124, 240, 0.14); }
.hpop-ico.ok     { color: #8fe6bf; background: rgba(60, 207, 145, 0.14); }
.hpop-txt { min-width: 0; }
.hpop-txt b { display: block; font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hpop-txt span { display: block; font-size: 11px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hpop-row time { font-size: 10.5px; color: var(--faint); font-family: var(--mono); white-space: nowrap; }
.hpop-empty { padding: 26px; text-align: center; font-size: 12.5px; color: var(--faint); }
.hpop-more {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--accent); cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.hpop-more:hover { background: rgba(86, 175, 236, 0.08); }

/* Шапка ужимается по месту, а не по ширине окна: меню-то тянется мышью */
.topbar.t1 .omni { min-width: 42px; }
.topbar.t1 .omni span, .topbar.t1 .omni kbd { display: none; }
.topbar.t2 .hbtn .hb-l { display: none; }
.topbar.t3 .hm-up { display: none; }
.topbar.t4 .ol-day { display: none; }
.topbar.t5 .hostbar { display: none; }
.topbar.t6 .onlinebar { display: none; }
.omni {
  display: flex; align-items: center; gap: 9px;
  height: 36px; padding: 0 10px 0 12px; min-width: 250px;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface-2);
  color: var(--faint); font-size: 13px; cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.omni:hover { border-color: var(--line-2); color: var(--muted); }
.omni kbd { margin-left: auto; font-family: var(--mono); font-size: 10.5px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--faint); }
.bell { position: relative; }
.bell .dot {
  position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); box-shadow: 0 0 0 2px rgba(9, 12, 18, 0.9);
  animation: pulse-dot 2s var(--ease) infinite;
}

.content { flex: 1; padding: 26px clamp(18px, 2.4vw, 34px) 60px; min-width: 0; }

.view { animation: view-in 0.42s var(--ease) forwards; }
.view.leaving { animation: view-out 0.16s var(--ease) forwards; }
@keyframes view-in  { from { opacity: 0; transform: translateY(14px); } }
@keyframes view-out { to   { opacity: 0; transform: translateY(-8px); } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.15; }
.page-head p { color: var(--muted); font-size: 13.5px; margin-top: 6px; max-width: 660px; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.stack { display: grid; gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr); gap: 18px; align-items: start; }
.grid-side-l { display: grid; grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.7fr); gap: 18px; align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cron-sched-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 12px;
  align-items: end;
}
.cron-sched-grid .field { margin: 0; }
.cron-sched-grid .select,
.cron-sched-grid .input { width: 100%; min-height: 38px; box-sizing: border-box; }
.cron-sched-grid .select-wrap,
.cron-sched-grid .input-wrap { width: 100%; }
.cron-sched-grid .field[hidden] { display: none; }
.span-2 { grid-column: 1 / -1; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-end { justify-content: flex-end; }
.row-between { justify-content: space-between; }
.nowrap { flex-wrap: nowrap; }

/* — Метрики — */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metrics-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.metrics-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metrics-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1500px) { .metrics-5, .metrics-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.metric {
  position: relative; overflow: hidden;
  padding: 15px 17px 14px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface);
  backdrop-filter: blur(14px);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
  animation: metric-in 0.5s var(--spring) both;
}
@keyframes metric-in { from { opacity: 0; transform: translateY(14px); } }
.metric:hover { transform: translateY(-2px); border-color: var(--line-2); }
.metric::after {
  content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 2.5px;
  border-radius: 0 99px 99px 0; background: var(--tone, var(--accent)); opacity: 0.85;
}
.metric .m-label { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.metric .m-value { font-family: var(--mono); font-size: 28px; font-weight: 500; letter-spacing: -0.03em; margin-top: 9px; line-height: 1; }
.metric .m-delta { position: relative; z-index: 1; font-size: 11px; color: var(--faint); margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.metric .m-delta.up { color: #8fe6bf; }
.metric .m-delta.down { color: #ffb2ba; }
.metric .spark { position: absolute; right: 0; bottom: -2px; left: 0; height: 28px; opacity: 0.2; pointer-events: none; }

.bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent-2); transform-origin: left; animation: bar-fill 0.9s var(--ease) both; }
.bar.ok > i { background: var(--ok); }
.bar.warn > i { background: var(--warn); }
.bar.danger > i { background: var(--danger); }
@keyframes bar-fill { from { transform: scaleX(0); } }

.stat-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.stat-line:last-child { border-bottom: 0; }
.stat-line .sl-name { display: flex; align-items: center; gap: 10px; font-size: 13px; min-width: 0; }
.stat-line .sl-val { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }

/* полоски «каталог по типам» */
.kind-row { display: grid; grid-template-columns: 20px minmax(88px, 1fr) 1fr 78px; gap: 11px; align-items: center; padding: 7px 0; font-size: 12.5px; }
.kind-row .kr-name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kind-row .kr-num { font-family: var(--mono); text-align: right; color: var(--text); }
.kind-row .kr-num i { color: var(--faint); font-style: normal; font-size: 11px; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 99px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px; color: var(--muted); cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.on { color: #bfe0fa; border-color: rgba(86, 175, 236, 0.45); background: rgba(86, 175, 236, 0.12); }
.chip.deny { color: #ffb2ba; border-color: rgba(239, 102, 114, 0.45); background: rgba(239, 102, 114, 0.1); }
.chip.allow { color: #8fe6bf; border-color: rgba(60, 207, 145, 0.45); background: rgba(60, 207, 145, 0.1); }
.chip-sm { height: 26px; font-size: 11.5px; padding: 0 9px; }

.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: rgba(6, 9, 14, 0.5); }
.seg button {
  border: 0; background: none; cursor: pointer;
  padding: 5px 11px; border-radius: 7px;
  font-size: 12px; color: var(--muted);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.seg button:hover { color: var(--text); }
.seg button.on { background: rgba(86, 175, 236, 0.16); color: #cfe7fb; }

.bulkbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; margin-bottom: 12px;
  border: 1px solid rgba(86, 175, 236, 0.3); border-radius: var(--r);
  background: rgba(86, 175, 236, 0.08);
  animation: step-in 0.28s var(--ease) both;
  font-size: 13px;
}

/* — Вкладки — */
.tabs { position: relative; display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab {
  position: relative; flex: none;
  padding: 11px 14px 13px;
  font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap;
  transition: color var(--dur) var(--ease);
  background: none; border: 0;
}
.tab:hover { color: var(--text); }
.tab.active { color: #dceeff; }
.tab .tcount { font-family: var(--mono); font-size: 10px; color: var(--faint); margin-left: 5px; }
.tab-marker {
  position: absolute; bottom: -1px; left: 0; height: 2px;
  background: var(--accent); border-radius: 99px;
  transition: transform 0.38s var(--spring), width 0.38s var(--spring);
}
.tab-panel { animation: view-in 0.34s var(--ease) both; }

/* — Карточка тайтла — */
.manual { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: var(--brand); }
.manual svg { width: 11px; height: 11px; }
.field-manual .input, .field-manual .textarea, .field-manual .select { border-color: rgba(224, 122, 58, 0.42); }

.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); }
.kv dt, .kv dd { padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 13px; }
.kv dt { color: var(--faint); }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }

.season { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 10px; }
.season-head { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: rgba(255, 255, 255, 0.025); cursor: pointer; transition: background var(--dur) var(--ease); }
.season-head:hover { background: rgba(255, 255, 255, 0.05); }
.season-head .arw { transition: transform var(--dur) var(--ease); color: var(--faint); }
.season.open .season-head .arw { transform: rotate(90deg); }
.season-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-lg) var(--ease); }
.season.open .season-body { grid-template-rows: 1fr; }
.season-body > div { overflow: hidden; }
.ep { display: flex; align-items: center; gap: 12px; padding: 9px 14px 9px 40px; border-top: 1px solid rgba(255, 255, 255, 0.04); font-size: 12.5px; }
.ep .ep-n { font-family: var(--mono); color: var(--faint); width: 34px; }
.ep .ep-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.serp { padding: 15px 17px; border: 1px solid var(--line); border-radius: var(--r); background: rgba(6, 9, 14, 0.5); }
.serp .s-url { font-size: 12px; color: #8fe6bf; }
.serp .s-title { font-size: 17px; color: #9dc7f5; margin-top: 4px; }
.serp .s-desc { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.5; }

/* — Консоль / журналы — */
.console {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.85;
  padding: 14px 16px; max-height: 280px; overflow-y: auto;
  background: rgba(4, 6, 10, 0.7); border-radius: var(--r);
  border: 1px solid var(--line);
  overscroll-behavior: contain;
}
.console div { display: flex; gap: 10px; animation: step-in 0.3s var(--ease) both; }
.console .t { color: var(--faint); flex: none; }
.console .lvl { flex: none; width: 42px; }
.console .lvl.ok { color: var(--ok); }
.console .lvl.warn { color: var(--warn); }
.console .lvl.err { color: var(--danger); }
.console .msg { color: var(--muted); word-break: break-all; }

/* — Синхронизация — */
.sync-page { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
.sync-page.with-log { grid-template-columns: minmax(0, 1fr) minmax(400px, 520px); }
.sync-log-aside { position: sticky; top: 12px; max-height: calc(100vh - 120px); display: flex; flex-direction: column; }
.sync-log-aside .console { flex: 1; min-height: 360px; max-height: calc(100vh - 180px); overflow-y: auto; }
.sync-log-aside .console div,
#sync-log.console div { animation: none; }
.sync-history .bar > i,
.sync-bar > i { animation: none; transition: width 0.25s ease; }
.sync-strip .panel-body { padding: 10px 14px; }
.sync-strip .bar { margin-top: 8px; }

/* — Очереди — */
.queue { display: grid; gap: 8px; }
.q-item {
  display: grid; grid-template-columns: 3px minmax(0, 1fr) auto; gap: 13px; align-items: center;
  padding: 12px 15px 12px 11px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer; overflow: hidden;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.q-item:hover { border-color: var(--line-2); background: rgba(255, 255, 255, 0.045); transform: translateX(3px); }
.q-item.sel { border-color: rgba(86, 175, 236, 0.5); background: rgba(86, 175, 236, 0.08); }
.q-item .flag { align-self: stretch; border-radius: 99px; background: var(--tone, var(--faint)); }
.q-item h4 { font-size: 13.5px; font-weight: 500; }
.q-item p { font-size: 11.5px; color: var(--faint); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.feed { display: grid; }
.feed-item { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 13px; padding: 11px 0; position: relative; }
.feed-item::before { content: ''; position: absolute; left: 15px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.feed-item:first-child::before { top: 18px; }
.feed-item:last-child::before { bottom: calc(100% - 18px); }
.feed-dot { position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted); }
.feed-body { min-width: 0; font-size: 13px; }
.feed-body time { display: block; font-size: 11px; color: var(--faint); margin-top: 2px; font-family: var(--mono); }

/* — Гео-карта — */
.geomap { position: relative; border-radius: var(--r); overflow: hidden; background: rgba(4, 7, 12, 0.55); border: 1px solid var(--line); }
.geomap svg { display: block; width: 100%; height: auto; touch-action: none; cursor: grab; }
.geomap.dragging svg { cursor: grabbing; }
.geomap .gm-c {
  fill: #16202e; stroke: rgba(255, 255, 255, 0.09); stroke-width: 0.5;
  transition: fill 160ms var(--ease);
}
.geomap .gm-c:hover { fill: #24374d; }
.geomap .gm-c.deny  { fill: rgba(239, 102, 114, 0.55); }
.geomap .gm-c.deny:hover { fill: rgba(239, 102, 114, 0.75); }
.geomap .gm-c.allow { fill: rgba(60, 207, 145, 0.5); }
.geomap .gm-c.allow:hover { fill: rgba(60, 207, 145, 0.7); }
.geomap .gm-c.pick { stroke: var(--accent); stroke-width: 1.2; }
.geomap-tip {
  position: absolute; pointer-events: none; z-index: 5;
  padding: 5px 9px; border-radius: 8px;
  background: rgba(8, 11, 17, 0.94); border: 1px solid var(--line-2);
  font-size: 11.5px; white-space: nowrap;
  transform: translate(-50%, -140%);
  opacity: 0; transition: opacity 120ms var(--ease);
}
.geomap-tip.on { opacity: 1; }
.geomap-tools { position: absolute; right: 10px; bottom: 10px; display: grid; gap: 6px; z-index: 4; }
.geomap-legend { display: flex; align-items: center; gap: 16px; padding: 10px 14px; font-size: 11.5px; color: var(--faint); border-top: 1px solid var(--line); }
.geomap-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }

/* — Выбор стран — */
.cpick-tags { margin-bottom: 10px; }
.cpick-list {
  max-height: 260px; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--line); border-radius: var(--r);
  background: rgba(6, 9, 14, 0.4);
}
.cpick-row {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) 28px 28px; gap: 8px; align-items: center;
  padding: 6px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px; transition: background var(--dur) var(--ease);
}
.cpick-row:last-child { border-bottom: 0; }
.cpick-row:hover { background: rgba(255, 255, 255, 0.035); }
.cpick-row .cp-code { font-size: 11px; color: var(--faint); }
.cpick-row .cp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.cpick-row.is-in { background: rgba(60, 207, 145, 0.07); }
.cpick-row.is-in .cp-name { color: var(--text); }
.cpick-row.is-out { background: rgba(239, 102, 114, 0.07); }
.cp-btn {
  width: 26px; height: 26px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 8px;
  background: rgba(255, 255, 255, 0.03); color: var(--faint); cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.cp-btn:hover { color: var(--text); border-color: var(--line-2); }
.cpick-row.is-in .cp-btn.plus { color: #8fe6bf; border-color: rgba(60, 207, 145, 0.4); background: rgba(60, 207, 145, 0.12); }
.cpick-row.is-out .cp-btn.minus { color: #ffb2ba; border-color: rgba(239, 102, 114, 0.4); background: rgba(239, 102, 114, 0.12); }

/* — Бекапы: выбор копии — */
.bk-copy {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; align-items: center;
  padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--r);
  background: rgba(6, 9, 14, 0.35);
  transition: border-color var(--dur) var(--ease);
}
.bk-copy:hover { border-color: var(--line-2); }
.bk-when b { display: block; font-size: 13px; font-weight: 500; }
.bk-when span { font-size: 11.5px; }
.bk-parts { display: flex; gap: 7px; }
.bk-meta { grid-column: 1 / -1; display: flex; gap: 5px; }

.link-cell {
  display: inline-flex; align-items: center; gap: 9px;
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--text); font: inherit;
  transition: color var(--dur) var(--ease);
}
.link-cell b { font-weight: 500; border-bottom: 1px dashed var(--line-2); }
.link-cell:hover { color: var(--accent); }

/* — Сервер — */
.gauge { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 0; }
.gauge-ring { position: relative; width: 54px; height: 54px; }
.gauge-ring svg { transform: rotate(-90deg); }
.gauge-ring circle { fill: none; stroke-width: 5; }
.gauge-ring .bg { stroke: rgba(255, 255, 255, 0.08); }
.gauge-ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 0.9s var(--ease); }
.gauge-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; }
.gauge-txt b { display: block; font-size: 13px; font-weight: 500; }
.gauge-txt span { font-size: 11.5px; color: var(--faint); }

/* — Тосты / оверлеи — */
.ov-back {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(3, 5, 9, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade-in 0.22s var(--ease) both;
  display: grid;
}
.ov-back.closing { animation: fade-out 0.18s var(--ease) both; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.modal {
  place-self: center;
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--line-2); border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-in 0.34s var(--spring) both;
}
.ov-back.closing .modal { animation: modal-out 0.18s var(--ease) both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(22px) scale(0.96); } }
@keyframes modal-out { to { opacity: 0; transform: translateY(10px) scale(0.98); } }

.palette {
  place-self: start center; margin-top: 12vh;
  width: min(600px, calc(100vw - 32px));
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-in 0.3s var(--spring) both;
}
.palette-input { display: flex; align-items: center; gap: 11px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.palette-input input { flex: 1; background: none; border: 0; outline: none; font-size: 15px; }
.palette-list { max-height: 340px; overflow-y: auto; padding: 8px; overscroll-behavior: contain; }
.palette-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.palette-item .kind { margin-left: auto; font-size: 10.5px; color: var(--faint); }
.palette-item.cur { background: rgba(86, 175, 236, 0.12); color: #dceeff; }
.palette-empty { padding: 26px; text-align: center; color: var(--faint); font-size: 13px; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 10px; justify-items: end; }
.toast {
  position: relative;
  display: flex; align-items: flex-start; gap: 11px;
  width: min(360px, calc(100vw - 40px));
  padding: 13px 15px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: rgba(17, 22, 32, 0.95);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  animation: toast-in 0.36s var(--spring) both;
  overflow: hidden;
}
.toast.out { animation: toast-out 0.26s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px) scale(0.96); } }
.toast .t-ico { flex: none; margin-top: 1px; }
.toast b { display: block; font-size: 13px; font-weight: 500; }
.toast span { font-size: 12px; color: var(--faint); }
.toast::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--tone, var(--accent)); transform-origin: left;
  animation: toast-bar 4s linear both;
}
@keyframes toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.empty { display: grid; place-items: center; gap: 10px; padding: 42px 20px; text-align: center; }
.empty .e-ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--faint); background: rgba(255, 255, 255, 0.02); }
.empty b { font-size: 14px; font-weight: 500; }
.empty span { font-size: 12.5px; color: var(--faint); max-width: 320px; }

/* — Демо-док — */
.demo-fab {
  position: fixed; left: 18px; bottom: 18px; z-index: 80;
  width: 40px; height: 40px; border-radius: 13px;
  display: grid; place-items: center;
  border: 1px solid var(--line-2); background: rgba(17, 22, 32, 0.9);
  backdrop-filter: blur(14px); color: var(--muted); cursor: pointer;
  box-shadow: var(--shadow);
  transition: color var(--dur) var(--ease), transform var(--dur) var(--spring);
}
.demo-fab:hover { color: var(--text); transform: translateY(-2px); }
.demo-dock {
  position: fixed; left: 18px; bottom: 68px; z-index: 80;
  width: 256px;
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background: rgba(15, 19, 28, 0.95);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-in 0.28s var(--spring) both;
}
.demo-dock[hidden] { display: none; }
.demo-dock-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px 11px 15px; border-bottom: 1px solid var(--line); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.demo-dock-body { padding: 8px; display: grid; gap: 2px; }
.demo-item { text-align: left; padding: 8px 11px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-size: 12.5px; cursor: pointer; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.demo-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.demo-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* ============================================================
   Подгонка компонентов LibreTime UI под тему
   ============================================================ */

.lt-table-wrap, .lt-tbl-wrap { background: transparent; }
.lt-table-toolbar, .lt-tbl-toolbar { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.lt-chart, .lt-chart-wrap { background: transparent; }
.lt-dropdown-panel { z-index: 70; }
.lt-chart-detail-empty { display: none; }
.lt-panel-close { display: none !important; }
.lt-panel, .lt-notify-panel { background: var(--surface); }

/* — Адаптив — */
@media (max-width: 1240px) {
  .metrics, .metrics-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-side, .grid-side-l { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1000px) {
  .shell { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr); }
  .grid-2, .grid-3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .side-grip { display: none; }
}
@media (max-width: 720px) {
  .metrics, .metrics-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .omni { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
