/* ============================================================
   Мәслихат-2026 · городской штаб «Әділет», Астана
   Токены: фиолетовый бренда, глубокий фиолетовый навигации,
   золото – только для «сегодня» и сигналов внимания.
   ============================================================ */
:root {
  --violet: #542580;
  --violet-700: #44206A;
  --violet-deep: #24103D;
  --violet-ink: #3A1663;
  --lilac: #EFE8F7;
  --lilac-2: #E2D6F0;
  --lilac-3: #C9B5E2;
  --paper: #F6F5F9;
  --white: #FFFFFF;
  --ink: #1E1528;
  --ink-2: #4B4157;
  --muted: #7D738A;
  --line: #E4DEEC;
  --line-2: #D5CCE1;
  --gold: #E0A100;
  --gold-soft: #FFF4D6;
  --ok: #1D7A55;
  --ok-soft: #E3F3EB;
  --watch: #B26A00;
  --watch-soft: #FDF0DC;
  --risk: #BE3628;
  --risk-soft: #FBE7E4;
  --info: #2D5DA8;
  --info-soft: #E6EEFA;
  --f-display: 'Unbounded', 'Golos Text', 'Segoe UI', sans-serif;
  --f-body: 'Golos Text', 'Segoe UI', Roboto, Arial, sans-serif;
  --r-panel: 14px;
  --r-ctl: 9px;
  --rail-w: 236px;
  --shadow-pop: 0 18px 50px rgba(36, 16, 61, .22);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--f-body); font-size: 14px; line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
