:root {
  --ink: #14171c;
  --steel: #5b6472;
  --ground: #eef0f2;
  --surface: #ffffff;
  --line: #dfe2e7;
  --accent: #ff5a1f;

  --good: #16a34a;   --good-bg: #e4f6ea;
  --warn: #d97706;   --warn-bg: #fdf1de;
  --critical: #dc2626; --critical-bg: #fbe6e6;
  --info: #2563eb;   --info-bg: #e5edfd;
  --neutral: #9aa1ac; --neutral-bg: #eef0f2;

  --page-bg: #f6f5f2;
  --page-ink: #1c1f26;
  --page-sub: #6a6f78;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--page-ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page { max-width: 900px; margin: 0 auto; padding: 40px 20px 60px; display: flex; flex-direction: column; align-items: center; }
.page-head { max-width: 420px; margin-bottom: 24px; text-align: center; }
.ph-title { font-family: "Barlow Semi Condensed", sans-serif; font-weight: 700; font-size: 22px; }
.ph-title span { font-weight: 400; color: var(--page-sub); font-size: 15px; }
.ph-sub { font-size: 12px; color: var(--page-sub); margin-top: 6px; line-height: 1.5; }

/* ---------- device ---------- */
.device {
  width: 342px; height: 728px;
  border-radius: 44px; background: #0d0f13; padding: 12px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,0,0,0.08);
}
.screen {
  position: relative; width: 100%; height: 100%;
  border-radius: 34px; overflow: hidden; background: var(--surface);
  display: flex; flex-direction: column;
  font-family: "IBM Plex Sans", system-ui, sans-serif; color: var(--ink);
}
.notch {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 90px; height: 22px; background: #0d0f13; border-radius: 14px; z-index: 6;
}
.statusbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 22px 0; font-family: "IBM Plex Mono", monospace; font-size: 12px; font-weight: 500;
  color: var(--ink); flex: 0 0 auto;
}

/* ---------- app bar ---------- */
.ab-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 12px 16px 9px; flex: 0 0 auto; }
.ab-row h2 { font-family: "Barlow Semi Condensed", sans-serif; font-weight: 700; font-size: 21px; margin: 0; }
.ab-row .sub { margin-top: 3px; font-size: 11.5px; color: var(--steel); }
.ab-row .sub b { color: var(--critical); font-weight: 600; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 500;
  flex: 0 0 auto; box-shadow: 0 4px 10px -3px rgba(255,90,31,0.5); cursor: pointer; border: none;
}
.icon-btn.ghost { background: var(--ground); color: var(--steel); box-shadow: none; }

/* ---------- search + chips ---------- */
.searchwrap { padding: 0 16px 9px; flex: 0 0 auto; }
.search { display: flex; align-items: center; gap: 8px; background: var(--ground); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; }
.search svg { flex: 0 0 auto; color: var(--steel); }
.search input {
  border: none; background: transparent; outline: none; font-size: 12.5px; color: var(--ink);
  font-family: inherit; width: 100%;
}
.search input::placeholder { color: var(--steel); }

.chips { display: flex; gap: 6px; padding: 0 16px 10px; flex: 0 0 auto; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; font-size: 11.5px; font-weight: 500; padding: 6px 11px; border-radius: 999px;
  background: var(--ground); color: var(--steel); border: 1px solid var(--line); white-space: nowrap;
  cursor: pointer; user-select: none;
}
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip b { font-weight: 600; }

/* ---------- lists / rows ---------- */
.listwrap { position: relative; flex: 1 1 auto; min-height: 0; }
.list { height: 100%; overflow-y: auto; background: var(--surface); border-top: 1px solid var(--line); }
.list-divider { padding: 8px 16px 6px; font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--steel); background: var(--ground); }
.empty-hint { padding: 30px 20px; text-align: center; font-size: 12px; color: var(--steel); line-height: 1.6; }

