/* Автосервис PRO — дашборд руководителя. Макет 17.11.2026: десктоп с левым меню, телефон ≤ 760px. */
:root {
  --bg: #f4f6fa; --card: #fff; --text: #111827; --muted: #6b7280; --line: #e6eaf1; --soft: #eef2f8;
  --blue: #2f6fed; --blue-2: #5b8ff5; --blue-soft: #e8effd; --green: #3bbf5a;
  --up: #15803d; --up-bg: #e5f6ea; --down: #dc2626; --down-bg: #fde8e8;
  --yel: #a16207; --yel-bg: #fef3c7; --red-row: #fff1f1; --yel-row: #fffbea;
  --radius: 12px; --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.4 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-variant-numeric: tabular-nums; }
a { color: var(--blue); text-decoration: none; }
h1, h2 { margin: 0; }
.ic { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.down { color: var(--down); }
.nowrap { white-space: nowrap; }
.m-only { display: none !important; }
button.link { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0;
  color: var(--blue); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
button.link .ic { width: 16px; height: 16px; }

/* ---------- каркас ---------- */
.layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px;
  padding: 16px 12px; background: var(--card); border-right: 1px solid var(--line); }
.side-brand, .m-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.side-brand b, .m-brand b { display: block; font-size: 15px; }
.side-brand small, .m-brand small { display: block; color: var(--muted); font-size: 12px; }
.brand-ic { color: var(--blue); display: inline-flex; }
.brand-ic .ic { width: 34px; height: 34px; stroke-width: 2; }
.side-close { display: none; margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: #1f2937; font-size: 14px; font-weight: 500; }
.side-nav a .ic { color: #4b5563; }
.side-nav a:hover { background: var(--soft); }
.side-nav a.on { background: var(--blue); color: #fff; }
.side-nav a.on .ic { color: #fff; }
.side-promo { margin-top: auto; padding: 14px; border-radius: 12px; display: flex; flex-direction: column; gap: 4px;
  background: linear-gradient(160deg, #eef3fe 0%, #dfe8fb 100%); border: 1px solid #dbe4f7; }
.side-promo b { font-size: 14px; }
.side-promo small { color: var(--muted); font-size: 12px; }
.promo-ic { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
  background: var(--blue); color: #fff; margin-bottom: 6px; }
.scrim { display: none; }
.main { min-width: 0; }

/* ---------- шапка ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 12px 24px;
  background: rgba(244, 246, 250, .92); backdrop-filter: saturate(1.4) blur(8px); }
.burger, .m-brand { display: none; }
.title h1 { font-size: 22px; font-weight: 700; line-height: 1.15; }
.title p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.filters { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.dd { position: relative; }
.dd > summary, .dd.branch { list-style: none; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; white-space: nowrap; font-size: 13px; }
.dd > summary::-webkit-details-marker { display: none; }
.dd .ic { width: 18px; height: 18px; color: #4b5563; }
.dd .chev { width: 16px; height: 16px; color: var(--muted); }
.dd-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 280px; padding: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(16, 24, 40, .14); }
.dd-panel.right { left: auto; right: 0; min-width: 180px; padding: 6px; }
.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 10px; }
.presets a { padding: 7px 10px; border-radius: 8px; color: var(--text); font-size: 13px; background: var(--soft); }
.presets a:hover { background: var(--blue-soft); color: var(--blue); }
.range-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.range-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.range-form input { height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; color: var(--text); background: #fff; }
.range-form button { grid-column: 1 / -1; height: 36px; border: 0; border-radius: 8px; background: var(--blue); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.dd.branch { cursor: default; }
.dd.branch .lbl { color: var(--muted); }
.dd.branch select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font: inherit; font-weight: 500;
  color: var(--text); padding: 0 18px 0 0; margin-right: -22px; cursor: pointer; max-width: 230px; }
.dd.branch .chev { pointer-events: none; }
.seg { display: flex; padding: 3px; border-radius: 10px; background: #e9eef8; }
.seg a { padding: 7px 16px; border-radius: 8px; color: #374151; font-size: 13px; font-weight: 500; }
.seg a.on { background: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(47, 111, 237, .35); }
.dd.bell > summary { position: relative; justify-content: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 10px; background: none; color: #374151; }
.dd.bell > summary:hover, .dd.bell[open] > summary { background: var(--soft); }
.dd.bell > summary .ic { width: 22px; height: 22px; color: #374151; }
.bell i { position: absolute; top: 1px; right: 0; display: flex; align-items: center; justify-content: center;
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; border: 2px solid var(--bg);
  background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; line-height: 1; font-style: normal; font-variant-numeric: tabular-nums; }
.bell-panel { width: 360px; max-width: calc(100vw - 32px); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.bell-panel.right { min-width: 0; padding: 10px; }
.bp-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 2px; color: #c81e1e; font-size: 15px; font-weight: 700; }
.bp-head .ic { width: 20px; height: 20px; color: #c81e1e; }
.bell-panel .empty { margin: 4px; }
.me > summary { border: 0; background: none; padding: 0 0 0 12px; border-left: 1px solid var(--line); border-radius: 0; height: 42px; gap: 10px; }
.ava { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #e3e9f6; color: #3b4a6b; font-weight: 600; }
.me-txt b { display: block; font-size: 14px; }
.me-txt small { display: block; color: var(--muted); font-size: 12px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px;
  background: none; font: inherit; color: var(--text); cursor: pointer; }
.menu-item:hover { background: var(--soft); }

/* ---------- контент ---------- */
.content { padding: 4px 24px 28px; display: flex; flex-direction: column; gap: 14px; }
.banner { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; background: #fff7e6;
  border: 1px dashed #f3c46b; color: #7a5500; font-size: 13px; }
.banner .ic { width: 18px; height: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; min-width: 0; }
.c-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.c-head h2 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.tip { display: inline-flex; color: #9aa3b2; cursor: help; }
.tip .ic { width: 16px; height: 16px; }
.empty { color: var(--muted); font-size: 13px; margin: 8px 0; }

/* плитки */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { display: flex; gap: 14px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.k-ic { color: var(--blue); padding-top: 4px; }
.k-ic .ic { width: 30px; height: 30px; stroke-width: 1.7; }
.k-l { font-size: 14px; color: #1f2937; }
.k-v { font-size: 24px; font-weight: 700; margin: 2px 0 6px; white-space: nowrap; letter-spacing: -.01em; }
.k-v small { font-size: 20px; font-weight: 700; }
.k-d { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill-up { background: var(--up-bg); color: var(--up); }
.pill-down { background: var(--down-bg); color: var(--down); }
.pill-none { background: var(--soft); color: var(--muted); }

/* ряд A */
.row-a { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; grid-template-areas: "chart chart mech" "adv adv struct"; }
.row-a .c-chart { grid-area: chart; } .row-a .c-mech { grid-area: mech; } .row-a .c-adv { grid-area: adv; } .row-a .c-struct { grid-area: struct; }   /* график 2/3 + выработка механиков справа */
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.blue, .sq.blue { background: var(--blue); } .dot.green, .sq.green { background: var(--green); }
.chart { display: block; width: 100%; height: auto; }
.chart .grid { stroke: #edf0f5; stroke-dasharray: 4 4; } .chart .grid.base { stroke: #e2e7ef; stroke-dasharray: none; }
.chart text { font-size: 11px; fill: #8a94a6; }
.chart .axl { text-anchor: end; fill: #5b7fd6; font-size: 11.5px; }
.chart .axr { text-anchor: start; fill: #3a9d5d; font-size: 11.5px; }
.chart .axx { text-anchor: middle; }
.chart .area { animation: chFade .9s ease-out both; }   /* заливка — атрибутом fill (у каждого графика свой градиент) */
.chart .area-avg { fill: url(#gAvg); animation: chFade .9s ease-out .15s both; }
.chart .l-rev, .chart .l-avg { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 0; animation: chDraw 1.1s cubic-bezier(.4, 0, .2, 1) both; }
.chart .l-rev { filter: drop-shadow(0 4px 6px rgba(47, 111, 237, .28)); }
.chart .l-avg { stroke: url(#gAvgL); filter: drop-shadow(0 4px 6px rgba(34, 197, 94, .25)); animation-delay: .15s; }
.chart .d-rev { fill: #fff; stroke: var(--blue); stroke-width: 2.5; animation: chFade .4s ease-out 1s both; }
.chart .d-avg { fill: #fff; stroke: #16a34a; stroke-width: 2.5; animation: chFade .4s ease-out 1s both; }
@keyframes chDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes chFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .chart .area, .chart .area-avg, .chart .l-rev, .chart .l-avg, .chart .d-rev, .chart .d-avg { animation: none; } }

.hbars { display: flex; flex-direction: column; gap: 14px; padding: 10px 4px 0; }
.hb-row, .hb-axis { display: grid; grid-template-columns: 110px minmax(0, 1fr) 84px; align-items: center; gap: 12px; }
.hb-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-track { height: 20px; }
.hb-bar { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #2f6fed, #4e86f2); }
.hb-row:nth-child(n+3) .hb-bar { background: linear-gradient(90deg, #4e86f2, #6a9af5); }
.hb-row:nth-child(n+4) .hb-bar { background: #7aa6f6; }
.hb-val { font-size: 13px; font-weight: 500; text-align: left; white-space: nowrap; }
.hb-axis { margin-top: -4px; color: var(--muted); font-size: 11px; }
.hb-axis .ticks { position: relative; height: 14px; border-top: 1px solid var(--line); }
.hb-axis .ticks i { position: absolute; top: 3px; transform: translateX(-50%); font-style: normal; white-space: nowrap; }
.hb-axis .ticks i:first-child { transform: none; }
.hb-axis .ticks i:last-child { transform: translateX(-100%); }

.struct { display: flex; align-items: center; gap: 18px; }
.donut { width: 170px; height: 170px; flex: none; }
.donut .dl { font-size: 9px; font-weight: 600; fill: #fff; text-anchor: middle; }
.donut .dc { font-size: 22px; font-weight: 700; fill: var(--text); text-anchor: middle; }
.donut .ds { font-size: 10px; fill: var(--muted); text-anchor: middle; }
.struct-leg { display: flex; flex-direction: column; gap: 18px; font-size: 14px; }
.struct-leg div { display: flex; gap: 10px; align-items: flex-start; }
.struct-leg small { color: var(--muted); font-size: 13px; }
.sq { width: 12px; height: 12px; border-radius: 3px; margin-top: 4px; flex: none; }

/* ряд B/C */
.row-b { display: grid; gap: 14px;
  grid-template-columns: 1fr 1.17fr .97fr .8fr;
  grid-template-areas: "fill reco stack alerts" "stuck stuck stack alerts"; align-items: start; }
.c-fill { grid-area: fill; } .c-reco { grid-area: reco; }
.c-stuck { grid-area: stuck; } .stack { grid-area: stack; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.c-alerts { grid-area: alerts; align-self: stretch; }
.c-fill, .c-reco, .c-mech { height: 100%; }
.c-fill h2, .c-reco h2 { font-size: 15px; }
.g-wrap { display: flex; align-items: center; gap: 14px; }
.gauge { width: 150px; height: auto; flex: none; }
.g-track { fill: none; stroke: #e8ecf2; stroke-width: 12; stroke-linecap: round; }
.g-val { fill: none; stroke-width: 12; stroke-linecap: round; }
.g-txt { font-size: 17px; font-weight: 700; text-anchor: middle; fill: var(--text); }
.g-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; color: var(--muted); font-size: 13px; }
.g-ret { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding-left: 14px; border-left: 1px solid var(--line); }
.g-ret small { color: var(--muted); font-size: 12px; }
.g-ret b { font-size: 20px; }

.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rank li { display: grid; grid-template-columns: 22px 100px minmax(0, 1fr) 70px; align-items: center; gap: 8px; font-size: 13px; }
.rank i { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--soft); font-style: normal; font-size: 11px; color: var(--muted); }
.rk-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-track, .pb-track { height: 10px; background: #edf1f6; border-radius: 6px; overflow: hidden; }
.rk-track span, .pb-track span { display: block; height: 100%; border-radius: 6px; background: var(--green); }
.rank b, .pb-row b { text-align: right; font-weight: 500; white-space: nowrap; }

.tbl-wrap { margin: 0 -16px -14px; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th { text-align: left; padding: 7px 6px; line-height: 1.2; font-size: 11.5px !important; background: #f6f8fb; color: #374151; font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line); }
.tbl td { padding: 6px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th:first-child, .tbl td:first-child { padding-left: 16px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 16px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl tr.more { display: none; }
.tbl.show-all tr.more { display: table-row; }
tr.st-overdue td { background: var(--red-row); }
tr.st-long td { background: var(--yel-row); }
tr.st-overdue .hrs { color: var(--down); font-weight: 600; }
.car { display: flex; align-items: center; gap: 10px; }
.car .ic { width: 22px; height: 22px; color: #6b7280; }
tr.st-overdue .car .ic { color: #c2414b; } tr.st-long .car .ic { color: #c08a12; }
.car b { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; }
.car small { display: block; color: var(--muted); font-size: 11.5px; }
.zn { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.hrs { white-space: nowrap; }
.works { max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 7px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-red { background: #fde2e2; color: #c81e1e; } .b-yel { background: var(--yel-bg); color: var(--yel); } .b-blue { background: #e3edfd; color: #1d5bd6; }

.oc { display: grid; grid-template-columns: 1fr 1fr; }
.oc > div { display: flex; gap: 10px; padding: 4px 0; }
.oc > div + div { border-left: 1px solid var(--line); padding-left: 14px; }
.oc-ic { color: var(--green); padding-top: 2px; } .oc-ic .ic { width: 22px; height: 22px; stroke-width: 2.4; }
.oc small { display: block; color: var(--muted); font-size: 13px; }
.oc b { display: block; font-size: 20px; margin: 2px 0 4px; }
.pbars { display: flex; flex-direction: column; gap: 10px; }
.pb-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 70px; align-items: center; gap: 12px; font-size: 13px; }
.pb-track { height: 12px; }

.c-alerts { background: #fff6f6; border-color: #f9d4d4; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.al-title { display: flex; align-items: center; gap: 8px; color: #c81e1e; font-size: 16px; font-weight: 700; padding: 0 4px 4px; }
.al-title .ic { width: 22px; height: 22px; }
.al-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 10px; background: #fff; border: 1px solid #f6dede; color: var(--text); }
.al-item:hover { border-color: #f0b9b9; }
.al-ic { color: #d93a3a; padding-top: 1px; } .al-ic .ic { width: 22px; height: 22px; }
.al-item b { display: block; font-size: 14px; margin-bottom: 2px; }
.al-item small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.al-go { margin-left: auto; align-self: center; width: 18px !important; height: 18px !important; color: var(--muted); }

.foot { color: var(--muted); font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; padding: 10px 16px; border-radius: 10px;
  background: #111827; color: #fff; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }

/* ---------- адаптивность карточек (контейнерные запросы) и подсказка графика ---------- */
.card, .kpi { container-type: inline-size; }
.c-head h2 { flex: 1 1 auto; min-width: 0; line-height: 1.25; }
.c-head > :not(h2) { flex: none; }
.k-v { font-size: clamp(18px, 8.5cqi, 24px); }
.k-v small { font-size: .82em; }
.kpi > div { min-width: 0; }
.k-l { overflow-wrap: anywhere; }

.g-wrap { flex-wrap: wrap; row-gap: 10px; }
.gauge { width: clamp(110px, 36cqi, 150px); }
@container (max-width: 430px) {
  .c-reco .g-ret { flex-basis: 100%; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 4px 10px;
    padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .c-reco .g-ret small { flex-basis: 100%; }
}
@container (max-width: 300px) { .g-side { flex-direction: row; flex-wrap: wrap; align-items: center; } }

/* таблица подвисших: при нехватке ширины прячем второстепенные колонки по очереди */
@container (max-width: 820px) { .c-stuck .col-works { display: none; } }
@container (max-width: 700px) { .c-stuck .col-rate { display: none; } }
@container (max-width: 600px) { .c-stuck .col-adv { display: none; } }
@container (max-width: 500px) { .c-stuck .col-open { display: none; } }
.tbl th { white-space: nowrap; }

.rank li { grid-template-columns: 22px minmax(70px, 110px) minmax(30px, 1fr) auto; }
.pb-row { grid-template-columns: minmax(44px, auto) minmax(30px, 1fr) auto; }
.oc > div { min-width: 0; }
@container (max-width: 300px) { .oc { grid-template-columns: 1fr; gap: 10px; } .oc > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 10px; } }

.struct-leg { min-width: 0; }
.donut { width: clamp(120px, 42cqi, 170px); height: auto; }
@container (max-width: 400px) { .struct { flex-direction: column; align-items: center; gap: 12px; } .struct-leg { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 10px 22px; } }
.al-list { display: flex; flex-direction: column; gap: 10px; }
@container (min-width: 640px) { .al-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
.c-chart .c-head { flex-wrap: wrap; row-gap: 4px; }
.c-chart .c-head h2 { flex: 0 1 auto; }
.legend { flex-wrap: wrap; }
@container (max-width: 480px) { .hb-axis .ticks i { display: none; } .hb-axis .ticks i:first-child, .hb-axis .ticks i:last-child { display: block; } }
.chart-box { position: relative; }
.chart .hit-area { fill: transparent; cursor: crosshair; touch-action: pan-y; }
.chart .guide { stroke: #94a3b8; stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.chart .f-rev { fill: var(--blue); stroke: #fff; stroke-width: 2.5; }
.chart .f-avg { fill: #16a34a; stroke: #fff; stroke-width: 2.5; }
.chart .hover { pointer-events: none; }
.ctip { position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none; min-width: 170px; padding: 9px 11px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(16, 24, 40, .14); font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; }
.ctip[hidden] { display: none; }
.ctip b { font-size: 13px; margin-bottom: 2px; }
.ctip span { display: flex; align-items: center; gap: 6px; }
.ctip em { margin-left: auto; padding-left: 12px; font-style: normal; font-weight: 600; color: var(--text); }

/* ---------- вход ---------- */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 26px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 10px 30px rgba(16,24,40,.06); }
.login-card .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.login-card .brand small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.login-card h1 { font-size: 22px; margin-top: 6px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.login-card input { height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 16px; color: var(--text); }
.login-card input:focus, .range-form input:focus { outline: 2px solid var(--blue-soft); border-color: var(--blue); }
.login-card button { height: 46px; border: 0; border-radius: 10px; background: var(--blue); color: #fff; font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; }
.alert { padding: 10px 12px; border-radius: 10px; background: var(--down-bg); color: var(--down); }

/* ---------- узкий десктоп / планшет ---------- */
@media (max-width: 1380px) {
  .top { flex-wrap: wrap; }
  .filters { order: 3; width: 100%; margin-left: 0; }
  .bell { margin-left: auto; }
}
@media (max-width: 1560px) {
  .row-b { grid-template-columns: 1fr 1.2fr 1fr; grid-template-areas: "fill reco stack" "stuck stuck stack" "alerts alerts alerts"; }
}
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-a { grid-template-columns: 1fr 1fr; grid-template-areas: "chart chart" "mech struct" "adv adv"; }
  .row-b { grid-template-columns: 1fr 1fr; grid-template-areas: "fill reco" "stack stack" "stuck stuck" "alerts alerts"; }
}
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; width: 270px; transform: translateX(-102%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  body.menu-open .side { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(17, 24, 39, .35); }
  .side-close { display: inline-flex; }
  .burger { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; background: none; color: #1f2937; cursor: pointer; margin-left: -8px; }
  .burger .ic { width: 26px; height: 26px; }
}

/* ---------- телефон (второй макет) ---------- */
@media (max-width: 760px) {
  body { font-size: 14px; }
  .m-only { display: inline-flex !important; }
  .m-hide, .d-only, .desk { display: none !important; }
  .top { position: static; background: var(--bg); backdrop-filter: none; padding: 10px 16px 0; gap: 8px 10px; }
  .m-brand { display: flex; padding: 0; order: 1; }
  .m-brand .brand-ic .ic { width: 30px; height: 30px; }
  .m-brand b { font-size: 16px; }
  .burger { order: 0; margin-left: -6px; }
  .bell { order: 2; margin-left: auto; }
  .bell-panel { position: fixed; top: 58px; left: 16px; right: 16px; width: auto; max-width: none; }
  .me { order: 3; }
  .me > summary { border: 0; padding: 0; }
  .me-txt { display: none !important; }
  .title { order: 4; width: 100%; margin-top: 6px; }
  .title h1 { font-size: 24px; }
  .filters { order: 5; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .dd.range { order: 1; } .dd.branch { order: 2; } .seg { order: 3; }
  .c-stuck .c-head { align-items: flex-start; }
  .js-more { white-space: nowrap; }
  .badge { font-size: 11px; padding: 2px 6px; }
  .car .ic { width: 18px; height: 18px; }
  .car { gap: 6px; }
  .dd.range, .dd.branch { min-width: 0; }
  .dd > summary, .dd.branch { height: 40px; padding: 0 10px; font-size: 13px; }
  .dd > summary span, .dd.branch select { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .dd.branch select { max-width: none; flex: 1; margin-right: -20px; }
  .dd.range .dd-panel { left: 0; right: auto; width: calc(100vw - 32px); min-width: 0; }
  .seg { grid-column: 1 / -1; }
  .seg a { flex: 1; text-align: center; padding: 8px 0; font-size: 14px; }
  .content { padding: 10px 16px 24px; gap: 10px; }
  .kpis { gap: 10px; }
  .kpi { padding: 10px 12px; gap: 10px; }
  .k-ic .ic { width: 24px; height: 24px; }
  .k-l { font-size: 13px; }
  .k-v { font-size: 20px; margin: 0 0 4px; }
  .k-d { gap: 6px; font-size: 11.5px; }
  .pill { font-size: 12px; padding: 1px 6px; }
  .card { padding: 12px; }
  .c-head h2 { font-size: 15px; }
  .row-a { grid-template-columns: 1fr; gap: 10px; grid-template-areas: "chart" "adv" "struct" "mech"; }
  .legend { font-size: 11px; gap: 8px; }
  .c-chart .c-head { flex-wrap: wrap; }
  .hb-row, .hb-axis { grid-template-columns: 96px minmax(0, 1fr) 70px; gap: 8px; }
  .hbars { gap: 10px; }
  .hb-track { height: 14px; }
  .struct { justify-content: center; }
  .donut { width: 130px; height: 130px; }
  .row-b { grid-template-columns: 1fr 1fr; gap: 10px; grid-template-areas: "fill fill" "reco reco" "stuck stuck" "stack stack" "alerts alerts"; }
  .c-mech, .g-ret, .g-side span { display: none !important; }
  .c-fill h2, .c-reco h2 { font-size: 13px; }
  .g-wrap { flex-direction: column; align-items: center; gap: 4px; }
  .gauge { width: 120px; }
  .stack { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .c-oc h2, .c-posts h2 { font-size: 13px; }
  .oc { grid-template-columns: 1fr 1fr; }
  .oc > div { flex-direction: column; gap: 2px; align-items: flex-start; }
  .oc > div + div { padding-left: 8px; }
  .oc b { font-size: 17px; }
  .pb-row { grid-template-columns: 44px minmax(0, 1fr) 54px; gap: 6px; font-size: 12px; }
  .tbl-wrap { margin: 0 -12px -12px; }
  .tbl th:first-child, .tbl td:first-child { padding-left: 12px; }
  .tbl th:last-child, .tbl td:last-child { padding-right: 12px; }
  .tbl tr:nth-child(n+4) { display: none; }
  .tbl.show-all tr { display: table-row; }
  .c-alerts { padding: 12px 10px; }
}

/* ---------- главная: блок «Дебиторка» ---------- */
.c-debts .c-head { margin-bottom: 4px; }
.link-more { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.link-more .ic { width: 16px; height: 16px; }
.dkh-top { display: block; color: var(--text); margin-bottom: 8px; }
.dkh-top b { display: block; font-size: 22px; color: var(--down); }
.dkh-top small { color: var(--muted); font-size: 12px; }
.dkh-rows { display: flex; flex-direction: column; }
.dkh-rows span { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; color: #374151; }
.dkh-rows b { font-weight: 600; white-space: nowrap; }
@media (max-width: 760px) {
  .stack .c-debts { grid-column: 1 / -1; }
  .c-debts h2 { font-size: 13px; }
  .dkh-top b { font-size: 20px; }
}
/* Версия дашборда — мелко в левом нижнем углу меню */
.side-ver { margin-top: -14px; padding: 0 4px; color: #9aa3b2; font-size: 11px; line-height: 16px; text-decoration: none; white-space: nowrap; }
.side-ver:hover, .side-ver.on { color: var(--blue); }
@media (max-height: 860px) { .side-promo small { display: none; } }
@media (max-height: 780px) { .side-promo { display: none; } .side-ver { margin-top: auto; } }
.side { overflow-y: auto; scrollbar-width: none; }
/* Главная: КФ наполнения З/Н услугами */
.kf { display: flex; flex-direction: column; gap: 10px; }
.kf-top { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.kf-v { font-size: 34px; font-weight: 700; line-height: 1; color: var(--text); }
.kf-u { font-size: 12px; line-height: 1.2; color: var(--muted); }
.kf-dev { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin-left: auto; }
.kf-dev small { font-size: 11.5px; color: var(--muted); }
.kf-bars { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 56px; padding-bottom: 1px; border-bottom: 1px solid var(--line); }
.kf-bars i { flex: 1 1 0; min-width: 2px; background: #cfe9d6; border-radius: 2px 2px 0 0; }
.kf-bars i.on { background: #3bbf5a; } .kf-bars i.lo { background: #f3d9b1; } .kf-bars i.on.lo { background: #f2b33d; }
.kf-bars em { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px dashed #6b7280; pointer-events: none; }
.kf-n { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
@container (max-width: 300px) { .kf-dev { margin-left: 0; flex-direction: row; align-items: center; gap: 6px; } }
/* Главная: раскрытие подвисших З/Н (как в журнале заказ-нарядов) */
.c-stuck .tbl tr.jr { cursor: pointer; }
.c-stuck .tbl tr.jr:hover td { background: #f8faff; }
.c-stuck .tbl tr.jr[aria-expanded=true] td { background: var(--blue-soft, #eef4ff); border-bottom-color: transparent; }
.tbl tr.det[hidden] { display: none !important; }
.tbl:not(.show-all) tr.more + tr.det { display: none !important; }
.c-stuck .tbl tr.det > td { padding: 0 16px 12px; background: var(--blue-soft, #eef4ff); white-space: normal; }
.c-stuck .dt { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; cursor: default; }
.c-stuck .dt-meta { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.c-stuck .dt-meta small { display: block; color: var(--muted); font-size: 11.5px; }
.c-stuck .dt-meta b { font-weight: 600; font-size: 13px; }
.c-stuck .dt-meta i { font-style: normal; color: var(--muted); margin-left: 6px; font-size: 12px; }
.c-stuck .dtt { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.c-stuck .dtt th { text-align: left; font-weight: 600; font-size: 11.5px; color: var(--muted); padding: 4px 6px; border-bottom: 1px solid var(--line); background: none; }
.c-stuck .dtt td { padding: 5px 6px; border-bottom: 1px solid #f1f3f7; vertical-align: top; background: none !important; }
.c-stuck .dtt th:first-child, .c-stuck .dtt td:first-child { padding-left: 0; width: 46%; }
.c-stuck .dtt .r { text-align: right; } .c-stuck .dtt td small { display: none; }
.c-stuck .dt-sum { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 22px; font-size: 13px; color: var(--muted); }
.c-stuck .dt-sum b { color: var(--text); margin-left: 4px; }
.c-stuck .dt-reco { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: var(--yel-row); font-size: 12.5px; }
.c-stuck .dt-reco .ic { width: 16px; height: 16px; color: var(--yel); margin-top: 1px; flex: none; }
.c-stuck .dt-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; }
.c-stuck .ctag { display: inline-block; min-width: 24px; margin-right: 6px; padding: 1px 4px; border-radius: 5px; font-size: 10.5px; font-weight: 700; text-align: center; vertical-align: middle; }
.c-stuck .ct-company { background: #e3edfd; color: #1d5bd6; } .c-stuck .ct-ip { background: #efe7fd; color: #6d3fd0; }
.c-stuck .ct-person { background: #eef1f5; color: #4b5563; } .c-stuck .ct-other { background: #f3f4f6; color: #9ca3af; }
.c-stuck .b-green { background: var(--up-bg); color: var(--up); } .c-stuck .b-gray { background: #eef1f5; color: #4b5563; }
@media (max-width: 760px) {
  .c-stuck .tbl tr.jr:nth-child(n+4) { display: table-row; }
  .c-stuck .tbl tr.jr:nth-child(n+7) { display: none; }
  .c-stuck .tbl.show-all tr.jr { display: table-row; }
  .c-stuck .tbl tr.det > td { padding: 0 8px 10px; }
  .c-stuck .dt { padding: 10px; }
  .c-stuck .dtt .d-only, .c-stuck .dtt td.d-only { display: none; }
}
@media (max-width: 760px) {
  /* раскрытый наряд — по ширине экрана, а не всей прокручиваемой таблицы */
  .c-stuck .tbl tr.det > td > .dt { position: sticky; left: 8px; width: calc(100vw - 52px); box-sizing: border-box; }
  .c-stuck .dt-sum { gap: 4px 14px; font-size: 12px; }
}

/* Главная: график «Оборот и средний чек» — столбцы, линия оборота, записи; легенда-переключатель */
.dot.orange { background: #f59e0b; }
.sq-l { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sq-l.green { background: linear-gradient(#4ade80, #bbf7d0); }
.chart .bar-avg { animation: chGrow .7s cubic-bezier(.4, 0, .2, 1) both; transform-box: fill-box; transform-origin: bottom; }
.chart .l-bk { fill: none; stroke: #f59e0b; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; animation: chDraw 1.1s cubic-bezier(.4, 0, .2, 1) .2s both; }
.chart .d-bk { fill: #fff; stroke: #f59e0b; stroke-width: 2; }
.chart .hband { fill: rgba(47, 111, 237, .06); }
.chart .f { stroke: #fff; stroke-width: 2.5; }
.chart .f-avg { fill: #16a34a; } .chart .f-bk { fill: #f59e0b; }
@keyframes chGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .chart .bar-avg, .chart .l-bk { animation: none; } }
.chart-box.cb-m { display: none; }
@media (max-width: 700px) { .chart-box.cb-d { display: none; } .chart-box.cb-m { display: block; } }
.lg-toggle button { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 0; border-radius: 7px; background: none; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.lg-toggle button:hover { background: var(--soft); color: var(--text); }
.lg-toggle button.off { text-decoration: line-through; opacity: .5; }
.lg-toggle button.off i { filter: grayscale(1); }
.c-chart[data-hide~="rev"] .s-rev, .c-chart[data-hide~="avg"] .s-avg, .c-chart[data-hide~="bk"] .s-bk { display: none !important; }
.c-chart .c-head > .legend { flex: 1 1 auto; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
@media (max-width: 700px) { .c-chart .c-head > .legend { flex-basis: 100%; justify-content: flex-start; gap: 4px 10px; } }
.row-a .c-mech { display: flex; flex-direction: column; }
.row-a .c-mech .rank { flex: 1; justify-content: space-evenly; gap: 10px; }
/* Главная: «Рекомендованные работы и возврат клиентов» */
.c-reco { display: flex; flex-direction: column; gap: 10px; }
.rc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rc-i { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px; border-radius: 10px; background: #f7f9fc; min-width: 0; }
.rc-i small { font-size: 11.5px; color: #4b5563; font-weight: 500; line-height: 1.25; }
.rc-i b { font-size: 22px; font-weight: 700; line-height: 1.1; }
.rc-i span { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.rc-i .pill { font-size: 11px; }
.rc-call { border: 1px solid var(--line); border-radius: 10px; }
.rc-call summary { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; color: var(--blue); }
.rc-call summary::-webkit-details-marker { display: none; }
.rc-call summary .ic { width: 16px; height: 16px; flex: none; }
.rc-call summary .chev { margin-left: auto; transition: transform .15s; }
.rc-call[open] summary .chev { transform: rotate(180deg); }
.rc-call ul { list-style: none; margin: 0; padding: 0 6px 6px; max-height: 300px; overflow-y: auto; }
.rc-call li a { display: flex; flex-direction: column; gap: 1px; padding: 7px 6px; border-top: 1px solid var(--line); color: var(--text); font-size: 12.5px; }
.rc-call li a:hover { background: #f8faff; }
.rc-call li small { color: var(--muted); font-size: 11.5px; }
.rc-call li i { font-style: normal; color: #374151; font-size: 12px; }
.rc-note { margin: 0; font-size: 11.5px; color: var(--muted); }
@container (max-width: 380px) { .rc { grid-template-columns: 1fr; } .rc-i { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 8px; } .rc-i small { flex-basis: 100%; } }
