/* ============================================================
   Феникс CRM — Premium Purple Theme
   Tokens → reset → shell → components
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;450;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@600;700;800&display=swap');

/* ===== 1. Tokens ===== */
:root {
  --violet-950:#1e0a3c; --violet-900:#2e1065; --violet-800:#3b0764;
  --violet-700:#4c1d95; --violet-600:#6d28d9; --violet-500:#7c3aed;
  --violet-400:#8b5cf6; --violet-300:#a78bfa; --violet-200:#c4b5fd;
  --violet-100:#ede9fe; --violet-50:#faf5ff;

  /* Semantic */
  --bg:#faf7ff; --surface:#ffffff; --surface-2:#f5f0ff; --surface-3:#ede9fe;
  --border:rgba(109,40,217,.1); --border-card:rgba(109,40,217,.12);
  --border-strong:rgba(109,40,217,.22);
  --text:#1e0a3c; --text-2:#5b3b8a; --text-3:#6b4b9e;
  --text-muted:#5b3b8a; --text-faint:#6b4b9e;

  /* Primary */
  --primary:var(--violet-500); --primary-hover:var(--violet-600);
  --primary-soft:var(--violet-100); --primary-mid:var(--violet-200);
  --indigo-50:var(--violet-50); --indigo-100:var(--violet-100);
  --indigo-500:var(--violet-500); --indigo-600:var(--violet-600);
  --indigo-700:var(--violet-700);

  /* Status */
  --green-50:#f0fdf4; --green-700:#15803d;
  --amber-50:#fffbeb; --amber-700:#b45309;
  --red-50:#fef2f2;   --red-700:#b91c1c;
  --blue-50:#eff6ff;  --blue-700:#1d4ed8;
  --success:#15803d; --success-soft:#f0fdf4;
  --warning:#b45309; --warning-soft:#fffbeb;
  --danger:#b91c1c;  --danger-soft:#fef2f2;
  --info:#1d4ed8;    --info-soft:#eff6ff;
  --accent-rent:var(--violet-500); --accent-ik:#15803d; --accent-event:#b45309;

  /* Sidebar (dark gradient) */
  --sb-bg:var(--violet-950); --sb-border:rgba(255,255,255,.07);
  --sb-text:rgba(255,255,255,.45); --sb-hover:rgba(255,255,255,.06);
  --sb-active-bg:rgba(139,92,246,.2); --sb-active-text:#fff;
  --sidebar-bg:var(--sb-bg); --sidebar-border:var(--sb-border);
  --sidebar-text:var(--sb-text); --sidebar-text-active:var(--sb-active-text);
  --sidebar-hover:var(--sb-hover); --sidebar-active-bg:var(--sb-active-bg);

  /* Avatars */
  --av-1:#8b5cf6; --av-2:#3b82f6; --av-3:#10b981;
  --av-4:#f59e0b; --av-5:#c62828; --av-6:#14b8a6;

  /* Shadows */
  --shadow-xs:0 1px 2px rgba(109,40,217,.05);
  --shadow-sm:0 1px 3px rgba(109,40,217,.06),0 4px 16px rgba(109,40,217,.05);
  --shadow-md:0 4px 20px rgba(109,40,217,.08),0 1px 4px rgba(109,40,217,.04);
  --shadow-lg:0 10px 40px rgba(109,40,217,.12),0 2px 8px rgba(109,40,217,.06);
  --sh-sm:var(--shadow-sm); --sh-md:var(--shadow-md);
  --sh-lg:var(--shadow-lg); --sh-focus:0 0 0 3px rgba(139,92,246,.25);

  /* Motion */
  --t:150ms ease; --t-fast:100ms ease; --t-base:150ms ease;
  --t-modal:200ms cubic-bezier(.32,.72,0,1);

  /* Radii */
  --r-sm:8px; --r-md:12px; --r-lg:16px; --r-pill:9999px;

  /* Spacing */
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:20px;
  --s6:24px; --s8:32px; --s10:40px; --s12:48px;
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px;
  --sp-6:24px; --sp-8:32px; --sp-12:48px; --sp-16:64px;

  /* Type */
  --fs-xs:11px; --fs-sm:12px; --fs-base:14px; --fs-md:15px;
  --fs-lg:16px; --fs-xl:20px; --fs-2xl:24px; --fs-3xl:28px; --fs-4xl:32px;
  --fs-h1:24px; --fs-h2:20px; --fs-h3:16px; --fs-body:14px;
  --fs-small:12px; --fs-stat:28px;

  /* Z-index */
  --z-base:1; --z-sticky:10; --z-sidebar:50;
  --z-dropdown:100; --z-modal-bg:900; --z-modal:901; --z-toast:1000;

  --font-display:'Manrope','Inter',sans-serif;
}

/* ===== 2. Reset ===== */
*,*::before,*::after { box-sizing:border-box; }
html,body { margin:0; padding:0; }
html { -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; }
body {
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  font-size:var(--fs-base); line-height:1.5;
  color:var(--text); background:var(--bg); min-height:100vh;
}
h1,h2,h3,h4,p { margin:0; }
h1,h2,h3 { font-family:var(--font-display); }
a { color:inherit; text-decoration:none; }
button { font-family:inherit; }
[x-cloak] { display:none !important; }

