/*
 * Green Yard / Расходники — проприетарное ПО.
 * Copyright (c) 2026 Гусейнов Давид. Все права защищены.
 *
 * Копирование, распространение, переработка и обратная разработка
 * (reverse engineering) запрещены без письменного разрешения правообладателя.
 * Условия: см. файл LICENSE. Нарушение влечёт ответственность по ст. 1252,
 * 1301 ГК РФ.
 */

:root, [data-theme="light"] {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --space-1:.25rem; --space-2:.5rem; --space-3:.75rem; --space-4:1rem; --space-5:1.25rem; --space-6:1.5rem; --space-8:2rem; --space-10:2.5rem; --space-12:3rem;
  --color-bg:#f7f6f2; --color-surface:#f9f8f5; --color-surface-2:#fbfbf9; --color-surface-offset:#edeae5; --color-border:#d4d1ca;
  --color-text:#28251d; --color-text-muted:#6e6b65; --color-text-faint:#9f9b92; --color-text-inverse:#f9f8f4;
  --color-primary:#01696f; --color-primary-hover:#0c4e54; --color-primary-highlight:#cedcd8; --color-success:#437a22; --color-warning:#964219; --color-error:#a12c7b;
  --radius-sm:.375rem; --radius-md:.75rem; --radius-lg:1rem; --radius-xl:1.25rem; --radius-full:9999px;
  --shadow-sm:0 1px 2px rgba(33,29,19,.06); --shadow-md:0 8px 24px rgba(33,29,19,.08); --shadow-lg:0 18px 48px rgba(33,29,19,.12);
  --font-body:'Satoshi', Inter, sans-serif; --transition:180ms cubic-bezier(0.16,1,0.3,1);
}
[data-theme="dark"] {
  --color-bg:#171614; --color-surface:#1c1b19; --color-surface-2:#201f1d; --color-surface-offset:#262421; --color-border:#393836;
  --color-text:#e1dfda; --color-text-muted:#b2aea6; --color-text-faint:#807b73; --color-text-inverse:#161513;
  --color-primary:#4f98a3; --color-primary-hover:#65aebb; --color-primary-highlight:#313b3b; --color-success:#6daa45; --color-warning:#bb653b; --color-error:#d163a7;
  --shadow-sm:0 1px 2px rgba(0,0,0,.25); --shadow-md:0 8px 24px rgba(0,0,0,.28); --shadow-lg:0 18px 48px rgba(0,0,0,.35);
}
*,:before,:after{box-sizing:border-box} html,body{margin:0;padding:0;min-height:100%;font-family:var(--font-body);background:var(--color-bg);color:var(--color-text);scroll-behavior:smooth} body{font-size:var(--text-base);line-height:1.5}
button,input,select{font:inherit} button{cursor:pointer;border:none;background:none;color:inherit} input,select{width:100%;border:1px solid rgba(60,60,60,.12);background:var(--color-surface-2);color:var(--color-text);border-radius:var(--radius-md);padding:.85rem 1rem;transition:border-color var(--transition),box-shadow var(--transition),transform var(--transition)} input:focus,select:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 4px rgba(1,105,111,.16)}
.app{display:grid;grid-template-columns:340px 1fr;min-height:100dvh}.sidebar{background:linear-gradient(180deg,var(--color-surface),var(--color-surface-2));border-right:1px solid rgba(60,60,60,.1);padding:var(--space-6);display:flex;flex-direction:column;gap:var(--space-6);position:sticky;top:0;height:100dvh;overflow:auto}.brand{display:flex;align-items:center;gap:var(--space-3)}.brand h1{font-size:var(--text-lg);line-height:1.1;margin:0}.brand p,.muted{margin:0;color:var(--color-text-muted);font-size:var(--text-sm)}.brand-company{margin:0 0 .2rem;font-size:clamp(1.2rem,1rem + 1vw,1.9rem);line-height:1;letter-spacing:.18em;font-weight:700;text-transform:uppercase;color:#014921}
.panel{background:var(--color-surface);border:1px solid rgba(60,60,60,.1);border-radius:var(--radius-xl);padding:var(--space-5);box-shadow:var(--shadow-sm)}.panel h2{font-size:var(--text-sm);text-transform:uppercase;letter-spacing:.08em;color:var(--color-text-muted);margin:0 0 var(--space-4)}.grid{display:grid;gap:var(--space-4)}.main{padding:var(--space-6);display:grid;gap:var(--space-6)}.topbar{display:flex;justify-content:space-between;align-items:flex-start;gap:var(--space-4);flex-wrap:wrap}.topbar h2{font-size:var(--text-xl);margin:0 0 .35rem}.actions{display:flex;gap:.75rem;flex-wrap:wrap}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.6rem;padding:.9rem 1.05rem;border-radius:var(--radius-md);font-size:var(--text-sm);font-weight:700;transition:transform var(--transition),background var(--transition),color var(--transition),border-color var(--transition);min-height:44px}.btn:active{transform:translateY(1px) scale(.99)}.btn-primary{background:var(--color-primary);color:var(--color-text-inverse);box-shadow:var(--shadow-sm)}.btn-primary:hover{background:var(--color-primary-hover)}.btn-secondary{background:var(--color-surface);border:1px solid rgba(60,60,60,.1)}.btn-danger{background:rgba(161,44,123,.08);border:1px solid rgba(161,44,123,.24);color:var(--color-error)}
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--space-4)}.stat{background:var(--color-surface);border-radius:var(--radius-xl);padding:var(--space-5);border:1px solid rgba(60,60,60,.1);box-shadow:var(--shadow-sm)}.stat span{display:block;color:var(--color-text-muted);font-size:var(--text-sm);margin-bottom:.45rem}.stat strong{font-size:var(--text-xl);line-height:1.1;font-variant-numeric:tabular-nums lining-nums}
.workspace{display:grid;grid-template-columns:1.35fr .95fr;gap:var(--space-6)}.stack{display:grid;gap:var(--space-6)}.item-card{background:var(--color-surface);border:1px solid rgba(60,60,60,.1);border-radius:var(--radius-xl);padding:var(--space-5);display:grid;gap:var(--space-4);box-shadow:var(--shadow-sm)}.item-card.highlight{background:rgba(1,105,111,.05)}.item-head{display:flex;justify-content:space-between;gap:var(--space-3);align-items:flex-start}.item-name{font-size:var(--text-base);font-weight:700}.badge{display:inline-flex;align-items:center;padding:.38rem .7rem;border-radius:var(--radius-full);font-size:var(--text-xs);font-weight:700}.badge.ok{background:rgba(67,122,34,.14);color:var(--color-success)}.badge.warn{background:rgba(150,66,25,.14);color:var(--color-warning)}.badge.low{background:rgba(161,44,123,.14);color:var(--color-error)}
.row{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-3)}.small{font-size:var(--text-sm);color:var(--color-text-muted)}.qty{font-size:1.7rem;font-weight:700;font-variant-numeric:tabular-nums lining-nums}.quick-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.55rem}.mini-btn{padding:.75rem .5rem;border-radius:var(--radius-md);background:var(--color-surface-2);border:1px solid rgba(60,60,60,.1);font-weight:700;min-height:44px}.mini-btn:hover{border-color:rgba(1,105,111,.35);color:var(--color-primary)}
.list{display:grid;gap:.8rem}.line{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);padding:.85rem 1rem;border-radius:var(--radius-lg);background:var(--color-surface-2)}.line strong{font-variant-numeric:tabular-nums lining-nums}.progress{height:10px;background:var(--color-surface-offset);border-radius:var(--radius-full);overflow:hidden}.progress span{display:block;height:100%;background:linear-gradient(90deg,var(--color-primary),#9ec8cc);border-radius:inherit;transition:width .35s ease}.hint{padding:1rem 1.1rem;border-radius:var(--radius-lg);background:rgba(1,105,111,.08);color:var(--color-text)}.footer-note{font-size:var(--text-xs);color:var(--color-text-faint)}
.menu-toggle{width:46px;height:46px;border-radius:14px;background:var(--color-surface);border:1px solid rgba(60,60,60,.1);display:grid;place-items:center;box-shadow:var(--shadow-sm)}.empty{padding:1rem;border-radius:var(--radius-lg);background:var(--color-surface-2);color:var(--color-text-muted)}.apartments{display:grid;gap:.75rem;grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}.apartment-row{display:flex;flex-direction:column;gap:.5rem;align-items:stretch;padding:.75rem;border-radius:var(--radius-lg);background:var(--color-surface-2);border:1px solid var(--color-border,rgba(60,60,60,.12));transition:border-color .15s ease,box-shadow .15s ease,background .15s ease;min-height:118px}.apartment-row:hover{border-color:color-mix(in oklab,var(--color-primary,#01696f) 35%,var(--color-border,rgba(60,60,60,.12)))}.apartment-row:has(.apartment-btn.active),.apartment-row.is-active{background:color-mix(in oklab,var(--color-primary,#01696f) 10%,var(--color-surface-2));border-color:color-mix(in oklab,var(--color-primary,#01696f) 45%,transparent);box-shadow:0 0 0 1px color-mix(in oklab,var(--color-primary,#01696f) 35%,transparent) inset}.apartment-btn{width:100%;text-align:left;padding:.4rem .1rem;border-radius:8px;background:transparent;border:none;display:flex;justify-content:space-between;gap:.5rem;align-items:flex-start;flex:1;color:var(--color-text);cursor:pointer;font:inherit;min-width:0}.apartment-btn .apartment-meta strong{font-size:.98rem;font-weight:600;line-height:1.25;display:block;word-break:break-word}.apartment-btn .apartment-meta .small{display:block;margin-top:.2rem;color:var(--color-text-muted)}.apartment-btn.active .apartment-meta strong{color:var(--color-primary,#01696f)}.apartment-btn > .small{flex-shrink:0;padding:.18rem .45rem;border-radius:999px;background:var(--color-surface);border:1px solid var(--color-border,rgba(60,60,60,.1));font-size:.72rem;font-weight:500;color:var(--color-text-muted);white-space:nowrap}.apartment-meta{display:grid;gap:.15rem;min-width:0;flex:1}.trash-btn{width:44px;min-width:44px;border-radius:var(--radius-lg);background:var(--color-surface-2);border:1px solid rgba(60,60,60,.1);display:grid;place-items:center;color:var(--color-text-muted)}.trash-btn:hover{color:var(--color-error);border-color:rgba(161,44,123,.24);background:rgba(161,44,123,.08)}.trash-btn:disabled{opacity:.45;cursor:not-allowed}
.section-head{display:flex;justify-content:space-between;align-items:center;gap:var(--space-3);margin-bottom:var(--space-4)}.modal-backdrop{position:fixed;inset:0;background:rgba(20,18,14,.32);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);display:none;align-items:center;justify-content:center;padding:var(--space-4);z-index:30}.modal-backdrop.open{display:flex}.modal{width:min(920px,100%);max-height:90dvh;overflow:auto;background:var(--color-bg);border:1px solid rgba(60,60,60,.1);border-radius:1.4rem;box-shadow:var(--shadow-lg);padding:var(--space-6)}.modal-title{margin:0 0 .35rem;font-size:var(--text-lg);text-transform:none;letter-spacing:0;color:var(--color-text)}.deduction-grid,.request-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-4)}.pill{display:inline-flex;align-items:center;padding:.35rem .65rem;border-radius:var(--radius-full);background:var(--color-primary-highlight);color:var(--color-primary);font-size:var(--text-xs);font-weight:700}.subsection{display:grid;gap:var(--space-4)}.subsection-title{display:flex;justify-content:space-between;align-items:center;gap:var(--space-3)}.subsection-title h3{margin:0;font-size:var(--text-lg)}.accordion-group{display:grid;gap:var(--space-4)}.accordion-card{background:var(--color-surface);border:1px solid rgba(60,60,60,.1);border-radius:var(--radius-xl);box-shadow:var(--shadow-sm);overflow:hidden}.accordion-trigger{width:100%;display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);padding:1rem 1.1rem;text-align:left;background:transparent}.accordion-trigger.static-open{padding:0;background:transparent}.accordion-label{display:flex;align-items:center;gap:.8rem}.accordion-body{display:none;padding:0 1rem 1rem}.accordion-body.open,.accordion-body.static-block{display:block}.storage-actions{display:grid;gap:.75rem}.status-box{padding:.85rem 1rem;border-radius:var(--radius-lg);background:var(--color-surface-2);font-size:var(--text-sm);color:var(--color-text-muted)}.file-input{display:none}
.drawer-backdrop{position:fixed;inset:0;background:rgba(20,18,14,.38);opacity:0;pointer-events:none;transition:opacity var(--transition);z-index:24}.drawer-backdrop.open{opacity:1;pointer-events:auto}.drawer{position:fixed;top:0;left:0;height:100dvh;width:min(340px,90vw);background:var(--color-bg);border-right:1px solid rgba(60,60,60,.1);box-shadow:var(--shadow-lg);padding:var(--space-6);display:flex;flex-direction:column;gap:var(--space-4);transform:translateX(-105%);transition:transform var(--transition);z-index:25;overflow:auto}.drawer.open{transform:translateX(0)}.drawer-head{display:flex;justify-content:space-between;align-items:center;gap:.75rem}.drawer-item{width:100%;display:flex;align-items:center;justify-content:space-between;gap:.8rem;padding:1rem;border-radius:var(--radius-lg);background:var(--color-surface);border:1px solid rgba(60,60,60,.1);text-align:left}.drawer-item.accent{border-color:rgba(1,105,111,.25);background:rgba(1,105,111,.06)}.theme-switch{display:flex;align-items:center;justify-content:space-between;gap:.9rem;padding:1rem;border-radius:var(--radius-lg);background:var(--color-surface);border:1px solid rgba(60,60,60,.1)}.switch{position:relative;width:58px;height:32px;border-radius:999px;background:var(--color-surface-offset);border:1px solid rgba(60,60,60,.1);transition:background var(--transition)}.switch:after{content:"";position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:var(--color-text-inverse);box-shadow:var(--shadow-sm);transition:transform var(--transition)}.switch.active{background:var(--color-primary)}.switch.active:after{transform:translateX(26px)}
.history-filter{display:flex;flex-wrap:wrap;gap:.6rem;margin-top:.8rem}.history-chip{padding:.55rem .85rem;border-radius:var(--radius-full);background:var(--color-surface-2);border:1px solid rgba(60,60,60,.1);font-size:var(--text-sm);font-weight:700}.history-chip.active{background:rgba(1,105,111,.1);border-color:rgba(1,105,111,.25);color:var(--color-primary)}.history-modal-list{display:grid;gap:.9rem;margin-top:1rem}.history-card,.request-card{padding:1rem;border-radius:var(--radius-lg);background:var(--color-surface-2);display:grid;gap:.45rem}.history-card-header,.request-card-header{display:flex;justify-content:space-between;gap:.8rem;align-items:flex-start}.history-kind,.request-kind{display:inline-flex;align-items:center;padding:.35rem .6rem;border-radius:var(--radius-full);background:rgba(1,105,111,.1);color:var(--color-primary);font-size:var(--text-xs);font-weight:700;width:max-content}.request-list{display:grid;gap:.75rem;margin-top:.9rem}.request-item{display:grid;grid-template-columns:auto 1fr auto;gap:.75rem;align-items:center;padding:.8rem 1rem;border-radius:var(--radius-lg);background:var(--color-surface-2)}.request-summary{display:grid;gap:.8rem}.request-check{width:20px;height:20px}.kb-section{display:none}.kb-section.active{display:block}
@media (max-width:1180px){.app{grid-template-columns:1fr}.sidebar{position:relative;height:auto;border-right:none;border-bottom:1px solid rgba(60,60,60,.1)}.stats,.workspace,.deduction-grid,.request-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.workspace{grid-template-columns:1fr}.sidebar .panel{content-visibility:auto}.apartments{grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}}
@media (max-width:640px){.apartments{grid-template-columns:1fr}.apartment-row{min-height:auto}.stats,.deduction-grid,.request-grid{grid-template-columns:1fr}}
@media (max-width:720px){.main,.sidebar,.modal,.drawer{padding:var(--space-4)}.stats,.row,.quick-controls,.deduction-grid,.request-grid{grid-template-columns:1fr}.topbar{align-items:flex-start}.actions{width:100%}.actions .btn{flex:1}.stat strong{font-size:1.8rem}.line,.subsection-title,.history-card-header,.accordion-trigger,.request-card-header,.request-item{align-items:flex-start;flex-direction:column}.request-item{grid-template-columns:1fr}}

.drawer-item.active{border-color:rgba(1,105,111,.25);background:rgba(1,105,111,.08);color:var(--color-primary)}

/* ── Finance layout ─────────────────────────────── */
.finance-filters-panel{margin-bottom:0}
.finance-workspace{display:grid;grid-template-columns:1.35fr .95fr;gap:var(--space-6)}
.finance-list{display:grid;gap:.75rem}
.recurring-list{display:grid;gap:.75rem}

/* ── Finance card ───────────────────────────────── */
.finance-card{position:relative;padding:1rem 1.1rem;border-radius:var(--radius-lg);background:var(--color-surface-2);border:1px solid rgba(60,60,60,.1);display:grid;gap:.55rem;transition:border-color var(--transition)}
.finance-card-icons{position:absolute;top:.55rem;right:.6rem;display:flex;gap:.15rem;z-index:2}
.finance-icon-btn{background:transparent;border:none;padding:.35rem;border-radius:.5rem;color:var(--color-text-muted);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:background var(--transition),color var(--transition)}
.finance-icon-btn:hover{background:rgba(255,255,255,.06);color:var(--color-text)}
.finance-icon-btn:active{transform:scale(.96)}
.finance-card .finance-card-top{padding-right:4.2rem}
.finance-card:hover{border-color:rgba(1,105,111,.2)}
.finance-card.income{border-left:3px solid var(--color-success)}
.finance-card.expense{border-left:3px solid var(--color-error)}
.finance-card-top{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}
.finance-card-left{display:grid;gap:.25rem;flex:1;min-width:0}
.finance-card-right{display:grid;gap:.3rem;align-items:flex-end;text-align:right;flex-shrink:0}
.finance-card-title{font-weight:700;font-size:var(--text-base);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.finance-card-meta{display:flex;flex-wrap:wrap;gap:.25rem .4rem;font-size:var(--text-xs);color:var(--color-text-muted)}
.sep{color:var(--color-text-faint)}
.finance-card-cat{display:inline-flex;align-items:center;padding:.2rem .55rem;border-radius:var(--radius-full);background:rgba(1,105,111,.1);color:var(--color-primary);font-size:var(--text-xs);font-weight:700;width:max-content}
.finance-card-notes{font-size:var(--text-xs);color:var(--color-text-muted);font-style:italic}
.finance-card-actions{display:flex;gap:.5rem;flex-wrap:wrap}

/* ── Finance amount & status ────────────────────── */
.finance-amount{font-weight:700;font-variant-numeric:tabular-nums lining-nums;font-size:var(--text-base)}
.finance-amount.income{color:var(--color-success)}
.finance-amount.expense{color:var(--color-error)}
.finance-status{display:inline-flex;align-items:center;padding:.2rem .55rem;border-radius:var(--radius-full);font-size:var(--text-xs);font-weight:700;width:max-content}
.finance-status.planned{background:rgba(150,66,25,.12);color:var(--color-warning)}
.finance-status.confirmed{background:rgba(67,122,34,.12);color:var(--color-success)}
.finance-status.pending{background:rgba(1,105,111,.1);color:var(--color-primary)}
.finance-status.cancelled{background:rgba(60,60,60,.1);color:var(--color-text-muted)}

/* ── Chip buttons ───────────────────────────────── */
.btn-chip{display:inline-flex;align-items:center;gap:.35rem;padding:.3rem .7rem;border-radius:var(--radius-full);font-size:var(--text-xs);font-weight:700;border:1px solid rgba(60,60,60,.12);background:var(--color-surface);transition:background var(--transition),border-color var(--transition);min-height:32px;cursor:pointer}
.btn-chip:hover{border-color:rgba(1,105,111,.3);background:rgba(1,105,111,.06);color:var(--color-primary)}
.btn-confirm{border-color:rgba(67,122,34,.2);background:rgba(67,122,34,.07);color:var(--color-success)}
.btn-confirm:hover{background:rgba(67,122,34,.15)}
.btn-del{border-color:rgba(161,44,123,.15);background:rgba(161,44,123,.05);color:var(--color-error)}
.btn-del:hover{background:rgba(161,44,123,.14)}

/* ── Recurring card ─────────────────────────────── */
.recurring-card{padding:1rem 1.1rem;border-radius:var(--radius-lg);background:var(--color-surface-2);border:1px solid rgba(60,60,60,.1);display:grid;gap:.55rem;transition:border-color var(--transition)}
.recurring-card.inactive{opacity:.55}
.recurring-card-top{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}
.recurring-title{font-weight:700;font-size:var(--text-base)}

/* ── By-apartment block ─────────────────────────── */
.apt-finance-list{display:grid;gap:.55rem}
.apt-finance-row{display:flex;justify-content:space-between;align-items:center;gap:.75rem;padding:.7rem 1rem;border-radius:var(--radius-lg);background:var(--color-surface-2)}
.apt-finance-name{font-weight:600;font-size:var(--text-sm);min-width:0;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.apt-finance-nums{display:flex;gap:.75rem;font-size:var(--text-sm);font-variant-numeric:tabular-nums lining-nums;flex-shrink:0}

/* ── Misc ───────────────────────────────────────── */
.toggle-row{display:flex;align-items:center;gap:.75rem}
.toggle-row input{width:20px;height:20px;flex-shrink:0}
.code-block{padding:1rem;border-radius:var(--radius-lg);background:var(--color-surface-2);overflow:auto;font-size:var(--text-sm);line-height:1.45;white-space:pre-wrap}

@media (max-width:1180px){.finance-workspace{grid-template-columns:1fr}}

.finance-modal{width:min(1100px,100%);max-height:92dvh;overflow:auto;display:flex;flex-direction:column;gap:0}
#financeEntryModal,#recurringExpenseModal,#financeWebhookModal,#confirmDeleteModal{z-index:40}
#financeAptDetailsModal{z-index:50}

.finance-modal .finance-list,.finance-modal .recurring-list{display:grid;gap:.75rem;margin-top:.5rem}

/* ── Ввод стоимости в заявке (крупный, слева) ── */
.purchase-cost-row{display:flex;align-items:center;gap:.75rem;padding:.6rem 0;border-bottom:1px solid color-mix(in oklab,var(--color-text) 6%,transparent)}
.purchase-cost-row:last-child{border-bottom:none}
.purchase-cost-name{flex:1;min-width:0}
.purchase-cost-name strong{display:block;font-size:var(--text-base)}
.purchase-cost-name .small{color:var(--color-text-muted)}
.purchase-cost-input{display:flex;align-items:center;gap:.4rem;flex-shrink:0}
.cost-input-field{width:120px;padding:.55rem .65rem;font-size:1.1rem;font-weight:600;border:1.5px solid color-mix(in oklab,var(--color-primary) 40%,transparent);border-radius:var(--radius-md);background:var(--color-surface);color:var(--color-text);text-align:right}
.cost-input-field:focus{outline:none;border-color:var(--color-primary)}
.cost-currency{font-size:1.1rem;font-weight:600;color:var(--color-text-muted)}

/* ── Новая закупка — строки расходников ── */
.purchase-new-row{display:flex;align-items:center;gap:.75rem;padding:.6rem 0;border-bottom:1px solid color-mix(in oklab,var(--color-text) 6%,transparent)}
.purchase-new-row:last-child{border-bottom:none}
.purchase-new-label{display:flex;align-items:center;gap:.7rem;flex:1;cursor:pointer;min-width:0}
.purchase-item-checkbox{width:1.15rem;height:1.15rem;flex-shrink:0;accent-color:var(--color-primary);cursor:pointer}
.purchase-new-info{display:flex;flex-direction:column;min-width:0}
.purchase-new-name{font-size:var(--text-base);white-space:normal;word-break:break-word}
.purchase-new-sub{color:var(--color-text-muted);margin-top:.1rem}
.purchase-new-qty{width:80px;padding:.4rem .5rem;font-size:var(--text-base);border:1px solid color-mix(in oklab,var(--color-text) 15%,transparent);border-radius:var(--radius-md);background:var(--color-surface);color:var(--color-text);text-align:right;flex-shrink:0}

/* ── Тумблер авто-заявки — гарантированный вид ── */
#autoRequestToggle{position:relative;width:52px;height:28px;border-radius:999px;background:var(--color-surface-offset);border:1.5px solid color-mix(in oklab,var(--color-text) 15%,transparent);cursor:pointer;transition:background .2s,border-color .2s;flex-shrink:0;padding:0}
#autoRequestToggle::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .2s}
#autoRequestToggle.active{background:var(--color-primary);border-color:var(--color-primary)}
#autoRequestToggle.active::after{transform:translateX(24px)}

@media (max-width:720px){.finance-card-title{white-space:normal}.finance-card-top{flex-direction:column;gap:.5rem}.finance-card-right{text-align:left}.apt-finance-nums{flex-direction:column;gap:.2rem}}

.btn-sm{padding:.35rem .75rem;font-size:var(--text-sm);border-radius:var(--radius-md)}

/* ─── Компактный auth-виджет (правый верхний угол) ─────────────────────── */
.auth-corner{position:fixed;top:.85rem;right:1rem;z-index:60;display:flex;flex-direction:column;align-items:flex-end;gap:.5rem;font-family:var(--font-body)}
.auth-corner-btn{padding:.55rem 1.1rem;border-radius:var(--radius-full);background:var(--color-surface);border:1px solid var(--color-border);color:var(--color-text);font-weight:700;font-size:var(--text-sm);box-shadow:var(--shadow-sm);cursor:pointer;transition:background var(--transition),border-color var(--transition),color var(--transition);letter-spacing:.02em}
.auth-corner-btn:hover{background:var(--color-surface-2);border-color:var(--color-primary);color:var(--color-primary)}
.auth-corner-btn.signed-in{background:var(--color-primary);color:var(--color-text-inverse);border-color:var(--color-primary)}
.auth-corner-btn.signed-in:hover{background:var(--color-primary-hover);border-color:var(--color-primary-hover);color:var(--color-text-inverse)}
/* Кнопка «Выход» переехала в меню → «Настройки» → «Сеанс», поэтому угловой виджет скрыт.
   Разметку не удаляем: гостевой вход идёт через .guest-gate (см. body.is-guest ниже),
   а dropdown внутри auth-corner для гостя и так был скрыт правилом body.is-guest .auth-corner. */
.auth-corner{display:none !important}

.auth-dropdown{width:300px;max-width:calc(100vw - 2rem);background:var(--color-bg);border:1px solid var(--color-border);border-radius:var(--radius-xl);box-shadow:var(--shadow-lg);padding:1rem;display:flex;flex-direction:column;gap:.6rem;animation:authDropIn .18s cubic-bezier(.16,1,.3,1)}
@keyframes authDropIn{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}
.auth-dropdown[hidden]{display:none}
.auth-dropdown-title{font-weight:700;font-size:var(--text-base);color:var(--color-text);margin:0}
.auth-dropdown-hint{font-size:var(--text-xs);color:var(--color-text-muted);line-height:1.45}
.auth-dropdown input[type="email"],.auth-dropdown-pwd input{width:100%;padding:.55rem .75rem;font-size:var(--text-sm);border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-surface-2);color:var(--color-text)}
.auth-dropdown input[type="email"]:focus,.auth-dropdown-pwd input:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 3px rgba(1,105,111,.12)}
.auth-dropdown-pwd{position:relative;display:flex;align-items:center}
.auth-dropdown-pwd input{padding-right:2.2rem}
.auth-dropdown-eye{position:absolute;right:.4rem;top:50%;transform:translateY(-50%);background:none;border:0;cursor:pointer;font-size:1rem;color:var(--color-text-muted);padding:.2rem;line-height:1}
.auth-dropdown-eye:hover{color:var(--color-text)}
.auth-dropdown-actions{display:flex;gap:.5rem;margin-top:.15rem}
.auth-dropdown-msg{font-size:var(--text-xs);min-height:1rem;line-height:1.35;color:var(--color-text-muted)}
.auth-dropdown-msg.error{color:var(--color-error)}
.auth-dropdown-msg.success{color:var(--color-success)}
.auth-dropdown-foot{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding-top:.5rem;border-top:1px solid var(--color-border);font-size:var(--text-xs);color:var(--color-text-muted)}
.auth-dropdown-badge{font-weight:600;padding:.18rem .5rem;border-radius:999px;background:color-mix(in oklab,var(--color-text-muted) 12%,transparent);color:var(--color-text-muted);border:1px solid color-mix(in oklab,var(--color-text-muted) 25%,transparent)}
.auth-dropdown-badge.cloud{background:color-mix(in oklab,var(--color-success) 14%,transparent);color:var(--color-success);border-color:color-mix(in oklab,var(--color-success) 30%,transparent)}
.auth-dropdown-user{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:170px}

@media (max-width:720px){
  .auth-corner{top:.6rem;right:.6rem}
  .auth-corner-btn{padding:.45rem .9rem;font-size:var(--text-xs)}
  .auth-dropdown{width:min(280px,calc(100vw - 1.2rem))}
}

/* Сдвиг основной шапки sidebar, чтобы кнопка-виджет не наезжала */
.sidebar .brand{padding-right:5rem}
@media (max-width:1180px){.sidebar .brand{padding-right:5.5rem}}

/* ─── RealtyCalendar integration ─────────────────────────────────────── */
.rc-block{
  border:1px solid var(--color-border);
  border-radius:var(--radius-lg);
  padding:1rem;
  background:var(--color-surface);
  margin-top:.5rem;
}
.rc-block-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:.75rem;
  margin-bottom:1rem;
}
.rc-status{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  padding:.3rem .6rem;
  border-radius:var(--radius-sm,.5rem);
  font-size:var(--text-sm,.85rem);
  font-weight:500;
  background:color-mix(in oklab,var(--color-text-muted) 10%,var(--color-surface-2));
  color:var(--color-text-muted);
  white-space:nowrap;
}
.rc-status[data-kind="connected"]{
  background:color-mix(in oklab,var(--color-success) 12%,var(--color-surface-2));
  color:var(--color-success);
}
.rc-status[data-kind="disconnected"]{
  background:color-mix(in oklab,var(--color-error) 10%,var(--color-surface-2));
  color:var(--color-error);
}
.rc-step{
  display:flex;
  gap:.75rem;
  padding:.85rem 0;
  border-top:1px solid var(--color-border);
}
.rc-step:first-of-type{border-top:none;padding-top:0}
.rc-step-num{
  flex-shrink:0;
  width:2rem;
  height:2rem;
  border-radius:50%;
  background:color-mix(in oklab,var(--color-accent,var(--color-text)) 12%,var(--color-surface-2));
  color:var(--color-accent,var(--color-text));
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  font-size:var(--text-sm,.9rem);
}
.rc-step-body{flex:1;min-width:0}
.rc-step-body strong{display:block;margin-bottom:.15rem}
.rc-msg{
  padding:.55rem .75rem;
  border-radius:var(--radius-sm,.5rem);
  margin:.5rem 0;
  font-size:var(--text-sm,.9rem);
}
.rc-msg[data-kind="info"]{
  background:color-mix(in oklab,var(--color-text-muted) 8%,var(--color-surface-2));
  color:var(--color-text);
}
.rc-msg[data-kind="success"]{
  background:color-mix(in oklab,var(--color-success) 12%,var(--color-surface-2));
  color:var(--color-success);
}
.rc-msg[data-kind="error"]{
  background:color-mix(in oklab,var(--color-error) 12%,var(--color-surface-2));
  color:var(--color-error);
}
.rc-log-block{
  margin-top:1rem;
  padding-top:1rem;
  border-top:1px solid var(--color-border);
}
.rc-log-list{
  max-height:240px;
  overflow:auto;
  font-size:var(--text-sm,.9rem);
}
.rc-log-row{border-bottom:1px dashed var(--color-border)}
.rc-log-row:last-child{border-bottom:none}

