/* Садик PWA — те же цвета и размеры, что в приложении:
   синий #2B8BD9, кнопки 52px, карточки с радиусом 18. */
:root {
  --primary: #2B8BD9; --primary-dark: #1C6CB0; --amber: #F5A524; --green: #2FA36B;
  --red: #D9485F; --orange: #E8833A; --milk: #FFFBF5; --ink: #2E2A24; --muted: #7A7166;
  --line: #EDE4D6; --card: #fff; --radius: 18px; --btn: 52px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--milk); color: var(--ink);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; text-decoration: none; }
h1 { font-size: 20px; margin: 0; }
h3 { font-size: 16px; margin: 20px 4px 8px; }
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; }

/* ───── Раскладка: снизу панель на телефоне, слева — на ноутбуке ───── */
.layout { min-height: 100vh; }
main { padding-bottom: calc(96px + var(--safe-b)); }
.page { max-width: 960px; margin: 0 auto; padding: 8px 16px 24px; }
.rail { display: none; }
.bottom {
  position: fixed; inset: auto 0 0 0; z-index: 20; display: flex; background: #fff;
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
}
.bottom a, .rail a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 2px; font-size: 12px; color: var(--muted); min-width: 0; text-align: center;
}
.bottom a span, .rail a span { font-size: 22px; line-height: 1.2; }
.bottom a.on, .rail a.on { color: var(--primary); font-weight: 700; }
@media (min-width: 900px) {
  .layout { display: grid; grid-template-columns: 104px 1fr; }
  .rail {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh;
    background: #fff; border-right: 1px solid var(--line); padding: 12px 6px;
  }
  .rail a { flex: none; border-radius: 14px; padding: 10px 4px; }
  .rail a.on { background: rgba(43, 139, 217, .1); }
  .bottom { display: none; }
  main { padding-bottom: 32px; }
  .fab { bottom: 24px; }
}