a { color: var(--violet); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--violet-deep) var(--rail-w), transparent var(--rail-w)); }
.rail {
  background: var(--violet-deep); color: #E9E1F4; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: thin;
}
.rail-brand { padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 10px; }
.rail-brand img { width: 150px; height: auto; display: block; border-radius: 4px; }
.rail-brand .product { font-family: var(--f-display); font-size: 12.5px; font-weight: 600; letter-spacing: .2px; color: #fff; }
.rail-brand .product span { display: block; font-family: var(--f-body); font-weight: 400; font-size: 12px; color: #B9A9D0; letter-spacing: 0; margin-top: 2px; }
.rail-group { padding: 10px 10px 4px; }
.rail-group h4 { margin: 0 8px 6px; font-size: 11.5px; font-weight: 500; color: #9E8CB8; }
.rail-link {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: transparent;
  color: #E3D9F0; border-radius: 9px; cursor: pointer; text-align: left; font-size: 13.5px;
}
.rail-link svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.rail-link:hover { background: rgba(255, 255, 255, .07); }
.rail-link.active { background: var(--violet); color: #fff; }
.rail-link.active svg { opacity: 1; }
.rail-link .count { margin-left: auto; background: var(--gold); color: var(--violet-deep); font-weight: 700; font-size: 11px; border-radius: 10px; padding: 1px 7px; }
.rail-foot { margin-top: auto; padding: 14px 18px 18px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 12.5px; color: #B9A9D0; }
.rail-foot b { color: #fff; font-weight: 600; display: block; font-size: 13.5px; }
.rail-foot .row { display: flex; gap: 8px; margin-top: 10px; }
.rail-foot button { flex: 1; background: rgba(255, 255, 255, .08); border: 0; color: #fff; border-radius: 8px; padding: 7px 8px; cursor: pointer; font-size: 12.5px; }
.rail-foot button:hover { background: rgba(255, 255, 255, .16); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { padding: 22px 28px 64px; max-width: 1480px; width: 100%; }

/* ---------- полоса календаря кампании ---------- */
.strip { background: var(--white); border-bottom: 1px solid var(--line); padding: 12px 28px 10px; }
.strip-head { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.strip-phase { font-family: var(--f-display); font-weight: 600; font-size: 16px; color: var(--violet-ink); }
.strip-meta { color: var(--ink-2); font-size: 13px; }
.strip-meta b { font-family: var(--f-display); font-weight: 600; color: var(--ink); font-size: 14px; }
.strip-count { margin-left: auto; text-align: right; display: flex; align-items: baseline; gap: 8px; }
.strip-count .n { font-family: var(--f-display); font-weight: 700; font-size: 26px; line-height: 1; color: var(--violet); }
.strip-count .l { font-size: 12.5px; color: var(--muted); max-width: 170px; line-height: 1.25; }
.track { position: relative; display: flex; height: 26px; border-radius: 6px; overflow: visible; }
.track .seg { position: relative; display: flex; align-items: center; padding: 0 8px; font-size: 11.5px; white-space: nowrap; overflow: hidden; color: var(--violet-ink); border-right: 2px solid var(--white); }
.track .seg:first-child { border-radius: 6px 0 0 6px; }
.track .seg:last-child { border-radius: 0 6px 6px 0; border-right: 0; }
.track .seg.nom { background: var(--lilac); }
.track .seg.reg { background: var(--lilac-2); }
.track .seg.agit { background: var(--violet); color: #fff; }
.track .seg.sil { background: #F3E4B5; color: #6B4E00; }
.track .seg.vote { background: var(--gold); color: var(--violet-deep); font-weight: 600; }
.track .seg.res { background: #DCD6E4; color: var(--ink-2); }
.track .past { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(135deg, rgba(255,255,255,.0) 0 6px, rgba(255,255,255,.28) 6px 8px); pointer-events: none; border-radius: 6px 0 0 6px; }
.track .today { position: absolute; top: -5px; bottom: -5px; width: 3px; background: var(--gold); border-radius: 2px; box-shadow: 0 0 0 2px var(--white); }
.track .today::after { content: attr(data-label); position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: #8A6300; white-space: nowrap; }
.track-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---------- заголовки страниц ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-family: var(--f-display); font-weight: 600; font-size: 22px; line-height: 1.25; margin: 0; color: var(--violet-ink); letter-spacing: -.1px; }
.page-head .lead { margin: 6px 0 0; color: var(--ink-2); max-width: 78ch; font-size: 14px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
h2.sec { font-family: var(--f-display); font-weight: 600; font-size: 15px; margin: 0 0 12px; color: var(--ink); }
h3.sub { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.hint { color: var(--muted); font-size: 12.5px; }
.note { color: var(--ink-2); font-size: 13px; }

/* ---------- поверхности ---------- */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 18px 20px; }
.panel + .panel, .stack > * + * { margin-top: 16px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.tint { background: var(--lilac); border-color: var(--lilac-2); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-7-5 { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; }
.grid2 > *, .grid3 > *, .grid-7-5 > * { min-width: 0; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ленточный блок показателей: одна полоса, разделённая вертикальными линиями */
.ledger { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-panel); margin-bottom: 16px; }
.ledger .cell { padding: 14px 18px 13px; border-left: 1px solid var(--line); min-width: 0; }
.ledger .cell:first-child { border-left: 0; }
.ledger .k { font-size: 12.5px; color: var(--muted); }
.ledger .v { font-family: var(--f-display); font-weight: 600; font-size: 24px; line-height: 1.15; margin-top: 4px; color: var(--ink); }
.ledger .v small { font-family: var(--f-body); font-weight: 500; font-size: 13px; color: var(--muted); margin-left: 4px; }
.ledger .s { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.ledger .s.ok { color: var(--ok); } .ledger .s.risk { color: var(--risk); } .ledger .s.watch { color: var(--watch); }

/* ---------- элементы управления ---------- */
.btn, .btn-ghost, .btn-quiet, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--r-ctl);
  padding: 8px 14px; font-weight: 600; font-size: 13.5px; cursor: pointer; border: 1px solid transparent; line-height: 1.2; white-space: nowrap;
}
.btn { background: var(--violet); color: #fff; }
.btn:hover { background: var(--violet-700); }
.btn:disabled { background: var(--lilac-3); cursor: not-allowed; }
.btn-ghost { background: var(--white); color: var(--violet); border-color: var(--lilac-3); }
.btn-ghost:hover { background: var(--lilac); }
.btn-quiet { background: transparent; color: var(--violet); padding: 6px 8px; }
.btn-quiet:hover { background: var(--lilac); }
.btn-danger { background: var(--white); color: var(--risk); border-color: #EBC2BC; }
.btn-danger:hover { background: var(--risk-soft); }
.btn.sm, .btn-ghost.sm, .btn-danger.sm, .btn-quiet.sm { padding: 5px 10px; font-size: 12.5px; }
.btn svg, .btn-ghost svg, .btn-quiet svg { width: 16px; height: 16px; }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .lbl { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field .help { font-size: 12px; color: var(--muted); }
input[type=text], input[type=number], input[type=password], input[type=date], input[type=search], input:not([type]), select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--r-ctl); background: var(--white); font-size: 14px; min-width: 0;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 3px rgba(84, 37, 128, .14); }
input:disabled, select:disabled, textarea:disabled { background: var(--paper); color: var(--ink-2); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid .span2 { grid-column: span 2; }
@media (max-width: 600px) { .form-grid .span2 { grid-column: 1 / -1; } }
.form-sec { padding: 16px 0; border-top: 1px solid var(--line); }
.form-sec:first-child { border-top: 0; padding-top: 0; }
.form-sec > h3 { font-family: var(--f-display); font-size: 13.5px; font-weight: 600; margin: 0 0 4px; color: var(--violet-ink); }
.form-sec > .hint { margin: 0 0 12px; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; padding: 3px 0; cursor: pointer; }
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--violet); flex: none; }
.time-sel { display: flex; align-items: center; gap: 4px; }
.time-sel select { width: auto; min-width: 64px; }

.seg-ctl { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; background: var(--white); flex-wrap: wrap; gap: 2px; }
.seg-ctl button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--ink-2); }
.seg-ctl button.on { background: var(--violet); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; border: 1px solid var(--line-2); background: var(--white); cursor: pointer; color: var(--ink-2); }
.chip.on { background: var(--lilac); border-color: var(--violet); color: var(--violet-ink); }
.chip .x { font-weight: 700; opacity: .6; }

.scale5 { display: flex; gap: 6px; flex-wrap: wrap; }
.scale5 button { min-width: 44px; padding: 7px 10px; border: 1px solid var(--line-2); background: var(--white); border-radius: 9px; cursor: pointer; font-size: 13px; text-align: center; }
.scale5 button b { display: block; font-family: var(--f-display); font-size: 15px; }
.scale5 button span { font-size: 11px; color: var(--muted); }
.scale5 button.on { border-color: var(--violet); background: var(--lilac); }

/* ---------- метки статусов ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--lilac); color: var(--violet-ink); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.watch { background: var(--watch-soft); color: var(--watch); }
.tag.risk { background: var(--risk-soft); color: var(--risk); }
.tag.info { background: var(--info-soft); color: var(--info); }
.tag.mute { background: #EEECF1; color: var(--muted); }
.tag.gold { background: var(--gold-soft); color: #7A5600; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.ok { background: var(--ok); } .dot.watch { background: var(--watch); } .dot.risk { background: var(--risk); } .dot.mute { background: var(--lilac-3); }

.prio { font-family: var(--f-display); font-weight: 700; font-size: 11px; width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 6px; }
.prio.A { background: var(--risk); color: #fff; } .prio.B { background: var(--watch-soft); color: var(--watch); border: 1px solid #F1CF9B; } .prio.C { background: var(--lilac); color: var(--violet-ink); }

/* ---------- таблицы ---------- */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--white); position: sticky; top: 0; }
table.tbl td { padding: 9px 10px; border-bottom: 1px solid #F0ECF5; vertical-align: top; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tr.click { cursor: pointer; }
table.tbl tr.click:hover td { background: #FAF8FC; }
table.tbl td.num, table.tbl th.num { text-align: right; white-space: nowrap; }
table.tbl tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
table.tbl .sub { font-size: 12px; color: var(--muted); }
table.tbl tr.drill > td { background: #FBFAFD; padding: 14px 16px; }

.bar { height: 6px; border-radius: 4px; background: #EEE9F4; overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: var(--violet); border-radius: 4px; }
.bar.ok > i { background: var(--ok); } .bar.watch > i { background: var(--watch); } .bar.risk > i { background: var(--risk); }

/* ---------- мероприятия: строки ---------- */
.ev-list { display: flex; flex-direction: column; gap: 8px; }
.ev {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: start;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; position: relative;
}
.ev::before { content: ''; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--lilac-3); }
.ev.s-reported::before { background: var(--ok); } .ev.s-overdue::before { background: var(--risk); } .ev.s-cancelled::before { background: #B8B0C2; } .ev.s-revision::before { background: var(--watch); }
.ev .t { font-family: var(--f-display); font-weight: 600; font-size: 15px; color: var(--violet-ink); }
.ev .t small { display: block; font-family: var(--f-body); font-weight: 400; font-size: 12px; color: var(--muted); }
.ev .title { font-weight: 600; font-size: 14.5px; }
.ev .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.ev .meta span { display: inline-flex; gap: 4px; align-items: center; }
.ev .side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ev .people { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }

.iem { display: inline-flex; align-items: baseline; gap: 4px; font-family: var(--f-display); font-weight: 700; font-size: 18px; }
.iem small { font-family: var(--f-body); font-size: 11.5px; font-weight: 500; color: var(--muted); }
.iem.hi { color: var(--ok); } .iem.mid { color: var(--watch); } .iem.lo { color: var(--risk); }

/* ---------- округа ---------- */
.ok-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; }
.ok-tile { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 12px; cursor: pointer; text-align: left; position: relative; display: flex; flex-direction: column; gap: 8px; }
.ok-tile:hover { border-color: var(--lilac-3); box-shadow: 0 6px 18px rgba(36, 16, 61, .07); }
.ok-tile .top { display: flex; align-items: center; gap: 8px; }
.ok-tile .num { font-family: var(--f-display); font-weight: 700; font-size: 28px; line-height: 1; color: var(--violet-ink); }
.ok-tile .num small { font-size: 12px; font-weight: 500; color: var(--muted); margin-right: 2px; }
.ok-tile .who { font-size: 12px; color: var(--ink-2); line-height: 1.3; min-height: 31px; }
.ok-tile .line { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.ok-tile .line b { color: var(--ink); font-weight: 600; }
.ok-tile.st-risk { border-color: #EBC2BC; background: linear-gradient(0deg, #FFF9F8, #FFF9F8); }
.ok-tile.st-watch { border-color: #F1D7AE; }
.ok-tile .state { margin-left: auto; font-size: 11.5px; padding: 2px 7px; }

.passport-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; }
.passport-num { font-family: var(--f-display); font-weight: 700; font-size: 54px; line-height: .9; color: var(--violet); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }

/* ---------- сигналы ---------- */
.signals { display: flex; flex-direction: column; }
.signal { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid #F0ECF5; font-size: 13px; }
.signal:last-child { border-bottom: 0; }
.signal .dot { margin-top: 6px; }
.signal b { font-weight: 600; }
.signal .go { font-size: 12.5px; }

/* ---------- фото ---------- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 4 / 3; border-radius: 9px; overflow: hidden; background: var(--lilac); border: 1px solid var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo .del { position: absolute; top: 4px; right: 4px; background: rgba(30, 21, 40, .7); color: #fff; border: 0; border-radius: 6px; width: 24px; height: 24px; cursor: pointer; font-weight: 700; }
.photo.uploading::after { content: attr(data-p); position: absolute; inset: 0; display: grid; place-items: center; background: rgba(239, 232, 247, .85); font-weight: 600; color: var(--violet-ink); font-size: 13px; }
.drop { display: block; border: 1.5px dashed var(--lilac-3); border-radius: 12px; padding: 14px; text-align: center; color: var(--ink-2); background: #FCFBFE; cursor: pointer; font-size: 13px; }
.drop svg { width: 20px; height: 20px; vertical-align: -5px; margin-right: 6px; }
.drop:hover, .drop.over { border-color: var(--violet); background: var(--lilac); }
.gallery-day { margin-bottom: 18px; }

/* ---------- выдвижная панель и диалоги ---------- */
.scrim { position: fixed; inset: 0; background: rgba(30, 21, 40, .42); z-index: 60; display: flex; justify-content: flex-end; }
.drawer { background: var(--paper); width: min(860px, 100%); height: 100%; overflow-y: auto; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; animation: slidein .18s ease-out; }
@keyframes slidein { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { position: sticky; top: 0; z-index: 2; background: var(--white); border-bottom: 1px solid var(--line); padding: 14px 22px; display: flex; gap: 12px; align-items: flex-start; }
.drawer-head h2 { font-family: var(--f-display); font-size: 16px; font-weight: 600; margin: 0; color: var(--violet-ink); }
.drawer-head .hint { margin-top: 3px; }
.drawer-head .close { margin-left: auto; }
.drawer-body { padding: 18px 22px 30px; flex: 1; }
.drawer-foot { position: sticky; bottom: 0; background: var(--white); border-top: 1px solid var(--line); padding: 12px 22px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.scrim.center { justify-content: center; align-items: center; padding: 16px; }
.dialog { background: var(--white); border-radius: 16px; width: min(480px, 100%); padding: 22px; box-shadow: var(--shadow-pop); }
.dialog h3 { font-family: var(--f-display); font-size: 16px; margin: 0 0 8px; color: var(--violet-ink); }
.dialog .row { justify-content: flex-end; margin-top: 16px; }
.lightbox { position: fixed; inset: 0; background: rgba(20, 12, 30, .92); z-index: 90; display: grid; place-items: center; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: 8px; }
.lightbox .cap { color: #EDE5F7; text-align: center; margin-top: 10px; font-size: 13px; }

.toast-host { position: fixed; right: 18px; top: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--violet-deep); color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 13.5px; box-shadow: var(--shadow-pop); max-width: 420px; }
.toast.err { background: var(--risk); }

.banner { border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.banner.info { background: var(--info-soft); color: #1F4580; }
.banner.warn { background: var(--watch-soft); color: #6F4300; }
.banner.risk { background: var(--risk-soft); color: #7D2017; }
.banner.gold { background: var(--gold-soft); color: #5E4300; }
.banner b { font-weight: 600; }

.empty { text-align: center; padding: 34px 16px; color: var(--ink-2); }
.empty h3 { font-family: var(--f-display); font-size: 15px; color: var(--violet-ink); margin: 0 0 6px; }

/* ---------- выбор даты ---------- */
.dp { display: inline-flex; align-items: center; gap: 4px; position: relative; flex-wrap: wrap; }
.dp > button { border: 1px solid var(--line-2); background: var(--white); border-radius: 9px; cursor: pointer; padding: 7px 10px; font-size: 13.5px; }
.dp > button:hover { background: var(--lilac); }
.dp .dp-label { font-weight: 600; color: var(--violet-ink); min-width: 210px; }
.dp-cal { position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: var(--shadow-pop); width: 300px; max-width: calc(100vw - 40px); }
.dp-cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 600; color: var(--violet-ink); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-grid .wd { font-size: 11px; color: var(--muted); text-align: center; padding: 4px 0; }
.dp-day { position: relative; text-align: center; padding: 7px 0; border-radius: 7px; cursor: pointer; font-size: 13px; border: 0; background: transparent; }
.dp-day:hover { background: var(--lilac); }
.dp-day.other { visibility: hidden; }
.dp-day.today { outline: 1.5px solid var(--gold); }
.dp-day.sel { background: var(--violet); color: #fff; }
.dp-day.agit { box-shadow: inset 0 -2px 0 var(--lilac-3); }
.dp-day.sil, .dp-day.vote { color: #8A6300; font-weight: 600; }
.dp-day .d { position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--violet); }
.dp-day.sel .d { background: #fff; }

/* ---------- подсказки выбора людей ---------- */
.ms { position: relative; }
.ms .sel { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop); max-height: 240px; overflow-y: auto; margin-top: 4px; }
.suggest div { padding: 8px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #F3F0F7; }
.suggest div:hover, .suggest div.hl { background: var(--lilac); }
.suggest div small { display: block; color: var(--muted); font-size: 11.5px; }

/* ---------- сетевой график (диаграмма Ганта) ---------- */
.gantt { overflow-x: auto; }
.gantt-grid { display: grid; min-width: 980px; }
.g-row { display: contents; }
.g-label { padding: 7px 12px 7px 0; font-size: 13px; border-bottom: 1px solid #F0ECF5; display: flex; gap: 8px; align-items: center; position: sticky; left: 0; background: var(--white); z-index: 1; }
.g-label .own { font-size: 11.5px; color: var(--muted); display: block; font-weight: 400; }
.g-label > button, .g-label > span { white-space: normal; text-align: left; line-height: 1.3; display: block; width: 100%; font-weight: 500; }
.g-label .dot { margin-right: 6px; vertical-align: 1px; }
.g-cells { position: relative; border-bottom: 1px solid #F0ECF5; }
.g-bar { position: absolute; top: 8px; height: 16px; border-radius: 5px; background: var(--lilac-3); }
.g-bar.doing { background: var(--violet); } .g-bar.done { background: var(--ok); } .g-bar.risk { background: var(--risk); }
.g-head { font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--line); position: relative; height: 26px; }
.g-head span { position: absolute; top: 6px; transform: translateX(-50%); white-space: nowrap; }
.g-phase { grid-column: 1 / -1; font-family: var(--f-display); font-size: 12.5px; font-weight: 600; color: var(--violet-ink); padding: 12px 0 4px; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--gold); }
.g-phase-band { position: absolute; top: 0; bottom: 0; background: rgba(84, 37, 128, .05); }

/* ---------- вход ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); }
.login-art { background: var(--violet-deep); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art img { width: 210px; border-radius: 4px; }
.login-art h1 { font-family: var(--f-display); font-weight: 600; font-size: 34px; line-height: 1.15; margin: 0 0 14px; max-width: 16ch; }
.login-art p { color: #CDBFE0; max-width: 46ch; margin: 0; }
.login-dates { display: grid; grid-template-columns: repeat(3, auto); gap: 18px 28px; margin-top: 30px; }
.login-dates div { font-size: 12.5px; color: #B7A6CF; }
.login-dates b { display: block; font-family: var(--f-display); font-size: 17px; color: #fff; font-weight: 600; }
.login-dates .gold b { color: var(--gold); }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-family: var(--f-display); font-size: 20px; margin: 0 0 18px; color: var(--violet-ink); }
.login-card .field { margin-bottom: 14px; }

/* ---------- методика ---------- */
.doc { max-width: 80ch; }
.doc h2 { font-family: var(--f-display); font-size: 17px; color: var(--violet-ink); margin: 28px 0 8px; }
.doc h2:first-child { margin-top: 0; }
.doc p, .doc li { font-size: 14.5px; line-height: 1.6; text-align: justify; }
.doc table.tbl { margin: 10px 0 16px; }
.formula { background: var(--lilac); border-radius: 10px; padding: 10px 14px; font-size: 13.5px; margin: 8px 0 14px; }

.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 340px; }
.chart-box.short { height: 200px; }

/* ---------- мини-отчёт (печать) ---------- */
.mini { background: var(--white); max-width: 900px; margin: 0 auto; padding: 28px 32px; border-radius: 14px; }
.mini-head { display: flex; align-items: center; gap: 16px; border-bottom: 3px solid var(--violet); padding-bottom: 12px; margin-bottom: 16px; }
.mini-head img { height: 44px; border-radius: 3px; }
.mini-head h1 { font-family: var(--f-display); font-size: 18px; margin: 0; color: var(--violet-ink); }
.mini .photos { grid-template-columns: repeat(3, 1fr); }
.mini h3 { font-family: var(--f-display); font-size: 13.5px; color: var(--violet-ink); margin: 18px 0 6px; }
.mini p { margin: 0 0 6px; text-align: justify; }

@media print {
  body { background: #fff; }
  body.printing > *:not(.print-root) { display: none !important; }
  .print-root { position: static !important; background: #fff !important; display: block !important; }
  .print-root .drawer-head, .print-root .drawer-foot, .no-print { display: none !important; }
  .print-root .drawer { width: 100%; box-shadow: none; height: auto; overflow: visible; animation: none; }
  .mini { padding: 0; }
  .photo img { cursor: default; }
}

/* адаптив: см. блок «Телефон и планшет» в конце файла */

/* ---------- пользователи, профиль, журнал ---------- */
.rail-foot .who { display: block; width: 100%; flex: none; text-align: left; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); border-radius: 10px; padding: 9px 11px; cursor: pointer; color: #D9CDEA; line-height: 1.35; }
.rail-foot .who:hover { background: rgba(255, 255, 255, .14); }
.rail-foot .who b { font-size: 13px; overflow-wrap: anywhere; }
.rail-foot .who span { display: block; font-size: 12px; color: #B9A9D0; }
.rail-foot .who .scope { margin-top: 2px; font-size: 11.5px; color: #9E8CB8; }
.btn-quiet.danger { color: var(--risk); }
.btn-quiet.danger:hover { background: var(--risk-soft); }
.av { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; font-size: 12.5px; font-weight: 700; letter-spacing: .3px; background: var(--lilac); color: var(--violet-ink); }
.av.admin { background: var(--gold-soft); color: #7A5600; }
.av.filial { background: var(--info-soft); color: var(--info); }
.av.observer { background: #EEECF1; color: var(--muted); }
.uc { display: flex; gap: 11px; align-items: center; min-width: 210px; }
.uc.big .av { width: 52px; height: 52px; font-size: 16px; }
.uc .sub { font-size: 12px; color: var(--muted); }
.uc code, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: #F3F0F7; border-radius: 5px; padding: 1px 5px; color: var(--ink-2); }
.us-tbl td { vertical-align: middle; }
.us-tbl tr.off td { opacity: .62; }
.us-tbl .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.us-tbl .chips-s { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 3px; }
.us-tbl .sc-k { font-size: 12px; color: var(--ink-2); }
.us-tbl .sc-k.mute { color: var(--muted); }
.us-act { white-space: nowrap; text-align: right; }
.us-act .btn-quiet.sm, .us-act .btn-ghost.sm { padding: 5px 8px; }
.role-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.role-card { text-align: left; background: var(--white); border: 1.5px solid var(--line-2); border-radius: 12px; padding: 11px 13px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.role-card b { font-size: 13.5px; color: var(--violet-ink); }
.role-card span { font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.role-card:hover:not(:disabled) { border-color: var(--lilac-3); background: #FBFAFD; }
.role-card.on { border-color: var(--violet); background: var(--lilac); box-shadow: 0 0 0 1px var(--violet) inset; }
.role-card:disabled { cursor: not-allowed; opacity: .55; }
.ok-groups { display: grid; gap: 8px; }
.okg { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: start; }
.okg > .btn-quiet { text-align: left; justify-content: flex-start; font-weight: 600; }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.perm-grid h4 { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.check.perm { border-bottom: 1px solid #F0ECF5; padding: 7px 0; }
.check.perm span b { display: block; font-weight: 500; font-size: 13.5px; }
.check.perm .hint { display: block; font-size: 12px; line-height: 1.35; }
.check.perm.off { opacity: .45; cursor: not-allowed; }
.cred { display: grid; gap: 10px; background: var(--lilac); border: 1px solid var(--lilac-2); border-radius: 12px; padding: 14px 16px; margin-top: 10px; }
.cred > div { display: flex; flex-direction: column; gap: 3px; }
.cred code { font-size: 15px; padding: 4px 8px; background: var(--white); user-select: all; }
.dialog .row .spacer { flex: 1; }
.au-d { max-width: 520px; overflow-wrap: anywhere; color: var(--ink-2); }
.grid2 > .panel + .panel { margin-top: 0; }
.mt-xs { margin-top: 4px; }
.nw { white-space: nowrap; }
.ue-sum { flex: 1; min-width: 0; }

/* ============================================================
   Общие элементы упрощённых форм и экрана «Сегодня»
   ============================================================ */
.riskc { color: var(--risk); font-weight: 600; } .okc { color: var(--ok); font-weight: 600; }
h2.sec .cnt { display: inline-block; margin-left: 6px; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--risk-soft); color: var(--risk); font-family: var(--f-body); font-size: 12.5px; font-weight: 700; text-align: center; vertical-align: 2px; }

.today-top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.today-top h1 { font-family: var(--f-display); font-weight: 600; font-size: 22px; margin: 0; color: var(--violet-ink); }
.today-top .td-date { color: var(--ink-2); font-size: 14px; }
.today-sum { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); margin-bottom: 14px; }
.today-sum b { color: var(--ink); }
.today-acts { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }

.count-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 4px 2px 10px; font-size: 14px; }
.panel.filters { display: flex; gap: 12px 18px; align-items: flex-end; flex-wrap: wrap; }
.panel.filters .fsel { display: flex; gap: 12px; flex-wrap: wrap; }
.panel.filters .fsel .field { min-width: 190px; }
.panel.filters .week { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.panel.filters .week .chip { padding: 5px 11px; }
.panel.filters .dl { width: 100%; }
.panel.filters .seg-ctl.scroll { max-width: 100%; }
.seg-ctl button b { margin-left: 3px; font-weight: 700; }

/* раскрывающиеся блоки форм */
.acc { border: 1px solid var(--line); border-radius: 12px; background: var(--white); margin-top: 10px; }
.acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 13px 14px; min-height: 48px; font-weight: 600; font-size: 14px; color: var(--violet-ink); }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::after { content: ''; flex: none; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.acc[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.acc > summary .acc-n { font-style: normal; font-weight: 400; font-size: 12.5px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc[open] > summary { border-bottom: 1px solid var(--line); }
.acc-b { padding: 14px; }
.acc.hidden { display: none; }
.rsec { margin: 18px 0 16px; }
.rsec-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; font-size: 14px; }
.goal { background: var(--lilac); border-radius: 10px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px; color: var(--ink-2); }
.goal .lbl { font-weight: 600; color: var(--violet-ink); }
.more-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.del-row { margin-top: 18px; }
.r-iem { flex: 1; min-width: 0; }
.form-grid.pf .field.wide { grid-column: 1 / -1; }
.drop { display: flex; align-items: center; justify-content: center; gap: 8px; }
.photos { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.warn-line { flex: 1; min-width: 0; }

/* ============================================================
   Телефон и планшет
   ============================================================ */
@media (min-width: 901px) { .tabbar, .rail-scrim { display: none; } }
@media (max-width: 1100px) {
  .grid3 { grid-template-columns: 1fr 1fr; }
  .grid-7-5 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .rail { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); z-index: 75; transform: translateX(-100%); transition: transform .2s; }
  .rail.open { transform: none; box-shadow: var(--shadow-pop); }
  .rail-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(30, 21, 40, .45); opacity: 0; pointer-events: none; transition: opacity .2s; display: block; }
  body.rail-open .rail-scrim { opacity: 1; pointer-events: auto; }
  .rail-brand { padding: 14px 16px 6px; flex-direction: row; align-items: center; gap: 12px; }
  .rail-brand img { width: 84px; }
  .rail-link { padding: 12px 12px; font-size: 15px; }
  .rail-link svg { width: 20px; height: 20px; }

  .topbar { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--violet-deep); color: #fff; position: sticky; top: 0; z-index: 25; min-height: 52px; }
  .topbar img { height: 24px; border-radius: 3px; }
  .topbar .t { flex: 1; font-family: var(--f-display); font-weight: 600; font-size: 15px; color: #fff; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar button { width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; font-size: 12.5px; font-weight: 700; display: grid; place-items: center; }

  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--white); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -6px 20px rgba(36, 16, 61, .06); }
  .tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; padding: 6px 2px; border: 0; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 500; cursor: pointer; }
  .tab svg { width: 23px; height: 23px; }
  .tab.active { color: var(--violet); font-weight: 700; }
  .tab.active::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--violet); }
  .tab .count { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 17px; padding: 0 5px; border-radius: 9px; background: var(--risk); color: #fff; font-style: normal; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; }

  /* календарь кампании: одна строка, только на экранах «Сегодня» и «Обзор» */
  body:not([data-tab="today"]):not([data-tab="dashboard"]) #strip-host { display: none; }
  .strip { position: static; padding: 10px 16px 12px; }
  .strip-head { gap: 4px 12px; margin-bottom: 4px; align-items: center; flex-wrap: nowrap; justify-content: space-between; }
  .strip-phase { font-size: 14px; min-width: 0; }
  .strip-meta { display: none; }
  .strip-count { gap: 6px; }
  .strip-count .n { font-size: 20px; }
  .strip-count { margin-left: 0; flex: none; }
  .strip-count .l { font-size: 11px; max-width: 82px; line-height: 1.15; }
  .strip-count .dt { display: none; }
  .track { height: 8px; }
  .track .seg { font-size: 0; padding: 0; }
  .track .today::after { display: none; }
  .track .today { top: -3px; bottom: -3px; }
  .track-scale { display: none; }

  .content { padding: 14px 14px calc(78px + env(safe-area-inset-bottom)); }
  .m-hide { display: none !important; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .grid-7-5 > :last-child { order: -1; }
  .passport-head { grid-template-columns: auto 1fr; }
  .passport-head > :last-child { grid-column: 1 / -1; }
  .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger .cell { border-left: 0; border-top: 1px solid var(--line); padding: 11px 14px; }
  .ledger .cell:nth-child(-n+2) { border-top: 0; }
  .ledger .cell:nth-child(even) { border-left: 1px solid var(--line); }
  .ledger .v { font-size: 20px; }
  .ledger .cell:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .login { grid-template-columns: 1fr; min-height: 100dvh; }
  .login-art { padding: 22px 20px; gap: 14px; }
  .login-art img { width: 120px; }
  .login-art h1 { font-size: 21px; margin: 0; max-width: none; }
  .login-art p, .login-dates, .login-art .hint { display: none; }
  .login-form { align-items: flex-start; padding: 22px 20px 32px; }
  .toast-host { left: 12px; right: 12px; top: calc(10px + env(safe-area-inset-top)); bottom: auto; }
  .toast { max-width: none; }
  .lightbox { padding: 10px; }

  /* выдвижная панель: во весь экран */
  .drawer { width: 100% !important; animation: none; }
  .drawer-head { padding: 10px 12px 10px 14px; align-items: center; }
  .drawer-head h2 { font-size: 15px; line-height: 1.3; }
  .drawer-head .hint { font-size: 12px; }
  .drawer-head .close span { display: none; }
  .drawer-head .close { padding: 8px; }
  .drawer-body { padding: 14px 14px 24px; }
  .drawer-foot { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 8px; }
  .drawer-foot .btn, .drawer-foot .btn-ghost { width: 100%; min-height: 50px; font-size: 16px; }
  .drawer-foot .note, .drawer-foot .hint { font-size: 12.5px; }
  .drawer-foot .spacer, .drawer-foot [data-x] { display: none; }
  .scrim.center { align-items: flex-end; padding: 0; }
  .dialog { width: 100%; border-radius: 18px 18px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); }
  .dialog .row { flex-direction: column-reverse; align-items: stretch; }
  .dialog .row .btn, .dialog .row .btn-ghost, .dialog .row .btn-danger { width: 100%; }

  /* выбор даты: нижний лист */
  .dp { display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px auto; width: 100%; gap: 6px; }
  .dp > button { min-height: 44px; padding: 7px 8px; }
  .dp .dp-label { min-width: 0; text-align: center; font-size: 14.5px; }
  .dp-cal { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); top: auto; width: auto; max-width: none; z-index: 120; padding: 14px; }
  .dp-day { padding: 11px 0; font-size: 15px; }
}

@media (max-width: 700px) {
  body { font-size: 15px; }
  .page-head { margin-bottom: 12px; gap: 10px; }
  .page-head h1 { font-size: 19px; }
  .page-head .lead { display: none; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .page-head .actions > * { flex: 1 1 auto; }
  .page-head .actions .btn { flex-basis: 100%; }
  h2.sec { font-size: 14.5px; margin: 18px 0 10px; }
  .panel { padding: 14px; border-radius: 12px; }
  .panel + .panel { margin-top: 12px; }

  /* крупные поля и кнопки */
  input[type=text], input[type=number], input[type=password], input[type=date], input[type=search], input:not([type]), select, textarea { font-size: 16px; min-height: 46px; padding: 10px 12px; }
  textarea { min-height: 76px; }
  .btn, .btn-ghost, .btn-danger { min-height: 46px; padding: 11px 16px; font-size: 15px; }
  .btn.sm, .btn-ghost.sm, .btn-danger.sm { min-height: 44px; padding: 10px 14px; font-size: 14.5px; }
  .btn-quiet { min-height: 40px; }
  .btn-quiet.sm { min-height: 40px; padding: 8px 10px; font-size: 14px; }
  .field > label, .lbl { font-size: 13px; }
  .field .help { font-size: 12.5px; }
  .check { padding: 8px 0; font-size: 14.5px; gap: 10px; }
  .check input { width: 22px; height: 22px; margin-top: 0; }
  .chip { padding: 8px 13px; font-size: 14px; }
  .form-grid, .form-grid.pf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .form-grid .wide, .form-grid .span2 { grid-column: 1 / -1; }
  .time-sel select { min-width: 0; flex: 1; }
  .time-sel { width: 100%; }

  /* кнопки статуса и фильтры */
  .panel.filters { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 12px; }
  .panel.filters .fsel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .panel.filters .fsel .field { min-width: 0; }
  .panel.filters .fsel .field:only-child { grid-column: 1 / -1; }
  .panel.filters .week, .seg-ctl.scroll { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 -14px; padding: 2px 14px; width: auto; }
  .seg-ctl.scroll button { flex: none; white-space: nowrap; }
  .panel.filters .week .chip { flex: none; padding: 8px 12px; }
  .seg-ctl { max-width: 100%; border: 0; background: none; padding: 0; gap: 6px; }
  .seg-ctl button { padding: 9px 14px; font-size: 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--white); }
  .seg-ctl button.on { background: var(--violet); border-color: var(--violet); color: #fff; }

  /* карточка мероприятия */
  .ev { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 12px 14px; }
  .ev .t { font-size: 13.5px; display: flex; gap: 6px; align-items: baseline; }
  .ev .t small { display: inline; font-size: 12.5px; }
  .ev .title { font-size: 15px; line-height: 1.3; }
  .ev .meta { font-size: 13px; gap: 2px 10px; }
  .ev .side { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px; margin-top: 4px; }
  .ev .side .acts { flex: 1 1 100%; display: flex; gap: 8px; }
  .ev .side .acts > * { flex: 1 1 0; }
  .ev .side:not(:has(.acts)) { margin-top: 0; }
  .iem { font-size: 16px; }
  .ev.compact .side > .tag.risk, .ev.compact .side > .iem { display: none; }
  .ev.compact .side { margin-top: 6px; }

  /* фото и настроение в отчёте */
  .drop { background: var(--violet); color: #fff; border: 0; border-radius: 12px; padding: 15px; font-size: 16px; font-weight: 600; }
  .drop:hover, .drop.over { background: var(--violet-700); }
  .drop svg { width: 24px; height: 24px; margin: 0; vertical-align: 0; }
  .photos { grid-template-columns: repeat(3, 1fr); }
  .photo .del { width: 30px; height: 30px; font-size: 18px; }
  .scale5 { flex-wrap: nowrap; gap: 6px; }
  .scale5 button { flex: 1 1 0; min-width: 0; min-height: 50px; padding: 8px 2px; }
  .scale5 button span { display: none; }
  .scale5 button b { font-size: 18px; }
  .r-iem .hint { display: none; }
  .r-iem { display: flex; align-items: center; justify-content: center; }
  .more-actions .btn-ghost, .more-actions .btn-quiet { flex: 1; }
  .del-row .btn-danger { width: 100%; }

  /* экран «Сегодня» */
  .today-top h1 { display: none; }
  .today-top .td-date { font-family: var(--f-display); font-weight: 600; font-size: 18px; color: var(--violet-ink); display: inline-block; }
  .today-top .td-date::first-letter { text-transform: uppercase; }
  body:not([data-tab="dashboard"]):not([data-tab="okrug"]):not([data-tab="eday"]) .page-head h1 { display: none; }
  body:not([data-tab="dashboard"]):not([data-tab="okrug"]):not([data-tab="eday"]) .page-head:not(:has(.actions)) { display: none; }
  body:not([data-tab="dashboard"]):not([data-tab="okrug"]):not([data-tab="eday"]) .page-head { margin-bottom: 10px; }
  .today-acts { flex-direction: column; margin-bottom: 14px; }
  .today-acts > * { width: 100%; }

  /* таблицы: строка превращается в карточку; широкие матрицы прокручиваются */
  table.tbl.cards, table.tbl.cards tbody, table.tbl.cards tr, table.tbl.cards td { display: block; width: 100%; }
  table.tbl.cards tr.hd { display: none; }
  table.tbl.cards tr { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
  table.tbl.cards td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 5px 0; border: 0; text-align: right; font-size: 14px; }
  table.tbl.cards td::before { content: attr(data-l); flex: none; max-width: 46%; text-align: left; color: var(--muted); font-size: 12.5px; }
  table.tbl.cards td[data-t] { display: block; text-align: left; font-weight: 600; font-size: 15px; padding: 3px 0 6px; }
  table.tbl.cards td[data-t]::before { display: none; }
  table.tbl.cards td.void { display: none; }
  table.tbl.cards td.num { white-space: normal; }
  table.tbl.cards tr.span-row { border: 0; background: transparent; padding: 0; margin: -4px 0 8px; }
  table.tbl.cards tr.span-row td { display: block; text-align: left; padding: 0; }
  table.tbl.cards tr.span-row td::before { display: none; }
  table.tbl.cards tr.drill { margin-top: -4px; }
  table.tbl.cards tr.drill > td { padding: 10px 0 0; background: transparent; }
  table.tbl.cards tr.total { background: var(--lilac); }
  table.tbl.cards tr.click:hover td { background: transparent; }
  table.tbl.cards td .btn-quiet, table.tbl.cards td .btn-ghost { margin-left: auto; }
  table.tbl tr.cap-hide, .ev-list > .cap-hide { display: none !important; }
  .more-btn { display: flex; width: 100%; margin-top: 4px; }
  .more-btn.hidden { display: none; }
  table.tbl.cards td[data-l=""]::before { display: none; }
  table.tbl.cards td[data-l=""] { position: absolute; top: 6px; right: 6px; width: auto; padding: 0; }
  table.tbl.cards tr { position: relative; }
  table.tbl.cards td[data-t]:not(:last-child) { padding-right: 36px; }
  table.tbl.cards .bar { min-width: 90px; flex: 1; }
  table.tbl th { position: static; }
  table.tbl:not(.cards) td:first-child, table.tbl:not(.cards) th:first-child { position: sticky; left: 0; z-index: 1; background: var(--white); box-shadow: 1px 0 0 var(--line); max-width: 140px; }
  table.tbl:not(.cards) { font-size: 13px; }

  .row > .field { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .row > .field select, .row > .field input:not([type=checkbox]) { width: 100%; max-width: none; }
  .dec-row input { flex: 1 1 100%; max-width: none !important; }
  .dec-row .btn, .dec-row .btn-danger { flex: 1 1 0; }
  .panel .row { gap: 10px; }
  .perm-grid { grid-template-columns: 1fr; }
  .okg { grid-template-columns: 1fr; gap: 4px; }
  .us-act { white-space: normal; text-align: left; }
  .ue-sum { flex-basis: 100%; order: -1; font-size: 12px; }
  .ok-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .doc p, .doc li { text-align: left; font-size: 15px; }
  .chart-box { height: 220px; }
  .chart-box.tall { height: 280px; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dt { margin-top: 8px; }
  .gantt-grid { min-width: 760px; }
}

.more-btn { display: none; }
/* группы по филиалам: на телефоне свёрнуты */
.grp > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 18px; min-height: 52px; }
.grp > summary::-webkit-details-marker { display: none; }
.grp > summary h2 { margin: 0; }
.grp > summary .note { margin-left: auto; text-align: right; }
.grp > summary::after { content: ''; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.grp[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.grp[open] > summary { padding-bottom: 8px; }
@media (max-width: 700px) { .grp > summary { padding: 12px 14px; } .grp > .tbl-wrap { padding: 0 10px 6px; } }

.fl-row { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; width: 100%; padding: 13px 16px; border: 0; border-bottom: 1px solid #F0ECF5; background: var(--white); text-align: left; cursor: pointer; font-size: 14px; color: var(--ink-2); min-height: 52px; }
.fl-row:last-child { border-bottom: 0; }
.fl-row:hover { background: #FAF8FC; }
.fl-row b { color: var(--ink); min-width: 110px; }
.fl-row .tag { margin-left: auto; }

/* свёрнутые на телефоне блоки */
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: 32px; font-family: var(--f-display); font-weight: 600; font-size: 14.5px; color: var(--ink); }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: ''; flex: none; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
details.fold[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
details.fold[open] > summary { margin-bottom: 12px; }
details.fold.panel + details.fold.panel, details.fold.panel + .panel, .panel + details.fold.panel { margin-top: 10px; }