/* ─── Квартиры: блок действий (Синхронизация + Удалить) ─────────────── */
.apartment-row-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.5rem;
  margin-left:0;
  padding-top:.5rem;
  border-top:1px dashed var(--color-border,rgba(60,60,60,.12));
}
.apt-sync-btn{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  padding:.3rem .55rem;
  font-size:.78rem;
  font-weight:500;
  border-radius:6px;
  border:1px solid var(--color-border);
  background:var(--color-surface);
  color:var(--color-text-muted);
  cursor:pointer;
  transition:background .15s ease,border-color .15s ease,color .15s ease;
  white-space:nowrap;
  flex:1;
  justify-content:center;
}
.apt-sync-btn:hover{
  background:color-mix(in oklab,var(--color-primary) 8%,var(--color-surface-2));
  border-color:var(--color-primary);
}
.apt-sync-btn.is-synced{
  background:color-mix(in oklab,var(--color-success) 18%,var(--color-surface-2));
  color:var(--color-success);
  border-color:color-mix(in oklab,var(--color-success) 35%,transparent);
}
.apt-sync-btn.is-synced:hover{
  background:color-mix(in oklab,var(--color-success) 26%,var(--color-surface-2));
}
.apt-delete-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:30px;
  height:30px;
  padding:0;
  border-radius:6px;
  border:1px solid var(--color-border);
  background:transparent;
  color:var(--color-text-muted);
  cursor:pointer;
  transition:background .15s ease,color .15s ease,border-color .15s ease;
  flex-shrink:0;
}
.apt-delete-btn:hover{
  background:color-mix(in oklab,var(--color-error) 12%,transparent);
  color:var(--color-error);
  border-color:color-mix(in oklab,var(--color-error) 35%,transparent);
}
.apt-delete-btn svg{
  width:16px;
  height:16px;
  pointer-events:none;
}
/* Кнопка-шестерёнка «Настроить» — минималистичный вид, как у кнопки удаления. */
.apt-configure-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:30px;
  height:30px;
  padding:0;
  border-radius:6px;
  border:1px solid var(--color-border);
  background:transparent;
  color:var(--color-text-muted);
  cursor:pointer;
  transition:background .15s ease,color .15s ease,border-color .15s ease;
  flex-shrink:0;
}
.apt-configure-btn:hover{
  background:color-mix(in oklab,var(--color-primary) 12%,transparent);
  color:var(--color-primary);
  border-color:color-mix(in oklab,var(--color-primary) 35%,transparent);
}
.apt-configure-btn svg{
  width:16px;
  height:16px;
  pointer-events:none;
}
/* Строка «Своя позиция» в модалке новой заявки на закупку. */
.purchase-custom-row{
  display:flex;
  gap:.5rem;
  flex-wrap:wrap;
  align-items:flex-end;
  margin-bottom:.5rem;
}
.purchase-custom-row .purchase-custom-remove{
  padding:.4rem .7rem;
  align-self:flex-end;
}

