/* База знаний бухгалтерии — Здрадовский · Франшизы
   Палитра из руководства по фирменному стилю:
   #1D1D1D Neutral Black · #D4CFC9 Warm Grey 1C · #EAEAEA Cool Grey 1C · #FFFFFF
   Франшизы: #73BCEA (Pantone 292 C) и светлый #BBDDF3 (Pantone 290 C) */

:root {
  --ink: #1d1d1d;
  --ink-2: #3a3936;
  --muted: #5f5b56;
  --faint: #8a857f;
  --white: #ffffff;
  --cool: #eaeaea;
  --cool-2: #f4f4f4;
  --warm: #d4cfc9;
  --warm-2: #e6e2dd;
  --fr: #73bcea;
  --fr-light: #bbddf3;
  --fr-wash: #e4f1fa;
  --fr-ink: #1f5f8a; /* текстовый оттенок голубого для ссылок (контраст AA) */
  --line: rgba(29, 29, 29, 0.12);
  --line-2: rgba(29, 29, 29, 0.07);
  --danger: #b3261e;

  --font-display: 'Unbounded', 'Geologica', 'Arial', sans-serif; /* замена TT Bluescreens Pro Expanded */
  --font-body: 'Geologica', 'Arial', sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: clamp(1.375rem, 1.1rem + 0.9vw, 1.75rem);
  --text-2xl: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-full: 999px;

  --header-h: 64px;
  --side-w: 300px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 1px 2px rgba(29, 29, 29, 0.05), 0 8px 24px -12px rgba(29, 29, 29, 0.18);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--ink);
  background: var(--cool);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--fr); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--white); padding: 8px 14px; border-radius: var(--r-sm); }
.skip:focus { top: 12px; }

/* ---------- Шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px;
  background: var(--ink); color: var(--white);
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--white); flex-shrink: 0; }
.brand-logo { display: block; height: 22px; width: auto; color: var(--white); }
.pill {
  display: inline-flex; align-items: center;
  height: 26px; padding: 0 12px;
  border-radius: var(--r-full);
  background: var(--fr-light); color: var(--ink);
  font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  white-space: nowrap;
}
.pill--outline { background: transparent; color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }
.topbar-title { font-size: var(--text-sm); color: rgba(255, 255, 255, 0.72); padding-left: 18px; border-left: 1px solid rgba(255, 255, 255, 0.18); white-space: nowrap; }
.topbar-search { flex: 1; max-width: 520px; margin-left: auto; position: relative; }
.topbar-search input {
  width: 100%; height: 40px;
  padding: 0 44px 0 40px;
  border-radius: var(--r-full); border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08); color: var(--white);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.topbar-search input::placeholder { color: rgba(255, 255, 255, 0.55); }
.topbar-search input:focus { outline: none; background: rgba(255, 255, 255, 0.14); border-color: var(--fr); }
.topbar-search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); opacity: 0.7; }
.kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 11px; padding: 2px 7px; border-radius: 6px; border: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.6); }
.user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.user-email { font-size: var(--text-sm); color: rgba(255, 255, 255, 0.72); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: var(--r-full);
  border: 0; background: transparent; color: inherit; cursor: pointer;
  transition: background 0.2s var(--ease);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); }
.menu-btn { display: none; }
.scrim { display: none; }

/* ---------- Каркас ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: calc(100dvh - var(--header-h)); }
.side {
  position: sticky; top: var(--header-h);
  height: calc(100dvh - var(--header-h));
  overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 14px 40px;
  background: var(--cool);
  border-right: 1px solid var(--line-2);
}
.side-home { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); text-decoration: none; font-weight: 500; font-size: var(--text-sm); margin-bottom: 10px; }
.side-home:hover { background: rgba(29, 29, 29, 0.05); }
.side-home[aria-current="page"] { background: var(--white); }
.nav-sec { margin-bottom: 6px; }
.nav-sec > button {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 0; border-radius: var(--r-sm);
  background: transparent; cursor: pointer; text-align: left;
  font-weight: 600; font-size: var(--text-sm);
}
.nav-sec > button:hover { background: rgba(29, 29, 29, 0.05); }
.nav-sec .num { font-family: var(--font-display); font-size: 11px; font-weight: 500; color: var(--muted); width: 22px; }
.nav-sec .chev { margin-left: auto; transition: transform 0.25s var(--ease); opacity: 0.6; }
.nav-sec[data-open="false"] .chev { transform: rotate(-90deg); }
.nav-sec[data-open="false"] .nav-body { display: none; }
.nav-sec.is-current > button { background: var(--white); }
.nav-group-title { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); padding: 12px 12px 4px 44px; }
.nav-item {
  display: block; position: relative;
  padding: 7px 12px 7px 44px; border-radius: var(--r-sm);
  text-decoration: none; font-size: var(--text-sm); color: var(--ink-2); line-height: 1.35;
}
.nav-item:hover { background: rgba(29, 29, 29, 0.05); }
.nav-item[aria-current="page"] { background: var(--fr-light); color: var(--ink); font-weight: 500; }
.nav-item[aria-current="page"]::before { content: ''; position: absolute; left: 30px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--ink); }
.badge-new { display: inline-block; margin-left: 6px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; padding: 1px 6px; border-radius: var(--r-full); background: var(--ink); color: var(--white); vertical-align: 1px; }

.main { min-width: 0; padding: 24px clamp(16px, 3vw, 40px) 64px; }
.wrap { max-width: 1240px; margin: 0 auto; }

/* ---------- Общие элементы ---------- */
.label { font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.h-display { font-family: var(--font-display); font-weight: 500; text-transform: uppercase; letter-spacing: -0.01em; line-height: 1.08; margin: 0; }
h1.page-title { font-family: var(--font-display); font-weight: 500; font-size: var(--text-xl); text-transform: uppercase; line-height: 1.15; letter-spacing: -0.005em; margin: 6px 0 0; text-wrap: balance; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: var(--text-sm); color: var(--muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-decoration-color: var(--fr); text-underline-offset: 3px; }
.card { background: var(--white); border-radius: var(--r-lg); padding: clamp(18px, 2.4vw, 28px); }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border-radius: var(--r-full); border: 1px solid var(--line);
  background: var(--white); color: var(--ink);
  font-size: var(--text-sm); font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.1s;
}
.btn:hover { border-color: rgba(29, 29, 29, 0.35); }
.btn:active { transform: translateY(1px); }
.btn--dark { background: var(--ink); color: var(--white); border-color: var(--ink); }
.btn--dark:hover { background: #333; }
.btn--fr { background: var(--fr-light); border-color: transparent; }
.btn--fr:hover { background: var(--fr); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-full); background: var(--cool); font-size: var(--text-xs); color: var(--ink-2); white-space: nowrap; }
.chip--fr { background: var(--fr-light); color: var(--ink); }
.chip--warm { background: var(--warm); }
.muted { color: var(--muted); }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 12px; font-size: var(--text-sm); color: var(--muted); }
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Главная ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--warm); border-radius: var(--r-lg);
  padding: clamp(24px, 4vw, 48px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end;
}
.hero h1 { font-size: var(--text-2xl); max-width: 16ch; margin-top: 14px; }
.hero p { max-width: 58ch; color: var(--ink-2); margin: 16px 0 0; font-size: var(--text-lg); line-height: 1.5; }
.hero-mark { width: clamp(70px, 9vw, 120px); color: var(--ink); opacity: 0.92; }
.hero-search { margin-top: 24px; max-width: 560px; position: relative; }
.hero-search input { width: 100%; height: 52px; border-radius: var(--r-full); border: 0; background: var(--white); padding: 0 20px 0 48px; font-size: var(--text-base); box-shadow: var(--shadow); }
.hero-search input:focus { outline: 3px solid var(--fr); }
.hero-search .ico { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.sec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.sec-card { display: flex; flex-direction: column; gap: 14px; text-decoration: none; transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); min-height: 240px; }
.sec-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.sec-card .top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sec-card .n { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 500; }
.sec-card h2 { font-family: var(--font-display); font-weight: 500; text-transform: uppercase; font-size: clamp(1.1rem, 0.95rem + 0.6vw, 1.4rem); margin: 0; line-height: 1.15; }
.sec-card p { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.sec-card ul { list-style: none; margin: auto 0 0; padding: 14px 0 0; border-top: 1px solid var(--line-2); display: grid; gap: 6px; }
.sec-card li { font-size: var(--text-sm); display: flex; gap: 8px; align-items: center; color: var(--ink-2); }
.sec-card li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--fr); flex-shrink: 0; }

