/* =========================================================================
   Дизайн-система: публичный сайт и кабинет сотрудника.
   Цвета и размеры — в переменных ниже; меняйте их, а не отдельные правила.
   ========================================================================= */

:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --text: #0a0a0a;
  --text-2: #404040;
  --muted: #737373;
  --faint: #a3a3a3;

  --primary: #0a0a0a;
  --primary-hover: #262626;
  --primary-soft: #f0f0f0;
  --navy: #0a0a0a;
  --navy-2: #1f1f1f;

  --green: #15803d;   --green-soft: #e8f6ee;
  --red: #b91c1c;     --red-soft: #fdecec;
  --amber: #a16207;   --amber-soft: #fef6e0;
  --violet: #6d28d9;  --violet-soft: #f1ebff;
  --blue: #0a0a0a;    --blue-soft: #f0f0f0;
  --gray: #525252;    --gray-soft: #f0f0f0;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(0 0 0 / 4%), 0 2px 8px rgb(0 0 0 / 5%);
  --shadow-lg: 0 10px 30px rgb(0 0 0 / 10%);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --sidebar: 248px;
}

/* ---------- основа ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.55 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 12px; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
        stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon-sm { width: 15px; height: 15px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- кнопки ---------- */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  font: inherit; font-weight: 600; font-size: 14px; line-height: 1;
  color: #fff; background: var(--primary);
  border: 1px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover, button:hover { background: var(--primary-hover); text-decoration: none; }