/* ─── Настройки аккаунта: сообщение под формой смены пароля ─────────── */
#pwdMsg{
  margin-top:.25rem;
  padding:.55rem .75rem;
  border-radius:8px;
  line-height:1.35;
}
#pwdMsg[data-kind="error"]{
  background:color-mix(in oklab,var(--color-error) 12%,var(--color-surface-2));
  color:var(--color-error);
}
#pwdMsg[data-kind="success"]{
  background:color-mix(in oklab,var(--color-success) 12%,var(--color-surface-2));
  color:var(--color-success);
}
#pwdMsg[data-kind="info"]{
  background:color-mix(in oklab,var(--color-primary) 10%,var(--color-surface-2));
  color:var(--color-text-muted);
}

/* ─── Модалка синхронизации: сообщения ──────────────────────────────── */
#apartmentSyncMsg{
  margin-top:.5rem;
  padding:.55rem .75rem;
  border-radius:8px;
}
#apartmentSyncMsg[data-kind="error"]{
  background:color-mix(in oklab,var(--color-error) 12%,var(--color-surface-2));
  color:var(--color-error);
}
#apartmentSyncMsg[data-kind="success"]{
  background:color-mix(in oklab,var(--color-success) 12%,var(--color-surface-2));
  color:var(--color-success);
}
#apartmentSyncMsg[data-kind="info"]{
  background:color-mix(in oklab,var(--color-primary) 10%,var(--color-surface-2));
  color:var(--color-text-muted);
}

