/* Кабинет клиента А3 (lk.a3.house). Токены, шрифт и тёмная тема — из Стройки (portal.a3.house). Сначала телефон (390px), потом компьютер. */


@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url('fonts/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --brand: #00aeef;
  --brand-dark: #263d4e;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --sunken: #eef1f3;
  --text: #14181b;
  --heading: #263d4e;
  --muted: #46525a;
  --subtle: #6a747b;
  --line: #e3e7ea;
  --line-strong: #cfd6db;
  --accent: #0173b4;
  --accent-hover: #01679f;
  --accent-soft: #e6f7fe;
  --link: #0b7ba8;
  --link-hover: #076183;
  --success: #2f7d52;
  --danger: #b3463c;
  --warn: #a8641a;
  --shadow: 0 12px 32px rgba(10, 20, 28, 0.08);
  --logo-day: block;
  --logo-night: none;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --radius-sm: 8px;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1417;
    --surface: #161c21;
    --sunken: #1d252b;
    --text: #e7ecef;
    --heading: #e7ecef;
    --muted: #a3aeb5;
    --subtle: #7a858c;
    --line: #2a343b;
    --line-strong: #3b464e;
    --accent: #0d7cbd;
    --accent-hover: #1590d6;
    --accent-soft: #14242e;
    --link: #7fc9f5;
    --link-hover: #a3daf9;
    --success: #6cc08c;
    --danger: #e08b82;
    --warn: #e0a85c;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    --logo-day: none;
    --logo-night: block;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
h1 { font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; margin: 4px 0 6px; color: var(--heading); }
h2 { font-size: 18px; line-height: 1.25; font-weight: 600; margin: 26px 0 10px; color: var(--heading); }
h3 { font-size: 16px; margin: 0 0 4px; color: var(--heading); }
b, strong { font-weight: 600; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.nowrap { white-space: nowrap; }
.logo-day { display: var(--logo-day); }
.logo-night { display: var(--logo-night); }

/* шапка */
.top { background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: inset 0 3px 0 var(--brand); }
.top-in { max-width: 860px; margin: 0 auto; padding: 14px 16px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top-in img { height: 30px; width: auto; }
.me { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.me form { margin: 0; }
.me .who { display: none; color: var(--subtle); }
button.link { border: 0; background: none; padding: 0; font: inherit; color: var(--link); cursor: pointer; }
button.link:hover { color: var(--link-hover); text-decoration: underline; }
.preview-bar { background: var(--warn); color: #1a1205; text-align: center; padding: 10px 16px; font-weight: 600; font-size: 14px; }
.preview-bar a { color: #1a1205; text-decoration: underline; margin-left: 8px; }

.wrap { max-width: 860px; margin: 0 auto; padding: 18px 16px 96px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card.accent { border-left: 4px solid var(--brand); }
.flash { background: var(--accent-soft); border-left: 3px solid var(--brand); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px; }
.error { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px; }

/* вкладки: на телефоне внизу, на компьютере сверху */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { display: block; text-align: center; padding: 11px 2px 10px; font-size: 12.5px; color: var(--muted); position: relative; line-height: 1.2; }
.tabs a:hover { text-decoration: none; color: var(--heading); }
.tabs a.on { color: var(--heading); font-weight: 600; box-shadow: inset 0 3px 0 var(--brand); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 600; line-height: 18px; margin-left: 2px; }

/* проект */
.sub { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.big-stage { font-size: 26px; font-weight: 600; color: var(--heading); line-height: 1.2; margin: 2px 0 12px; }
.label { font-size: 13px; color: var(--subtle); text-transform: none; }
progress { width: 100%; height: 12px; border: 0; border-radius: 6px; overflow: hidden; background: var(--sunken); display: block; appearance: none; -webkit-appearance: none; }
progress::-webkit-progress-bar { background: var(--sunken); border-radius: 6px; }
progress::-webkit-progress-value { background: var(--brand); border-radius: 6px; }
progress::-moz-progress-bar { background: var(--brand); border-radius: 6px; }
progress.thin { height: 6px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 14px 0 0; }
.facts div b { display: block; font-size: 17px; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 22px 1fr; gap: 0 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.steps li:last-child { border-bottom: 0; }
.dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 5px; border: 2px solid var(--line-strong); background: var(--surface); }
.dot.work { border-color: var(--brand); background: var(--brand); }
.dot.done, .dot.accepted { border-color: var(--success); background: var(--success); }
.steps .name { font-weight: 600; }
.steps .state { font-size: 14px; color: var(--muted); }
.tag { display: inline-block; font-size: 12.5px; padding: 1px 8px; border-radius: 6px; background: var(--sunken); color: var(--muted); border: 1px solid var(--line); }
.tag.ok { color: var(--success); border-color: color-mix(in srgb, var(--success) 40%, var(--line)); }
.tag.wait { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }

/* лента */
.day { font-size: 14px; font-weight: 600; color: var(--subtle); margin: 22px 0 8px; }
.event { display: grid; grid-template-columns: 22px 1fr; gap: 0 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.event .dot { margin-top: 6px; }
.event.report .dot { border-color: var(--brand); background: var(--brand); }
.event .where { font-size: 13px; color: var(--subtle); }
.event p { margin: 4px 0 0; white-space: pre-wrap; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; grid-column: 1 / -1; }
.photos a { display: block; border-radius: var(--radius-sm); overflow: hidden; background: var(--sunken); aspect-ratio: 1 / 1; }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pager { display: flex; justify-content: space-between; margin-top: 16px; }

/* документы */
.doc { padding: 12px 0; border-bottom: 1px solid var(--line); }
.doc:last-child { border-bottom: 0; }
.doc .t { font-weight: 600; display: block; word-break: break-word; }
.doc .meta { font-size: 13.5px; color: var(--muted); }
.sign-box { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.sign-box form { margin: 0 0 14px; }
.btn { display: inline-block; padding: 13px 20px; border: 0; border-radius: var(--radius-sm); font: inherit; font-weight: 600;
  background: var(--accent); color: #fff; cursor: pointer; text-align: center; }
.btn:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--link); border: 1px solid var(--line-strong); }
.btn.ghost:hover { background: var(--sunken); color: var(--link-hover); }
.btn.block { display: block; width: 100%; }
.btn.sm { padding: 8px 14px; font-size: 14px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; margin-bottom: 12px; }
label.check input { margin-top: 4px; width: 20px; height: 20px; flex: none; }
.form label { display: block; font-size: 14px; font-weight: 500; color: var(--muted); margin-bottom: 14px; }
.form input[type=text], .form input[type=password], .form input[type=file] { display: block; width: 100%; margin-top: 5px; padding: 12px 13px; font: inherit;
  color: var(--text); background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.form input:focus { outline: 3px solid color-mix(in srgb, var(--brand) 30%, transparent); border-color: var(--brand); background: var(--surface); }
input[type=file] { font-size: 14px; }

/* деньги и контакты */
.money { display: grid; grid-template-columns: 1fr; gap: 8px; }
.money .row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.money .row b { font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.pay:last-child { border-bottom: 0; }
.pay b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.person { padding: 12px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person .role { font-size: 13px; color: var(--subtle); }
.person .name { font-weight: 600; font-size: 17px; }
.person a.call { display: inline-block; margin: 6px 14px 0 0; padding: 8px 0; font-weight: 600; font-size: 16px; }
.tile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; color: var(--text); }
.tile:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: var(--shadow); }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }

/* вход */
.auth { max-width: 400px; margin: 7vh auto 0; padding: 0 16px; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand img { height: 52px; width: auto; margin: 0 auto 12px; }
.auth-brand h1 { font-size: 20px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.auth .card { border-top: 3px solid var(--brand); box-shadow: var(--shadow); }

@media (min-width: 760px) {
  body { font-size: 16px; }
  h1 { font-size: 30px; }
  .me .who { display: inline; }
  .top-in img { height: 34px; }
  .tabs { position: static; display: flex; gap: 4px; border: 0; background: none; padding: 0; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
  .tabs a { padding: 12px 18px; font-size: 15px; box-shadow: none; }
  .tabs a.on { box-shadow: inset 0 -3px 0 var(--brand); }
  .wrap { padding-bottom: 64px; }
  .photos { grid-template-columns: repeat(4, 1fr); }
  .facts { grid-template-columns: repeat(4, 1fr); }
  .money { grid-template-columns: repeat(3, 1fr); }
  .money .row { display: block; }
}
.money .label { display: block; }

/* раздел сотрудников (/staff) */
h2.first { margin-top: 0; }
.search { display: flex; gap: 8px; align-items: stretch; margin-bottom: 14px; }
.search input[type=text] { margin-top: 0; flex: 1; min-width: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.actions form, .doc form { margin: 0; }
.doc form { margin-top: 8px; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 20px; letter-spacing: 0.04em; user-select: all; }
.feed-text { white-space: pre-wrap; margin: 4px 0 0; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.thumbs a { display: block; width: 72px; height: 72px; border-radius: var(--radius-sm); overflow: hidden; background: var(--sunken); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.form textarea { display: block; width: 100%; margin-top: 5px; padding: 12px 13px; font: inherit; color: var(--text); background: var(--sunken);
  border: 1px solid var(--line); border-radius: var(--radius-sm); resize: vertical; }
.form textarea:focus { outline: 3px solid color-mix(in srgb, var(--brand) 30%, transparent); border-color: var(--brand); background: var(--surface); }