.home-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.quick a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--cool-2); text-decoration: none; font-weight: 500; font-size: var(--text-sm); transition: background 0.2s var(--ease); }
.quick a:hover { background: var(--fr-light); }
.quick .qi { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--white); flex-shrink: 0; }
.src-list { display: grid; gap: 12px; margin: 14px 0 16px; }
.src { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start; padding: 14px; border-radius: var(--r-md); background: var(--cool-2); }
.src .qi { grid-row: span 2; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--white); }
.src b { font-weight: 600; font-size: var(--text-sm); }
.src span { font-size: var(--text-xs); color: var(--muted); }
.src a { font-size: var(--text-xs); color: var(--fr-ink); }
.notice { margin-top: 10px; padding: 10px 14px; border-radius: var(--r-md); background: var(--fr-wash); font-size: var(--text-sm); }
.notice--warn { background: #fbe9e7; color: #6d1b14; }

/* ---------- Раздел ---------- */
.group-block { margin-top: 28px; }
.group-block h2 { font-size: var(--text-lg); font-weight: 600; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.item-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--r-md); background: var(--white); text-decoration: none; min-height: 128px; transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.item-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.item-card b { font-weight: 600; line-height: 1.3; }
.item-card .foot { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.kind-ico { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--cool); }
.kind-ico--fr { background: var(--fr-light); }

/* ---------- Документ ---------- */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: start; }
.doc-layout.no-toc { grid-template-columns: minmax(0, 1fr); }
.doc { background: var(--white); border-radius: var(--r-lg); padding: clamp(20px, 3.5vw, 48px); min-width: 0; }
.doc-body { max-width: 78ch; font-size: 1rem; line-height: 1.65; color: var(--ink-2); }
.doc-body > :first-child { margin-top: 0; }
.doc-body h2, .doc-body h3, .doc-body h4, .doc-body h5, .doc-body h6 { color: var(--ink); line-height: 1.25; text-wrap: balance; }
.doc-body h2 { font-size: var(--text-xl); font-weight: 600; margin: 2.2em 0 0.6em; padding-top: 0.8em; border-top: 1px solid var(--line-2); }
.doc-body h3 { font-size: var(--text-lg); font-weight: 600; margin: 1.8em 0 0.5em; }
.doc-body h4, .doc-body h5, .doc-body h6 { font-size: var(--text-base); font-weight: 600; margin: 1.5em 0 0.4em; }
.doc-body p { margin: 0 0 0.8em; }
.doc-body ul, .doc-body ol { padding-left: 1.4em; margin: 0 0 1em; }
.doc-body li { margin: 0.25em 0; }
.doc-body li::marker { color: var(--muted); }
.doc-body .li-strong { font-weight: 500; color: var(--ink); }
.doc-body a { color: var(--fr-ink); text-decoration-color: var(--fr); text-underline-offset: 3px; }
.doc-body strong { color: var(--ink); font-weight: 600; }
.doc-body .al-c { text-align: center; }
.doc-body .al-r { text-align: right; }
.doc-body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.doc-body .tc { border-radius: 3px; }
.doc-fig { margin: 1.2em 0; }
.doc-img { display: block; border-radius: var(--r-sm); border: 1px solid var(--line-2); cursor: zoom-in; background: var(--cool-2); max-width: 100%; height: auto; }
.doc.image-only .doc-body { max-width: none; }
.doc.image-only .doc-img { margin: 0 auto; }
.tbl-wrap { overflow-x: auto; margin: 1em 0 1.4em; border: 1px solid var(--line); border-radius: var(--r-md); }
.doc-table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); line-height: 1.45; }
.doc-table td { border: 1px solid var(--line-2); padding: 10px 12px; vertical-align: top; min-width: 120px; }
.doc-table td p { margin: 0 0 0.4em; }
.doc-table td p:last-child { margin: 0; }
.doc-table td ul, .doc-table td ol { margin: 0; }
.doc-table tr:first-child td { background: var(--cool-2); font-weight: 500; color: var(--ink); }
.toc { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100dvh - var(--header-h) - 48px); overflow: auto; padding: 18px; border-radius: var(--r-lg); background: var(--white); }
.toc ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 5px 8px; border-radius: 8px; font-size: var(--text-sm); text-decoration: none; color: var(--ink-2); line-height: 1.35; }
.toc a:hover { background: var(--cool-2); }
.toc a.is-active { background: var(--fr-light); color: var(--ink); }
.toc .l3 a { padding-left: 20px; font-size: var(--text-xs); }
mark, .hl { background: var(--fr-light); color: inherit; border-radius: 3px; padding: 0 2px; }
.flash { animation: flash 2.2s var(--ease); }
@keyframes flash { 0%, 40% { background: var(--fr-light); } 100% { background: transparent; } }

