/* Оформление в духе KVS: светлый рабочий стол, тёмное боковое меню с синим выбранным пунктом, синяя шапка таблиц с пунктирными разделителями,
   строки «зеброй», серые кнопки и синяя главная кнопка, зелёная и красная полосы сообщений. */
:root{
  --hl:#1a73e8;--hl2:#1a4ee8;--on-hl:#fff;--red:#ef0025;--red-soft:#f56064;
  --bg:#fff;--bg-blue:#f1f5f8;--bg-gray:#f4f3f2;--bg-2:#d9d9d9;--line:#d4d4d4;
  --text:#202020;--muted:#7d7474;--green:#0a8700;--orange:#ff5500;
  --nav:#15181b;--nav-2:#1b1e22;--nav-hover:#202328;--nav-hi:#282d33;--nav-text:#808a99;
  --btn:#e9e9ed;--btn-hover:#c4c4c4;--btn-line:#8f8f9d;
  --err-bg:#f8dce0;--ok-bg:#07c580;--warn-bg:#ee8d31;
  --info-bg:#d9edf9;--info-line:#b8cedb;
}
*{box-sizing:border-box}
html{font-size:13px}
body{margin:0;background:var(--bg);color:var(--text);font:1rem/1.45 Roboto,"Segoe UI",system-ui,-apple-system,Arial,sans-serif;letter-spacing:.3px}
a{color:var(--hl2);text-decoration:none}a:hover{text-decoration:underline}
h1{font-size:1.45rem;font-weight:500;margin:0}h2{font-size:1.1rem;font-weight:500;margin:0 0 .6rem}h3{font-size:1rem;font-weight:500;margin:1rem 0 .5rem}
code,pre{font-family:"Roboto Mono",ui-monospace,Menlo,Consolas,monospace;font-size:.88em}
code{background:var(--bg-gray);border:1px solid var(--line);padding:.05em .4em;border-radius:3px}
pre.code{background:var(--bg-gray);border:1px solid var(--line);padding:.7rem;border-radius:3px;overflow:auto;white-space:pre-wrap;word-break:break-all}
.copy{display:inline-block;padding:.3rem .6rem;word-break:break-all;user-select:all}
.muted{color:var(--muted)}.small{font-size:.86rem}.right{text-align:right}.grow{flex:1}
.err{color:var(--red)}

