/* B2B TV — админка. Тёмная тема в духе панели ЛоялСити, акценты — цвета логотипа. */
:root {
  --bg: #0b1120;
  --bg2: #0f172a;
  --card: #151f33;
  --card2: #1b2740;
  --line: #26344f;
  --line2: #33456a;
  --text: #e6ebf5;
  --muted: #8d9bb5;
  --dim: #5f6d88;
  --brand: #c026d3;
  --brand2: #7c3aed;
  --grad: linear-gradient(135deg, #d946ef 0%, #8b5cf6 55%, #6366f1 100%);
  --indigo: #6366f1;
  --green: #10b981;
  --green2: #34d399;
  --yellow: #f59e0b;
  --red: #ef4444;
  --cyan: #22d3ee;
  --orange: #fb923c;
  --r: 16px;
  --r2: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 14px/1.45 "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(139, 92, 246, .12), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(217, 70, 239, .08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
a { color: #a5b4fc; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(192, 38, 211, .35); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.right { margin-left: auto; }
.center { text-align: center; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; }

/* ---------- шапка ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 17, 32, .82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-in { max-width: 1320px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 10px 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .2px; white-space: nowrap; }
.brand img { width: 40px; height: 40px; filter: drop-shadow(0 4px 12px rgba(217, 70, 239, .45)); }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; letter-spacing: 0; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px;
  color: var(--muted); font-weight: 600; white-space: nowrap; cursor: pointer; border: 0; background: none;
}
.tab:hover { color: var(--text); background: var(--card); text-decoration: none; }
.tab.on { color: #fff; background: var(--card2); box-shadow: inset 0 0 0 1px var(--line2); }
.tab.on svg { color: #e879f9; }
.top .me { margin-left: auto; display: flex; align-items: center; gap: 8px; }

main { max-width: 1320px; margin: 0 auto; padding: 22px 20px 80px; }
.page-h { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; flex-wrap: wrap; }
.page-h h1 { font-size: 24px; margin: 0; letter-spacing: -.3px; }
.page-h .sub { color: var(--muted); }

/* ---------- карточки ---------- */
.card {
  background: linear-gradient(180deg, rgba(27, 39, 64, .75), rgba(21, 31, 51, .9));
  border: 1px solid var(--line); border-radius: var(--r); padding: 18px;
}
.card.hover { cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.card.hover:hover { border-color: #4b3b7a; transform: translateY(-2px); box-shadow: var(--shadow); }
.card h3 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card h3 svg { color: #e879f9; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gauto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  main { padding: 14px 12px 80px; }
  .top-in { padding: 8px 12px; gap: 10px; }
  .brand span { display: none; }
}

/* KPI */
.kpi { position: relative; overflow: hidden; }
.kpi .lbl { color: var(--muted); font-weight: 600; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.kpi .val { font-size: 34px; font-weight: 800; letter-spacing: -1px; margin-top: 6px; line-height: 1.1; }
.kpi .val small { font-size: 16px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.kpi .note { color: var(--muted); font-size: 12px; margin-top: 4px; }
.kpi .glow { position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; filter: blur(40px); opacity: .35; }
.c-green { color: var(--green2); } .c-yellow { color: var(--yellow); } .c-red { color: #f87171; }
.c-indigo { color: #a5b4fc; } .c-brand { color: #f0abfc; } .c-cyan { color: var(--cyan); }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card2);
  color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap; transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.15); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.btn.pri { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 20px rgba(192, 38, 211, .3); }
.btn.green { background: #059669; border-color: transparent; color: #fff; }
.btn.share-toggle[aria-pressed="true"] { border-color: #34d399; box-shadow: inset 0 0 0 1px #34d399; }
.btn.red { background: rgba(239, 68, 68, .14); border-color: rgba(239, 68, 68, .45); color: #fca5a5; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { padding: 7px; }
.btn.big { padding: 16px 18px; font-size: 16px; border-radius: 14px; }
.toggle {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  border: 1px solid var(--line2); background: var(--bg2); color: var(--muted); cursor: pointer; user-select: none;
}
.toggle.on.eco { background: rgba(16, 185, 129, .15); border-color: rgba(16, 185, 129, .5); color: var(--green2); }
.toggle.on.snd { background: rgba(99, 102, 241, .18); border-color: rgba(99, 102, 241, .55); color: #c7d2fe; }

/* ---------- поля ---------- */
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; padding: 9px 12px; outline: none; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: #a855f7; box-shadow: 0 0 0 3px rgba(168, 85, 247, .18); }
textarea { width: 100%; min-height: 80px; resize: vertical; }
label.f { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
label.f input, label.f select, label.f textarea { color: var(--text); font-size: 14px; font-weight: 400; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input[type=search] { min-width: 240px; flex: 1; max-width: 380px; }
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: #c026d3; }

/* ---------- метки и точки ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgba(99, 102, 241, .15); color: #c7d2fe; border: 1px solid rgba(99, 102, 241, .3); white-space: nowrap; }
.tag.cat { background: rgba(217, 70, 239, .12); color: #f5d0fe; border-color: rgba(217, 70, 239, .3); }
.tag.ok { background: rgba(16, 185, 129, .13); color: #6ee7b7; border-color: rgba(16, 185, 129, .35); }
.tag.bad { background: rgba(239, 68, 68, .13); color: #fca5a5; border-color: rgba(239, 68, 68, .35); }
.pick .btn.on { color: #fff; background: rgba(217, 70, 239, .28); border-color: #d946ef; }
.pick .btn.on.g { background: rgba(16, 185, 129, .25); border-color: #10b981; }
.pick .btn.on.r { background: rgba(239, 68, 68, .25); border-color: #ef4444; }
.pick .btn.on.n { background: rgba(148, 163, 184, .22); border-color: #94a3b8; }
.tag.warn { background: rgba(245, 158, 11, .14); color: #fcd34d; border-color: rgba(245, 158, 11, .35); }
.tag.grey { background: rgba(148, 163, 184, .1); color: var(--muted); border-color: var(--line2); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; background: var(--dim); }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); }
.dot.off { background: var(--red); box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); }
.dot.warn { background: var(--yellow); box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); }

/* ---------- списки ---------- */
.cat-h { margin: 22px 0 10px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: .8px; }
.cat-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.list { display: flex; flex-direction: column; gap: 8px; }
.li {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r2);
  background: var(--card); border: 1px solid var(--line); cursor: pointer;
}
.li:hover { border-color: #4b3b7a; background: var(--card2); }
.li .t { font-weight: 700; }
.li .s { color: var(--muted); font-size: 12px; }
.stat { display: flex; flex-direction: column; align-items: flex-end; min-width: 70px; }
.stat b { font-size: 16px; }
.stat span { color: var(--dim); font-size: 11px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; border: 1px dashed var(--line2); border-radius: var(--r); }

/* канал */
.ch-card { display: flex; flex-direction: column; gap: 12px; }
.ch-top { display: flex; gap: 12px; align-items: flex-start; }
.logo-box {
  width: 64px; height: 64px; flex: none; border-radius: 14px; background: #0a0f1c; border: 1px solid var(--line2);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.logo-box img { max-width: 86%; max-height: 86%; object-fit: contain; }
.logo-box.big { width: 92px; height: 92px; border-radius: 18px; }
.logo-ph { color: var(--dim); font-weight: 800; font-size: 20px; }
.ch-name { font-weight: 800; font-size: 16px; line-height: 1.25; }
.ch-addr { color: var(--muted); font-size: 12px; margin-top: 2px; }
.ch-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.ch-meta b { color: var(--text); font-size: 14px; }
.ch-foot { display: flex; gap: 6px; align-items: center; }

/* ---------- ролики (превью) ---------- */
.clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.clip { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; position: relative; }
.clip .pv { aspect-ratio: 16/9; background: #05080f center/cover no-repeat; display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; }
.clip .pv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.clip .pv .play { position: absolute; width: 38px; height: 38px; border-radius: 50%; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.clip .pv:hover .play { opacity: 1; }
.clip .dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0, 0, 0, .7); padding: 1px 6px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.clip .ci { padding: 8px 10px; display: flex; gap: 6px; align-items: center; }
.clip .ci .t { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.clip .state { position: absolute; left: 6px; top: 6px; }

/* ---------- окна ---------- */
.overlay { position: fixed; inset: 0; background: rgba(3, 6, 14, .72); backdrop-filter: blur(4px); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; animation: fade .15s; }
.modal { width: 100%; max-width: 980px; background: var(--bg2); border: 1px solid var(--line2); border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: up .18s; }
.modal.narrow { max-width: 520px; }
.modal.wide { max-width: 1200px; }
.modal-h { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg2); border-radius: 20px 20px 0 0; z-index: 2; }
.modal-h h2 { margin: 0; font-size: 18px; }
.modal-b { padding: 18px 20px 22px; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 0 20px 20px; }
@media (max-width: 720px) { .overlay { padding: 0; } .modal { border-radius: 0; min-height: 100vh; } .modal-h { border-radius: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(12px); opacity: 0; } }
.subtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; }
.subtab { padding: 10px 16px; cursor: pointer; color: var(--muted); font-weight: 700; border-bottom: 2px solid transparent; white-space: nowrap; background: none; border-top: 0; border-left: 0; border-right: 0; }
.subtab.on { color: #fff; border-bottom-color: #d946ef; }
.subtab .cnt { margin-left: 6px; color: var(--dim); font-weight: 600; }

/* таблицы */
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; padding: 8px 10px; border-bottom: 1px solid var(--line); font-weight: 700; }
table.t td { padding: 9px 10px; border-bottom: 1px solid rgba(38, 52, 79, .6); vertical-align: middle; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: rgba(255, 255, 255, .02); }
.scroll { max-height: 60vh; overflow-y: auto; }

/* полоски прогресса и диаграммы */
.bar { height: 8px; border-radius: 99px; background: var(--bg); overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--grad); }
.bar.green > i { background: linear-gradient(90deg, #059669, #34d399); }
.bar.warn > i { background: linear-gradient(90deg, #d97706, #fbbf24); }
.bar.red > i { background: linear-gradient(90deg, #dc2626, #f87171); }
.meter { display: flex; flex-direction: column; gap: 6px; }
.meter .mh { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.meter .mh b { color: var(--text); }
.chart { width: 100%; height: 160px; }
.chart text { fill: var(--dim); font-size: 10px; }

/* приставка */
.prio { border: 1px solid rgba(217, 70, 239, .35); background: linear-gradient(180deg, rgba(192, 38, 211, .12), rgba(21, 31, 51, .9)); }
.prio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.prio-btn { padding: 16px 12px; border-radius: 14px; font-weight: 800; font-size: 15px; text-align: center; background: var(--card2); border: 1px solid var(--line2); cursor: pointer; min-height: 64px; color: var(--text); }
.prio-btn:hover { border-color: #d946ef; }
.prio-btn.on { background: var(--grad); border-color: transparent; color: #fff; }
.prio-btn small { display: block; font-weight: 600; color: var(--muted); font-size: 11px; margin-top: 4px; }
.prio-btn.on small { color: #fde4ff; }
.prio-nav { display: flex; gap: 10px; }
.prio-nav .btn { flex: 1; }
.actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.actions .btn { justify-content: flex-start; padding: 12px; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; font-size: 13px; }
.kv > div:nth-child(odd) { color: var(--muted); }
@media (max-width: 720px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv > div:nth-child(even) { margin-bottom: 8px; } }

/* задачи */
.task { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task.done .tt { text-decoration: line-through; color: var(--dim); }
.task input { margin-top: 3px; width: 18px; height: 18px; accent-color: #10b981; }

/* всплывашки */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--card2); border: 1px solid var(--line2); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); animation: up .2s; max-width: 380px; }
.toast.ok { border-color: rgba(16, 185, 129, .5); }
.toast.err { border-color: rgba(239, 68, 68, .55); }

/* вход */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login .card { width: 100%; max-width: 380px; padding: 30px; text-align: center; }
.login img { width: 120px; filter: drop-shadow(0 10px 30px rgba(217, 70, 239, .5)); }
.login h1 { margin: 6px 0 4px; font-size: 22px; }
.login form { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; text-align: left; }

.spin { width: 18px; height: 18px; border: 2px solid var(--line2); border-top-color: #d946ef; border-radius: 50%; animation: rot .8s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }
.loading { padding: 40px; text-align: center; color: var(--muted); }
video.player { width: 100%; max-height: 70vh; background: #000; border-radius: 12px; }
.screens { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.screens img { width: 100%; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; }
.upl { border: 1px dashed var(--line2); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }

/* --- правки после просмотра (10.10): ничего не должно уезжать за край на телефоне --- */
.grid > *, .row > *, .col > * { min-width: 0; }
.actions .btn { white-space: normal; text-align: left; line-height: 1.25; }
.prio-nav { flex-wrap: wrap; }
@media (max-width: 720px) {
  .prio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prio-btn { font-size: 14px; padding: 14px 8px; }
  .prio-nav .btn.big { padding: 14px 10px; font-size: 15px; flex: 1 1 30%; }
  .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-b { padding: 14px 12px 20px; }
  .card { padding: 14px; }
  .filters input[type=search] { min-width: 0; max-width: none; width: 100%; }
  .filters select { flex: 1 1 45%; }
  .li { flex-wrap: wrap; }
  .stat { min-width: 56px; }
  table.t { font-size: 13px; }
  .page-h h1 { font-size: 20px; }
}
.scroll { overflow-x: auto; }

/* --- включённый приоритет: видно издалека (забытый приоритет = заведение смотрит только рекламу) --- */
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .55); } 50% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); } }
.prio-alert { border: 2px solid #f59e0b; background: linear-gradient(135deg, rgba(245, 158, 11, .22), rgba(239, 68, 68, .14)); animation: pulse 2s infinite; margin-bottom: 14px; }
.prio-alert h3 { color: #fde68a; font-size: 17px; }
.prio-alert h3 svg { color: #fbbf24; }
.card.prio-on { border: 2px solid #f59e0b; animation: pulse 2s infinite; }
.tag.prio { background: #f59e0b; color: #1a1205; border-color: #f59e0b; }
.tag.exp { background: rgba(251, 146, 60, .15); color: #fdba74; border-color: rgba(251, 146, 60, .4); }

/* --- правки владельца 10.10 вечер --- */
/* шапка окна больше не «висит» при прокрутке */
.modal-h { position: static; }
/* каналы и приставки — строками во всю ширину */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row-card { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-radius: 14px; background: var(--card);
  border: 1px solid var(--line); cursor: pointer; transition: border-color .15s, background .15s; }
.row-card:hover { border-color: #4b3b7a; background: var(--card2); }
.row-card.prio-on { border: 2px solid #f59e0b; animation: pulse 2s infinite; }
.row-card .main { flex: 1; min-width: 0; }
.row-card .ttl { font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-card .ttl .kind { color: var(--muted); font-weight: 600; }
.row-card .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.row-card .metrics { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.metric { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.metric b { font-size: 16px; }
.metric span { color: var(--dim); font-size: 11px; white-space: nowrap; }
@media (max-width: 720px) { .row-card { flex-wrap: wrap; } .row-card .metrics { width: 100%; justify-content: flex-start; } }
/* превью «черепицей» */
.tiles { width: 64px; height: 44px; position: relative; flex: none; }
.tiles img { position: absolute; width: 44px; height: 30px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line2); background: #05080f; }
.tiles img:nth-child(1) { left: 0; top: 0; z-index: 3; }
.tiles img:nth-child(2) { left: 10px; top: 7px; z-index: 2; opacity: .85; }
.tiles img:nth-child(3) { left: 20px; top: 14px; z-index: 1; opacity: .7; }
/* реклама в истории показов — еле видно жёлтым по всей строке */
table.t tr.ad td { background: rgba(245, 158, 11, .07); }
table.t tr.prio-row td { background: rgba(217, 70, 239, .08); }
.row-card .metric { width: 92px; min-width: 92px; }
table.t tr.ad td { background: rgba(245, 158, 11, .11); }

/* --- правки владельца 10.10 поздно: текст в карточках крупнее на ~15%, жирный легче --- */
.row-card .ttl { font-size: 18px; font-weight: 600; }
.row-card .ttl .kind { font-weight: 500; }
.row-card .sub { font-size: 14px; }
.metric b { font-size: 18px; font-weight: 600; }
.metric span { font-size: 12.5px; }
.li .t { font-size: 16px; font-weight: 600; }
.li .s { font-size: 13.5px; }
.stat b { font-size: 18px; font-weight: 600; }
.stat span { font-size: 12.5px; }
.clip .ci .t { font-size: 13.5px; font-weight: 500; }
/* задачи: тонкая жёлтая рамка, важные — мягкий жёлтый градиент */
.task { border: 1px solid rgba(245, 158, 11, .22); border-radius: 10px; padding: 9px 11px; margin-bottom: 8px; }
.task:last-child { border-bottom: 1px solid rgba(245, 158, 11, .22); }
.task.prio { background: linear-gradient(135deg, rgba(245, 158, 11, .22), rgba(245, 158, 11, .04) 70%); border-color: rgba(245, 158, 11, .5); }
.task input[type=checkbox] { width: 15px; height: 15px; accent-color: #6b8f80; opacity: .75; margin-top: 4px; }
.task .tt { font-size: 14.5px; }

/* перетаскивание порядка (разделы и клиенты канала) */
.grip { cursor: grab; color: var(--dim); display: inline-flex; padding: 4px; border-radius: 6px; }
.grip:hover { color: var(--text); background: var(--card2); }
tr.dragging td, .li.dragging { opacity: .4; }
tr.drop-over td, .li.drop-over { box-shadow: inset 0 2px 0 #d946ef; }

/* Действие кнопки выполняется — повторное нажатие не проходит (core.js guard). */
.busy { opacity: .6; cursor: progress !important; pointer-events: auto; }

/* Периодичность РД: число минут, кратное 5 */
.iv-input { width: 72px; text-align: right; }
.iv-input.bad { border-color: #ef4444; }

/* Белый фон под логотипом канала (кнопка «Фон» во вкладке «Лого»), только в админке */
.logo-box.light { background: #fff; border-color: #d7dbe3; }
.logo-box.light .logo-ph { color: #8a93a6; }

/* Выбор с подписью (каналы: название + адрес мелко) */
.chooser { position: relative; min-width: 200px; }
.chooser-btn { width: 100%; display: flex; align-items: center; gap: 8px; justify-content: space-between; text-align: left;
  padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text); cursor: pointer; font: inherit; }
.chooser-btn:hover { border-color: var(--accent, #a855f7); }
.chooser-val { display: flex; flex-direction: column; min-width: 0; }
.chooser .t { font-weight: 600; line-height: 1.25; }
.chooser .s { font-size: 12px; color: var(--muted); line-height: 1.25; margin-top: 2px; }
.chooser-list { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px); max-height: 320px; overflow: auto;
  background: var(--card2); border: 1px solid var(--line2); border-radius: 10px; padding: 6px; box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.chooser-list input[type=search] { width: 100%; margin-bottom: 6px; }
.chooser-item { display: flex; flex-direction: column; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.chooser-item:hover { background: var(--card); }
.chooser-item.on { background: rgba(168, 85, 247, .18); }

/* ---------- ЛК техника (13.10): открывают с телефона — кнопки крупные ---------- */
.tech-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tech-btn { flex-direction: column; gap: 6px; padding: 16px 10px; border-radius: 14px; font-size: 14px; white-space: normal; text-align: center; line-height: 1.2; min-height: 78px; }
.tech-visit { margin-top: 10px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.row-card.tech-ch .metric { width: auto; min-width: 70px; }
.rep-row { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--card); display: flex; flex-direction: column; gap: 10px; }
.rep-row.need { border-color: rgba(217, 70, 239, .45); }
.rep-row .rep-h { display: flex; align-items: center; gap: 10px; }
.rep-row .t { font-weight: 700; font-size: 16px; }
.rep-row .s { font-size: 12px; color: #f0abfc; }
.rep-row .photo-add { width: 100%; padding: 13px; font-size: 15px; }
.rep-upd { margin-top: 18px; }
.rep-upd .rep-row { border: 2px solid rgba(16, 185, 129, .45); background: linear-gradient(180deg, rgba(16, 185, 129, .1), var(--card)); }
.rep-upd .photo-add { padding: 16px; font-size: 16px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line2); background: #05080f; }
.ph img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.ph-file { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 100%; padding: 8px; font-size: 11px; color: var(--muted); text-align: center; word-break: break-all; }
.ph-del { position: absolute; right: 4px; top: 4px; width: 28px; height: 28px; border-radius: 8px; border: 0; background: rgba(0, 0, 0, .65); color: #fca5a5; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lb-img { width: 100%; max-height: 78vh; object-fit: contain; border-radius: 10px; background: #000; touch-action: pan-y; }
.note-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card); display: flex; flex-direction: column; gap: 8px; }
.note-text { white-space: pre-wrap; word-break: break-word; }
.info-text { font-size: 15px; line-height: 1.5; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
@media (max-width: 720px) {
  .tech-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tech-btn { min-height: 72px; font-size: 14px; }
  .photos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .li.tech-box { flex-wrap: nowrap; }
  .li.tech-box .tag { display: none; }
  .row-card.tech-ch { flex-wrap: nowrap; }
  .row-card.tech-ch .metrics, .row-card.tech-ch .metric { width: auto; }
  .row-card.tech-ch .ttl { font-size: 16px; white-space: normal; }
  .row-card.tech-ch .logo-box { width: 48px; height: 48px; }
}

/* ---------- сотрудники ---------- */
.staff-deps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.staff-dep-h { margin-bottom: 8px; color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: .6px; }
.staff-li { gap: 12px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800;
  background: var(--card2); border: 1px solid var(--line2); color: #e9d5ff; position: relative; }
.avatar.on::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--green); border: 2px solid var(--bg2); }
.avatar.big { width: 48px; height: 48px; font-size: 20px; background: var(--grad); color: #fff; border: 0; }
@media (max-width: 720px) { .staff-deps { grid-template-columns: 1fr; } }

/* ---------- тех таблица и отчёты ---------- */
.tt-wrap { overflow: auto; max-height: calc(100vh - 210px); border: 1px solid var(--line); border-radius: var(--r); background: var(--bg2); }
table.tt { min-width: 1250px; }
table.tt th { position: sticky; top: 0; z-index: 2; background: var(--card2); white-space: nowrap; }
table.tt td { vertical-align: top; font-size: 13px; }
table.tt td.tt-name { font-weight: 700; min-width: 160px; position: sticky; left: 0; background: var(--bg2); z-index: 1; }
table.tt th:first-child { left: 0; z-index: 3; }
table.tt tr.tt-group td { background: rgba(217, 70, 239, .08); color: #f0abfc; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; position: static; }
table.tt td.tt-cell { cursor: pointer; max-width: 260px; min-width: 160px; }
table.tt td.tt-cell:hover { background: rgba(255, 255, 255, .03); }
.clip2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; word-break: break-word; }
.po { border: 0; border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: 12px; cursor: pointer; display: inline-block; }
.po.yes { background: #059669; color: #fff; }
.po.no { background: #dc2626; color: #fff; cursor: default; }
button.po.no { cursor: pointer; }
.po small { font-weight: 600; opacity: .85; }
select.by-sel { padding: 5px 8px; font-size: 13px; }
select.by-sel.set { border-color: rgba(124, 58, 237, .7); background: rgba(124, 58, 237, .18); }
table.rep { min-width: 0; }
table.rep th.rep-col { text-align: center; min-width: 120px; vertical-align: bottom; text-transform: none; letter-spacing: 0; white-space: normal; }
table.rep th.rep-col.on { background: #3b2160; }
table.rep th.rep-col.gone .rep-nm { color: var(--muted); text-decoration: line-through; }
.rep-btns { display: flex; justify-content: center; gap: 2px; margin-bottom: 4px; }
.rep-btns .btn.on { color: #f0abfc; background: rgba(217, 70, 239, .2); }
.rep-nm { color: var(--text); font-size: 13px; font-weight: 700; max-width: 160px; margin: 0 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-cnt { font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 2px; }
td.rep-cell { text-align: center; vertical-align: middle !important; }
@media (max-width: 720px) { .tt-wrap { max-height: none; } table.tt td.tt-name { min-width: 120px; } }

/* 9 вкладок владельца в одну строку на обычном мониторе */
@media (min-width: 721px) { .top .tab { padding: 9px 11px; gap: 7px; } .top-in { gap: 14px; } }
@media (max-width: 720px) { .filters input[type=search] { flex: 1 1 100%; } }
table.tt { min-width: 1150px; }
table.tt td:nth-child(3) { min-width: 170px; }

/* правки 13.10: тех. таблица во всю ширину без ползунка; ползунок «Отчётов» — в нашем стиле */
main.wide { max-width: 1800px; }
table.tt.fit { min-width: 0; width: 100%; table-layout: fixed; }
table.tt.fit th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
table.tt.fit td { overflow-wrap: anywhere; }
table.tt.fit td.tt-name, table.tt.fit td.tt-cell { min-width: 0; max-width: none; }
table.tt.fit td:nth-child(3) { min-width: 0; }
table.tt.fit select.by-sel { width: 100%; padding: 5px 4px; }
table.rep th.rep-col.hint { text-align: left; color: var(--muted); font-weight: 500; min-width: 260px; }
.tt-wrap { scrollbar-width: thin; scrollbar-color: #7c3aed var(--bg2); }
.tt-wrap::-webkit-scrollbar { height: 10px; width: 10px; }
.tt-wrap::-webkit-scrollbar-track { background: var(--bg2); border-radius: 0 0 var(--r) var(--r); }
.tt-wrap::-webkit-scrollbar-thumb { background: linear-gradient(90deg, #d946ef, #6366f1); border-radius: 99px; border: 2px solid var(--bg2); }
.tt-wrap::-webkit-scrollbar-corner { background: var(--bg2); }
@media (max-width: 900px) { table.tt.fit { min-width: 1000px; table-layout: auto; } }

/* фотоотчёт: есть хоть один файл — зелёным «отчёт есть»; видео в сетке */
.rep-row.done { border-color: rgba(16, 185, 129, .55); }
.rep-row.done .s { color: var(--green2); font-weight: 700; }
.ph-video { width: 100%; height: 100%; position: relative; cursor: pointer; background: #000; }
.ph-video img { width: 100%; height: 100%; object-fit: cover; }
.ph-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0, 0, 0, .6); display: flex; align-items: center; justify-content: center; color: #fff; }

/* раздел «Сайт» (31.10): воронка, путь посетителя, QR-коды */
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.funnel-bar { height: 10px; border-radius: 99px; margin-top: 4px; min-width: 4px; opacity: .9; }
.path { display: flex; flex-direction: column; gap: 3px; border-left: 2px solid var(--line2); padding-left: 10px; }
.path-i { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.path-i.ev { color: #fcd34d; }
.path-i.ld { color: var(--green2); font-weight: 700; }
.path-sep { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; margin: 6px 0 2px; }
.qr-img { flex: none; width: 104px; height: 104px; border-radius: 12px; background: #fff; padding: 4px; display: block; }
.qr-img img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.qr-off { opacity: .6; }
.qr-off .qr-img { filter: grayscale(1); }
@media (max-width: 720px) { .qr-img { width: 84px; height: 84px; } }
