:root {
  --brand: #2E6C5F; --brand-dark: #23564B; --brand-soft: #E7F1EE;
  --accent: #F5C25C; --accent-dark: #E9B13F; --on-accent: #1B3B34;
  --bg: #F5F6FA; --surface: #fff; --subtle: #F1F3F8; --border: #E5E7EF;
  --text: #0F172A; --muted: #64748B;
  --red: #DC2626; --red-soft: #FEE2E2; --amber: #B45309; --amber-soft: #FEF3C7;
  --green: #15803D; --green-soft: #DCFCE7; --gray: #475569; --gray-soft: #EEF1F5;
  --purple: #7C3AED; --purple-soft: #F1EAFE;
  --surface-solid: #fff; --input: #fff;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1 { font-size: 24px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.hidden { display: none !important; }

/* Layout */
.layout { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 240px; max-width: 100%; background: var(--brand); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 20px; }
.brand img { width: 44px; height: 44px; border-radius: 10px; }
.brand b { display: block; font-size: 16px; }
.brand span { font-size: 12px; color: var(--accent); }
.nav { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: rgba(255,255,255,.85); text-decoration: none; font-weight: 500; }
.nav:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav.on { background: rgba(255,255,255,.15); color: #fff; font-weight: 600; }
.nav.on svg { color: var(--accent); }
.nav .count { margin-left: auto; background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; font-weight: 600; }
.side .spacer { flex: 1 1 auto; min-height: 20px; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; border-top: 1px solid rgba(255,255,255,.18); color: #fff; text-decoration: none; }
.me:hover { color: #fff; }
.me .av { background: var(--accent); color: var(--on-accent); }
.main { flex: 999 1 560px; min-width: 0; padding: 28px 32px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 820px) {
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; }
  .brand { padding: 0 8px 0 0; } .brand div { display: none; }
  .side .spacer, .me div { display: none; } .me { border: 0; padding: 0; }
  .nav { padding: 8px 10px; } .nav span.lbl { display: none; }
  .main { padding: 18px 14px; }
}

/* Company switcher */
.co-switch { margin: 0 4px 14px; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.1); color: #fff; font-weight: 600; }
.co-switch option { color: var(--text); }
.co-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.co-card { text-align: left; display: block; padding: 14px 16px; }
.co-card:hover { border-color: var(--brand); }
.dict-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; align-items: start; }
.icon-btn:disabled { opacity: .3; cursor: default; }
@media (max-width: 820px) { .co-switch { margin: 0; order: 10; flex: 1 1 100%; } }

/* Elements */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-solid); font-weight: 600; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { background: var(--subtle); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-dark); }
.btn.green { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.green:hover { background: var(--brand-dark); }
.btn.danger { color: var(--red); }
.btn.sm { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.link { border: 0; background: none; color: var(--brand); font-weight: 600; padding: 4px 0; }
.icon-btn { width: 32px; height: 32px; border: 0; border-radius: 6px; background: none; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.icon-btn:hover { background: var(--subtle); color: var(--text); }
.inp, select.inp, textarea.inp { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--input); }
.inp:focus, .ed:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
textarea.inp { min-height: 80px; resize: vertical; line-height: 1.5; }
label.lbl, .lbl { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.av { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.av.sm { width: 24px; height: 24px; font-size: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.s-analysis { color: var(--purple); background: var(--purple-soft); }
.s-new { color: var(--gray); background: var(--gray-soft); }
.s-progress { color: var(--brand); background: var(--brand-soft); }
.s-review { color: var(--amber); background: var(--amber-soft); }
.s-done { color: var(--green); background: var(--green-soft); }
.s-late { color: var(--red); background: var(--red-soft); }
.p-high { color: var(--red); background: var(--red-soft); }
.p-medium { color: var(--amber); background: var(--amber-soft); }
.p-low { color: var(--gray); background: var(--gray-soft); }
.l-office { color: var(--green); background: var(--green-soft); }
.l-meeting { color: var(--purple); background: var(--purple-soft); }
.l-trip { color: var(--amber); background: var(--amber-soft); }
.l-leave { color: var(--gray); background: var(--gray-soft); }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 8px; background: var(--subtle); }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 6px; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--surface-solid); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.empty { padding: 24px; text-align: center; color: var(--muted); }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 8px 8px 0; }
.tbl td { border-top: 1px solid var(--border); padding: 10px 8px 10px 0; vertical-align: middle; }
.scroll-x { overflow-x: auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kpi .v { font-size: 30px; font-weight: 700; margin: 6px 0; }
.cols { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.col-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.col-side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.person { display: flex; align-items: center; gap: 10px; }
.person b { font-weight: 600; display: block; }
.list { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }

/* Kanban */
.board { display: grid; grid-template-columns: repeat(5, minmax(230px, 1fr)); gap: 16px; align-items: start; }
.lane { background: var(--subtle); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.lane.drop { outline: 2px dashed var(--brand); }
.lane-h { display: flex; align-items: center; gap: 8px; padding: 4px; }
.tcard { display: block; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 10px; padding: 14px; text-decoration: none; color: inherit; }
.tcard:hover { border-color: #C9D2DF; color: inherit; box-shadow: 0 2px 8px rgba(15,23,42,.06); }
.tcard.late { border-color: var(--red); }
.tcard .t { font-weight: 600; line-height: 1.35; margin: 8px 0; }
.joint { font-size: 12px; font-weight: 500; color: var(--brand); background: var(--brand-soft); padding: 6px 8px; border-radius: 6px; margin-bottom: 8px; }

/* Task card */
.stage { display: flex; gap: 14px; padding: 14px; border-radius: 10px; border: 1px solid var(--border); }
.stage.active { border-color: var(--brand); background: #FAFCFB; }
.stage .num { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; background: var(--gray-soft); color: var(--gray); }
.stage.active .num { background: var(--brand); color: #fff; }
.stage.done .num { background: var(--green); color: #fff; }
.progress { height: 6px; border-radius: 3px; background: var(--gray-soft); margin-bottom: 16px; }
.progress > div { height: 6px; border-radius: 3px; background: var(--brand); }
.desc { line-height: 1.6; word-wrap: break-word; }
.desc ul, .desc ol, .ed ul, .ed ol { padding-left: 22px; }
.desc code, .ed code { background: var(--subtle); border-radius: 4px; padding: 1px 4px; font-size: 13px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tabs button { border: 0; background: none; padding: 8px 10px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--brand); }
.comment-body { white-space: pre-wrap; line-height: 1.5; margin-top: 4px; word-wrap: break-word; }
.mention { color: var(--brand); font-weight: 600; }

/* Editor */
.editor { border: 1px solid var(--border); border-radius: 10px; position: relative; background: var(--surface-solid); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.toolbar .sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.tb { width: 30px; height: 30px; border: 0; border-radius: 6px; background: none; color: #334155; display: inline-flex; align-items: center; justify-content: center; }
.tb:hover, .tb.on { background: var(--subtle); }
.ed { min-height: 110px; max-height: 420px; overflow: auto; padding: 12px 14px; line-height: 1.6; border-radius: 0 0 10px 10px; }
.ed:empty::before { content: attr(data-placeholder); color: var(--muted); }
.palette { position: absolute; z-index: 20; top: 44px; left: 100px; width: 336px; max-width: calc(100% - 16px); background: var(--surface-solid); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 14px; }
.swatches { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
.sw { aspect-ratio: 1; border: 1px solid rgba(0,0,0,.1); border-radius: 6px; padding: 0; font-weight: 600; font-size: 12px; }
.sw:hover { outline: 2px solid var(--text); outline-offset: 1px; }

/* Meetings */
.week { display: grid; grid-template-columns: 220px repeat(5, minmax(150px, 1fr)); min-width: 980px; }
.week > div { border-bottom: 1px solid var(--border); padding: 8px; }
.week .h { background: var(--subtle); font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 8px; }
.week .d { border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.week .today { background: #FAFCFB; }
.ev { text-align: left; width: 100%; padding: 6px 8px 6px 10px; border-radius: 6px; border: 0; border-left: 3px solid currentColor; font-size: 12px; }
.ev b { display: block; font-weight: 600; }
.ev span { color: var(--muted); font-size: 11px; }

/* Bars */
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-row .who { width: 170px; flex: none; display: flex; align-items: center; gap: 8px; }
.bar { height: 8px; border-radius: 4px; }

/* Modal & toast */
.overlay { position: fixed; inset: 0; background: rgba(20,48,42,.55); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto; z-index: 50; }
.modal { width: 680px; max-width: 100%; background: var(--surface-solid); border-radius: 16px; box-shadow: 0 16px 48px rgba(0,0,0,.2); }
.modal-h { display: flex; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.modal-b { padding: 20px 24px; }
.modal-f { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); }
.stage-row { display: grid; grid-template-columns: 26px minmax(160px, 1.2fr) minmax(150px, 1.5fr) 140px 32px; gap: 8px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--border); }
@media (max-width: 700px) { .stage-row { grid-template-columns: 26px 1fr 32px; } .stage-row .what, .stage-row .sdl { grid-column: 2 / 3; } }
.stage-no { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--subtle); font-size: 13px; }
.chip button { border: 0; background: none; color: var(--muted); padding: 0 4px; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 18px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 100; max-width: 90vw; }
#toast.show { opacity: 1; }
#toast.err { background: var(--red); }

/* Планёрка: отчёт */
.num-row { display: grid; grid-template-columns: minmax(160px, 1.2fr) minmax(110px, .8fr) minmax(160px, 1.4fr) 32px; gap: 8px; margin-bottom: 8px; }
@media (max-width: 700px) { .num-row { grid-template-columns: 1fr 1fr 32px; } .num-row input:nth-child(3) { grid-column: 1 / 3; } }
.av.xl { width: 72px; height: 72px; font-size: 24px; }

/* Планёрка: режим демонстрации */
.live { min-height: 100vh; display: flex; flex-direction: column; background: #F5F6FA; }
.live-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 20px; background: var(--brand); color: #fff; }
.live-top img { width: 40px; height: 40px; border-radius: 8px; }
.live-top b { display: block; font-size: 15px; }
.live-top span { font-size: 12px; color: var(--accent); }
.live-top .btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff; }
.live-top .btn:hover { background: rgba(255,255,255,.22); }
.live-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.dot { width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: transparent; color: rgba(255,255,255,.8); font-size: 11px; font-weight: 600; padding: 0; }
.dot.past { background: rgba(255,255,255,.18); }
.dot.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.dot.q { font-size: 14px; }
.live-clock { text-align: right; font-variant-numeric: tabular-nums; }
.live-clock span { font-size: 20px; font-weight: 700; }
.live-clock small { display: block; font-size: 11px; opacity: .7; }
.live-body { flex: 1 1 auto; display: flex; min-height: 0; }
.live-main { flex: 1 1 auto; min-width: 0; padding: 28px 36px; overflow: auto; }
.live-panel { width: 360px; flex: none; background: var(--surface-solid); border-left: 1px solid var(--border); padding: 20px; overflow: auto; }
.live-panel h3 { margin: 0 0 10px; font-size: 15px; }
.live-foot { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--surface-solid); border-top: 1px solid var(--border); }
.sp-head { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; }
.sp-head h1 { font-size: 34px; }
.sp-head p { margin: 4px 0 0; color: var(--muted); font-size: 17px; }
.sp-timer-box { text-align: center; }
.sp-timer { font-size: 52px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; color: var(--brand); }
.sp-timer.warn { color: var(--amber); }
.sp-timer.over { color: var(--red); }
.sp-timer-box small { color: var(--muted); }
.lv-warn { background: var(--red-soft); color: var(--red); font-weight: 600; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.lv-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.lv-stats > div, .lv-num { background: var(--surface-solid); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; }
.lv-stats b { display: block; font-size: 34px; }
.lv-stats span, .lv-num span { color: var(--muted); font-size: 14px; }
.lv-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.lv-num b { display: block; font-size: 30px; color: var(--brand); margin: 4px 0; }
.lv-num small { color: var(--muted); }
.lv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lv-card { background: var(--surface-solid); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; font-size: 17px; line-height: 1.5; }
.lv-card h3 { margin: 0 0 8px; font-size: 18px; }
.lv-card ul { margin: 0; padding-left: 20px; }
.live-intro { max-width: 720px; margin: 20px auto; text-align: center; }
.live-intro h1 { font-size: 36px; }
.live-intro p { font-size: 18px; color: var(--muted); }
.intro-list { text-align: left; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.lv-q { list-style: decimal; padding-left: 24px; display: flex; flex-direction: column; gap: 10px; font-size: 18px; }
.lv-q li > div { display: inline-block; }
.lv-q li { background: var(--surface-solid); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.lv-q small, .dec small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 2px; }
.lv-q.done li { opacity: .7; }
.dec { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--border); border-radius: 8px; padding: 10px; font-size: 13px; }
@media (max-width: 1000px) { .live-panel { width: 100%; border-left: 0; border-top: 1px solid var(--border); } .live-body { flex-direction: column; } .lv-grid, .lv-stats { grid-template-columns: 1fr 1fr; } }

/* Номер задачи, кнопка завершения, широкое поле в сетке */
.tnum { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--subtle); border-radius: 5px; padding: 1px 6px; font-variant-numeric: tabular-nums; }
.tnum.big { font-size: 16px; padding: 2px 8px; vertical-align: middle; }
.field-wide { grid-column: 1 / -1; }
.live-top .btn.finish { background: var(--red); border-color: var(--red); }
.live-top .btn.finish:hover { background: #B91C1C; }

/* Справочники: значение и кнопки в одну строку */
.dict-row { flex-wrap: nowrap; gap: 4px; }
.dict-row .inp { width: auto; flex: 1 1 auto; min-width: 0; }
.dict-row .btn { flex: none; }
.dict-grid form.row { flex-wrap: nowrap; }
.dict-grid form.row .inp { width: auto; flex: 1 1 auto; min-width: 0; }

/* Login */

@media print {
  .side, .no-print, #toast { display: none !important; }
  .main { padding: 0; }
  body { background: var(--surface-solid); }
  .card { break-inside: avoid; }
}

/* ---------- Вход (вариант 7D) ---------- */
.lg { position: relative; min-height: 100vh; overflow: hidden; background: #1F4A41; color: #1B3B34; font-family: inherit; }
.lg-bg { position: absolute; inset: 0; background: #F5C25C; clip-path: polygon(0 0, 62% 0, 44% 100%, 0 100%); }
.lg-chev { position: absolute; left: 21%; top: 16%; width: 33%; max-width: 480px; fill: none; stroke: #2E6C5F; stroke-width: 18; }
.lg-wrap { position: relative; display: flex; min-height: 100vh; padding: 48px 64px; box-sizing: border-box; gap: 32px; }
.lg-hero { flex: 1 1 560px; display: flex; flex-direction: column; justify-content: space-between; }
.lg-brand { display: flex; align-items: center; gap: 12px; font-size: 18px; }
.lg-brand img { width: 48px; height: 48px; border-radius: 10px; }
.lg-hero h1 { margin: 0; font-size: clamp(44px, 5vw, 72px); line-height: .98; font-weight: 800; letter-spacing: -.03em; color: #1B3B34; }
.lg-side { flex: 0 1 400px; display: flex; align-items: center; justify-content: flex-end; }
.lg-form { width: 380px; max-width: 100%; display: flex; flex-direction: column; }
.lg-form h2 { margin: 0 0 28px; font-size: 30px; font-weight: 800; color: #fff; }
.lg-sub { margin: 0 0 28px; color: #B9D3CC; }
.lg-lbl { font-size: 13px; font-weight: 600; color: #E7F1EE; margin: 0 0 6px; }
.lg-inp { height: 48px; padding: 0 14px; margin-bottom: 16px; border: 1px solid rgba(255,255,255,.25); border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; font-size: 15px; font-family: inherit; box-sizing: border-box; width: 100%; }
.lg-inp::placeholder { color: rgba(255,255,255,.45); }
.lg-inp:focus { outline: 2px solid #F5C25C; outline-offset: -1px; }
.lg-btn { height: 50px; margin-top: 6px; border: 0; border-radius: 10px; background: #F5C25C; color: #1B3B34; font-size: 16px; font-weight: 700; font-family: inherit; cursor: pointer; }
.lg-btn:hover { background: #F0B53A; }
.lg-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lg-btn:disabled { opacity: .7; cursor: default; }
.lg-note { margin: 16px 0 0; font-size: 13px; color: #B9D3CC; }
@media (max-width: 900px) {
  .lg-bg { clip-path: polygon(0 0, 100% 0, 100% 42%, 0 50%); }
  .lg-chev { left: auto; right: -20px; top: 40px; width: 200px; opacity: .5; }
  .lg-wrap { flex-direction: column; padding: 28px 22px; }
  .lg-hero { flex: none; gap: 28px; min-height: 34vh; }
  .lg-hero h1 { font-size: 40px; }
  .lg-side { flex: 1; justify-content: center; align-items: flex-start; padding-top: 72px; }
}

/* ---------- Информационные панели в описании ---------- */
[data-panel] { position: relative; margin: 8px 0; padding: 10px 14px 10px 42px; border-radius: 8px; border: 1px solid transparent; min-height: 22px; }
[data-panel]::before { content: ''; position: absolute; left: 13px; top: 11px; width: 18px; height: 18px; background: no-repeat center / contain; }
.pico { display: inline-block; width: 18px; height: 18px; flex: none; background: no-repeat center / contain; }
[data-panel="info"] { background: #EFF6FF; border-color: #BFDBFE; }
[data-panel="info"]::before, .pico-info { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%232563EB'/%3E%3Cpath d='M12 11v6M12 7.5v.5' stroke='white' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
[data-panel="note"] { background: #F5F3FF; border-color: #DDD6FE; }
[data-panel="note"]::before, .pico-note { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='3' width='18' height='18' rx='4' fill='%237C3AED'/%3E%3Cpath d='M8 9h8M8 13h5' stroke='white' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E"); }
[data-panel="success"] { background: #F0FDF4; border-color: #BBF7D0; }
[data-panel="success"]::before, .pico-success { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%2315803D'/%3E%3Cpath d='m7.5 12.5 3 3 6-6.5' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
[data-panel="warning"] { background: #FFFBEB; border-color: #FDE68A; }
[data-panel="warning"]::before, .pico-warning { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5 22.5 21h-21z' fill='%23D97706' stroke='%23D97706' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M12 9.5v5M12 17.5v.3' stroke='white' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
[data-panel="error"] { background: #FEF2F2; border-color: #FECACA; }
[data-panel="error"]::before, .pico-error { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%23DC2626'/%3E%3Cpath d='m8.5 8.5 7 7M15.5 8.5l-7 7' stroke='white' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
.panel-menu { position: absolute; z-index: 21; top: 44px; left: 8px; width: 300px; max-width: calc(100% - 16px); background: var(--surface-solid); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 6px; display: flex; flex-direction: column; }
.panel-menu button { display: flex; align-items: center; gap: 12px; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 8px; color: var(--text); }
.panel-menu button:hover, .panel-menu button:focus-visible { background: var(--subtle); }
.panel-menu b { display: block; font-size: 14px; } .panel-menu small { color: var(--muted); font-size: 12px; }
.panel-bar { position: absolute; z-index: 19; display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.panel-bar button { border: 0; background: none; width: 32px; height: 30px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.panel-bar button:hover { background: var(--subtle); color: var(--text); }
.panel-bar button.on { background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.panel-bar .sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }

/* ---------- Колокольчик и уведомления ---------- */
.bell { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; color: #fff; background: rgba(255,255,255,.1); }
.bell:hover, .bell.on { background: rgba(255,255,255,.2); color: #fff; }
.bell-n { position: absolute; top: -5px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; box-sizing: border-box; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 19px; text-align: center; border: 2px solid var(--brand); }
.bell-n[hidden] { display: none; }
.badge-red { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; text-align: center; vertical-align: middle; margin-left: 4px; }
.ntf-card { border-color: #FCA5A5; }
.ntf-list { gap: 4px; }
.ntf { display: flex; align-items: flex-start; gap: 12px; padding: 10px; border-radius: 10px; cursor: pointer; }
.ntf:hover { background: var(--subtle); }
.ntf:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.ntf.unread { background: #FFF7ED; }
.ntf.unread:hover { background: #FFEDD5; }
.ntf-k { font-size: 12px; font-weight: 600; color: var(--brand); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ntf.k-mention .ntf-k { color: var(--purple); } .ntf.k-invite .ntf-k { color: var(--amber); }
.ntf-t { font-weight: 500; margin-top: 2px; overflow-wrap: anywhere; }
.ntf-x { margin-top: 2px; overflow-wrap: anywhere; }
.dot-new { width: 8px; height: 8px; border-radius: 50%; background: var(--red); display: inline-block; }

/* ---------- @упоминания ---------- */
.mention-wrap { position: relative; }
.mention-pop { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.14); max-height: 280px; overflow: auto; }
.mention-pop li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.mention-pop li.on, .mention-pop li:hover { background: var(--brand-soft); }
.mention-pop b { display: block; font-size: 14px; } .mention-pop small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- Дата + время ---------- */
.dt { display: flex; gap: 8px; } .dt input[type="date"] { flex: 1 1 auto; min-width: 0; } .dt input[type="time"] { flex: 0 0 118px; }
.ev.ev-pending { border-left-style: dashed; opacity: .85; }
.live-intro .btn.finish { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------- Меню портала: разделы ---------- */
.side { overflow-y: auto; }
.brand a { color: inherit; text-decoration: none; }
.brand-home { display: inline-flex; border-radius: 10px; }
.brand-home:focus-visible, .lt-home:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.brand-t b { letter-spacing: .02em; }
.lt-home { display: inline-flex; }
.nav-g { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.nav-g.here { color: #fff; }
.nav-g .chev { margin-left: auto; display: inline-flex; transition: transform .15s; opacity: .7; }
.nav-group.open > .nav-g .chev { transform: rotate(180deg); }
.nav-sub { display: none; flex-direction: column; gap: 2px; margin: 2px 0 6px 22px; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.18); }
.nav-group.open > .nav-sub { display: flex; }
.nav-sub .nav { padding: 8px 10px; font-size: 14px; }
.nav .soon { margin-left: auto; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: 999px; background: rgba(255,255,255,.12); color: rgba(255,255,255,.75); }
.nav-g .soon + .chev { margin-left: 6px; }
.co-fixed { display: flex; align-items: center; min-height: 20px; cursor: default; }
@media (max-width: 820px) { .nav-sub { margin-left: 0; border: 0; padding: 0; flex-direction: row; flex-wrap: wrap; } .nav-g .chev, .nav .soon { display: none; } }

/* ---------- О компании ---------- */
.about-doc { font-size: 16px; line-height: 1.6; max-width: 900px; }
.org-root { display: flex; align-items: center; gap: 12px; margin: 0 auto 18px; width: max-content; padding: 12px 20px; border-radius: 14px; background: var(--brand); color: #fff; }
.org-root img { width: 40px; height: 40px; border-radius: 8px; } .org-root b { font-size: 18px; } .org-root span { color: var(--accent); }
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.org-co { border-top: 3px solid var(--brand); margin: 0; }
.soon-card { display: flex; gap: 18px; align-items: center; padding: 28px; }
.soon-ic { width: 60px; height: 60px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* ---------- Календарь ---------- */
.ce { display: flex; gap: 8px; align-items: flex-start; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--purple); background: var(--purple-soft); color: var(--text); border-radius: 6px; padding: 4px 8px; font: inherit; font-size: 12px; cursor: pointer; margin: 0 0 3px; overflow: hidden; }
.ce:hover { filter: brightness(.97); } .ce:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.ce b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ce small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ce-x { min-width: 0; flex: 1; } .ce-t { flex: none; font-weight: 600; color: var(--muted); min-width: 64px; }
.ce-trip { border-color: var(--amber); background: #FFFBEB; } .ce-leave { border-color: var(--gray); background: var(--gray-soft); }
.ce-task { border-color: var(--brand); background: var(--brand-soft); } .ce-task.hi { border-color: var(--red); }
.ce-task.late { border-color: var(--red); background: #FEF2F2; } .ce-task.done { opacity: .55; } .ce-task.done b { text-decoration: line-through; }
.ce.pending { border-left-style: dashed; opacity: .85; }
.mini-cal h2 { font-size: 18px; }
.mc-nav { margin-bottom: 6px; }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mc-wd { font-size: 11px; color: var(--muted); font-weight: 600; padding: 2px 0; }
.mc-d { position: relative; border: 0; background: none; font: inherit; font-size: 13px; padding: 6px 0 10px; border-radius: 8px; cursor: pointer; color: var(--text); }
.mc-d:hover { background: var(--subtle); } .mc-d.out { color: #B6BDC8; }
.mc-d.today { color: var(--brand); font-weight: 700; } .mc-d.sel { background: var(--brand); color: #fff; }
.mc-dots { position: absolute; left: 0; right: 0; bottom: 3px; display: flex; justify-content: center; gap: 2px; }
.mc-dots i, .mc-legend i { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
.mc-dots .m, .mc-legend .m { background: var(--purple); } .mc-dots .t, .mc-legend .t { background: var(--brand); } .mc-dots .l { background: var(--red); }
.mc-d.sel .mc-dots i { background: var(--surface-solid); }
.mc-legend { display: flex; gap: 14px; margin: 6px 0 0; } .mc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mc-h { font-size: 14px; margin: 14px 0 8px; text-transform: capitalize; }
.mc-list { gap: 4px; } .mc-list .ce { font-size: 13px; padding: 7px 10px; margin: 0; }
.cal-top { flex-wrap: wrap; gap: 12px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--subtle); }
.seg button { border: 0; background: none; font: inherit; font-weight: 600; padding: 7px 14px; border-radius: 8px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface-solid); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 10px; } .cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 14px; height: 10px; border-radius: 3px; border-left: 3px solid; display: inline-block; }
.cal-legend i.ce-meeting { border-color: var(--purple); background: var(--purple-soft); }
.cal-card { padding: 0; overflow: hidden; }
.cm-head, .cm-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cm-head span { padding: 10px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: right; border-bottom: 1px solid var(--border); }
.cm-d { min-height: 118px; padding: 4px 6px 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); cursor: cell; min-width: 0; }
.cm-d:nth-child(7n) { border-right: 0; } .cm-d.out { background: #FAFBFC; } .cm-d.out .cm-n { color: #B6BDC8; }
.cm-n { display: block; margin: 0 0 4px auto; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; padding: 2px 7px; border-radius: 999px; cursor: pointer; color: var(--text); }
.cm-d.today .cm-n { background: var(--red); color: #fff; }
.cm-more { border: 0; background: none; font: inherit; font-size: 12px; color: var(--muted); padding: 0 4px; cursor: pointer; }
.cal-time { --cols: 7; }
.ct-head, .ct-allday { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.ct-dh { border: 0; background: none; font: inherit; padding: 10px 6px; color: var(--muted); cursor: pointer; text-align: center; }
.ct-dh b { color: var(--text); font-size: 16px; } .ct-dh.today b { background: var(--red); color: #fff; border-radius: 999px; padding: 1px 8px; }
.ct-allday { min-height: 34px; } .ct-allday > span { padding: 8px 6px; } .ct-allday > div { padding: 4px; border-left: 1px solid var(--border); min-width: 0; }
.ct-body { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(0, 1fr)); max-height: 640px; overflow-y: auto; }
.ct-hours span { display: block; font-size: 11px; color: var(--muted); text-align: right; padding: 0 8px; transform: translateY(-7px); box-sizing: border-box; }
.ct-col { position: relative; border-left: 1px solid var(--border); }
.ct-col.today { background: #FBFDFC; }
.ct-slot { border-top: 1px solid #EEF1F4; cursor: cell; } .ct-slot:hover { background: var(--brand-soft); }
.ce-abs { position: absolute; margin: 0; flex-direction: column; gap: 0; z-index: 1; }
.ct-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 2; pointer-events: none; }
.ct-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
@media (max-width: 820px) { .cm-d { min-height: 70px; } .cm-d .ce { display: none; } .ct-body { max-height: 70vh; } }

/* ---------- Занятость участников в форме встречи ---------- */
.busy-box { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--subtle); }
.busy-box ul { margin: 0; padding-left: 18px; font-size: 13px; } .busy-box li { margin: 2px 0; } .busy-box li.clash { color: var(--red); }
.brand-t { min-width: 0; } .brand-t b { font-size: 14px; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .bell { margin-left: 2px; }
.cal-legend i { border-left-width: 14px; width: 0; }
.cal-legend i.ce-meeting { border-color: var(--purple); } .cal-legend i.ce-trip { border-color: var(--amber); } .cal-legend i.ce-leave { border-color: var(--gray); }
.cal-legend i.ce-task { border-color: var(--brand); } .cal-legend i.ce-task.late { border-color: var(--red); }

/* ---------- «Финансы» внутри портала ---------- */
.main.main-flush { padding: 0; }
.fin-frame { display: block; width: 100%; height: 100vh; border: 0; background: transparent; }
@media (max-width: 820px) { .fin-frame { height: calc(100vh - 64px); } }

/* ---------- SMS-рассылка ---------- */
.sms-step h2 { display: flex; align-items: center; gap: 10px; }
.sms-n { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.sms-note { margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 8px; font-size: 13px; }
.sms-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.sms-stat { background: var(--subtle); border-radius: 10px; padding: 8px 14px; min-width: 120px; } .sms-stat b { display: block; font-size: 20px; } .sms-stat.bad { color: var(--red); font-weight: 600; }
.sms-preview { white-space: pre-wrap; background: var(--subtle); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.sms-tbl { max-height: 520px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.sms-tbl th { position: sticky; top: 0; background: var(--surface-solid); z-index: 1; }
.sms-tbl tr.sms-bad td { background: #FEF2F2; } .sms-tbl tr.sms-off td { opacity: .45; }
#s-tpl { width: 100%; min-height: 110px; resize: vertical; }
.chips .chip[data-ins] { cursor: pointer; border: 1px solid var(--border); background: var(--brand-soft); font: inherit; font-size: 13px; }


/* =====================================================================
   Темы: «Стекло» (светлая, по умолчанию) и «Тёмное стекло».
   Переключатель — кнопка в шапке меню; выбор хранится в localStorage.
   ===================================================================== */
html:not([data-theme="dark"]) {
  --bg: #E9F0EC; --surface: rgba(255,255,255,.62); --surface-solid: rgba(255,255,255,.9); --input: rgba(255,255,255,.82);
  --subtle: rgba(255,255,255,.45); --border: rgba(15,23,42,.09);
  --glass-edge: rgba(255,255,255,.75); --glass-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 8px 32px rgba(31,74,65,.10);
  --bg-art: radial-gradient(600px 420px at 12% 18%, rgba(46,108,95,.45), transparent 60%),
    radial-gradient(520px 400px at 85% 8%, rgba(245,194,92,.6), transparent 60%),
    radial-gradient(700px 520px at 70% 90%, rgba(95,163,143,.45), transparent 60%),
    radial-gradient(420px 360px at 30% 95%, rgba(245,194,92,.35), transparent 60%), #E9F0EC;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --brand: #5FB39C; --brand-dark: #4A9A84; --brand-soft: rgba(95,179,156,.16);
  --bg: #07110E; --surface: rgba(255,255,255,.07); --surface-solid: rgba(18,30,26,.94); --input: rgba(255,255,255,.06);
  --subtle: rgba(255,255,255,.05); --border: rgba(255,255,255,.12);
  --text: #EEF5F2; --muted: #9DB4AC;
  --red: #FF8F8F; --red-soft: rgba(255,120,120,.16); --amber: #F7CD73; --amber-soft: rgba(245,194,92,.16);
  --green: #7BE0A3; --green-soft: rgba(91,208,138,.15); --gray: #AFBACA; --gray-soft: rgba(255,255,255,.08);
  --purple: #C4B5FD; --purple-soft: rgba(167,139,250,.18);
  --glass-edge: rgba(255,255,255,.16); --glass-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 10px 40px rgba(0,0,0,.35);
  --bg-art: radial-gradient(620px 460px at 15% 20%, rgba(46,108,95,.85), transparent 60%),
    radial-gradient(520px 400px at 85% 10%, rgba(245,194,92,.32), transparent 60%),
    radial-gradient(700px 520px at 65% 95%, rgba(40,120,100,.6), transparent 60%), #07110E;
}
body { background: var(--bg-art, var(--bg)); background-attachment: fixed; }
/* стеклянные поверхности */
.card, .lane, .modal, .palette, .panel-menu, .panel-bar, .mention-pop, .live-panel, .live-foot, .editor {
  -webkit-backdrop-filter: blur(24px) saturate(165%); backdrop-filter: blur(24px) saturate(165%);
}
.card, .lane { border-color: var(--glass-edge); box-shadow: var(--glass-shadow); }
.card { border-radius: 18px; }
.modal { background: var(--surface-solid); border: 1px solid var(--glass-edge); border-radius: 20px; }
.tcard { background: var(--surface-solid); }
.btn:not(.primary):not(.green):not(.danger) { background: var(--input); }
/* меню — зелёное стекло (вариант 03b) */
.side { background: linear-gradient(180deg, rgba(46,108,95,.88), rgba(31,74,65,.84)); -webkit-backdrop-filter: blur(24px) saturate(165%); backdrop-filter: blur(24px) saturate(165%);
  border-right: 1px solid rgba(255,255,255,.22); box-shadow: inset -1px 0 0 rgba(255,255,255,.08); }
html[data-theme="dark"] .side { background: rgba(255,255,255,.06); border-right-color: rgba(255,255,255,.12); }
html[data-theme="dark"] .nav.on, html[data-theme="dark"] .nav:hover { background: rgba(255,255,255,.12); }
/* переключатель темы */
.theme-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; border: 0; color: #fff; background: rgba(255,255,255,.1); cursor: pointer; }
.theme-btn:hover { background: rgba(255,255,255,.2); }
.theme-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-btn .i-sun { display: none; } html[data-theme="dark"] .theme-btn .i-sun { display: block; } html[data-theme="dark"] .theme-btn .i-moon { display: none; }
/* тёмная тема: места с «зашитыми» светлыми цветами */
html[data-theme="dark"] .ntf.unread { background: rgba(245,194,92,.10); } html[data-theme="dark"] .ntf.unread:hover { background: rgba(245,194,92,.16); }
html[data-theme="dark"] .ntf:hover, html[data-theme="dark"] .mc-d:hover { background: rgba(255,255,255,.08); }
html[data-theme="dark"] .cm-d.out, html[data-theme="dark"] .ct-col.today { background: rgba(255,255,255,.03); }
html[data-theme="dark"] .ct-slot { border-top-color: rgba(255,255,255,.06); }
html[data-theme="dark"] .ct-slot:hover { background: rgba(95,179,156,.12); }
html[data-theme="dark"] .ce { color: var(--text); }
html[data-theme="dark"] .ce-trip { background: rgba(245,194,92,.14); } html[data-theme="dark"] .ce-task.late { background: rgba(255,120,120,.14); }
html[data-theme="dark"] .sms-tbl th, html[data-theme="dark"] .seg button.on { background: rgba(30,45,40,.96); color: var(--text); }
html[data-theme="dark"] .sms-tbl tr.sms-bad td { background: rgba(255,120,120,.10); }
html[data-theme="dark"] [data-panel="info"] { background: rgba(96,165,250,.12); border-color: rgba(96,165,250,.3); }
html[data-theme="dark"] [data-panel="note"] { background: rgba(167,139,250,.12); border-color: rgba(167,139,250,.3); }
html[data-theme="dark"] [data-panel="success"] { background: rgba(91,208,138,.12); border-color: rgba(91,208,138,.3); }
html[data-theme="dark"] [data-panel="warning"] { background: rgba(245,194,92,.12); border-color: rgba(245,194,92,.3); }
html[data-theme="dark"] [data-panel="error"] { background: rgba(255,120,120,.12); border-color: rgba(255,120,120,.3); }
html[data-theme="dark"] .tcard:hover { border-color: rgba(255,255,255,.25); }

/* кому прозрачность мешает — сплошные поверхности */
@media (prefers-reduced-transparency: reduce) {
  html:not([data-theme="dark"]) { --surface: #fff; --surface-solid: #fff; --subtle: #F1F3F8; }
  html[data-theme="dark"] { --surface: #142420; --surface-solid: #142420; --subtle: #1A2C27; }
}
.brand .theme-btn, .brand .bell { width: 34px; height: 34px; }
.brand { gap: 8px; }
.me-row { display: flex; align-items: center; gap: 8px; } .me-row .me { flex: 1; min-width: 0; }
.bell-n { background: #DC2626; border-color: transparent; }
.brand-t b { font-size: 13px; }
html[data-theme="dark"] .mc-d.out, html[data-theme="dark"] .cm-d.out .cm-n { color: rgba(255,255,255,.3); }
/* Вход — шишасимон (03 / 04) */
.lg { background: transparent; color: var(--text); }
.lg-bg { display: none; }
.lg-chev { stroke: rgba(46,108,95,.28); }
html[data-theme="dark"] .lg-chev { stroke: rgba(95,179,156,.22); }
.lg-hero h1 { color: #1B3B34; }
html[data-theme="dark"] .lg-hero h1, html[data-theme="dark"] .lg-brand { color: #EEF5F2; }
html[data-theme="dark"] .lg-hero h1 span { color: #F5C25C; }
.lg-form { padding: 36px 32px; border-radius: 24px; background: rgba(255,255,255,.55); border: 1px solid rgba(255,255,255,.8);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 20px 60px rgba(31,74,65,.18); -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%); }
.lg-form h2 { color: #1B3B34; } .lg-lbl { color: #334155; } .lg-note { color: #64748B; }
.lg-inp { background: rgba(255,255,255,.8); border-color: rgba(15,23,42,.1); color: #0F172A; }
.lg-inp::placeholder { color: #94A3B8; }
.lg-inp:focus { outline-color: #2E6C5F; }
.lg-btn { box-shadow: 0 8px 22px rgba(245,194,92,.5); }
html[data-theme="dark"] .lg-form { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.16); box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 20px 60px rgba(0,0,0,.45); }
html[data-theme="dark"] .lg-form h2 { color: #fff; } html[data-theme="dark"] .lg-lbl { color: #D7E8E2; } html[data-theme="dark"] .lg-note { color: #9DB4AC; }
html[data-theme="dark"] .lg-inp { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); color: #fff; }
html[data-theme="dark"] .lg-inp::placeholder { color: rgba(255,255,255,.4); }
html[data-theme="dark"] .lg-inp:focus { outline-color: #F5C25C; }
.lg-chev path:first-child { stroke: rgba(245,194,92,.75); }
html[data-theme="dark"] .lg-chev path:first-child { stroke: rgba(245,194,92,.55); }
/* Кнопка «Назад» */
.back-bar { margin: 0 0 14px; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 10px; border-radius: 999px; border: 1px solid var(--glass-edge, var(--border));
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%); box-shadow: 0 2px 10px rgba(31,74,65,.08); }
.back-btn:hover { background: var(--surface-solid); border-color: var(--brand); color: var(--brand); }
.back-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.back-btn svg { flex: none; }
.main-flush > .back-bar { margin: 0; padding: 14px 20px 0; }
.main-flush > .back-bar ~ .fin-frame { height: calc(100vh - 50px); }
.back-live { margin-right: 10px; }

/* ---------- Оргструктура ---------- */
.og { position: relative; padding: 8px 0 24px; overflow-x: auto; }
.og-founders { display: flex; justify-content: center; gap: 48px; flex-wrap: wrap; position: relative; padding-bottom: 22px; }
.og-f { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; width: 190px; background: none; border: 0; font: inherit; color: inherit; cursor: default; }
.og-f[data-oedit]:not([data-oedit=""]), .og-card[data-oedit]:not([data-oedit=""]), .og-head[data-oedit]:not([data-oedit=""]) { cursor: pointer; }
.og-f::after { content: ''; position: absolute; left: 50%; bottom: -22px; width: 2px; height: 22px; background: var(--og-line); }
.og-ring { width: 136px; height: 136px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--brand) 0 58%, var(--accent) 58% 100%); box-shadow: 0 0 0 9px rgba(46,108,95,.10); margin-bottom: 12px; }
.og-ring > svg, .og-ring > img, .og-ring > span { width: 116px !important; height: 116px !important; border-radius: 50%; border: 6px solid var(--surface-solid); box-sizing: border-box; }
.og-ring > span { display: grid; place-items: center; color: var(--brand); background: var(--surface-solid); }
.og-f b { font-size: 15px; } .og-f > span:not(.og-tools) { font-size: 12.5px; color: var(--muted); }
.og-fadd { cursor: pointer; opacity: .75; } .og-fadd .og-ring { background: none; border: 2px dashed var(--og-line); box-shadow: none; } .og-fadd:hover { opacity: 1; }
.og-fadd::after { display: none; }
.og-bus { height: 2px; background: var(--og-line); margin: 0 auto; }
:root { --og-line: #9CC3B8; } html[data-theme="dark"] { --og-line: rgba(95,179,156,.45); }
.og-coord { position: relative; margin-top: 26px; border: 2px dashed rgba(46,108,95,.4); border-radius: 18px; padding: 14px 12px 0; }
.og-coord::before { content: ''; position: absolute; left: 50%; top: -28px; width: 2px; height: 26px; background: var(--og-line); }
.og-coord-l { position: absolute; right: 14px; top: -30px; font-size: 12.5px; font-weight: 700; color: var(--brand); }
.og-cols { display: grid; grid-template-columns: repeat(var(--n), minmax(190px, 1fr)); gap: 16px; }
.og-col { position: relative; min-width: 0; }
.og-tick { position: absolute; left: 50%; top: -14px; width: 2px; height: 14px; background: var(--og-line); }
.og-head { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 78px; padding: 10px 12px; border-radius: 14px; background: var(--brand-soft); border: 2px solid #5FA38F; text-align: left; font: inherit; color: inherit; margin-bottom: 14px; box-sizing: border-box; }
.og-head > svg, .og-head > img, .og-q, .og-logo { flex: none; width: 48px; height: 48px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface-solid), 0 3px 10px rgba(31,74,65,.18); }
.og-logo { display: grid; place-items: center; background: var(--brand); overflow: hidden; } .og-logo img { width: 48px; height: 48px; }
.og-vac { background: var(--amber-soft); border-color: #D9A23A; cursor: pointer; }
html:not([data-theme="dark"]) .og-vac { background: rgba(254,243,199,.85); }
.og-q { display: grid; place-items: center; border: 2px dashed #D9A23A; color: var(--amber); font-weight: 800; font-size: 20px; box-shadow: none; }
.og-t { min-width: 0; display: flex; flex-direction: column; }
.og-t small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.og-t b { font-size: 13.5px; line-height: 1.25; } .og-t span { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.og-vac .og-t b { color: var(--amber); }
.og-staff { list-style: none; margin: 0; padding: 0 0 18px 30px; position: relative; display: grid; gap: 12px; }
.og-staff::before { content: ''; position: absolute; left: 13px; top: -14px; bottom: var(--b, 53px); width: 2px; background: var(--og-line); }
.og-staff:not(:has(.og-card))::before { display: none; }
.og-card { position: relative; display: flex; align-items: center; gap: 10px; min-height: 70px; padding: 8px 10px; border-radius: 14px; background: var(--surface-solid); border: 1.5px solid var(--og-line); box-shadow: 0 4px 14px rgba(31,74,65,.06); }
.og-card::before { content: ''; position: absolute; left: -17px; top: 50%; width: 17px; height: 2px; background: var(--og-line); }
.og-card::after { content: ''; position: absolute; left: -20px; top: calc(50% - 3px); width: 8px; height: 8px; border-radius: 50%; background: var(--og-line); }
.og-card > svg, .og-card > img { flex: none; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface-solid), 0 2px 8px rgba(31,74,65,.15); }
.og-photo { display: block; border-radius: 50%; object-fit: cover; }
.og-add { width: 100%; padding: 9px; border-radius: 12px; border: 1.5px dashed var(--og-line); background: transparent; color: var(--brand); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.og-add:hover { background: var(--brand-soft); }
.og-tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.og-f .og-tools { top: 0; right: 18px; }
.og-card:hover .og-tools, .og-head:hover .og-tools, .og-f:hover .og-tools, .og-tools:focus-within { opacity: 1; }
@media (hover: none) { .og-tools { opacity: 1; } }
.og-tb { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-solid); color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; }
.og-tb:hover { color: var(--brand); border-color: var(--brand); } .og-tb.danger:hover { color: var(--red); border-color: var(--red); }
.og-plus { position: absolute; top: 8px; right: 8px; }
.og-form label { display: grid; gap: 4px; }
.og-form-top { display: flex; align-items: center; gap: 18px; }
.og-form-face > svg, .og-form-face > img { width: 88px; height: 88px; border-radius: 50%; box-shadow: 0 0 0 3px var(--surface-solid), 0 6px 18px rgba(31,74,65,.2); }
.av { overflow: hidden; } .av-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-photo { display: flex; align-items: center; gap: 22px; margin-bottom: 16px; }
.pf-face > svg, .pf-face > img { width: 112px; height: 112px; border-radius: 50%; box-shadow: 0 0 0 4px var(--surface-solid), 0 0 0 7px rgba(46,108,95,.25), 0 10px 26px rgba(31,74,65,.2); }
/* инструменты карточки — над углом, не закрывают текст */
.og-tools { top: -11px !important; right: -8px !important; }
.og-f .og-tools { top: 0 !important; right: 12px !important; }
.og-tb { width: 24px; height: 24px; border-radius: 50%; box-shadow: 0 2px 8px rgba(15,23,42,.15); }
.og-cols { grid-template-columns: repeat(var(--n), minmax(164px, 1fr)); gap: 12px; }
.og-coord { padding: 14px 10px 0; }
.og-staff { padding-left: 22px; } .og-staff::before { left: 9px; }
.og-card::before { left: -13px; width: 13px; } .og-card::after { left: -16px; }
.og-plus { top: -11px !important; right: -8px !important; width: 24px; height: 24px; border-radius: 50%; box-shadow: 0 2px 8px rgba(15,23,42,.15); }
.og-head { padding: 10px; gap: 8px; } .og-head > svg, .og-head > img, .og-q, .og-logo { width: 44px !important; height: 44px !important; }
.og-card { padding: 8px; gap: 8px; } .og-card > svg, .og-card > img { width: 40px !important; height: 40px !important; }
/* SMS: результат отправки и статусы */
.sms-result { padding: 14px 16px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border); box-shadow: 0 6px 20px rgba(31,74,65,.08); }
.sms-result.bad { border-color: var(--red); }
.sms-result-h { font-weight: 800; font-size: 15px; margin-bottom: 8px; }
.sms-result-n { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; }
.sms-result-n .ok { color: var(--green); } .sms-result-n .bad { color: var(--red); } .sms-result-n .wait { color: var(--amber); }
.sms-st { display: inline-block; font-weight: 700; font-size: 12.5px; padding: 2px 8px; border-radius: 999px; }
.sms-st.ok { background: var(--green-soft); color: var(--green); } .sms-st.bad { background: var(--red-soft); color: var(--red); } .sms-st.wait { background: var(--amber-soft); color: var(--amber); }
.sms-tbl tr.sms-sent td { background: rgba(21,128,61,.04); }
.sms-tbl tr.sms-sent, .sms-tbl tr.sms-sent td { opacity: 1 !important; }
/* ---------- Счёт-фактуры ---------- */
.iv-steps { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--glass-edge, var(--border)); margin-bottom: 14px; flex-wrap: wrap; }
.iv-step { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.iv-step b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 12.5px; }
.iv-step.on { color: var(--text); } .iv-step.on b { background: var(--brand); color: #fff; } .iv-step.done b { background: var(--green); color: #fff; }
.iv-sep { flex: 1; min-width: 20px; height: 2px; background: var(--border); }
.tabs-bar { display: flex; gap: 4px; margin-bottom: 14px; padding: 4px; border-radius: 12px; background: var(--subtle); width: max-content; max-width: 100%; overflow-x: auto; }
.tb-t { border: 0; background: transparent; padding: 9px 14px; border-radius: 9px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tb-t.on { background: var(--surface-solid); color: var(--text); box-shadow: 0 1px 4px rgba(15,23,42,.08); }
.iv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.iv-stat { padding: 14px 16px; margin: 0; } .iv-stat small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); } .iv-stat b { display: block; font-size: 24px; font-weight: 800; margin-top: 2px; } .iv-stat i { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.iv-tbl { overflow: auto; max-height: 62vh; } .iv-tbl .num { text-align: right; white-space: nowrap; } .iv-tbl th { position: sticky; top: 0; background: var(--surface-solid); z-index: 1; }
.iv-tbl tr.iv-err td { background: var(--red-soft); }
.iv-empty { text-align: center; padding: 40px 20px; } .iv-empty h2 { margin-top: 0; }
.iv-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 14px; margin-bottom: 10px; } .iv-map label { display: grid; gap: 4px; }
.pill.p-ok { background: var(--green-soft); color: var(--green); } .pill.p-err { background: var(--red-soft); color: var(--red); } .pill.p-wait { background: var(--amber-soft); color: var(--amber); }
.pill.p-sig { background: var(--brand-soft); color: var(--brand); } .pill.p-gray { background: var(--gray-soft); color: var(--gray); }
.iv-card .iv-fld { display: grid; grid-template-columns: 160px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.iv-card .iv-fld > span { color: var(--muted); font-size: 13px; }
.iv-cp { border: 0; background: var(--brand-soft); color: var(--brand); font: inherit; font-size: 12px; font-weight: 600; padding: 3px 7px; border-radius: 6px; cursor: pointer; font-variant-numeric: tabular-nums; }
.iv-bars { display: flex; gap: 8px; align-items: flex-end; height: 240px; padding-top: 10px; }
.iv-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; height: 100%; }
.iv-bw { flex: 1; width: 100%; max-width: 46px; position: relative; } .iv-bw span { position: absolute; bottom: 0; left: 0; width: 48%; border-radius: 5px 5px 0 0; background: var(--brand-soft); } .iv-bw span.f { left: 52%; background: var(--brand); }
.iv-bar small { font-size: 11px; color: var(--muted); } .iv-bar b { font-size: 11px; }
.iv-r { margin: 10px 0; font-size: 13.5px; } .iv-rb { height: 8px; border-radius: 4px; background: var(--subtle); margin-top: 4px; } .iv-rb span { display: block; height: 100%; border-radius: 4px; background: #D9A23A; }
.modal:has(.iv-card) { width: min(1040px, 96vw); max-width: 1040px; }
/* Счёт-фактуры: настройки и инструкция */
.iv-set{display:grid;gap:16px}
.iv-fs{border:0;padding:0;margin:0;min-width:0}
.iv-fs[disabled] .inp{opacity:.7}
.iv-help{max-width:860px;line-height:1.55}
.iv-help h3{margin:18px 0 6px}
.iv-help li{margin:6px 0}
.tabs-bar .tb-t[data-tab="set"]{margin-left:auto}
.iv-map label.iv-chk{display:flex;flex-direction:row;align-items:center;gap:8px;align-self:end;min-height:42px;cursor:pointer}
.iv-map label.iv-chk input{width:18px;height:18px;margin:0;accent-color:var(--brand)}
/* Ежедневка */
.dr-bar{gap:10px;flex-wrap:wrap;margin:6px 0 14px}
.dr-bar .loading{opacity:.6;pointer-events:none}
.dr-tbl td,.dr-tbl th{padding:7px 12px}
.dr-tbl th.dr-date{background:#ffef5c;color:#1b1b1b;border-radius:6px 0 0 0}
.dr-tbl tr.dr-sec td{background:color-mix(in srgb,var(--green) 16%,transparent);font-weight:700}
.dr-tbl tr.dr-row[data-sup]{cursor:pointer}
.dr-tbl tr.dr-row[data-sup]:hover td{background:color-mix(in srgb,var(--brand) 8%,transparent)}
.dr-tbl tr.dr-subtotal td{color:var(--red);font-weight:700;border-bottom:2px solid color-mix(in srgb,var(--red) 30%,transparent)}
.dr-tbl tr.dr-total td,.dr-tbl tr.dr-grand td{background:color-mix(in srgb,#6f8fd6 22%,transparent);font-weight:800}
.dr-tbl tr.dr-grand td{font-size:1.04em}
.dr-tbl tr.dr-gap td{padding:4px;border:0}
.dr-warn{padding:12px 16px;margin-bottom:12px;display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.dr-warn .pill{cursor:pointer;border:0}
.dr-days{display:grid;gap:5px}
.dr-day{display:grid;grid-template-columns:44px 1fr 74px;gap:8px;align-items:center;font-size:12px}
.dr-day b{text-align:right;font-weight:600}
.dr-db{height:10px;border-radius:5px;background:color-mix(in srgb,var(--muted) 14%,transparent);overflow:hidden}
.dr-db span{display:block;height:100%;background:var(--green);border-radius:5px}
.dr-cfg{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.dr-cfg label{display:grid;gap:4px}
.dr-cfg textarea{font-family:inherit;resize:vertical}
.modal:has(.dr-cfg){width:min(900px,96vw)}
@media(max-width:760px){.dr-cfg{grid-template-columns:1fr}}
.dr-card .iv-tbl{max-height:none}