/* ---------- Таблица ---------- */
.notes { display: grid; gap: 8px; margin-bottom: 16px; }
.note { padding: 14px 16px; border-radius: var(--r-md); background: var(--warm-2); font-size: var(--text-sm); color: var(--ink-2); border-left: 4px solid var(--warm); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.field { position: relative; flex: 1 1 260px; max-width: 420px; }
.field input, .select { width: 100%; height: 42px; border-radius: var(--r-full); border: 1px solid var(--line); background: var(--white); padding: 0 16px 0 40px; }
.select { padding: 0 14px; width: auto; min-width: 160px; cursor: pointer; }
.field .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.field input:focus, .select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--fr-light); }
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin: -2px 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.flt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.flt-l { font-size: var(--text-xs, 12px); color: var(--muted); padding-left: 6px; }
.flt .select { height: 38px; min-width: 150px; max-width: 240px; }
.flt-range { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.flt .select.date { min-width: 0; width: 150px; padding: 0 10px; }
.flt-reset { height: 38px; }
.flt-reset[hidden] { display: none; }
.grid td.dt { white-space: nowrap; }
.count { margin-left: auto; font-size: var(--text-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.grid-wrap { background: var(--white); border-radius: var(--r-lg); overflow: auto; max-height: calc(100dvh - var(--header-h) - 120px); border: 1px solid var(--line-2); }
table.grid { border-collapse: separate; border-spacing: 0; font-size: var(--text-sm); line-height: 1.4; min-width: 100%; font-variant-numeric: tabular-nums; }
.grid th, .grid td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.grid th { position: sticky; top: 0; z-index: 2; background: var(--ink); color: var(--white); font-weight: 500; white-space: nowrap; font-size: var(--text-xs); letter-spacing: 0.02em; }
.grid td { max-width: 420px; white-space: pre-line; overflow-wrap: anywhere; }
.grid td.num { text-align: right; white-space: nowrap; }
.grid td.c-first { position: sticky; left: 0; background: var(--white); z-index: 1; font-weight: 500; }
.grid th.c-first { left: 0; z-index: 3; }
.grid tr:hover td { background: var(--cool-2); }
.grid tr.grp td { background: var(--warm-2); font-weight: 600; color: var(--ink); }
.grid td.mark { background: var(--fr-light) !important; text-align: center; color: transparent; padding: 0; min-width: 22px; }
.grid td.mark::after { content: '•'; color: var(--ink); }
.grid.compact td, .grid.compact th { padding: 6px 8px; white-space: nowrap; }
.grid.compact td.c-first, .grid.compact td:nth-child(2) { min-width: 110px; }
.grid .rn { color: var(--faint); font-size: var(--text-xs); text-align: right; width: 1%; white-space: nowrap; }
.more { display: flex; justify-content: center; padding: 16px; }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: var(--text-lg); margin-bottom: 6px; }

/* ---------- Чек-лист ---------- */
.progress { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: var(--r-lg); background: var(--white); margin-bottom: 14px; position: sticky; top: calc(var(--header-h) + 8px); z-index: 5; box-shadow: 0 6px 18px -14px rgba(0,0,0,.35); }
.bar { flex: 1; height: 10px; border-radius: var(--r-full); background: var(--cool); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--fr); border-radius: inherit; transition: width 0.4s var(--ease); }
.progress b { font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.cl { display: grid; gap: 10px; }
.cl-item { background: var(--white); border-radius: var(--r-md); padding: 14px 18px; transition: background 0.25s var(--ease); }
.cl-item.done { background: #f3f8fc; }
.cl-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 12px; align-items: start; cursor: pointer; }
.cl-num { font-family: var(--font-display); font-size: 13px; font-weight: 500; color: var(--muted); min-width: 22px; padding-top: 3px; }
.cl-text { font-weight: 500; color: var(--ink); white-space: pre-line; }
.cl-side { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cl-sub { list-style: none; margin: 10px 0 0; padding: 10px 0 0 34px; border-top: 1px dashed var(--line); display: grid; gap: 6px; }
.cl-sub .cl-row { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.cl-sub .cl-text { font-weight: 400; color: var(--ink-2); font-size: var(--text-sm); }
.cl-sub .cl-num { font-family: var(--font-body); font-size: var(--text-xs); }
.cb { appearance: none; width: 22px; height: 22px; border-radius: 7px; border: 2px solid rgba(29,29,29,.35); background: var(--white); display: grid; place-items: center; cursor: pointer; margin: 1px 0 0; transition: background .2s var(--ease), border-color .2s var(--ease); }
.cb:checked { background: var(--ink); border-color: var(--ink); }
.cb:checked::after { content: ''; width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }

/* ---------- Поиск ---------- */
.results { display: grid; gap: 10px; }
.result { display: block; padding: 16px 18px; border-radius: var(--r-md); background: var(--white); text-decoration: none; transition: box-shadow .2s var(--ease); }
.result:hover { box-shadow: var(--shadow); }
.result .rt { font-weight: 600; }
.result .rs { color: var(--muted); font-size: var(--text-sm); margin-top: 4px; }
.result .rm { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Вход ---------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--ink); color: var(--white); }
.login-art { padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.login-art .brand-logo { height: clamp(28px, 4vw, 44px); width: auto; align-self: flex-start; }
.login-art h1 { font-size: var(--text-2xl); max-width: 14ch; }
.login-art p { color: rgba(255,255,255,.7); max-width: 46ch; }
.login-foot { display: flex; justify-content: space-between; font-size: var(--text-xs); color: rgba(255,255,255,.5); letter-spacing: .1em; text-transform: uppercase; }
.login-panel { background: var(--cool); color: var(--ink); display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); background: var(--white); border-radius: var(--r-lg); padding: clamp(24px, 4vw, 36px); box-shadow: var(--shadow); }
.login-card h2 { font-size: var(--text-xl); margin: 0 0 6px; font-weight: 600; }
.login-card .login-form { display: grid; gap: 12px; margin-top: 20px; }
.login-card label { font-size: var(--text-sm); font-weight: 500; }
.login-card input { height: 48px; border-radius: var(--r-md); border: 1px solid var(--line); padding: 0 16px; font-size: var(--text-base); }
.login-card input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--fr-light); }
.login-card .btn { justify-content: center; min-height: 48px; font-size: var(--text-base); }
.code-input { letter-spacing: .5em; font-variant-numeric: tabular-nums; text-align: center; font-size: 1.4rem !important; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: var(--text-xs); margin: 18px 0 6px; text-transform: uppercase; letter-spacing: .1em; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.err { color: var(--danger); font-size: var(--text-sm); min-height: 1.2em; }

/* ---------- Лайтбокс ---------- */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(20, 20, 20, 0.88); display: grid; place-items: center; padding: 24px; opacity: 0; pointer-events: none; transition: opacity .25s var(--ease); }
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: min(1400px, 100%); max-height: calc(100dvh - 48px); border-radius: var(--r-sm); background: #fff; cursor: zoom-out; }
.lightbox .icon-btn { position: absolute; top: 16px; right: 16px; color: #fff; }

/* ---------- Скелетоны ---------- */
.sk { background: linear-gradient(90deg, rgba(29,29,29,.06), rgba(29,29,29,.11), rgba(29,29,29,.06)); background-size: 200% 100%; animation: sk 1.4s linear infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }
.fade-in { animation: fade .35s var(--ease) both; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-full); font-size: var(--text-sm); opacity: 0; transition: all .3s var(--ease); z-index: 1100; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- Адаптив ---------- */
@media (max-width: 1180px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .topbar-title { display: none; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-grid; }
  .side { position: fixed; top: var(--header-h); left: 0; z-index: 35; width: min(340px, 88vw); transform: translateX(-102%); transition: transform .3s var(--ease); box-shadow: 0 0 40px rgba(0,0,0,.2); }
  body.nav-open .side { transform: none; }
  .scrim { display: block; position: fixed; inset: var(--header-h) 0 0 0; background: rgba(0,0,0,.3); z-index: 30; opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .home-row { grid-template-columns: minmax(0, 1fr); }
  .user-email { display: none; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-art { min-height: 0; }
}
@media (max-width: 680px) {
  :root { --header-h: 58px; }
  .topbar { gap: 8px; padding: 0 10px; }
  .brand .pill { display: none; }
  .brand-logo { height: 16px; }
  .topbar-search input { height: 38px; padding-right: 12px; }
  .kbd { display: none; }
  .sec-grid { grid-template-columns: minmax(0, 1fr); }
  .quick { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-mark { display: none; }
  .cl-row { grid-template-columns: auto auto minmax(0, 1fr); }
  .cl-side { grid-column: 3; justify-content: flex-start; }
  .cl-sub { padding-left: 8px; }
  .count { margin-left: 0; width: 100%; }
  .filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .flt .select { max-width: none; min-width: 0; width: 100%; }
  .flt-dates { grid-column: 1 / -1; }
  .flt .select.date { width: 100%; }
  .flt-range label { flex: 1; min-width: 0; }
  .flt-range { width: 100%; }
  .grid-wrap { max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@media print {
  .topbar, .side, .toc, .toolbar, .filters, .page-head .actions, .progress .btn { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .doc, .card, .cl-item { padding: 0; }
  .grid-wrap { max-height: none; overflow: visible; }
}

.cl-group { font-family: var(--font-display); font-size: var(--text-base); font-weight: 600; letter-spacing: .02em; margin: 22px 0 10px; color: var(--ink); }
.cl-group:first-child { margin-top: 4px; }
.doc-table tr.tr-group td { background: var(--cool-2); font-weight: 600; color: var(--ink); letter-spacing: .02em; }
.doc-table td.c-narrow { min-width: 0; width: 1%; white-space: nowrap; text-align: center; }

.btn-refresh { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.22); background: transparent; color: #fff; font: inherit; font-size: var(--text-sm); cursor: pointer; white-space: nowrap; }
.btn-refresh:hover { background: rgba(255,255,255,.1); }
.btn-refresh:focus-visible { outline: 2px solid #73BCEA; outline-offset: 2px; }
.btn-refresh[disabled] { opacity: .7; cursor: progress; }
.is-busy svg { animation: kb-spin 1s linear infinite; }
@keyframes kb-spin { to { transform: rotate(360deg); } }
@media (max-width: 1100px) { .btn-refresh span { display: none; } .btn-refresh { padding: 0; width: 34px; justify-content: center; } }

.view-as select { height: 34px; border-radius: 999px; border: 1px solid rgba(255,255,255,.22); background: transparent; color: #fff; font: inherit; font-size: var(--text-sm); padding: 0 30px 0 14px; cursor: pointer; appearance: none; background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%); background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }
.view-as select option { color: #1D1D1D; background: #fff; }
.view-as select:focus-visible { outline: 2px solid #73BCEA; outline-offset: 2px; }
.viewas-bar { background: #BBDDF3; color: #1D1D1D; font-size: var(--text-sm); padding: 9px 20px; text-align: center; }
.viewas-bar[hidden] { display: none; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: #1f5f8a; text-decoration: underline; cursor: pointer; }
.access-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; max-width: 100%; }
.access-row .chip { white-space: normal; height: auto; min-height: 24px; padding-block: 3px; max-width: 100%; line-height: 1.35; }
.chip--role { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
@media (max-width: 1100px) { .view-as select { width: 40px; padding: 0; color: transparent; background-position: 50% 15px, 50% 15px; } .view-as select option { color: #1D1D1D; } }

/* ---------- Реестр с отметками (Взаимозамены) ---------- */
.reg-toolbar { flex-wrap: wrap; }
.grid.reg td, .grid.reg th { vertical-align: middle; }
.grid.reg .c-cb { width: 72px; text-align: center; }
.grid.reg .c-cb .cb { margin: 0 auto; }
.grid.reg tr.is-today td { background: var(--fr-wash); }
.grid.reg tr.is-late td:first-child { box-shadow: inset 3px 0 0 #c8793a; }
.reg-date { font-variant-numeric: tabular-nums; font-weight: 600; }
.reg-who { font-size: var(--text-xs); color: var(--muted); margin-top: 2px; }
.cb:disabled { cursor: not-allowed; opacity: .45; }
.cb:checked:disabled { opacity: .7; }
.cb--conf:checked { background: var(--fr-ink); border-color: var(--fr-ink); }
.reg-tails { background: #f6ede4; color: var(--ink); border-radius: var(--r-md); padding: 10px 16px; margin: 0 0 14px; font-size: var(--text-sm); }

/* ---------- Печатная форма ---------- */
.pf-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(29,29,29,.82); overflow: auto; padding: 0 16px 32px; }
body.pf-open { overflow: hidden; }
.pf-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: 820px; margin: 0 auto; padding: 12px 0; color: #fff; }
.pf-bar .btn:not(.btn--dark) { background: #fff; }
.pf-bar-sp { flex: 1; }
.pf-hint { max-width: 820px; margin: 0 auto 10px; background: var(--fr-light); color: var(--ink); border-radius: var(--r-md); padding: 10px 14px; font-size: var(--text-sm); }
.pf-page { max-width: 820px; margin: 0 auto; background: #fff; color: #111; padding: 36px 40px 44px; border-radius: 6px; font-size: 13px; line-height: 1.4; }
.pf-head { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #555; border-bottom: 1px solid #111; padding-bottom: 6px; margin-bottom: 16px; }
.pf-title { font-family: var(--font-display); font-size: 20px; margin: 0 0 4px; }
.pf-subtitle { font-size: 13px; margin-bottom: 4px; }
.pf-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; margin: 6px 0 14px; }
.pf-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pf-table th, .pf-table td { border: 1px solid #333; padding: 6px 7px; vertical-align: top; text-align: left; word-wrap: break-word; }
.pf-table th { overflow-wrap: normal; word-wrap: normal; hyphens: none; background: #eee; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.pf-table td:last-child { min-height: 28px; }
.pf-group td { background: #f2f2f2; font-weight: 700; }
.pf-sub { display: block; padding-left: 12px; color: #333; }
.pf-note { font-size: 10.5px; color: #555; margin-top: 2px; }
.pf-st { font-weight: 600; }
.pf-st--no { color: #111; font-weight: 400; }
.pf-st--ok::before { content: '✓ '; }
.pf-st--no::before { content: '○ '; }
.pf-sign { margin-top: 36px; display: grid; gap: 22px; font-size: 13px; white-space: nowrap; overflow: hidden; }
@media (max-width: 640px) { .pf-page { padding: 20px 14px 28px; } .pf-sign { white-space: normal; } }
@media print {
  body.pf-open > *:not(#pf) { display: none !important; }
  body.pf-open { overflow: visible; background: #fff; }
  .pf-overlay { position: static; background: none; padding: 0; overflow: visible; }
  .pf-bar, .pf-hint { display: none !important; }
  .pf-page { max-width: none; padding: 0; border-radius: 0; }
  .pf-table tr { break-inside: avoid; }
  .pf-sign { break-inside: avoid; }
  @page { size: A4; margin: 14mm 12mm; }
}
.reg-date { white-space: nowrap; }
@media (max-width: 640px) {
  .grid.reg .c-cb { width: 48px; padding-left: 4px; padding-right: 4px; }
  .grid.reg td.c-first { white-space: nowrap; }
}

/* ---------- График отпусков и отгулы ---------- */
:root {
  --ok: #3e8e5c; --ok-wash: #e3f1e8;
  --no: #c8473d; --no-wash: #f9e3e0;
  --wait: #73bcea; --wait-wash: #e4f1fa;
  --or: #ee9a4d; --or-wash: #fdeedd;
}
.vac-bar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-full); background: var(--white); border: 1px solid var(--line-2); }
.seg button { border: 0; background: transparent; height: 34px; padding: 0 16px; border-radius: var(--r-full); cursor: pointer; font-size: var(--text-sm); font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.seg button:hover { background: var(--cool-2); }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.seg--sm button { height: 32px; padding: 0 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--text-sm); color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.lg { width: 22px; height: 12px; border-radius: 4px; display: inline-block; }
.lg.ok { background: var(--ok); }
.lg.no { background: repeating-linear-gradient(135deg, var(--no) 0 3px, #e8908a 3px 6px); }
.lg.wait { background: var(--wait-wash); border: 1.5px dashed #3c8fc4; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--white); border-radius: var(--r-md); padding: 14px 16px; display: grid; gap: 2px; border-top: 4px solid var(--warm); }
.kpi b { font-family: var(--font-display); font-weight: 500; font-size: 1.75rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi span { font-size: var(--text-sm); font-weight: 500; line-height: 1.3; }
.kpi small { font-size: var(--text-xs); color: var(--muted); }
.kpi.k-ok { border-top-color: var(--ok); } .kpi.k-no { border-top-color: var(--no); } .kpi.k-wait { border-top-color: var(--wait); } .kpi.k-none { border-top-color: var(--ink); }
.peaks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: stretch; background: var(--warm-2); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 14px; }
.peaks .label { grid-column: 1 / -1; }
.peak { background: var(--white); border-radius: var(--r-sm); padding: 8px 12px; display: grid; grid-template-columns: 1fr auto; gap: 0 8px; }
.peak b { font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.peak span { font-size: var(--text-xs); font-weight: 600; color: var(--ink); background: var(--fr-light); border-radius: var(--r-full); padding: 1px 8px; align-self: center; }
.peak small { grid-column: 1 / -1; font-size: var(--text-xs); color: var(--muted); line-height: 1.35; }

.gantt-wrap { background: var(--white); border-radius: var(--r-lg); overflow: auto; border: 1px solid var(--line-2); max-height: calc(100dvh - var(--header-h) - 100px); }
table.gantt { border-collapse: separate; border-spacing: 0; font-size: var(--text-xs); width: 100%; table-layout: fixed; min-width: calc(190px + var(--wk, 52) * 16px); }
.gantt col.c-who { width: 190px; }
.gantt th, .gantt td { padding: 0; border-bottom: 1px solid var(--line-2); }
.gantt thead th { position: sticky; z-index: 3; background: var(--ink); color: var(--white); font-weight: 500; }
.gantt thead tr:first-child th { top: 0; height: 30px; }
.gantt thead tr:nth-child(2) th { top: 30px; height: 24px; }
.gantt th.mon { text-align: left; padding: 0 6px; overflow: hidden; white-space: nowrap; text-overflow: clip; letter-spacing: .04em; border-left: 1px solid rgba(255,255,255,.18); }
.gantt th.mon.odd { background: #2b2b2b; }
.gantt th.wk { text-align: center; font-weight: 400; font-size: 10px; overflow: hidden; color: rgba(255,255,255,.75); font-variant-numeric: tabular-nums; }
.gantt th.wk.odd { background: #2b2b2b; }
.gantt th.wk.now { background: var(--fr); color: var(--ink); font-weight: 600; }
.gantt th.who { position: sticky; left: 0; z-index: 4; text-align: left; padding: 6px 12px; background: var(--white); overflow: hidden; border-right: 1px solid var(--line-2); }
.gantt thead th.who { background: var(--ink); color: var(--white); z-index: 5; vertical-align: bottom; padding-bottom: 6px; }
.gantt th.who b { display: block; font-size: var(--text-sm); font-weight: 500; white-space: nowrap; }
.gantt th.who small { color: var(--muted); font-weight: 400; }
.gantt tr.grp th { position: sticky; left: 0; text-align: left; padding: 8px 12px; background: var(--warm-2); font-size: var(--text-xs); letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.gantt tr.is-empty .who b { color: var(--faint); font-style: normal; font-weight: 400; }
.gantt td.w { height: 34px; position: relative; }
.gantt td.w.odd { background: #fafafa; }
.gantt td.w.now { background: var(--fr-wash); }
.gantt tbody tr:not(.grp):hover td.w { background-color: var(--cool-2); }
.gantt td.w i { position: absolute; inset: 8px 0; }
.gantt td.ok i { background: var(--ok); }
.gantt td.no i { background: repeating-linear-gradient(135deg, var(--no) 0 4px, #e8908a 4px 8px); }
.gantt td.wait i { background: var(--wait-wash); border-top: 1.5px dashed #3c8fc4; border-bottom: 1.5px dashed #3c8fc4; }
.gantt td.rs i { left: 3px; border-top-left-radius: 7px; border-bottom-left-radius: 7px; }
.gantt td.re i { right: 3px; border-top-right-radius: 7px; border-bottom-right-radius: 7px; }
.gantt td.wait.rs i { border-left: 1.5px dashed #3c8fc4; }
.gantt td.wait.re i { border-right: 1.5px dashed #3c8fc4; }
.gantt tr.sum th.who, .gantt tr.sum td { position: sticky; bottom: 0; background: var(--cool-2); border-top: 1px solid var(--line); z-index: 2; }
.gantt tr.sum th.who { z-index: 4; }
.gantt tr.sum td { text-align: center; height: 34px; font-weight: 600; font-variant-numeric: tabular-nums; }
.gantt tr.sum td span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 50%; background: var(--fr-light); font-size: 11px; }
.gantt tr.sum td.hot span { background: var(--or); color: var(--ink); }
.hint { font-size: var(--text-sm); margin: 10px 2px 0; }
.vac-list { display: grid; gap: 8px; }
.vac-card { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: 10px 16px; align-items: center; background: var(--white); border-radius: var(--r-md); padding: 12px 16px; }
.vac-card .who { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vac-card.is-empty b { color: var(--faint); font-weight: 400; }
.periods { display: flex; flex-wrap: wrap; gap: 8px; }
.period { display: grid; padding: 6px 12px; border-radius: var(--r-sm); border-left: 4px solid; }
.period b { font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.period small { font-size: var(--text-xs); color: var(--muted); }
.period.ok { background: var(--ok-wash); border-color: var(--ok); }
.period.no { background: var(--no-wash); border-color: var(--no); }
.period.no b { text-decoration: line-through; text-decoration-color: rgba(200,71,61,.6); }
.period.wait { background: var(--wait-wash); border-color: #3c8fc4; border-left-style: dashed; }
.howto { margin-top: 18px; background: var(--white); border-radius: var(--r-md); padding: 14px 18px; font-size: var(--text-sm); }
.howto summary { cursor: pointer; font-weight: 600; }
.howto ol { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 4px; color: var(--ink-2); }

/* отгулы */
.rule { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; background: var(--ink); color: var(--white); border-radius: var(--r-lg); padding: 18px 22px; margin-bottom: 14px; }
.rule .label { color: var(--fr-light); }
.rule p { margin: 4px 0 0; font-size: var(--text-lg); line-height: 1.4; }
.rule p b { color: var(--fr); font-weight: 600; }
.rule-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--fr); color: var(--ink); }
.rule-state { text-align: right; padding-left: 18px; border-left: 1px solid rgba(255,255,255,.2); }
.rule-state b { display: block; font-family: var(--font-display); font-weight: 500; font-size: var(--text-xl); color: var(--fr-light); }
.rule-state.is-past b { color: #f3b3ac; }
.rule-state small { color: rgba(255,255,255,.7); }
.jan { background: var(--white); border-radius: var(--r-md); padding: 14px 18px; margin-bottom: 14px; }
.jan-days { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin-top: 10px; }
.jd { display: grid; justify-items: center; gap: 2px; }
.jd-bar { width: 100%; max-width: 46px; height: 64px; background: var(--cool-2); border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden; }
.jd-bar i { display: block; width: 100%; background: var(--or); border-radius: 8px 8px 0 0; }
.jd b { font-size: var(--text-sm); font-variant-numeric: tabular-nums; min-height: 1.2em; }
.jd small { font-size: var(--text-xs); color: var(--muted); }
.legend--to { margin: 0 0 10px; font-size: var(--text-xs); }
.lg.dot-w, .lg.dot-o, .lg.dot-late { width: 12px; height: 12px; border-radius: 50%; }
.lg.dot-w { border: 2px solid var(--or); background: var(--white); }
.lg.dot-w.comp { background: var(--or); }
.lg.dot-o { background: var(--ok); }
.lg.dot-late { background: var(--no); }
.to-list { background: var(--white); border-radius: var(--r-md); overflow: hidden; }
.to-head, .to-row { display: grid; grid-template-columns: minmax(170px, 1.1fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(220px, 1.6fr) minmax(150px, .9fr); gap: 14px; align-items: center; padding: 10px 16px; }
.to-head { background: var(--ink); color: var(--white); font-size: var(--text-xs); letter-spacing: .04em; position: relative; }
.to-row { border-top: 1px solid var(--line-2); }
.to-row:hover { background: var(--cool-2); }
.to-row .who { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.to-row .who b { font-weight: 500; }
.to-dates { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.to-dates .lbl { display: none; }
.dchip { font-size: var(--text-xs); font-variant-numeric: tabular-nums; padding: 2px 8px; border-radius: var(--r-full); border: 1.5px solid; white-space: nowrap; }
.dchip.w { border-color: var(--or); color: var(--ink); }
.dchip.w.comp { background: var(--or); }
.dchip.o { border-color: var(--ok); background: var(--ok-wash); }
.dchip.o.late { border-color: var(--no); background: var(--no-wash); color: #8e2a22; font-weight: 600; }
.tl-axis { position: relative; height: 16px; }
.tl-axis span, .tl-axis em { position: absolute; top: 0; font-style: normal; font-size: 10px; transform: translateX(-2px); color: rgba(255,255,255,.75); text-transform: uppercase; }
.tl-axis em { transform: translateX(-50%); background: var(--fr); color: var(--ink); padding: 0 4px; border-radius: 4px; font-weight: 600; }
.tl-track { position: relative; height: 22px; background: linear-gradient(90deg, var(--or-wash) 0 25%, var(--cool-2) 25%); border-radius: 11px; }
.tl-track > em { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--fr); transform: translateX(-1px); }
.tl-track i { position: absolute; top: 50%; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); }
.tl-track i.dw { border: 2px solid var(--or); background: var(--white); }
.tl-track i.dw.comp { background: var(--or); }
.tl-track i.do { background: var(--ok); box-shadow: 0 0 0 2px var(--white); }
.tl-track i.do.late { background: var(--no); }
.to-state { display: grid; gap: 4px; justify-items: start; }
.to-state small { font-size: var(--text-xs); color: var(--muted); }
.mini { width: 100%; max-width: 120px; height: 6px; border-radius: 3px; background: var(--cool); overflow: hidden; }
.mini i { display: block; height: 100%; background: var(--ok); }
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-full); font-size: var(--text-xs); font-weight: 600; white-space: nowrap; }
.b-done { background: var(--ok-wash); color: #24603b; }
.b-open { background: var(--wait-wash); color: var(--fr-ink); }
.b-lost { background: var(--no-wash); color: #8e2a22; }
.b-late { background: var(--no); color: var(--white); }
.b-none { background: var(--cool); color: var(--muted); font-weight: 500; }
.b-check { background: var(--or-wash); color: #8a4b0f; cursor: help; }
.to-row.s-none .who b { color: var(--muted); }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .peaks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .to-head { display: none; }
  .to-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .to-row .tl { grid-column: 1 / -1; }
  .to-dates .lbl { display: block; width: 100%; font-size: 11px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
}
@media (max-width: 680px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rule { grid-template-columns: 1fr; }
  .rule-state { text-align: left; border-left: 0; padding-left: 0; border-top: 1px solid rgba(255,255,255,.2); padding-top: 10px; }
  .rule-ico { display: none; }
  .vac-card { grid-template-columns: 1fr; }
  .to-row { grid-template-columns: 1fr; }
  .jan-days { gap: 4px; }
}
@media print {
  .gantt-wrap { max-height: none; overflow: visible; }
  .seg, .howto, .vac-side { display: none !important; }
  .gantt td.w i, .lg, .tl-track i, .dchip, .badge, .kpi, .rule { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (max-width: 640px) {
  .gantt col.c-who { width: 118px; }
  table.gantt { min-width: calc(118px + var(--wk, 52) * 16px); }
  .gantt td.who, .gantt th.who { padding-left: 8px; padding-right: 6px; }
}

/* ---------- Справочник контактов ---------- */
.kpis--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ct-tools .field { max-width: 460px; }
.ct-tools .select { padding-left: 16px; min-width: 210px; }
.ct-brands { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chip-btn { border: 1px solid var(--line); background: var(--white); color: var(--ink-2); height: 30px; padding: 0 12px; border-radius: var(--r-full); font: inherit; font-size: var(--text-sm); font-weight: 500; cursor: pointer; }
.chip-btn:hover { border-color: var(--ink); }
.chip-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.chip-btn--sm { height: 24px; padding: 0 8px; font-size: var(--text-xs); }
.ct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.ct-card { background: var(--white); border-radius: var(--r-md); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; border-top: 4px solid var(--fr); }
.ct-card header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.ct-card header > div { display: grid; gap: 2px; min-width: 0; }
.ct-cfo { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; line-height: 1.1; letter-spacing: .02em; }
.ct-org { font-size: var(--text-sm); color: var(--muted); }
.ct-hours { font-size: var(--text-xs); color: var(--muted); white-space: nowrap; }
.ct-team { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ct-team li { background: var(--cool-2); border-radius: var(--r-sm); padding: 10px 12px; display: grid; gap: 4px; }
.ct-team li.is-hit, .ct-bureau .is-hit { box-shadow: inset 0 0 0 2px var(--fr); }
.ct-role { font-size: var(--text-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.ct-name { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; justify-self: start; }
.ct-name:hover { color: #1f5f8a; text-decoration: underline; }
.ct-name--sm { font-weight: 500; font-size: var(--text-sm); }
.ct-links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--text-sm); }
.ct-links.muted { color: var(--muted); font-size: var(--text-xs); }
.ct-link { display: inline-flex; align-items: center; gap: 2px; min-width: 0; }
.ct-link a { display: inline-flex; align-items: center; gap: 6px; color: #1f5f8a; text-decoration: none; overflow-wrap: anywhere; }
.ct-link a:hover { text-decoration: underline; }
.ct-link a svg { flex: none; color: var(--muted); }
.ct-copy { border: 0; background: none; padding: 4px; border-radius: 6px; color: var(--muted); cursor: pointer; display: inline-flex; }
.ct-copy:hover { background: var(--cool); color: var(--ink); }
.ct-bureau { border-top: 1px solid var(--line-2); padding-top: 10px; }
.ct-bureau .label { font-size: var(--text-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-bottom: 6px; }
.ct-bureau dl { margin: 0; display: grid; gap: 4px; }
.ct-bureau dl > div { display: grid; grid-template-columns: 150px 1fr; gap: 8px; align-items: baseline; border-radius: 6px; padding: 1px 4px; }
.ct-bureau dt { font-size: var(--text-xs); color: var(--muted); }
.ct-bureau dd { margin: 0; }
.ct-people { background: var(--white); border-radius: var(--r-md); overflow: hidden; }
.ct-prow { display: grid; grid-template-columns: minmax(170px, 1.1fr) minmax(220px, 2fr) minmax(220px, 1.5fr) 140px; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--line-2); align-items: start; }
.ct-phead { background: var(--ink); color: var(--white); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; border-top: 0; padding-block: 10px; }
.ct-proles { display: grid; gap: 6px; }
.ct-proles > div { display: grid; gap: 4px; }
.ct-cfos { display: flex; flex-wrap: wrap; gap: 4px; }
.ct-prow .ct-links { flex-direction: column; gap: 4px; }
.ct-issues ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 4px; color: var(--ink-2); }
@media (max-width: 900px) {
  .kpis--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct-phead { display: none; }
  .ct-prow { grid-template-columns: 1fr; gap: 6px; padding: 14px 16px; }
}
@media (max-width: 640px) {
  .ct-grid { grid-template-columns: 1fr; }
  .ct-tools .select { min-width: 0; }
  .ct-tools > label:not(.field) { flex: 1 1 100%; }
  .ct-bureau dl > div { grid-template-columns: 110px 1fr; }
}
@media (max-width: 640px) {
  .kpis--4 { gap: 6px; }
  .kpis--4 .kpi { padding: 8px 10px; border-top-width: 3px; }
  .kpis--4 .kpi b { font-size: 1.2rem; }
  .kpis--4 .kpi span { font-size: var(--text-xs); }
  .kpis--4 .kpi small { display: none; }
  .ct-tools .select { width: 100%; }
}

/* ---------- Статусы строк (Закрывающие документы) ---------- */
.st-tools .select { min-width: 180px; }
.st-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.st-chip { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: baseline; text-align: left; border: 1px solid var(--line); border-left: 4px solid var(--warm); background: var(--white); color: var(--ink); border-radius: var(--r-sm); padding: 7px 12px; font: inherit; cursor: pointer; }
.st-chip span { font-size: var(--text-sm); font-weight: 500; }
.st-chip b { font-family: var(--font-display); font-weight: 500; font-variant-numeric: tabular-nums; }
.st-chip small { grid-column: 1 / -1; font-size: var(--text-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.st-chip:hover { border-color: var(--ink); }
.st-chip[aria-pressed="true"] { background: var(--ink); color: var(--white); border-color: var(--ink); }
.st-chip[aria-pressed="true"] small { color: #cfcfcf; }
.st-chip--all { border-left-color: var(--ink); } .st-chip--none { border-left-color: var(--warm); }
.st-chip--ok { border-left-color: var(--ok); } .st-chip--wait { border-left-color: var(--wait); } .st-chip--no { border-left-color: var(--no); } .st-chip--or { border-left-color: var(--or); }
.st-table { min-width: 920px; width: 100%; }
.st-table td { vertical-align: top; overflow-wrap: break-word; }
.st-table td.c-first { min-width: 120px; max-width: 150px; }
.st-bk { font-weight: 400; font-size: var(--text-sm); color: var(--ink-2); margin-top: 2px; }
.st-table tfoot td { position: sticky; bottom: 0; z-index: 1; }
.st-table .c-sum { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.st-table .c-sup { min-width: 140px; max-width: 200px; font-weight: 500; }
.st-table .c-desc { min-width: 180px; font-size: var(--text-sm); }
.st-table .c-st { width: 205px; min-width: 205px; }
.st-table .c-cm { width: 210px; min-width: 210px; }
.st-table tfoot td { font-weight: 600; background: var(--cool-2); }
.st-sel { width: 100%; font: inherit; font-size: var(--text-sm); padding: 6px 28px 6px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background-color: var(--white); color: var(--ink); cursor: pointer; }
.st-sel--ok { background-color: var(--ok-wash); border-color: var(--ok); }
.st-sel--wait { background-color: var(--wait-wash); border-color: var(--wait); }
.st-sel--no { background-color: var(--no-wash); border-color: var(--no); }
.st-sel--or { background-color: var(--or-wash); border-color: var(--or); }
.st-sel:disabled { opacity: .6; }
.st-badge { display: inline-block; font-size: var(--text-sm); padding: 4px 10px; border-radius: var(--r-sm); background: var(--cool-2); }
.st-badge--ok { background: var(--ok-wash); } .st-badge--wait { background: var(--wait-wash); } .st-badge--no { background: var(--no-wash); } .st-badge--or { background: var(--or-wash); }
.st-badge--none { color: var(--muted); }
.st-cm { width: 100%; min-height: 34px; resize: none; overflow: hidden; font: inherit; font-size: var(--text-sm); line-height: 1.4; padding: 6px 10px; border-radius: var(--r-sm); border: 1px dashed var(--line); background: transparent; color: var(--ink); }
.st-cm:hover { border-color: var(--warm); }
.st-cm:focus { outline: none; border-style: solid; border-color: var(--fr); background: var(--white); }
.st-cm.is-saving { opacity: .6; }
@media (max-width: 760px) {
  .st-table { min-width: 0; }
  .grid-wrap:has(.st-table) { background: transparent; border: 0; max-height: none; overflow: visible; }
  .st-table tbody tr:hover td { background: transparent; }
  .st-table td.c-first { position: static; background: transparent; }
  .st-table thead { display: none; }
  .st-table, .st-table tbody, .st-table tr, .st-table td, .st-table tfoot { display: block; width: auto; }
  .st-table tbody tr { background: var(--white); border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 10px; }
  .st-table td { border: 0; padding: 3px 0; max-width: none; }
  .st-table tfoot td { position: static; }
  .st-table .c-st { min-width: 0; }
  .st-table td[data-label]::before { content: attr(data-label); display: block; font-size: var(--text-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
  .st-table td.c-first::before { display: none; }
  .st-table .c-sum { text-align: left; }
  .st-table .c-st, .st-table .c-cm { width: auto; padding-top: 6px; }
  .st-table tfoot tr { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: var(--r-md); background: var(--cool-2); }
  .st-table tfoot td:empty { display: none; }
  .st-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .st-chip { flex: 0 0 auto; }
}

/* ---------- Внутренние перемещения под реализацию ---------- */
:root { --kb: #3e8e5c; --kb-wash: #e3f1e8; --bk: #d9a514; --bk-wash: #fdf3cf; }
.vp-tools .select { min-width: 200px; font-weight: 600; }
.vp-pick { background: var(--white); border-radius: var(--r-md); padding: 20px 22px; }
.vp-pick b { font-family: var(--font-display); font-weight: 500; font-size: 1.15rem; }
.vp-pick p { margin: 4px 0 14px; font-size: var(--text-sm); }
.vp-pick-list { display: flex; flex-wrap: wrap; gap: 6px; }
.vp-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-bottom: 10px; }
.vp-head .cl-group { margin: 0; }
.vp-legend { display: flex; gap: 14px; font-size: var(--text-sm); }
.vp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.vp-legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.vp-legend i.vp-kb { background: var(--kb-wash); box-shadow: inset 4px 0 0 var(--kb); }
.vp-legend i.vp-bk { background: var(--bk-wash); box-shadow: inset 4px 0 0 var(--bk); }
.vp-wrap { max-height: none; }
.vp-tab { width: 100%; }
.vp-tab td, .vp-tab th { white-space: normal; }
.vp-tab .c-n { width: 48px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.vp-tab .c-dir { width: 160px; white-space: nowrap; font-size: var(--text-sm); font-weight: 500; }
.vp-tab tr.vp-kb td { background: var(--kb-wash); }
.vp-tab tr.vp-bk td { background: var(--bk-wash); }
.vp-tab tr.vp-kb td:first-child { box-shadow: inset 4px 0 0 var(--kb); }
.vp-tab tr.vp-bk td:first-child { box-shadow: inset 4px 0 0 var(--bk); }
.vp-tab tr.vp-kb:hover td { background: #d3eadb; }
.vp-tab tr.vp-bk:hover td { background: #fbeab0; }
.vp-tab tr.is-none td { color: var(--muted); font-style: normal; }
.vp-cfo { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }
.vp-cfo:hover { color: #1f5f8a; text-decoration: underline; }
.seg button.seg-vp-kb[aria-pressed="true"] { background: var(--kb); }
.seg button.seg-vp-bk[aria-pressed="true"] { background: var(--bk); color: var(--ink); }
@media (max-width: 640px) {
  .vp-tools > label:not(.field) { flex: 1 1 100%; }
  .vp-tools .select { width: 100%; }
  .vp-tab .c-dir { width: auto; white-space: nowrap; font-size: var(--text-xs); padding-left: 8px; padding-right: 8px; }
  .vp-tab .c-n { width: 32px; padding-left: 8px; padding-right: 6px; }
}
@media (max-width: 640px) {
  .ct-tools .seg { max-width: 100%; }
  .ct-tools .seg button { padding: 0 11px; }
}

/* ---------- Акты разбора (Д/К) ---------- */
.dk-rules { margin-bottom: 14px; }
.dk-rules ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: var(--text-sm); }
.dk-list { list-style: none; margin: 0 0 18px; padding: 0; background: var(--white); border-radius: var(--r-md); overflow: hidden; }
.dk-list li + li { border-top: 1px solid var(--line-2); }
.dk-row { width: 100%; display: grid; grid-template-columns: minmax(220px, 1.1fr) minmax(0, 1.4fr) auto; gap: 4px 18px; align-items: center; text-align: left; border: 0; background: none; padding: 12px 18px; font: inherit; color: var(--ink); cursor: pointer; }
.dk-row:hover { background: var(--cool-2); }
.dk-row:focus-visible { outline: 2px solid var(--fr); outline-offset: -2px; }
.dk-name { font-weight: 600; }
.dk-main { font-size: var(--text-sm); color: var(--muted); }
.dk-tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.dk-dlg { border: 0; padding: 0; border-radius: var(--r-lg); width: min(760px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); background: var(--white); color: var(--ink); box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.dk-dlg::backdrop { background: rgba(29,29,29,.45); }
.dk-card { display: flex; flex-direction: column; max-height: calc(100dvh - 48px); }
.dk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line-2); border-top: 6px solid var(--fr); }
.dk-head h2 { margin: 6px 0 0; font-family: var(--font-display); font-weight: 500; font-size: 1.35rem; line-height: 1.2; text-transform: none; }
.dk-x { border: 0; background: var(--cool-2); width: 36px; height: 36px; border-radius: 50%; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink); flex: 0 0 auto; }
.dk-x:hover { background: var(--line); }
.dk-body { overflow: auto; padding: 16px 22px; display: grid; gap: 16px; }
.dk-var { display: grid; gap: 10px; }
.dk-var + .dk-var { border-top: 1px dashed var(--line); padding-top: 16px; }
.dk-vt { margin: 0; font-size: var(--text-sm); text-transform: uppercase; letter-spacing: .05em; }
.dk-sec { border-radius: var(--r-sm); padding: 12px 14px; background: var(--cool-2); }
.dk-sec h3 { margin: 0 0 6px; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.dk-sec--main { background: #e4f1fa; box-shadow: inset 4px 0 0 var(--fr); }
.dk-sec--com p { margin: 0; font-size: var(--text-sm); }
.dk-pname { margin: 0 0 10px; font-weight: 600; }
.dk-fields { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dk-fields div { background: var(--white); border-radius: 8px; padding: 8px 10px; }
.dk-fields dt { font-size: var(--text-xs); color: var(--muted); display: grid; }
.dk-fields dt small { font-size: 10px; opacity: .85; }
.dk-fields dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.dk-none { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.dk-foot { display: flex; justify-content: space-between; gap: 8px; padding: 12px 22px 16px; border-top: 1px solid var(--line-2); }
.dk-foot .btn { max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
@media (max-width: 640px) {
  .dk-row { grid-template-columns: 1fr; padding: 12px 14px; }
  .dk-tags { justify-content: flex-start; }
  .dk-dlg { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .dk-card { max-height: 100dvh; height: 100%; }
  .dk-body { flex: 1; }
  .dk-fields { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .dk-head, .dk-body, .dk-foot { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Акты переработки (А/П) ---------- */
.ap-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 4px 0 8px; }
.ap-tabs button { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 2px 10px; align-items: center; text-align: left; border: 1px solid var(--line-2); background: var(--white); border-radius: var(--r-md); padding: 12px 16px; cursor: pointer; font: inherit; color: var(--ink); }
.ap-tabs button small { grid-column: 1; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ap-tabs button b { grid-column: 1; font-weight: 600; }
.ap-tabs button .chip { grid-column: 2; grid-row: 1 / 3; }
.ap-tabs button:hover { background: var(--cool-2); }
.ap-tabs button[aria-selected="true"] { border-color: var(--fr); box-shadow: inset 0 -4px 0 var(--fr); background: #eef7fd; }
.ap-desc { margin: 0 0 12px; font-size: var(--text-sm); color: var(--muted); }
.ap-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--text-xs); color: var(--muted); margin: 6px 0 12px; }
.ap-legend span { display: inline-flex; gap: 6px; align-items: center; }
.ap-legend i { font-style: normal; }
.ap-b { display: inline-block; padding: 2px 8px; border-radius: var(--r-full); font-size: var(--text-xs); font-weight: 600; line-height: 1.5; white-space: normal; }
.ap-ok { background: #e3f1e8; color: #1f6b3a; }
.ap-lim { background: #fde9cc; color: #8a4b00; }
.ap-ban { background: #fbe0de; color: #a3241b; }
.ap-new { background: #fff3a6; color: #6b5a00; }
.ap-none { color: var(--muted); }
.ap-other { margin: 0 0 10px; font-size: var(--text-sm); }
.ap-wrap { background: var(--white); border: 0; margin-top: 0; }
.ap-tab { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.ap-tab th, .ap-tab td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-2); }
.ap-tab thead th { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--white); position: sticky; top: 0; }
.ap-tab .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ap-tab tr.ap-g th { background: var(--cool-2); font-size: var(--text-sm); text-transform: none; letter-spacing: 0; color: var(--ink); }
.ap-tab tr.ap-isnew td { background: #fffbe0; }
.ap-arrow { color: var(--muted); }
@media (max-width: 760px) {
  .ap-tab thead { display: none; }
  .ap-tab, .ap-tab tbody, .ap-tab tr, .ap-tab td, .ap-tab th { display: block; width: 100%; }
  .ap-tab tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .ap-tab tr.ap-g { padding: 0; }
  .ap-tab td { border: 0; padding: 3px 14px; display: grid; grid-template-columns: 42% 1fr; gap: 8px; }
  .ap-tab td::before { content: attr(data-l); font-size: var(--text-xs); color: var(--muted); }
  .ap-tab td:first-child { grid-template-columns: 1fr; font-size: 1rem; }
  .ap-tab td:first-child::before { display: none; }
  .ap-tab .num { text-align: left; }
}
.linkbtn { border: 0; background: none; padding: 0; color: #1f5f8a; text-decoration: underline; cursor: pointer; font: inherit; }
.ap-desc:empty { display: none; }
@media (max-width: 760px) {
  .ap-tab td > * { justify-self: start; }
  .ct-tools [data-fs] { flex-wrap: wrap; border-radius: var(--r-md); }
  .ap-tabs { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ap-tabs button { padding: 10px 12px; }
}
.pw-wrap { position: relative; display: grid; }
.pw-wrap input { padding-right: 96px; }
.pw-eye { position: absolute; right: 6px; top: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: var(--r-md); background: var(--cool-2); color: var(--ink); font: inherit; font-size: var(--text-sm); cursor: pointer; }
.pw-eye:hover { background: var(--line); }
.login-card input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(200, 40, 30, .15); }

/* ---------- Сдача архива ---------- */
.ar-common { background: var(--white); border-radius: var(--r-md); padding: 16px 18px; margin-bottom: 14px; }
.ar-h { margin: 0 0 12px; font-size: var(--text-sm); font-weight: 600; text-transform: none; letter-spacing: 0; font-family: inherit; }
.ar-imgs { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: flex-start; }
.ar-imgs figure { margin: 0; max-width: 100%; }
.ar-imgs figcaption { font-size: var(--text-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.ar-imgs img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line-2); border-radius: 8px; cursor: zoom-in; background: #fff; }
.ar-tabs { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ar-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: var(--text-xs); color: var(--ink-2); margin: 6px 0 12px; }
.ar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ar-legend b { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.ar-note { color: var(--muted); }
.ar-sw { width: 18px; height: 18px; border-radius: 4px; display: inline-grid; place-items: center; font-style: normal; font-weight: 700; font-size: 11px; border: 1px solid var(--line); background: #fff; }
.ar-wrap { background: var(--white); border: 0; margin-top: 0; }
.ar-tab { border-collapse: separate; border-spacing: 0; font-size: var(--text-sm); min-width: 100%; }
.ar-tab th, .ar-tab td { border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); padding: 0; }
.ar-tab thead th { background: var(--ink); color: var(--white); font-weight: 600; font-size: var(--text-xs); padding: 6px 4px; text-align: center; border-color: rgba(255,255,255,.12); }
.ar-tab thead .ar-year { font-size: var(--text-sm); }
.ar-tab .ar-name { position: sticky; left: 0; z-index: 1; background: var(--white); text-align: left; padding: 6px 12px; font-weight: 500; white-space: nowrap; min-width: 160px; }
.ar-tab thead .ar-name { background: var(--ink); z-index: 2; }
.ar-tab td.ar-c { width: 34px; min-width: 34px; height: 30px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.ar-tab.ar-half td.ar-c { min-width: 120px; }
.ar-c.ar-office, .ar-sw.ar-office { color: #d0201a; }
.ar-ok1 { background: #46bdc6 !important; }
.ar-ok2 { background: #34a853 !important; color: #fff; }
.ar-ok2.ar-office { color: #ffd9d6; }
.ar-resub { background: #ffff00 !important; }
.ar-nopay { background: #f1c232 !important; }
.ar-red { background: #ff5a4f !important; }
.ar-red.ar-office { color: #fff; }
.ar-na { background: #d9d9d9 !important; }
.ar-tab tbody tr:hover .ar-name { background: var(--cool-2); }
