/* Оформление повторяет реестр имущества АРКО (sklad.ar-ko.ru): белый фон, чёрный активный пункт меню,
   красный акцент #da3329, нумерованные шаги, крупные поля ввода. */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f6f6;
  --text: #111111;
  --muted: #6b6b6b;
  --border: #d9dada;
  --accent: #da3329;
  --accent-soft: #eea39e;
  --accent-tint: #fdeceb;
  --ink: #000000;
  --on-ink: #ffffff;
  --ok: #1f8a4c;
  --ok-tint: #e6f4ec;
  --warn: #b26a00;
  --warn-tint: #fff3dc;
  --weekend: #fdf1f0;
  --p1: #2a6fb0;
  --p2: #c47a12;
  --pur: #7a3fb5;
  --pur-tint: #f1e9fa;
  --shadow: 0 10px 40px rgba(0, 0, 0, .18);
  --side-w: 252px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131313; --bg-soft: #1c1c1c; --text: #f2f2f2; --muted: #9a9a9a; --border: #333;
    --accent: #ef4a3f; --accent-soft: #6b2f2b; --accent-tint: #2b1a19; --ink: #f2f2f2; --on-ink: #111;
    --ok: #4cc47f; --ok-tint: #17281f; --warn: #f0b04a; --warn-tint: #2d2414; --weekend: #201716; --pur: #b993e6; --pur-tint: #271c33;
    --shadow: 0 10px 40px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131313; --bg-soft: #1c1c1c; --text: #f2f2f2; --muted: #9a9a9a; --border: #333;
  --accent: #ef4a3f; --accent-soft: #6b2f2b; --accent-tint: #2b1a19; --ink: #f2f2f2; --on-ink: #111;
  --ok: #4cc47f; --ok-tint: #17281f; --warn: #f0b04a; --warn-tint: #2d2414; --weekend: #201716; --pur: #b993e6; --pur-tint: #271c33;
  --shadow: 0 10px 40px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------- каркас ---------- */
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.side {
  width: var(--side-w); flex: none; border-right: 1px solid var(--border); background: var(--bg);
  display: flex; flex-direction: column; padding: 22px 10px 14px; position: sticky; top: 0;
  height: 100vh; height: 100dvh; overflow-y: auto;
}
.brand { padding: 0 8px 4px; }
.brand svg, .brand img { display: block; height: 56px; width: auto; }
.brand-title { margin: 14px 8px 20px; display: flex; align-items: baseline; gap: 8px; }
.brand-title b { font-size: 24px; letter-spacing: -.02em; }
.brand-title span { font-size: 14px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 8px;
  text-decoration: none; font-size: 17px; color: var(--text);
}
.nav a svg { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.nav a:hover { background: var(--bg-soft); }
.nav a.active { background: var(--ink); color: var(--on-ink); }
.nav a.active svg { opacity: 1; }
.side-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.side-foot .who { line-height: 1.35; margin-bottom: 10px; }
.side-foot button { display: block; background: none; border: 0; padding: 6px 0; color: var(--muted); text-align: left; }
.side-foot button:hover { color: var(--text); }
.side-foot .org { margin-top: 12px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }

.main { flex: 1; min-width: 0; padding: 34px 44px 60px; }
.page { max-width: 1120px; }
.crumb { display: inline-block; color: var(--muted); text-decoration: none; font-size: 16px; margin-right: 14px; }
.crumb:hover { color: var(--text); }
.page-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 0; margin-bottom: 26px; }
h1 { margin: 0; font-size: 34px; letter-spacing: -.02em; line-height: 1.15; }
h2 { margin: 0 0 12px; font-size: 20px; }

/* ---------- шаги (как «1 КУДА / 2 ЧТО / 3 КОММЕНТАРИЙ») ---------- */
.step { margin-bottom: 26px; }
.step-label { display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
  font-size: 16px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.step-label i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff; font-style: normal; font-size: 15px; font-weight: 700; letter-spacing: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { color: var(--muted); font-size: 15px; }
.row { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 260px; max-width: 460px; }
.hint { color: var(--muted); font-size: 15px; margin: 10px 0 0; }

input[type=text], input[type=password], input[type=date], input[type=month], input[type=number], input[type=search], select {
  width: 100%; height: 52px; padding: 0 16px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; font-size: 18px; outline: none; appearance: none; -webkit-appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 22px) 22px, calc(100% - 16px) 22px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
input:focus, select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent); }
input::placeholder { color: var(--muted); opacity: .8; }
input:disabled, select:disabled { background: var(--bg-soft); color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 24px;
  border: 0; border-radius: 10px; font-size: 18px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(.94); }
