/* CRM аренды «Кама». Цвета и размеры — из дизайн-системы сайта агентства (sayt-kama16/design-system/tokens.css);
   янтарный «внимание» добавлен здесь. Экран рассчитан на телефон, на широком экране стоит колонкой по центру. */
:root {
  --ink: #0F1A2A; --text: #3A4452; --muted: #5F6B7A; --line: #E3E7EC; --chip: #F0F3F7; --bg: #F5F7FA; --card: #FFFFFF;
  --act: #0052B0; --link: #006CB4; --act-bg: #EEF4FB; --good: #1B7A3F; --good-bg: #E8F5EE; --warn: #7A4F00; --warn-bg: #FEF3DC;
  --warn-line: #C98A00; --star: #F5A623;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #E9EDF2; color: var(--text); font-size: 15px; line-height: 22px; -webkit-text-size-adjust: 100%; }
a { color: var(--link); text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }

#app { max-width: 480px; min-height: 100%; margin: 0 auto; background: var(--bg); display: flex; flex-direction: column; }
.main { flex: 1 1 auto; padding: 14px 16px 24px; display: flex; flex-direction: column; gap: 10px; }
.pad-nav { padding-bottom: 88px; }
.pad-foot { padding-bottom: 96px; }

/* шапки */
.head { background: var(--card); border-bottom: 1px solid var(--line); padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; z-index: 5; }
.head-row { display: flex; align-items: center; gap: 8px; }
.head h1 { font-size: 24px; line-height: 29px; font-weight: 700; color: var(--ink); flex: 1 1 auto; min-width: 0; }
.head.sub h1 { font-size: 20px; line-height: 25px; }
.head .under { font-size: 13px; line-height: 18px; color: var(--muted); }
.back { width: 44px; height: 44px; margin-left: -12px; display: flex; align-items: center; justify-content: center; color: var(--ink); flex-shrink: 0; }
.icon-btn { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-btn.act { border: 0; background: var(--act); color: #fff; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* переключатели */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--chip); border-radius: 10px; padding: 4px; }
.seg > * { height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-weight: 600; display: flex; align-items: center; justify-content: center; white-space: nowrap; padding: 0 6px; }
.seg > .on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 26, 42, 0.12); }
.seg.small > * { height: 36px; font-size: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.row { flex-wrap: nowrap; }
.chips.row > * { flex: 1 1 0; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip-btn { height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--chip); color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap; }
.chip-btn.on { background: var(--act); color: #fff; }
.chip-btn.soft { background: var(--card); border: 1px solid var(--line); font-weight: 500; color: var(--text); }
.chip-btn.soft.on { background: var(--act-bg); border-color: var(--act-bg); color: var(--act); font-weight: 600; }

/* карточки и строки */
.card { background: var(--card); border-radius: 14px; box-shadow: 0 1px 3px rgba(15, 26, 42, 0.04); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.card.tight { padding: 2px 14px; gap: 0; }
.card.blue { background: var(--act-bg); box-shadow: none; }
.card.warn { background: var(--warn-bg); box-shadow: none; gap: 4px; padding: 12px 14px; }
.card.warn p { color: var(--warn); font-size: 13px; line-height: 18px; }
h2 { font-size: 18px; line-height: 23px; font-weight: 600; color: var(--ink); }
.h2-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 6px; }
.small { font-size: 13px; line-height: 18px; color: var(--muted); }
.tiny { font-size: 12px; line-height: 16px; color: var(--muted); }
.strong { font-weight: 600; color: var(--ink); }
.good { color: var(--good); } .warnc { color: var(--warn); } .actc { color: var(--act); }
.b600 { font-weight: 600; }
.ell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.between { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.line { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line > :first-child { color: var(--muted); }
.line > :last-child { font-weight: 600; color: var(--ink); text-align: right; }
.tag { border-radius: 6px; padding: 4px 8px; font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; background: var(--chip); color: var(--ink); }
.tag.good { background: var(--good-bg); color: var(--good); } .tag.warn { background: var(--warn-bg); color: var(--warn); } .tag.act { background: var(--act-bg); color: var(--act); }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.dim { opacity: 0.6; }
a.card { color: inherit; }

/* карточка квартиры в списке: адрес заголовком, под ним комнаты значком, площадь, этаж, цена */
.kv { background: var(--card); border-radius: 14px; box-shadow: 0 1px 3px rgba(15, 26, 42, 0.04); padding: 12px; display: flex; gap: 12px; color: inherit; }
.kv .thumb { position: relative; width: 72px; height: 72px; border-radius: 8px; background: var(--line); flex-shrink: 0; overflow: hidden; }
.kv .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kv .rate { position: absolute; left: 4px; bottom: 4px; display: inline-flex; align-items: center; gap: 2px; padding: 1px 5px; border-radius: 6px; background: rgba(255, 255, 255, 0.94); font-size: 12px; line-height: 18px; font-weight: 700; color: var(--ink); }
.kv .body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kv .addr { font-size: 17px; line-height: 24px; font-weight: 700; color: var(--ink); }
.spec { display: flex; align-items: center; gap: 6px; font-size: 15px; line-height: 24px; }
.spec .price { font-weight: 500; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rb { min-width: 30px; height: 24px; padding: 0 5px; border-radius: 6px; font-size: 13px; line-height: 24px; font-weight: 700; text-align: center; flex-shrink: 0; background: var(--chip); color: var(--ink); }
.rb.r-st { background: #F0E9FB; color: #5B2DA3; } .rb.r-1 { background: #E1EDFB; color: #0052B0; }
.rb.r-2 { background: #DDF3EE; color: #0B6B5E; } .rb.r-3, .rb.r-4 { background: #FCE9DA; color: #9A4A00; }
svg.star { width: 12px; height: 12px; fill: var(--star); }
.stars { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px; background: var(--chip); color: inherit; }

/* квартира */
.contact { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.contact:last-of-type { border-bottom: 0; }
.contact .name { display: block; font-size: 16px; line-height: 22px; font-weight: 700; color: var(--ink); }
.contact .tel { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
.call { width: 44px; height: 44px; border-radius: 999px; background: var(--act); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.call svg { width: 20px; height: 20px; }
.photos { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px; }
.photos img { height: 200px; border-radius: 12px; scroll-snap-align: start; flex-shrink: 0; background: var(--line); }
.bigprice { font-size: 26px; line-height: 29px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 8px; font-size: 13px; line-height: 18px; }
.grid2 .v { font-weight: 600; color: var(--ink); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile { background: var(--chip); border-radius: 8px; padding: 10px 6px; text-align: center; }
.tile b { display: block; font-size: 17px; line-height: 22px; color: var(--ink); }
.tile span { font-size: 12px; line-height: 16px; color: var(--muted); }
.tile.miss { background: var(--warn-bg); } .tile.miss b, .tile.miss span { color: var(--warn); }
.subtabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-bottom: 1px solid var(--line); margin: 0 -16px -12px; }
.subtabs a { text-align: center; padding: 12px 0; color: var(--muted); font-weight: 600; }
.subtabs a.on { color: var(--act); border-bottom: 2px solid var(--act); }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* взаимодействие */
.note { background: var(--card); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.note.pin { border-left: 3px solid var(--star); }
.note .who { font-weight: 600; color: var(--ink); font-size: 14px; }
.chg { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.chg:last-child { border-bottom: 0; }
.chg s { color: var(--muted); }

/* формы */
.field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 0; min-width: 0; }
.field > span { font-size: 13px; line-height: 18px; color: var(--muted); }
.input { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; font-size: 16px; font-weight: 500; color: var(--ink); background: var(--card); }
textarea.input { height: auto; padding: 10px 12px; font-weight: 400; line-height: 22px; resize: vertical; }
.input:focus { outline: 2px solid var(--act); outline-offset: -1px; }
.input.miss { border-color: var(--warn-line); background: var(--warn-bg); }
fieldset.field { border: 0; margin: 0; padding: 0; }
input:checked + .opt { background: var(--act); border-color: var(--act); color: #fff; font-weight: 600; }
.opt { display: inline-flex; align-items: center; cursor: pointer; }
.cols { display: flex; gap: 8px; align-items: flex-end; }
.av { margin-left: 5px; background: var(--act-bg); color: var(--act); border-radius: 4px; padding: 0 5px; font-size: 11px; line-height: 16px; font-weight: 700; display: inline-block; }
.calc { height: 44px; border-radius: 8px; padding: 0 12px; background: var(--chip); color: var(--ink); font-weight: 600; font-size: 16px; line-height: 44px; }
.btn { height: 48px; border: 0; border-radius: 8px; background: var(--act); color: #fff; font-weight: 600; display: flex; align-items: center; justify-content: center; padding: 0 16px; flex: 1 1 0; text-align: center; }
.btn.out { background: var(--card); border: 1px solid var(--act); color: var(--act); }
.btn.quiet { background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.btn.h44 { height: 44px; }
.btn:disabled { opacity: 0.55; }
.err { color: #B3261E; font-size: 14px; }

/* низ экрана */
.foot { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; background: var(--card); box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06); padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); display: flex; gap: 8px; z-index: 6; }
.nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; background: var(--card); box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06); display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px 4px calc(10px + env(safe-area-inset-bottom)); z-index: 6; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 12px; line-height: 16px; }
.nav a.on { color: var(--act); font-weight: 600; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 110px; max-width: 420px; width: calc(100% - 32px); background: var(--ink); color: #fff; border-radius: 10px; padding: 10px 14px; z-index: 20; text-align: center; }

/* вход */
.login { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 24px 20px; }
.login h1 { font-size: 26px; line-height: 31px; font-weight: 800; color: var(--ink); }
.logo { font-weight: 800; color: #E02024; letter-spacing: 0.02em; }