.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px;
  background: var(--milk); padding: 14px 16px; border-bottom: 3px solid rgba(43, 139, 217, .25);
}
.topbar h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───── Карточки и списки ───── */
.card {
  display: block; background: var(--card); border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 8px; border: 1px solid transparent; box-shadow: 0 1px 2px rgba(46, 42, 36, .05);
}
a.card:hover, button.card:hover { border-color: var(--line); }
.row { display: flex; align-items: center; gap: 12px; }
.row-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.right { text-align: right; }
.list-plain { padding: 0; }
.line { display: flex; gap: 8px; align-items: flex-start; padding: 10px 16px; border-top: 1px solid var(--line); }
.line:first-child { border-top: 0; }
.grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); margin: 12px 0; }
.grid .card { margin: 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid3 b { display: block; font-size: clamp(14px, 4vw, 20px); }
.stat b { display: block; font-size: 24px; margin: 4px 0; }
.stat progress { width: 100%; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; }
.kv b { text-align: right; overflow-wrap: anywhere; }
.stack { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; }
.btn-row .btn { flex: 1; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.center { text-align: center; }
.faded { opacity: .6; }

.tint-red { background: #fdf2f4; } .tint-green { background: #f1faf5; }
.tint-blue { background: #eef6fd; } .tint-amber { background: #fff6e6; }
.note { background: #fdf3ea; }
.banner { display: flex; align-items: center; gap: 12px; }
.banner.amber { background: #fff3dc; } .banner.red { background: #fdecef; }
.big { font-size: 20px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.green { color: var(--green); } .red { color: var(--red); } .blue { color: var(--primary); } .amber-t { color: var(--orange); }
.struck { text-decoration: line-through; color: var(--muted); }

.avatar {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 700; background: hsl(var(--h), 55%, 52%);
}
.tile-icon { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: #eef6fd; }
.cat { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; background: color-mix(in srgb, var(--c) 15%, white); }

.badge {
  display: inline-block; margin: 4px 4px 0 0; padding: 3px 8px; border-radius: 10px; font-size: 12.5px; font-weight: 600;
  background: #eee; max-width: 100%; overflow-wrap: anywhere;
}
.badge.red, .badge.unpaid, .badge.rejected { background: #fbe3e7; color: #a32b3f; }
.badge.green, .badge.paid, .badge.approved { background: #dff3e8; color: #1f7a4f; }
.badge.amber, .badge.partial, .badge.pending { background: #fff0d1; color: #8a5a00; }
.badge.blue { background: #e1effb; color: var(--primary-dark); }
.badge.muted { background: #f0ece6; color: var(--muted); }

/* ───── Кнопки ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--btn);
  padding: 0 20px; border-radius: 16px; border: 1.5px solid var(--line); background: #fff; cursor: pointer;
  font-weight: 600; text-align: center;
}
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:disabled { background: #b9d6ef; border-color: #b9d6ef; cursor: default; }
.btn.danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn.danger-outline { color: var(--red); border-color: #f1c2ca; }
.btn.ghost { background: #fff; }
.btn.wa { color: #25A244; }
.btn.block { width: 100%; }
.btn.sticky, .btn-row.sticky { position: sticky; bottom: calc(76px + var(--safe-b)); margin-top: 16px; z-index: 5; }
@media (min-width: 900px) { .btn.sticky, .btn-row.sticky { bottom: 16px; } }
.btn-row.sticky { background: var(--milk); padding: 8px 0; }
.icon-btn {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent;
  font-size: 20px; cursor: pointer; display: grid; place-items: center;
}
.icon-btn:hover { background: #f2ede6; }
.icon-btn.danger { color: var(--red); } .icon-btn.warn { color: var(--orange); }
.icon-btn.on { background: #e1effb; }
.fab {
  position: fixed; right: 16px; bottom: calc(80px + var(--safe-b)); z-index: 15; min-height: 56px; padding: 0 22px;
  border-radius: 18px; background: var(--primary); color: #fff; font-weight: 700;
  display: flex; align-items: center; box-shadow: 0 6px 16px rgba(43, 139, 217, .35);
}

.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin: 12px 0; }
.quick-btn {
  min-height: 76px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; text-align: center; padding: 8px 4px;
}
.quick-btn span { font-size: 26px; }
.quick-btn.sky { background: #e1effb; color: #13507f; }
.quick-btn.green { background: #dff3e8; color: #1c6643; }
.quick-btn.orange { background: #fcebdd; color: #8a4510; }

/* ───── Поля ───── */
.field { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; }
.field > span { font-size: 14px; color: var(--muted); }
.field input, .field select, .search {
  width: 100%; min-height: 52px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff;
}
.field input:focus, .field select:focus, .search:focus { outline: 2px solid var(--primary); border-color: transparent; }
.field.small input { min-height: 44px; }
.prefix { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; padding-left: 14px; }
.prefix input { border: 0; min-height: 50px; }
.with-icon { position: relative; }
.with-icon input { padding-right: 52px; }
.with-icon .icon-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.search { margin: 8px 0; }
.error { color: var(--red); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.chip {
  flex: none; min-height: 40px; padding: 6px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: #fff; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.chip.on, .chip.radio:has(input:checked) { background: #e1effb; border-color: var(--primary); font-weight: 700; }
.chip.blocked { color: var(--red); }
.chip.radio input, .tile input { position: absolute; opacity: 0; pointer-events: none; }
.chip:disabled { opacity: .6; cursor: default; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(6, 1fr); } }
.tile {
  position: relative; min-height: 72px; border-radius: 16px; border: 1.5px solid var(--line); background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer;
  font-weight: 600; font-size: 14px; text-align: center; padding: 6px;
}
.tile:has(input:checked) { border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 14%, white); font-weight: 800; }
.tile-icon + span { overflow-wrap: anywhere; }

.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: 10px 16px; cursor: pointer; min-height: 44px; }
.seg button.on { background: var(--primary); color: #fff; font-weight: 700; }
.seg.wide { display: flex; } .seg.wide button { flex: 1; }

/* ───── Права ───── */
.perm-sec { padding: 0; overflow: hidden; }
.perm-sec summary {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; list-style: none;
}
.perm-sec summary::-webkit-details-marker { display: none; }
.perm-sec summary b { flex: 1; }
.perm-sec summary::after { content: '▾'; color: var(--muted); transition: transform .2s; }
.perm-sec[open] summary::after { transform: rotate(180deg); }
.count { font-weight: 700; font-size: 14px; }
.perm { border-top: 1px solid var(--line); padding: 10px 16px; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.check small { display: block; }
.params { padding: 4px 0 0 34px; }
.switch { position: relative; display: inline-block; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: #d9d2c6; border-radius: 28px; transition: .2s; }
.switch i::before { content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::before { transform: translateX(18px); }
.summary { margin: 8px 0 0; padding: 0; list-style: none; }
.summary li { padding: 3px 0 3px 26px; position: relative; }
.summary li::before { position: absolute; left: 0; font-weight: 800; }
.summary .yes::before { content: '✓'; color: var(--green); }
.summary .no::before { content: '✗'; color: var(--red); }
.role { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; cursor: pointer; }
.role.on { border: 2px solid var(--primary); background: #eef6fd; }
.role small { display: block; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 0; margin: 8px 0 16px; list-style: none; text-align: center; font-size: 13px; color: var(--muted); }
.steps span { display: grid; place-items: center; width: 32px; height: 32px; margin: 0 auto 4px; border-radius: 50%; background: var(--line); font-weight: 800; }
.steps .on { color: var(--ink); font-weight: 800; }
.steps .on span, .steps .done span { background: var(--primary); color: #fff; }

/* ───── Чек, графики ───── */
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; margin-top: 6px; display: block; cursor: zoom-in; }
.thumb.big { width: 72px; height: 72px; }
.thumb.ph { display: grid; place-items: center; background: #f0ece6; font-size: 26px; cursor: default; }
.receipt { position: relative; display: inline-block; }
.receipt .x { position: absolute; top: -8px; right: -12px; background: #fff; width: 32px; height: 32px; font-size: 14px; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.zoom { width: 100%; border-radius: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.2fr) 2fr auto; gap: 8px; align-items: center; padding: 4px 0; font-size: 14px; }
.bar { height: 10px; background: #f0ece6; border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; }
.chart { display: flex; gap: 8px; align-items: flex-end; height: 200px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.chart .pair { flex: 1; display: flex; gap: 3px; align-items: flex-end; width: 100%; justify-content: center; }
.chart i { width: 40%; border-radius: 4px 4px 0 0; }
.chart .inc { background: var(--green); } .chart .exp { background: var(--orange); }

/* ───── Вход ───── */
.login { max-width: 440px; margin: 0 auto; padding: 24px 20px 48px; text-align: center; }
.login .card { text-align: left; }
.lang-row { display: flex; justify-content: center; }
.sun { width: 84px; height: 84px; margin: 16px auto 8px; border-radius: 50%; display: grid; place-items: center; font-size: 46px; color: var(--amber); background: #fdf0d6; }
.small-sun { width: 48px; height: 48px; font-size: 28px; margin: 0 auto 12px; }
.login .chips { justify-content: center; }

/* ───── Модальные окна и тост ───── */
.modal-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(30, 26, 20, .45); display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 22px; padding: 20px; width: min(480px, 100%); max-height: 90vh; overflow: auto; }
.modal h2 { margin: 0 0 8px; font-size: 19px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.creds { white-space: pre-wrap; background: var(--milk); padding: 12px; border-radius: 12px; font: inherit; }
.toast {
  position: fixed; left: 50%; bottom: calc(88px + var(--safe-b)); transform: translate(-50%, 40px); opacity: 0; pointer-events: none;
  background: #2E2A24; color: #fff; padding: 12px 16px; border-radius: 14px; z-index: 60; display: flex; gap: 12px; align-items: center;
  max-width: min(560px, calc(100% - 32px)); transition: .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.error { background: #8e2234; }
.toast-action { border: 0; background: transparent; color: #8CC8FF; font-weight: 800; cursor: pointer; padding: 8px; }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* ───── Төлөмдөр: бир ай — бир сап, басканда толук маалымат ───── */
.hint { margin: -4px 4px 8px; }
.month { padding: 0; overflow: hidden; }
.month summary {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; min-height: 64px;
}
.month summary::-webkit-details-marker { display: none; }
.month summary .grow { display: flex; flex-direction: column; }
.month summary .right { display: flex; flex-direction: column; align-items: flex-end; }
.month summary .right .badge { margin: 2px 0 0; }
.month summary::after { content: '▾'; color: var(--muted); transition: transform .2s; }
.month[open] summary::after { transform: rotate(180deg); }
.month[open] summary { border-bottom: 1px solid var(--line); background: #fcfaf6; }
.dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: #ccc; }
.dot.green { background: var(--green); } .dot.amber { background: var(--amber); }
.dot.red { background: var(--red); } .dot.muted { background: #cfc8bd; }
.month-body { padding: 4px 14px 12px; }
.pay { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px dashed var(--line); }
.pay:first-child { border-top: 0; }
.pay-icon {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px;
  background: color-mix(in srgb, var(--c) 15%, white);
}
.line-mini { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; font-size: 14px; }
.line-mini > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.line-mini.red { color: var(--red); font-weight: 700; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }

/* ───── Фото документов ───── */
.attach { display: inline-flex; align-items: center; }
.with-icon .attach { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.with-icon .attach .icon-btn { position: static; transform: none; }
.doc-line { align-items: center; }
.doc-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.doc-grid figure { margin: 0; width: 96px; text-align: center; }
.doc-grid img { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; cursor: zoom-in; display: block; }
.doc-grid figcaption { font-size: 12.5px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }

/* ═════ Простой CRM-стиль: нейтральные цвета, текст вместо иконок ═════ */
:root {
  --milk: #F5F6F8; --ink: #1F2328; --muted: #6B7280; --line: #E5E7EB; --radius: 12px;
}
body { font-size: 15px; }
.card { border: 1px solid var(--line); box-shadow: none; }
a.card:hover, button.card:hover { border-color: #cfd4dc; background: #fcfcfd; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 16px; }
.topbar h1 { font-size: 18px; font-weight: 600; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }

/* Навигация — только текст, активный пункт подчёркнут. */
.bottom a, .rail a { font-size: 13px; padding: 14px 4px; gap: 0; }
.bottom a.on { color: var(--primary); box-shadow: inset 0 3px 0 var(--primary); }
.rail { padding-top: 16px; }
.rail a { text-align: left; align-items: flex-start; padding: 10px 14px; border-radius: 8px; }
.rail a.on { background: #eef5fc; color: var(--primary); }
.brand { font-weight: 700; padding: 0 14px 16px; color: var(--ink); }
@media (min-width: 900px) { .layout { grid-template-columns: 200px 1fr; } }

/* Аватар — серый кружок с инициалами. */
.avatar { background: #EFF1F4; color: var(--ink); font-weight: 600; font-size: 14px; width: 40px; height: 40px; }

/* Быстрые действия — обычные кнопки. */
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; margin: 12px 0; }
.quick .btn { min-height: 44px; color: var(--primary-dark); }

/* Баннер: тонкая цветная полоска слева. */
.banner { display: flex; align-items: center; gap: 12px; background: #fff; }
.accent { flex: none; width: 4px; align-self: stretch; min-height: 36px; border-radius: 2px; background: var(--primary); }
.accent.amber { background: var(--amber); } .accent.red { background: var(--red); }
.chev { color: var(--muted); font-size: 20px; }

/* Текстовые кнопки-ссылки (сторно, копировать, позвонить). */
.link-btn { border: 0; background: none; padding: 6px 4px; color: var(--primary-dark); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.link-btn.danger { color: var(--red); } .link-btn.warn { color: #b45309; }

/* Выбор роли: радио-кружок. */
span.radio { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #c5cad3; }
span.radio.on { border: 6px solid var(--primary); }
.role.on { border: 1px solid var(--primary); background: #f5f9fe; }

/* Мягче цвета и меньше радиусы. */
.btn { border-radius: 10px; min-height: 48px; font-weight: 600; }
.chip { border-radius: 8px; min-height: 36px; }
.field input, .field select, .search, .prefix { border-radius: 10px; border-width: 1px; }
.note { background: #fffbeb; border-color: #fde68a; }
.big { font-size: 18px; } .block-b { display: block; }
.bar i { background: var(--primary); }
.stat b { font-size: 22px; font-weight: 700; }
.login h1 { font-size: 26px; margin-top: 24px; }
.fab { border-radius: 12px; box-shadow: 0 4px 12px rgba(31, 35, 40, .15); }
.toast { background: #1F2328; }
/* Узкий телефон: подписи меню и быстрых кнопок — в одну строку. */
.bottom a { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 2px; padding-right: 2px; }
.quick .btn { padding: 0 8px; white-space: nowrap; font-size: 14px; }

/* Неактивная кнопка — серая. */
.btn.primary:disabled { background: #E5E7EB; border-color: #E5E7EB; color: #6B7280; }
/* Детальные экраны: без нижнего меню — кнопка «Сактоо» у самого низа. */
main.detail { padding-bottom: calc(24px + var(--safe-b)); }
main.detail .btn.sticky, main.detail .btn-row.sticky { bottom: calc(12px + var(--safe-b)); }
.hist-title { margin: 10px 0 2px; font-weight: 600; }
/* Квитанция об оплате. */
.receipt-card { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; }
.receipt-card .line-mini { text-align: left; }
.rc-kg { font-size: 18px; } .rc-sum { font-size: 26px; color: var(--green); margin: 8px 0; }

/* Превью чека под суммой. */
#receipt-preview .receipt { margin: 4px 0 8px; }
[hidden] { display: none !important; }
/* Сумма — крупно и жирно. */
.field input[name="amount"] { font-size: 26px; font-weight: 700; min-height: 60px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
#receipt-preview { display: flex; flex-wrap: wrap; gap: 14px; margin: 6px 0; }
/* Кнопки в ряд переносятся на узком экране (длинные русские подписи). */
.btn-row { flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 auto; min-width: 0; white-space: normal; }

/* ── Несколько групп и айлык ── */
.chip.check input { position: absolute; opacity: 0; pointer-events: none; }
.chip.check { position: relative; }
.chip.check.on::before { content: '✓ '; }
.sub { display: block; }
.salary { display: grid; gap: 4px; }
.pick-list h3 { margin-top: 12px; }
button.card.row { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.card.warn { background: #fff6e6; border-color: var(--amber); }
.bar-row.tap { cursor: pointer; }
.bar-row.tap span { color: var(--primary); }
.line-mini .avatar { flex: none; }
.row .grow, .line-mini .grow { min-width: 0; overflow-wrap: anywhere; }

/* ── Топтор ── */
.avatars { display: inline-flex; flex: none; }
.avatars .avatar + .avatar { margin-left: -10px; box-shadow: 0 0 0 2px #fff; }
.avatar.more { font-size: 12px; background: #e1effb; color: var(--primary-dark); }
.row.teachers { margin-top: 6px; gap: 8px; }
.card progress.fill { display: block; width: 100%; margin: 8px 0 4px; }

/* ── Чыгымдар ── */
.chips.scroll { scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.month-switch { display: flex; align-items: center; justify-content: space-between; padding: 4px; }
.month-switch b { font-size: 16px; }
.month-switch .icon-btn { font-size: 24px; color: var(--primary-dark); }
.month-switch .icon-btn:disabled { color: #c5cad3; cursor: default; background: none; }
.exp-total { display: block; font-size: 26px; font-weight: 700; margin: 2px 0; white-space: nowrap; }
.wallets { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 4px; }
.wallets summary { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; cursor: pointer; list-style: none; font-size: 14px; color: var(--muted); }
.wallets summary::-webkit-details-marker { display: none; }
.wallets summary span::after { content: ' ▾'; }
.wallets[open] summary span::after { content: ' ▴'; }
.wallets summary b { color: var(--ink); }
.day-head { display: flex; justify-content: space-between; gap: 8px; margin: 16px 4px 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.exp-list { padding: 0 16px; }
.exp-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.exp-row:first-child { border-top: 0; }
.exp-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.exp-row .amt { flex: none; white-space: nowrap; font-weight: 700; }
.exp-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.exp-meta .link-btn { padding: 4px 0; }
.topbar .link-btn { font-size: 15px; }
.chip { position: relative; }

/* ═════ Как во Flutter-приложении ═════ */
/* Вкладки (Активдүү / Архив) — подчёркивание, как TabBar. */
.tabs { display: flex; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 53px; z-index: 9; }
.tabs button { flex: 1; border: 0; background: none; padding: 12px 8px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--primary); }
/* Аватар: размеры и архив. */
.avatar.md { width: 52px; height: 52px; font-size: 18px; }
.avatar.lg { width: 60px; height: 60px; font-size: 20px; }
.avatar.muted { color: var(--muted); }
.card .name { font-size: 16px; font-weight: 600; }
.card .big { font-size: 20px; font-weight: 800; }
.amt { white-space: nowrap; font-weight: 800; }
.orange { color: var(--orange); }
.note-dot { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--orange); border: 2px solid var(--orange); }
/* Плитки главной: подпись, стрелка, большое число, низ. */
.tiles-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.stat-tile { display: flex; flex-direction: column; gap: 6px; }
.stat-value { font-size: 24px; font-weight: 800; }
.fill-row { display: flex; align-items: center; gap: 10px; }
.fill-row progress { flex: 1; }
progress.fill { appearance: none; -webkit-appearance: none; width: 100%; height: 8px; border: 0; border-radius: 4px; background: #E5E7EB; overflow: hidden; }
progress.fill::-webkit-progress-bar { background: #E5E7EB; border-radius: 4px; }
progress.fill::-webkit-progress-value { background: var(--green); border-radius: 4px; }
progress.fill::-moz-progress-bar { background: var(--green); border-radius: 4px; }
progress.fill.warn::-webkit-progress-value { background: var(--orange); } progress.fill.warn::-moz-progress-bar { background: var(--orange); }
progress.fill.full::-webkit-progress-value { background: var(--red); } progress.fill.full::-moz-progress-bar { background: var(--red); }
progress.fill.two { height: 10px; background: #F8DCE1; }
progress.fill.two::-webkit-progress-bar { background: #F8DCE1; }
.sections { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.section { min-height: 52px; }
/* Графики свёрнуты, раскрываются тапом. */
.charts details { border-top: 1px solid var(--line); }
.charts details:first-child { border-top: 0; }
.charts summary { display: flex; align-items: center; gap: 8px; padding: 12px 16px; cursor: pointer; list-style: none; }
.charts summary::-webkit-details-marker { display: none; }
.charts summary::after { content: '▾'; color: var(--muted); }
.charts details[open] summary::after { transform: rotate(180deg); }
.chart-body { padding: 0 16px 16px; }
.legend { display: flex; gap: 16px; margin-bottom: 8px; font-size: 14px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .inc, .chart .inc { background: var(--green); } .legend .exp, .chart .exp { background: var(--orange); }
.donut { display: grid; place-items: center; margin: 4px 0 12px; }
.legend-list .line-mini { gap: 10px; }
.legend-list .sw { flex: none; width: 12px; height: 12px; border-radius: 3px; }
.legend-list .tap { cursor: pointer; }
.legend-list .tap span:first-of-type { color: var(--primary-dark); }
/* Онбординг. */
.get-started .step { color: var(--ink); }
.get-started .step.done span:first-child { color: var(--green); text-decoration: line-through; }
/* Карточка ребёнка. */
.status { margin-top: 10px; }
.balance { display: flex; flex-direction: column; gap: 4px; }
.big-money { font-size: 22px; font-weight: 800; display: block; }
.kv b.normal { font-weight: 500; }
.contact-card .chips { margin: 4px 0; }
h3.with-trailing { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
h3.with-trailing span { text-transform: none; letter-spacing: 0; font-size: 13px; }
/* Төлөмдөр: три цифры и полоса. */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; }
.figures span { display: block; font-size: 14px; }
.figures b { font-size: clamp(16px, 5vw, 20px); font-weight: 800; white-space: nowrap; }
.due { margin: 4px 4px 8px; font-size: 16px; }
.tile-row { padding: 14px 16px; }
.ob-amt { width: 110px; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; text-align: right; font: inherit; }
.list-plain .line .field { flex: 1; margin: 0; }
/* Мелочи, чтобы совпадало с приложением. */
.section b { font-size: 15px; font-weight: 600; overflow-wrap: normal; word-break: normal; hyphens: auto; }
.legend-list .line-mini > .chev { flex: none; }
.chip.blocked { color: var(--muted); text-decoration: line-through; }
.doc-line .check { justify-content: space-between; align-items: center; }
.doc-line .check input { margin-top: 0; }
.row > .right { display: flex; flex-direction: column; align-items: flex-end; }
/* Заголовки разделов — как SectionTitle в приложении: обычный регистр, тёмные. */
h3 { font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--ink); font-weight: 600; margin: 20px 4px 8px; }
/* Выбранный чип — с галочкой, как ChoiceChip. */
.chip.on::before, .chip.radio:has(input:checked)::before { content: '✓'; font-weight: 700; margin-right: 2px; }
.chip.on, .chip.radio:has(input:checked) { font-weight: 500; }
.chip.check.on::before { content: '✓'; }
.more-btn { width: 32px; height: 32px; font-size: 20px; font-weight: 700; color: var(--ink); margin: -6px -8px 0 0; }
.exp-row .more-btn { align-self: flex-start; }
/* Группы (как GroupsScreen / GroupDetailScreen). */
.group-card { display: flex; flex-direction: column; gap: 8px; }
.teachers-row { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatars { display: inline-flex; gap: 4px; flex: none; }
.avatars .avatar + .avatar { margin-left: 0; box-shadow: none; }
.more-pill { height: 28px; padding: 0 8px; border-radius: 14px; background: var(--line); font-weight: 700; display: inline-grid; place-items: center; }
.tariff-row { font-size: 14px; color: var(--ink); }
.card hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.section-head { align-items: center; }
.section-head h3 { margin-left: 4px; }
.pick-row input { width: 22px; height: 22px; accent-color: var(--primary); flex: none; }
.card .phone { font-size: 17px; font-weight: 600; display: block; }
/* Баштапкы калдыктар: имя не рвётся посреди слова. */
#ob-form .card.row .grow { overflow-wrap: normal; word-break: normal; }
#ob-form .card.row .grow .muted { overflow-wrap: anywhere; }
.ob-amt { width: 96px; }
.btn.block + .card, a.btn.block + .card { margin-top: 8px; }
#ob-form .card.row { gap: 8px; padding: 12px; }
#ob-form .card.row .grow { overflow-wrap: anywhere; }
#ob-form .card.row .name { font-size: 15px; }
#ob-form .card.row .chip { padding: 4px 10px; min-height: 36px; }
.ob-amt { width: 84px; }

/* Объявления платформы и срок подписки на главной. */
.platform-banner { margin: 8px 0; padding: 12px 8px 12px 16px; align-items: flex-start; }
.platform-banner .icon-btn { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px 8px; font-size: 16px; }

/* ───── «Башкы экранга кошуу»: ненавязчиво, над нижним меню ───── */
.install-hint {
  position: fixed; left: 12px; right: 12px; bottom: calc(84px + var(--safe-b)); z-index: 40;
  display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 6px 24px rgba(46, 42, 36, .14);
}
.install-hint .install-text { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.install-hint .install-text span { color: var(--muted); }
.install-hint .btn { height: 40px; padding: 0 14px; white-space: nowrap; }
@media (min-width: 900px) { .install-hint { left: auto; right: 24px; bottom: 24px; max-width: 420px; } }