.row { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.row:active { background: var(--ground); }
.row::before { content: ""; width: 3px; align-self: stretch; border-radius: 3px; background: var(--stripe, var(--neutral)); flex: 0 0 auto; }
.thumb {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; background: var(--neutral-bg); color: var(--steel);
  display: flex; align-items: center; justify-content: center;
  font-family: "Barlow Semi Condensed", sans-serif; font-weight: 700; font-size: 12px;
}
.row-text { flex: 1 1 auto; min-width: 0; }
.row-text .l1 { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-text .l1 .flag-tag { margin-left: 5px; vertical-align: middle; }
.row-text .l2 { font-family: "IBM Plex Mono", monospace; font-size: 10px; color: var(--steel); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-right { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.to-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.to-dot.warn { background: var(--warn); }
.to-dot.critical { background: var(--critical); }
.to-dot.info { background: var(--info); }
.flag-tag { font-size: 9.5px; font-weight: 600; padding: 2px 6px; border-radius: 5px; white-space: nowrap; flex: 0 0 auto; }
.flag-tag.warn { background: var(--warn-bg); color: var(--warn); }
.flag-tag.critical { background: var(--critical-bg); color: var(--critical); }
.row-count { font-size: 10.5px; color: var(--steel); white-space: nowrap; }
.chev { color: #c7cbd1; flex: 0 0 auto; }
.row .end-btn {
  font-size: 9.5px; font-weight: 600; color: var(--ink); background: var(--ground);
  border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; white-space: nowrap; cursor: pointer;
}
.pay-badge { font-size: 9.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px; white-space: nowrap; flex: 0 0 auto; }
.pay-badge.good { background: var(--good-bg); color: var(--good); }
.pay-badge.warn { background: var(--warn-bg); color: var(--warn); }
.pay-badge.critical { background: var(--critical-bg); color: var(--critical); }

/* ---------- mini rows (вложенные списки в детальных экранах) ---------- */
.mini-list { display: flex; flex-direction: column; flex-shrink: 0; background: var(--ground); border-radius: 10px; overflow: hidden; }
.mini-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.mini-row:last-child { border-bottom: none; }
.mini-row:active { background: var(--surface); }
.section-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--steel); margin-top: 4px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mini-btn {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 600; color: var(--steel);
  background: var(--ground); border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; cursor: pointer;
}
.mini-btn.add { color: var(--accent); border-color: transparent; background: none; padding: 0; text-transform: none; letter-spacing: normal; }

/* ---------- tabbar ---------- */
.tabbar { flex: 0 0 auto; display: flex; padding: 8px 8px 14px; background: var(--surface); border-top: 1px solid var(--line); }
.tab { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--steel); font-size: 10px; font-weight: 500; background: none; border: none; cursor: pointer; font-family: inherit; }
.tab.active { color: var(--accent); }
.tab svg { display: block; }
.tab-ico-wrap { position: relative; display: inline-flex; }
.tab-badge {
  position: absolute; top: -5px; right: -8px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 999px;
  background: var(--critical); color: #fff; font-size: 8.5px; font-weight: 700; line-height: 14px; text-align: center;
}
.tab-badge.static { position: static; margin-left: 4px; }

/* ---------- bike / client / rental detail (общая шапка) ---------- */
.detail-header { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px 8px; flex: 0 0 auto; }
.back-btn { font-size: 22px; line-height: 1; color: var(--ink); width: 22px; flex: 0 0 auto; background: none; border: none; cursor: pointer; padding: 0; }
.dh-title { flex: 1 1 auto; min-width: 0; }
.dh-name { font-family: "Barlow Semi Condensed", sans-serif; font-weight: 700; font-size: 16px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dh-name .flag-tag { margin-left: 6px; vertical-align: middle; }
.dh-meta { font-family: "IBM Plex Mono", monospace; font-size: 10px; color: var(--steel); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-select {
  flex: 0 0 auto; font-size: 10.5px; font-weight: 600; padding: 4px 22px 4px 9px; border-radius: 999px;
  border: none; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m6 9 6 6 6-6' stroke='%235b6472' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center; background-size: 9px;
}
.status-select.free { background-color: var(--good-bg); color: var(--good); }
.status-select.reserved { background-color: var(--info-bg); color: var(--info); }
.status-select.rented { background-color: #ffe9de; color: var(--accent); }
.status-select.repair { background-color: var(--warn-bg); color: var(--warn); }
.status-select.retired { background-color: var(--neutral-bg); color: var(--steel); }

.detail-scroll { flex: 1 1 auto; overflow-y: auto; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.photo-block { width: 100%; height: 110px; border-radius: 12px; background: var(--neutral-bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--steel); flex: 0 0 auto; cursor: pointer; overflow: hidden; }
.photo-block.filled { padding: 0; }
.photo-block img { width: 100%; height: 100%; object-fit: cover; }
.photo-hint { font-size: 10px; color: var(--steel); }

.info-grid, .stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.info-item { background: var(--ground); border-radius: 10px; padding: 7px 9px; display: flex; flex-direction: column; gap: 2px; }
.info-item .k { font-size: 9px; color: var(--steel); text-transform: uppercase; letter-spacing: 0.03em; }
.info-item .v { font-family: "IBM Plex Mono", monospace; font-size: 12.5px; font-weight: 500; color: var(--ink); display: flex; align-items: center; gap: 4px; }
.info-item .d { font-size: 9px; color: var(--steel); }

.to-row { display: flex; gap: 6px; flex-wrap: wrap; }
.to-pill { padding: 5px 9px; border-radius: 8px; font-size: 9.5px; font-weight: 600; white-space: nowrap; }
.to-pill.warn { background: var(--warn-bg); color: var(--warn); }
.to-pill.critical { background: var(--critical-bg); color: var(--critical); }
.to-pill.ok { background: var(--neutral-bg); color: var(--steel); }

.action-row { display: flex; gap: 8px; }
.action-btn { flex: 1; text-align: center; padding: 9px; border-radius: 10px; font-size: 12px; font-weight: 600; cursor: pointer; border: none; font-family: inherit; }
.action-btn.primary { background: var(--accent); color: #fff; }
.action-btn.outline { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }

.hist-tabs { display: flex; gap: 14px; border-bottom: 1px solid var(--line); margin-top: 2px; }
.ht { padding: 7px 1px; font-size: 11px; font-weight: 600; color: var(--steel); border-bottom: 2px solid transparent; cursor: pointer; background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; }
.ht.active { color: var(--ink); border-bottom-color: var(--accent); }
.hist-list { display: flex; flex-direction: column; }
.hist-row { display: flex; align-items: center; gap: 7px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.hist-row:last-child { border-bottom: none; }
.hd { font-family: "IBM Plex Mono", monospace; font-size: 10px; color: var(--steel); width: 56px; flex: 0 0 auto; }
.hv { font-family: "IBM Plex Mono", monospace; font-size: 10.5px; font-weight: 500; color: var(--ink); flex: 0 0 auto; white-space: nowrap; }
.hn { font-size: 10px; color: var(--steel); flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* разбивка итоговой суммы аренды */
.calc-list { display: flex; flex-direction: column; background: var(--ground); border-radius: 10px; overflow: hidden; }
.calc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 11px; }
.calc-row:last-child { border-bottom: none; }
.calc-row .cl { color: var(--steel); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calc-row .cv { font-family: "IBM Plex Mono", monospace; font-weight: 500; color: var(--ink); flex: 0 0 auto; }
.calc-row.total { background: var(--surface); font-weight: 700; }
.calc-row.total .cl, .calc-row.total .cv { color: var(--ink); font-weight: 700; }

/* ---------- клиент: контакты, документы, флаги ---------- */
.link-row { display: flex; gap: 8px; }
.link-btn {
  flex: 1; text-align: center; padding: 9px; border-radius: 10px; font-size: 11.5px; font-weight: 600;
  background: var(--ground); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.doc-list, .flag-list { display: flex; flex-direction: column; gap: 7px; }
.doc-card, .flag-card {
  display: flex; align-items: center; gap: 9px; padding: 8px 9px; background: var(--ground); border-radius: 10px;
}
.flag-card.resolved { opacity: 0.55; }
.photo-thumb { width: 34px; height: 34px; border-radius: 8px; background: var(--neutral-bg); flex: 0 0 auto; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--steel); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- аренды: депозит / комплектность / уведомления ---------- */
.equip-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--ground); border-radius: 10px; padding: 8px 10px; font-size: 11px; }
.equip-row .k { color: var(--steel); font-weight: 600; flex: 0 0 auto; }
.equip-row .v { color: var(--ink); text-align: right; }
.warn-banner {
  display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 10px; font-size: 11px; font-weight: 600;
}
.warn-banner.warn { background: var(--warn-bg); color: var(--warn); }
.warn-banner.critical { background: var(--critical-bg); color: var(--critical); }
.notif-list { display: flex; flex-direction: column; gap: 6px; }
.notif-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--ground); border-radius: 10px; cursor: pointer; }
.notif-item .to-dot { align-self: flex-start; margin-top: 4px; }
.notif-item .l1 { white-space: normal; overflow: visible; line-height: 1.35; }
.notif-item.read { opacity: 0.5; }
.notif-item .to-dot.info { background: var(--info); }

/* ---------- профиль: дашборд, настройки ---------- */
.profile-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; flex: 1 1 auto; overflow-y: auto; }
.profile-card { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.profile-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-family: "Barlow Semi Condensed", sans-serif; font-weight: 700; font-size: 17px; flex: 0 0 auto; }
.profile-card .name { font-size: 14px; font-weight: 600; color: var(--ink); }
.profile-card .role { font-size: 11.5px; color: var(--steel); margin-top: 1px; }
.dash-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.dash-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.dt-k { font-size: 10px; color: var(--steel); font-weight: 600; display: flex; align-items: center; gap: 4px; }
.dt-v { font-family: "IBM Plex Mono", monospace; font-size: 15px; font-weight: 600; color: var(--ink); }
.menu-list { flex-shrink: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.menu-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 500; color: var(--ink); cursor: pointer; }
.menu-row:last-child { border-bottom: none; }
.menu-row svg { flex: 0 0 auto; color: var(--steel); }
.menu-row .txt { flex: 1 1 auto; }
.menu-row .note { font-size: 10px; color: var(--steel); font-weight: 400; margin-top: 1px; }
.menu-row.disabled { color: var(--steel); cursor: default; }
.menu-row.disabled svg { color: var(--line); }
.menu-row.danger { color: var(--critical); }
.menu-row.danger svg { color: var(--critical); }
.menu-row .chev { margin-left: auto; }

.settings-row { display: flex; align-items: center; gap: 6px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.settings-input { background: var(--ground); border: 1px solid transparent; border-radius: 8px; padding: 6px 7px; font-size: 11px; font-family: inherit; color: var(--ink); width: 64px; flex: 0 0 auto; }
.settings-input.wide { width: auto; flex: 1 1 auto; }
.settings-input:focus { border-color: var(--accent); outline: none; }
.field-row { display: flex; gap: 8px; align-items: center; }
.field-row input { flex: 1 1 auto; background: var(--ground); border: 1px solid transparent; border-radius: 9px; padding: 8px 10px; font-size: 12px; font-family: inherit; }
.reason-text { flex: 1 1 auto; font-size: 12px; color: var(--ink); }

/* ---------- sheet / modal ---------- */
.sheet-area { position: relative; flex: 1 1 auto; min-height: 0; }
.backdrop { position: absolute; inset: 0; background: rgba(10,12,16,0.44); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface);
  border-radius: 20px 20px 0 0; padding: 14px 16px 16px; box-shadow: 0 -10px 26px rgba(0,0,0,0.16);
  display: flex; flex-direction: column; gap: 11px; max-height: 88%; overflow-y: auto;
}
.sheet-grab { width: 34px; height: 4px; border-radius: 3px; background: var(--line); align-self: center; margin-bottom: 2px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h3 { font-family: "Barlow Semi Condensed", sans-serif; font-weight: 700; font-size: 15px; margin: 0; }
.sheet-close { width: 22px; height: 22px; border-radius: 50%; background: var(--ground); display: flex; align-items: center; justify-content: center; color: var(--steel); font-size: 13px; flex: 0 0 auto; cursor: pointer; border: none; }

.value-display { font-family: "IBM Plex Mono", monospace; font-size: 28px; font-weight: 500; text-align: center; padding: 10px; color: var(--ink); background: var(--ground); border-radius: 12px; border: none; width: 100%; outline: none; }
.value-display::placeholder { color: var(--steel); opacity: 0.6; }
.hint-row { display: flex; justify-content: space-between; font-size: 10px; color: var(--steel); padding: 0 2px; }
.err-row { font-size: 10.5px; color: var(--critical); padding: 0 2px; display: none; }
.err-row.show { display: block; }
.override-row { display: none; align-items: center; gap: 6px; font-size: 10.5px; color: var(--steel); padding: 0 2px; }
.override-row.show { display: flex; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 10px; color: var(--steel); font-weight: 500; }
.field input[type="text"], .field input[type="number"], .field input[type="tel"], .field input[type="date"], .field textarea, .field select {
  background: var(--ground); border: 1px solid transparent; border-radius: 9px; padding: 8px 10px;
  font-size: 12px; color: var(--ink); font-family: inherit; outline: none; width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field textarea { resize: none; min-height: 44px; }

.type-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.type-chip { padding: 6px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 500; background: var(--ground); color: var(--steel); cursor: pointer; user-select: none; }
.type-chip.sel { background: var(--accent); color: #fff; }

.dropzone { border: 1.5px dashed var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--steel); font-size: 10.5px; text-align: center; cursor: pointer; position: relative; }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone.filled { border-style: solid; border-color: var(--line); flex-direction: row; align-items: center; justify-content: flex-start; gap: 9px; padding: 7px 9px; }
.dz-name { font-size: 11px; color: var(--ink); font-weight: 500; }

/* мульти-фото дропзона + сетки фото аренды */
.multi-dz { display: flex; flex-direction: column; gap: 7px; }
.mp-strip { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.mp-thumb { position: relative; width: 46px; height: 46px; border-radius: 8px; overflow: hidden; background: var(--neutral-bg); flex: 0 0 auto; }
.mp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.mp-del { position: absolute; top: 1px; right: 1px; width: 15px; height: 15px; border-radius: 50%; border: none; background: rgba(10,12,16,0.6); color: #fff; font-size: 8px; line-height: 15px; padding: 0; cursor: pointer; }
.mp-add { border: 1.5px dashed var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--steel); font-size: 10.5px; text-align: center; cursor: pointer; position: relative; }
.mp-add input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.mp-add-btn { font-size: 10px; font-weight: 600; color: var(--accent); background: none; border: 1px dashed var(--line); border-radius: 8px; padding: 6px 9px; cursor: pointer; flex: 0 0 auto; font-family: inherit; }
.rp-block { display: flex; flex-direction: column; gap: 5px; }
.rp-label { font-size: 10px; color: var(--steel); font-weight: 600; }
.lightbox { position: absolute; inset: 0; background: rgba(6,8,12,0.9); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.hist-row.editable { cursor: pointer; }
.hist-row.editable:active { background: var(--ground); }

/* редактор позиций работ ТО */
#svc-items { display: flex; flex-direction: column; gap: 6px; }
.svc-item-row { display: flex; flex-wrap: wrap; gap: 5px; padding: 7px; background: var(--ground); border-radius: 9px; align-items: center; }
.svc-item-row select, .svc-item-row input { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; font-size: 11px; font-family: inherit; color: var(--ink); outline: none; }
.svc-item-row select:focus, .svc-item-row input:focus { border-color: var(--accent); }
.svc-item-row .svc-it-type { flex: 1 1 100%; }
.svc-item-row .svc-it-name { flex: 1 1 58%; min-width: 0; }
.svc-item-row .svc-it-cost { flex: 1 1 28%; min-width: 62px; }
.svc-item-row .mini-btn { flex: 0 0 auto; align-self: center; padding: 5px 8px; }

.dbg-box { font-size: 10px; color: var(--steel); background: var(--ground); border-radius: 9px; padding: 8px 10px; }
.dbg-box summary { cursor: pointer; font-weight: 600; }
.dbg-box pre { margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; font-family: "IBM Plex Mono", monospace; font-size: 9.5px; max-height: 180px; overflow: auto; }

.checkbox-row { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--steel); }
.checkbox-row input { width: 14px; height: 14px; }

.sheet-save { background: var(--accent); color: #fff; text-align: center; padding: 11px; border-radius: 11px; font-weight: 600; font-size: 12.5px; cursor: pointer; border: none; font-family: inherit; }
.sheet-save:disabled { opacity: 0.45; cursor: not-allowed; }
.sheet-save.secondary { background: var(--ink); }

.toast {
  position: absolute; left: 12px; right: 12px; bottom: 14px; background: #1c1f26; color: #fff;
  border-radius: 12px; padding: 9px 11px; display: flex; align-items: center; gap: 8px;
  font-size: 10.5px; font-weight: 500; box-shadow: 0 8px 20px rgba(0,0,0,0.28); z-index: 8;
  animation: toast-in 0.2s ease-out;
}
.toast svg { flex: 0 0 auto; color: var(--good); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Защита от известного flex-бага: внутри прокручиваемых flex-колонок (.profile-body/.detail-scroll/.sheet)
   дочерний блок с overflow:hidden получает вычисляемую min-height:auto = 0 и браузер может схлопнуть
   его почти до нуля при нехватке места, вместо того чтобы просто прокрутить контейнер. Явный
   flex-shrink:0 на всех прямых детях этих контейнеров гарантирует, что секции сохраняют свой
   естественный размер, а скроллится сам контейнер. */
.profile-body > *, .detail-scroll > *, .sheet > * { flex-shrink: 0; }

/* ---------- вход / регистрация ---------- */
.auth-wrap { flex: 1 1 auto; overflow-y: auto; padding: 28px 20px 20px; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.auth-logo { align-self: center; width: 64px; height: 64px; border-radius: 18px; background: var(--ground); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.auth-title { text-align: center; font-family: "Barlow Semi Condensed", sans-serif; font-weight: 700; font-size: 19px; }
.auth-sub { text-align: center; font-size: 11.5px; color: var(--steel); margin-bottom: 6px; }
.auth-switch { text-align: center; font-size: 11.5px; color: var(--steel); margin-top: 6px; }
.auth-switch span { color: var(--accent); font-weight: 600; cursor: pointer; }

/* ---------- админка ---------- */
.action-btn.danger { color: var(--critical); border-color: var(--critical-bg); background: var(--critical-bg); }
.warn-banner.info { background: var(--info-bg); color: var(--info); }
.doc-card select.settings-input { width: auto; min-width: 92px; }
.doc-card { flex-wrap: wrap; }

/* ---------- режим приложения (PWA / телефон / планшет) ----------
   В браузере на десктопе показываем «телефон на подставке» (мокап-презентация).
   На реальном телефоне и в установленном PWA приложение должно занимать весь экран:
   прячем шапку-презентацию и рамку устройства, разворачиваем .screen на весь вьюпорт.
   Учитываем «безопасные зоны» (челка / жест-бар) через env(safe-area-inset-*). */
@media (display-mode: standalone), (display-mode: fullscreen), (max-width: 560px) {
  body { background: #0d0f13; }
  .page { padding: 0; max-width: none; display: block; }
  .page-head { display: none; }
  .device {
    width: 100%; height: 100vh; height: 100dvh;
    border-radius: 0; padding: 0; box-shadow: none; background: #0d0f13;
  }
  .screen { border-radius: 0; padding-bottom: env(safe-area-inset-bottom); }
  .notch { display: none; }
}
/* Фейковый «9:41 + батарейка» нужен только в мокапе на десктопе —
   в установленном приложении и на телефоне уже есть системный статус-бар. */
@media (display-mode: standalone), (display-mode: fullscreen), (max-width: 560px) {
  .statusbar { display: none; }
}