.btn-primary:disabled { background: var(--accent-soft); cursor: not-allowed; filter: none; }
.btn-dark { background: var(--ink); color: var(--on-ink); }
.btn-dark:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: var(--bg); color: var(--text); border: 1px solid var(--border); font-weight: 600; }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 15px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--accent); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 13px;
  font-weight: 600; background: var(--bg-soft); color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--ok-tint); color: var(--ok); }
.chip.warn { background: var(--warn-tint); color: var(--warn); }
.chip.red { background: var(--accent-tint); color: var(--accent); }

.banner { padding: 12px 16px; border-radius: 10px; background: var(--warn-tint); color: var(--warn); margin: 0 0 20px; font-size: 15px; }
.banner.ok { background: var(--ok-tint); color: var(--ok); }

/* ---------- ввод часов ---------- */
.date-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.date-row input[type=date] { width: 190px; }
.icon-btn { width: 52px; height: 52px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); font-size: 22px; }
.icon-btn:hover { background: var(--bg-soft); }
.weekday { color: var(--muted); font-size: 16px; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.progress { color: var(--muted); font-size: 15px; }
.crew { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.person { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.person:last-child { border-bottom: 0; }
.person.filled { background: color-mix(in srgb, var(--ok-tint) 55%, var(--bg)); }
.person .who { flex: 1; min-width: 0; }
.person .nm { font-weight: 600; font-size: 17px; overflow-wrap: anywhere; }
.person .ps { color: var(--muted); font-size: 14px; }
.person .oth { margin-top: 4px; }
.stepper { display: flex; align-items: center; gap: 6px; flex: none; }
.stepper button { width: 46px; height: 46px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); font-size: 24px; line-height: 1; }
.stepper button:active { background: var(--bg-soft); }
.stepper input { width: 72px; height: 46px; text-align: center; font-size: 20px; font-weight: 700; padding: 0 4px; }
.stepper .unit { color: var(--muted); font-size: 14px; width: 12px; }
.saved { width: 18px; color: var(--ok); font-size: 16px; text-align: center; }
.empty { padding: 30px 20px; text-align: center; color: var(--muted); }

/* ---------- главная ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.card { border: 1px solid var(--border); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.card h3 { margin: 0; font-size: 20px; display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.bar { height: 8px; background: var(--bg-soft); border-radius: 9px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 9px; }
.bar.full > i { background: var(--ok); }
.kv { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 15px; }
.kv b { color: var(--text); font-weight: 600; }
.card .btns { display: flex; gap: 10px; margin-top: 4px; }
.card .btns .btn { flex: 1; }
.stats { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.stat { border: 1px solid var(--border); border-radius: 12px; padding: 14px 20px; min-width: 170px; }
.stat b { display: block; font-size: 28px; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 14px; }

/* ---------- таблицы ---------- */
.tbl-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 12px; max-width: 100%; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 15px; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
th { position: sticky; top: 0; background: var(--bg-soft); font-weight: 600; color: var(--muted); font-size: 13px;
  text-transform: uppercase; letter-spacing: .04em; z-index: 2; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--bg-soft); }
td.wrap { white-space: normal; }
.grid { max-height: 68vh; }
.grid table { width: auto; }
.grid th, .grid td { padding: 0; text-align: center; min-width: 40px; height: 42px; border-right: 1px solid var(--border); }
.grid th.name, .grid td.name { position: sticky; left: 0; z-index: 3; background: var(--bg); text-align: left; padding: 0 12px;
  min-width: 210px; max-width: 260px; white-space: normal; font-size: 14px; line-height: 1.25; }
.grid th.name { background: var(--bg-soft); z-index: 4; }
.grid td.name small { display: block; color: var(--muted); }
.grid td.we, .grid th.we { background: var(--weekend); }
.grid th.we { color: var(--accent); }
.grid td.cell { cursor: pointer; font-variant-numeric: tabular-nums; }
.grid td.cell:hover { outline: 2px solid var(--ink); outline-offset: -2px; }
.grid td.cell input { width: 100%; height: 100%; border: 0; border-radius: 0; padding: 0; text-align: center; font-size: 15px; box-shadow: none; outline: 2px solid var(--accent); outline-offset: -2px; }
.grid td.tot, .grid th.tot { font-weight: 700; padding: 0 12px; background: var(--bg-soft); }
.grid tfoot td { font-weight: 700; background: var(--bg-soft); border-top: 2px solid var(--border); }
.grid tfoot td.name { background: var(--bg-soft); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- окна и уведомления ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: var(--bg); border-radius: 16px; box-shadow: var(--shadow); width: 100%; max-width: 560px; max-height: 92vh;
  display: flex; flex-direction: column; }
.modal-head { padding: 20px 24px 8px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 8px 24px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { padding: 14px 24px 20px; display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.x { border: 0; background: none; font-size: 28px; line-height: 1; color: var(--muted); padding: 4px 8px; }
.check { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 17px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.pick { max-height: 46vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.pick .person { padding: 10px 14px; }
#toasts { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 80;
  display: flex; flex-direction: column; gap: 8px; align-items: center; max-width: 92vw; pointer-events: none; }
.toast { background: var(--ink); color: var(--on-ink); padding: 12px 20px; border-radius: 10px; max-width: 92vw; font-size: 15px; box-shadow: var(--shadow); }
.toast.err { background: var(--accent); color: #fff; }

/* ---------- вход ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }
.login-card .brand img { height: 84px; }
.login-card h1 { font-size: 30px; }
.err { color: var(--accent); font-size: 15px; min-height: 20px; margin: -4px 0 0; }

/* ---------- мобильная версия ---------- */
.topbar, .tabbar { display: none; }
@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; transform: translateX(-102%); visibility: hidden;
    transition: transform .2s, visibility .2s; background: var(--bg); }
  body.menu-open .side { transform: none; visibility: visible; box-shadow: var(--shadow); }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 55; }
  .main { padding: 16px 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .topbar { display: flex; align-items: center; justify-content: space-between; margin: -4px 0 14px; }
  .topbar svg { height: 34px; width: auto; display: block; }
  .topbar button { border: 1px solid var(--border); background: var(--bg); border-radius: 8px; height: 40px; width: 44px; font-size: 20px; }
  h1 { font-size: 28px; }
  .page-head { margin-bottom: 18px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--bg); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border: 0; background: none;
    color: var(--muted); text-decoration: none; font-size: 11px; border-radius: 8px; }
  .tabbar svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar .active { color: var(--accent); font-weight: 700; }
  .row > .field { max-width: none; flex-basis: 100%; }
  .date-row input[type=date] { flex: 1; min-width: 150px; }
  .person { padding: 12px; gap: 8px; }
  .stepper button { width: 42px; }
  .stepper input { width: 58px; }
  .stepper .unit { display: none; }
  .cards { grid-template-columns: 1fr; }
  .btn-block-m { width: 100%; }
  .modal { max-height: 96vh; }
  .modal-body, .modal-head, .modal-foot { padding-left: 18px; padding-right: 18px; }
}
@media print { .side, .tabbar, .topbar, .toolbar { display: none !important; } .main { padding: 0; } }

/* ---------- подсветка сроков документов ---------- */
tbody tr.a-soon td { background: var(--warn-tint); }
tbody tr.a-expired td { background: var(--accent-tint); }
tbody tr.a-soon.click:hover td, tbody tr.a-expired.click:hover td { filter: brightness(.97); }
.person.a-soon { box-shadow: inset 5px 0 0 var(--warn); background: color-mix(in srgb, var(--warn-tint) 60%, var(--bg)); }
.person.a-expired { box-shadow: inset 5px 0 0 var(--accent); background: color-mix(in srgb, var(--accent-tint) 70%, var(--bg)); }
.attn { border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; margin-bottom: 22px; }
.attn h2 { font-size: 17px; margin-bottom: 10px; }
.attn-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.attn-item { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px; border-radius: 10px; text-decoration: none; color: inherit; background: var(--warn-tint); }
.attn-item.a-expired { background: var(--accent-tint); }
a.attn-item:hover { filter: brightness(.97); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.muted { color: var(--muted); }
td small.muted { display: block; font-size: 13px; }

/* ---------- карточка сотрудника ---------- */
.card-sec { border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px 20px; margin-bottom: 18px; }
.card-sec h2 { margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 22px; }
input.soon { border-color: var(--warn); background: var(--warn-tint); }
input.expired { border-color: var(--accent); background: var(--accent-tint); }
.exp-note { font-size: 13px; min-height: 16px; color: var(--muted); }
.exp-note.soon { color: var(--warn); font-weight: 600; }
.exp-note.expired { color: var(--accent); font-weight: 600; }
textarea { width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font-size: 17px; resize: vertical; outline: none; }
textarea:focus { border-color: var(--ink); }
.docs { margin-top: 14px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.doc { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.doc:last-child { border-bottom: 0; }
.doc .who { flex: 1 1 200px; min-width: 0; }
.doc .nm { font-weight: 600; overflow-wrap: anywhere; }
.doc .ps { color: var(--muted); font-size: 14px; }
.savebar { position: sticky; bottom: 0; display: flex; gap: 12px; flex-wrap: wrap; padding: 12px 0 8px; background: var(--bg); border-top: 1px solid var(--border); z-index: 5; }
.obj-pick { max-height: 220px; overflow-y: auto; }
@media (max-width: 900px) {
  .savebar { bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
  .attn-list { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
}
.grid td.cell.ro:hover { outline: none; }

/* ---------- оформление сотрудников: зелёный — официально, фиолетовый курсив — не оформлен ---------- */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: var(--border); flex: none; vertical-align: baseline; }
.dot.emp-official { background: var(--ok); }
.dot.emp-unofficial { background: var(--pur); }
.chip.emp-official { background: var(--ok-tint); color: var(--ok); }
.chip.emp-unofficial { background: var(--pur-tint); color: var(--pur); }
.person.emp-unofficial .nm, tr.emp-unofficial td:first-child, td.emp-unofficial a.emp-link { font-style: italic; }
.person.emp-unofficial .nm a, td.emp-unofficial a.emp-link { color: var(--pur); }
.grp-row { padding: 8px 16px; background: var(--bg-soft); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); border-bottom: 1px solid var(--border); display: flex; align-items: center; }
tbody tr.grp td { background: var(--bg-soft); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 14px; }
tbody tr.grp:hover td { background: var(--bg-soft); }
.grid tr.grp td { height: 32px; text-align: left; }
.grid tr.grp td.name { position: sticky; left: 0; white-space: nowrap; }
.emp-link { color: inherit; text-decoration: none; border-bottom: 1px dashed var(--muted); }
.emp-link:hover { color: var(--accent); border-bottom-color: var(--accent); }
.person .nm { display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; }
.person .nm .dot { margin-right: 2px; }
.person .nm .chip { font-size: 12px; padding: 1px 8px; }

/* ---------- подтверждение часов ---------- */
.person.dirty { background: color-mix(in srgb, var(--accent-tint) 60%, var(--bg)); }
.person.dirty .stepper input { border-color: var(--accent); }
.saved { color: var(--accent); font-weight: 700; }
.grid td.cell.dirty { background: var(--accent-tint); box-shadow: inset 0 0 0 2px var(--accent); font-weight: 700; }
.confirmbar { position: sticky; bottom: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 16px; margin-top: 14px;
  background: var(--ink); color: var(--on-ink); border-radius: 12px; z-index: 6; box-shadow: var(--shadow); }
.confirmbar .cb-text { flex: 1 1 160px; font-weight: 600; }
.confirmbar .btn-ghost { background: transparent; color: var(--on-ink); border-color: color-mix(in srgb, var(--on-ink) 40%, transparent); }
.confirm-list { border: 1px solid var(--border); border-radius: 10px; max-height: 38vh; overflow-y: auto; }
.confirm-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 15px; }
.confirm-row:last-child { border-bottom: 0; }
.confirm-row b { text-align: right; }
@media (max-width: 900px) { .confirmbar { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- зарплата: два периода ---------- */
.periods { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-bottom: 18px; }
.period-card { border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.period-card.p1 { border-top: 4px solid var(--p1); }
.period-card.p2 { border-top: 4px solid var(--p2); }
.pc-title { font-weight: 700; font-size: 17px; }
.pc-sub { color: var(--muted); font-size: 14px; }
.pc-amt { font-size: 26px; letter-spacing: -.02em; margin: 2px 0; }
table.pay th { position: static; }
table.pay th.num, table.pay td.num { text-align: right; }
table.pay th.grp-p { text-align: center; border-left: 1px solid var(--border); }
table.pay th.grp-p.p1 { border-top: 3px solid var(--p1); }
table.pay th.grp-p.p2 { border-top: 3px solid var(--p2); }
table.pay th.sub { font-size: 12px; }
table.pay td.p1, table.pay td.p2 { border-left: 1px solid var(--border); }
table.pay td.b { font-weight: 700; }
table.pay tfoot td { font-weight: 700; background: var(--bg-soft); }

/* ---------- «Н» — нет на объекте (причина обязательна) ---------- */
.reason { flex: 1 1 100%; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.reason-input { height: 44px; font-size: 16px; }
.reason-input.bad { border-color: var(--accent); background: var(--accent-tint); }
.chip-btn { border: 1px solid var(--border); background: var(--bg); border-radius: 99px; padding: 5px 12px; font-size: 14px; }
.chip-btn:hover { background: var(--bg-soft); }
.link-btn { border: 0; background: none; padding: 2px 0; color: var(--accent); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.grid td.cell.abs { color: var(--accent); font-weight: 700; }
.check.switch { font-weight: 600; margin-bottom: 8px; }

/* ---------- логотип: из файла (чёрное на прозрачном); в тёмной теме инвертируется ---------- */
.logo-img { display: block; }
:root[data-theme="dark"] .logo-img { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-img { filter: invert(1); } }

/* ---------- отзывы и форма ---------- */
.notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.notes-col { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.notes-col h3 { margin: 0; font-size: 16px; }
.notes-col.plus { border-top: 4px solid var(--ok); }
.notes-col.minus { border-top: 4px solid var(--accent); }
.notes-list { display: flex; flex-direction: column; gap: 8px; }
.note { border-radius: 10px; padding: 10px 12px; background: var(--bg-soft); }
.note.plus { background: var(--ok-tint); }
.note.minus { background: var(--accent-tint); }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.note-meta { margin-top: 6px; font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.note-meta b { color: var(--text); }
.note-empty { color: var(--muted); font-size: 14px; }
.note-add { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.note-add textarea { font-size: 15px; }
.uniform-row { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(150px, 1fr) minmax(130px, 1fr) minmax(140px, 1.4fr); gap: 10px 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.uniform-row input[type=date], .uniform-row input[type=text] { height: 44px; font-size: 16px; }
@media (max-width: 900px) { .notes-grid { grid-template-columns: 1fr; } .uniform-row { grid-template-columns: 1fr 1fr; } .uniform-row .check { grid-column: 1 / -1; } .uniform-row small { grid-column: 1 / -1; } }

.grid td.name .link-btn { display: block; margin-top: 2px; font-size: 12px; text-align: left; }

/* ---------- удостоверения и допуски ---------- */
.permit-list { display: flex; flex-direction: column; gap: 10px; }
.permit { border: 1px solid var(--border); border-left: 5px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.permit.ok { border-left-color: var(--ok); }
.permit.soon { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn-tint) 45%, var(--bg)); }
.permit.expired { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent-tint) 50%, var(--bg)); }
.permit-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.permit-files { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.file-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 99px; padding: 2px 4px 2px 10px; background: var(--bg); font-size: 14px; }
.file-chip .link-btn { color: var(--text); text-decoration: none; font-size: 14px; overflow-wrap: anywhere; text-align: left; }
.x-small { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 6px; }
.x-small:hover { color: var(--accent); }
.permit-actions { display: flex; gap: 8px; }
table.pm th { position: sticky; top: 0; white-space: normal; text-align: center; min-width: 96px; }
table.pm th:first-child, table.pm th:nth-child(2) { text-align: left; }
table.pm td { text-align: center; }
table.pm td:first-child, table.pm td:nth-child(2) { text-align: left; }

.install-banner { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.install-banner .ib-btns { display: flex; gap: 14px; align-items: center; }