/* ===== 3. Sidebar (dark gradient) ===== */
.sidebar {
  position:fixed; top:0; left:0; width:216px; height:100vh;
  background: linear-gradient(160deg, #1e0a3c 0%, #2e1065 60%, #1a0535 100%);
  border-right:1px solid rgba(255,255,255,.05);
  display:flex; flex-direction:column;
  z-index:var(--z-sidebar); overflow:hidden;
}
.sidebar__logo {
  padding:16px 16px 12px;
  border-bottom:1px solid rgba(255,255,255,.07);
  display:grid;
  grid-template-columns:auto 1fr;
  grid-template-rows:auto auto;
  align-content:center;
  align-items:center;
  gap:0 10px;
}
.sidebar__logo img { grid-column:1; grid-row:1/3; width:32px; height:32px; object-fit:contain; border-radius:8px; }
.sidebar__logo-title { grid-column:2; grid-row:1; }
.sidebar__logo-sub { grid-column:2; grid-row:2; }
.sidebar__logo-title { font-size:14px; font-weight:700; color:#fff; letter-spacing:-.01em; line-height:1.2; }
.sidebar__logo-sub { font-size:10px; color:rgba(255,255,255,.6); margin-top:1px; line-height:1.2; }
.sidebar__nav {
  flex:1; padding:10px; display:flex; flex-direction:column;
  gap:2px; overflow-y:auto;
}
.nav-item {
  display:flex; align-items:center; gap:10px;
  padding:9px 10px; border-radius:10px;
  font-size:12.5px; font-weight:500;
  color:rgba(255,255,255,.45);
  transition:background var(--t),color var(--t);
  cursor:pointer; position:relative;
}
.nav-item:hover { background:rgba(255,255,255,.06); color:rgba(255,255,255,.8); }
.nav-item.is-active {
  background:rgba(139,92,246,.2);
  color:#fff; font-weight:600;
  box-shadow:inset 0 0 0 1px rgba(139,92,246,.3);
}
.nav-item.is-active::before {
  content:''; position:absolute; left:-10px; top:50%; transform:translateY(-50%);
  width:3px; height:60%; background:#8b5cf6; border-radius:0 2px 2px 0;
}
.nav-item__icon { font-size:15px; width:18px; text-align:center; color:inherit; opacity:.8; }
.nav-item.is-active .nav-item__icon { opacity:1; }
.nav-item__label { flex:1; }
.sb-section-label {
  font-size:11px; font-weight:700; letter-spacing:.1em;
  text-transform:uppercase; color:rgba(255,255,255,.55);
  padding:12px 18px 4px;
}
.sidebar__footer {
  padding:12px; border-top:1px solid rgba(255,255,255,.07);
}
.sidebar__footer .input-label { color:rgba(255,255,255,.35); }
.sidebar__footer .input {
  background:rgba(255,255,255,.07); border-color:rgba(255,255,255,.1);
  color:rgba(255,255,255,.7);
}
.sidebar__footer .input:focus { border-color:var(--violet-400); box-shadow:var(--sh-focus); }
.sidebar__footer .btn--ghost { color:rgba(255,255,255,.4); }
.sidebar__footer .btn--ghost:hover { background:rgba(255,255,255,.07); color:rgba(255,255,255,.7); }

/* Collapsed sidebar */
.sidebar { transition:width .22s cubic-bezier(.32,.72,0,1); }
.sidebar.collapsed { width:60px; }
.sidebar.collapsed .sidebar__logo-title,
.sidebar.collapsed .sidebar__logo-sub,
.sidebar.collapsed .nav-item__label,
.sidebar.collapsed .sb-section-label,
.sidebar.collapsed .sidebar__footer .input-label,
.sidebar.collapsed .sidebar__footer select,
.sidebar.collapsed ._sb-user-name,
.sidebar.collapsed ._sb-logout-text,
.sidebar.collapsed ._sb-toggle-text { display:none !important; }
.sidebar.collapsed .sidebar__logo { padding:14px 0; display:flex; justify-content:center; }
.sidebar.collapsed .sidebar__logo img { width:32px; height:32px; }
.sidebar.collapsed ._sb-logo-icon { display:block !important; }
.sidebar:not(.collapsed) ._sb-logo-icon { display:block; }
.sidebar.collapsed .nav-item { padding:10px 0; justify-content:center; }
.sidebar.collapsed .nav-item__icon { font-size:18px; width:auto; }
.sidebar.collapsed .sidebar__footer { padding:10px 0; display:flex; flex-direction:column; align-items:center; gap:6px; }
.sidebar.collapsed ._sb-user-block { padding:6px 0; margin-bottom:0; justify-content:center; }
.sidebar.collapsed ._sb-logout-btn { width:36px !important; padding:8px; justify-content:center; }
.sidebar.collapsed ._sb-logout-btn .ph-sign-out { margin:0; }
.sidebar.collapsed ._nav-badge { position:absolute; top:6px; right:6px; min-width:14px; height:14px; padding:0 3px; font-size:8px; }
.nav-item { position:relative; }
._sb-toggle { position:fixed; top:50%; transform:translateY(-50%); left:207px; width:22px; height:22px; padding:0; border-radius:50%; background:var(--violet-500); border:2px solid #fff; cursor:pointer; display:grid; place-items:center; font-family:Arial,sans-serif; font-size:16px; font-weight:400; line-height:1; color:#fff; z-index:200; box-shadow:0 2px 8px rgba(109,40,217,.4); transition:left .22s cubic-bezier(.32,.72,0,1); }
._sb-toggle-glyph { display:block; line-height:1; pointer-events:none; transform:translateY(-1px); }
._sb-toggle:hover { background:var(--violet-600); }
.sidebar.collapsed ~ ._sb-toggle { left:51px; }
/* nav-item label */
.nav-item__label { flex:1; }

/* ===== 4. Main / Topbar / Content ===== */
.main { margin-left:216px; background:var(--bg); min-height:100vh; transition:margin-left .22s cubic-bezier(.32,.72,0,1); }
.main.sb-collapsed { margin-left:60px; }
.sidebar.collapsed ~ .main { margin-left:60px; }
.topbar {
  position:sticky; top:0; height:56px;
  padding:0 var(--s8);
  display:flex; align-items:center; justify-content:space-between; gap:var(--s4);
  background:#faf7ff;
  border-bottom:1px solid var(--border);
  z-index:calc(var(--z-sticky) + 1);
}
.topbar__title { font-size:17px; font-weight:700; letter-spacing:-.02em; color:var(--text); }
.topbar__heading { display:flex; align-items:center; gap:14px; min-width:0; }
.topbar__actions { display:flex; align-items:center; gap:var(--s3); }
.content { padding:var(--s6) var(--s8); max-width:1440px; display:flex; flex-direction:column; min-height:calc(100vh - 52px); }
.content.content--schedule {
  width:100%; max-width:none; height:calc(100dvh - 56px); min-height:0;
  padding:var(--s5); overflow:hidden;
}
.content .stat-row + .grid-8-4 { flex:1; min-height:0; }
.content .grid-8-4 { align-items:stretch; }
.content .grid-8-4 > div:first-child { display:flex; flex-direction:column; }
.content .grid-8-4 > div:first-child .card { flex:1; display:flex; flex-direction:column; }
.content .grid-8-4 > div:first-child .card .card__body { flex:1; overflow-y:auto; }
.content > * + * { margin-top:var(--s6); }

/* ===== 5. Buttons ===== */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:var(--s2);
  height:38px; padding:0 var(--s4);
  border:1px solid transparent; border-radius:var(--r-md);
  background:transparent; color:var(--text);
  font-size:13px; font-weight:500; cursor:pointer;
  transition:background var(--t),border-color var(--t),color var(--t),
             box-shadow var(--t-fast),transform var(--t-fast);
  white-space:nowrap; font-family:inherit;
}
.btn:focus-visible { outline:none; box-shadow:var(--sh-focus); }
.btn:disabled,.btn.is-disabled { opacity:.45; cursor:not-allowed; pointer-events:none; }
.btn--sm  { height:30px; padding:0 var(--s3); font-size:var(--fs-xs); border-radius:var(--r-sm); }
.btn--md  { height:36px; }
.btn--lg  { height:44px; padding:0 var(--s6); font-size:var(--fs-base); }
.btn--icon { width:36px; padding:0; justify-content:center; }
.btn--primary {
  background:var(--violet-600);
  color:#fff; border:none;
  border-radius:8px;
  box-shadow:none;
}
.btn--primary:hover { background:var(--violet-700); box-shadow:none; transform:none; }
.btn--primary:active { opacity:.92; transform:none; }
.btn--secondary {
  background:var(--surface); border-color:var(--border-card); color:var(--text-2);
}
.btn--secondary:hover { background:var(--violet-50); border-color:var(--violet-200); color:var(--text); }
.btn--ghost { background:transparent; color:var(--text-2); }
.btn--ghost:hover { background:var(--violet-50); color:var(--text); }
.btn--danger {
  background:var(--danger-soft); color:var(--danger); border-color:rgba(185,28,28,.2);
}
.btn--danger:hover { background:var(--danger); color:#fff; border-color:var(--danger); }
.btn--round { width:56px; height:56px; padding:0; border-radius:var(--r-pill); font-size:18px; }
.btn--square { width:56px; height:56px; padding:0; border-radius:var(--r-md); font-size:18px; }

/* ===== 6. Cards ===== */
.card {
  background:var(--surface); border:1px solid var(--border-card);
  border-radius:var(--r-lg); box-shadow:var(--shadow-sm); padding:var(--s6);
}
.card--flush { padding:0; }
.card--flush .card__header {
  padding:var(--s4) var(--s6);
  border-bottom:1px solid var(--border); margin-bottom:0;
}
.card--flush .card__footer {
  padding:var(--s3) var(--s6);
  border-top:1px solid var(--border); margin-top:0;
}
.card--accent { }
.card__header {
  display:flex; align-items:center; justify-content:space-between;
  gap:var(--s3); margin-bottom:var(--s4);
}
.card__title { font-size:13px; font-weight:700; color:var(--text); letter-spacing:-.01em; font-family:var(--font-display); }
.card__subtitle { font-size:10px; color:var(--text-3); margin-top:2px; }
.card__actions { display:flex; align-items:center; gap:var(--s2); }
.card__body { color:var(--text); }
.card__footer {
  margin-top:var(--s4); display:flex; justify-content:space-between; align-items:center;
  font-size:var(--fs-sm); color:var(--text-2);
}

/* ===== 7. Inputs ===== */
.input-label {
  display:block; font-size:var(--fs-xs); font-weight:500; color:var(--text-3);
  text-transform:uppercase; letter-spacing:.05em; margin-bottom:6px;
}
.input {
  width:100%; height:36px; padding:0 var(--s3);
  background:var(--surface); border:1px solid var(--border-card);
  border-radius:var(--r-sm); color:var(--text);
  font-family:inherit; font-size:var(--fs-base);
  transition:border-color var(--t),box-shadow var(--t);
}
.input::placeholder { color:var(--text-3); }
.input:focus { outline:none; }
.input:focus-visible { border-color:var(--violet-400); box-shadow:var(--sh-focus); }
.input--error { border-color:var(--red-700); }
.input-group { display:flex; gap:var(--s3); }
.input-group > * { flex:1; }
textarea.input {
  height:auto; min-height:96px;
  padding:var(--s3); resize:vertical; line-height:1.5;
}
select.input {
  appearance:none;
  background-image:linear-gradient(45deg,transparent 50%,var(--text-3) 50%),
                   linear-gradient(135deg,var(--text-3) 50%,transparent 50%);
  background-position:calc(100% - 16px) 50%,calc(100% - 11px) 50%;
  background-size:5px 5px; background-repeat:no-repeat; padding-right:32px;
}

/* Брендированные контролы вместо системных Safari select/date/time. */
.fenix-control { position:relative; display:inline-flex; min-width:0; vertical-align:middle; }
.fenix-control--fluid { width:100%; }
.fenix-control__source {
  display:none!important;
}
.fenix-control__trigger {
  width:100%; min-width:0; min-height:36px; padding:0 11px; border:1px solid var(--border-card);
  border-radius:var(--r-sm); background:var(--surface); color:var(--text); font:inherit;
  display:flex; align-items:center; justify-content:space-between; gap:8px; cursor:pointer;
  transition:border-color var(--t),box-shadow var(--t),background var(--t); text-align:left;
}
.fenix-control__trigger:hover { border-color:var(--violet-300); background:var(--violet-50); }
.fenix-control__trigger:focus { outline:none; }
.fenix-control__trigger:focus-visible { border-color:var(--violet-400); box-shadow:var(--sh-focus); }
.fenix-control__trigger:disabled { opacity:.55; cursor:not-allowed; }
.fenix-control__label { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fenix-control__trigger svg { width:18px; height:18px; flex:0 0 18px; fill:none; stroke:var(--violet-500); stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.fenix-control-panel {
  position:fixed; z-index:1200; max-height:min(460px,calc(100vh - 24px)); overflow:auto; padding:12px;
  background:var(--surface); border:1px solid var(--border-card); border-radius:var(--r-lg);
  box-shadow:0 22px 60px rgba(53,25,91,.22); color:var(--text);
}
.fenix-control-panel__title { padding:2px 3px 10px; color:var(--violet-700); font-size:var(--fs-sm); font-weight:700; }
.fenix-control-panel__subtitle { padding:12px 3px 8px; margin-top:8px; border-top:1px solid var(--border); color:var(--violet-700); font-size:var(--fs-sm); font-weight:700; }
.fenix-select-list { display:flex; flex-direction:column; gap:3px; }
.fenix-select-option { min-height:38px; padding:8px 10px; border:0; border-radius:9px; background:transparent; color:var(--text); font:inherit; text-align:left; cursor:pointer; }
.fenix-select-option:hover { background:var(--violet-50); }
.fenix-select-option.is-selected { background:var(--violet-100); color:var(--violet-700); font-weight:700; }
.fenix-select-option:focus { outline:none; }
.fenix-select-option:focus-visible { box-shadow:inset 0 0 0 2px var(--violet-500); }
.fenix-calendar-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:10px; color:var(--violet-700); text-transform:capitalize; }
.fenix-calendar-nav { width:36px; height:36px; padding:0; border:0; border-radius:10px; background:var(--violet-50); color:var(--violet-600); display:flex; align-items:center; justify-content:center; cursor:pointer; }
.fenix-calendar-nav:hover { background:var(--violet-100); }
.fenix-calendar-nav:focus { outline:none; }
.fenix-calendar-nav:focus-visible { box-shadow:0 0 0 3px rgba(109,40,217,.16); }
.fenix-calendar-nav svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.fenix-calendar-week,.fenix-calendar-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:3px; }
.fenix-calendar-week { margin-bottom:4px; color:var(--text-3); font-size:10px; font-weight:700; text-align:center; }
.fenix-calendar-week span { padding:4px 0; }
.fenix-calendar-day { width:100%; min-width:0; padding:0; aspect-ratio:1; min-height:34px; border:0; border-radius:9px; background:transparent; color:var(--text); font:600 var(--fs-sm)/1 'Inter',sans-serif; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.fenix-calendar-day:hover { background:var(--violet-50); color:var(--violet-700); }
.fenix-calendar-day.is-outside { color:var(--text-3); font-weight:400; }
.fenix-calendar-day.is-today { box-shadow:inset 0 0 0 1.5px var(--violet-300); color:var(--violet-700); }
.fenix-calendar-day.is-selected { background:var(--violet-600); color:#fff; box-shadow:none; }
.fenix-calendar-day:focus { outline:none; }
.fenix-calendar-day:focus-visible { box-shadow:inset 0 0 0 2px var(--violet-600); }
.fenix-time-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:5px; max-height:210px; overflow:auto; padding:1px; }
.fenix-time-option { min-height:34px; padding:5px; border:1px solid var(--border-card); border-radius:8px; background:var(--surface); color:var(--text); font:600 var(--fs-sm)/1 'Inter',sans-serif; cursor:pointer; }
.fenix-time-option:hover { border-color:var(--violet-300); background:var(--violet-50); }
.fenix-time-option.is-selected { border-color:var(--violet-600); background:var(--violet-600); color:#fff; }
.fenix-time-option:focus { outline:none; }
.fenix-time-option:focus-visible { box-shadow:0 0 0 3px rgba(109,40,217,.16); }
.fenix-control-apply { width:100%; min-height:40px; margin-top:12px; border:0; border-radius:10px; background:var(--violet-600); color:#fff; font:700 var(--fs-base)/1 'Inter',sans-serif; cursor:pointer; }
.fenix-control-apply:hover { background:var(--violet-700); }
.fenix-control-apply:focus { outline:none; }
.fenix-control-apply:focus-visible { box-shadow:0 0 0 3px rgba(109,40,217,.22); }

input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-cancel-button { display:none; }
input[type=number] { appearance:textfield; -moz-appearance:textfield; }
input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button { appearance:none; -webkit-appearance:none; margin:0; }

/* ===== 8. Table ===== */
.table { width:100%; border-collapse:separate; border-spacing:0; font-size:var(--fs-base); }
.table thead th {
  position:sticky; top:0; z-index:2;
  background:#faf5ff;
  color:var(--text-3); font-size:11px; font-weight:700;
  text-transform:uppercase; letter-spacing:.08em; text-align:left;
  padding:var(--s3) var(--s4); border-bottom:1px solid var(--border);
}
.table tbody td {
  padding:10px 14px; border-bottom:1px solid rgba(109,40,217,.05);
  color:var(--text); vertical-align:middle;
  
}
.table tbody tr:hover td { background:rgba(250,245,255,.6); cursor:pointer; }
.table tbody tr:last-child td { border-bottom:none; }
.td-num { font-variant-numeric:tabular-nums; text-align:right; font-weight:500; }
.td-center { font-variant-numeric:tabular-nums; text-align:center; font-weight:500; }
.table thead th.td-num { text-align:right; }
.th-sort { cursor:pointer; user-select:none; white-space:nowrap; }
.th-sort::after { content:none; }
.table-empty td { text-align:center; padding:var(--s8); color:var(--text-2); }

/* ===== 9. Modal ===== */
.modal-host { position:fixed; inset:0; z-index:var(--z-modal-bg); }
.modal-backdrop {
  position:fixed; inset:0;
  background:rgba(30,10,60,.5); backdrop-filter:blur(6px);
  display:flex; align-items:center; justify-content:center;
  padding:var(--s6); z-index:var(--z-modal-bg);
}
.modal {
  position:relative; background:var(--surface);
  border:1px solid var(--border-card); border-radius:var(--r-lg);
  box-shadow:var(--shadow-lg);
  width:100%; max-height:90vh; overflow:auto;
  z-index:var(--z-modal); animation:modal-in var(--t-modal);
}
.modal--sm { max-width:480px; }
.modal--md { max-width:640px; }
.modal--lg { max-width:880px; }
.modal__header {
  display:flex; align-items:center; justify-content:space-between;
  padding:var(--s4) var(--s6); border-bottom:1px solid var(--border);
}
.modal__title { font-size:18px; font-weight:700; color:var(--text); }
.modal__close {
  background:transparent; border:none; color:var(--text-2);
  font-size:22px; cursor:pointer; padding:0; line-height:1;
  transition:color var(--t);
}
.modal__close:hover { color:var(--text); }
.modal__body { padding:var(--s6); }
.modal__body > * + * { margin-top:var(--s6); }
.modal__footer {
  display:flex; align-items:center; justify-content:space-between; gap:var(--s3);
  padding:var(--s4) var(--s6); border-top:1px solid var(--border);
}
.modal__footer-right { display:flex; gap:var(--s3); margin-left:auto; }
.modal__footer-actions { display:flex; align-items:center; flex-wrap:wrap; gap:var(--s3); }

.balance-topup .balance-topup__body { display:grid; gap:var(--s4); }
.balance-topup__body > * + * { margin-top:0; }
.balance-topup__client { color:var(--text); font-size:16px; font-weight:600; overflow-wrap:anywhere; }
.balance-topup__fiscal { display:flex; gap:var(--s2); align-items:center; }
.balance-topup__fiscal input { flex-shrink:0; margin:0; }
.balance-topup .balance-topup__footer { display:flex; flex-wrap:nowrap; justify-content:flex-end; gap:var(--s3); }
.balance-topup__footer .btn { flex-shrink:0; }

@keyframes modal-in {
  from { opacity:0; transform:translateY(6px); }
  to   { opacity:1; transform:none; }
}

/* ===== 10. Badge ===== */
.badge {
  display:inline-flex; align-items:center; gap:5px;
  padding:2px 8px; border-radius:var(--r-pill);
  font-size:var(--fs-xs); font-weight:600;
  background:var(--surface-2); color:var(--text-2); white-space:nowrap;
}
.badge__dot { width:6px; height:6px; border-radius:var(--r-pill); background:currentColor; flex-shrink:0; }
.badge--success { background:var(--success-soft); color:var(--success); }
.badge--warning { background:var(--warning-soft); color:var(--warning); }
.badge--danger  { background:var(--danger-soft);  color:var(--danger); }
.badge--info    { background:var(--info-soft);     color:var(--info); }
.badge--primary { background:var(--violet-100);    color:var(--violet-700); }

/* ===== 11. KPI Stat cards ===== */
.stat-row { display:grid; grid-template-columns:repeat(4,1fr); gap:var(--s4); }
.stat-row--3 { grid-template-columns:repeat(3,1fr); }
.stat {
  background:var(--surface); border:1px solid var(--border-card);
  border-radius:var(--r-lg); box-shadow:var(--shadow-sm);
  padding:var(--s5) var(--s6); position:relative;
}
.stat:hover { box-shadow:var(--shadow-md); }
.stat__label {
  font-size:10px; font-weight:700; text-transform:uppercase;
  letter-spacing:.07em; color:var(--text-3); margin-bottom:var(--s3);
}
.stat__value {
  font-size:var(--fs-stat); font-weight:800; line-height:1;
  color:var(--text); font-variant-numeric:tabular-nums; letter-spacing:-.03em;
  font-family:var(--font-display);
}
.dashboard-conflicts { width:100%; min-height:52px; margin:var(--s4) 0; padding:12px 16px; border:1px solid var(--border-card); border-radius:var(--r-md); display:flex; align-items:center; gap:12px; background:var(--surface); color:var(--text-2); font:inherit; text-align:left; }
button.dashboard-conflicts { cursor:pointer; }
.dashboard-conflicts > i { flex:0 0 auto; font-size:20px; }
.dashboard-conflicts > span { display:flex; flex:1; min-width:0; flex-direction:column; gap:2px; }
.dashboard-conflicts small { color:var(--text-2); font-size:var(--fs-sm); }
.dashboard-conflicts--warning { border-color:rgba(245,158,11,.4); background:var(--warning-soft); color:#92400e; }
.dashboard-conflicts--error { border-color:rgba(239,68,68,.3); background:var(--danger-soft); color:var(--danger); }
.dashboard-conflicts--ok { color:var(--success); }
.dashboard-conflicts--loading > i { animation:sp .8s linear infinite; }
.conflict-modal__body { display:grid; gap:12px; max-height:65vh; overflow:auto; }
.conflict-pair { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px 16px; align-items:center; padding:14px; border:1px solid var(--border); border-radius:var(--r-md); background:var(--surface-2); }
.conflict-pair__head { grid-column:1 / -1; display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; }
.conflict-pair__bookings { display:grid; gap:8px; min-width:0; }
.conflict-pair__bookings > div { display:flex; align-items:center; gap:10px; min-width:0; }
.conflict-pair__bookings strong { overflow-wrap:anywhere; }
@media(max-width:600px) { .conflict-pair { grid-template-columns:minmax(0,1fr); } .conflict-pair .btn { width:100%; } .conflict-pair__bookings > div { align-items:flex-start; flex-direction:column; gap:4px; } }
.stat__delta {
  font-size:var(--fs-sm); font-weight:500; margin-top:var(--s2);
  display:inline-flex; align-items:center; gap:4px;
}
.stat__delta--up   { color:var(--success); background:var(--success-soft); padding:2px 7px; border-radius:var(--r-pill); font-size:10px; }
.stat__delta--down { color:var(--danger);  background:var(--danger-soft);  padding:2px 7px; border-radius:var(--r-pill); font-size:10px; }
.stat__delta--neutral { color:var(--text-2); }
.stat--danger .stat__value { color:var(--danger); }
.stat__icon { width:36px; height:36px; border-radius:10px; display:flex; align-items:center; justify-content:center; background:var(--violet-50); font-size:18px; flex-shrink:0; }
.stat--danger .stat__icon { background:#fff1f2; }
.stat__header { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:12px; }
.time-chip { white-space:nowrap; font-size:11px; font-weight:600; color:var(--text-2); background:var(--violet-50); border:1px solid var(--border-card); padding:3px 8px; border-radius:6px; display:inline-block; font-variant-numeric:tabular-nums; }

/* ===== 12. Avatar ===== */
.avatar {
  display:inline-flex; align-items:center; justify-content:center;
  width:34px; height:34px; border-radius:50%;
  color:#fff; font-size:13px; font-weight:600;
  flex-shrink:0; user-select:none;
}
.avatar--sm { width:26px; height:26px; font-size:11px; }
.avatar--lg { width:44px; height:44px; font-size:16px; }
.avatar--c1{background:var(--av-1);} .avatar--c2{background:var(--av-2);}
.avatar--c3{background:var(--av-3);} .avatar--c4{background:var(--av-4);}
.avatar--c5{background:var(--av-5);} .avatar--c6{background:var(--av-6);}
.client-cell { display:inline-flex; align-items:center; gap:var(--s3); }
.client-cell__name { font-weight:500; color:var(--text); }

/* ===== 13. Tabs ===== */
.tabs {
  display:inline-flex; padding:3px;
  background:var(--surface-2); border-radius:var(--r-pill); gap:2px;
}
.tabs__btn {
  padding:6px 14px; border:none; background:transparent;
  color:var(--text-2); font-size:var(--fs-sm); font-weight:600;
  border-radius:var(--r-pill); cursor:pointer; font-family:inherit;
  transition:background var(--t),color var(--t);
}
.tabs__btn:hover { color:var(--text); }
.tabs__btn.is-active { background:var(--surface); color:var(--violet-600); box-shadow:var(--shadow-sm); }

/* ===== 14. Chips ===== */
.chips { display:inline-flex; flex-wrap:wrap; gap:var(--s2); }
.chip {
  display:inline-flex; align-items:center; gap:6px;
  padding:7px 12px; background:var(--surface); min-height:36px;
  border:1px solid var(--border-card); color:var(--text-2);
  font-size:var(--fs-sm); font-weight:500; border-radius:var(--r-pill);
  cursor:pointer; transition:background var(--t-fast),color var(--t-fast),border-color var(--t-fast);
}
.chip:hover,.chip:active { background:var(--violet-50); color:var(--text); border-color:var(--violet-200); }
.chip.is-active { background:var(--violet-100); border-color:var(--violet-400); color:var(--violet-700); }

/* ===== 15. Toast ===== */
.toast-container {
  position:fixed; bottom:var(--s6); right:var(--s6);
  display:flex; flex-direction:column; gap:var(--s2);
  z-index:var(--z-toast); pointer-events:none;
}
.toast {
  display:flex; align-items:center; gap:var(--s3); max-width:320px;
  padding:var(--s3) var(--s4); background:var(--surface);
  border:1px solid var(--border-card);
  border-radius:var(--r-sm); box-shadow:var(--shadow-lg);
  font-size:var(--fs-sm); color:var(--text); pointer-events:auto;
  animation:toast-in 200ms ease;
}
.toast--success { border-left-color:var(--success); }
.toast--warning { border-left-color:var(--warning); }
.toast--danger  { border-left-color:var(--danger); }
.toast--info    { border-left-color:var(--info); }
.toast__icon { display:grid; place-items:center; flex:0 0 20px; width:20px; height:20px; font-size:16px; line-height:1; }
.toast__icon > i { display:block; line-height:1; }
.toast__text { flex:1; min-width:0; line-height:20px; overflow-wrap:anywhere; }
.toast__close {
  background:transparent; border:none; color:var(--text-2);
  display:grid; place-items:center; flex:0 0 24px; width:24px; height:24px;
  font-family:inherit; font-size:18px; cursor:pointer; padding:0; line-height:1;
}
.toast__close:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.toast__close:hover { color:var(--text); }

@keyframes toast-in {
  from { opacity:0; transform:translateX(16px); }
  to   { opacity:1; transform:none; }
}
@keyframes shimmer {
  0%   { background-position:200% 0; }
  100% { background-position:-200% 0; }
}

/* ===== 16. Skeleton ===== */
.skeleton {
  display:block;
  background:linear-gradient(90deg,var(--surface-2) 0%,var(--surface-3) 50%,var(--surface-2) 100%);
  background-size:200% 100%; border-radius:var(--r-sm);
  animation:shimmer 1.6s linear infinite; height:16px;
}
.skeleton--stat { height:80px; }
.skeleton--row  { height:36px; margin-top:6px; }

/* ===== 17. Dashboard layout ===== */
.grid-8-4 { display:grid; grid-template-columns:2fr 1fr; gap:var(--s4); align-items:stretch; }
.grid-8-4 > div:first-child { display:flex; flex-direction:column; }
.grid-8-4 > .col-right { display:flex; flex-direction:column; gap:var(--s4); }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:var(--s4); align-items:start; }
.grid-3 { display:grid; grid-template-columns:repeat(3,1fr); gap:var(--s4); align-items:start; }

.client-list { display:flex; flex-direction:column; gap:var(--s3); }
.client-list__row { display:flex; align-items:center; gap:var(--s3); padding:var(--s2) 0; }
.client-list__row + .client-list__row { border-top:1px solid var(--border); padding-top:var(--s3); }
.client-list__meta { font-size:var(--fs-sm); color:var(--text-2); }
.client-list__value { margin-left:auto; font-weight:600; font-variant-numeric:tabular-nums; }
.client-list__value--danger { color:var(--danger); }

.progress-row {
  display:grid; grid-template-columns:120px 1fr 60px;
  align-items:center; gap:var(--s4);
  padding:var(--s3) 0; border-bottom:1px solid var(--border);
}
.progress-row:last-child { border-bottom:none; }
.progress-row__label { font-weight:500; color:var(--text); }
.progress-row__value { font-variant-numeric:tabular-nums; text-align:right; color:var(--text-2); font-size:var(--fs-sm); font-weight:600; }

.progress-bar { height:6px; background:var(--surface-2); border-radius:var(--r-pill); overflow:hidden; }
.progress-bar__fill {
  height:100%; border-radius:var(--r-pill);
  background:var(--violet-500);
  transition:width var(--t);
}
.progress-inline { display:inline-flex; align-items:center; gap:var(--s3); width:100%; max-width:260px; }
.progress-inline .progress-bar { flex:1; min-width:80px; }
.progress-inline__text { font-size:var(--fs-sm); font-weight:600; color:var(--text-2); white-space:nowrap; }

.empty-state { text-align:center; padding:var(--s12) var(--s4); color:var(--text-3); }
.empty-state__icon { font-size:48px; line-height:1; margin-bottom:var(--s3); }
.empty-state__text { font-size:var(--fs-base); }

.filter-row { display:flex; align-items:center; gap:var(--s3); flex-wrap:wrap; }
.filters-grid { display:grid; grid-template-columns:1fr 1fr 1fr 1fr auto auto; gap:var(--s3); align-items:end; }
.finance-filters-grid {
  display:grid;
  grid-template-columns:170px 170px minmax(240px,1fr) minmax(150px,.7fr);
  gap:var(--s3);
  align-items:end;
}
.finance-filters-grid > * { min-width:0; }
.finance-filter-date { width:170px; }
.finance-filter-client { display:grid; grid-template-columns:minmax(0,1fr); gap:var(--s2); }
.finance-filter-client__search { min-width:0; }
.search-input { max-width:480px; width:100%; }
.clients-toolbar { display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.clients-search { position:relative; flex:1 1 320px; min-width:0; }
.clients-search > i { position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--text-3); pointer-events:none; font-size:18px; }
.clients-search > .input { width:100%; height:42px; padding-left:42px; }
.clients-toolbar > .chips { flex-shrink:0; }
.channel-links-issues summary { cursor:pointer; color:var(--primary); }
.channel-links-issues p { overflow-wrap:anywhere; }
@media(max-width:768px) {
  .clients-toolbar { flex-direction:column; align-items:stretch; gap:10px; }
  .clients-search { flex:0 0 auto; width:100%; }
}
.legend { display:inline-flex; align-items:center; gap:var(--s4); font-size:var(--fs-sm); color:var(--text-2); }
.legend__item { display:inline-flex; align-items:center; gap:6px; }
.legend__dot { width:10px; height:10px; border-radius:var(--r-pill); }

.pagination {
  display:flex; justify-content:space-between; align-items:center;
  padding:var(--s3) var(--s6); gap:var(--s3);
}
.pagination__info { font-size:var(--fs-sm); color:var(--text-2); }

/* ===== 18. KPI mini ===== */
.kpi-mini { display:grid; grid-template-columns:repeat(3,1fr); gap:var(--s3); margin-top:var(--s2); }
.kpi-mini__item { display:flex; flex-direction:column; gap:2px; }
.kpi-mini__label { font-size:11px; color:var(--text-2); text-transform:uppercase; letter-spacing:.03em; }
.kpi-mini__value { font-size:16px; font-weight:700; font-variant-numeric:tabular-nums; color:var(--text); }

/* ===== 19. Schedule ===== */
.schedule-toolbar { display:flex; align-items:center; justify-content:space-between; gap:var(--s4); flex-wrap:wrap; }
.schedule-toolbar__left,.schedule-toolbar__right { display:flex; align-items:center; gap:var(--s3); }
.schedule-group-requests__short { display:none; }
.schedule-nav-pair { display:flex; align-items:center; gap:4px; flex-shrink:0; }
.schedule-today-btn { flex-shrink:0; }
.schedule-view > * + * { margin-top:var(--s5); }
.schedule-view { display:flex; flex:1; flex-direction:column; min-height:0; }
.schedule-view > .card--flush { display:flex; flex:1; flex-direction:column; min-height:0; }
.schedule-toolbar { flex-shrink:0; }
.schedule-view--day { display:flex; flex:1; flex-direction:column; min-height:0; }
.schedule-view--day .card--flush { display:flex; flex:1; flex-direction:column; min-height:0; }
.schedule-nav-btn {
  display:inline-flex; align-items:center; justify-content:center;
  width:32px; height:32px; border-radius:var(--r-sm);
  border:1px solid var(--border-card); background:var(--surface);
  color:var(--text-2); cursor:pointer; transition:background var(--t),color var(--t);
  flex-shrink:0;
}
.schedule-nav-btn:hover { background:var(--violet-50); color:var(--primary); }

.cal-month {
  display:grid; grid-template-columns:repeat(7,minmax(0,1fr));
  gap:1px; background:var(--border); border-radius:var(--r-sm); overflow:hidden;
}
.cal-month__hd {
  background:var(--surface-2); padding:var(--s2) var(--s3);
  font-size:var(--fs-sm); font-weight:600; color:var(--text-3);
  text-transform:uppercase; text-align:center;
}
.cal-day {
  background:var(--surface); padding:var(--s2); min-height:110px;
  display:flex; flex-direction:column; gap:4px;
  cursor:pointer; transition:background var(--t);
}
.cal-day:hover { background:var(--surface-2); }
.cal-day--outside { opacity:.45; }
.cal-day--today { outline:2px solid var(--violet-500); outline-offset:-2px; }
.cal-day__num { font-size:var(--fs-sm); font-weight:600; color:var(--text-2); margin-bottom:2px; }
.cal-day--today .cal-day__num { color:var(--violet-600); }

.cal-pill {
  display:flex; flex-direction:column; justify-content:center; gap:3px;
  width:100%; min-width:0; border:0; font-family:inherit; text-align:left; cursor:pointer;
  font-size:11px; padding:5px 6px; border-radius:var(--r-sm);
  color:#fff; font-weight:500; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis;
}
.cal-pill__meta { display:flex; flex-wrap:wrap; gap:2px 6px; min-width:0; font-size:10px; }
.cal-pill__time { font-weight:700; font-variant-numeric:tabular-nums; }
.cal-pill__room { white-space:normal; overflow-wrap:anywhere; }
.cal-pill__name { display:block; overflow:hidden; text-overflow:ellipsis; font-weight:600; }
.schedule-caption-compact, .cal-pill--mobile-more { display:none; }
.cal-pill:focus-visible { outline:2px solid var(--violet-500); outline-offset:1px; }
.month-grid-shell { overflow:auto; min-height:0; }
.cal-pill--rent  { background:var(--amber-400,#fbbf24); color:#1c1917; }
.cal-pill--key   { background:#16a34a; color:#fff; }
.cal-pill--ik    { background:#14532d; color:#fff; }
.cal-pill--event { background:var(--accent-event); color:#78350f; }
.cal-pill--more    { background:var(--surface-3); color:var(--text-2); }
.cal-pill--visited { background:#3b0764 !important; color:rgba(255,255,255,.75); }
.cal-pill--closed { background:var(--surface-3) !important; color:var(--text-2); text-decoration:line-through; }
.cal-pill--truant { background:#9f1239 !important; color:#fff; }

.day-grid {
  width:100%; min-width:780px; border-collapse:collapse; border-spacing:0; font-size:13px;
  table-layout:fixed;  /* равные колонки */
}
.day-grid-content { position:relative; }
.day-now {
  position:absolute; left:0; z-index:5; display:flex; align-items:center;
  height:0; pointer-events:none; color:#dc2626;
}
.day-now[hidden] { display:none; }
.day-now__label {
  flex:0 0 var(--now-label-width); display:flex; align-items:center; justify-content:center;
  min-height:18px; background:#dc2626; color:#fff; border-radius:4px;
  font-size:10px; font-weight:700; font-variant-numeric:tabular-nums; line-height:1;
}
.day-now__line { flex:1; height:2px; background:currentColor; position:relative; }
.day-now__line::before {
  content:''; position:absolute; left:-3px; top:-2px; width:6px; height:6px;
  border-radius:50%; background:currentColor;
}
.day-grid-shell {
  /* 33 half-hour marks: 07:00 through the final 23:00 boundary. */
  --day-slot-height:28px;
  overflow:auto;
  max-height:calc(100dvh - 216px);
}
.schedule-view--day .day-grid-shell {
  flex:1; min-height:0; max-height:none;
  overflow-y:auto; scrollbar-gutter:stable;
}
.day-grid thead th {
  position:sticky; top:0; z-index:var(--z-sticky);
  background:rgba(250,245,255,.95);
  font-weight:700; font-size:11px; text-transform:uppercase;
  color:var(--text-3); padding:var(--s2) var(--s3);
  border-bottom:1px solid var(--border); text-align:center;
}
.day-grid thead th:first-child { width:44px; text-align:center; }
.day-grid tbody th,
.day-grid tbody td {
  padding:0 4px; border-bottom:1px solid rgba(109,40,217,.05);
  height:var(--day-slot-height); vertical-align:middle; line-height:1;
}
.day-grid tbody th:first-child {
  font-variant-numeric:tabular-nums; color:var(--text-3);
  width:44px; background:var(--surface-2);
  font-size:11px; font-weight:600; text-align:center;
  padding:0 4px;
}
.day-grid__end-cell { background:var(--surface-2); }
.day-cell {
  width:100%; height:100%; min-height:18px;
  display:flex; align-items:flex-start;
  padding:clamp(4px,calc(var(--day-slot-height) - 17.5px),20px); border:0; border-radius:var(--r-sm);
  font-family:inherit; text-align:left;
  cursor:pointer; transition:filter var(--t-fast);
  font-size:12px; font-weight:500; line-height:1.2;
}
.day-cell-stack {
  position:relative;
  height:calc(var(--day-slot-height) * var(--day-slot-span) - 4px);
}
.day-cell-stack .day-cell {
  position:absolute; top:calc(var(--day-slot-height) * var(--day-booking-offset,0)); left:var(--day-stack-left);
  width:calc(var(--day-stack-width) - 3px);
  height:calc(var(--day-slot-height) * var(--day-booking-span) - 3px);
}
.day-cell:hover { filter:brightness(.95); }
.day-cell:focus-visible { outline:none; box-shadow:var(--sh-focus); z-index:1; }
.day-cell--free {
  background:transparent; border:0; opacity:1; padding:0;
}
.day-grid tbody tr:nth-child(odd) .day-cell--free { background:rgba(109,40,217,.018); }
.day-cell--free:hover { background:rgba(109,40,217,.09) !important; }
.day-cell--rent  { background:var(--amber-400,#fbbf24); color:#1c1917; }
.day-cell--key   { background:#16a34a; color:#fff; }
.day-cell--ik    { background:#14532d; color:#fff; }
.day-cell--event { background:var(--amber-50);   color:var(--amber-700); }
.day-cell--visited { background:#3b0764; color:rgba(255,255,255,.75); border:none; }
.day-cell--closed { background:var(--surface-3); color:var(--text-2); border:1px dashed var(--border); text-decoration:line-through; }
.day-cell--truant { background:#9f1239; color:#fff; border:1px solid #881337; }
@keyframes crm-spin { to { transform:rotate(360deg); } }
.crm-spinning { animation:crm-spin .7s linear infinite; display:inline-block; }
.day-cell-stack .day-cell { container-type:size; container-name:day-booking; }
/* A one-hour card has equal padding around its two lines; longer cards keep the same top inset. */
.day-cell__content { display:flex; flex-direction:column; gap:2px; min-width:0; width:100%; }
.day-cell__meta { display:flex; align-items:center; justify-content:space-between; gap:6px; min-width:0; height:16px; }
.day-cell__time { flex:none; font-size:10px; line-height:14px; font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; }
.day-cell__name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600; line-height:14px; }
.day-cell__room { display:inline-flex; align-items:center; min-width:0; max-width:55%; height:16px; padding:0 5px; border:1px solid currentColor; border-radius:4px; font-size:9px; line-height:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.day-cell__status { position:absolute; bottom:3px; right:5px; font-size:9px; font-weight:700; text-transform:uppercase; opacity:.9; }
.day-cell--short { padding:3px; }
.day-cell--short .day-cell__content { gap:0; }
.day-cell--short .day-cell__meta { height:12px; }
.day-cell--short .day-cell__room { height:12px; font-size:8px; padding:0 3px; }
.day-cell--short .day-cell__time, .day-cell--short .day-cell__name { font-size:9px; line-height:11px; }
.day-cell__badge { font-size:10px; padding:1px 6px; border-radius:var(--r-pill); background:rgba(0,0,0,.10); margin-left:4px; }
.day-cell__lock { position:absolute; right:4px; bottom:3px; cursor:pointer; opacity:.7; }
.day-cell__lock:hover { opacity:1; }

/* ===== 20. Booking card ===== */
.bk-summary {
  display:grid; grid-template-columns:44px minmax(0,1fr) auto; align-items:center; gap:var(--s4);
  padding:var(--s4); background:var(--surface-2); border-radius:var(--r-lg);
}
.bk-summary > .avatar { width:44px; height:44px; flex-shrink:0; }
.bk-summary__main { flex:1; min-width:0; align-self:center; }
.bk-summary__name { font-size:var(--fs-lg); font-weight:600; color:var(--text); }
.bk-summary__meta { font-size:var(--fs-sm); color:var(--text-2); margin-top:2px; display:flex; align-items:center; gap:var(--s3); flex-wrap:wrap; line-height:1.2; }
.bk-summary__meta > * { display:inline-flex; align-items:center; min-height:20px; }
.bk-summary__channel { gap:4px; min-width:0; }
.bk-summary__channel > span:last-child { overflow-wrap:anywhere; min-width:0; }
.bk-icon { display:inline-grid; place-items:center; width:1em; height:1em; flex:0 0 1em; line-height:1; }
.bk-icon > i { display:block; line-height:1; transform:translateY(-.5px); }
.bk-summary__balance { text-align:right; align-self:center; }
.bk-summary__balance-num { font-size:var(--fs-lg); font-weight:700; font-variant-numeric:tabular-nums; }
.bk-summary__balance-num--neg { color:var(--danger); }
.bk-summary__balance-num--pos { color:var(--success); }
.bk-summary__balance-label { font-size:var(--fs-sm); color:var(--text-2); }

.bk-meta { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-bottom:var(--sp-4); padding:var(--sp-3); background:var(--surface-2); border-radius:var(--r-sm); }
.bk-meta__item { display:grid; grid-template-columns:18px max-content; align-items:center; column-gap:6px; height:28px; font-size:var(--fs-small); line-height:1; }
.bk-meta__item > span:last-child { display:flex; align-items:center; height:28px; }
.bk-meta__item .bk-icon { width:18px; height:18px; font-size:18px; }
.bk-meta__item--status { font-weight:700; }
.bk-meta__item--price { font-weight:700; color:var(--text); }

.bk-cols { display:grid; grid-template-columns:1fr 1fr; gap:var(--s4); }
.bk-col h4 {
  font-size:var(--fs-xs); text-transform:uppercase; letter-spacing:.05em;
  color:var(--text-3); font-weight:600; margin-bottom:var(--s3);
}

.status-toggle {
  display:inline-flex; padding:3px;
  background:var(--surface-2); border-radius:var(--r-pill);
}
.status-toggle button {
  padding:6px 14px; border:none; background:transparent;
  color:var(--text-2); font-size:13px; font-weight:600;
  border-radius:var(--r-pill); cursor:pointer; font-family:inherit;
}
.status-toggle button.is-active { background:var(--surface); color:var(--text); box-shadow:var(--shadow-xs); }
.status-toggle button.is-active.is-visited { background:var(--success); color:#fff; }
.status-hint { font-size:var(--fs-sm); color:var(--text-2); margin-top:var(--s3); line-height:1.4; }

.pay-row { display:flex; align-items:center; gap:var(--s3); min-height:28px; line-height:1; }
.pay-row > span:not(.bk-icon) { display:inline-flex; align-items:center; min-height:28px; }
.pay-row--settlement { display:grid; grid-template-columns:22px max-content max-content; align-items:center; column-gap:10px; min-height:30px; }
.pay-row--settlement > span { height:30px; min-height:30px; }
.pay-row--settlement .bk-icon--success { color:#22c55e; width:22px; height:22px; font-size:22px; }
.pay-row--settlement .pay-status { font-size:var(--fs-base); transform:translateY(1px); }
.pay-form { display:flex; flex-wrap:wrap; align-items:center; gap:var(--s3); }
.pay-form .input { flex:1 1 120px; min-width:0; }
.pay-form .btn { flex:0 0 auto; }
.pay-status { margin-top:0; font-size:var(--fs-sm); color:var(--text-2); }

.log-table { width:100%; font-size:13px; border-collapse:separate; border-spacing:0; }
.log-table thead th {
  font-size:11px; text-transform:uppercase; color:var(--text-2);
  padding:6px 10px; text-align:left; vertical-align:middle; line-height:1.2;
  border-bottom:1px solid var(--border); font-weight:600;
}
.log-table tbody td { padding:6px 10px; border-bottom:1px solid var(--border); vertical-align:middle; line-height:1; }
.bk-table-cell { display:inline-flex; align-items:center; min-height:24px; }
.bk-table-cell--num { justify-content:flex-end; width:100%; }
.bk-table-cell--method { display:grid; grid-template-columns:18px max-content; align-items:center; column-gap:6px; height:24px; white-space:nowrap; }
.bk-table-cell--method .bk-icon { width:18px; height:18px; font-size:18px; }
.log-table tbody tr:last-child td { border-bottom:none; }

/* ===== 21. Client card ===== */
.client-card-layout { display:grid; grid-template-columns:2fr 1fr; gap:var(--s4); align-items:start; }
.client-card-layout > .col-left,
.client-card-layout > .col-right { display:flex; flex-direction:column; gap:var(--s4); }
.field-grid { display:grid; grid-template-columns:1fr 1fr; gap:var(--s4); }
.field { display:flex; flex-direction:column; gap:3px; }
.field__label { font-size:var(--fs-xs); font-weight:500; color:var(--text-3); text-transform:uppercase; letter-spacing:.05em; }
.field__value { font-size:var(--fs-base); font-weight:500; color:var(--text); }
.balance-big { font-size:32px; font-weight:700; font-variant-numeric:tabular-nums; line-height:1; font-family:var(--font-display); }
.balance-big--neg { color:var(--danger); }
.balance-big--pos { color:var(--success); }
.balance-actions { display:flex; gap:var(--s2); margin-top:var(--s3); }

.channel-row {
  display:flex; align-items:center; justify-content:space-between;
  padding:var(--s3) 0; border-bottom:1px solid var(--border);
}
.channel-row:last-child { border-bottom:none; }
.channel-row__name { display:flex; align-items:center; gap:var(--s2); font-weight:500; }
.channel-icons { display:inline-flex; gap:4px; font-size:14px; }
.channel-icons span { opacity:.45; }
.channel-icons span.is-on { opacity:1; }

/* ===== 22. Subscription card ===== */
.sub-card { display:flex; flex-direction:column; gap:var(--s3); }
.sub-card__price { font-size:28px; font-weight:700; color:var(--text); font-variant-numeric:tabular-nums; }
.sub-card__meta { display:flex; gap:var(--s3); font-size:var(--fs-sm); color:var(--text-2); flex-wrap:wrap; }
.sub-card__footer { display:flex; align-items:center; justify-content:space-between; gap:var(--s2); }
.template-create-button { min-height:40px; padding-inline:16px; box-shadow:var(--shadow-sm); }
.template-create-button i { font-size:16px; line-height:1; }

/* Subscription template form */
.template-modal-host { position:fixed; inset:0; z-index:9999; display:flex; align-items:center; justify-content:center; padding:20px; background:rgba(30,10,60,.5); backdrop-filter:blur(4px); }
.template-modal { width:min(100%, 520px); padding:28px; border:1px solid var(--border-card); border-radius:12px; background:var(--surface); box-shadow:var(--shadow-lg); }
.template-modal__header { display:flex; align-items:flex-start; gap:12px; margin-bottom:24px; }
.template-modal__icon { display:grid; flex:0 0 36px; width:36px; height:36px; place-items:center; border-radius:8px; background:var(--violet-100); color:var(--violet-600); font-size:18px; }
.template-modal h2 { margin:0 0 4px; color:var(--text); font:700 18px/1.25 var(--font-display); }
.template-modal__header p { margin:0; color:var(--text-2); font-size:13px; line-height:1.45; }
.template-form { display:flex; flex-direction:column; gap:16px; }
.template-form__grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.template-form__field { display:flex; flex-direction:column; gap:7px; color:var(--text); font-size:13px; font-weight:600; }
.template-form__field b { color:var(--danger); }
.template-form__field input { width:100%; height:40px; padding:0 12px; border:1px solid var(--border-strong); border-radius:8px; background:var(--surface); color:var(--text); font:inherit; font-weight:400; outline:none; }
.template-form__field input::placeholder { color:var(--text-3); }
.template-form__field input:focus { border-color:var(--violet-500); box-shadow:var(--sh-focus); }
.template-form__unit { position:relative; }
.template-form__unit input { padding-right:34px; }
.template-form__unit span { position:absolute; top:50%; right:12px; transform:translateY(-50%); color:var(--text-2); font-size:13px; font-weight:600; pointer-events:none; }
.template-form__notice { display:flex; align-items:flex-start; gap:8px; padding:10px 12px; border-radius:8px; background:var(--violet-50); color:var(--text-2); font-size:12px; line-height:1.45; }
.template-form__notice i { margin-top:2px; color:var(--violet-600); }
.template-modal__actions { display:flex; justify-content:flex-end; gap:8px; margin-top:24px; }

@media (max-width:480px) {
  .template-modal { padding:20px; }
  .template-form__grid { grid-template-columns:1fr; }
  .template-modal__actions { flex-direction:column-reverse; }
  .template-modal__actions .btn { width:100%; }
}

/* ===== 23. Event card ===== */
.event-card {
  background:var(--surface); border:1px solid var(--border-card);
  border-radius:var(--r-lg); box-shadow:var(--shadow-sm);
  padding:var(--s6); display:flex; flex-direction:column; gap:var(--s3);
  cursor:pointer; transition:border-color var(--t),box-shadow var(--t-fast);
}
.event-card:hover { border-color:var(--violet-300); box-shadow:var(--shadow-md); }
.event-card__title { font-size:var(--fs-lg); font-weight:600; color:var(--text); display:flex; align-items:center; gap:var(--s2); }
.event-card__meta { font-size:var(--fs-sm); color:var(--text-2); }
.event-card__desc { font-size:var(--fs-base); color:var(--text); line-height:1.5; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.event-card__footer { display:flex; justify-content:space-between; align-items:center; padding-top:var(--s3); border-top:1px solid var(--border); }
.event-card__metric { font-size:var(--fs-sm); color:var(--text-2); }
.event-card__metric strong { color:var(--text); font-weight:600; }

/* ===== 24. Checkbox row ===== */
.check-row { display:flex; align-items:center; gap:var(--s2); padding:var(--s2) 0; cursor:pointer; user-select:none; }
.check-row input,.modal input[type=checkbox] { width:17px; height:17px; margin:0; border:1.5px solid var(--violet-300); border-radius:5px; background:var(--surface); appearance:none; -webkit-appearance:none; cursor:pointer; background-position:center; background-repeat:no-repeat; background-size:12px 12px; transition:.15s; }
.check-row input:checked,.modal input[type=checkbox]:checked { border-color:var(--violet-600); background-color:var(--violet-600); background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 8.2 3.1 3.1L13 4.8' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.check-row input:focus,.modal input[type=checkbox]:focus { outline:none; }
.check-row input:focus-visible,.modal input[type=checkbox]:focus-visible { box-shadow:0 0 0 3px rgba(109,40,217,.16); }
input[type=radio] { width:17px; height:17px; margin:0; border:1.5px solid var(--violet-300); border-radius:50%; background:var(--surface); appearance:none; -webkit-appearance:none; cursor:pointer; transition:.15s; }
input[type=radio]:checked { border-color:var(--violet-600); box-shadow:inset 0 0 0 4px var(--surface); background:var(--violet-600); }
input[type=radio]:focus { outline:none; }
input[type=radio]:focus-visible { box-shadow:0 0 0 3px rgba(109,40,217,.16),inset 0 0 0 4px var(--surface); }

@media(max-width:640px) {
  .fenix-control-panel:not(.fenix-control-panel--select) { left:12px!important; right:12px!important; top:auto!important; bottom:max(12px,env(safe-area-inset-bottom,0px))!important; width:auto!important; max-height:min(72vh,560px); border-radius:20px; }
  .fenix-calendar-day { min-height:40px; }
  .fenix-time-grid { grid-template-columns:repeat(3,1fr); }
}

/* ===== 25. Utilities ===== */
.muted { color:var(--text-2); }
.row-flex { display:flex; align-items:center; gap:var(--s3); }
.row-spread { display:flex; align-items:center; justify-content:space-between; gap:var(--s3); }
.text-right { text-align:right; }
.text-mono { font-variant-numeric:tabular-nums; }
.divider { height:1px; background:var(--border); margin:var(--s4) 0; }
.link { color:var(--violet-600); cursor:pointer; }
.link:hover { text-decoration:underline; }

/* ===== 26. Responsive — Mobile / Tablet ===== */

/* --- Sidebar overlay (shared) --- */
#sidebar-overlay {
  display:none; position:fixed; inset:0;
  background:rgba(30,10,60,.5); backdrop-filter:blur(2px);
  z-index:var(--z-sidebar); /* same layer, renders behind sidebar */
}
#sidebar-overlay.visible { display:block; }
body:has(#sidebar-overlay.visible) { overflow:hidden; }

/* --- Sidebar toggle button: hide on mobile (hamburger replaces it) --- */
@media (max-width:768px) {
  ._sb-toggle { display:none !important; }
}

/* ===== ≤768px : phones + small tablets ===== */
@media (max-width:768px) {

  /* Sidebar: slide-in drawer */
  #sidebar {
    position:fixed; left:-232px; top:0; height:100%;
    width:216px; z-index:calc(var(--z-sidebar) + 1);
    transition:left .25s ease;
    box-shadow:none;
  }
  #sidebar.open { left:0; box-shadow:var(--shadow-lg); }
  .sidebar.collapsed .nav-item__label,
  .sidebar.collapsed .sidebar__logo-title,
  .sidebar.collapsed .sidebar__logo-sub,
  .sidebar.collapsed .sb-section-label,
  .sidebar.collapsed ._sb-user-name,
  .sidebar.collapsed ._sb-logout-text { display:block !important; }
  .sidebar.collapsed .nav-item { padding:10px 16px; justify-content:flex-start; }
  .sidebar.collapsed .sidebar__logo { display:grid; padding:16px 16px 12px; }
  .sidebar.collapsed .sidebar__footer { display:block; padding:12px; }
  .sidebar.collapsed ._sb-user-block { padding:10px 12px; justify-content:flex-start; }
  .sidebar.collapsed ._sb-logout-btn { width:100% !important; }

  /* Overlay sits BELOW sidebar */
  #sidebar-overlay { z-index:var(--z-sidebar); }

  /* Main: full width, no left offset */
  #main-content { margin-left:0 !important; width:100% !important; }

  /* Hamburger button */
  #hamburger {
    display:flex !important;
    background:linear-gradient(135deg,var(--violet-700),var(--violet-900)) !important;
    box-shadow:0 2px 8px rgba(76,29,149,.45) !important;
    color:#fff !important; border:none !important;
    border-radius:10px !important;
    width:38px; height:38px;
    align-items:center; justify-content:center;
    font-size:19px; cursor:pointer; flex-shrink:0;
    transition:opacity .15s !important;
  }
  #hamburger:active { opacity:.8 !important; }
  .td-hide-mobile { display:none !important; }

  /* Topbar: compress */
  .topbar {
    padding:0 var(--s3);
    gap:var(--s2);
    flex-wrap:nowrap;
    height:52px;
  }
  .topbar__title { font-size:14px; white-space:nowrap; }
  .topbar__heading { flex:1 1 auto; }
  /* Hide date chip and search on small screens */
  #_topbar-date { display:none !important; }
  #_topbar-search-wrap { display:none !important; }
  /* Compress topbar actions */
  .topbar__actions { gap:var(--s2); flex-shrink:0; }
  .topbar__actions .badge { display:none; }
  .topbar__actions .btn--primary { height:30px; font-size:12px; padding:0 var(--s3); }

  /* Content padding */
  .content { padding:var(--s4) var(--s3); }

  /* KPI stat row: 2×2 grid */
  .stat-row { grid-template-columns:1fr 1fr; gap:var(--s3); }
  .stat-row--3 { grid-template-columns:1fr 1fr; }
  .stat { padding:var(--s4); }
  .stat__value { font-size:22px; }

  /* Main dashboard grid: single column */
  .grid-8-4 { grid-template-columns:1fr; }
  .grid-8-4 > .col-right { gap:var(--s3); }
  .grid-2 { grid-template-columns:1fr; }
  .grid-3 { grid-template-columns:1fr; }

  /* Таблицы — скролл ВНУТРИ карточки, страница не скроллится */
  html, body { overflow-x:hidden; }
  .card--flush { overflow:hidden; }
  .card__body,
  .card--flush .card__body { overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .day-grid { min-width:0; overflow-x:auto; -webkit-overflow-scrolling:touch; }
  /* Таблицы достаточно узкие чтобы влезть */
  .table { font-size:12px; }

  .cal-month { gap:1px; min-width:0; }
  .cal-month__hd { padding:3px 0; font-size:9px; letter-spacing:0; text-align:center; }
  .cal-day { min-height:72px; padding:4px 3px; gap:3px; overflow:hidden; }
  .cal-day__num { font-size:11px; font-weight:700; margin-bottom:2px; }
  /* События — цветные блоки с временем */
  .cal-pill {
    font-size:11px;
    padding:5px 6px;
    line-height:1.3;
  }
  .cal-pill--more {
    color:var(--text-3);
    background:transparent;
  }

  /* td-hide-mobile скрываем */
  .td-hide-mobile { display:none !important; }

  /* Кнопки в topbar — одна высота с бургером (38px) */
  .topbar .btn { height:38px !important; font-size:13px !important; }
  .topbar .btn--primary { height:38px !important; border-radius:10px !important; padding:0 14px !important; }

  /* Burger z-index выше сайдбара */
  #hamburger { position:relative; z-index:calc(var(--z-sidebar) + 10) !important; }

  /* Filters: stack */
  .filters-grid {
    grid-template-columns:1fr 1fr;
    gap:var(--s2);
  }
  .finance-filters-grid { grid-template-columns:170px 170px minmax(220px,1fr); gap:var(--s2); }
  .filter-row { flex-wrap:wrap; }
  .search-input { max-width:100%; }

  /* Schedule toolbar: stack */
  .schedule-toolbar { flex-direction:column; align-items:flex-start; gap:var(--s2); }
  .schedule-toolbar__right { width:100%; gap:var(--s2); }
  #schedule-date { min-width:0; flex:1; }
  .schedule-toolbar__left { flex-wrap:wrap; }
  .legend { flex-wrap:wrap; row-gap:6px; }

  /* Client card layout: single column */
  .client-card-layout { grid-template-columns:1fr; }
  .field-grid { grid-template-columns:1fr 1fr; }

  /* Keep the avatar beside the client's identity at this breakpoint. */
  .bk-summary { gap:var(--s3); }
  .bk-cols { grid-template-columns:1fr; }

  /* Progress rows: shrink label */
  .progress-row { grid-template-columns:100px 1fr 52px; gap:var(--s2); }

  /* Modals: near-full-screen */
  .modal-backdrop { padding:var(--s2); align-items:flex-end; }
  .modal, .modal--sm, .modal--md, .modal--lg {
    max-width:100% !important;
    width:100%;
    max-height:92vh;
    border-radius:var(--r-lg) var(--r-lg) 0 0;
  }
  .modal__body { padding:var(--s4); }
  .modal__header, .modal__footer { padding:var(--s3) var(--s4); }
  .modal__footer { flex-wrap:wrap; gap:var(--s2); }
  .modal__footer-right { margin-left:0; width:100%; justify-content:flex-end; }

  /* Events grid: 1 column */
  .events-grid, [class*="grid-3"], [class*="grid-2"] { grid-template-columns:1fr; }

  /* KPI mini: 2 columns */
  .kpi-mini { grid-template-columns:1fr 1fr; }

  /* Pagination: stack on very small */
  .pagination { flex-direction:column; text-align:center; gap:var(--s2); }

  /* Toast: full width */
  .toast-container { left:var(--s3); right:var(--s3); bottom:var(--s4); }
  .toast { max-width:100%; }
}

/* ===== ≤480px : small phones ===== */
@media (max-width:480px) {
  .stat-row { grid-template-columns:1fr; }
  .stat__value { font-size:20px; }
  .field-grid { grid-template-columns:1fr; }
  .filters-grid { grid-template-columns:1fr; }
  .topbar__title { font-size:13px; overflow:hidden; text-overflow:ellipsis; }
  .topbar { justify-content:flex-start; }
  .topbar__actions { margin-left:auto; }
  .topbar__actions #_sync-btn,
  .topbar__actions .btn--icon { display:none !important; }
  .topbar__primary {
    width:38px; min-width:38px; padding:0 !important;
    font-size:0 !important;
  }
  .topbar__primary > span { display:none; }
  .topbar__primary::before { content:'+'; font-size:24px; font-weight:400; line-height:1; }
  .legend { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 10px; width:100%; }
  .legend__item { min-width:0; }
  .bk-summary { grid-template-columns:40px minmax(0,1fr); gap:var(--s2) var(--s3); }
  .bk-summary > .avatar { width:40px; height:40px; }
  .bk-summary__balance { grid-column:2; text-align:left; }
  .bk-summary__name { font-size:var(--fs-base); }
  /* Hide non-critical topbar items */
  .topbar__actions .btn--icon:not(:first-child) { display:none; }
  /* Pay form: stack vertically on small screens */
  .pay-form { flex-direction:column !important; }
  .pay-form input, .pay-form select, .pay-form button { width:100% !important; min-width:0 !important; }
  .pay-form .input { flex:0 0 auto; }
  /* Log table compact */
  .log-table { font-size:11px; }
  .log-table thead th, .log-table tbody td { padding:6px 6px; }
}

/* Keep the working actions available without letting the mobile header overflow. */
@media (max-width:640px) {
  .topbar { min-width:0; }
  .topbar__heading { min-width:0; overflow:hidden; }
  .topbar__actions { min-width:0; }
  .topbar__actions #_sync-btn,
  .topbar__actions .btn--icon { display:none !important; }
  .topbar__primary {
    width:38px; min-width:38px; padding:0 !important;
    font-size:0 !important; flex-shrink:0;
  }
  .topbar__primary > span {
    display:inline-flex; align-items:center; justify-content:center;
    width:100%; height:100%; font-size:0;
  }
  .topbar__primary > span > i { font-size:18px; line-height:1; }
  .topbar__primary::before { content:none; }
  .finance-filters-grid { grid-template-columns:1fr; }
  .finance-filter-date { width:100%; }
  .finance-filter-client { grid-template-columns:1fr; }
}

/* ===== 769px–1024px : tablet / laptop ===== */
@media (min-width:769px) and (max-width:1024px) {
  /* Hide hamburger */
  #hamburger { display:none !important; }

  /* The full search row crowds primary actions at narrow tablet widths. */
  #_topbar-search-wrap { display:none !important; }

  /* Sidebar: force collapsed to icon-only (regardless of JS state) */
  #sidebar {
    width:60px !important;
    transition:none;
  }
  #sidebar .sidebar__logo-title,
  #sidebar .sidebar__logo-sub,
  #sidebar .nav-item__label,
  #sidebar .sb-section-label,
  #sidebar ._sb-user-name,
  #sidebar ._sb-logout-text,
  #sidebar ._sb-toggle-text { display:none !important; }
  #sidebar .sidebar__logo { padding:14px 0 !important; display:flex !important; justify-content:center !important; }
  #sidebar .nav-item {
    width:40px !important; min-width:40px !important; min-height:40px !important;
    padding:10px 0 !important; margin:0 auto !important; justify-content:center !important;
  }
  #sidebar .nav-item__icon { font-size:18px !important; width:auto !important; }
  #sidebar .sidebar__footer { padding:10px 0 !important; display:flex !important; flex-direction:column !important; align-items:center !important; gap:6px !important; }
  #sidebar ._sb-user-block { padding:6px 0 !important; justify-content:center !important; }
  #sidebar ._sb-logout-btn { width:36px !important; padding:8px !important; justify-content:center !important; }

  /* Main: offset for 60px sidebar */
  #main-content { margin-left:60px !important; }

  /* Toggle button: reposition and hide (let user expand manually on desktop) */
  ._sb-toggle { left:51px; display:none !important; }

  /* KPI: 4-across (enough space at 1024 with 60px sidebar = 964px content) */
  .stat-row { grid-template-columns:repeat(4,1fr); }
  .stat-row--3 { grid-template-columns:repeat(3,1fr); }

  /* Dashboard grid: keep 2-col at 1024 (2fr 1fr) */
  .grid-8-4 { grid-template-columns:2fr 1fr; }
  .grid-8-4 > * { min-width:0; }
  .grid-2 { grid-template-columns:1fr 1fr; }

  /* Wide tables scroll inside their card instead of widening the page. */
  .card--flush { overflow:hidden; }
  .card--flush .card__body { overflow-x:auto; -webkit-overflow-scrolling:touch; }

  /* Content padding */
  .content { padding:var(--s4) var(--s5); }

  /* Filters: 2 cols */
  .filters-grid { grid-template-columns:1fr 1fr auto auto; }
  .finance-filters-grid { grid-template-columns:170px 170px minmax(220px,1fr); }

  /* Client card: single column */
  .client-card-layout { grid-template-columns:1fr; }

  /* Events: 2 columns */
  .events-grid { grid-template-columns:1fr 1fr; }

  /* Modals: add side padding */
  .modal-backdrop { padding:var(--s4); }
  .modal--lg { max-width:96%; }
}

/* ===== ≥769px : ensure hamburger hidden ===== */
@media (min-width:769px) {
  #hamburger { display:none !important; }
}

/* Client flows keep the booking, balance and subscription views in sync. */
.bk-summary__client-link { text-decoration:underline; text-underline-offset:4px; }
.bk-summary__client-link:hover { color:var(--primary); }
.bk-summary__client-link:focus { outline:none; }
.bk-summary__client-link:focus-visible { border-radius:var(--r-sm); box-shadow:var(--sh-focus); }
.client-subscription + .client-subscription { margin-top:var(--s4); padding-top:var(--s4); border-top:1px solid var(--border); }
.client-subscription__name { font-weight:600; margin-bottom:var(--s3); overflow-wrap:anywhere; }
.client-subscription .muted { font-size:var(--fs-small); margin-top:var(--s2); }
.client-subscription__create { margin-top:var(--s4); max-width:100%; }
.subscription-create .subscription-create__body { display:grid; grid-template-columns:minmax(0,1fr); gap:var(--s4); }
.subscription-create__body > * { min-width:0; }
.subscription-create__body > * + * { margin-top:0; }
.subscription-create__terms { padding:var(--s3); border-radius:var(--r-md); background:var(--surface-2); overflow-wrap:anywhere; }
.subscription-create .subscription-create__footer { justify-content:flex-end; flex-wrap:nowrap; }

.fenix-control-panel--select { padding:6px; }
.fenix-control-panel--select .fenix-select-option { display:flex; flex-direction:column; justify-content:center; gap:4px; width:100%; min-width:0; }
.fenix-option-name { min-width:0; overflow-wrap:anywhere; }
.fenix-option-detail { display:block; white-space:nowrap; color:var(--text-2); font-size:var(--fs-sm); font-weight:400; }
.fenix-control__label--detail { display:flex; flex-direction:column; gap:3px; padding:7px 0; }
.fenix-control__label--detail .fenix-option-name { overflow:hidden; text-overflow:ellipsis; }
.fenix-control__trigger--detail { min-height:58px!important; }

.bk-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--sp-3); }
@media (max-width:600px) { .bk-form-grid { grid-template-columns:minmax(0,1fr); } }

.booking-client-picker { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:var(--s3); align-items:center; }
.booking-client-picker .input { min-width:0; overflow-wrap:anywhere; }
@media (max-width:600px) {
  .booking-client-picker { grid-template-columns:1fr 1fr; }
  .booking-client-picker .input { grid-column:1 / -1; }
}
/* Full client history and private action journal. */
.debtor-link { color: inherit; text-decoration: none; border-radius: 10px; }
.debtor-link:hover { background: var(--bg-soft, #f5f0ff); }
.debtor-link:focus-visible { outline: 2px solid var(--purple, #8b5cf6); outline-offset: 2px; }
.history-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 16px; }
.history-table { overflow-x:auto; }
#client-history .history-table { position:relative; isolation:isolate; max-height:480px; overflow-y:auto; }
#client-history .history-table .table thead th { top:0; z-index:2; }
#client-history .history-table .table tbody td { position:relative; z-index:1; }
.client-card-layout > .col-left, .client-card-layout > .col-right { min-width: 0; }
#client-history { min-width: 0; max-width: 100%; }
#client-operations { min-width:0; max-width:100%; }
#client-operations .table thead th { position:static; }
#client-operations .table td:nth-child(2) { white-space:normal; overflow-wrap:anywhere; min-width:200px; }
#client-operations .td-num { white-space:nowrap; }
#client-operations .text-danger { color:var(--danger); }
#client-operations .text-success { color:var(--success); }
.journal-detail-modal { max-width: 720px; }
.journal-detail-modal .table td { white-space: normal; overflow-wrap: anywhere; }
.history-record { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 0; border: 0; background: transparent; color: var(--primary, #7c3aed); font: inherit; text-align: left; cursor: pointer; }
.history-record:hover { text-decoration: underline; }
.history-record:focus-visible { outline: 2px solid #8b5cf6; outline-offset: 3px; border-radius: 4px; }
.history-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; color: var(--text-3); }
.history-pagination > div { display: flex; gap: 8px; }
.history-error { color: #b91c1c; padding: 12px 20px; }
.journal-filters { display: grid; grid-template-columns: minmax(180px, 1fr) 160px 160px auto auto; gap: 12px; align-items: end; }
.journal-filters label { display: grid; gap: 8px; color: var(--text-3); }
.journal-filters .input { width: 100%; min-width: 0; }
.journal-date { white-space: nowrap; }
.journal-details { min-width: 220px; overflow-wrap: anywhere; white-space: normal; }
@media (max-width: 1000px) { .journal-filters { grid-template-columns: 1fr 1fr; } .journal-filters label:first-child { grid-column: 1 / -1; } }
@media (max-width: 480px) { .history-tabs, .history-pagination { padding-left: 12px; padding-right: 12px; } .history-tabs .btn { flex: 1; } .journal-filters { gap: 10px; } .journal-filters .btn { width: 100%; } }

/* Phone overview: all rooms and all seven weekdays fit without sideways scrolling. */
@media (max-width:600px) {
  .content.content--schedule { height:calc(100dvh - 52px); padding:8px; }
  .schedule-view { display:flex; flex:1; flex-direction:column; min-height:0; }
  .schedule-view > .card--flush { display:flex; flex:1; flex-direction:column; min-height:0; }
  .schedule-view > * + * { margin-top:8px; }
  .schedule-toolbar { gap:6px; }
  .schedule-toolbar__left { width:100%; gap:6px; }
  .schedule-toolbar .tabs { padding:2px; }
  .schedule-toolbar .tabs__btn { padding:5px 12px; font-size:12px; }
  .schedule-toolbar .legend { width:100%; gap:4px 12px; font-size:10px; line-height:14px; }
  .schedule-toolbar .legend__item { gap:4px; }
  .schedule-toolbar .legend__dot { width:6px; height:6px; }
  .schedule-toolbar__right { gap:4px; }
  .schedule-group-requests__full { display:none; }
  .schedule-group-requests__short { display:inline; }
  .schedule-toolbar__right .btn { height:32px; padding:0 8px; font-size:12px; }
  #schedule-date { height:32px; padding:0 6px; font-size:12px; }
  .schedule-nav-btn { width:32px; height:32px; }
  .schedule-caption-full { display:none; }
  .schedule-caption-compact { display:inline; }
  .day-grid { min-width:0; width:100%; font-size:9px; }
  .day-grid-shell { --day-slot-height:clamp(13px,calc((100dvh - 208px) / 33),24px); }
  .schedule-view--day .day-grid-shell { scrollbar-gutter:auto; }
  .day-grid thead th { padding:5px 1px; font-size:8px; height:24px; }
  .day-grid thead th:first-child, .day-grid tbody th:first-child { width:34px; padding:0 1px; font-size:8px; }
  .day-grid tbody td { padding:0 1px; }
  .day-cell { min-height:0; padding:4px; border-radius:3px; overflow:hidden; }
  .day-cell-stack .day-cell { width:calc(var(--day-stack-width) - 1px); height:calc(var(--day-slot-height) * var(--day-booking-span) - 1px); }
  .day-cell-stack { height:calc(var(--day-slot-height) * var(--day-slot-span) - 1px); }
  .day-cell__content { gap:2px; }
  .day-cell__meta { height:auto; align-items:flex-start; flex-direction:column; gap:2px; }
  .day-cell__time { font-size:8px; white-space:nowrap; line-height:10px; }
  .day-cell__name { font-size:9px; line-height:11px; }
  .day-cell__room { display:inline-flex; max-width:100%; height:12px; padding:0 3px; font-size:7px; line-height:10px; }
  .day-cell__badge, .day-cell__status { display:none; }
  .month-grid-shell { overflow-x:hidden; overflow-y:auto; min-height:0; }
  .cal-month__hd { font-size:9px; padding:4px 0; }
  .cal-day { min-width:0; min-height:76px; padding:3px 2px; gap:2px; }
  .cal-day__num { font-size:10px; line-height:12px; margin:0; }
  .cal-day > .cal-pill:not(.cal-pill--more):nth-of-type(n+4) { display:none; }
  .cal-pill { font-size:8px; line-height:10px; padding:2px; gap:0; border-radius:3px; min-height:24px; }
  .cal-pill__meta { flex-wrap:nowrap; justify-content:space-between; gap:1px; font-size:8px; line-height:10px; }
  .cal-pill__room { white-space:nowrap; overflow:hidden; }
  .cal-pill__name { font-size:8px; line-height:10px; }
  .cal-pill--more { min-height:14px; padding:0 2px; line-height:14px; }
  .cal-pill--mobile-more { display:flex; }
}

.bk-specialists { display: grid; gap: 8px; margin: 16px 0; }
.bk-specialists > button { justify-self: start; }
.bk-specialists__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bk-specialists__row > a { flex: 1; min-width: 160px; }

@media (max-width: 640px) {
  #client-operations .history-table { overflow-x: visible; }
  #client-operations .table, #client-operations tbody { display: block; width: 100%; }
  #client-operations thead { display: none; }
  #client-operations tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 12px 16px; gap: 6px 12px; border-bottom: 1px solid var(--border); }
  #client-operations td { display: block; padding: 0; border: 0; min-width: 0; }
  #client-operations td:first-child { grid-column: 1 / -1; color: var(--text-muted); }
  #client-operations td:first-child .muted { display: inline; margin-left: 8px; }
  #client-operations td:nth-child(2) { min-width: 0; }
  #client-operations td:nth-child(3) { grid-column: 2; grid-row: 2; }
  #client-operations td:last-child { grid-column: 1 / -1; color: var(--text-muted); }
}

/* Lesson settlement and viewport-safe dialogs, including iOS input zoom. */
html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }
body { touch-action:manipulation; }
@media (max-width:1024px), (hover:none) and (pointer:coarse) {
  /* Inline and widget styles must not reintroduce Safari's focus zoom. */
  input:not([type=checkbox]):not([type=radio]), select, textarea,
  [contenteditable=true], [contenteditable=""] { font-size:16px !important; }
}
.booking-payment-choice { display:grid; gap:8px; margin-bottom:12px; min-width:0; }
.booking-payment-choice > button { justify-self:start; }
.modal { max-height:calc(100dvh - 48px); }
.modal__header { gap:12px; }
.modal__title { min-width:0; overflow-wrap:anywhere; }
@media (max-width: 640px) {
  input:not([type=checkbox]):not([type=radio]), select, textarea, .input { font-size:16px; }
  .modal-backdrop { padding:8px; align-items:center; }
  .modal, .modal--sm, .modal--md, .modal--lg { max-height:calc(100dvh - 16px); border-radius:var(--r-lg); min-width:0; display:flex; flex-direction:column; overflow:hidden; }
  .modal__body, .modal__body > *, .bk-col { min-width:0; }
  .modal__body { overflow:auto; min-height:0; }
  .modal__header, .modal__footer { flex-shrink:0; }
  .modal .pay-form { flex-wrap:wrap; }
  .modal .pay-form > .input { min-width:0 !important; max-width:100%; flex:1 1 100%; }
  .modal__footer-right { flex-wrap:wrap; }
  .modal .btn { min-height:44px; white-space:normal; justify-content:center; }
  .modal .fenix-control__trigger { min-height:44px!important; height:auto; font-size:16px; }
  .modal__close { display:grid; place-items:center; flex:0 0 44px; height:44px; }
  .bk-summary__balance-num { white-space:nowrap; }
  .fenix-control-panel { max-width:calc(100vw - 16px); }
}

/* Client information stays open on desktop; phone actions precede folded sections. */
.client-section { min-width:0; }
.client-section__toggle { display:none; }
@media (max-width:1024px) {
  .client-card-layout > .col-left, .client-card-layout > .col-right { display:contents; }
  .client-card-layout > .col-left > .client-section { order:1; }
  .client-card-layout > .col-right > .client-section { order:2; }
  .client-card-layout .btn { min-height:44px; }
  .client-section { border:1px solid var(--border); border-radius:var(--r-lg); background:var(--surface); overflow:hidden; }
  .client-section__toggle { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:56px; padding:16px 20px; border:0; background:transparent; color:var(--text); font:inherit; font-weight:600; text-align:left; cursor:pointer; }
  .client-section__toggle i { flex:none; transition:transform .15s; }
  .client-section:not(.is-collapsed) .client-section__toggle i { transform:rotate(180deg); }
  .client-section.is-collapsed .client-section__body { display:none; }
  .client-section__body > .card { border:0; border-radius:0; box-shadow:none; }
  .client-section__body .card__header { display:none; }
  #client-history .history-table, #client-operations .history-table { max-height:460px; overflow-y:auto; }
  #client-history table, #client-history tbody, #client-history tr { display:block; width:100%; }
  #client-history thead { display:none; }
  #client-history tr { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px 12px; padding:12px 16px; border-bottom:1px solid var(--border); }
  #client-history td { display:block; padding:0; border:0; white-space:normal; }
  #client-history td:first-child { grid-column:1/-1; }
  #client-history td:nth-child(3) { grid-column:1; }
  #client-history td:nth-child(4) { grid-column:1; }
  #client-history td:last-child { grid-column:2; grid-row:2/5; align-self:start; }
  #client-history .history-record { min-height:44px; text-align:left; white-space:normal; }
  .client-section .history-tabs { gap:6px; padding:0 16px 12px; }
  .client-section .history-pagination { flex-wrap:wrap; gap:12px; }
}

.booking-creation { display:flex; flex-wrap:wrap; gap:4px 10px; margin:var(--s3) 0; font-size:var(--fs-sm); line-height:1.5; overflow-wrap:anywhere; }
.booking-creation h4 { margin:0 0 var(--s1); color:var(--text-2); font-size:var(--fs-sm); }
.bk-summary:has(.bk-summary__attendance) { grid-template-columns:44px minmax(0,1fr) auto; }
.bk-summary__meta > .badge { padding-left:0; background:transparent; }
/* Attendance is a separate, balanced row inside the client summary. */
.bk-summary__attendance { grid-column:1 / -1; grid-row:2; display:flex; align-items:center; gap:12px; padding-top:12px; border-top:1px solid var(--border); }
.bk-summary__attendance h4 { margin:0; }
.bk-summary__attendance .status-toggle { display:flex; gap:8px; padding:0; background:transparent; border-radius:0; }
.bk-summary__attendance .status-toggle button { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-width:112px; min-height:40px; padding:8px 14px; background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md); line-height:20px; }
.bk-summary__attendance .status-toggle button:hover { border-color:var(--primary); }
.bk-summary__attendance .status-toggle button:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.bk-summary__attendance .status-hint { margin:0 0 0 auto; }
.bk-summary:has(.bk-summary__attendance) .bk-summary__balance { grid-column:3; grid-row:1; }
.bk-payment-grid { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:20px; margin-top:16px; align-items:start; }
.bk-payment-actions { min-width:0; }
.bk-payment-actions .pay-form { flex-wrap:wrap; }
.bk-payment-actions .pay-form > .input { width:120px; }
.bk-details { border-top:1px solid var(--border); margin-top:12px; }
.bk-details > summary { cursor:pointer; padding:12px 0; min-height:44px; color:var(--text-2); font-weight:600; }
.bk-details .bk-specialists { margin-top:4px; }
.bk-exchange-preview { margin-top:16px; padding:12px; border-radius:var(--r-md); background:var(--surface-2); }
.modal__body--booking .bk-meta__item:not(.bk-meta__item--price) { display:none; }
.modal__body--booking .bk-meta { margin-bottom:8px; }
@media (max-width:767px) {
  .bk-summary:has(.bk-summary__attendance) { grid-template-columns:40px minmax(0,1fr); }
  .bk-summary__attendance { grid-column:1 / -1; flex-wrap:wrap; gap:8px; }
  .bk-summary__attendance h4 { flex-basis:100%; }
  .bk-summary__attendance .status-toggle { width:100%; }
  .bk-summary__attendance .status-toggle button { flex:1; }
  .bk-summary__attendance .status-hint { margin:0; }
  .bk-summary__attendance .status-toggle button { min-height:44px; display:inline-flex; align-items:center; gap:6px; }
  .bk-payment-grid { grid-template-columns:minmax(0,1fr); gap:12px; }
  .bk-summary__meta { line-height:1.5; }
  .bk-summary__attendance { grid-row:3; }
  .bk-summary:has(.bk-summary__attendance) .bk-summary__balance { grid-column:2; grid-row:2; }
  .modal__footer--booking .modal__footer-right > button:last-child { display:none; }
}
@media (max-width:768px) {
  /* Body overflow-x breaks sticky positioning in Safari; keep navigation fixed. */
  .topbar { position:fixed; left:0; right:0; top:0; width:100%; box-sizing:border-box;
    height:calc(52px + env(safe-area-inset-top, 0px)); padding-top:env(safe-area-inset-top, 0px); }
  #main-content { padding-top:calc(52px + env(safe-area-inset-top, 0px)); }
}

/* Keep the booking date and uninterrupted time range readable on phones. */
.bk-title-slot::before { content:" · "; }
.bk-title-time { white-space:nowrap; }
@media (max-width:767px) {
  .bk-title-date, .bk-title-slot { display:block; }
  .bk-title-slot::before { content:none; }
  .modal__footer--booking .modal__footer-actions { display:flex; flex-wrap:nowrap; width:100%; gap:6px; }
  .modal__footer--booking .modal__footer-actions > .btn { flex:1; min-width:0; padding:10px 6px; gap:4px; font-size:13px; white-space:nowrap; min-height:44px; }
  .modal__footer--booking .bk-action-suffix { display:none; }
}

/* Center reminders */
.reminders { display:grid; gap:20px; min-width:0; }
.reminders h2 { font-size:18px; font-weight:700; margin:0; }
.reminders h3 { font-size:15px; font-weight:600; margin:0; overflow-wrap:anywhere; }
.reminders p { margin:6px 0 0; line-height:1.5; }
.reminder-row { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.reminder-form { display:grid; gap:16px; }
.reminder-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.reminder-field { display:grid; gap:6px; min-width:0; }
.reminder-field .input-label { margin:0; }
.reminder-field textarea { resize:vertical; min-height:72px; }
.reminder-actions, .reminder-tabs { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.reminders .btn { min-height:44px; display:inline-flex; align-items:center; justify-content:center; gap:6px; }
.reminder-list { padding:0; overflow:hidden; }
.reminder-tabs { padding:16px 20px; border-bottom:1px solid var(--border); }
.reminder-item { display:flex; align-items:flex-start; gap:16px; padding:20px; border-bottom:1px solid var(--border); }
.reminder-item:last-child { border-bottom:0; }
.reminder-item__body { flex:1; min-width:0; }
.reminder-item__icon { width:40px; height:40px; flex:0 0 40px; display:grid; place-items:center; color:var(--primary); background:var(--surface-2); border-radius:12px; font-size:22px; }
.reminder-item--overdue { background:#fffaf7; }
.reminder-item--overdue .reminder-item__icon { color:#b45309; background:#ffedd5; }
.reminder-meta { display:flex; flex-wrap:wrap; gap:6px 14px; font-size:12px; color:var(--text-2); margin-top:8px; }
.reminder-overdue { color:#b45309; font-weight:600; }
.reminder-notes { white-space:pre-wrap; overflow-wrap:anywhere; color:var(--text-2); font-size:14px; }
.reminder-push { display:flex; align-items:flex-start; gap:16px; }
.reminder-push > div:last-child { flex:1; min-width:0; }
.reminder-push .reminder-actions { margin-top:16px; }
.reminder-message { display:flex; align-items:center; gap:16px; flex-wrap:wrap; color:var(--text-2); }
.reminder-message--error { border-color:#f5cccc; color:#a32135; }
.reminder-message .btn { margin-left:auto; }
.reminder-list .empty-state { padding:40px 20px; }
.reminder-list .empty-state > .btn { margin-top:16px; }
@media (max-width:767px) {
  .reminder-row { flex-wrap:wrap; gap:12px; }
  .reminder-form-grid { grid-template-columns:minmax(0,1fr); gap:12px; }
  .reminder-item { flex-wrap:wrap; gap:12px; padding:16px; }
  .reminder-item > .reminder-actions { width:100%; padding-left:52px; }
  .reminder-item .btn { padding:8px 10px; font-size:12px; }
  .reminder-push { padding:16px; gap:12px; }
  .reminder-push .reminder-actions { margin-left:-52px; }
  .reminder-message { padding:16px; }
  .reminder-field .input { min-width:0; width:100%; box-sizing:border-box; }
}

/* Subscription history in the client card. */
.client-subscription__open { display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:44px;padding:0;border:0;background:transparent;text-align:left;font:inherit;font-weight:600;color:var(--violet-600);cursor:pointer; }
.client-subscription__open i { flex:none; }
.client-subscription-archive { margin-top:16px; }
.client-subscription-archive summary { cursor:pointer;min-height:44px;display:flex;align-items:center;color:var(--text-2); }
.subscription-history-list { display:grid;gap:12px;margin-top:16px; }
.subscription-history-item { display:grid;gap:6px;min-width:0;padding:16px;border:1px solid var(--border);border-radius:12px;overflow-wrap:anywhere; }
.subscription-history-link { font:inherit;font-weight:600;min-height:44px;border:0;background:transparent;padding:0;cursor:pointer;text-align:left; }
.subscription-history-note { margin-top:16px; }
.subscription-history-link:focus-visible,
.client-subscription__open:focus-visible,
.modal[aria-label="История абонемента"] button:focus-visible { outline:2px solid var(--violet-600);outline-offset:3px; }

/* Compact subscription history with client identity. */
.subscription-history-heading { min-width:0; }
.subscription-history-name { margin:4px 0 0; color:var(--text-2); overflow-wrap:anywhere; }
.subscription-history-modal .modal__close { flex:none; }
.subscription-history-modal .subscription-history-list { gap:8px; margin-top:12px; }
.subscription-history-modal .subscription-history-item { grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:12px; padding:8px 12px; }
.subscription-history-details { min-width:0; }
.subscription-history-modal .subscription-history-link { display:flex; align-items:center; min-height:44px; }
.subscription-history-hours { white-space:nowrap; text-align:right; }
@media (max-width:480px) {
  .subscription-history-modal .subscription-history-item { grid-template-columns:minmax(0,1fr); gap:4px; }
  .subscription-history-hours { text-align:left; }
}

.bk-exchange-fields { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px; align-items:start; }
.bk-exchange-field { min-width:0; display:flex; flex-direction:column; gap:8px; }
.bk-exchange-field > .input-label { margin:0; }
.bk-exchange-field > select.input { width:100%; min-width:0; height:44px; font-size:16px; }
.bk-exchange-preview[hidden] { display:none; }
#room-exchange-comment-wrap:not([hidden]) { display:flex; flex-direction:column; gap:8px; }
@media(max-width:640px) { .bk-exchange-fields { grid-template-columns:minmax(0,1fr); gap:16px; } }

.bk-exchange-field .fenix-control__trigger { height:58px!important; min-height:58px!important; }