/* ─── Скрываем auth-corner-btn на не-главной секции ─────────────────── */
.auth-corner[data-hide-button="1"] .auth-corner-btn{ display:none !important; }

/* Скрываем кнопку Меню/Выход, когда открыта любая модалка
   (финансы, заявки, история — пользователь не на главной) */
body:has(.modal-backdrop.open) .auth-corner-btn{ display:none !important; }
/* Скрываем кнопку Меню/Выход, когда открыт drawer (боковое меню) */
body:has(.drawer.open) .auth-corner-btn{ display:none !important; }

/* Блокируем прокрутку фона, когда открыта любая модалка или боковое меню.
   Без этого при скролле внутри окна «протекала» главная страница под ним. */
body:has(.modal-backdrop.open),
body:has(.drawer.open){ overflow:hidden; }

/* ═══════════════════════════════════════════════════════════════════
   ГОСТЕВОЙ БОТ — стили для разделов: Брони, Инструкции, Чаты,
   Настройки уведомлений.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Брони ───────────────────────────────────────────────────────── */
.bk-filter{
  padding:.5rem .75rem;
  border-radius:8px;
  border:1px solid var(--color-border, rgba(0,0,0,.1));
  background:var(--color-surface, #fff);
  color:var(--color-text, #111);
  font-size:.875rem;
}
.bk-group{ margin-bottom:1.5rem; }
.bk-group-title{
  font-weight:600;
  font-size:.95rem;
  margin-bottom:.5rem;
  display:flex;
  align-items:center;
  gap:.5rem;
}
.bk-count{
  background:var(--color-surface-2, rgba(0,0,0,.05));
  padding:.1rem .5rem;
  border-radius:999px;
  font-size:.75rem;
  font-weight:500;
  color:var(--color-text-muted, #666);
}
.bk-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));
  gap:.75rem;
}
.bk-card{
  background:var(--color-surface, #fff);
  border:1px solid var(--color-border, rgba(0,0,0,.08));
  border-radius:12px;
  padding:.9rem;
  display:flex;
  flex-direction:column;
  gap:.5rem;
}
.bk-card-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:.5rem;
}
.bk-guest{ font-weight:600; font-size:.95rem; }
.bk-apt{
  font-size:.8rem;
  color:var(--color-text-muted, #666);
  text-align:right;
  max-width:50%;
}
.bk-card-body{ font-size:.85rem; line-height:1.5; }
.bk-dates{ color:var(--color-text-muted, #666); }
.bk-amount{ font-weight:600; margin-top:.25rem; }
.bk-tag{
  display:inline-block;
  padding:.05rem .4rem;
  margin-left:.35rem;
  border-radius:6px;
  background:var(--color-surface-2, rgba(0,0,0,.05));
  font-size:.7rem;
  font-weight:500;
  color:var(--color-text-muted, #666);
  text-transform:lowercase;
}
.bk-card-actions{
  display:flex;
  gap:.4rem;
  margin-top:.4rem;
}
.bk-card-actions .btn{
  flex:1;
  font-size:.8rem;
  padding:.45rem .5rem;
}
/* Окно «Оформить заезд». */
.bk-checkin-backdrop{ z-index:40; }
.bk-checkin{ width:min(520px,100%); display:grid; gap:.85rem; }
.bk-checkin .section-head{ margin-bottom:0; align-items:flex-start; }
.bk-checkin .muted{ margin:0; }
.bk-checkin-hint{ margin:0; color:var(--color-text-muted); line-height:1.45; }
.bk-checkin-group{ display:grid; gap:.5rem; }
.bk-checkin-group .btn{ width:100%; justify-content:center; }
.bk-checkin-group + .bk-checkin-group{ padding-top:.85rem; border-top:1px solid rgba(60,60,60,.12); }
.bk-checkin-email{ display:flex; gap:.5rem; }
.bk-checkin-email input{ flex:1; min-width:0; }
.bk-checkin-email .btn{ width:auto; flex:none; }
.bk-checkin-email.is-solo .btn{ width:100%; flex:1; }
.bk-checkin-extra{ display:grid; gap:.5rem; }
.bk-checkin-note{ margin:0; padding:.6rem .75rem; border-radius:10px; background:rgba(60,60,60,.06); color:var(--color-text-muted); line-height:1.45; }
.bk-checkin-note.is-warn{ background:rgba(179,38,30,.08); color:var(--color-error, #b3261e); }

/* ─── Раздел «Залог» ─── */
.dp-list{ display:grid; gap:.75rem; }
.dp-card{ display:grid; gap:.6rem; padding:.9rem 1rem; border:1px solid rgba(60,60,60,.12); border-radius:14px; background:var(--color-surface, #fff); }
.dp-head{ display:flex; justify-content:space-between; align-items:baseline; gap:.75rem; }
.dp-guest{ font-weight:600; }
.dp-amount{ font-weight:700; white-space:nowrap; }
.dp-meta{ display:grid; gap:.15rem; color:var(--color-text-muted); }
.dp-actions{ display:grid; grid-template-columns:1fr 1fr; gap:.5rem; }
.dp-actions .btn{ width:100%; justify-content:center; }
.dp-pending{ color:var(--color-text-muted); }
.dp-pending.is-error{ color:var(--color-error, #b3261e); }
/* Штраф: поле суммы и справа кнопка «Подтвердить» */
.dp-penalty{ display:grid; gap:.35rem; }
.dp-penalty[hidden]{ display:none; }
.dp-penalty-label{ color:var(--color-text-muted); }
.dp-penalty-row{ display:flex; gap:.5rem; align-items:stretch; }
.dp-penalty-row input{ flex:1 1 auto; min-width:0; }
.dp-penalty-row .btn{ flex:0 0 auto; white-space:nowrap; }
.dp-penalty-error{ color:var(--color-error, #b3261e); min-height:1.1em; }
.dp-penalty-error:empty{ min-height:0; }
.dp-empty{ padding:2rem 1rem; text-align:center; color:var(--color-text-muted); }
.dp-confirm-backdrop{ z-index:45; }
.dp-confirm{ width:min(440px,100%); display:grid; gap:.85rem; }
.dp-confirm p{ margin:0; line-height:1.45; }
.dp-confirm-actions{ display:grid; grid-template-columns:1fr 1fr; gap:.5rem; }
.dp-confirm-actions .btn{ width:100%; justify-content:center; }
.dp-confirm-status{ min-height:1.2em; }
.dp-confirm-status.is-error{ color:var(--color-error, #b3261e); }
.bk-checkin-status{ min-height:1.2em; color:var(--color-text-muted); }
.bk-checkin-status.is-error{ color:var(--color-error, #b3261e); }
.bk-checkin .btn.is-sent{
  background:color-mix(in oklab, var(--color-success, #1a7f37) 18%, var(--color-surface-2));
  color:var(--color-success, #1a7f37);
}
.bk-btn-link.is-sent{
  background:color-mix(in oklab, var(--color-success, #1a7f37) 18%, var(--color-surface-2));
  color:var(--color-success, #1a7f37);
}

/* Статусные бейджи в карточке брони (оплата, договор). */
.bk-badge{
  display:inline-block;
  padding:.15rem .45rem;
  border-radius:.5rem;
  font-size:.72rem;
  background:var(--color-surface-2);
  color:var(--color-text);
  white-space:nowrap;
}
.bk-badge-ok{
  background:color-mix(in oklab, var(--color-success, #1a7f37) 18%, var(--color-surface-2));
  color:var(--color-success, #1a7f37);
}
.bk-badge-warn{
  background:color-mix(in oklab, #d97706 18%, var(--color-surface-2));
  color:#d97706;
}
.bk-badge-mute{ opacity:.6; }
/* Статусы брони — сетка 2×2: оплата, договор / залог, уборка. Полный текст — в подсказке. */
.bk-status{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:.3rem;
  margin-top:.35rem;
}
.bk-status .bk-badge{
  overflow:hidden;
  text-overflow:ellipsis;
  text-align:left;
  min-width:0;
}
/* Маркер «вручную» — маленькая «р» у ручной отметки. */
.bk-manual{
  font-size:.6rem;
  font-weight:700;
  margin-left:.2rem;
  opacity:.75;
  text-decoration:none;
  display:inline-block;
}
/* Чат с горничной открывается из карточки брони — поверх окна «Брони». */
#maidChatModal{ z-index:40; }
/* Бейдж-кнопка ручной отметки (оплата, договор, залог). */
.bk-badge-btn{
  border:0;
  font-family:inherit;
  line-height:inherit;
  cursor:pointer;
  text-decoration:underline dotted;
  text-underline-offset:2px;
}
.bk-badge-btn:disabled{ cursor:wait; opacity:.5; }

/* Копируемый телефон в карточке брони. */
.bk-phone{
  display:inline-flex;
  align-items:center;
  gap:.25rem;
  background:transparent;
  border:none;
  padding:.15rem 0;
  margin:0;
  color:var(--color-text);
  opacity:.85;
  font:inherit;
  font-size:.85rem;
  cursor:pointer;
  text-align:left;
}
.bk-phone:hover{ opacity:1; text-decoration:underline; }

/* ── Инструкции и настройки бота ─────────────────────────────────── */
#guestInstructionsModal label,
#notifySettingsModal label{
  display:block;
  margin-bottom:.6rem;
  width:100%;
}
#guestInstructionsModal label > .small,
#notifySettingsModal label > .small{
  display:block;
  margin-bottom:.3rem;
  font-size:.8rem;
  opacity:.75;
}
#guestInstructionsModal input[type="text"],
#guestInstructionsModal input[type="number"],
#guestInstructionsModal textarea,
#guestInstructionsModal select,
#notifySettingsModal input[type="text"],
#notifySettingsModal input[type="number"],
#notifySettingsModal textarea,
#notifySettingsModal select{
  margin-top:0;
  width:100%;
  box-sizing:border-box;
  padding:.55rem .75rem;
  border-radius:.6rem;
  border:1px solid var(--color-border, rgba(0,0,0,.12));
  background:var(--color-surface, #1a1a1a);
  color:var(--color-text, #f3f3f3);
  font:inherit;
  font-size:.95rem;
  line-height:1.35;
  transition:border-color .15s ease, box-shadow .15s ease;
}
#guestInstructionsModal input:focus,
#guestInstructionsModal textarea:focus,
#guestInstructionsModal select:focus,
#notifySettingsModal input:focus,
#notifySettingsModal textarea:focus,
#notifySettingsModal select:focus{
  outline:none;
  border-color:var(--color-primary, #3b82f6);
  box-shadow:0 0 0 3px color-mix(in oklab, var(--color-primary, #3b82f6) 22%, transparent);
}
#guestInstructionsModal textarea,
#notifySettingsModal textarea{
  resize:vertical;
  min-height:2.6rem;
}
.instr-h{
  font-size:1.02rem;
  font-weight:700;
  margin:1.25rem 0 .75rem;
  padding-top:.75rem;
  border-top:1px solid var(--color-border, rgba(0,0,0,.08));
  letter-spacing:.01em;
  display:flex;
  align-items:center;
  gap:.45rem;
}
.instr-h:first-of-type{ border-top:none; padding-top:0; margin-top:.5rem; }
#guestInstructionsModal .modal{ max-width:760px; }
#guestInstructionsModal label{
  margin-bottom:.75rem;
}
#guestInstructionsModal label > .small,
#notifySettingsModal label > .small{
  font-weight:500;
  color:var(--color-text-muted);
}
@media (min-width:720px){
  #guestInstructionsModal .instr-grid-2{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:0 .9rem;
    margin-bottom:0;
  }
  #guestInstructionsModal .instr-grid-2 > label{
    margin-bottom:.75rem;
  }
}

/* Точки на карте в «Инструкциях для гостей» */
#guestInstructionsModal .geo-row{ display:flex; align-items:center; gap:.6rem; margin-top:.4rem; }
#guestInstructionsModal .geo-row > input{ flex:1 1 auto; min-width:0; margin-top:0; }
#guestInstructionsModal .geo-check{ flex:0 0 auto; white-space:nowrap; color:var(--color-primary); text-decoration:none; font-weight:600; }
#guestInstructionsModal .geo-check:hover{ text-decoration:underline; }
#guestInstructionsModal input.geo-bad{ border-color:var(--color-error,#c33); box-shadow:0 0 0 1px var(--color-error,#c33) inset; }
#guestInstructionsModal .geo-hint{ margin:-.35rem 0 .75rem; line-height:1.4; }
#guestInstructionsModal .geo-extra-head{ display:flex; align-items:center; justify-content:space-between; gap:.6rem; margin:.25rem 0 .5rem; }
#guestInstructionsModal .geo-extra-head > .small{ font-weight:500; color:var(--color-text-muted); }
#guestInstructionsModal .geo-points{ display:grid; gap:.5rem; margin-bottom:.6rem; }
#guestInstructionsModal .geo-points:empty{ display:none; }
#guestInstructionsModal .geo-point{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:.4rem .5rem; align-items:center; padding:.6rem; border:1px solid var(--color-border, rgba(0,0,0,.08)); border-radius:var(--radius-lg, .75rem); background:var(--color-surface, transparent); }
#guestInstructionsModal .geo-point > [data-geo-label]{ grid-column:1; grid-row:1; margin:0; }
#guestInstructionsModal .geo-point > .geo-row{ grid-column:1; grid-row:2; margin:0; }
#guestInstructionsModal .geo-point > .geo-del{ grid-column:2; grid-row:1 / span 2; align-self:center; }
@media (min-width:720px){
  #guestInstructionsModal .geo-point{ grid-template-columns:minmax(0,.8fr) minmax(0,1.4fr) auto; }
  #guestInstructionsModal .geo-point > .geo-row{ grid-column:2; grid-row:1; }
  #guestInstructionsModal .geo-point > .geo-del{ grid-column:3; grid-row:1; }
}
#guestInstructionsModal.instr-readonly #instrGeoAddBtn,
#guestInstructionsModal.instr-readonly .geo-del{ display:none; }
#guestInstructionsModal.instr-readonly #instrGeoEmpty{ display:none; }

.check{
  display:flex;
  align-items:center;
  gap:.5rem;
  margin:.4rem 0;
  font-size:.9rem;
  cursor:pointer;
}

/* ── Чаты ────────────────────────────────────────────────────────── */
.chat-modal{ padding:1rem; max-height:92dvh; height:92dvh; }
.chats-grid{
  display:grid;
  grid-template-columns:300px 1fr;
  gap:.75rem;
  flex:1;
  min-height:0;
  height:calc(92dvh - 110px);
}
.chats-side{
  border-right:1px solid var(--color-border, rgba(0,0,0,.08));
  overflow:auto;
  padding-right:.5rem;
  min-height:0;
}
.chat-row{
  display:block;
  width:100%;
  text-align:left;
  background:transparent;
  border:none;
  padding:.7rem .6rem;
  border-radius:8px;
  cursor:pointer;
  border-bottom:1px solid var(--color-border, rgba(0,0,0,.06));
  color:inherit;
}
.chat-row:hover{ background:var(--color-surface-2, rgba(0,0,0,.04)); }
.chat-row.is-active{ background:color-mix(in oklab, var(--color-primary, #3b82f6) 12%, var(--color-surface-2)); }
.chat-row-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:.5rem;
}
.chat-row-name{ font-weight:600; font-size:.9rem; }
.chat-row-bottom{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top:.2rem;
}
.chat-row-apt{ opacity:.75; font-size:.8rem; }
.chat-unread{
  background:var(--color-primary, #3b82f6);
  color:#fff;
  font-size:.7rem;
  font-weight:600;
  padding:.1rem .5rem;
  border-radius:999px;
  min-width:1.25rem;
  text-align:center;
}
.chats-main{
  display:flex;
  flex-direction:column;
  min-height:0;
  overflow:hidden;
  height:100%;
}
/* Когда есть активный чат — скрываем сторону на мобильных */
.chats-grid.has-active .chats-side{ display:none; }
.chats-grid.has-active .chats-main{ display:flex; }
/* Когда активного чата нет — скрываем основную панель на мобильных */
.chats-grid.no-active .chats-main{ display:none; }
.chats-head{
  padding:.5rem .25rem .75rem;
  border-bottom:1px solid var(--color-border, rgba(0,0,0,.08));
  margin-bottom:.5rem;
}
.chats-thread{
  flex:1 1 auto;
  overflow-y:auto;
  padding:.5rem;
  display:flex;
  flex-direction:column;
  gap:.5rem;
  min-height:200px;
}
.chat-msg{
  max-width:75%;
  padding:.5rem .75rem;
  border-radius:12px;
  font-size:.9rem;
  line-height:1.45;
}
.chat-msg-meta{ opacity:.7; margin-bottom:.2rem; font-size:.7rem; }
.chat-msg-body{ white-space:pre-wrap;  }
.msg-inbound{
  align-self:flex-start;
  background:var(--color-surface-2, rgba(0,0,0,.06));
}
.msg-bot{
  align-self:flex-start;
  background:color-mix(in oklab, var(--color-primary, #3b82f6) 10%, var(--color-surface-2));
}
.msg-manager{
  align-self:flex-end;
  background:color-mix(in oklab, var(--color-success, #1a7f37) 18%, var(--color-surface-2));
}
.msg-system{
  align-self:center;
  background:transparent;
  font-style:italic;
  opacity:.65;
  font-size:.8rem;
}
.chats-composer{
  display:flex;
  gap:.5rem;
  padding:.5rem 0;
  border-top:1px solid var(--color-border, rgba(0,0,0,.08));
}
.chats-composer textarea{
  flex:1;
  resize:vertical;
  min-height:50px;
  padding:.5rem .75rem;
  border:1px solid var(--color-border, rgba(0,0,0,.1));
  border-radius:8px;
  font-family:inherit;
  font-size:.9rem;
}
@media (max-width:720px){
  .chats-grid{
    grid-template-columns:1fr;
    height:calc(92dvh - 110px);
  }
  .chats-side{ max-height:none; border-right:none; }
  .chat-modal{ max-height:96dvh !important; height:96dvh; }
}
@media (min-width:721px){
  /* На десктопе всегда показываем обе колонки */
  .chats-grid.has-active .chats-side,
  .chats-grid.no-active .chats-main{ display:block; }
  .chats-grid.no-active .chats-main{ display:flex; }
}

/* ─── Юнит экономика (таблица) ────────────────────────────────────────── */
.unit-eco-wrap{ margin-top:.75rem; }
.unit-eco-table-scroll{
  overflow-x:auto;
  border:1px solid var(--color-border, rgba(0,0,0,.08));
  border-radius:var(--radius-lg, 12px);
  background:var(--color-surface, #fff);
}
.unit-eco-table{
  width:100%;
  border-collapse:collapse;
  font-size:.88rem;
  min-width:880px;
}
.unit-eco-table th,
.unit-eco-table td{
  padding:.55rem .65rem;
  border-bottom:1px solid var(--color-border, rgba(0,0,0,.06));
  text-align:left;
  vertical-align:middle;
  white-space:nowrap;
}
.unit-eco-table thead th{
  position:sticky;
  top:0;
  background:var(--color-surface-2, #f5f5f7);
  font-weight:600;
  font-size:.78rem;
  color:var(--color-text-muted, #666);
  text-transform:uppercase;
  letter-spacing:.02em;
}
.unit-eco-table td.num,
.unit-eco-table th.num{ text-align:right; font-variant-numeric:tabular-nums; }
.unit-eco-table td.unit-eco-name{ font-weight:600; }
.unit-eco-table td.small,
.unit-eco-table td.muted{ color:var(--color-text-muted, #888); }
.unit-eco-table tbody tr:hover{ background:rgba(0,0,0,.02); }
.unit-eco-table tfoot tr.unit-eco-total td{
  background:var(--color-surface-2, #f5f5f7);
  border-top:2px solid var(--color-border, rgba(0,0,0,.12));
  font-weight:700;
}
@media (max-width:720px){
  .unit-eco-table{ font-size:.82rem; min-width:760px; }
  .unit-eco-table th, .unit-eco-table td{ padding:.45rem .5rem; }
}

/* ─── Toggle switch (тумблер) ─────────────────────────────── */
.gy-toggle{
  display:flex;
  align-items:flex-start;
  gap:.75rem;
  cursor:pointer;
  user-select:none;
  padding:.25rem 0;
}
.gy-toggle input[type=checkbox]{
  position:absolute;
  opacity:0;
  width:0;
  height:0;
  pointer-events:none;
}
.gy-toggle-track{
  position:relative;
  display:inline-block;
  flex-shrink:0;
  width:44px;
  height:26px;
  background:var(--color-surface-2, #d0d0d0);
  border-radius:999px;
  transition:background .18s ease;
  margin-top:.1rem;
}
.gy-toggle-thumb{
  position:absolute;
  top:3px;
  left:3px;
  width:20px;
  height:20px;
  background:#fff;
  border-radius:50%;
  box-shadow:0 1px 3px rgba(0,0,0,.25);
  transition:transform .18s ease;
}
.gy-toggle input[type=checkbox]:checked + .gy-toggle-track{
  background:var(--color-primary, #4aa3a3);
}
.gy-toggle input[type=checkbox]:checked + .gy-toggle-track .gy-toggle-thumb{
  transform:translateX(18px);
}
.gy-toggle input[type=checkbox]:focus-visible + .gy-toggle-track{
  outline:2px solid var(--color-primary, #4aa3a3);
  outline-offset:2px;
}
.gy-toggle-label{
  flex:1;
  line-height:1.35;
  font-size:.95rem;
}

/* ── Раздел «Горничные» ─────────────────────────────────────────── */
.maid-apt-row{
  display:flex;
  align-items:center;
  gap:.6rem;
  padding:.5rem .6rem;
  border-radius:.5rem;
  cursor:pointer;
  border:1px solid transparent;
  transition:background .15s, border-color .15s;
}
.maid-apt-row:hover{
  background:var(--color-surface-2);
  border-color:rgba(60,60,60,.12);
}
.maid-apt-cb{
  width:20px !important;
  height:20px !important;
  min-width:20px !important;
  max-width:20px !important;
  padding:0 !important;
  margin:0 !important;
  flex:0 0 20px !important;
  box-sizing:border-box !important;
  accent-color:var(--color-primary);
  border:1px solid rgba(60,60,60,.3) !important;
  background:var(--color-surface-2) !important;
  appearance:auto !important;
  -webkit-appearance:checkbox !important;
}
.maid-apt-name{
  display:block;
  flex:1 1 auto;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--color-text);
  font-size:.95rem;
}
.maid-apt-rid{
  display:block;
  color:var(--color-text-muted);
  flex:0 0 auto;
  font-variant-numeric:tabular-nums;
  font-size:.8rem;
}

/* Чат-инпут горничной */
#maidChatInput{
  padding:.65rem .85rem;
}
#maidChatBox img{
  max-width:100%;
  height:auto;
}

/* Мобильная адаптация модалок горничных */
@media (max-width:640px){
  #maidsModal .modal,
  #maidEditModal .modal,
  #maidChatModal .modal{
    padding:1rem;
    border-radius:1rem;
  }
  .maid-apt-row{ padding:.55rem .5rem; }
}

/* ── Заставка загрузки «А-Смена» ──────────────────── */
/* Пока body.is-booting — видна только заставка: приложение, экран входа и модалки скрыты. */
.boot-splash{display:none;position:fixed;inset:0;z-index:10001;flex-direction:column;align-items:center;justify-content:center;gap:1.1rem;padding:1.5rem;background:#0b0f18;color:#fff;text-align:center}
body.is-booting .boot-splash{display:flex}
body.is-booting .guest-gate,
body.is-booting .app,
body.is-booting .drawer,
body.is-booting .drawer-backdrop,
body.is-booting .auth-corner,
body.is-booting .modal-backdrop{display:none !important}
.boot-splash-logo{width:min(320px,72vw);height:auto;display:block}
.boot-splash-row{display:flex;align-items:center;gap:.6rem;font-size:1rem;color:rgba(255,255,255,.85)}
.boot-splash-spinner{width:18px;height:18px;border-radius:50%;border:2px solid rgba(249,115,22,.25);border-top-color:#f97316;animation:boot-spin .8s linear infinite}
.boot-splash-spinner[hidden]{display:none}
.boot-splash-hint{max-width:22rem;font-size:.875rem;line-height:1.4;color:rgba(255,255,255,.6)}
.boot-splash-hint[hidden]{display:none}
.boot-splash-btn{padding:.6rem 1.4rem;border-radius:10px;border:0;background:#f97316;color:#fff;font-size:.95rem;font-weight:700;cursor:pointer}
.boot-splash-btn[hidden]{display:none}
@keyframes boot-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.boot-splash-spinner{animation-duration:2.4s}}

/* ── Гостевой экран входа ─────────────────────────── */
.guest-gate{display:none;position:fixed;inset:0;z-index:9999;align-items:center;justify-content:center;padding:1.25rem;background:var(--color-bg,#0b0d10);overflow-y:auto}
body.is-guest .guest-gate{display:flex}
body.is-guest .app,
body.is-guest .drawer,
body.is-guest .drawer-backdrop,
body.is-guest .auth-corner,
body.is-guest .modal-backdrop{display:none !important}
.guest-gate-card{width:100%;max-width:26rem;background:var(--color-surface,#151719);border:1px solid rgba(255,255,255,.06);border-radius:var(--radius-xl,1rem);padding:1.75rem 1.5rem;box-shadow:0 20px 60px rgba(0,0,0,.35);display:grid;grid-template-columns:minmax(0,1fr);gap:.65rem}
.guest-gate-title{margin:.25rem 0 .35rem;font-size:1.4rem;font-weight:700}
.guest-gate-hint{margin:0 0 .5rem;color:var(--color-text-muted);font-size:.9rem;line-height:1.4}
.guest-gate input[type=email],
.guest-gate input[type=password],
.guest-gate input[type=text]{width:100%;padding:.7rem .85rem;border-radius:var(--radius-md,.6rem);background:var(--color-surface-2);border:1px solid rgba(255,255,255,.08);color:var(--color-text);font-size:1rem;outline:none;transition:border-color var(--transition)}
.guest-gate input:focus{border-color:var(--color-primary)}
.guest-gate-pwd{position:relative}
.guest-gate-pwd input{padding-right:2.5rem}
.guest-gate-eye{position:absolute;top:50%;right:.55rem;transform:translateY(-50%);background:transparent;border:none;color:var(--color-text-muted);font-size:1.05rem;cursor:pointer;padding:.3rem .4rem}
.guest-gate-actions{display:flex;gap:.5rem;margin-top:.35rem}
.guest-gate-actions .btn{flex:1;justify-content:center}
.guest-gate-msg{min-height:1.1rem;font-size:.85rem;color:var(--color-text-muted)}
.guest-gate-msg.error{color:var(--color-error)}
.guest-gate-msg.success{color:var(--color-success)}

/* ─── Consent checkbox в gate/authBar ─── */
/* min-width:0 критичен, чтобы flex/grid item не распирал контейнер мин-вшириной контента */
.gate-consent-check,
.authbar-consent-check{
  display:flex;
  gap:.5rem;
  align-items:flex-start;
  font-size:.85rem;
  line-height:1.4;
  margin:.5rem 0;
  width:100%;
  min-width:0;
  box-sizing:border-box;
}
.gate-consent-check > span,
.authbar-consent-check > span{
  flex:1 1 auto;
  min-width:0;
  
  
}
.gate-consent-check input[type=checkbox],
.authbar-consent-check input[type=checkbox]{
  flex:0 0 auto;
  width:16px;
  height:16px;
  min-width:16px;
  padding:0;
  margin:.2rem 0 0;
  border:1px solid rgba(60,60,60,.35);
  border-radius:3px;
  background:transparent;
  appearance:auto;
  -webkit-appearance:checkbox;
}
.gate-consent-check a,
.authbar-consent-check a{color:#7fd3ff;text-decoration:underline}
.gate-consent-check small,
.authbar-consent-check em{opacity:.65;font-style:normal}
.authbar-consent-check{font-size:.78rem;line-height:1.35;margin:.4rem 0}

/* ═══════════════════════════════════════════════════════════════════
   УЧЁТ РАСХОДНИКОВ — компактные карточки с быстрыми действиями.
   Правая колонка (расход/комплекты/покрытие) убрана, поэтому список
   занимает всю ширину и раскладывается в адаптивную сетку. */
.workspace{grid-template-columns:1fr}
#linenList .grid,#guestList .grid{grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:var(--space-4)}
.item-card{gap:.7rem;padding:var(--space-4)}
.item-head-right{display:flex;align-items:center;gap:.5rem;flex:0 0 auto}
.item-del-btn{width:26px;height:26px;border-radius:8px;background:var(--color-surface-2);border:1px solid rgba(60,60,60,.12);color:var(--color-text-muted);font-size:.8rem;line-height:1;cursor:pointer;flex:0 0 auto}
.item-del-btn:hover{color:var(--color-error);border-color:color-mix(in oklab,var(--color-error) 35%,transparent)}
.item-qty-row{display:grid;grid-template-columns:46px 1fr 46px;gap:.5rem;align-items:stretch}
.qbtn{border-radius:var(--radius-md);border:1px solid rgba(60,60,60,.12);background:var(--color-surface-2);font-size:1.4rem;font-weight:700;line-height:1;cursor:pointer;min-height:52px}
.qbtn-minus{color:var(--color-error);background:color-mix(in oklab,var(--color-error) 9%,var(--color-surface-2));border-color:color-mix(in oklab,var(--color-error) 18%,transparent)}
.qbtn-plus{color:var(--color-success);background:color-mix(in oklab,var(--color-success) 9%,var(--color-surface-2));border-color:color-mix(in oklab,var(--color-success) 18%,transparent)}
.qbtn:active{transform:translateY(1px)}
.item-qty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.05rem;border-radius:var(--radius-md);border:1px dashed rgba(60,60,60,.22);background:transparent;cursor:pointer;padding:.3rem}
.item-qty strong{font-size:1.55rem;line-height:1;font-variant-numeric:tabular-nums lining-nums}
.item-meta{display:flex;align-items:center;justify-content:space-between;gap:.6rem;flex-wrap:wrap}
.item-par{display:flex;align-items:center;gap:.4rem;margin:0}
.item-par input{width:66px;padding:.35rem .5rem;border-radius:8px;border:1px solid rgba(60,60,60,.15);background:var(--color-surface-2);text-align:center;font-variant-numeric:tabular-nums}
.item-hint{white-space:nowrap}
.item-hint.is-low{color:var(--color-error)}
.item-adv{border-top:1px dashed rgba(60,60,60,.12);padding-top:.35rem}
.item-adv>summary{cursor:pointer;color:var(--color-text-muted);list-style:none;user-select:none}
.item-adv>summary::-webkit-details-marker{display:none}
.item-adv-body{display:grid;gap:.55rem;margin-top:.55rem}
.item-adv-field{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin:0}
.item-adv-field input{width:82px;padding:.35rem .5rem;border-radius:8px;border:1px solid rgba(60,60,60,.15);background:var(--color-surface-2);text-align:center}
.item-adv-actions{display:flex;flex-wrap:wrap;gap:.4rem}
.item-adv-actions .mini-btn{flex:1 1 auto;min-height:38px;padding:.5rem .5rem;font-size:.85rem}
.item-damage-btn{flex:0 0 100%;color:var(--color-warning);background:color-mix(in oklab,var(--color-warning) 10%,var(--color-surface-2));border-color:color-mix(in oklab,var(--color-warning) 25%,transparent)}

/* Подзаголовки-разделители в боковом меню (Основное / Чаты / Интеграции) */
.drawer-section-label{margin:.6rem 0 -.15rem;padding:0 .25rem;font-size:var(--text-xs);text-transform:uppercase;letter-spacing:.09em;color:var(--color-text-muted);font-weight:700}
.drawer-section-label:first-child{margin-top:0}

/* ==== Таблица «Итоги по квартирам» (референс — приложение «Реалти») ==== */
.fin-tbl-wrap{width:100%;overflow-x:auto;border-radius:var(--radius-lg);border:1px solid var(--color-border);background:var(--color-surface-1)}
.fin-tbl{width:100%;border-collapse:collapse;font-size:var(--text-sm);font-variant-numeric:tabular-nums lining-nums;min-width:820px}
.fin-tbl thead th{position:sticky;top:0;background:var(--color-surface-2);color:var(--color-text-muted);font-weight:600;text-align:left;padding:.6rem .7rem;border-bottom:1px solid var(--color-border);white-space:normal;vertical-align:bottom;line-height:1.2}
.fin-tbl th.num,.fin-tbl td.num{text-align:right}
.fin-tbl tbody td{padding:.6rem .7rem;border-bottom:1px solid var(--color-border)}
.fin-tbl tbody tr:last-child td{border-bottom:none}
.fin-tbl .fin-tbl-name{font-weight:600;white-space:nowrap}
.fin-tbl-link{background:none;border:none;padding:0;font:inherit;color:var(--color-text);text-decoration:underline;text-decoration-style:dotted;text-underline-offset:2px;cursor:pointer;font-variant-numeric:tabular-nums lining-nums}
.fin-tbl-link:hover{color:var(--color-primary);text-decoration-style:solid}
.fin-tbl tfoot .fin-tbl-total td{padding:.7rem;font-weight:700;background:var(--color-surface-2);border-top:2px solid var(--color-border)}
/* Вертикальные разделители */
.fin-tbl th + th, .fin-tbl td + td{border-left:1px solid var(--color-border)}
.fin-tbl tfoot .fin-tbl-total td + td{border-left:1px solid var(--color-border)}
/* Компактные стрелки цикла */
.fin-tbl td.fin-cycle-period{white-space:nowrap;padding:.4rem .35rem;font-variant-numeric:tabular-nums;text-align:center}
.fin-cycle-period .cycle-range{display:inline-block;margin:0 .25rem;white-space:nowrap}
.cycle-arrow{appearance:none;background:transparent;color:var(--color-text-muted);border:1px solid var(--color-border);border-radius:.3rem;width:1.15rem;height:1.15rem;display:inline-flex;align-items:center;justify-content:center;font-size:.8rem;line-height:1;padding:0;margin:0;cursor:pointer;vertical-align:middle;transition:background .15s,color .15s}
.cycle-arrow:hover{background:var(--color-surface-2);color:var(--color-text)}
.cycle-arrow:active{transform:translateY(1px)}
/* Кнопка PDF-отчёта рядом со стрелками цикла */
.cycle-arrow.cycle-pdf{width:auto;padding:0 .3rem;margin-left:.35rem;font-size:.62rem;font-weight:600;letter-spacing:.02em}
.cycle-arrow.cycle-pdf:disabled{opacity:.5;cursor:progress}

/* ==== Блок выбора периода в «Итогах по квартирам» ==== */
.summary-period{display:flex;flex-direction:column;gap:.6rem;margin-bottom:1rem;padding:.75rem;border-radius:var(--radius-lg);background:var(--color-surface-2)}
.summary-period-row{display:flex;flex-wrap:wrap;gap:.5rem}
.summary-period-field{display:flex;flex-direction:column;gap:.25rem;flex:1 1 140px;min-width:0}
.summary-period-field .small{color:var(--color-text-muted)}
.summary-period-field input[type="date"]{display:block;width:100%;box-sizing:border-box;min-height:2.4rem;padding:.45rem .6rem;border-radius:var(--radius-md);border:1px solid var(--color-border);background:var(--color-surface-1);color:var(--color-text);font:inherit;-webkit-appearance:none;appearance:none}
.summary-period-presets{display:flex;flex-wrap:wrap;gap:.4rem}
.summary-period-btn{padding:.4rem .7rem;font-size:.85rem;flex:0 1 auto}

/* «Несколько квартир» в модалках расхода: список галочек */
.apt-multi{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:.4rem .5rem;padding:.6rem .7rem;border-radius:var(--radius-lg);background:var(--color-surface-2)}
.apt-multi[hidden]{display:none}
.apt-multi .apt-multi-item{display:inline-flex !important;flex-direction:row;align-items:center;gap:.4rem;width:auto;margin:0;padding:.3rem .65rem;border-radius:var(--radius-full);background:var(--color-bg);border:1px solid rgba(60,60,60,.12);font-size:var(--text-sm);white-space:nowrap;cursor:pointer}
.apt-multi .apt-multi-item input{width:auto;min-width:0;height:auto;margin:0;padding:0;flex:0 0 auto}
/* Регулярный расход на несколько квартир: сумма на квартиру и список квартир */
.recurring-split-line{margin-top:.35rem;color:var(--color-text);font-weight:600}
.recurring-split-apts{margin-top:.1rem;color:var(--color-text-muted)}

/* Оценки гостей: звёздочка со средней оценкой на карточке квартиры и окно отзывов. */
.apt-title-row{display:flex;align-items:baseline;gap:.45rem;min-width:0}
.apt-title-row strong{min-width:0}
.apt-rating{flex-shrink:0;display:inline-flex;align-items:center;gap:.15rem;padding:.05rem .35rem;border-radius:999px;font-size:.78rem;font-weight:600;line-height:1.4;color:var(--color-text-muted);cursor:pointer;font-variant-numeric:tabular-nums}
.apt-rating[hidden]{display:none}
.apt-rating:hover,.apt-rating:focus-visible{background:var(--color-surface);color:var(--color-text);outline:none}
.apt-rating-star{color:#d4a017;font-size:.85rem;line-height:1}
.rv-list{display:grid;gap:.75rem}
.rv-item{padding:.85rem 1rem;border-radius:var(--radius-lg);background:var(--color-surface-2);border:1px solid var(--color-border,rgba(60,60,60,.1))}
.rv-head{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem}
.rv-dates{color:var(--color-text-muted);margin-top:.15rem}
.rv-stars{color:#d4a017;letter-spacing:.05em;white-space:nowrap;font-size:.95rem}
.rv-stars-off{color:color-mix(in oklab,var(--color-text) 18%,transparent)}
.rv-text{margin-top:.5rem;white-space:pre-wrap;line-height:1.45;font-size:var(--text-sm)}
.rv-checkin .small{color:var(--color-text-muted)}

/* Логотип А-Смена: оранжевый знак картинкой, слово «Смена» — маской цвета текста (видно в светлой и тёмной теме). */
.brand-logo{position:relative;display:block;height:2.1rem;aspect-ratio:786/191;margin:0 0 .35rem;max-width:100%}
.brand-logo-mark{position:absolute;inset:0;width:100%;height:100%;display:block}
.brand-logo-word{position:absolute;inset:0;background:var(--color-text);-webkit-mask:url(./a-smena-word.png?v=20261104-1) center/contain no-repeat;mask:url(./a-smena-word.png?v=20261104-1) center/contain no-repeat}
.drawer-head .brand-logo{height:1.8rem}
/* Чекбоксы не растягиваются на всю ширину (иначе подпись уезжает за край). */
input[type=checkbox],input[type=radio]{width:auto;flex:0 0 auto;padding:0;margin:0}

/* ─── Горничные: долг в карточке и окно «Уборки» (maidPay.js) ─── */
.maid-debt-line{ display:flex; flex-wrap:wrap; gap:.35rem; margin-top:.5rem; }
.maid-debt{ display:inline-flex; align-items:center; padding:.2rem .55rem; border-radius:var(--radius-full, 999px); font-size:var(--text-xs, .78rem); font-weight:600; line-height:1.3; }
.maid-debt.muted{ font-weight:400; color:var(--color-text-muted); padding-left:0; }
.maid-debt--due{ background:#fff4e5; color:#8a4b00; }
.maid-debt--ok{ background:#e6f4ea; color:#137333; }
.maid-debt--warn{ background:#fce8e6; color:#b3261e; }
#maidWorkModal{ z-index:40; }
#maidWorkModal .mw-modal{ width:min(760px,100%); display:flex; flex-direction:column; max-height:92dvh; }
.mw-tabs{ display:flex; gap:.25rem; padding:.25rem; background:var(--color-surface-2, rgba(0,0,0,.04)); border-radius:var(--radius-lg, .75rem); margin-bottom:.75rem; }
.mw-tab{ flex:1; padding:.5rem .6rem; border-radius:var(--radius-md, .55rem); font-weight:600; font-size:var(--text-sm, .9rem); color:var(--color-text-muted); background:transparent; border:0; cursor:pointer; }
.mw-tab.active{ background:var(--color-bg, #fff); color:var(--color-text); box-shadow:var(--shadow-sm, 0 1px 2px rgba(0,0,0,.08)); }
.mw-body{ flex:1 1 auto; overflow:auto; min-height:120px; }
.mw-empty{ padding:1rem; color:var(--color-text-muted); }
.mw-err{ color:var(--color-error, #c33); }
.mw-hint{ margin:0 0 .75rem; line-height:1.4; }
.mw-allpaid{ padding:1.25rem 1rem; text-align:center; font-weight:700; color:#137333; background:#e6f4ea; border-radius:var(--radius-lg, .75rem); margin-bottom:.75rem; }
.mw-row{ display:grid; grid-template-columns:1.5rem 3.2rem minmax(0,1fr) auto; align-items:center; gap:.6rem; padding:.55rem .25rem; border-bottom:1px solid var(--color-border, rgba(0,0,0,.08)); }
.mw-row--head{ font-size:var(--text-xs, .78rem); color:var(--color-text-muted); font-weight:600; text-transform:uppercase; letter-spacing:.04em; padding-top:0; cursor:pointer; }
.mw-row input[type=checkbox]{ width:1.1rem; height:1.1rem; }
.mw-when{ font-variant-numeric:tabular-nums; font-weight:600; }
.mw-what{ display:flex; flex-direction:column; min-width:0; }
.mw-apt{ font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mw-sum{ display:flex; flex-direction:column; align-items:flex-end; gap:.15rem; text-align:right; font-variant-numeric:tabular-nums; }
.mw-sum input{ width:6.5rem; text-align:right; padding:.35rem .5rem; margin:0; }
.mw-sum input.mw-noprice{ border-color:var(--color-error, #c33); }
.mw-reset{ background:none; border:0; padding:0; font-size:var(--text-xs, .75rem); color:var(--color-primary); cursor:pointer; }
.mw-sub{ display:flex; flex-direction:column; gap:.15rem; margin:1rem 0 .25rem; font-weight:700; color:#b3261e; }
.mw-sub .small{ font-weight:400; }
.mw-row--open .mw-apt{ color:var(--color-text); }
.mw-foot:empty{ display:none; }
.mw-foot{ border-top:1px solid var(--color-border, rgba(0,0,0,.1)); padding-top:.75rem; margin-top:.5rem; display:grid; gap:.6rem; }
.mw-total{ display:grid; grid-template-columns:1fr 1fr; gap:.75rem; }
.mw-total > div{ display:flex; flex-direction:column; padding:.55rem .75rem; background:var(--color-surface-2, rgba(0,0,0,.04)); border-radius:var(--radius-lg, .75rem); }
.mw-total strong{ font-size:1.2rem; font-variant-numeric:tabular-nums; }
.mw-pay{ display:flex; align-items:flex-end; gap:.75rem; flex-wrap:wrap; }
.mw-pay label{ display:flex; flex-direction:column; gap:.25rem; }
.mw-pay input[type=date]{ margin:0; }
.mw-pay .btn{ flex:1; min-width:12rem; }
.mw-pay .btn:disabled{ opacity:.5; cursor:not-allowed; }
.mw-rates{ display:grid; gap:.4rem; }
.mw-rate{ display:grid; grid-template-columns:minmax(0,1fr) auto 7rem; align-items:center; gap:.6rem; padding:.5rem .25rem; border-bottom:1px solid var(--color-border, rgba(0,0,0,.08)); }
.mw-rate input{ margin:0; text-align:right; }
.mw-hist-head{ display:flex; align-items:center; justify-content:space-between; gap:.75rem; margin-bottom:.5rem; }
.mw-hist-head select{ width:auto; margin:0; }
.mw-payout{ border:1px solid var(--color-border, rgba(0,0,0,.08)); border-radius:var(--radius-lg, .75rem); margin-bottom:.5rem; overflow:hidden; }
.mw-payout summary{ display:grid; grid-template-columns:5rem minmax(0,1fr) auto; gap:.6rem; align-items:center; padding:.6rem .75rem; cursor:pointer; list-style:none; }
.mw-payout summary::-webkit-details-marker{ display:none; }
.mw-payout[open] summary{ background:var(--color-surface-2, rgba(0,0,0,.04)); }
.mw-payout-items{ padding:.25rem .75rem; }
.mw-item{ display:grid; grid-template-columns:3.2rem minmax(0,1fr) auto; gap:.6rem; padding:.35rem 0; border-bottom:1px dashed var(--color-border, rgba(0,0,0,.08)); font-size:var(--text-sm, .9rem); }
.mw-item .mw-what{ display:block; }
.mw-payout summary .mw-what{ display:flex; flex-direction:column; }
.mw-tab{ white-space:nowrap; }
.mw-payout-actions{ display:flex; justify-content:flex-end; padding:.5rem .75rem .75rem; }
@media (max-width:560px){
  .mw-row{ grid-template-columns:1.3rem 2.8rem minmax(0,1fr) auto; gap:.45rem; }
  .mw-sum input{ width:5.5rem; }
  .mw-rate{ grid-template-columns:minmax(0,1fr) 6rem; }
  .mw-rate .small{ grid-column:1; grid-row:2; }
  .mw-rate input{ grid-column:2; grid-row:1 / span 2; }
  .mw-total strong{ font-size:1.05rem; }
  .mw-tab{ padding:.5rem .3rem; font-size:var(--text-xs, .8rem); }
  #maidWorkModal .mw-modal{ max-height:96dvh; }
}
.mw-nowrap{ white-space:nowrap; }
/* Датчик двери (doorSensor.js) */
#doorSensorRoot{display:grid;gap:var(--space-4)}
.door-status{display:grid;gap:.55rem}
.door-switch{display:flex;gap:.8rem;align-items:flex-start;padding:.85rem 1rem;border-radius:var(--radius-lg);background:var(--color-surface-2);cursor:pointer}
.door-switch input{width:auto;margin-top:.25rem}
.door-switch>span{display:grid;gap:.15rem}
.door-status .line .badge{white-space:normal;text-align:right;max-width:70%}
.door-mode{width:auto;max-width:60%;padding:.45rem .7rem}
.door-h{margin:var(--space-2) 0 0;font-size:var(--text-sm)}
.door-quick{display:flex;gap:.55rem;flex-wrap:wrap}
.door-quick .mini-btn{padding:.6rem .9rem}
.door-custom{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) auto;gap:.55rem;align-items:end}
.door-custom input{padding:.55rem .7rem}
.door-grant{gap:var(--space-3)}
.door-log{overflow:auto;max-height:420px;border-radius:var(--radius-lg);border:1px solid rgba(60,60,60,.1)}
.door-log table{width:100%;border-collapse:collapse;font-size:var(--text-sm)}
.door-log th,.door-log td{padding:.5rem .65rem;text-align:left;border-bottom:1px solid rgba(60,60,60,.08);vertical-align:top}
.door-log th{position:sticky;top:0;background:var(--color-surface);font-weight:700}
.door-actions{display:flex;gap:.55rem;flex-wrap:wrap}
.door-actions .mini-btn{padding:.6rem .9rem}
.door-danger{color:var(--color-error)}
.door-token{padding:1rem;border-radius:var(--radius-lg);border:1px solid rgba(150,66,25,.35);background:rgba(150,66,25,.06);display:grid;gap:.5rem}
.door-token-row{display:flex;gap:.5rem}
.door-token-row input{font-family:monospace;font-size:var(--text-xs)}
.door-empty{display:grid;gap:var(--space-3);justify-items:start}
.door-foot{margin:0}
@media (max-width:720px){.door-custom{grid-template-columns:1fr}.door-status .line{flex-wrap:wrap}.door-status .line .badge,.door-mode{max-width:100%}}

/* Линейные иконки вместо эмодзи (icons.js). Размер — от шрифта. */
.ic{width:1em;height:1em;display:inline-block;vertical-align:-.14em;flex-shrink:0}
.bk-badge .ic{margin-right:.3em}
.menu-toggle .ic{width:20px;height:20px;display:block}
.guest-gate-eye .ic,.auth-dropdown-eye .ic,#okidokiKeyToggle .ic{width:18px;height:18px;display:block}
.guest-gate-eye,.auth-dropdown-eye{display:grid;place-items:center}
[data-delete-request] .ic{width:16px;height:16px;display:block}
/* Метка «есть пятно» в реестре белья. */
.stain-dot{display:inline-block;width:.55em;height:.55em;border-radius:50%;background:#d9a400;vertical-align:.1em;margin-left:.15em}

/* ─── Геометрия (2026-12-02) ─── */
/* Компьютер: квартиры сверху сеткой, как на телефоне, но рядами; меню — кнопкой слева. */
.app{grid-template-columns:minmax(0,1fr)}
.sidebar{position:relative;height:auto;overflow:visible;border-right:none;border-bottom:1px solid rgba(60,60,60,.1)}
.sidebar .brand{padding-right:5.5rem}
.apartments{grid-template-columns:repeat(auto-fill,minmax(240px,1fr))}
@media (max-width:640px){.apartments{grid-template-columns:minmax(0,1fr)}}
/* Блок «Квартиры»: без второго отступа внутри панели — поиск и карточки по одной линии с заголовком. */
.sidebar .panel .accordion-body.static-block{padding:0}
.sidebar .panel .accordion-trigger.static-open{margin-bottom:var(--space-3)}
.sidebar .panel .section-head>div{min-width:0}
/* Карточка квартиры: кнопки не вылезают за край. */
.apartment-row{min-width:0}
.apartment-row>*{min-width:0}
/* Меню: название пункта сверху, пояснение под ним. */
.drawer-item{flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:.2rem}
.drawer-item>span:first-child{font-weight:600}
/* Датчик двери: содержимое не шире карточки, журнал прокручивается внутри себя. */
#doorSensorRoot,.door-status{grid-template-columns:minmax(0,1fr)}
#doorSensorRoot>*,.door-status>*,.door-custom>*{min-width:0}
.door-custom input{width:100%;min-width:0}
.door-mode{min-width:0}
/* Фин.учёт: широкая таблица прокручивается сама, окно не уезжает вбок. */
.apt-finance-list{grid-template-columns:minmax(0,1fr)}
.finance-modal>*,#financeTabSummary,#financeTabRecurring{min-width:0}
.fin-tbl-period{white-space:normal}
@media (max-width:720px){.door-status .line .badge{text-align:left}}
