html { overflow-y: scroll; scrollbar-gutter: stable; }
/* ==========================================================================
   Портал «Аренда» — тема (синяя палитра)
   ========================================================================== */
:root {
  --brand-900: #0b2e6b;
  --brand-800: #123a86;
  --brand-700: #1749a5;
  --brand-600: #1d5fc4;
  --brand-500: #2570e0;
  --brand-300: #8ab3f0;
  --brand-100: #e3edfd;
  --brand-050: #f2f7ff;
  --ink: #16233a;
  --muted: #6b7a92;
  --line: #d9e2f1;
  --ok: #17864f;
  --warn: #a9751a;
  --danger: #b42a2a;

  --bs-body-bg: #f4f7fc;
  --bs-body-color: var(--ink);
  --bs-primary: var(--brand-600);
  --bs-link-color: var(--brand-700);
  --bs-link-hover-color: var(--brand-900);
}

body { font-size: 15px; color: var(--ink); background: var(--bs-body-bg); }

/* фон с частицами */
#particles-bg { position: fixed; inset: 0; z-index: 0; }   /* мышь работает на свободном фоне */
/* весь контент — над слоем частиц */
.guest-wrap, .app-header, main.app-main, footer { position: relative; z-index: 2; }
.guest-wrap .chip-group { position: relative; z-index: 3; }
.guest-wrap .chip { background: #fff; }
.guest-wrap .chip.active, .guest-wrap .chip.active:hover { background: var(--brand-600); color: #fff !important;
  border-color: var(--brand-600); }
.guest-wrap .lang-switch:hover { color: var(--brand-800) !important; }
.guest-wrap a, .link-plain, .card-body a.small { text-decoration: none; }
.link-plain { color: var(--brand-800); }
.link-plain:hover { text-decoration: underline; }
.guest-wrap a:hover, .link-plain:hover { color: var(--brand-900); }
#particles-bg canvas { display: block; }
main.app-main, footer, .modal { position: relative; z-index: 1; }
.card, .stat { background: #fff; }        /* без backdrop-filter: он тормозил перерисовку меню */

/* ---- рабочая область: сетка 1024/1920 (перемикач ширини) ---- */
main.app-main { max-width: 1024px; margin-inline: auto; width: 100%; }
.app-subnav-inner, .app-nav-inner { max-width: 1024px; margin-inline: auto; width: 100%; }
.app-nav-inner { flex-wrap: wrap; }
.nav-blocks { flex-wrap: wrap; }                       /* меню переносится на несколько строк */

/* ---- верхнее меню: квадратные блоки во всю высоту ---- */
.app-header { z-index: 1040; }
.app-nav { background: var(--brand-800); min-height: 40px; }
.app-nav .navbar-brand { color: #fff; font-weight: 600; letter-spacing: .01em; padding: .25rem .9rem .25rem 0;
  display: flex; align-items: center; gap: .55rem; }
.brand-logo { height: 28px; width: auto; display: block;
  filter: brightness(0) invert(1); }        /* логотип в шапке — белым */
.brand-name { font-size: 15px; line-height: 1.1; }
.nav-blocks { align-items: stretch; }
.nav-blocks .nav-item { display: flex; }
.nav-blocks .nav-link {
  display: flex; align-items: center; color: #cfe0f8; padding: 0 .8rem; min-height: 34px; font-size: 14px;
  border-radius: 0; border-bottom: 2px solid transparent;
  transition: none;                 /* мгновенная реакция на наведение */
  will-change: background-color;
}
.nav-blocks .nav-link:hover { color: #fff; background: rgba(255,255,255,.10); border-bottom-color: var(--brand-300); }
.nav-blocks .nav-link.active { color: #fff; background: var(--brand-600); border-bottom-color: transparent; font-weight: 600; }
.app-nav .dropdown-toggle { color: #cfe0f8; }

/* профиль: две строки (e-mail + роль), подсветка активного состояния */
.user-corner { display: flex; flex-direction: row; align-items: stretch; gap: .9rem;
  padding: 0 .4rem 0 .4rem; margin-left: auto; }
.user-corner .lang-col { display: flex; flex-direction: column; gap: .45rem;
  align-items: stretch; justify-content: center; padding: .3rem 0; }
.user-corner .lang-col .chip { justify-content: center; min-width: 34px; }
.user-block { display: flex; flex-direction: column; justify-content: center; gap: .28rem; line-height: 1.15;
  padding: .3rem 1.5rem; min-height: 100%; height: 100%; align-self: stretch;
  color: #eaf1fd !important; text-decoration: none; border-radius: 0; }
.user-corner .navbar-nav, .user-corner .nav-item { display: flex; align-items: stretch; }
.user-block { border: 1px solid transparent; }
.user-block::after { display: none !important; }        /* без стрелки */
.user-block:hover, .user-block.show { background: var(--brand-900); color: #fff !important;
  border-color: rgba(255,255,255,.25); }
.user-block .u-mail { font-size: 15px; font-weight: 600; }
.user-block .u-role { font-size: 10.5px; color: #a9c6ee; text-transform: uppercase; letter-spacing: .04em; }
.app-nav .dropdown-menu { z-index: 1090; padding: .25rem; border: 1px solid var(--brand-100);
  border-radius: .5rem; box-shadow: 0 10px 26px rgba(11,46,107,.18); }
.app-nav .dropdown-item { border-radius: .35rem; padding: .4rem .7rem; font-size: 14px; }
.app-nav .dropdown-item:hover, .app-nav .dropdown-item:focus { background: var(--brand-700); color: #fff; }
.app-nav .dropdown-item:active { background: var(--brand-900); color: #fff; }
.app-header { z-index: 1050; }
/* Головне меню закріплене вгорі; коли ввімкнено режим роботи —
   стає одразу під смугою, тому вони виглядають одним блоком. */
.app-nav { position: relative; z-index: 3; }
.app-subnav { position: relative; z-index: 1; }
.user-block:hover .u-role, .user-block.show .u-role { color: #cfe0f8; }

/* переключатель языка поверх шапки */
.app-nav .chip-group { position: relative; z-index: 3; }
.app-nav .chip { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #eaf1fd;
  padding: .05rem .5rem; font-size: 11px; }
.app-nav .chip:hover { background: rgba(255,255,255,.26); color: #fff; }
.app-nav .chip.active { background: #fff; color: var(--brand-800); border-color: #fff; font-weight: 600; }
@media (max-width: 991px) {
  .nav-blocks .nav-link { min-height: 38px; border-bottom: 0; border-left: 3px solid transparent; }
  .nav-blocks .nav-link.active { border-left-color: #fff; }
  .user-corner { align-items: flex-start; }
}

/* ---- субменю: вторая строка шапки ---- */
.app-subnav { background: #eef3fb; border-bottom: 1px solid rgba(29, 95, 196, .18); }
.app-subnav .nav { flex-wrap: wrap; }
.app-subnav .nav-link { color: var(--brand-900); padding: .5rem .9rem; font-size: 14px; border-radius: 0;
  border-bottom: 3px solid transparent; }
.app-subnav .nav-link:hover { background: #fff; border-bottom-color: var(--brand-300); }
.app-subnav .nav-link.active { background: #fff; font-weight: 600; border-bottom-color: var(--brand-600); }

/* ---- кнопки: единый размер и отступы ---- */
.btn { --bs-btn-padding-y: .45rem; --bs-btn-padding-x: 1rem; --bs-btn-font-size: 14px;
       --bs-btn-border-radius: .45rem; font-weight: 500; line-height: 1.35; }
.btn-sm { --bs-btn-padding-y: .3rem; --bs-btn-padding-x: .7rem; --bs-btn-font-size: 13px; }
.btn-primary { --bs-btn-bg: var(--brand-600); --bs-btn-border-color: var(--brand-600);
  --bs-btn-hover-bg: var(--brand-700); --bs-btn-hover-border-color: var(--brand-700);
  --bs-btn-active-bg: var(--brand-900); --bs-btn-active-border-color: var(--brand-900); }
.btn-outline-primary { --bs-btn-color: var(--brand-700); --bs-btn-border-color: var(--brand-300);
  --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600); }
.btn-toolbar-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ---- карточки и блоки настроек ---- */
.card { border: 1px solid var(--line); border-radius: .6rem; }
.card-header { background: var(--brand-050); border-bottom: 1px solid var(--line); font-weight: 600; }
.settings-block { background: var(--brand-050); border: 1px solid var(--brand-100); border-radius: .6rem; }
.settings-block .card-header, .settings-block .card-body { background: transparent; }
/* блоки настроек портала — на белом фоне */
.settings-panel, .panel-block, .table-block, .pane-block {
  background: #fff; border: 1px solid var(--line); border-radius: .6rem; margin-bottom: 1rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
/* подсветка активного блока при наведении */
.settings-panel:hover, .panel-block:hover, .table-block:hover, .pane-block:hover,
.stat-link:hover .stat {
  border-color: var(--brand-600);
  box-shadow: 0 2px 10px rgba(29, 95, 196, .08);
}
.settings-panel .card-header { background: var(--brand-050); border-radius: .6rem .6rem 0 0; }
.settings-panel .card-body, .panel-block { padding: 1rem; }
.panel-title { font-size: 16.5px; font-weight: 600; color: var(--brand-900); margin-bottom: .75rem; }
.stat { border-radius: .6rem; background: #fff; padding: 1.15rem; border: 1px solid var(--line);
  height: 100%; display: flex; flex-direction: column; justify-content: center; gap: .3rem;
  transition: background .15s, border-color .15s, box-shadow .15s; }
.stat .val { font-size: 1.4rem; font-weight: 600; line-height: 1.2; color: var(--ink); }
.stat .lbl { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
a.stat-link { text-decoration: none; display: block; height: 100%; }
a.stat-link:hover .stat { background: var(--brand-100); border-color: var(--brand-300); box-shadow: 0 2px 10px rgba(29,95,196,.12); }
a.stat-link .val, a.stat-link:hover .val { color: var(--ink); }

/* пустое состояние внутри блока */
.empty-box { background: var(--brand-100); border: 1px dashed var(--brand-300); color: var(--brand-900);
  border-radius: .5rem; padding: .6rem .8rem; font-size: 14px; }
.block-hint { font-size: 12px; color: var(--muted); margin: -.2rem 0 .6rem; }

/* ---- таблицы: всегда внутри белого блока ---- */
.table-block { background: #fff; border: 1px solid var(--line); border-radius: .6rem; padding: 1rem; margin-bottom: 1rem; }
.table-block > .table-responsive { border-radius: 0; }
.table-block table { border-radius: 0 !important; margin-bottom: 0; }
.table-block table thead th:first-child, .table-block table thead th:last-child { border-radius: 0; }

/* ---- таблицы: зебра + ховер ---- */
.table { --bs-table-hover-bg: transparent; border-color: var(--line); }
.table > tbody > tr:nth-child(odd) > * { background: #fff; }
.table > tbody > tr:nth-child(even) > * { background: #f2f7ff; }
/* таблицы со строками-«раскрывашками» размечают чередование явно */
.table > tbody > tr.stripe-odd > * { background: #fff !important; }
.table > tbody > tr.stripe-even > * { background: #f2f7ff !important; }
.table > tbody > tr.stripe-odd:hover > *, .table > tbody > tr.stripe-even:hover > * { background: #dce9fb !important; }
.table > tbody > tr:hover > * { background: #dce9fb !important; }
.table > tbody > tr.row-active > * { background: #fff6df !important; }
.table > tbody > tr.row-done > * { background: #e8f6ed !important; }
.table > tbody > tr.row-deleted > * { background: #fdecec !important; }
.table > tbody > tr.row-error > * { background: #fdf1f1 !important; }
.row-error td { text-decoration: none !important; }
.table > tbody > tr.collapse-host > * { background: transparent !important; }
.table thead th { background: #c9ddf9; color: var(--brand-900); font-size: 13px; white-space: nowrap;
  border-bottom: 1px solid var(--brand-300); }   /* заметно темнее ховера строк (#dce9fb) */
.table-sm td, .table-sm th { padding: .45rem .5rem; }
th.js-sort { cursor: pointer; user-select: none; }
th.js-sort::after { content: '⇅'; opacity: .35; margin-left: .35rem; font-size: 11px; }
th.js-sort.asc::after { content: '↑'; opacity: .9; }
th.js-sort.desc::after { content: '↓'; opacity: .9; }
.table-toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center;
  justify-content: space-between; margin-bottom: .6rem; }
.table-toolbar .table-count { color: var(--muted); font-size: 13px; }
.table-toolbar .form-control { max-width: 280px; margin-left: auto; }
.table-pager { display: flex; gap: .3rem; flex-wrap: wrap; padding-top: .7rem; }
.table-empty td { color: var(--muted); }

/* строки-состояния */
tr.row-active   { background: #fff8e1 !important; }
tr.row-done     { background: #e8f6ed !important; }
tr.row-deleted  { background: #fdecec !important; color: var(--muted); }
tr.row-deleted td { text-decoration: line-through; }

/* ---- чипсы ---- */
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .55rem; border-radius: 999px;
        font-size: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none;
        white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip.active, .chip:hover { border-color: var(--brand-600); }
.chip.active { background: var(--brand-600); color: #fff; }
.chip-tg { background: #e7f3fb; border-color: #bfe0f5; color: #0f6ea8; }
.chip-mail { background: #fdeceb; border-color: #f6c9c5; color: #b23127; }
.chip-group { display: inline-flex; gap: .35rem; flex-wrap: wrap; }

/* ---- прочее ---- */
/* модальные окна поверх всего (шапка sticky + фон-частицы создают контексты наложения) */
.modal { z-index: 1090; }
.modal-backdrop { z-index: 1080; }
.modal-dialog { z-index: 1091; }

/* флеш-сообщения: плавное исчезновение без рывка контента */
.flash-stack { position: relative; z-index: 5; }
.flash-item, .flash-stack .alert { overflow: hidden; max-height: 300px;
  transition: opacity 1.5s ease, max-height 1.5s ease, margin 1.5s ease,
              padding 1.5s ease, border-width 1.5s ease; }
.flash-hiding { opacity: 0; max-height: 0 !important; margin-top: 0 !important; margin-bottom: 0 !important;
  padding-top: 0 !important; padding-bottom: 0 !important; border-width: 0 !important; }
.flash-inline:empty { display: none; }

/* глазик в поле пароля */
.pwd-eye { opacity: 0; pointer-events: none; transition: opacity .15s; }
.pwd-eye.is-visible { opacity: 1; pointer-events: auto; }
.pwd-eye svg { display: block; width: 18px; height: 18px; stroke: var(--brand-600); fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pwd-eye:hover svg { stroke: var(--brand-900); }

/* чипс-статус */
.chip-status { font-weight: 600; }
.chip-status.is-active { background: #fff6df; border-color: #f0d79a; color: #8a6410; }
.chip-status.is-done { background: #e6f6ec; border-color: #b6e0c6; color: #146c3f; }
.chip-status.is-deleted { background: #fdecec; border-color: #f3c2c2; color: #a52626; }
.pwd-wrap { position: relative; }
.pwd-wrap .pwd-eye { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
  border: 0; background: none; line-height: 1; padding: .2rem .3rem; }
.form-label { font-size: 13px; font-weight: 500; color: var(--brand-900); margin-bottom: .2rem; }
.form-hint { font-size: 12px; color: var(--muted); }
.page-title { font-size: 1.3rem; font-weight: 600; }
.entity-meta { color: var(--muted); font-size: 12.5px; }
.entity-meta b { color: var(--ink); font-weight: 600; }
@media (max-width: 767px) { .table-responsive { font-size: 14px; } main.app-main { padding-inline: .75rem; } }


/* ---------- вкладки в блоке ---------- */
.tabs-block { background: #fff; border: 1px solid var(--line); border-radius: .6rem; padding: .35rem; margin-bottom: 1rem; }
.tabs-block .nav { gap: .25rem; border: 0; flex-wrap: wrap; }
.tabs-block .nav-link { border: 0; border-radius: .45rem; color: var(--brand-900); font-size: 14px; padding: .45rem .9rem; }
.tabs-block .nav-link:hover { background: var(--brand-050); }
.tabs-block .nav-link.active { background: var(--brand-600); color: #fff; font-weight: 600; }
.pane-block { background: #fff; border: 1px solid var(--line); border-radius: .6rem; padding: 1rem; }

/* ---------- панель таблицы: количество строк + пагинация ---------- */
.table-toolbar .per-page { display: flex; align-items: center; gap: .35rem; font-size: 13px; color: var(--muted); }
.table-toolbar .per-page .form-select { width: auto; }
.table-toolbar .toolbar-left { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.table-toolbar .toolbar-right { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

/* ---------- подсказки ---------- */
.tip { position: relative; border-bottom: 1px dotted var(--brand-300); cursor: help; }
.tip-pop { position: fixed; z-index: 1200; max-width: 340px; background: #fff; color: var(--ink);
  border: 1px solid var(--brand-300); border-radius: .55rem; box-shadow: 0 8px 24px rgba(11,46,107,.18);
  padding: .55rem .75rem; font-size: 13px; line-height: 1.4; pointer-events: none; }
.tip-pop b { color: var(--brand-800); }
.truncate { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- комбобокс с поиском ---------- */
.combo { position: relative; }
.combo-input { background-image: none; }
.combo-list { position: absolute; z-index: 1100; left: 0; right: 0; top: calc(100% + 2px); max-height: 320px;
  overflow: auto; background: #fff; border: 1px solid var(--brand-300); border-radius: .5rem;
  box-shadow: 0 10px 26px rgba(11,46,107,.16); display: none; }
.combo.open .combo-list { display: block; }
.combo-item { padding: .4rem .7rem; cursor: pointer; font-size: 14px; }
.combo-item:hover, .combo-item.active { background: var(--brand-100); }
.combo-item .sub { display: block; font-size: 12px; color: var(--muted); }
.combo-group { padding: .35rem .7rem; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: var(--brand-050); border-top: 1px solid var(--line); }

/* ---------- drag-n-drop загрузка ---------- */
.dropzone { border: 2px dashed var(--brand-300); border-radius: .6rem; background: var(--brand-050);
  padding: 1.2rem; text-align: center; color: var(--brand-900); cursor: pointer; transition: background .15s, border-color .15s; }
.dropzone.dragover { background: var(--brand-100); border-color: var(--brand-600); }
.dz-preview { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.dz-item { position: relative; width: 92px; }
.dz-item img { width: 92px; height: 92px; object-fit: cover; border-radius: .45rem; border: 1px solid var(--line); }
.dz-item .dz-name { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-remove { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  border: 0; background: var(--danger); color: #fff; font-size: 12px; line-height: 20px; padding: 0; cursor: pointer; }

/* ---------- галерея медиа ---------- */
.media-card { background: #fff; border: 1px solid var(--line); border-radius: .55rem; overflow: hidden; }
.media-card .thumb { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; cursor: zoom-in; }
.media-card .meta { padding: .4rem .5rem; }
.media-card .meta .date { font-size: 11.5px; color: var(--muted); }
.media-card .meta hr { margin: .3rem 0; border-color: var(--line); opacity: 1; }
.media-strip { position: relative; }
.media-strip .strip-scroll { display: flex; gap: .5rem; overflow-x: auto; scroll-behavior: smooth; padding-bottom: .3rem; }
.media-strip .strip-scroll .media-card { flex: 0 0 150px; }
.strip-nav { position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%; padding: 0;
  display: grid; place-items: center; align-content: center; justify-content: center;
  font-size: 0; line-height: 0;
  background: rgba(255,255,255,.96); border: 1px solid var(--brand-300); color: var(--brand-700);
  box-shadow: 0 4px 14px rgba(11,46,107,.18); z-index: 3; }
.strip-nav:hover { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }
.strip-nav svg { display: block; }
.strip-nav.prev { left: 10px; } .strip-nav.next { right: 10px; }

.lightbox { position: fixed; inset: 0; background: rgba(9,24,50,.9); z-index: 1200; display: none;
  align-items: center; justify-content: center; flex-direction: column; padding: 2rem 1rem; }
.lightbox.open { display: flex; }
.lightbox img { max-width: min(92vw, 1100px); max-height: 74vh; border-radius: .5rem; background: #fff; }
.lightbox .lb-bar { color: #eaf1fd; margin-top: .8rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  justify-content: center; max-width: 900px; text-align: center; }
.lightbox .lb-close { position: absolute; top: 1rem; right: 1.2rem; background: none; border: 0; color: #fff; font-size: 28px; }
.lightbox .lb-arrow { position: absolute; top: 50%; background: rgba(255,255,255,.12); border: 0; color: #fff;
  font-size: 26px; width: 46px; height: 46px; border-radius: 50%; }
.lightbox .lb-arrow.prev { left: 1.5rem; } .lightbox .lb-arrow.next { right: 1.5rem; }


/* ---------- фиксированный копирайт внизу окна ---------- */
.app-copyright {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035;
  padding: .35rem .9rem; text-align: center;
  font-size: 12.5px; color: var(--brand-900);
  background: rgba(255, 255, 255, .78);
  border-top: 1px solid rgba(29, 95, 196, .18);
  pointer-events: none;
}
.app-copyright { color: #74afe3 !important; }
.app-copyright .copy-inner { max-width: 1000px; margin-inline: auto; width: 100%;
  display: flex; align-items: center; gap: .75rem; }
.app-copyright .copy-text { display: inline-flex; align-items: center; gap: .4rem;
  flex: 1 1 auto; justify-content: center; }
.app-copyright .copy-screen,
.app-copyright .copy-version { pointer-events: auto; font-variant-numeric: tabular-nums;
  font-size: 11.5px; padding: .1rem .45rem; border: 1px solid rgba(29,95,196,.25);
  border-radius: 999px; background: rgba(255,255,255,.7); white-space: nowrap;
  color: inherit; margin: 0; }
.app-copyright .copy-version + .copy-screen { margin-left: .25rem; }
.copy-player { pointer-events: auto; display: inline-flex; align-items: center; gap: .15rem; }
.mp-btn { border: 0; background: none; padding: .2rem .3rem; color: #74afe3; line-height: 0; cursor: pointer; }
.mp-btn:hover { color: var(--brand-700); }
.mp-btn svg { width: 19px; height: 19px; fill: currentColor; stroke: currentColor; stroke-width: 1.2; }
.mp-btn[disabled] { opacity: .35; cursor: default; }
/* кнопка воспроизведения не выделяется цветом — как остальные кнопки плеера */
@media (max-width: 575px) {
  .app-copyright .copy-screen, .app-copyright .copy-version { display: none; }
}
.app-copyright img { height: 18px; width: auto;
  filter: brightness(0) saturate(100%) invert(70%) sepia(24%) saturate(1100%) hue-rotate(178deg) brightness(96%) contrast(92%); }
.app-copyright span { pointer-events: auto; }
body { padding-bottom: 42px; }          /* чтобы контент не уходил под полосу */
.lightbox { padding-bottom: 3.5rem; }
@media (max-width: 575px) { .app-copyright { font-size: 11.5px; } body { padding-bottom: 38px; } }
@media print { .app-copyright { display: none; } }


/* ---------- переходы без перезагрузки ---------- */
.pjax-loading { opacity: .55; transition: opacity .15s ease; }


/* ---------- логотип: поле в настройках ---------- */
.logo-field { display: flex; gap: .8rem; align-items: flex-start; }
.logo-preview { position: relative; width: 108px; height: 74px; border: 1px dashed var(--brand-300);
  border-radius: .55rem; background: var(--brand-050); display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: .4rem; transition: border-color .15s, background .15s; }
.logo-preview:hover { border-color: var(--brand-600); background: var(--brand-100); }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-actions { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
.color-field { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .3rem; }
.color-field .form-control-color { width: 46px; padding: .15rem; }

/* строка проверок: основная форма слева, «Проверка подключения» прижата вправо */
.check-row { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.check-row .check-main { flex: 1 1 340px; }
.check-row .check-side { margin-left: auto; text-align: right; }

/* ---------- бренд на странице входа ---------- */
.guest-brand { display: inline-flex; flex-direction: column; align-items: center; gap: .4rem; text-decoration: none; }
.guest-brand img { height: 62px; width: auto; }
.guest-brand span { font-size: 14.5px; font-weight: 600; color: #74afe3; }
.guest-brand:hover span { color: #4d92cf; }


/* ---------- кнопка входа через Google ---------- */
.btn-google {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  background: #fff; color: #3c4043; border: 1px solid #dadce0; border-radius: .45rem;
  font-weight: 500; font-size: 14px; padding: .45rem 1rem; text-decoration: none;
}
.btn-google:hover { background: #f7f8f9; border-color: #c6cace; color: #202124; box-shadow: 0 1px 3px rgba(60,64,67,.18); }
.btn-google svg { width: 18px; height: 18px; flex: 0 0 18px; }


/* ---------- индикатор ожидания ---------- */
.dots { display: inline-flex; gap: 4px; margin-left: .5rem; vertical-align: middle; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-600); display: inline-block;
  animation: dotPulse 1.1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .18s; }
.dots i:nth-child(3) { animation-delay: .36s; }
@keyframes dotPulse { 0%, 80%, 100% { opacity: .18; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

.btn .dots i { background: currentColor; }
.btn[disabled] { opacity: .75; }


/* ---------- кнопки-иконки в таблицах ---------- */
.btn-icon { width: 38px; height: 38px; min-width: 38px; padding: 0; display: inline-flex;
  align-items: center; justify-content: center; }
.btn-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.btn-toolbar-row.flex-nowrap { flex-wrap: nowrap; }

/* инлайновая смена статуса заявки */
.status-inline { display: inline-block; min-width: 150px; }
.status-select { border-radius: 999px; font-size: 12px; padding: .15rem 1.6rem .15rem .6rem;
  border-color: var(--brand-300); background-color: #fff; font-weight: 600; color: var(--brand-900); }
.status-select:focus { box-shadow: 0 0 0 .2rem rgba(37,112,224,.18); }

/* строка «ничего не найдено» */
tr.js-empty td { background: #fff !important; }


/* ---------- всплывающий ответ у кнопки ---------- */
.toast-pop { max-width: 320px; font-weight: 500; }
.toast-pop.toast-ok { border-color: #9ed5b3; background: #eefaf2; color: #14603a; }
.toast-pop.toast-error { border-color: #f0b6b6; background: #fdf0f0; color: #92211f; }


/* ---------- плавающая кнопка «наверх» ---------- */
.scroll-top {
  position: fixed; right: 20px; bottom: 54px; z-index: 1045;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--brand-300);
  background: rgba(255,255,255,.95); color: var(--brand-700);
  box-shadow: 0 6px 18px rgba(11,46,107,.18);
  display: none; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .25s ease, transform .25s ease, background .15s;
}
.scroll-top.visible { display: flex; opacity: 1; }
.scroll-top:hover { background: var(--brand-600); color: #fff; border-color: var(--brand-600); transform: translateY(-2px); }
.scroll-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 575px) { .scroll-top { right: 12px; bottom: 48px; width: 38px; height: 38px; } }


/* ---------- регулятор громкости плеера ---------- */
.mp-volume { display: inline-flex; align-items: center; gap: .2rem; margin-left: .15rem; }
/* ползунок всегда занимает одно и то же место — появление не сдвигает текст копирайта */
.mp-range {
  -webkit-appearance: none; appearance: none; height: 4px; width: 68px; flex: 0 0 68px;
  opacity: 0; pointer-events: none;
  background: rgba(116, 175, 227, .45); border-radius: 999px; outline: none; cursor: pointer;
  transition: opacity .18s ease;
}
.copy-player:hover .mp-range, .mp-range:focus, .mp-volume:hover .mp-range, .mp-range.pinned {
  opacity: 1; pointer-events: auto;
}
.mp-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 11px; height: 11px; border-radius: 50%;
  background: var(--brand-600); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(11,46,107,.35);
}
.mp-range::-moz-range-thumb {
  width: 11px; height: 11px; border-radius: 50%; background: var(--brand-600);
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(11,46,107,.35);
}
.copy-player.muted .mp-mute { color: var(--danger); }
@media (max-width: 575px) { .mp-volume { display: none; } }


/* ---------- иконки в блоках панели ---------- */
.stat .val { display: inline-flex; align-items: center; gap: .45rem; }
.stat-ico svg { width: 1.25em; height: 1.25em; fill: none; stroke: var(--brand-600);
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; display: block; }
.stat .val.text-danger .stat-ico svg { stroke: var(--danger); }
.stat .val.text-success .stat-ico svg { stroke: var(--ok); }

/* ---------- комбобокс как единый элемент ---------- */
.combo .input-group { border: 1px solid var(--line); border-radius: .45rem; overflow: hidden; background: #fff; }
.combo .input-group:focus-within { border-color: var(--brand-600); box-shadow: 0 0 0 .2rem rgba(37,112,224,.15); }
.combo .combo-input { border: 0; box-shadow: none !important; }
.combo .input-group .btn { border: 0; border-left: 1px solid var(--line); border-radius: 0; background: #fff;
  color: var(--brand-700); }
.combo .input-group .btn:hover { background: var(--brand-050); }

/* ---------- календарь: синяя иконка и клик по всему полю ---------- */
input[type="date"], input[type="month"] { cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(38%) sepia(72%) saturate(1600%) hue-rotate(196deg) brightness(92%) contrast(92%);
}
.flatpickr-input { background-color: #fff !important; cursor: pointer; }


/* ссылки внутри таблиц — без подчёркивания */
.table a, .table-block a, .panel-block a { text-decoration: none; }
.table a:not(.btn):hover, .table-block a:not(.btn):hover { text-decoration: none; color: var(--brand-900); }
.table a.btn-outline-primary:hover, .table-block a.btn-outline-primary:hover {
  color: #fff !important; background: var(--brand-600); border-color: var(--brand-600); }


/* ---------- сетка иконок в настройках ---------- */
.icon-grid { display: flex; flex-wrap: wrap; gap: 1rem; }
.icon-cell { width: 132px; text-align: center; }
.icon-label { font-size: 12px; color: var(--muted); margin-bottom: .3rem; }
.icon-cell .logo-preview { width: 100%; height: 74px; }
.icon-cell .btn-toolbar-row { justify-content: center; }
.icon-default svg { width: 38px; height: 38px; fill: none; stroke: var(--brand-600);
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* пользовательская картинка вместо встроенной иконки блока */
.stat-ico img { width: 1.35em; height: 1.35em; object-fit: contain; display: block; }


/* ---------- цветовые акценты блоков панели ---------- */
.stat.tone-balance .stat-ico svg { stroke: #8b1f1f; }     /* тёмно-красный значок */
.stat.tone-balance .lbl { color: #8b1f1f; }
.stat.tone-balance .val,
.stat.tone-balance .val.text-success,
.stat.tone-balance .val.text-secondary { color: var(--ink) !important; }  /* нет долга — чёрный текст */
.stat.tone-balance .val.text-danger { color: #e02424 !important; }  /* долг — ярко-красный */
.stat.tone-balance .stat-ico svg,
.stat.tone-balance .val.text-danger .stat-ico svg,
.stat.tone-balance .val.text-success .stat-ico svg { stroke: #8b1f1f !important; }
.stat.tone-leases .stat-ico svg { stroke: #7a4bd0; }
.stat.tone-leases .lbl { color: #7a4bd0; }
.stat.tone-tenants .stat-ico svg { stroke: #128a5e; }
.stat.tone-tenants .lbl { color: #128a5e; }
.stat.tone-properties .stat-ico svg { stroke: #c2761b; }
.stat.tone-properties .lbl { color: #c2761b; }

/* заблокированная зона перетаскивания во время загрузки */
.dropzone.disabled { opacity: .5; pointer-events: none; }

/* календарь: больше внутренних отступов */
.flatpickr-calendar { padding: .5rem; border-radius: .6rem; }
.flatpickr-calendar .flatpickr-months { padding: .2rem .3rem .4rem; }
.flatpickr-calendar .flatpickr-innerContainer { padding: 0 .2rem .3rem; }
.flatpickr-calendar .flatpickr-days { padding-bottom: .25rem; }
.flatpickr-monthSelect-months { padding: .35rem; gap: .25rem; }

/* чипса-ссылка в таблицах */
.chip-link { text-decoration: none; }
a.chip.chip-link:hover, .chip-link:hover {
  background: var(--brand-600) !important; color: #fff !important; border-color: var(--brand-600) !important;
}


/* на цветных строках таблиц не должно быть контрастных красных акцентов */
.table > tbody > tr.row-active .btn-outline-danger { color: #8a6410; border-color: #e2c988; }
.table > tbody > tr.row-active .btn-outline-danger:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
.table > tbody > tr.row-active a { color: var(--brand-800); }


/* компактная таблица позиций счёта */
.table-compact td, .table-compact th { padding: .35rem .45rem; font-size: 13px; word-break: break-word; }
.table-compact { table-layout: auto; width: 100%; }


/* ---------- плавающие уведомления (правый верхний угол, поверх всего) ---------- */
#toastStack {
  position: fixed; top: 14px; right: 14px; z-index: 2000;
  display: flex; flex-direction: column; gap: .5rem;
  width: min(380px, calc(100vw - 28px)); pointer-events: none;
}
#toastStack .toast-msg {
  pointer-events: auto; position: relative;
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand-600);
  border-radius: .5rem; box-shadow: 0 10px 30px rgba(11, 46, 107, .18);
  padding: .6rem 2rem .6rem .8rem; font-size: 14px; line-height: 1.35; color: var(--ink);
  opacity: 0; transform: translateX(16px);
  transition: opacity .25s ease, transform .25s ease, max-height .45s ease,
              margin .45s ease, padding .45s ease, border-width .45s ease;
  max-height: 320px; overflow: hidden;
}
#toastStack .toast-msg.show { opacity: 1; transform: translateX(0); }
#toastStack .toast-msg.hide {
  opacity: 0; transform: translateX(16px);
  max-height: 0; margin-top: 0; margin-bottom: 0;
  padding-top: 0; padding-bottom: 0; border-width: 0 0 0 4px;
}
#toastStack .toast-msg.type-success { border-left-color: var(--ok); }
#toastStack .toast-msg.type-danger  { border-left-color: var(--danger); }
#toastStack .toast-msg.type-warning { border-left-color: #d99b1a; }
#toastStack .toast-msg.type-info    { border-left-color: var(--brand-600); }
#toastStack .toast-close {
  position: absolute; top: .25rem; right: .35rem; border: 0; background: none;
  color: var(--muted); font-size: 17px; line-height: 1; padding: .15rem .3rem; cursor: pointer;
}
#toastStack .toast-close:hover { color: var(--ink); }
@media (max-width: 575px) { #toastStack { top: 8px; right: 8px; } }


/* частично скрытый адрес в журнале входов */
.mask-toggle { cursor: pointer; border-bottom: 1px dashed var(--brand-300); font-variant-ligatures: none; }
.mask-toggle:hover { color: var(--brand-800); border-bottom-color: var(--brand-600); }


/* ---------- второй уровень строк: светло-зелёный фон ---------- */
.level-2, .user-detail .p-3 { background: #fff !important; border-top: 1px solid var(--line); }
.user-detail .table > tbody > tr:nth-child(even) > * { background: #f7faff !important; }
.user-detail .table > tbody > tr:hover > * { background: #eaf2fd !important; }
.table > tbody > tr.collapse-host > * { background: transparent !important; padding: 0 !important; }

/* ---------- чипса номера договора: светло-синяя ---------- */
a.chip.chip-link, .chip.chip-link, .chip-link {
  background: #dce9fb !important; border: 1px solid var(--brand-300) !important;
  color: var(--brand-800) !important; font-weight: 600; text-decoration: none;
}
a.chip.chip-link:hover, .chip-link:hover {
  background: var(--brand-600) !important; color: #fff !important; border-color: var(--brand-600) !important;
}

/* ---------- фиксированная шапка и субменю ----------
   Шапка целиком (меню + субменю) прилипает к верху окна: субменю входит в .app-header,
   поэтому достаточно одного sticky на контейнере. */
html, body { overflow-x: clip; }               /* overflow на предках ломает sticky */
.app-header { position: sticky !important; top: 0 !important; z-index: 1050; }
.app-nav, .app-subnav { position: relative; }

/* ---------- календарь: шире и с оформленными элементами ---------- */
.flatpickr-calendar { width: 344px !important; padding: .6rem .7rem !important; box-sizing: border-box; }
.flatpickr-rContainer, .flatpickr-days { width: 100% !important; }
.flatpickr-calendar .dayContainer { width: 100%; min-width: 0; max-width: none; padding: 0; }
.flatpickr-days { width: 100% !important; }
.flatpickr-days .dayContainer { justify-content: space-between; }
.flatpickr-day { max-width: 42px; width: 42px; height: 36px; line-height: 35px; border-radius: .4rem; }
.dayContainer { width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--brand-600); border-color: var(--brand-600); }
.flatpickr-weekdays { padding: 0 0 .25rem; }
.flatpickr-weekday { color: var(--muted) !important; font-weight: 600 !important; }

.flatpickr-months { align-items: center; gap: .3rem; }
.flatpickr-months .flatpickr-month { height: 34px; }
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  position: static; padding: 0; width: 30px; height: 30px; border-radius: .4rem;
  display: flex; align-items: center; justify-content: center; transition: background .12s;
}
.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover { background: var(--brand-600); }
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg { fill: #fff !important; }

.flatpickr-current-month { display: flex; align-items: center; justify-content: center; gap: .35rem;
  padding: 0; font-size: 15px; }
.flatpickr-current-month .flatpickr-monthDropdown-months {
  appearance: none; -webkit-appearance: none;
  background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%231d5fc4' d='M4 6l4 4 4-4z'/%3E%3C/svg%3E") no-repeat right .35rem center/12px;
  border: 1px solid var(--brand-300); border-radius: .4rem; padding: .15rem 1.3rem .15rem .5rem;
  color: var(--brand-900); font-weight: 600;
}
.flatpickr-current-month .numInputWrapper { border: 1px solid var(--brand-300); border-radius: .4rem;
  padding: 0 .2rem; background: #fff; }


/* отметка состояния токена Telegram */
.token-ok { color: var(--ok); font-weight: 700; margin-left: .25rem; }
.token-wait { color: #d99b1a; font-weight: 700; margin-left: .25rem; }

/* ширина колонок в списке объектов */
.props-table th:first-child, .props-table td:first-child { white-space: nowrap; width: 1%; }
.props-table td:nth-child(2) { white-space: normal; word-break: break-word; min-width: 160px; }


/* календарь выбора месяца */
.flatpickr-monthSelect-months { padding: .5rem; gap: .35rem; }
.flatpickr-monthSelect-month {
  border-radius: .45rem; padding: .5rem .2rem; font-size: 13px; color: var(--brand-900);
  border: 1px solid transparent; transition: background .12s, color .12s, border-color .12s;
}
.flatpickr-monthSelect-month:hover { background: var(--brand-100); border-color: var(--brand-300); }
.flatpickr-monthSelect-month.selected {
  background: var(--brand-600) !important; color: #fff !important; border-color: var(--brand-600) !important;
}
.flatpickr-monthSelect-month.today { border-color: var(--brand-600); }


/* панель под таблицей: счётчик слева, страницы справа */
.table-footer { display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; flex-wrap: wrap; padding-top: .7rem; }
.table-footer .table-count { color: var(--muted); font-size: 13px; }
.table-footer .table-pager { padding-top: 0; margin-left: auto; }

/* кнопка выбора файла */
.file-field { position: relative; display: inline-flex; align-items: center; }
.file-btn { display: inline-flex; align-items: center; gap: .45rem; max-width: 100%;
  background: #fff; border: 1px solid var(--brand-300); color: var(--brand-800);
  border-radius: .45rem; padding: .4rem .8rem; font-size: 14px; cursor: pointer; }
.file-btn:hover { background: var(--brand-050); }
.file-btn.has-file { border-color: var(--brand-600); font-weight: 600; }
.file-btn .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 230px; }
.file-clear { position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%;
  border: 0; background: var(--danger); color: #fff; font-size: 12px; line-height: 20px; padding: 0;
  cursor: pointer; display: none; }
.file-field:hover .file-clear.visible { display: block; }


/* ссылка, оформленная как основная кнопка */
a.btn-primary, a.btn-primary:hover, a.btn-primary:focus { color: #fff !important; text-decoration: none; }
a.btn-primary:hover { background: var(--brand-700); border-color: var(--brand-700); }

/* субменю профиля прижато вправо */
.app-subnav .nav.justify-content-end { justify-content: flex-end; }


/* приборы учёта: колонка объекта в одну строку при раскрытом втором уровне */
#metersTable th:first-child, #metersTable td:first-child,
#tariffsTable th:first-child, #tariffsTable td:first-child { white-space: nowrap; width: 1%; }
#metersTable td:nth-child(3), #tariffsTable td:nth-child(2) { white-space: normal; }


/* цвета остальных блоков панели */
.stat.tone-payments .stat-ico svg { stroke: #1d5fc4; } .stat.tone-payments .lbl { color: #1d5fc4; }
.stat.tone-readings .stat-ico svg { stroke: #128a5e; } .stat.tone-readings .lbl { color: #128a5e; }
.stat.tone-requests .stat-ico svg { stroke: #c2761b; } .stat.tone-requests .lbl { color: #c2761b; }
.stat.tone-mail .stat-ico svg { stroke: #7a4bd0; } .stat.tone-mail .lbl { color: #7a4bd0; }

/* одна крупная кнопка языка */
.lang-switch { display: inline-flex; align-items: center; justify-content: center; min-width: 44px;
  height: 26px; align-self: center; border-radius: .4rem; background: rgba(255,255,255,.16); color: #fff !important;
  border: 1px solid rgba(255,255,255,.3); font-weight: 700; font-size: 12.5px; letter-spacing: .02em;
  text-decoration: none; }
.lang-switch:hover { background: #fff; color: var(--brand-800) !important; border-color: #fff; }


/* кнопка в панели таблицы — как поле поиска по высоте, без переноса */
.table-toolbar .btn, .table-toolbar .btn-sm { white-space: nowrap; height: 31px; display: inline-flex;
  align-items: center; padding: 0 .7rem; flex: 0 0 auto; }
.table-toolbar .toolbar-left > div, .table-toolbar .toolbar-right > div { display: inline-flex; }

/* подписи над полями в компактных формах */
.field-hint { font-size: 11.5px; color: var(--muted); display: block; margin-bottom: .15rem; }


/* блоки панели растягиваются на всю высоту колонки */
.row > [class*="col-"].d-flex > .stat-link { width: 100%; }
.row > [class*="col-"].d-flex > .stat-link > .stat,
.row > [class*="col-"].d-flex > .stat { height: 100%; width: 100%; }


/* кнопки одинаковой высоты (как «Ввести показник вручну») */
.btn-eq { height: 38px; display: inline-flex; align-items: center; padding: 0 .9rem; white-space: nowrap; }


/* плавное чередование копирайта и названия трека */
.copy-text { transition: opacity .9s ease; }
.copy-text.fading { opacity: 0; }
.copy-text .copy-label { display: inline-block; }
.copy-text .now-playing { font-weight: 600; }


/* договор в режиме просмотра (арендатор): поля выглядят как обычный текст */
/* договор только для чтения: поля остаются полями, но выглядят неактивными */
.lease-readonly .form-control,
.lease-readonly .form-select {
  background: #f6f8fb !important; color: #35486a; opacity: 1; cursor: default;
  border: 1px solid var(--line); box-shadow: none !important;
}
.lease-readonly .form-select { background-image: none; }
.lease-readonly textarea.form-control { resize: none; font-weight: 400; }
.lease-readonly .form-label { color: var(--muted); font-size: 11.5px; margin-bottom: 0; }
.lease-readonly .card { border-color: var(--line); }


/* блоки панели: одинаковая ширина, сдвигаются влево при скрытии соседей */
/* Панель: сетка 4 × 2. Grid сам подтягивает блоки влево-вверх,
   когда какой-то из них скрыт по правам. Ширина рамок учтена через border-box. */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;          /* обе строки одинаковой высоты */
  gap: .75rem;
  margin: 0 0 1rem;
}
.stats-row > * { padding: 0 !important; margin: 0; min-width: 0; }
.stats-row > * > .stat-link, .stats-row > * > .stat-link > .stat, .stats-row > * > .stat {
  width: 100%; height: 100%; box-sizing: border-box;
}
@media (max-width: 991px) { .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) { .stats-row { grid-template-columns: 1fr; } }


/* подсветка строки, к которой выполнен переход */
.row-highlight { position: relative; }
.row-highlight > * { background: transparent !important; }
.row-highlight::after {
  content: ''; position: absolute; inset: 3px 6px; border-radius: .55rem;
  background: #fff6d9; box-shadow: 0 0 0 1px #f0dca6; pointer-events: none; z-index: -1;
  animation: arenda-highlight 2.4s ease forwards;
}
@keyframes arenda-highlight { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }


/* модальное окно сторно — по центру экрана над всем интерфейсом */
#reverseModal { z-index: 2100; }
#reverseModal .modal-dialog { display: flex; align-items: center; min-height: calc(100% - 3rem); }
.modal-backdrop { z-index: 2090; }


/* ссылки в блоках панели — без подчёркивания */
.link-plain { text-decoration: none; color: var(--brand-800); }
.link-plain:hover { text-decoration: none; color: var(--brand-600); }

/* текст кнопок всегда по центру */
.btn { display: inline-flex; align-items: center; justify-content: center; }
.btn-primary, .btn-outline-primary, .btn-outline-danger, .btn-danger { padding-top: calc(var(--bs-btn-padding-y) + 1px);
  padding-bottom: calc(var(--bs-btn-padding-y) - 1px); }

/* неактивные кнопки — приглушённый серый */
.btn:disabled, .btn.disabled, fieldset:disabled .btn:not(.dz-remove) {
  background: #eef0f4 !important; border-color: #dfe3ea !important;
  color: #9aa3b0 !important; box-shadow: none !important; opacity: 1; }
.btn-icon { padding-top: var(--bs-btn-padding-y); padding-bottom: var(--bs-btn-padding-y); }
.btn-toolbar-row .btn { vertical-align: middle; }


/* единый размер текста во всех таблицах */
.table td, .table th { font-size: 13.5px; }
.table td.small, .table th.small, .table .small { font-size: 13.5px; }
.table td .form-hint, .table th .form-hint { font-size: 11.5px; }
.table td .chip, .table th .chip { font-size: 12px; }


/* мягкое появление: вход и выход меняют макет целиком, без этого экран «моргает» */
#app-content { animation: arenda-fade .28s ease both; transition: opacity .2s ease; }
#particles-bg { animation: arenda-fade .5s ease both; }
@keyframes arenda-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  #app-content, #particles-bg { animation: none; }
}


/* второй уровень таблиц: белая полоса-отступ снизу ячейки */
tr.collapse-host > td { padding: 0 0 2px !important; background: #fff; }
.row-detail > .level-2 { border-radius: 0 0 .4rem .4rem; }



/* версия сборки в строке копирайта */



/* карта интерфейса */
.site-tree { font-size: 14px; }
.site-tree ul { list-style: none; margin: 0; padding-left: 1.15rem; }
.site-tree ul.tree-root { padding-left: 0; }
.site-tree .tree-item > ul { display: none; border-left: 1px dashed var(--line); margin-left: .55rem; }
.site-tree .tree-item.open > ul { display: block; }
.site-tree .tree-row { display: flex; align-items: center; gap: .4rem; padding: .18rem .3rem;
  border-radius: .35rem; }
.site-tree .tree-item.has-kids > .tree-row { cursor: pointer; user-select: none; }
.site-tree .tree-row:hover { background: var(--brand-050); }
.site-tree .tree-toggle { border: 0; background: none; color: var(--brand-700); cursor: pointer;
  width: 18px; padding: 0; font-size: 13px; line-height: 1; transition: transform .15s ease; }
.site-tree .tree-item.open > .tree-row > .tree-toggle { transform: rotate(90deg); }
.site-tree .tree-dot { color: var(--muted); width: 18px; text-align: center; }
.site-tree .tree-count { font-size: 11px; color: var(--muted); background: var(--brand-050);
  border-radius: 999px; padding: 0 .4rem; }
.site-tree .tree-item.hit > .tree-row > .tree-label { background: #fff6d9; border-radius: .25rem; }
.site-tree .tree-item.filtered { display: none; }


/* кнопка перехода в карте интерфейса */
.site-tree .tree-go { margin-left: auto; font-size: 11.5px; line-height: 1; text-decoration: none;
  padding: .2rem .55rem; border: 1px solid var(--brand-300); border-radius: 999px;
  color: var(--brand-700); background: #fff; opacity: 0; transition: opacity .12s ease; }
.site-tree .tree-row:hover .tree-go,
.site-tree .tree-go:focus { opacity: 1; }
.site-tree .tree-go:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
@media (hover: none) { .site-tree .tree-go { opacity: 1; } }


/* название узла копируется по клику */
.site-tree .tree-label { cursor: copy; }
.site-tree .tree-label:hover { text-decoration: underline dotted; }


/* переключатель способа отправки */
.switch-group { display: inline-flex; padding: 3px; background: var(--brand-050);
  border: 1px solid var(--brand-300); border-radius: 999px; }
.switch-group .switch-input { position: absolute; opacity: 0; pointer-events: none; }
.switch-group .switch-option { padding: .35rem 1.1rem; border-radius: 999px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--brand-800); margin: 0;
  transition: background .15s ease, color .15s ease; user-select: none; }
.switch-group .switch-input:checked + .switch-option { background: var(--brand-600); color: #fff;
  box-shadow: 0 1px 3px rgba(11,46,107,.25); }
.switch-group .switch-input:focus-visible + .switch-option { outline: 2px solid var(--brand-700); }

/* названия блоков и разделов копируются по клику */
.panel-title, .app-content h1.page-title, .app-content h2.h6 { cursor: copy; }
.panel-title:hover, .app-content h1.page-title:hover { text-decoration: underline dotted; }


/* блок проверки отправки: каждый элемент с новой строки */
.check-stack { display: flex; flex-direction: column; gap: 1rem; }
.check-stack .check-main,
.check-stack .check-side { width: 100%; }
.check-stack .check-side { border-top: 1px solid var(--line); padding-top: .9rem; }


/* вкладки карточек: подсветка при наведении */
.tabs-block { transition: border-color .15s ease, box-shadow .15s ease; }
.tabs-block:hover { border-color: var(--brand-600); box-shadow: 0 2px 10px rgba(29,95,196,.08); }


/* кнопки в шапке раздела: единая высота, как на панели */
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.page-actions .btn { height: 34px; padding: 0 .85rem; font-size: 13.5px; line-height: 1; }


/* цвета статусов счетов */
.chip-status.is-warn { background: #fff6df; border-color: #f0d79a; color: #8a6410; }
.chip-status.is-muted { background: #f1f3f7; border-color: #dfe3ea; color: #6b7686; }
.chip-status.is-draft { background: #eef4fd; border-color: #cfe0f8; color: #35486a; }

/* баланс в таблице — одной строкой */
td.balance-cell, .table td[data-balance] { white-space: nowrap; }


/* блок аренды — справочный, без заливки */
.stat.stat-plain { background: transparent; box-shadow: none; }
.stat.stat-plain:hover { border-color: var(--line); box-shadow: none; }


/* подсветка обновлённого блока */
.panel-block.row-highlight { position: relative; }
.panel-block.row-highlight::after {
  content: ''; position: absolute; inset: 0; border-radius: .6rem;
  background: #fff6d9; opacity: .55; pointer-events: none;
  animation: arenda-highlight 2.4s ease forwards;
}


/* миниблок подачи показания на панели */
.meter-mini { background: var(--brand-050); border: 1px solid var(--line);
  border-radius: .5rem; padding: .6rem .7rem; height: 100%; }
.meter-mini:hover { border-color: var(--brand-600); }


/* подпись договора: каждая часть с новой строки */
.chip.sign-chip { display: inline-flex; flex-direction: column; align-items: flex-start;
  gap: .1rem; border-radius: .5rem; padding: .35rem .6rem; line-height: 1.35; white-space: normal; }


/* список выбранных файлов перед загрузкой */
.dz-list { display: flex; flex-direction: column; gap: .25rem; }
.dz-list .dz-row { display: flex; align-items: center; gap: .5rem;
  padding: .3rem .5rem; border: 1px solid var(--line); border-radius: .4rem; background: #fff; }
.dz-list .dz-row-name { flex: 1; font-size: 13px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.dz-list .dz-remove { border: 0; background: none; color: var(--muted);
  font-size: 18px; line-height: 1; cursor: pointer; padding: 0 .25rem; }
.dz-list .dz-remove:hover { color: #b23127; }


/* переключатель месяца: поле и стрелки одним элементом */
.month-nav { display: inline-flex; align-items: stretch; height: 31px; }
.month-nav .btn { display: grid; place-items: center; width: 34px; height: 31px;
  padding: 0 !important; font-size: 22px; line-height: 0; font-weight: 400;
  background: var(--brand-050); color: var(--brand-700); border: 1px solid var(--line); }
.month-nav .btn:first-child { border-radius: .4rem 0 0 .4rem; border-right: 0; }
.month-nav .btn:last-child { border-radius: 0 .4rem .4rem 0; border-left: 0; }
.month-nav .btn:hover { background: var(--brand-300); color: var(--brand-900); }
.month-nav input { height: 31px; width: 195px; text-align: center;
  font-size: 13px; font-weight: 500; color: var(--ink); background: var(--brand-050);
  border: 1px solid var(--line); border-radius: 0; cursor: pointer; padding: 0 .4rem; }
.month-nav input:focus { outline: none; box-shadow: none; border-color: var(--brand-600); }
.month-nav .flatpickr-input.form-control[readonly] { background: var(--brand-050); }


/* строка файла договора: раскрывается по клику */
tr.file-row { cursor: pointer; }
tr.file-row:hover { background: var(--brand-050); }


/* выбранные файлы в виде чипс */
.dz-chips { display: flex; flex-wrap: wrap; gap: .4rem; }

/* Чипса собрана как .switch-group: капсула с внутренним отступом,
   внутри две ячейки одной высоты — подпись и кнопка. Сдвиги не нужны. */
.dz-chips .dz-chip {
  display: inline-flex; align-items: stretch; padding: 3px;
  max-width: 100%; border-radius: 999px;
  background: var(--brand-050); border: 1px solid var(--brand-300);
  transition: border-color .15s ease;
}
.dz-chips .dz-chip:hover { border-color: var(--brand-600); }

.dz-chips .dz-chip .dz-row-name {
  display: flex; align-items: center; height: 24px; padding: 0 .5rem 0 .7rem;
  font-size: 13px; font-weight: 500; color: var(--brand-800);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px;
}

.dz-chips .dz-chip .dz-remove {
  flex: 0 0 auto; box-sizing: border-box; appearance: none;
  width: 24px !important; height: 24px !important; min-width: 24px;
  padding: 0 !important; margin: 0; border: 0 !important; border-radius: 999px !important;
  background: #d64535 !important; color: #fff !important; cursor: pointer;
  font-size: 0; line-height: 0; opacity: 1 !important;
  display: grid !important; place-items: center; transition: background .15s ease;
}
.dz-chips .dz-chip .dz-remove:hover { background: #b23127 !important; }

/* крестик рисуем внутри ячейки кнопки, без абсолютного позиционирования */
.dz-chips .dz-chip .dz-remove::before {
  content: ''; grid-area: 1 / 1; width: 11px; height: 2.2px;
  border-radius: 2px; background: #fff; transform: rotate(45deg);
}
.dz-chips .dz-chip .dz-remove::after {
  content: ''; grid-area: 1 / 1; width: 11px; height: 2.2px;
  border-radius: 2px; background: #fff; transform: rotate(-45deg);
}

/* отметка о полностью подписанном файле */
.sign-ok { display: inline-grid; place-items: center; width: 15px; height: 15px;
  border-radius: 50%; background: #1f9254; color: #fff; font-size: 10px; line-height: 1;
  margin-right: .35rem; vertical-align: 1px; }


/* переключатель языков: текст на пиксель ниже оптического центра */
.lang-switch { padding-top: 1px; }


/* Активний пункт меню виділяється жирним — щоб сусідні не зсувалися,
   резервуємо ширину найширшого накреслення заздалегідь. */
.nav-blocks .nav-link, .app-subnav .nav-link { position: relative; }
.nav-blocks .nav-link::after, .app-subnav .nav-link::after {
  content: attr(data-label); display: block; height: 0; overflow: hidden;
  font-weight: 600; visibility: hidden; pointer-events: none;
}


/* лічильник у пункті субменю */
.nav-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px;
  margin-left: .35rem; padding: 0 .3rem; border-radius: 999px;
  background: var(--brand-600); color: #fff; font-size: 11px; font-weight: 600; line-height: 1;
  vertical-align: 1px; }
.app-subnav .nav-link.active .nav-badge { background: var(--brand-800); }


/* смуга режиму роботи: діагональні жовті полоси, закріплена вгорі вікна */
.mode-strip {
  padding: .45rem 1rem; text-align: center; font-size: 13.5px; font-weight: 600;
  color: #4a3b00; letter-spacing: .01em; border-bottom: 1px solid #d9b400;
  background-image: repeating-linear-gradient(45deg,
      #ffd84d 0, #ffd84d 14px, #f6c700 14px, #f6c700 28px);
}
.mode-strip.is-maint {
  color: #5a1d00; border-bottom-color: #c96a00;
  background-image: repeating-linear-gradient(45deg,
      #ffd84d 0, #ffd84d 14px, #ff9d2e 14px, #ff9d2e 28px);
}

/* ---- working-area width toggle 1024 <-> 1920 ---- */
body.app-wide main.app-main,
body.app-wide .app-subnav-inner,
body.app-wide .app-nav-inner,
body.app-wide .app-copyright .copy-inner { max-width: 1920px; }
.corner-ico { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: .5rem; color: #fff; background: transparent; border: 1px solid transparent; cursor: pointer; margin-left: .25rem; text-decoration: none; }
.corner-ico:hover { color: #fff; background: rgba(255,255,255,.14); border-color: transparent; }
.corner-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.user-corner { display: flex; align-items: center; }
#wideToggle .ico-collapse { display: none; }
body.app-wide #wideToggle .ico-expand { display: none; }
body.app-wide #wideToggle .ico-collapse { display: inline; }


/* ---- per-user menu access tree (admin -> users) ---- */
.menu-access-panel { border: 1px solid #e3e6ea; background: #fff; border-radius: .6rem; padding: .85rem 1rem; }
.menu-access-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: .6rem; padding-bottom: .55rem; border-bottom: 1px solid #eef0f2; }
.menu-access-title { font-weight: 600; margin-right: auto; }
.menu-access-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.menu-access-tools .menu-copy-src { min-width: 190px; max-width: 260px; }
.menu-access-counter { font-size: 12px; font-weight: 600; color: var(--brand-600, #4b5563); background: #eef2ff; border-radius: 999px; padding: .15rem .6rem; white-space: nowrap; }
.menu-ownonly-wrap { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.menu-tree { columns: 3 220px; column-gap: 1.25rem; }
.menu-tree .mt-group { break-inside: avoid; -webkit-column-break-inside: avoid; margin-bottom: .55rem; }
.menu-tree .mt-grow { display: flex; align-items: center; gap: .2rem; }
.menu-tree .mt-arrow { width: 18px; height: 18px; flex: 0 0 18px; border: 0; background: transparent; cursor: pointer; padding: 0; }
.menu-tree .mt-arrow:not(.mt-noarrow)::before { content: ""; display: block; width: 6px; height: 6px; border-right: 2px solid #8a94a6; border-bottom: 2px solid #8a94a6; transform: rotate(45deg); margin: 1px auto 0; transition: transform .15s; }
.menu-tree .mt-group.is-collapsed .mt-arrow::before { transform: rotate(-45deg); }
.menu-tree .mt-gcheck .mt-glabel { font-weight: 600; }
.menu-tree .mt-children { margin: .1rem 0 .3rem 1.45rem; display: flex; flex-direction: column; gap: .05rem; }
.menu-tree .mt-group.is-collapsed .mt-children { display: none; }
.menu-tree .form-check { margin-bottom: 0; }