.btn:focus-visible, button:focus-visible { outline: 3px solid rgb(0 0 0 / 18%); outline-offset: 1px; }
.btn-secondary { color: var(--text); background: var(--surface); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { color: var(--text-2); background: transparent; }
.btn-ghost:hover { background: var(--gray-soft); }
.btn-danger-outline { color: var(--red); background: var(--surface); border-color: #f3c4c4; }
.btn-danger-outline:hover { background: var(--red-soft); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }

/* ---------- формы ---------- */
.field { margin-bottom: 16px; }
.field > label, .label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.req { color: var(--red); }
input, select, textarea {
  width: 100%; height: 42px; padding: 0 12px;
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
select { padding-right: 32px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgb(0 0 0 / 8%); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled input, fieldset:disabled select, fieldset:disabled textarea {
  color: var(--text-2); background: var(--surface-2); border-color: var(--border); cursor: not-allowed;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.hint { margin-top: 5px; font-size: 12px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-2); }
.check input { margin-top: 2px; flex: none; }

/* ---------- карточки и блоки ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 22px 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
             padding: 16px 24px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 15px; }
.card + .card { margin-top: 16px; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 8px 0 16px; padding-top: 24px;  /* над линией 16 + 8, под ней 24 */
                 border-top: 1px solid var(--border); font-size: 15px; }
.section-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.section-title .icon { color: var(--primary); }

/* ---------- уведомления ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 16px; margin-bottom: 16px;
         border-radius: var(--radius-sm); font-size: 14px; border: 1px solid transparent; }
.alert .icon { margin-top: 1px; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert-ok { color: #14532d; background: var(--green-soft); border-color: #c9ebd6; }
.alert-err { color: #7f1d1d; background: var(--red-soft); border-color: #f6cccc; }
.alert-warn { color: #713f12; background: var(--amber-soft); border-color: #f5e1a9; }
.alert-info { color: #262626; background: var(--surface-2); border-color: var(--border); }
.alert-lock { color: var(--text-2); background: var(--gray-soft); border-color: var(--border); }

/* ---------- метки ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
         font-size: 12px; font-weight: 600; border-radius: 99px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.plain::before { display: none; }
.tone-blue { color: var(--blue); background: var(--blue-soft); }
.tone-violet { color: var(--violet); background: var(--violet-soft); }
.tone-green { color: var(--green); background: var(--green-soft); }
.tone-gray { color: var(--gray); background: var(--gray-soft); }
.tone-red { color: var(--red); background: var(--red-soft); }
.tone-amber { color: var(--amber); background: var(--amber-soft); }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 10px 16px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
     color: var(--muted); text-align: left; background: var(--surface-2); border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #fafafa; }
.cell-main { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12px; color: var(--muted); }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty .icon { width: 36px; height: 36px; color: var(--faint); margin-bottom: 8px; }

/* =========================================================================
   Публичный сайт
   ========================================================================= */
.site { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface); }
.site-header { position: sticky; top: 0; z-index: 10; background: rgb(255 255 255 / 92%);
               backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
             color: #fff; background: var(--navy); }
.logo-mark .icon { width: 19px; height: 19px; }
.header-contacts { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.header-contacts a { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; }
.header-contacts .muted { font-size: 13px; }

.hero { position: relative; padding: 56px 0 72px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: start; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; margin-bottom: 18px;
           font-size: 13px; font-weight: 600; color: var(--primary); background: var(--primary-soft); border-radius: 99px; }
.hero h1 { font-size: 42px; line-height: 1.12; letter-spacing: -0.025em; margin-bottom: 18px; }
.hero h1 span { color: var(--muted); }
.lead { font-size: 18px; color: var(--text-2); max-width: 520px; margin-bottom: 30px; }
.features { display: grid; gap: 16px; margin: 0 0 36px; padding: 0; list-style: none; }
.features li { display: flex; gap: 14px; align-items: flex-start; }
.feature-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px;
                border-radius: 10px; color: var(--primary); background: var(--primary-soft); }
.features b { display: block; font-size: 15px; }
.features span { font-size: 14px; color: var(--muted); }
.steps-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.step-card { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.step-num { display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 10px;
            font-size: 13px; font-weight: 700; color: #fff; background: var(--navy); border-radius: 50%; }
.step-card b { display: block; font-size: 14px; margin-bottom: 2px; }
.step-card span { font-size: 13px; color: var(--muted); }

.form-card { position: relative; border: 1px solid var(--border); border-radius: 16px; background: var(--surface);
             box-shadow: var(--shadow-lg); }
.form-card .card-body { padding: 28px; }
.form-card h2 { font-size: 21px; margin-bottom: 4px; }
.form-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.form-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 12px; color: var(--muted); }

.site-footer { margin-top: auto; color: #d4d4d4; background: var(--navy); }
.site-footer .container { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding-top: 40px; padding-bottom: 28px; }
.site-footer .logo { color: #fff; }
.site-footer h3 { margin-bottom: 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #a3a3a3; }
.site-footer p, .site-footer li { font-size: 14px; }
.site-footer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.site-footer a { color: #e5e5e5; }
.footer-bottom { border-top: 1px solid rgb(255 255 255 / 8%); }
.footer-bottom .container { display: flex; justify-content: space-between; padding-top: 16px; padding-bottom: 16px;
                            font-size: 13px; color: #a3a3a3; grid-template-columns: none; }

.center-page { display: grid; place-items: center; flex: 1; padding: 64px 24px; }
.result-card { max-width: 480px; text-align: center; }
.result-card .card-body { padding: 40px 36px; }
.result-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; }
.result-icon .icon { width: 30px; height: 30px; stroke-width: 2.2; }
.result-card h1 { margin-bottom: 10px; }
.result-card p { color: var(--muted); }

/* ---------- вход ---------- */
.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 24px;
             background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .card-body { padding: 32px; }
.auth-card .logo { margin-bottom: 26px; }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

/* =========================================================================
   Кабинет сотрудника
   ========================================================================= */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 20px 14px;
           color: #d4d4d4; background: var(--navy); }
.sidebar .logo { color: #fff; padding: 0 8px; }
.sidebar .logo small { display: block; font-size: 11px; font-weight: 500; color: #a3a3a3; }
.nav-label { padding: 0 10px; margin: 6px 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .08em;
             text-transform: uppercase; color: #737373; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm);
         font-size: 14px; font-weight: 500; color: #d4d4d4; }
.nav a:hover { color: #fff; background: var(--navy-2); text-decoration: none; }
.nav a.active { color: #fff; background: rgb(255 255 255 / 10%); }
.nav a.active .icon { color: #fff; }
.nav .count { margin-left: auto; padding: 1px 8px; font-size: 12px; color: #e5e5e5; background: rgb(255 255 255 / 10%); border-radius: 99px; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgb(255 255 255 / 8%); }
.user { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
          font-weight: 700; color: #fff; background: #404040; }
.user b { display: block; font-size: 14px; color: #fff; }
.user span { font-size: 12px; color: #a3a3a3; }
.sidebar form button { width: 100%; color: #d4d4d4; background: transparent; border-color: rgb(255 255 255 / 14%); }
.sidebar form button:hover { color: #fff; background: var(--navy-2); }

.main { min-width: 0; padding: var(--page); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.crumbs { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* плашки этапов над списком */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat { display: block; padding: 16px; background: var(--surface); border: 1px solid var(--border);
        border-radius: var(--radius); color: var(--text); box-shadow: var(--shadow); transition: border-color .15s; }
.stat:hover { text-decoration: none; border-color: var(--border-strong); }
.stat.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgb(0 0 0 / 6%); }
.stat-title { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--muted); }
.stat-dot { width: 8px; height: 8px; border-radius: 50%; }
.stat-value { margin-top: 4px; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* панель фильтров */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.toolbar .field { margin: 0; }
.toolbar .grow { flex: 1 1 260px; }
.search { position: relative; }
.search .icon { position: absolute; left: 12px; top: 12px; color: var(--faint); }
.search input { padding-left: 38px; }

/* карточка заявки */
.layout-card { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.aside { position: sticky; top: 20px; display: grid; gap: 16px; }
.aside > * { min-width: 0; }  /* длинное содержимое не раздвигает боковую колонку */
.meta-list { margin: 0; display: grid; gap: 10px; font-size: 14px; }
.meta-list div { display: flex; justify-content: space-between; gap: 12px; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; font-weight: 600; text-align: right; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; padding: 16px 24px; border-top: 1px solid var(--border);
                background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.action-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }  /* поле даты не раздувает колонку */
.action-stack form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }

/* лента событий */
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.tl-dot { width: 10px; height: 10px; margin: 6px 0 0 6px; border-radius: 50%; background: currentColor; }
.tl-title { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 14px; }
.tl-title b { font-weight: 600; }
.tl-details { margin-top: 3px; font-size: 13px; color: var(--muted); }

/* реестр */
.tabs { display: flex; gap: 4px; padding: 0 16px; overflow-x: auto; overflow-y: hidden; box-shadow: inset 0 -1px 0 var(--border); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 14px 10px 12px;
       font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .num { padding: 1px 7px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--gray-soft); border-radius: 99px; }
.tab.active .num { color: var(--primary); background: var(--primary-soft); }
.tab.tone-red-tab .num { color: var(--red); background: var(--red-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; font-size: 13px; font-weight: 500;
        color: var(--text-2); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 99px; }
.chip:hover { text-decoration: none; background: var(--surface-2); }
.chip.active { color: var(--primary); background: var(--primary-soft); border-color: var(--border-strong); }
.filters-row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between;
               padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
details.more-filters > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px;
                                 font-weight: 600; color: var(--text-2); list-style: none; }
details.more-filters > summary::-webkit-details-marker { display: none; }
details.more-filters[open] > summary { color: var(--primary); }
.filter-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end;
                padding: 16px 20px; border-bottom: 1px solid var(--border); }
.filter-panel .field { margin: 0; }
.day-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; padding: 8px 24px;
            font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
            color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.log-row { display: grid; grid-template-columns: 56px 190px minmax(0, 1fr) 220px; gap: 16px; align-items: start;
           padding: 12px 24px; border-bottom: 1px solid var(--border); font-size: 14px; }
.log-row:hover { background: #fafafa; }
.log-time { color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.log-actor { display: flex; align-items: center; gap: 8px; min-width: 0; }
.log-actor .avatar { width: 26px; height: 26px; font-size: 12px; color: var(--text-2); background: var(--gray-soft); }
.log-actor span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-request { font-size: 13px; text-align: right; }
.log-request a { font-weight: 600; }
.log-text { margin-top: 4px; font-size: 13px; color: var(--muted); word-break: break-word; }
.changes { margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; font-size: 13px; }
.changes div { display: grid; grid-template-columns: 170px 1fr; gap: 12px; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.changes div:last-child { border-bottom: 0; }
.changes dt { color: var(--muted); }
.changes dd { margin: 0; }
.changes del { color: var(--red); background: var(--red-soft); text-decoration: line-through; padding: 0 4px; border-radius: 4px; }
.changes ins { color: var(--green); background: var(--green-soft); text-decoration: none; padding: 0 4px; border-radius: 4px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; }
.pages { display: flex; gap: 4px; }
.pages a, .pages span { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; font-size: 13px;
                        font-weight: 600; border-radius: var(--radius-sm); color: var(--text-2); }
.pages a:hover { background: var(--gray-soft); text-decoration: none; }
.pages .current { color: #fff; background: var(--primary); }

/* =========================================================================
   Адаптивность
   ========================================================================= */
@media (max-width: 1080px) {
  .layout-card { grid-template-columns: 1fr; }
  .aside { position: static; }
  .log-row { grid-template-columns: 52px 150px minmax(0, 1fr); }
  .log-request { grid-column: 3; text-align: left; }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero h1 { font-size: 32px; }
  .site-footer .container { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .grid-2, .steps-row { grid-template-columns: 1fr; }
  .header-contacts .hide-sm { display: none; }
  .hero { padding: 32px 0 48px; }
  .hero h1 { font-size: 28px; }
  .lead { font-size: 16px; }
  .form-card .card-body, .card-body { padding: 20px 16px; }
  .card-head, .form-actions, .timeline li, .day-head { padding-left: 16px; padding-right: 16px; }
  .log-row { grid-template-columns: auto 1fr; gap: 6px 12px; padding: 12px 16px; }
  .log-row > :nth-child(n+3) { grid-column: 1 / -1; }
  .log-request { text-align: left; }
  .changes div { grid-template-columns: 1fr; gap: 2px; }
  td, th { padding: 10px 12px; }
  .hide-sm { display: none; }
  h1 { font-size: 21px; }
}
.footer-about { margin-top: 14px; max-width: 360px; }
details.more-filters > summary { flex-wrap: wrap; width: 100%; padding: 12px 20px; border-bottom: 1px solid var(--border); }
details.more-filters > summary .chip { height: 26px; font-size: 12px; }
.filter-panel .head-actions { grid-column: 1 / -1; }

/* утилиты */
.m-0 { margin: 0; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.text-amber { color: var(--amber); }
.show-narrow { display: none; }
@media (max-width: 900px) { .show-narrow { display: inline-flex; margin-bottom: 28px; } }
.nav-label-gap { margin-top: 22px; }

/* =========================================================================
   Сотрудники и расписание
   ========================================================================= */
.ml-8 { margin-left: 8px; }
.border-top { border-top: 1px solid var(--border); }
.pre { white-space: pre-line; }
.gap-sm { gap: 0 10px; }
.badge-lg { height: 30px; padding: 0 14px; font-size: 13px; }
.avatar-xs { width: 24px; height: 24px; font-size: 11px; flex: none; }
.person { display: flex; align-items: center; gap: 12px; }
.person .avatar { flex: none; color: #fff; }
.person-lg .avatar { width: 52px; height: 52px; font-size: 20px; }
tr.is-muted td { opacity: .55; }
.narrow-card { max-width: 760px; }
.layout-wide-aside { grid-template-columns: minmax(0, 1fr) 400px; }

/* список-карточка: строки с действием справа */
.mini-list { margin: 0; padding: 0; list-style: none; }
.mini-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px;
                border-bottom: 1px solid var(--border); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list a { display: grid; gap: 2px; min-width: 0; color: var(--text); }
.mini-list a:hover { text-decoration: none; }
.mini-list a:hover b { color: var(--primary); }
.mini-list a span { font-size: 13px; color: var(--muted); }
.meta-wide div { display: grid; grid-template-columns: 130px 1fr; }
.meta-wide dd { text-align: left; font-weight: 500; }

/* недельный график сотрудника */
.hours { padding: 8px 24px; }
.hours-row { display: grid; grid-template-columns: 22px 130px 120px 14px 120px; gap: 10px; align-items: center;
             padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; cursor: pointer; }
.hours-row:last-child { border-bottom: 0; }
.hours-row input[type=time] { height: 36px; }
.hours-row:has(input[type=checkbox]:not(:checked)) .hours-day { color: var(--muted); }
.hours-row:has(input[type=checkbox]:not(:checked)) input[type=time] { opacity: .45; }
.time-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

/* кабинет оценщика: лента записей */
.agenda { margin: 0; padding: 0; list-style: none; }
.agenda-item { display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 14px 24px; border-bottom: 1px solid var(--border); }
.agenda-item:last-child { border-bottom: 0; }
.agenda-item.status-cancelled { opacity: .5; }
.agenda-item.status-cancelled .agenda-title b { text-decoration: line-through; }
.agenda-time { display: grid; align-content: start; font-variant-numeric: tabular-nums; }
.agenda-time b { font-size: 17px; }
.agenda-time span { font-size: 12px; color: var(--muted); }
.agenda-body { display: grid; gap: 3px; color: var(--text); font-size: 14px; }
.agenda-body:hover { text-decoration: none; }
.agenda-body:hover .agenda-title b { color: var(--primary); }
.agenda-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* форма записи: занятость на день */
.avail { padding: 12px 20px; border-bottom: 1px solid var(--border); }
.avail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.avail-head .avatar { color: #fff; }
.avail-head b { flex: 1; }
.avail-slots { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-free, .slot-busy { display: inline-flex; align-items: center; height: 26px; padding: 0 9px; font-size: 12px; font-weight: 600;
                         border-radius: 6px; font-variant-numeric: tabular-nums; }
button.slot-free { color: var(--green); background: var(--green-soft); border: 1px solid #bfe5cd; cursor: pointer; }
button.slot-free:hover, button.slot-free.picked { color: #fff; background: var(--green); }
.slot-free.slot-legend { color: var(--green); background: var(--green-soft); }
.slot-busy { color: var(--muted); background: var(--gray-soft); text-decoration: line-through; }

@media (max-width: 1080px) {
  .layout-wide-aside { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hours { padding: 4px 16px; }
  .hours-row { grid-template-columns: 22px 1fr 1fr; }
  .hours-row .muted { display: none; }
  .hours-row .hours-day { grid-column: 2 / 4; }
  .hours-row input[name^=start] { grid-column: 2; }
  .hours-row input[name^=end] { grid-column: 3; grid-row: 2; }
  .mini-list li, .agenda-item, .avail { padding-left: 16px; padding-right: 16px; }
  .meta-wide div { grid-template-columns: 1fr; gap: 2px; }
}

/* чёрно-белая тема: знак логотипа на тёмном фоне — белый */
.sidebar .logo-mark, .site-footer .logo-mark { color: var(--navy); background: #fff; }
.eyebrow { color: var(--text-2); background: var(--surface); border: 1px solid var(--border); }
.feature-icon { color: var(--text); background: var(--surface); border: 1px solid var(--border); }

/* =========================================================================
   Пошаговая работа с заявкой и кабинет оценщика
   ========================================================================= */

/* полоса этапов над карточкой заявки */
.progress { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 0 0 18px; padding: 16px 12px;
            list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
            box-shadow: var(--shadow); }
.progress li { position: relative; display: grid; justify-items: center; gap: 4px; padding: 0 4px; text-align: center; }
.progress li::before { content: ""; position: absolute; top: 11px; left: calc(-50% + 14px); right: calc(50% + 14px);
                       height: 2px; background: var(--border); }
.progress li:first-child::before { display: none; }
.progress li.done::before, .progress li.now::before { background: var(--text); }
.progress-dot { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
                border: 2px solid var(--border-strong); background: var(--surface); color: #fff; }
.progress li.done .progress-dot { background: var(--text); border-color: var(--text); }
.progress li.now .progress-dot { border-color: var(--text); box-shadow: 0 0 0 4px rgb(0 0 0 / 8%); }
.progress li.now .progress-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text); }
.progress b { font-size: 12px; font-weight: 600; line-height: 1.25; }
.progress li.todo b { color: var(--muted); font-weight: 500; }
.progress small { font-size: 11px; line-height: 1.3; color: var(--muted); }

/* блок «Следующий шаг» */
.next-step { border-color: var(--text); box-shadow: 0 0 0 1px var(--text), var(--shadow); }
.step-text { margin: 0; font-size: 14px; color: var(--text-2); }
.step-text .icon { color: var(--green); }
.amount { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.checklist { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.checklist li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.checklist li .icon { color: var(--faint); }
.checklist li.ok { color: var(--text); }
.checklist li.ok .icon { color: var(--green); }
details.inline-details { margin-top: 2px; padding-top: 12px; border-top: 1px solid var(--border); }
details.inline-details > summary { cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; }
details.inline-details > summary::-webkit-details-marker { display: none; }
details.inline-details > summary::before { content: "› "; }
details.inline-details[open] > summary { margin-bottom: 10px; color: var(--text); }
details.inline-details form { display: grid; gap: 8px; }
.fixed-value { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; font-size: 14px;
               background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* документы и контакты */
.doc-link { display: flex; align-items: center; gap: 12px; padding: 12px; color: var(--text);
            border: 1px solid var(--border); border-radius: var(--radius-sm); }
.doc-link:hover { text-decoration: none; background: var(--surface-2); }
.doc-link span { display: grid; flex: 1; }
.doc-link small { font-size: 12px; color: var(--muted); }
.contact-links { display: grid; gap: 8px; }
.contact-links a { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; }
.how-list { margin: 0 0 12px; padding-left: 20px; font-size: 14px; display: grid; gap: 4px; }

/* карточка выезда: когда, куда, к кому */
.visit { overflow: hidden; }
.visit-row { display: flex; align-items: center; gap: 14px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.visit-row:last-child { border-bottom: 0; }
.visit-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px;
              background: var(--surface-2); border: 1px solid var(--border); }
.visit-main { display: grid; flex: 1; min-width: 0; font-size: 14px; }
.visit-main b { font-size: 15px; }
.visit-main span { color: var(--muted); }
.visit-big { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.visit-note { display: flex; gap: 10px; padding: 14px 24px; font-size: 14px; background: var(--amber-soft); color: #713f12; }
.next-visit { margin-bottom: 16px; border-color: var(--text); box-shadow: 0 0 0 1px var(--text), var(--shadow); }
.next-visit-head { display: grid; gap: 2px; padding: 18px 24px; color: #fff; background: var(--navy); }
.next-visit-head span:last-child { color: #d4d4d4; font-size: 14px; }
.eyebrow-dark { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #a3a3a3; }
.next-visit-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
                   padding: 16px 24px; background: var(--surface-2); border-top: 1px solid var(--border); }

/* список записей оценщика — каждая строка целиком ведёт в запись */
.agenda li { border-bottom: 1px solid var(--border); }
.agenda li:last-child { border-bottom: 0; }
a.agenda-item { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 14px; padding: 14px 24px;
                color: var(--text); border-bottom: 0; }
a.agenda-item:hover { text-decoration: none; background: var(--surface-2); }
a.agenda-item:hover .agenda-title b { color: var(--text); text-decoration: underline; }
.agenda-go { color: var(--faint); }
a.agenda-item.status-done { opacity: .6; }

@media (max-width: 900px) {
  .progress { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 16px; }
  .progress li:nth-child(5)::before { display: none; }
}
@media (max-width: 640px) {
  .visit-row { flex-wrap: wrap; padding: 14px 16px; }
  .visit-row .btn { width: 100%; }
  .next-visit-head, .next-visit-foot, .visit-note { padding-left: 16px; padding-right: 16px; }
  .next-visit-foot form, .next-visit-foot button { width: 100%; }
  a.agenda-item { padding: 12px 16px; grid-template-columns: 52px 1fr auto; }
  .progress small { display: none; }
}

/* =========================================================================
   Выдвижная боковая панель
   На компьютере сворачивается до иконок, на телефоне выезжает слева поверх страницы.
   ========================================================================= */
.app { transition: grid-template-columns .2s ease; }
.sidebar { z-index: 50; overflow-x: hidden; overflow-y: auto; }
.sidebar-top { display: flex; align-items: center; gap: 6px; margin-bottom: 28px; }
.sidebar .menu-btn { color: #d4d4d4; flex: none; }
.sidebar .menu-btn:hover { color: #fff; }
.logo-text { display: block; min-width: 0; line-height: 1.25; }
.sidebar .logo { min-width: 0; }
.nav a { position: relative; white-space: nowrap; }
.nav-text { white-space: nowrap; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; color: inherit;
            background: transparent; border: 0; border-radius: var(--radius-sm); }
.icon-btn:hover { background: rgb(255 255 255 / 10%); }
.topbar, .backdrop { display: none; }

/* компьютер: свёрнутая панель — только иконки, подписи во всплывающих подсказках */
@media (min-width: 901px) {
  .app.collapsed { --sidebar: 72px; }
  .app.collapsed .sidebar { padding-left: 12px; padding-right: 12px; }
  .app.collapsed .logo-text, .app.collapsed .nav-text, .app.collapsed .user-text,
  .app.collapsed .nav-label { display: none; }
  .app.collapsed .sidebar .logo { display: none; }
  .app.collapsed .sidebar-top { justify-content: center; }
  .app.collapsed .nav-label-gap { display: block; height: 1px; margin: 14px 6px; overflow: hidden; color: transparent;
                                  background: rgb(255 255 255 / 10%); }
  .app.collapsed .nav a { justify-content: center; padding: 10px 0; }
  .app.collapsed .nav .count { position: absolute; top: 3px; right: 6px; min-width: 18px; padding: 0 5px;
                               font-size: 10px; line-height: 16px; text-align: center; background: #dc2626; }
  .app.collapsed .sidebar-foot { padding-left: 0; padding-right: 0; }
  .app.collapsed .user { justify-content: center; }
  .app.collapsed .sidebar form button { justify-content: center; padding: 0; }
}

/* телефон и планшет: панель спрятана, выезжает по кнопке меню */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; align-content: start; }  /* короткая страница не растягивает полосу сверху */
  .topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; height: 56px;
            padding: 0 10px; color: #fff; background: var(--navy); }
  .topbar .logo { color: #fff; font-size: 15px; }
  .topbar .logo-mark { width: 30px; height: 30px; color: var(--navy); background: #fff; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); height: 100%;
             transform: translateX(-100%); transition: transform .25s ease; }
  .backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / 45%);
              opacity: 0; pointer-events: none; transition: opacity .25s ease; }
  .app.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgb(0 0 0 / 35%); }
  .app.nav-open .backdrop { opacity: 1; pointer-events: auto; }
  body.no-scroll { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .app, .sidebar, .backdrop { transition: none; }
}

/* реестр договоров */
.registry-table td { vertical-align: top; }
.registry-table .cell-wide { min-width: 260px; max-width: 420px; }

/* =========================================================================
   Имена и аватарки: кружок никогда не сжимается, длинное ФИО переносится (2 строки) или обрезается
   с многоточием; полное имя — во всплывающей подсказке (title).
   ========================================================================= */
.avatar { flex: none; aspect-ratio: 1; font-size: 13px; letter-spacing: .02em; line-height: 1; }
.avatar-xs { font-size: 9.5px; }
.person-lg .avatar { font-size: 18px; }
.user-text, .person > div { min-width: 0; }
.name-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
          overflow-wrap: break-word; hyphens: auto; line-height: 1.3; }
.name-1 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.user b.name-2 { display: -webkit-box; }
.avail-head b.name-1 { flex: 1; }

/* =========================================================================
   Заявки оценщика
   ========================================================================= */
.req-list { margin: 0; padding: 0; list-style: none; }
.req-list li { border-bottom: 1px solid var(--border); }
.req-list li:last-child { border-bottom: 0; }
.req-item { display: flex; align-items: center; gap: 16px; padding: 16px 24px; color: var(--text); }
.req-item:hover { text-decoration: none; background: var(--surface-2); }
.req-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.req-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; }
.req-object { font-size: 14px; color: var(--text-2); display: -webkit-box; -webkit-box-orient: vertical;
              -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.req-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.req-meta span { display: inline-flex; align-items: center; gap: 4px; }
.req-side { display: flex; align-items: center; gap: 10px; color: var(--faint); flex: none; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.summary-grid .card + .card { margin-top: 0; }
.summary-grid .card-head h2, .card-head h2 { display: flex; align-items: center; gap: 8px; }
.summary-text { margin: 0 0 14px; font-size: 15px; line-height: 1.6; }
.progress-compact { padding: 12px; }
.progress-compact b { font-size: 11px; }
@media (max-width: 900px) {
  .summary-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .req-item { padding: 14px 16px; }
}

/* печать сводки по заявке: только содержимое, без меню и кнопок */
@media print {
  body { background: #fff; font-size: 12px; }
  .sidebar, .topbar, .backdrop, .no-print, .tabs { display: none !important; }
  .app { display: block; }
  .main { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  a { color: inherit; text-decoration: none; }
}

/* =========================================================================
   Расписание: фильтр по оценщикам, неделя по дням
   ========================================================================= */
.who-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.who-filter .chip { max-width: 220px; }
.who-filter .chip .avatar { color: #fff; }
.who-filter .chip.active { color: #fff; background: var(--text); border-color: var(--text); }  /* выбранный оценщик — заметно */
.agenda-day { border-bottom: 1px solid var(--border); }
.agenda-day:last-child { border-bottom: 0; }
.agenda-day.is-today { background: #fcfcfc; }
.agenda-day-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px 8px; }
.agenda-day-head a { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; }
.agenda-off { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 24px 8px; }
.agenda-empty { margin: 0; padding: 4px 24px 16px; font-size: 13px; color: var(--muted); }
.agenda-who { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); min-width: 0; }
.agenda-who .avatar { color: #fff; }
div.agenda-item { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 14px; padding: 14px 24px; }
@media (max-width: 640px) {
  .agenda-day-head, .agenda-off, .agenda-empty { padding-left: 16px; padding-right: 16px; }
  div.agenda-item { padding: 12px 16px; grid-template-columns: 52px 1fr; }
}


/* =========================================================================
   Единые отступы окон — меняются здесь, в двух переменных.
   --gap — расстояние между окнами (карточками, колонками, плашками) и от заголовка страницы;
   --pad — отступ содержимого внутри окна (сверху, снизу и по бокам одинаковый);
   --page — поля страницы вокруг окон.
   ========================================================================= */
:root { --gap: 16px; --pad: 24px; --page: 32px; }
@media (max-width: 900px) { :root { --page: 16px; } }
@media (max-width: 640px) { :root { --pad: 16px; } .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* между окнами: каждый следующий блок страницы — ровно на --gap ниже предыдущего */
.main > *, .layout-card > div > * { margin-top: 0; margin-bottom: 0; }
.main > * + *, .layout-card > div > * + * { margin-top: var(--gap); }
.main > .crumbs + * { margin-top: 8px; }  /* «хлебные крошки» относятся к заголовку */
.card + .card { margin-top: var(--gap); }
.layout-card, .layout-wide-aside, .summary-grid, .aside, .stats, .hero .steps-row { gap: var(--gap); }
.aside { top: var(--gap); }

/* внутри окна: одинаковый боковой отступ у всех строк, шапок, панелей и списков */
.card-body { padding: var(--pad); }
/* последнее поле не добавляет свой нижний отступ к отступу окна — снизу столько же, сколько сверху */
.card-body > :last-child, .card-body > .grid-2:last-child > .field { margin-bottom: 0; }
.card-head, .form-actions, .toolbar, .filter-panel, .filters-row, .pager, .hours,
.mini-list li, .timeline li, .req-item, .visit-row, .visit-note, .next-visit-head, .next-visit-foot,
.avail, .day-head, .log-row, .agenda-day-head, .agenda-off, .agenda-empty, a.agenda-item, div.agenda-item,
details.more-filters > summary { padding-left: var(--pad); padding-right: var(--pad); }
.tabs { padding-left: calc(var(--pad) - 10px); padding-right: calc(var(--pad) - 10px); }
th:first-child, td:first-child { padding-left: var(--pad); }
th:last-child, td:last-child { padding-right: var(--pad); }
.empty { padding-left: var(--pad); padding-right: var(--pad); }
/* в колонках-сетках промежуток задаёт gap — собственный отступ карточки не нужен */
.aside > .card + .card, .summary-grid > .card + .card { margin-top: 0; }

.mini-list li > div { display: grid; gap: 2px; min-width: 0; }
.mini-list li > div span { font-size: 13px; color: var(--muted); }

/* подбор свободного времени: полоса дней */
.day-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; padding: 14px var(--pad); }
.strip-day { display: grid; justify-items: center; gap: 1px; padding: 6px 2px; border: 1px solid var(--border);
             border-radius: var(--radius-sm); color: var(--text); text-align: center; }
.strip-day:hover { text-decoration: none; border-color: var(--border-strong); background: var(--surface-2); }
.strip-day span { font-size: 11px; color: var(--muted); }
.strip-day b { font-size: 16px; }
.strip-day { min-width: 0; overflow: hidden; }
.strip-day small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
                   font-size: 10px; color: var(--green); font-weight: 600; }
.strip-day.is-full small { color: var(--red); }
.strip-day.is-off { background: var(--surface-2); }
.strip-day.is-off small, .strip-day.is-off b { color: var(--faint); }
.strip-day.active { color: #fff; background: var(--text); border-color: var(--text); }
.strip-day.active span, .strip-day.active small { color: #d4d4d4; }

/* предупреждение в карточке выезда: «не оплачено», «ждёт подписи новой версии» */
.next-visit-head .badge { justify-self: start; width: fit-content; }

/* профиль оценщика: неделя по дням */
.week-plan { display: grid; gap: var(--gap); margin-bottom: var(--gap); }
.week-plan > .card + .card { margin-top: 0; }  /* промежуток между днями задаёт gap */
.week-plan-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; border-bottom: 0; }
.week-plan-head h2 { justify-content: center; text-align: center; flex-wrap: wrap; gap: 4px 8px; }
.week-plan-back { display: block; padding: 0 var(--pad) 14px; text-align: center; }
/* день — отдельная скруглённая карточка; сегодняшний обведён, прошедшие бледнее */
.week-plan > .agenda-day { overflow: hidden; border: 1px solid var(--border); }
.week-plan .agenda-day-head { padding-top: 16px; padding-bottom: 16px; }
.week-plan .agenda-day-head:has(+ *) { padding-bottom: 8px; }  /* под шапкой есть записи или отметки */
.week-plan .agenda-off, .week-plan .agenda-empty { padding-top: 0; padding-bottom: 16px; }
.week-plan .agenda-item { padding-top: 12px; padding-bottom: 12px; }
.week-plan .agenda li:last-child .agenda-item { padding-bottom: 16px; }
.week-plan > .agenda-day.is-today { background: var(--surface); border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.week-plan > .agenda-day.is-past { opacity: .6; }

/* итоги выезда: галочки «осмотр проведён / договор подписан / оплата получена» */
.visit-results { display: grid; gap: 10px; }
.visit-results .label { margin: 0; }
.visit-results .field { margin: 6px 0 0; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 14px; font-weight: 600;
             border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--text); }
.check-row.is-done { color: var(--muted); background: var(--surface-2); cursor: default; }
.check-row small { font-weight: 400; }
/* памятка оценщику: что сделать на месте */
.on-site { display: grid; gap: 8px; justify-content: stretch; }
.on-site .checklist { margin: 0; }
.on-site .checklist { font-size: 14px; }
.on-site .checklist li { color: var(--text); }
.on-site .checklist li .icon { color: var(--text); }
.on-site .checklist li.ok { color: var(--muted); text-decoration: line-through; }

/* поле суммы: знак валюты внутри справа */
.input-suffix { position: relative; }
.input-suffix input { padding-right: 36px; }
.input-suffix::after { content: attr(data-suffix); position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
                       color: var(--muted); font-size: 15px; pointer-events: none; }

/* =========================================================================
   Тема «Мягкие карточки»: серый фон, белые скруглённые окна без рамок и теней,
   кнопки-«таблетки», поля с мягкой серой заливкой. Вся тема — этот блок.
   ========================================================================= */
:root {
  --bg: #f2f2f5; --surface-2: #f6f6f8; --border: #ececf0; --border-strong: #dcdce2;
  --radius: 18px; --radius-sm: 12px; --shadow: none; --field: #f2f2f5;
}
.card, .stat, .week-plan > .agenda-day { border: 0; box-shadow: none; }
.card-head, .toolbar { border-bottom-color: var(--border); }
.stat:hover { background: var(--surface-2); }
.stat.active { box-shadow: 0 0 0 2px var(--text); }
.next-step { box-shadow: 0 0 0 2px var(--text); }
.week-plan > .agenda-day.is-today { box-shadow: 0 0 0 2px var(--text); }

/* кнопки — «таблетки» */
.btn, button { border-radius: 999px; }
.btn-secondary { background: var(--field); border-color: transparent; }
.btn-secondary:hover { background: var(--border); }
.btn-danger-outline { background: var(--red-soft); border-color: transparent; }

/* поля: мягкая заливка без рамки, при вводе — белые с чёрной обводкой */
input, select, textarea { background: var(--field); border-color: transparent; border-radius: var(--radius-sm); }
input:hover, select:hover, textarea:hover { background: var(--border); }
input:focus, select:focus, textarea:focus { background: var(--surface); border-color: var(--text); box-shadow: none; }
input[type=checkbox] { background: none; }
fieldset:disabled input, fieldset:disabled select, fieldset:disabled textarea { background: var(--surface-2); border-color: transparent; }
.fixed-value, .doc-link, .check-row, .strip-day { border-color: transparent; background: var(--field); }
.doc-link:hover, .strip-day:hover { background: var(--border); }
.check-row.is-done { background: var(--surface-2); }
.strip-day.active { background: var(--text); }
.strip-day.is-off { background: var(--surface-2); }

/* плашки, метки, фильтры */
.alert { border: 0; border-radius: 14px; }
.chip { border-color: transparent; background: var(--surface); }
.chip.active { background: var(--text); color: #fff; }
.nav a { border-radius: 999px; }

/* светлое боковое меню (и верхняя полоса на телефоне): белое, активный пункт — серая «таблетка» */
.sidebar { color: var(--text-2); background: var(--surface); }
.sidebar .logo, .sidebar .user b { color: var(--text); }
.sidebar .logo small, .sidebar .user span, .nav-label { color: var(--muted); }
.sidebar .logo-mark, .topbar .logo-mark { color: #fff; background: var(--text); }
.nav a { color: var(--text-2); }
.nav a:hover { color: var(--text); background: var(--bg); }
.nav a.active { color: var(--text); font-weight: 600; background: var(--bg); }
.nav a.active .icon { color: var(--text); }
.nav .count { color: #fff; background: var(--text); }
.sidebar-foot { border-top-color: var(--border); }
.sidebar form button { color: var(--text-2); background: var(--bg); border-color: transparent; }
.sidebar form button:hover { color: var(--text); background: var(--border); }
.sidebar .menu-btn { color: var(--text-2); }
.sidebar .menu-btn:hover { color: var(--text); }
.icon-btn:hover { background: var(--bg); }
@media (max-width: 900px) {
  .topbar { color: var(--text); background: var(--surface); border-bottom: 1px solid var(--border); }
  .topbar .logo { color: var(--text); }
  .app.nav-open .sidebar { box-shadow: 0 0 40px rgb(0 0 0 / 15%); }
}
.sidebar .user .avatar { color: #fff; }  /* правило для подписей .user span выше не должно глушить инициалы */

/* выравнивание: дополнительные кнопки на сером фоне страницы — белые, иначе их не видно */
.page-head .btn-secondary, .head-actions .btn-secondary { background: var(--surface); }
.page-head .btn-secondary:hover, .head-actions .btn-secondary:hover { background: var(--border); }
/* полоса этапов: подписи всех шагов на одной линии, сколько бы строк ни было у соседей */
.progress { align-items: start; }
/* карточка выезда у оценщика: тёмная шапка повторяет скругление окна */
.next-visit { overflow: hidden; box-shadow: 0 0 0 2px var(--text); }
/* таблицы: заголовки в одну строку, график сотрудника не переносится */
th { white-space: nowrap; }
.registry-table .col-mid { min-width: 200px; }  /* вид стоимости и заказчик — без переносов по слову */
.staff-hours { white-space: nowrap; }
/* подвал формы: подсказка по центру строки с кнопкой */
.form-actions { align-items: center; }
/* телефон: плашки этапов — одна лента с прокруткой вбок, список заявок сразу на первом экране */
@media (max-width: 640px) {
  .stats { display: flex; overflow-x: auto; gap: 8px; scrollbar-width: none; padding: 2px; margin: -2px; }  /* место для обводки выбранной */
  .stats::-webkit-scrollbar { display: none; }
  .stat { flex: none; min-width: 112px; padding: 12px 14px; }
  .stat-value { font-size: 18px; }
  .stat-title { white-space: nowrap; }
}

/* заявка у оценщика: первая строка выезда — день крупно, время под ним */
.visit-when .visit-main b { font-size: 17px; }

/* выпадающий список в стиле сайта (рисует form.js; на телефоне — родной список) */
.cselect { position: relative; }
.cselect-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.cselect-btn { width: 100%; height: 42px; justify-content: space-between; gap: 10px; padding: 0 14px;
               font-weight: 400; font-size: 14px; color: var(--text); background: var(--field);
               border: 1px solid transparent; border-radius: var(--radius-sm); }
.cselect-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.cselect-btn::after { content: ""; flex: none; width: 7px; height: 7px; margin-top: -4px; border: solid var(--muted);
                      border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); transition: transform .15s; }
.cselect-btn:hover { background: var(--border); }
.cselect-btn.is-empty span { color: var(--muted); }
.cselect.open .cselect-btn { background: var(--surface); border-color: var(--text); }
.cselect.open .cselect-btn::after { margin-top: 4px; transform: rotate(225deg); }
.cselect.invalid .cselect-btn { border-color: var(--red); }
.cselect-btn:disabled { color: var(--text-2); background: var(--surface-2); cursor: not-allowed; }
.cselect-list { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; min-width: 100%; max-width: min(520px, 90vw);
                max-height: 300px; overflow-y: auto; padding: 6px; background: var(--surface); border-radius: 14px;
                box-shadow: 0 12px 32px rgb(0 0 0 / 14%), 0 0 0 1px rgb(0 0 0 / 4%); display: none; }
.cselect.open .cselect-list { display: block; }
.cselect-item { position: relative; padding: 9px 34px 9px 12px; font-size: 14px; line-height: 1.35; border-radius: 10px;
                cursor: pointer; }
.cselect-item:hover { background: var(--bg); }
.cselect-item.is-empty { color: var(--muted); }
.cselect-item.selected { font-weight: 600; }
.cselect-item.selected::after { content: ""; position: absolute; right: 14px; top: 50%; width: 5px; height: 10px;
                                margin-top: -7px; border: solid var(--text); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.toolbar .cselect, .filter-panel .cselect { min-width: 0; }

/* подвал формы серый — дополнительная кнопка в нём белая с тонкой обводкой, иначе сливается */
.form-actions .btn-secondary { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-strong); }
.form-actions .btn-secondary:hover { background: var(--bg); }

.cselect-item.disabled { color: var(--faint); cursor: default; }
.cselect-item.disabled:hover { background: none; }

/* =========================================================================
   Единая система кнопок и полей (последнее слово — здесь):
   - все кнопки и поля одной высоты 42px, кнопки — «таблетки»;
   - чёрная — одно главное действие; белая с обводкой — остальные; красная обводка — отказ/отмена брони;
     текстовая — «Отмена»;
   - где стоят: действия страницы — справа вверху; кнопки формы — слева внизу в подвале формы;
     в правой панели — на всю ширину.
   ========================================================================= */
.btn, button, .btn-lg { height: 42px; padding: 0 18px; font-size: 14px; font-weight: 600; border-radius: 999px; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-secondary, .page-head .btn-secondary, .head-actions .btn-secondary, .form-actions .btn-secondary {
  color: var(--text); background: var(--surface); border-color: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }
.btn-secondary:hover, .page-head .btn-secondary:hover, .head-actions .btn-secondary:hover, .form-actions .btn-secondary:hover {
  background: var(--bg); }
.btn-danger-outline { color: var(--red); background: var(--surface); border-color: transparent; box-shadow: inset 0 0 0 1px #f0b8b8; }
.btn-danger-outline:hover { background: var(--red-soft); }
.btn-ghost { color: var(--text-2); background: transparent; box-shadow: none; }
.btn-ghost:hover { color: var(--text); background: var(--bg); }
.form-actions { justify-content: flex-start; gap: 10px; }

/* поля и выпадающие списки: колонки форм строго пополам, длинный текст не раздвигает соседей */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field, .cselect { min-width: 0; }
input, select, textarea, .cselect-btn, .fixed-value { height: 42px; }
textarea { height: auto; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
/* текст в поле списка: обычная высота строки, иначе у «g», «у», «р» обрезаются хвостики */
.cselect-btn span { line-height: 1.5; padding: 1px 0; }

/* «Начало» записи: поле ввода времени со списком свободного времени */
.time-combo input { padding-right: 14px; }
.time-combo.invalid input { border-color: var(--red); background: var(--surface); }
.start-hint.is-error { color: var(--red); }

/* фильтры реестра договоров: основная строка, свёрнутые редкие, кнопки */
.filter-main { grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(0, 1fr)); border-bottom: 0; }
.filter-actions { display: flex; align-items: center; gap: 10px; padding: 0 var(--pad) 16px; }
.more-filters + .filter-actions { padding-top: 12px; }
@media (max-width: 900px) { .filter-main { grid-template-columns: repeat(2, minmax(0, 1fr)); } .filter-search { grid-column: 1 / -1; } }
