/* Админка OVI — тот же бренд, что у приложения (ovi/web/app.css), раскладка для компьютера: разделы слева,
   содержимое по центру, агент справа на каждой странице; на телефоне агент — по кнопке. */
:root {
  --navy: #08142b; --navy2: #0f2142; --card: #15294f; --card2: #1c3462; --line: #2a4475;
  --red: #d3122f; --red2: #a80d25; --white: #fff; --muted: #9db0cc; --dim: #6f86a8; --ok: #22b07d; --warn: #f2b233;
  --head: "Montserrat", -apple-system, sans-serif; --body: "Open Sans", -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--navy); color: #fff; font: 15px/1.5 var(--body); }
a { color: #9fc4ff; }
button { font: inherit; color: inherit; }
.hidden { display: none !important; }
.mut { color: var(--muted); }
.small { font-size: 13px; }
.logo { font: italic 900 24px/1 var(--head); letter-spacing: 1px; }
.logo i { color: var(--red); }
h1 { font: 800 22px/1.2 var(--head); text-transform: uppercase; margin: 0 0 14px; }
h2 { font: 800 15px var(--head); text-transform: uppercase; margin: 22px 0 10px; letter-spacing: .3px; }
.btn { display: inline-block; border: 0; border-radius: 10px; padding: 9px 14px; font: 700 13px var(--body); background: var(--red); color: #fff; cursor: pointer; text-decoration: none; transition: background .18s; }
.btn:hover { background: var(--red2); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--card); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.field, select, textarea { background: var(--navy2); border: 1px solid var(--line); border-radius: 10px; color: #fff; font: 14px var(--body); padding: 8px 10px; outline: none; }
.field:focus, select:focus, textarea:focus { border-color: var(--muted); }
textarea { resize: vertical; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }

.shell { display: grid; grid-template-columns: 210px minmax(0, 1fr) 380px; min-height: 100vh; }
.nav { background: var(--navy2); border-right: 1px solid var(--line); padding: 16px 10px; position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.nav .logo { padding: 4px 10px 14px; }
.nav a { display: flex; justify-content: space-between; color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-weight: 600; }
.nav a:hover { background: var(--card); color: #fff; }
.nav a.on { background: var(--card2); color: #fff; }
.nav .cnt { background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; }
.nav .foot { margin-top: auto; padding: 10px; font-size: 12px; color: var(--dim); display: flex; flex-direction: column; gap: 6px; }
.main { padding: 24px 30px 60px; min-width: 0; max-width: 1400px; }
.agent { border-left: 1px solid var(--line); background: var(--navy2); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--card); border-radius: 14px; padding: 12px 14px; }
.kpi b { display: block; font: 900 30px var(--head); }
.kpi span { color: var(--muted); font-size: 13px; }
.card { background: var(--card); border-radius: 14px; padding: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.tag { display: inline-block; border-radius: 4px; font: 700 10.5px var(--body); padding: 1px 6px; background: var(--card2); color: var(--muted); }
.tag.red { background: var(--red); color: #fff; }
.tag.ok { background: var(--ok); color: #fff; }
.tag.warn { background: var(--warn); color: #2a1c00; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: default; position: sticky; top: 0; background: var(--navy); }
td { padding: 7px 8px; border-bottom: 1px solid #1a2d55; vertical-align: top; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #102449; }
tr.dim td { color: var(--dim); }
.tablewrap { overflow: auto; max-height: calc(100vh - 230px); border-radius: 10px; }
.bar { height: 8px; background: var(--card2); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--red); }
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel .fr { display: grid; grid-template-columns: 170px 1fr 60px; gap: 10px; align-items: center; }
.stage { border-left: 3px solid var(--line); padding: 4px 0 4px 12px; margin: 8px 0; }
.stage.rel { border-color: var(--ok); }
.stage.next { border-color: var(--warn); }
.post { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; padding: 8px 0; border-bottom: 1px solid #1a2d55; }
.bubs { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow: auto; padding: 4px; }
.bub { max-width: 75%; padding: 8px 11px; border-radius: 14px; white-space: pre-line; }
.bub.them { background: var(--card); border-bottom-left-radius: 4px; }
.bub.me { background: var(--red); margin-left: auto; border-bottom-right-radius: 4px; }
.bub small { display: block; font-size: 10.5px; opacity: .7; margin-top: 2px; }
.split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; }
.listbox { display: flex; flex-direction: column; gap: 4px; max-height: 75vh; overflow: auto; }
.listbox a { display: block; padding: 9px 10px; border-radius: 10px; background: var(--card); text-decoration: none; color: #fff; }
.listbox a.on { outline: 1.5px solid var(--red); }
.hours { display: flex; gap: 2px; align-items: flex-end; height: 80px; }
.hours i { flex: 1; background: var(--red); border-radius: 2px 2px 0 0; min-height: 1px; }
.warnline { color: var(--warn); }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #fff; color: #14223e; padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 100; max-width: 90vw; }
.modalbg { position: fixed; inset: 0; background: #000a; z-index: 90; display: grid; place-items: center; padding: 16px; }
.modalbox { background: var(--navy2); border: 1px solid var(--line); border-radius: 16px; padding: 18px; width: min(560px, 100%); display: flex; flex-direction: column; gap: 12px; max-height: 90vh; overflow: auto; }
.modalbox pre { white-space: pre-wrap; background: var(--navy); padding: 10px; border-radius: 8px; font: 12.5px/1.4 var(--body); margin: 0; }

/* агент */
.ag-head { padding: 14px 14px 8px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.ag-head b { font: 800 13px var(--head); text-transform: uppercase; flex: 1; }
.ag-log { flex: 1; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.ag-msg { font-size: 13.5px; }
.ag-msg.user { align-self: flex-end; background: var(--card2); border-radius: 12px 12px 4px 12px; padding: 8px 11px; max-width: 90%; white-space: pre-line; }
.ag-msg.bot { line-height: 1.5; }
.ag-msg.bot p { margin: 0 0 8px; }
.ag-msg.bot table { font-size: 12px; margin: 6px 0; }
.ag-msg.bot td, .ag-msg.bot th { padding: 4px 6px; position: static; background: none; }
.ag-msg.bot ul, .ag-msg.bot ol { margin: 4px 0 8px; padding-left: 20px; }
.ag-msg.bot code { background: var(--navy); padding: 1px 4px; border-radius: 4px; font-size: 12px; }
.ag-tool { font-size: 11.5px; color: var(--dim); }
.ag-act { background: var(--card); border: 1px solid var(--warn); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.ag-table { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.ag-form { padding: 10px 14px 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.ag-form textarea { min-height: 64px; max-height: 200px; }
.ag-err { color: #ff8a9b; font-size: 12.5px; }
.ag-toggle { display: none; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.logincard { width: min(420px, 100%); background: var(--navy2); border: 1px solid var(--line); border-radius: 18px; padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.logincard form { display: flex; flex-direction: column; gap: 10px; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 190px minmax(0, 1fr); }
  .agent { position: fixed; right: 0; top: 0; width: min(420px, 100vw); z-index: 80; transform: translateX(100%); transition: transform .18s; box-shadow: -10px 0 40px #0008; }
  .agent.open { transform: none; }
  .ag-toggle { display: block; position: fixed; right: 16px; bottom: 16px; z-index: 81; }
}
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav .foot { display: none; }
  .main { padding: 16px 12px 80px; }
  .split { grid-template-columns: 1fr; }
  .funnel .fr { grid-template-columns: 120px 1fr 50px; }
}

/* 26.11.2026: переключатель тестовых, выбор и сортировка в таблице, лента действий, таблица контента, свёрнутый агент */
.testtoggle { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--warn); padding: 4px 10px 12px; cursor: pointer; }
.bulkbar { margin-bottom: 10px; gap: 8px; }
.bulkbar:empty { display: none; }
th.sort { cursor: pointer; user-select: none; }
th.sort:hover { color: #fff; }
.split2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; }
.timeline { display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow: auto; font-size: 14px; }
.timeline > div { padding: 6px 0; border-bottom: 1px solid #1a2d55; }
table.days td { font-size: 13px; }
.ctable td { vertical-align: middle; }
.thumb { width: 64px; height: 40px; object-fit: cover; border-radius: 6px; display: block; background: var(--card2); }
body.agent-hidden .shell { grid-template-columns: 210px minmax(0, 1fr); }
body.agent-hidden .agent { display: none; }
body.agent-hidden .ag-toggle { display: block; position: fixed; right: 16px; bottom: 16px; z-index: 81; }
@media (max-width: 1100px) { .split2 { grid-template-columns: 1fr; } body.agent-hidden .agent { display: flex; } }

/* «Пуши и рычаги» (П1-8): следующий выпуск отдельно, предпросмотр уведомления, меню «⋯» в таблице */
.nextrel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 280px); gap: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.nr-l { display: flex; flex-direction: column; gap: 10px; }
.nr-l > small { font: 800 12px var(--head); text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.nr-t { font: 900 22px/1.2 var(--head); text-transform: uppercase; }
.nr-n b { font-weight: 800; }
.nr-r { background: var(--card2); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.notif { display: flex; gap: 10px; background: #eef1f6; color: #14223e; border-radius: 14px; padding: 12px; font-size: 13px; line-height: 1.35; }
.notif b { display: block; font-size: 13.5px; }
.ni { width: 30px; height: 30px; border-radius: 8px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font: italic 900 10px var(--head); flex: none; }
.ni i { color: var(--red); }
table.rel td, table.rel th { padding: 11px 16px; }
table.rel th { background: none; }
table.rel tr.cur td { background: var(--card2); font-weight: 700; }
table.rel tr.grp td { color: var(--text2, #c9d6ea); }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 12.5px; padding: 0; }
.menu { position: relative; display: inline-block; }
.menu summary { list-style: none; cursor: pointer; color: var(--muted); padding: 0 8px; font-size: 18px; line-height: 1; border-radius: 6px; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { background: var(--card2); color: #fff; }
.menu > div { position: absolute; right: 0; top: 26px; z-index: 20; background: var(--navy2); border: 1px solid var(--line); border-radius: 10px; padding: 4px; display: flex; flex-direction: column; min-width: 200px; box-shadow: 0 10px 30px #0008; }
.menu > div button { background: none; border: 0; text-align: left; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.menu > div button:hover { background: var(--card2); }
.menu > div button.danger { color: #ff6b7f; }
@media (max-width: 1100px) { .nextrel { grid-template-columns: 1fr; } }

/* обзор (П2-11) */
.ovhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.nextpill { display: flex; gap: 12px; align-items: center; background: var(--navy2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 14px; text-decoration: none; color: #fff; font-size: 14px; }
.nextpill em { font-style: normal; color: #ff6b7f; font-weight: 700; text-decoration: underline; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.tile span { color: #c9d6ea; font-size: 14px; }
.tile b { font: italic 900 34px/1.1 var(--head); }
.tile small { font-size: 12.5px; color: #c9d6ea; }
.tile .up { color: #6fe0b4; font-style: normal; font-weight: 700; }
.ovgrid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; margin-bottom: 16px; align-items: start; }
table.regs td { vertical-align: middle; white-space: nowrap; }
table.regs td:first-child { white-space: normal; }
table.regs th { background: none; }
table.regs tr.lag td { background: #2a2414; }
table.regs tr.lag td:first-child { color: var(--warn); font-weight: 700; }
.pbar { display: inline-block; width: 80px; height: 7px; background: var(--card2); border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 8px; }
.pbar i { display: block; height: 100%; background: #fff; border-radius: 4px; }
.pbar.lag i { background: var(--warn); }
.todos { display: flex; flex-direction: column; gap: 10px; }
.todo { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.todo.hot { border-color: var(--warn); }
.todo b { font-size: 14.5px; line-height: 1.3; }
.todo p { margin: 0; font-size: 13px; color: #c9d6ea; }
.todo a { color: #ff6b7f; font-weight: 700; text-decoration: none; white-space: nowrap; font-size: 13.5px; }
.todo .btn { align-self: flex-start; }
.course { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.course > div { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.course i { height: 5px; border-radius: 3px; background: var(--card2); margin-bottom: 6px; }
.course .rel i { background: var(--ok); }
.course .cur i { background: var(--red); }
.course small { color: var(--muted); font-size: 12px; }
/* «учитывать тестовых» заметно (П2-12) */
.testtoggle.on { background: var(--warn); color: #2a1c00; border-radius: 8px; margin: 0 6px 8px; padding: 6px 8px; font-weight: 700; }
.testbanner { background: #2a2414; border: 1px solid var(--warn); color: var(--warn); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; font-size: 14px; }
@media (max-width: 1300px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ovgrid { grid-template-columns: 1fr; } }

/* участники (П2-13, П2-14) */
.fbtn { background: var(--navy2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.fbtn.on { background: #2a2414; border-color: var(--warn); color: var(--warn); }
.ptable td { vertical-align: middle; }
.ptable th { background: var(--card); }
.ptable tr.on td { background: var(--card2); }
.ptable tr.on td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.dots4 { display: inline-flex; gap: 5px; vertical-align: middle; }
.dots4 i { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--line); }
.dots4 i.on { background: var(--ok); border-color: var(--ok); }
.cells6 { display: inline-flex; gap: 3px; vertical-align: middle; }
.cells6 i { width: 13px; height: 13px; border-radius: 3px; background: var(--card2); }
.cells6 i.ok { background: var(--ok); }
.cells6 i.miss { background: #ff6b7f; }
.ppanel { position: fixed; top: 0; right: 0; width: 380px; max-width: 100vw; height: 100vh; overflow: auto; z-index: 85; background: var(--navy2); border-left: 1px solid var(--line); box-shadow: -14px 0 40px #0009; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.pp-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.pp-head h2 { font-size: 20px; }
.pp-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pp-tiles div { background: var(--card); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.pp-tiles b { font: italic 900 22px var(--head); }
.pp-tiles span { font-size: 12px; color: var(--muted); }
.pp-tiles .warn { background: #2a2414; }
.pp-tiles .warn b { color: var(--warn); }
.ppanel h2 { margin: 6px 0 0; }
.ppdays td { padding: 6px 4px; font-size: 13px; border-bottom: 0; }
.ppdays td:first-child { white-space: nowrap; color: #c9d6ea; }
.ppdays span { margin-right: 8px; white-space: nowrap; }
.okt { color: #6fe0b4; }
.pptl { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.ppanel .menu summary.btn { font-size: 13px; padding: 9px 14px; color: #fff; }
.ppanel .menu > div { left: 0; right: auto; }

/* контент по дням (П2-16) */
.segm { display: flex; background: var(--navy2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.segm button { background: none; border: 0; padding: 7px 14px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.segm button.on { background: var(--card2); color: #fff; }
.cstage { margin-bottom: 12px; padding: 0; overflow: hidden; }
.cs-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 18px; }
.cs-t { font: 900 18px var(--head); text-transform: uppercase; }
.cstage .ctable th { background: none; padding: 8px 18px; }
.cstage .ctable td { padding: 10px 18px; }
.kindw { font: 800 11px var(--head); color: #ff6b7f; text-transform: lowercase; }
.thumb { flex: none; }
span.thumb { display: block; }
.cs-pr { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 12px 18px; background: var(--card2); font-size: 13.5px; }
.cs-pr > b:first-child { font: 900 12.5px var(--head); text-transform: uppercase; }
.redlink { color: #ff6b7f; font-weight: 700; text-decoration: none; }
.chipline { border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.cstage.wait .cs-head { padding: 12px 18px; }
.cstage.wait .cs-t { font-size: 16px; color: #c9d6ea; }

/* квиз (П2-15) */
.qtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.qtab { border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; text-decoration: none; color: #c9d6ea; font-size: 13.5px; font-weight: 600; background: var(--navy2); }
.qtab.on { background: #fff; color: var(--navy); border-color: #fff; font-weight: 700; }
.qtab.fin { border-color: var(--warn); color: var(--warn); }
.qtab.fin.on { background: var(--warn); color: #2a1c00; }
.tile b .of { font: italic 900 16px var(--head); color: #c9d6ea; }
.qcardA { margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.qcardA.hot { border: 1px solid var(--warn); }
.optbar { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) 48px; gap: 12px; align-items: center; font-size: 13.5px; }
.optbar b { text-align: right; }
.pbar.wide { width: 100%; margin: 0; }
.pbar.ok i { background: var(--ok); }
.optbar .pbar:not(.ok):not(.lag) i { background: #6f86a8; }
.qfoot { border-top: 1px solid var(--line); padding-top: 8px; }
.easyq { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; padding: 10px 16px; }
.easyq .pbar { width: 150px; }

/* агент (П3-5): подсказки над полем, карточка предложенного действия */
.ag-hints { display: flex; flex-wrap: wrap; gap: 6px; }
.aghint { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; color: #c9d6ea; }
.aghint:hover { background: var(--card); color: #fff; }
.ag-act { border: 1.5px dashed var(--warn); background: transparent; }
.ag-acth { font: 800 11.5px var(--head); text-transform: uppercase; letter-spacing: 1px; color: var(--warn); }
/* режим отладки участнику — в строке таблицы «Участники» (26.11.2026) */
.dbgt { margin-top: 4px; display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font-size: 11.5px; background: none; color: var(--muted); cursor: pointer; }
.dbgt.on { background: var(--warn); border-color: var(--warn); color: #2a1c00; font-weight: 700; }
.dbgt.always { cursor: default; opacity: .7; }
/* журнал сети с телефонов (Телеметрия, 30.11.2026) — отчёт текстом, колонки выровнены пробелами */
pre.netlog { background: var(--card); border-radius: 14px; padding: 14px; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre; overflow-x: auto; max-height: 70vh; }
