/* Tumor Facility Management Group — админ-панель v3: дружелюбный, яркий, с узбекским орнаментом */
:root{
  --navy:#0E2A47;--navy2:#173B63;--turq:#1E9E98;--turq-d:#157f7a;--gold:#C9A24B;--sand:#F6F2EA;
  --bg:#F3F5FA;--card:#fff;--ink:#1B2433;--mute:#6F7B8D;--line:#E6E9F0;
  --ok:#12945a;--bad:#e2483d;--warn:#e89b1c;--violet:#7a5af8;--blue:#2f7cf6;
  --r:20px;--shadow:0 1px 2px rgba(20,35,60,.04),0 8px 24px rgba(20,35,60,.06);
  --serif:Georgia,"Times New Roman",serif
}
*{box-sizing:border-box}
body{margin:0;font:14px/1.5 "Segoe UI",system-ui,-apple-system,Roboto,sans-serif;background:var(--bg);color:var(--ink)}
a{color:var(--turq-d);text-decoration:none}a:hover{text-decoration:underline}
.layout{display:flex;min-height:100vh}

/* ---------- боковая панель ---------- */
.side{width:248px;background:linear-gradient(180deg,#0E2A47 0%,#12345a 100%);color:#cdd8e6;padding:0 14px 18px;position:sticky;top:0;height:100vh;flex:none;overflow-y:auto}
.side .brand{margin:0 -14px 10px;padding:22px 18px 16px;position:relative;overflow:hidden}
.side .brand::before{content:"";position:absolute;inset:0;background:url(pattern-gold.svg) 0 0/56px;opacity:.55}
.side .brand::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(14,42,71,.1),#0E2A47 95%)}
.side .brand>*{position:relative;z-index:1}
.side .logo{display:flex;gap:10px;align-items:center;font-weight:800;color:#fff;font-size:14px;line-height:1.25}
.side .logo img{width:38px;height:38px;flex:none}
.side .who{display:inline-block;font-size:12px;color:#d9e4f2;margin-top:10px;background:rgba(255,255,255,.1);padding:3px 10px;border-radius:20px}
.side .group{font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:#7f93ae;margin:18px 10px 6px;font-weight:700}
.side a{display:flex;align-items:center;gap:10px;color:#cdd8e6;padding:8px 12px;border-radius:12px;margin-bottom:2px;transition:background .15s}
.side a .ic{width:22px;display:grid;place-items:center;flex:none;opacity:.85}.side a.on .ic{opacity:1}
.side a:hover{background:rgba(255,255,255,.08);text-decoration:none}
.side a.on{background:linear-gradient(135deg,var(--turq),#17b3ab);color:#fff;font-weight:600;box-shadow:0 6px 16px rgba(30,158,152,.35)}
.side .lang{margin:20px 10px 0;font-size:12px;display:flex;gap:6px}
.side .lang a{display:inline-block;padding:3px 10px;border-radius:20px;background:rgba(255,255,255,.07);color:#a9b9cf;margin:0}
.side .lang a.on{background:var(--gold);color:#2a1d02;box-shadow:none}
.side .foot a{padding:5px 12px;font-size:13px;color:#93a6bf}

main{flex:1;padding:28px 34px 40px;max-width:1320px;min-width:0}
h1{font:800 26px/1.2 "Segoe UI",system-ui,sans-serif;margin:0 0 20px;letter-spacing:-.01em}
h1::after{content:"";display:block;width:84px;height:14px;margin-top:8px;background:url(band.svg) 0 0/28px 14px repeat-x}
h2{font:700 17px "Segoe UI",system-ui,sans-serif;margin:24px 0 10px}
h3{margin:0}

/* ---------- карточки ---------- */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:20px;margin-bottom:16px;box-shadow:var(--shadow)}
.card>h2:first-child,.card .hd{margin-top:0}
.grid{display:grid;gap:16px}.g2{grid-template-columns:1fr 1fr}.g21{grid-template-columns:2fr 1fr}.g3{grid-template-columns:repeat(3,1fr)}.g5{grid-template-columns:repeat(auto-fit,minmax(190px,1fr))}
.grid>.card{margin-bottom:0}
.hd{display:flex;align-items:center;gap:8px;margin-bottom:14px}
.hd h2{margin:0;font-size:16px}.hd a{margin-left:auto;font-size:13px}

/* ---------- дашборд ---------- */
.hero{position:relative;overflow:hidden;border-radius:26px;padding:28px 32px;color:#fff;margin-bottom:18px;
  background:linear-gradient(120deg,#0E2A47 0%,#14507a 55%,#1E9E98 100%);box-shadow:0 14px 34px rgba(14,42,71,.25);display:flex;gap:24px;align-items:center;flex-wrap:wrap}
.hero::before{content:"";position:absolute;inset:0;background:url(pattern-gold.svg) 0 0/72px;opacity:.5}
.hero::after{content:"";position:absolute;right:-60px;top:-60px;width:260px;height:260px;border-radius:50%;background:radial-gradient(circle,rgba(201,162,75,.45),transparent 70%)}
.hero>*{position:relative;z-index:1}
.hero h1{color:#fff;margin:0;font-size:28px}.hero h1::after{display:none}
.hero .sub{opacity:.88;margin-top:4px;font-size:15px}
.hero .date{font-size:12px;letter-spacing:.08em;text-transform:uppercase;opacity:.7;margin-bottom:6px}
.hero .qa{margin-left:auto;display:flex;gap:10px;flex-wrap:wrap}
.hero .qa a{background:rgba(255,255,255,.16);color:#fff;border:1px solid rgba(255,255,255,.28);padding:9px 16px;border-radius:30px;font-weight:600;backdrop-filter:blur(4px);transition:all .15s}
.hero .qa a:hover{background:#fff;color:var(--navy);text-decoration:none;transform:translateY(-1px)}
.hero .qa a.gold{background:var(--gold);border-color:var(--gold);color:#2a1d02}

.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px;margin-bottom:16px}
.kpis.c4{grid-template-columns:repeat(4,1fr)}.kpis.c3{grid-template-columns:repeat(3,1fr)}
.kpi{position:relative;overflow:hidden;padding:18px 18px 16px}
.kpi .top{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.kpi .ico{width:40px;height:40px;border-radius:14px;display:grid;place-items:center;font-size:20px;flex:none}
.kpi .l{color:var(--mute);font-size:13px;font-weight:600}
.kpi .v{font-size:26px;font-weight:800;letter-spacing:-.02em;line-height:1.1}
.kpi .s{color:var(--mute);font-size:12px;margin-top:6px}
.kpi.t-ok .ico{background:#e2f6ec}.kpi.t-ok .v{color:var(--ok)}
.kpi.t-bad .ico{background:#fde8e6}.kpi.t-bad .v{color:var(--bad)}
.kpi.t-blue .ico{background:#e6efff}
.kpi.t-gold .ico{background:#fbf0d2}
.kpi.t-violet .ico{background:#eee9ff}
.kpi.t-turq .ico{background:#dcf4f2}
.kpi::after{content:"";position:absolute;right:-22px;bottom:-22px;width:90px;height:90px;background:url(pattern-navy.svg) 0 0/44px;opacity:.06}

.progress{height:8px;background:#edf0f6;border-radius:8px;overflow:hidden;margin-top:10px}
.progress i{display:block;height:100%;border-radius:8px;background:linear-gradient(90deg,var(--turq),#4fd1c5)}
.progress.bad i{background:linear-gradient(90deg,#f08a82,var(--bad))}
.progress.gold i{background:linear-gradient(90deg,#e8cf8b,var(--gold))}

.chart{display:flex;align-items:flex-end;gap:10px;height:210px;padding:6px 0 0}
.chart .col{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;background:none;border-radius:0;padding:0;min-height:0}
.chart .pair{display:flex;gap:5px;align-items:flex-end;height:calc(100% - 22px);width:100%;justify-content:center}
.chart .pair span{flex:0 1 26px;border-radius:9px 9px 3px 3px;min-height:3px;transition:filter .15s;position:relative}
.chart .pair span:hover{filter:brightness(1.08)}
.chart .m{font-size:11px;color:var(--mute);margin-top:6px;height:16px}
.c1{background:linear-gradient(180deg,#f0dca4,#d8b45e)}.c2{background:linear-gradient(180deg,#4fd1c5,var(--turq))}
.legend{font-size:12px;color:var(--mute);margin-left:auto}.legend i{display:inline-block;width:10px;height:10px;border-radius:4px;margin:0 5px 0 12px;vertical-align:middle}

.donut{--p:0;--c:var(--turq);width:128px;height:128px;border-radius:50%;margin:0 auto;display:grid;place-items:center;
  background:conic-gradient(var(--c) calc(var(--p)*1%),#edf0f6 0)}
.donut::before{content:"";grid-area:1/1;width:98px;height:98px;border-radius:50%;background:#fff}
.donut b{grid-area:1/1;font-size:24px;font-weight:800;z-index:1}
.donut-wrap{text-align:center}.donut-wrap .cap{margin-top:10px;color:var(--mute);font-size:12px}

.list{list-style:none;margin:0;padding:0}
.list li{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px dashed var(--line)}
.list li:last-child{border-bottom:0}
.list .av{width:36px;height:36px;border-radius:12px;display:grid;place-items:center;font-weight:800;flex:none;background:#e6efff;color:var(--blue)}
.list .av.r{background:#fde8e6;color:var(--bad)}.list .av.g{background:#e2f6ec;color:var(--ok)}.list .av.y{background:#fbf0d2;color:#9a7412}
.list .t{flex:1;min-width:0}.list .t b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.list .t small{color:var(--mute)}
.list .amt{font-weight:700;white-space:nowrap}
.empty{color:var(--mute);text-align:center;padding:20px 0;font-size:13px}
.empty.good{color:var(--ok);font-weight:600}

.bar-row{margin:12px 0}.bar-row .top{display:flex;justify-content:space-between;font-size:13px;margin-bottom:5px}
.stages{display:flex;flex-wrap:wrap;gap:8px}
.stage{flex:1 1 90px;border-radius:14px;padding:10px 12px;background:#f3f5fa}
.stage b{font-size:22px;display:block;line-height:1.1}.stage span{font-size:12px;color:var(--mute)}
.stage.s-new{background:#e6efff}.stage.s-contacted{background:#eee9ff}.stage.s-viewing{background:#fbf0d2}.stage.s-negotiation{background:#dcf4f2}.stage.s-won{background:#e2f6ec}.stage.s-lost{background:#f1f1f1}
.alert{display:flex;gap:10px;align-items:center;border-radius:16px;padding:12px 16px;margin-bottom:16px;background:#fff6e0;color:#7a5a10;border:1px solid #f3dfa6}
.alert a{margin-left:auto;font-weight:600}
.mini{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.mini div{background:#f3f5fa;border-radius:14px;padding:12px;text-align:center}.mini b{display:block;font-size:20px}.mini span{font-size:11px;color:var(--mute)}

/* ---------- таблицы и формы ---------- */
table{width:100%;border-collapse:separate;border-spacing:0;background:var(--card);border:1px solid var(--line);border-radius:16px;overflow:hidden;box-shadow:var(--shadow)}
th,td{padding:11px 14px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
th{font-size:11px;color:var(--mute);font-weight:700;text-transform:uppercase;letter-spacing:.06em;background:#F8F9FC}
tr:last-child td{border-bottom:0}
tbody tr:hover td,table tr:hover td{background:#fafbfe}
td.n,th.n{text-align:right;white-space:nowrap}

.btn,button{background:var(--navy);color:#fff;border:0;border-radius:12px;padding:9px 16px;font:inherit;font-weight:600;cursor:pointer;display:inline-block;transition:all .15s}
.btn:hover,button:hover{background:var(--turq);text-decoration:none;transform:translateY(-1px);box-shadow:0 6px 14px rgba(30,158,152,.3)}
.btn.sec,button.sec{background:#e9edf5;color:var(--ink)}.btn.sec:hover,button.sec:hover{background:#dce2ee;box-shadow:none}
.btn.gold{background:var(--gold);color:#241a05}.btn.gold:hover{background:#d8b45e}
button.danger{background:#fff;color:var(--bad);border:1px solid #f1c3be;padding:4px 11px;font-weight:500}
button.danger:hover{background:#fdecea;box-shadow:none}
form.inline{display:inline}
label{display:block;font-size:12px;color:var(--mute);margin:10px 0 4px;font-weight:600}
input,select,textarea{width:100%;padding:9px 12px;border:1px solid #d9deea;border-radius:12px;font:inherit;background:#fff}
input:focus,select:focus,textarea:focus{outline:3px solid rgba(30,158,152,.2);border-color:var(--turq)}
textarea{min-height:70px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 16px}.form-grid .full{grid-column:1/-1}
.flash{padding:11px 16px;border-radius:14px;margin-bottom:14px}.flash.error{background:#fdecea;color:#8a2a20}.flash.ok{background:#e6f5ec;color:#14683a}
.warn{background:#fff6e0;color:#7a5a10;padding:10px 14px;border-radius:14px;margin-bottom:14px;font-size:13px;border:1px solid #f3dfa6}
.badge{display:inline-block;padding:2px 10px;border-radius:20px;font-size:12px;background:#e9edf5;font-weight:600}
.badge.ok{background:#e2f6ec;color:var(--ok)}.badge.bad{background:#fde8e6;color:var(--bad)}
.muted{color:var(--mute)}.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.right{margin-left:auto}

.kanban{display:grid;grid-template-columns:repeat(6,minmax(180px,1fr));gap:12px;overflow-x:auto}
.kanban .col{background:#e9edf5;border-radius:18px;padding:10px;min-height:120px}.kanban .col h3{font-size:12px;margin:3px 5px 10px;text-transform:uppercase;color:var(--mute);letter-spacing:.06em}
.lead{background:#fff;border:1px solid var(--line);border-radius:14px;padding:10px;margin-bottom:8px;font-size:13px;box-shadow:0 1px 2px rgba(20,35,60,.05)}
.lead select{padding:3px;font-size:12px;margin-top:6px}

/* ---------- вход и публичные формы ---------- */
body.auth{background:var(--navy) url(pattern-gold.svg) 0 0/80px;min-height:100vh}
body.auth::before{content:"";position:fixed;inset:0;background:radial-gradient(circle at 50% 30%,rgba(14,42,71,.2),var(--navy) 80%)}
.login,.public{position:relative;max-width:380px;margin:12vh auto;border-radius:24px;border:1px solid var(--gold)}
.public{max-width:520px;margin:6vh auto}
.login h1{font-size:21px}

/* ---------- HR: табель ---------- */
.ts{overflow-x:auto}.ts table{font-size:12px;width:auto}.ts th,.ts td{padding:3px 2px;text-align:center}
.ts td.name{text-align:left;white-space:nowrap;padding:3px 10px;position:sticky;left:0;background:#fff}
.ts select{width:42px;padding:2px 0;font-size:12px;text-align:center;border-radius:6px}
.ts th.we,.ts td.we{background:#fbf3df}
.code-D{background:#e4f4f2}.code-N{background:#dfe6f3}.code-O{background:#f1ecdf}.code-V{background:#fbf0d2}.code-S{background:#fbe3df}.code-U{background:#eee}.code-A{background:#f7c7c1}

@media(max-width:1100px){.g3,.kpis.c4,.kpis.c3{grid-template-columns:1fr 1fr}}
@media(max-width:560px){.kpis.c4,.kpis.c3{grid-template-columns:1fr}}

/* ---------- иконки ---------- */
.svg{flex:none;vertical-align:-3px}
.hero .qa a{display:inline-flex;align-items:center;gap:8px}
.kpi .ico svg{width:20px;height:20px}
.kpi.t-ok .ico{color:var(--ok)}.kpi.t-bad .ico{color:var(--bad)}.kpi.t-blue .ico{color:var(--blue)}.kpi.t-gold .ico{color:#a37b13}.kpi.t-violet .ico{color:var(--violet)}.kpi.t-turq .ico{color:var(--turq-d)}
.hd h2 svg{color:var(--turq-d);margin-right:2px}
.alert svg{flex:none;color:#b7791f}
.warn svg{vertical-align:-3px}
.theme-sw{display:flex;margin:14px 10px 0;background:rgba(255,255,255,.07);border-radius:10px;padding:3px;gap:3px}
.theme-sw a{flex:1;justify-content:center;text-align:center;padding:5px 6px!important;margin:0!important;font-size:12px;border-radius:8px!important;color:#a9b9cf}
.theme-sw a.on{background:rgba(255,255,255,.18)!important;color:#fff!important;box-shadow:none!important;font-weight:600}

/* =====================================================================
   ДЕЛОВАЯ ТЕМА (body.theme-business): строгая, плотная, без декора
   ===================================================================== */
body.theme-business{--bg:#F3F4F6;--ink:#1F2937;--mute:#667085;--line:#DDE1E7;--navy:#1F3556;--navy2:#2a4670;--turq:#1F4E8C;--turq-d:#1F4E8C;--gold:#B7791F;
  --r:8px;--shadow:none;--ok:#15803d;--bad:#b42318;--blue:#1F4E8C;--violet:#475467;--warn:#b7791f;
  font-size:13.5px;font-family:"Segoe UI",Arial,sans-serif}
.theme-business h1{font-size:22px;font-weight:700;letter-spacing:0;padding-bottom:12px;border-bottom:1px solid var(--line);margin-bottom:18px}
.theme-business h1::after{display:none}
.theme-business h2{font-size:15px}
.theme-business main{padding:24px 32px 40px}
.theme-business a{color:#1F4E8C}

/* меню */
.theme-business .side{background:#16243B;width:232px}
.theme-business .side .brand::before,.theme-business .side .brand::after{display:none}
.theme-business .side .brand{padding:20px 16px 14px;border-bottom:1px solid rgba(255,255,255,.08);margin-bottom:8px}
.theme-business .side .logo{font-weight:700;font-size:13.5px}
.theme-business .side .who{background:none;padding:0;color:#8fa3c0;border-radius:0}
.theme-business .side a{border-radius:6px;padding:7px 10px;color:#c3cfe0;border-left:3px solid transparent}
.theme-business .side a.on{background:rgba(255,255,255,.08);box-shadow:none;border-left-color:#5b9bd5;font-weight:600}
.theme-business .side a:hover{background:rgba(255,255,255,.06)}
.theme-business .side .group{color:#6f84a3;font-size:10.5px;margin-top:16px}
.theme-business .side .lang a{border-radius:4px}
.theme-business .side .lang a.on{background:#5b9bd5;color:#fff}
.theme-business .theme-sw{border-radius:6px}.theme-business .theme-sw a{border-radius:4px!important}

/* карточки и таблицы */
.theme-business .card{box-shadow:none;border-radius:8px;padding:18px}
.theme-business table{box-shadow:none;border-radius:8px}
.theme-business th{background:#F5F6F8;font-size:10.5px}
.theme-business th,.theme-business td{padding:9px 12px}
.theme-business tbody tr:nth-child(even) td,.theme-business table tr:nth-child(even) td{background:#FAFBFC}
.theme-business table tr:hover td{background:#F1F5FA}
.theme-business .btn,.theme-business button{border-radius:6px;font-weight:600;background:var(--navy);transition:none}
.theme-business .btn:hover,.theme-business button:hover{transform:none;box-shadow:none;background:#2a4670}
.theme-business .btn.sec,.theme-business button.sec{background:#fff;border:1px solid #cfd5de;color:var(--ink)}
.theme-business .btn.sec:hover,.theme-business button.sec:hover{background:#F3F4F6}
.theme-business input,.theme-business select,.theme-business textarea{border-radius:6px;border-color:#cfd5de}
.theme-business input:focus,.theme-business select:focus,.theme-business textarea:focus{outline:2px solid rgba(31,78,140,.2);border-color:#1F4E8C}
.theme-business .badge{border-radius:4px;font-weight:600}
.theme-business .flash,.theme-business .warn,.theme-business .alert{border-radius:6px}
.theme-business .kanban .col{border-radius:8px;background:#E9ECF1}.theme-business .lead{border-radius:6px;box-shadow:none}

/* верхний блок дашборда — плоская шапка без градиента */
.theme-business .hero{background:#fff;color:var(--ink);border:1px solid var(--line);border-left:4px solid #1F4E8C;border-radius:8px;box-shadow:none;padding:18px 22px}
.theme-business .hero::before,.theme-business .hero::after{display:none}
.theme-business .hero h1{color:var(--ink);font-size:20px;border:0;padding:0;margin:0}
.theme-business .hero .date{color:var(--mute);opacity:1}
.theme-business .hero .sub{opacity:1;color:var(--mute);font-size:13.5px}
.theme-business .hero .qa a{background:#fff;color:var(--ink);border:1px solid #cfd5de;border-radius:6px;backdrop-filter:none;padding:7px 13px;font-weight:600}
.theme-business .hero .qa a:hover{background:#F3F4F6;color:var(--ink);transform:none}
.theme-business .hero .qa a.gold{background:var(--navy);border-color:var(--navy);color:#fff}
.theme-business .hero .qa a.gold:hover{background:#2a4670}

/* показатели: единая полоса с разделителями */
.theme-business .kpis{gap:0;background:#fff;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.theme-business .kpi.card{border:0;border-right:1px solid var(--line);border-bottom:1px solid var(--line);border-radius:0;padding:16px 18px;margin:0;background:#fff}
.theme-business .kpi::after{display:none}
.theme-business .kpi .ico{width:auto;height:auto;background:none!important;border-radius:0;display:block}
.theme-business .kpi .top{margin-bottom:8px;gap:8px}
.theme-business .kpi .l{font-size:12px;text-transform:uppercase;letter-spacing:.04em;font-weight:600}
.theme-business .kpi .v{font-size:23px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--ink)}
.theme-business .kpi.t-ok .v{color:var(--ok)}.theme-business .kpi.t-bad .v{color:var(--bad)}
.theme-business .kpi .ico svg{width:16px;height:16px}
.theme-business .progress{height:5px;border-radius:3px}.theme-business .progress i{border-radius:3px;background:#1F4E8C}
.theme-business .progress.bad i{background:var(--bad)}.theme-business .progress.gold i{background:#6b8fbd}
.theme-business .kpi.t-ok .progress i{background:var(--ok)}

/* графики */
.theme-business .c1{background:#b8c5d6}.theme-business .c2{background:#1F4E8C}
.theme-business .chart .pair span{border-radius:3px 3px 0 0;flex:0 1 22px}
.theme-business .donut::before{width:104px;height:104px}
.theme-business .donut b{font-size:22px}
.theme-business .list li{border-bottom:1px solid #eef0f4}
.theme-business .list .av{border-radius:6px;width:32px;height:32px;font-size:13px;background:#eaf0f8;color:#1F4E8C}
.theme-business .list .av.r{background:#fbeceb;color:var(--bad)}.theme-business .list .av.g{background:#e7f4ec;color:var(--ok)}.theme-business .list .av.y{background:#fbf1dc;color:#8a5a0b}
.theme-business .mini div,.theme-business .stage{border-radius:6px}
.theme-business .stage.s-new,.theme-business .stage.s-contacted,.theme-business .stage.s-viewing,.theme-business .stage.s-negotiation,.theme-business .stage.s-won,.theme-business .stage.s-lost{background:#F3F4F6;border-left:3px solid #1F4E8C}
.theme-business .stage.s-won{border-left-color:var(--ok)}.theme-business .stage.s-lost{border-left-color:#98a2b3}
.theme-business .hd h2 svg{color:#667085}
.theme-business body.auth,body.theme-business.auth{background:#16243B}
.theme-business button.danger{background:#fff;color:var(--bad);border:1px solid #f1c3be}
.theme-business button.danger:hover{background:#fdecea}

/* карта помещений и новые блоки */
.map-free{border-left:5px solid var(--ok)}.map-busy{border-left:5px solid var(--navy)}.map-ending{border-left:5px solid var(--bad)}
.theme-business .map-free,.theme-business .map-busy,.theme-business .map-ending{border-left-width:4px}
.tabs-sub a{margin-right:6px}
body.cab{background:var(--bg,#F3F5FA);min-height:100vh}
.cabwrap{max-width:900px;margin:0 auto;padding:20px 16px 60px}

/* ---------- телефон / планшет ---------- */
.topbar,.scrim{display:none}
@media(max-width:900px){
  html{-webkit-text-size-adjust:100%}
  .topbar{display:flex;align-items:center;gap:10px;position:sticky;top:0;z-index:30;background:var(--navy);color:#fff;
    padding:8px 12px;padding-top:calc(8px + env(safe-area-inset-top));box-shadow:0 2px 10px rgba(0,0,0,.2)}
  .topbar .tt{font-weight:800;font-size:14px;line-height:1.2;flex:1}
  .topbar .burger{background:rgba(255,255,255,.12);padding:8px;border-radius:12px;display:grid;place-items:center;min-width:44px;min-height:44px;color:#fff}
  .topbar .burger:hover{transform:none;box-shadow:none;background:rgba(255,255,255,.2)}
  .layout{display:block}
  .side{position:fixed;top:0;left:0;bottom:0;height:auto;width:min(84vw,310px);z-index:50;transform:translateX(-102%);transition:transform .22s ease;
    padding-top:env(safe-area-inset-top);padding-bottom:calc(18px + env(safe-area-inset-bottom));box-shadow:none}
  .menu-open .side{transform:none;box-shadow:8px 0 32px rgba(0,0,0,.35)}
  .scrim{display:block;position:fixed;inset:0;background:rgba(10,20,35,.5);z-index:40;opacity:0;pointer-events:none;transition:opacity .2s}
  .menu-open .scrim{opacity:1;pointer-events:auto}
  .menu-open{overflow:hidden}
  .side a{padding:12px 12px}                       /* крупные цели для пальца */
  main{padding:14px 14px calc(28px + env(safe-area-inset-bottom));max-width:none}
  h1{font-size:22px;margin-bottom:14px}
  .g2,.g3,.form-grid,.grid{grid-template-columns:1fr}
  .grid>*,.kpis>*,.card{min-width:0;max-width:100%}
  .card svg,.card canvas,.card img{max-width:100%;height:auto}
  body{overflow-x:hidden}
  .g5{grid-template-columns:1fr 1fr}
  .card{padding:14px;border-radius:14px}
  .hero{padding:20px 18px;border-radius:20px}.hero h1{font-size:22px}.hero .qa{margin-left:0;width:100%}
  .hero .qa a{flex:1 1 auto;text-align:center}
  /* таблицы прокручиваются вбок, а не ломают страницу */
  table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch;white-space:nowrap;max-width:100%}
  td,th{padding:10px 12px}
  /* iOS не приближает страницу при вводе, если шрифт >= 16px */
  input,select,textarea{font-size:16px;min-height:44px}
  textarea{min-height:90px}
  .btn,button{min-height:44px;padding:10px 16px}
  button.danger{min-height:36px}
  form .row,.row{flex-wrap:wrap}
  .hd{flex-wrap:wrap}
  .kpis.c4,.kpis.c3{grid-template-columns:1fr 1fr}
}
@media(max-width:480px){
  .kpis.c4,.kpis.c3,.g5{grid-template-columns:1fr}
  .kpi .v,.kpi b{font-size:22px}
}
@media(display-mode:standalone){body{overscroll-behavior-y:none}}