/* рама: шапка на всю ширину, слева тёмное меню, справа рабочая область */
.shell{display:grid;grid-template-columns:250px 1fr;grid-template-rows:40px 1fr;min-height:100vh}
.top{grid-column:1/3;grid-row:1;display:flex;align-items:center;gap:.8rem;height:40px;padding:0 20px 0 0;background:var(--bg);border-bottom:1px solid var(--bg-2);position:sticky;top:0;z-index:6}
.brand{display:flex;align-items:center;gap:.55rem;font-weight:500;color:#fff;background:var(--nav);height:40px;width:250px;padding:0 16px;flex-shrink:0;letter-spacing:.4px}
.brand:hover{text-decoration:none}
.brand.big{width:auto;height:auto;background:none;color:var(--text);font-size:1.25rem;justify-content:center;margin-bottom:1.2rem;padding:0}
.logo{display:inline-grid;place-items:center;width:1.6rem;height:1.6rem;border-radius:4px;background:linear-gradient(var(--hl),var(--hl2));color:#fff;font-size:.8rem}
.who{display:flex;align-items:center;gap:.4rem;padding-left:20px;border-left:1px solid var(--bg-2)}
.who small{color:var(--muted)}
.side{grid-column:1;grid-row:2;background:var(--nav-2);padding:.6rem 0 2rem;position:sticky;top:40px;height:calc(100vh - 40px);overflow:auto}
.sitepick{padding:.3rem .8rem .6rem}
.sitepick select{background:var(--nav-hover);color:#fff;border:1px solid #343a42}
.note{font-size:.8rem;color:var(--nav-text);margin:.2rem .9rem .6rem}
.grp{margin-top:.5rem}
.grp h4{margin:0;padding:.55rem 1rem .25rem;font-size:.72rem;font-weight:500;letter-spacing:.08em;text-transform:uppercase;color:#59626f}
.mi{display:flex;align-items:center;justify-content:space-between;padding:.5rem 1rem .5rem 1.4rem;color:var(--nav-text);border-left:3px solid transparent}
.mi:hover{background:var(--nav-hover);color:#fff;text-decoration:none}
.mi.on{background:linear-gradient(to bottom,var(--hl) 0%,var(--hl2) 100%);color:#fff;font-weight:500;border-left-color:#fff}
.mi.off{color:#4b535e;cursor:default}.mi small{font-size:.7rem;color:#59626f}
.badge{background:var(--red);color:#fff;border-radius:99px;padding:0 .5rem;font-size:.75rem}
.main{grid-column:2;grid-row:2;min-width:0;background:var(--bg)}
.page{padding:1.1rem 1.5rem 3rem;max-width:1280px}
.burger{display:none;margin-left:.8rem}

.head{display:flex;align-items:center;gap:.8rem;flex-wrap:wrap;margin:0 0 .9rem;padding-bottom:.6rem;border-bottom:2px solid var(--hl)}
.head h1,.head h2{margin:0}.head .btn,.head form{margin-left:auto}
.head h1+.btn,.head h1+.muted,.head h1+.st{margin-left:0}
.crumbs{font-size:.86rem;color:var(--muted);margin-bottom:.4rem}
/* блок с заголовком-полосой, как «секции» форм KVS */
.card{background:var(--bg);border:1px solid var(--line);border-radius:3px;padding:0 1rem 1rem;margin:0 0 1rem}
.card>h2:first-of-type,.card>.head:first-child{margin:0 -1rem .9rem;padding:.5rem 1rem;background:var(--hl);color:#fff;border:0;font-size:1rem}
.card>.head:first-child h2{color:#fff}
.card>.head:first-child .tabs .tab{border-color:#fff7;color:#fff;background:transparent}
.card>.head:first-child .tabs .tab.on{background:#fff;color:var(--hl2)}
.card.cur{border-color:var(--hl)}
.cols{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:1rem}
.cols>.card{margin:0}
.twocol{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:1rem;align-items:start}
.stack{position:sticky;top:3.4rem}
.stackbtn{display:grid;gap:.5rem;margin-top:.8rem}
.stackbtn form{margin:0}

.flash{padding:.6rem .9rem;border-radius:3px;margin:0 0 1rem;background:var(--info-bg);border:1px solid var(--info-line)}
.flash.ok{background:var(--ok-bg);border-color:var(--ok-bg);color:#fff}
.flash.err{background:var(--err-bg);border-color:#e1bdc6;color:var(--red)}

.btn{display:inline-block;padding:.42rem .9rem;border-radius:3px;border:1px solid var(--btn-line);background:var(--btn);color:var(--text);font:inherit;letter-spacing:.3px;cursor:pointer;text-align:center}
.btn:hover{background:var(--btn-hover);text-decoration:none}
.btn.pri{background:linear-gradient(var(--hl),var(--hl2));border-color:var(--hl2);color:#fff;font-weight:500}
.btn.pri:hover{filter:brightness(1.08)}
.btn.danger{border-color:var(--red);color:var(--red);background:var(--bg)}
.btn.danger:hover{background:var(--red);color:#fff}
.btn.sm{padding:.2rem .6rem;font-size:.92rem}.btn.wide{width:100%}
.ghost{background:none;border:0;color:var(--muted);cursor:pointer;font:inherit;padding:.3rem .5rem}
.ghost:hover{color:var(--hl2);text-decoration:underline}
.link{color:var(--hl2);cursor:pointer}
summary.btn{list-style:none}summary::-webkit-details-marker{display:none}
details.add{padding:.6rem 1rem;background:var(--bg-blue)}details.add[open] summary{margin-bottom:.8rem}
details.edit{margin-top:.4rem}details.edit[open]{background:var(--bg-gray);border:1px solid var(--line);border-radius:3px;padding:.6rem;margin:.4rem 0}
details.inlinedet{display:inline-block;text-align:left;margin-right:.4rem;vertical-align:top}

input,select,textarea{width:100%;background:var(--bg);color:var(--text);border:1px solid var(--btn-line);border-radius:3px;padding:.38rem .5rem;font:inherit;letter-spacing:.2px}
input:hover,select:hover,textarea:hover{border-color:#676774}
input:focus,select:focus,textarea:focus{outline:0;border-color:#0060df;box-shadow:0 0 1px 1px rgba(0,96,223,.7),0 0 1px 3px rgba(178,221,249,.7)}
input[type=checkbox],input[type=radio]{width:auto}
textarea{resize:vertical}
/* строки форм, как в KVS: слева подпись на сером поле, справа значение, между строками пунктир */
label{display:block;color:var(--text);margin:0 0 .7rem}
label[hidden]{display:none}
label>input,label>select,label>textarea{margin-top:.25rem}
.card label:not(.check):not(.sw):not(.scr):not(.rolecard):not(.link),details.add label:not(.check){display:grid;grid-template-columns:190px minmax(0,1fr);gap:.8rem;align-items:start;margin:0;padding:.5rem .6rem;border-bottom:1px dotted #aaa;background:var(--bg-gray);font-weight:500}
.card label:not(.check):not(.sw):not(.scr):not(.rolecard):not(.link)>input,.card label:not(.check):not(.sw):not(.scr):not(.rolecard):not(.link)>select,.card label:not(.check):not(.sw):not(.scr):not(.rolecard):not(.link)>textarea,details.add label:not(.check)>input,details.add label:not(.check)>select,details.add label:not(.check)>textarea{margin:0;font-weight:400;max-width:560px}
.card .formgrid,details.add .formgrid{display:block;border-top:1px dotted #aaa}
.label{color:var(--text);margin:.6rem 0 .3rem;font-weight:500}
.formgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:0 .9rem}
.checks{display:flex;flex-wrap:wrap;gap:.3rem 1.2rem;margin:.6rem 0}
.check{display:inline-flex;align-items:center;gap:.4rem;margin:0}
.actions{display:flex;gap:.8rem;align-items:center;margin-top:.8rem;padding-top:.7rem;border-top:1px solid var(--line)}
form.inline{display:inline-flex;gap:.4rem;align-items:center;margin:0}
form.inline input,form.inline select{width:auto}
.bar{display:flex;gap:.5rem;align-items:center;margin:.5rem 0 .9rem;flex-wrap:wrap;padding:.5rem;background:var(--bg-blue);border:1px solid var(--line);border-radius:3px}
.bar input[type=search]{max-width:340px}
.bulkbar{display:flex;gap:.6rem;align-items:center;margin:0 0 .6rem;flex-wrap:wrap}
.bulkbar select{width:auto;min-width:260px}
.row-actions{display:flex;gap:.8rem;flex-wrap:wrap;margin-top:.6rem}
.hints{display:flex;flex-wrap:wrap;gap:.3rem;align-items:center;margin:.3rem 0 .4rem}
.chip{border:1px solid var(--btn-line);background:var(--btn);color:var(--text);border-radius:3px;padding:.05rem .55rem;font:inherit;font-size:.9rem;cursor:pointer}
.chip:hover{background:var(--hl);border-color:var(--hl);color:#fff}

.tabs{display:flex;gap:.25rem;flex-wrap:wrap;margin:0 0 .8rem}
.tab{padding:.3rem .8rem;border:1px solid var(--btn-line);border-radius:3px;color:var(--text);background:var(--btn)}
.tab:hover{text-decoration:none;background:var(--btn-hover)}
.tab.on{background:linear-gradient(var(--hl),var(--hl2));border-color:var(--hl2);color:#fff;font-weight:500}
.tab b{margin-left:.4rem;font-weight:500;opacity:.8}

/* таблицы данных (data-grid KVS): синяя шапка, пунктир между колонками, зебра, серый подвал */
table.grid{width:100%;border-collapse:collapse;background:var(--bg)}
.grid th{font-weight:500;text-align:left;padding:.5rem .7rem;background:var(--hl);color:#fff;border-left:1px dotted rgba(255,255,255,.55)}
.grid th:first-child{border-left:0}
.grid td{padding:.5rem .7rem;border-top:1px solid var(--line);border-left:1px dotted #bbb;vertical-align:top}
.grid td:first-child{border-left:0}
.grid tbody tr:nth-child(even){background:var(--bg-gray)}
.grid tbody tr:hover{background:#e4efff}
.grid .chk{width:34px}.grid .th{width:108px}
.grid img{display:block;border-radius:2px;object-fit:cover;background:var(--bg-2)}
.avatar{display:inline-block!important;vertical-align:middle;border-radius:50%!important}
.noimg{display:grid;place-items:center;width:96px;height:54px;border-radius:2px;background:var(--bg-2);color:#999}
.title{color:var(--text);font-weight:500;text-decoration:underline}.title:hover{color:var(--hl2)}
.sub{font-size:.85rem;color:var(--muted);margin-top:.1rem}

.st{display:inline-block;padding:.02rem .5rem;border-radius:3px;font-size:.85rem;border:1px solid var(--line);color:var(--muted);background:var(--bg);white-space:nowrap}
.st-live{color:var(--green);border-color:var(--green)}.st-error{color:var(--red);border-color:var(--red)}
.st-queued,.st-processing{color:var(--orange);border-color:var(--orange)}.st-removed{color:var(--muted)}

.pager{display:flex;gap:.25rem;flex-wrap:wrap;margin:1rem 0}
.pg{padding:.25rem .65rem;border:1px solid var(--btn-line);border-radius:3px;color:var(--text);background:var(--btn)}
.pg:hover{background:var(--btn-hover);text-decoration:none}
.pg.on{background:var(--hl);border-color:var(--hl2);color:#fff}.gap{padding:.25rem .3rem;color:var(--muted)}

.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:.8rem;margin:0 0 1rem}
.stat{display:block;background:var(--info-bg);border:1px solid var(--info-line);border-radius:3px;padding:.7rem 1rem;color:var(--text)}
a.stat:hover{border-color:var(--hl);text-decoration:none;background:#cfe6f6}
.stat b{display:block;font-size:1.65rem;line-height:1.2;font-weight:500;color:var(--hl2)}.stat span{color:var(--text);font-size:.92rem}
.stat.warn b{color:var(--orange)}.stat.bad{background:var(--err-bg);border-color:#e1bdc6}.stat.bad b{color:var(--red)}
.mini{list-style:none;margin:0;padding:0}.mini li{display:flex;justify-content:space-between;gap:.6rem;padding:.4rem 0;border-top:1px dotted #aaa}.mini li:first-child{border-top:0}
.bars{display:flex;align-items:flex-end;gap:3px;height:90px;border-bottom:1px solid var(--line)}
.bars.tall{height:160px}
.bars i{flex:1;min-height:2px;background:linear-gradient(var(--hl),var(--hl2));border-radius:2px 2px 0 0}
.bars.alt i{background:var(--orange)}
.axis{display:flex;justify-content:space-between;color:var(--muted);font-size:.8rem;margin-top:.2rem}
.hello{border-color:var(--hl)}
.empty{text-align:center;padding:2rem 1rem;color:var(--muted);background:var(--bg-gray);border:1px dashed var(--btn-line);border-radius:3px;margin:.6rem 0}
.empty.big h1{color:var(--text);margin-bottom:.5rem}

.kv{display:grid;grid-template-columns:auto 1fr;gap:.35rem .9rem;margin:0}.kv dt{color:var(--muted)}.kv dd{margin:0;text-align:right;font-weight:500}

.player{background:#000;border-radius:3px;overflow:hidden;margin:0 0 1rem;max-height:520px;display:flex;justify-content:center}
.player video{width:100%;max-height:520px;background:#000}.player.short video{width:auto;max-width:100%}
.screens{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:.5rem}
.scr{margin:0;position:relative;cursor:pointer}.scr img{width:150px;height:auto;aspect-ratio:16/9;object-fit:cover;border-radius:3px;border:2px solid transparent}
.scr input{position:absolute;top:.3rem;left:.3rem}.scr input:checked+img{border-color:var(--hl)}

.dropzone{border:2px dashed var(--btn-line);border-radius:3px;padding:2rem 1rem;text-align:center;margin:1rem 0;background:var(--bg-blue);transition:.15s}
.dropzone.over{border-color:var(--hl);background:var(--info-bg)}
.uplist{list-style:none;margin:1rem 0 0;padding:0;display:grid;gap:.5rem}
.uplist li{background:var(--bg-gray);border:1px solid var(--line);border-radius:3px;padding:.5rem .7rem}
.uplist .name{display:flex;justify-content:space-between;gap:.6rem}
.prog{height:6px;background:var(--bg-2);border-radius:99px;overflow:hidden;margin-top:.4rem}.prog i{display:block;height:100%;width:100%;background:var(--hl);transform:scaleX(0);transform-origin:left;transition:transform .2s}
.uplist .done .prog i{background:var(--ok-bg)}.uplist .fail .prog i{background:var(--red)}

.presets{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:.7rem}
.preset{display:flex;flex-direction:column;gap:.2rem;text-align:left;background:var(--bg-gray);border:2px solid var(--line);border-radius:3px;padding:.8rem;color:var(--text);font:inherit;cursor:pointer}
.preset:hover,.preset.on{border-color:var(--hl)}.preset i{display:block;width:100%;height:10px;border-radius:99px}.preset span{font-size:.85rem;color:var(--muted)}
.swatches{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:.6rem}
.sw{margin:0;cursor:pointer}.sw input{position:absolute;opacity:0}.sw i{display:block;width:34px;height:34px;border-radius:50%;border:3px solid transparent;box-shadow:0 0 0 1px var(--btn-line)}
.sw input:checked+i{border-color:var(--text)}.sw input:focus-visible+i{outline:2px solid var(--hl);outline-offset:2px}
.rolecards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:.8rem;margin:.8rem 0 1rem}
.rolecard{display:flex;flex-direction:column;gap:.3rem;background:var(--bg-gray);border:2px solid var(--line);border-radius:3px;padding:1rem;cursor:pointer;color:var(--text);margin:0}
.rolecard:has(input:checked){border-color:var(--hl);background:var(--info-bg)}.rolecard input{margin-bottom:.2rem}.rolecard .ico{font-size:1.6rem}
.logoprev{max-height:72px;max-width:260px;background:var(--bg-gray);padding:.4rem;border-radius:3px;border:1px solid var(--line)}.logorow{margin-bottom:.8rem}

/* вход — по центру на тёмном фоне, как у KVS */
.loginbody{display:grid;place-items:center;min-height:100vh;padding:1rem;background:var(--nav)}
.loginbox{width:100%;max-width:380px;background:var(--bg);border-radius:4px;padding:1.6rem;box-shadow:0 8px 30px rgba(0,0,0,.4)}
.loginbox h1{margin-bottom:.6rem}
.loginbox label{display:block;margin:0 0 .8rem;padding:0;background:none;border:0;font-weight:500}
.loginbox label>input{margin-top:.3rem;font-weight:400}

@media (max-width:900px){
  .shell{grid-template-columns:1fr}
  .top{grid-column:1}.main{grid-column:1}
  .brand{width:auto}
  .side{position:fixed;inset:40px auto 0 0;width:260px;z-index:20;transform:translateX(-105%);transition:transform .2s;height:auto}
  .side.open{transform:none;box-shadow:0 0 0 100vmax rgba(0,0,0,.5)}
  .burger{display:inline-block;background:none;border:1px solid var(--btn-line);color:var(--text);border-radius:3px;padding:.15rem .6rem;font-size:1.1rem}
  .twocol{grid-template-columns:1fr}.stack{position:static}
  .page{padding:1rem .9rem 3rem}
  .grid .th{display:none}
  .card label:not(.check):not(.sw):not(.scr):not(.rolecard):not(.link),details.add label:not(.check){grid-template-columns:1fr;gap:.2rem}
}

/* админка платформы: занятость машин, подзаголовки форм */
.hbar{margin:0 0 .9rem}.hrow{display:flex;gap:.6rem;align-items:baseline;flex-wrap:wrap}
.meter{height:10px;background:var(--bg-2);border-radius:99px;overflow:hidden;margin:.3rem 0 .15rem}
.meter i{display:block;height:100%;background:linear-gradient(var(--hl),var(--hl2));transform-origin:left}
.meter i.hot{background:var(--red)}
.subh{margin:1.2rem -1rem .6rem;padding:.4rem 1rem;background:var(--bg-blue);border-top:1px solid var(--line);border-bottom:1px solid var(--line);color:var(--text);font-size:1rem}
.actions-cell form{margin-left:.2rem}
.lic .kv{max-width:620px}
