:root {
  color-scheme: light;
  --kvant-bg: #f4f7fb;
  --kvant-surface: #fff;
  --kvant-text: #172033;
  --kvant-muted: #667085;
  --kvant-border: #dfe5ec;
  --kvant-primary: #155eef;
}

.booking-widget-settings { display: grid; gap: 18px; }
.booking-widget-settings .card { background: var(--kvant-surface); border: 1px solid var(--kvant-border); border-radius: 14px; padding: 20px; }
.booking-widget-plan-label { display: flex; justify-content: flex-end; }
.booking-widget-plan-label span { display: inline-flex; align-items: center; min-height: 34px; padding: 7px 13px; border: 1px solid color-mix(in srgb, var(--kvant-primary) 30%, var(--kvant-border)); border-radius: 999px; background: color-mix(in srgb, var(--kvant-primary) 8%, var(--kvant-surface)); color: var(--kvant-primary); font-weight: 700; }
.booking-widget-subscription { background: var(--kvant-surface); border: 1px solid var(--kvant-border); border-radius: 16px; padding: 28px; }
.booking-widget-subscription h2 { margin: 0; }
.booking-widget-subscription__heading { display: flex; align-items: center; gap: 16px; }
.booking-widget-subscription__heading-icon { display: grid; flex: 0 0 58px; height: 58px; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--kvant-primary) 10%, var(--kvant-surface)); color: var(--kvant-primary); font-size: 25px; }
.booking-widget-subscription__heading-text p { margin: 5px 0 0; color: var(--kvant-muted); }
.booking-widget-settings h2 { margin: 0 0 12px; }
.booking-widget-plans { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 20px; margin-top: 36px; }
.booking-widget-plan-option.btn { position: relative; display: grid; min-height: 250px; padding: 40px 18px 24px; gap: 18px; justify-items: center; align-content: center; border-color: var(--kvant-border); border-radius: 16px; background: var(--kvant-surface); box-shadow: 0 7px 20px rgb(16 24 40 / 8%); text-align: center; white-space: normal; }
.booking-widget-plan-option.btn:hover { border-color: color-mix(in srgb, var(--kvant-primary) 55%, var(--kvant-border)); background: color-mix(in srgb, var(--kvant-primary) 2%, var(--kvant-surface)); }
.booking-widget-plan-option.btn.is-popular { border: 2px solid color-mix(in srgb, var(--kvant-primary) 72%, white); }
.booking-widget-plan-option__period { color: var(--kvant-muted); font-size: 18px; font-weight: 600; line-height: 1.2; }
.booking-widget-plan-option__total { color: var(--kvant-text); font-size: clamp(24px, 2.4vw, 34px); font-weight: 800; line-height: 1.1; }
.booking-widget-plan-option__period-total { color: var(--kvant-muted); font-size: 13px; font-weight: 500; line-height: 1.3; }
.booking-widget-plan-option__saving { display: inline-flex; min-height: 32px; align-items: center; padding: 6px 12px; border-radius: 999px; background: #ecfdf3; color: #067647; font-size: 13px; font-weight: 700; line-height: 1.2; }
.booking-widget-plan-option__saving.is-empty { min-width: 72px; justify-content: center; background: #f2f4f7; color: #98a2b3; }
.booking-widget-plan-option__popular { position: absolute; top: 12px; left: 50%; display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; transform: translateX(-50%); border-radius: 9px; background: var(--kvant-primary); box-shadow: 0 5px 12px color-mix(in srgb, var(--kvant-primary) 28%, transparent); color: #fff; font-size: 13px; font-weight: 700; }
.booking-widget-benefit { position: relative; display: grid; min-height: 126px; grid-template-columns: auto minmax(0, 1fr) 230px; align-items: center; gap: 20px; overflow: hidden; margin-top: 32px; padding: 20px 28px; border-radius: 14px; background: linear-gradient(100deg, color-mix(in srgb, var(--kvant-primary) 8%, var(--kvant-surface)), color-mix(in srgb, var(--kvant-primary) 3%, var(--kvant-surface))); }
.booking-widget-benefit__icon { display: grid; width: 62px; height: 62px; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--kvant-primary) 12%, var(--kvant-surface)); color: var(--kvant-primary); font-size: 28px; }
.booking-widget-benefit__text { position: relative; z-index: 1; }
.booking-widget-benefit__text strong { color: var(--kvant-primary); font-size: 21px; }
.booking-widget-benefit__text p { max-width: 520px; margin: 7px 0 0; color: var(--kvant-muted); line-height: 1.45; }
.booking-widget-benefit__image { position: absolute; right: 8px; width: 245px; height: 138px; object-fit: contain; mix-blend-mode: multiply; }
.msweb-sidebar-nav .nav-link--booking-widget-attention { margin: 3px 6px; padding-right: 9px; border: 1px solid #22a447; border-radius: 9px; background: transparent; color: var(--msweb-sidebar-nav-link-color, #374151); }
.msweb-sidebar-nav .nav-link--booking-widget-attention:hover { background: var(--msweb-sidebar-nav-link-hover-bg, #f9fafb); }
.msweb-sidebar-nav .nav-link--booking-widget-attention .nav-link__icon { color: var(--msweb-sidebar-nav-icon-color, #9ca3af); }
.msweb-sidebar-nav .nav-link__attention-icon { flex: 0 0 auto; margin-left: auto; color: var(--kvant-primary); font-size: 13px; }
.msweb-sidebar-nav--collapsed .nav-link--booking-widget-attention { margin-inline: 5px; padding: 9px; }
.msweb-sidebar-nav--collapsed .nav-link__attention-icon { display: none; }
.ai-integration-benefit { position: relative; display: grid; min-height: 150px; grid-template-columns: auto minmax(0, 1fr) 230px; align-items: center; gap: 20px; overflow: hidden; margin-bottom: 24px; padding: 22px 28px; border-radius: 14px; background: linear-gradient(100deg, color-mix(in srgb, var(--kvant-primary) 9%, var(--kvant-surface)), color-mix(in srgb, var(--kvant-primary) 3%, var(--kvant-surface))); }
.ai-integration-benefit__icon { display: grid; width: 62px; height: 62px; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--kvant-primary) 12%, var(--kvant-surface)); color: var(--kvant-primary); font-size: 28px; }
.ai-integration-benefit__text { position: relative; z-index: 1; }
.ai-integration-benefit__text strong { color: var(--kvant-primary); font-size: 21px; }
.ai-integration-benefit__text p { max-width: 690px; margin: 7px 0 14px; color: var(--kvant-muted); line-height: 1.45; }
.ai-integration-benefit__action { width: max-content; }
.ai-integration-benefit__image { position: absolute; right: 14px; width: 200px; height: 150px; object-fit: contain; }
.booking-widget-editor__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 18px 0; }
.booking-widget-field.is-wide { grid-column: 1 / -1; }
.booking-widget-preview { display: grid; place-items: center; min-height: 150px; margin: 18px 0; border-radius: 12px; background: repeating-linear-gradient(45deg, #f3f6fa, #f3f6fa 12px, #e9eef5 12px, #e9eef5 24px); }
.booking-widget-embed code { display: block; overflow-wrap: anywhere; margin: 12px 0; padding: 14px; border-radius: 8px; background: #0f172a; color: #e2e8f0; }
@media (max-width: 700px) {
  .booking-widget-editor__grid { grid-template-columns: 1fr; }
  .booking-widget-field.is-wide { grid-column: 1; }
  .booking-widget-plans { grid-template-columns: 1fr; }
  .booking-widget-subscription { padding: 18px; }
  .booking-widget-plan-option.btn { min-height: 190px; }
  .booking-widget-benefit { grid-template-columns: auto minmax(0, 1fr); padding: 18px; }
  .booking-widget-benefit__image { display: none; }
  .ai-integration-benefit { grid-template-columns: auto minmax(0, 1fr); padding: 18px; }
  .ai-integration-benefit__image { display: none; }
}
@media (max-width: 560px) {
  .ai-integration-benefit { grid-template-columns: 1fr; }
  .ai-integration-benefit__icon { width: 52px; height: 52px; font-size: 23px; }
}
@media (min-width: 701px) and (max-width: 980px) {
  .booking-widget-plans { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
}
.booking-widget-editor-layout { min-width: 0; }
.msweb-ui.responsive-split-view.booking-widget-settings-split-view { --responsive-split-view-primary: minmax(0,1fr); --responsive-split-view-secondary: minmax(0,1fr); align-items:start; }
.booking-widget-editor,.booking-widget-preview-panel { min-width:0; }
.widget-launcher-settings { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 16px; margin:12px 0; }
.widget-launcher-settings [hidden] { display:none !important; }
.widget-launcher-setting-group { min-width:0; padding-block:12px; }
.widget-launcher-setting .label { display:block; margin:0; color:inherit; font:inherit; font-size:16px; font-weight:600; line-height:1.35; }
.widget-launcher-settings__card-field,.widget-launcher-settings__position { grid-column:1/-1; container-type:inline-size; }
.widget-launcher-radio-cards--compact .radio-option-wrapper { padding:6px; border-radius:9px; }
.msweb-ui .widget-launcher-radio-cards--compact .radio-options-container { gap:4px; }
.widget-launcher-radio-cards--compact .radio-option-preview { width:min(50%,42px); }
.widget-launcher-radio-cards--compact .radio-option-wrapper>span:last-child { font-size:11px; }
.widget-launcher-option-preview { position:relative; display:grid; width:100%; height:100%; place-items:center; }
.widget-launcher-option-preview--icon svg { width:72%; height:72%; }
.widget-launcher-position-cards .radio-option-wrapper { min-width:0; padding:7px; }
.msweb-ui .widget-launcher-position-cards .radio-option-preview { width:min(98%,58px); max-width:100%; aspect-ratio:1; }
.widget-launcher-position-cards .radio-option-wrapper>span:last-child { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.widget-launcher-position-point { position:absolute; width:6px; height:6px; border-radius:50%; background:#cbd5e1; }
.widget-launcher-position-point.is-active { background:#111827; }
.widget-launcher-position-point[data-position="top-left"]{top:0;left:0}.widget-launcher-position-point[data-position="top-center"]{top:0;left:50%;transform:translateX(-50%)}.widget-launcher-position-point[data-position="top-right"]{top:0;right:0}.widget-launcher-position-point[data-position="middle-left"]{top:50%;left:0;transform:translateY(-50%)}.widget-launcher-position-point[data-position="middle-right"]{top:50%;right:0;transform:translateY(-50%)}.widget-launcher-position-point[data-position="bottom-left"]{bottom:0;left:0}.widget-launcher-position-point[data-position="bottom-center"]{bottom:0;left:50%;transform:translateX(-50%)}.widget-launcher-position-point[data-position="bottom-right"]{right:0;bottom:0}
.widget-launcher-option-preview--preset { overflow:hidden; border:1px solid rgb(148 163 184/45%); border-radius:7px; }
.widget-launcher-option-preview--preset[data-value="default"]{background:linear-gradient(135deg,#2563eb,#60a5fa)}.widget-launcher-option-preview--preset[data-value="ocean"]{background:linear-gradient(135deg,#0369a1,#22d3ee)}.widget-launcher-option-preview--preset[data-value="emerald"]{background:linear-gradient(135deg,#047857,#34d399)}.widget-launcher-option-preview--preset[data-value="violet"]{background:linear-gradient(135deg,#6d28d9,#c084fc)}.widget-launcher-option-preview--preset[data-value="sunset"]{background:linear-gradient(135deg,#ea580c,#fbbf24)}.widget-launcher-option-preview--preset[data-value="graphite"]{background:linear-gradient(135deg,#1e293b,#64748b)}
.widget-launcher-option-preview--side,.widget-launcher-option-preview--anchor { border:1px solid #cbd5e1; border-radius:6px; background:#f8fafc; }
.widget-launcher-option-preview--side::before,.widget-launcher-option-preview--anchor::before { content:""; position:absolute; border-radius:3px; background:#3975c1; }
.widget-launcher-option-preview--side[data-value="left"]::before{inset:14% auto 14% 0;width:18%}.widget-launcher-option-preview--side[data-value="right"]::before{inset:14% 0 14% auto;width:18%}.widget-launcher-option-preview--side[data-value="top"]::before{inset:0 14% auto;height:18%}.widget-launcher-option-preview--side[data-value="bottom"]::before{inset:auto 14% 0;height:18%}
.widget-launcher-option-preview--anchor::before{width:22%;aspect-ratio:1;border-radius:50%}.widget-launcher-option-preview--anchor[data-value="top"]::before{top:8%;left:39%}.widget-launcher-option-preview--anchor[data-value="bottom"]::before{bottom:8%;left:39%}.widget-launcher-option-preview--anchor[data-value="left"]::before{left:8%;top:39%}.widget-launcher-option-preview--anchor[data-value="right"]::before{right:8%;top:39%}
.widget-launcher-color { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:48px; padding:8px 12px; border:1px solid var(--kvant-border); border-radius:10px; }
.widget-launcher-color input[type="color"] { width:54px; height:34px; padding:3px; border:1px solid #cbd5e1; border-radius:7px; background:#fff; cursor:pointer; }
.widget-settings-preview__header { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:10px; margin-bottom:16px; }
.widget-settings-preview__detach { white-space:nowrap; }
@media (max-width:700px) {
  .widget-settings-preview__header { align-items:stretch; }
  .widget-settings-preview__detach { width:100%; white-space:normal; }
}
.booking-widget-preview { min-height:520px; margin:0; overflow:hidden; }
.booking-widget-runtime-preview { position:relative; width:100%; max-width:100%; margin:0 auto; overflow:hidden; background:transparent; }
.booking-widget-runtime-preview__frame { position:absolute; top:0; left:50%; display:block; width:1100px; border:0; background:transparent; transform-origin:top center; }
@media (min-width:981px){.booking-widget-settings-split-view .responsive-split-view__panel--secondary{position:sticky;top:24px;align-self:start}}
@container (min-width:400px) and (max-width:599px){.msweb-ui .widget-launcher-radio-cards--presets .radio-options-container{grid-template-columns:repeat(3,minmax(0,1fr))}.msweb-ui .widget-launcher-radio-cards--icons .radio-options-container{grid-template-columns:repeat(3,minmax(0,1fr))}}
@container (max-width:399px){.msweb-ui .widget-launcher-radio-cards--compact .radio-options-container{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:980px){.widget-launcher-settings{grid-template-columns:1fr}.booking-widget-preview{min-height:460px}}

[data-theme="dark"] {
  color-scheme: dark;
  --kvant-bg: #0f172a;
  --kvant-surface: #111827;
  --kvant-text: #e5e7eb;
  --kvant-muted: #94a3b8;
  --kvant-border: #334155;
  --kvant-primary: #60a5fa;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--kvant-bg); color: var(--kvant-text); font-family: Inter, Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); padding: 40px; border: 1px solid var(--kvant-border); border-radius: 20px; background: var(--kvant-surface); text-align: center; box-shadow: 0 18px 50px rgb(16 24 40 / 8%); }
.login-card h1 { margin: 18px 0 8px; letter-spacing: .08em; }
.login-card p { margin: 0 0 28px; color: var(--kvant-muted); line-height: 1.5; }
.brand-logo { display: block; width: 38px; height: 38px; object-fit: contain; }
.brand-logo--login { width: 72px; height: 72px; margin: 0 auto; }
.booking-company-setting { display: grid; gap: 16px; max-width: 520px; margin-bottom: 24px; }
.booking-company-setting .form-group { min-width: 0; margin: 0; }
.booking-company-setting .input-wrapper,.booking-company-setting input { width: 100%; }
.booking-company-setting .label,.booking-logo-setting__label { font-weight: 700; }
.booking-logo-setting__label { margin-bottom: 8px; }
.booking-logo-setting { display: grid; grid-template-columns: 160px minmax(0, 520px); gap: 18px; align-items: start; margin-bottom: 24px; }
.booking-logo-setting__preview { display: grid; place-items: center; width: 160px; height: 96px; border-radius: 12px; object-fit: contain; background: transparent; color: #fff; font-size: 34px; font-weight: 700; }
.booking-logo-setting__preview.is-placeholder { width: 96px; border-radius: 50%; background: var(--surface-muted, #e5e7eb); color: var(--text-muted, #667085); }
.booking-logo-setting > div { display: grid; gap: 10px; }
@media (max-width: 640px) { .booking-logo-setting { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; } .booking-logo-setting__preview { width: 96px; height: 64px; font-size: 24px; } .booking-logo-setting__preview.is-placeholder { width: 64px; } }
.resource-avatar-control { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: start; width: 100%; }
.resource-avatar-control__preview { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: #dbeafe; color: #155eef; font-size: 34px; font-weight: 700; }
.resource-avatar-control__preview.is-placeholder { background: var(--surface-muted, #e5e7eb); color: var(--text-muted, #667085); }
.resource-avatar-control__controls { display: grid; gap: 10px; min-width: 0; }
.resource-avatar-control__controls > .msweb-ui.btn { justify-self: start; }
.resource-table-avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #dbeafe; color: #155eef; font-size: 14px; font-weight: 700; }
.resource-table-avatar.is-placeholder { background: var(--surface-muted, #e5e7eb); color: var(--text-muted, #667085); }
.employee-invitation-result { display: grid; gap: 16px; text-align: center; }
.employee-invitation-result p { margin: 0; font-weight: 600; }
.employee-invitation-result > .msweb-ui.input { width: 100%; }
.employee-invitation-result > div:last-child { display: flex; justify-content: center; }
@media (max-width: 640px) { .resource-avatar-control { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; } .resource-avatar-control__preview { width: 64px; height: 64px; font-size: 24px; } }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); transition: grid-template-columns .2s ease; }
.app-shell.app-shell--sidebar-collapsed { grid-template-columns: 56px minmax(0, 1fr); }
#sidebar { --msweb-sidebar-shell-width: 248px; --msweb-sidebar-shell-height: 100vh; --msweb-sidebar-shell-margin: 0; --msweb-sidebar-shell-radius: 0; grid-column: 1; grid-row: 1; position: sticky; top: 0; gap: 20px; padding: 20px 14px; }
#sidebar.msweb-sidebar-shell--collapsed { padding-inline: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: inherit; letter-spacing: .08em; text-decoration: none; }
.organization-picker { display: grid; gap: 6px; color: var(--kvant-muted); font-size: 12px; }
.organization-picker .select-component-wrapper { width: 100%; }
#sidebar .msweb-sidebar-nav { width: 100%; height: auto; min-height: 0; }
.sidebar-footer { margin-top: auto; display: grid; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--kvant-border); color: var(--kvant-muted); font-size: 13px; }
.sidebar-footer__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-profile-btn { width: 38px; height: 38px; padding: 4px; }
#sidebar.msweb-sidebar-shell--collapsed .brand { justify-content: center; padding-inline: 0; }
#sidebar.msweb-sidebar-shell--collapsed .app-title,
#sidebar.msweb-sidebar-shell--collapsed .organization-picker,
#sidebar.msweb-sidebar-shell--collapsed .sidebar-user__name,
#sidebar.msweb-sidebar-shell--collapsed .sidebar-footer > :not(.sidebar-footer__row):not(.support-actions) { display: none; }
#sidebar.msweb-sidebar-shell--collapsed .sidebar-footer { padding-inline: 0; }
#sidebar.msweb-sidebar-shell--collapsed .sidebar-footer__row { flex-direction: column; }

.main { grid-column: 2; grid-row: 1; min-width: 0; padding: 24px; }
.impersonation-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; padding: 12px 16px; border: 1px solid #f2c96f; border-radius: 12px; background: #fff4cf; color: #694f00; }
.impersonation-banner strong { display: block; }
.impersonation-banner span { font-size: 13px; }
.demo-mode-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; padding: 12px 16px; border: 1px solid #93c5fd; border-radius: 12px; background: #eff6ff; color: #1e3a5f; }
.demo-mode-banner__message { display: flex; flex-wrap: wrap; gap: 4px 10px; min-width: 0; font-size: 13px; }
.demo-mode-banner__message strong { white-space: nowrap; }
.demo-mode-banner__actions { display: flex; flex: 0 0 auto; gap: 8px; }
.demo-ownership-modal__frame { display: block; width: 100%; height: 360px; border: 0; }
.demo-ownership-choice-modal .modal-wide > h3 { font-size: 24px; line-height: 1.2; }
.crm-setup-notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--kvant-primary) 35%, var(--kvant-border)); border-radius: 14px; background: color-mix(in srgb, var(--kvant-primary) 8%, var(--kvant-surface)); }
.crm-setup-notice__content { display: grid; gap: 5px; }
.crm-setup-notice__content span { color: var(--kvant-muted); font-size: 14px; line-height: 1.45; }
.crm-setup-notice__action { flex: 0 0 auto; }
.smtp-help { display: grid; gap: 14px; color: var(--kvant-text); font-size: 14px; line-height: 1.55; }
.smtp-help p, .smtp-help h3, .smtp-help ol { margin: 0; }
.smtp-help ol { display: grid; gap: 10px; padding-left: 22px; }
.smtp-help__note { padding: 12px 14px; border-radius: 10px; background: var(--kvant-bg); color: var(--kvant-muted); }
.certificate-mail-editor-page__smtp-actions, .certificate-mail-editor-page__template-actions { gap: 10px; justify-content: flex-start; }
.certificate-mail-editor-page__smtp-actions:not([hidden]) { display: flex; }
.certificate-mail-editor-page__template-actions { display: flex; }
.certificate-mail-editor-page__smtp-toggle { display: flex; align-items: center; gap: 12px; }
.certificate-mail-editor-page__smtp-toggle .form-group { margin: 0; }
.certificate-mail-editor-page__help-link.btn { min-width: 0; height: auto; padding: 0; border: 0; background: transparent; box-shadow: none; color: var(--kvant-primary); text-decoration: underline; }
.certificate-mail-editor-page__help-link.btn:hover { background: transparent; box-shadow: none; text-decoration: none; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-header h1 { margin: 0; font-size: 26px; }
.page-header p { margin: 5px 0 0; color: var(--kvant-muted); }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric { padding: 18px; border: 1px solid var(--kvant-border); border-radius: 14px; background: var(--kvant-surface); }
.metric strong { display: block; margin-top: 7px; font-size: 26px; }
.metric span { color: var(--kvant-muted); font-size: 13px; }
.page-content { min-width: 0; }
.app-shell--schedule .schedule-calendar__viewport { max-height: none; }
.app-shell--schedule .metrics {
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 10px;
}
.app-shell--schedule .metrics > .branch-context { margin-bottom: 0; }
.app-shell--schedule .metrics > .branch-context .select-component-wrapper {
  width: clamp(250px, 22vw, 340px);
}
.app-shell--schedule .metrics > .branch-context .select2-container {
  width: 100% !important;
  margin-bottom: 0;
}
.app-shell--schedule .metric,
.schedule-resource-filter {
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--kvant-border);
  border-radius: 10px;
  background: var(--kvant-surface);
}
.schedule-view-filter { display: grid; gap: 6px; min-width: 230px; padding: 7px 10px; border: 1px solid var(--kvant-border); border-radius: 10px; background: var(--kvant-surface); }
.app-shell--schedule .metric { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.app-shell--schedule .metric strong { margin: 0; font-size: 20px; line-height: 1; }
.app-shell--schedule .metric span,
.schedule-resource-filter__label { font-size: 12px; }
.schedule-resource-filter { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.schedule-resource-filter__label { color: var(--kvant-muted); }
.schedule-resource-filter__control,
.schedule-resource-filter .select-component-wrapper { min-width: 0; width: 100%; }
.schedule-resource-filter__toggle { white-space: nowrap; }
.schedule-resource-filter__toggle .toggle-label-text { font-size: 12px; }
.panel { overflow: hidden; border: 1px solid var(--kvant-border); border-radius: 14px; background: var(--kvant-surface); }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--kvant-border); }
.panel-header h2 { margin: 0; font-size: 16px; }
.app-shell--certificates .page-content { gap: 12px; }
.certificate-actions { flex-wrap: wrap; justify-content: flex-end; }
.certificate-mail-split-view { --responsive-split-view-primary: minmax(360px, .9fr); --responsive-split-view-secondary: minmax(420px, 1.1fr); align-items: start; }
.certificate-mail-editor-page { display: grid; gap: 14px; min-width: 0; }
.certificate-mail-editor-page__section { display: grid; gap: 14px; padding: 18px; overflow: visible; }
.certificate-mail-editor-page__title { margin: 0; font-size: 18px; }
.certificate-mail-editor-page__smtp-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.certificate-mail-editor-page__smtp-fields .checkbox { grid-column: 1 / -1; }
.certificate-mail-editor-page__smtp-fields [hidden] { display: none !important; }
.gift-mail-preview-pane { min-width: 0; position: sticky; top: 12px; }
.gift-mail-preview-pane__subject { margin-bottom: 12px; color: var(--kvant-text); font-size: 16px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.gift-mail-preview-pane__status { color: var(--kvant-muted); }
.gift-mail-preview-pane__error { padding: 14px; border: 1px solid #f3b4b4; border-radius: 10px; background: #fff1f1; color: #a21d1d; overflow-wrap: anywhere; }
.gift-mail-preview-pane__frame { display: block; width: 100%; height: auto; min-height: 520px; overflow: hidden; border: 1px solid var(--kvant-border); border-radius: 12px; background: #fff; }
.list { display: grid; }
.list-row { display: grid; grid-template-columns: minmax(160px, 1.5fr) repeat(3, minmax(110px, 1fr)); gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--kvant-border); }
.list-row--admin { grid-template-columns: minmax(180px, 1.4fr) minmax(180px, 1fr) 100px minmax(150px, 1fr) 140px; }
.list-row:last-child { border-bottom: 0; }
.booking-settings-list .list-row { grid-template-columns: minmax(220px, 1fr) minmax(180px, 1fr); }
.settings-tab-content { padding-top: 14px; }
.settings-section { display: grid; gap: 12px; }
.branch-context { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.branch-context__label { color: var(--kvant-muted); font-size: 13px; white-space: nowrap; }
.branch-context .select-component-wrapper { width: min(420px, 100%); min-width: 180px; }
.branch-context .select2-container { min-width: 180px; }
.settings-section__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-section__header h2 { margin: 0; font-size: 18px; }
.list-row small, .muted { color: var(--kvant-muted); }
.empty-state { padding: 44px 20px; color: var(--kvant-muted); text-align: center; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.form-section-title { grid-column: 1 / -1; margin: 10px 0 0; padding-top: 18px; border-top: 1px solid var(--kvant-border); color: var(--kvant-text); font-size: 16px; }
.dialog-form .form-group { display: grid; gap: 6px; min-width: 0; color: var(--kvant-muted); font-size: 13px; }
.dialog-form .select-component-wrapper, .dialog-form .select2-container { min-width: 0; max-width: 100%; width: 100% !important; }
.dialog-form [data-field-name="service_ids"] .select-component-wrapper.msweb-ui.ui-component .select2-container--default .select2-selection--multiple {
  min-height: 152px;
  max-height: 152px;
}
.resource-services-summary { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.field--full { grid-column: 1 / -1; }
.dialog-form .form-group input:not([type="checkbox"]):not([type="radio"]), .dialog-form .form-group select, .dialog-form .form-group textarea { width: 100%; min-height: 40px; border: 1px solid var(--kvant-border); border-radius: 9px; padding: 9px 11px; background: var(--kvant-surface); color: var(--kvant-text); }
.role-editor > .form-group { width: 100%; }
.role-permission-matrix-wrap { max-width: 100%; overflow: auto; border: 1px solid var(--kvant-border); border-radius: 10px; }
.role-permission-matrix { width: 100%; min-width: 680px; border-collapse: separate; border-spacing: 0; background: var(--kvant-surface); }
.role-permission-matrix th, .role-permission-matrix td { padding: 10px 14px; border-bottom: 1px solid var(--kvant-border); text-align: center; vertical-align: middle; }
.role-permission-matrix thead th { position: sticky; top: 0; z-index: 1; background: var(--kvant-bg); color: var(--kvant-muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.role-permission-matrix th:first-child { min-width: 190px; text-align: left; }
.role-permission-matrix tbody th { color: var(--kvant-text); font-size: 13px; font-weight: 500; }
.role-permission-matrix tbody tr:last-child > * { border-bottom: 0; }
.role-permission-matrix__checkbox { display: inline-flex; align-items: center; justify-content: center; margin: 0; }
.role-permission-matrix__checkbox > span { display: none; }
.role-permission-matrix__empty { color: var(--kvant-muted); }
.role-editor__section-title { margin-top: 4px; color: var(--kvant-text); font-size: 14px; font-weight: 600; }
.role-agent-actions { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--kvant-border); border-radius: 10px; background: var(--kvant-surface); }
.dialog-form .form-group textarea { min-height: 80px; resize: vertical; }
.form-field-action { display: flex; justify-content: flex-start; margin-top: 2px; }
.form-field-control-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: stretch; min-width: 0; }
.form-field-control-row .select-component-wrapper { min-width: 0; }
.form-field-action--inline { margin: 0; }
.form-field-action--inline .btn { height: 100%; min-width: 40px; }
.dialog-form { display: grid; gap: 14px; min-width: 0; }
.duration-override-control { display: grid; grid-template-columns: repeat(3, minmax(70px, 1fr)); gap: 8px; }
.duration-override-control > label { display: grid; gap: 4px; color: var(--kvant-muted); font-size: 11px; }
.modal-body > .dialog-form { padding-top: 12px; }
.resource-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.api-token { overflow-wrap: anywhere; padding: 12px; border-radius: 9px; background: #f2f4f7; font-family: monospace; }
.form-template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-template-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; border: 1px solid var(--kvant-border); border-radius: 14px; background: var(--kvant-surface); }
.form-template-card h2 { margin: 0; font-size: 16px; }
.form-template-card p { margin: 5px 0 0; color: var(--kvant-muted); font-size: 13px; }
.page-action-group { display: flex; gap: 8px; }
.catalog-import__help { display: grid; gap: 10px; margin-bottom: 18px; padding: 14px 16px; border: 1px solid var(--kvant-border); border-radius: 10px; background: var(--kvant-surface); }
.msweb-ui.modal-wide .catalog-import__help h3 { margin: 0; padding: 0; font-size: 16px; }
.catalog-import__help ol { display: grid; gap: 6px; margin: 0; padding-left: 20px; color: var(--kvant-muted); font-size: 13px; line-height: 1.45; }
.catalog-import__templates { flex-wrap: wrap; }
.lead-intake { display: grid; gap: 16px; }
.lead-intake__section { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--kvant-border); border-radius: 12px; background: var(--kvant-surface); }
.msweb-ui.modal-wide .lead-intake__section h3 { margin: 0; padding: 0; font-size: 16px; }
.lead-intake__client-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.lead-intake__client-row .select-component-wrapper { min-width: 0; width: 100%; }
.lead-intake__section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lead-intake__section-header p { margin: 3px 0 0; font-size: 12px; }
.lead-intake__items { display: grid; gap: 10px; }
.lead-intake__item-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px 40px; gap: 8px; align-items: end; }
.lead-intake__item-row .form-group { margin: 0; }
.lead-intake__item { display: grid; gap: 3px; min-width: 0; }
.lead-intake__item > span { color: var(--kvant-muted); font-size: 13px; }
.lead-intake__item > strong, .lead-intake__item > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-intake__remove { padding-bottom: 1px; }
.lead-intake__remove .btn { width: 40px; min-width: 40px; height: 40px; padding: 0; }
.lead-intake__total { font-weight: 600; text-align: right; }
.lead-view { display: grid; gap: 12px; padding-top: 12px; min-width: 0; }
.lead-view__client { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px; border-radius: 12px; background: var(--kvant-surface); }
.lead-view__client-info, .lead-view__item-body { display: grid; gap: 4px; min-width: 0; }
.lead-view__label { color: var(--kvant-muted); font-size: 12px; }
.lead-view__client-name { overflow-wrap: anywhere; font-size: 18px; }
.lead-view__phone { overflow-wrap: anywhere; font-size: 16px; }
.lead-view__client-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.lead-view__item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--kvant-border); }
.lead-view__item--multiline { align-items: start; }
.lead-view__value { overflow-wrap: anywhere; color: var(--kvant-text); line-height: 1.5; white-space: pre-wrap; }
.lead-view__copy { min-width: 112px; }
.lead-view > .btn:last-child { justify-self: end; margin-top: 4px; }
.lead-item-picker { display: grid; grid-template-rows: minmax(320px, 1fr) auto; gap: 16px; min-height: min(640px, 70vh); }
.lead-item-picker__catalog { min-height: 0; padding: 0; }
.lead-item-picker__selected { display: grid; gap: 10px; min-height: 150px; padding: 14px; border: 1px solid var(--kvant-border); border-radius: 12px; background: var(--kvant-surface); }
.msweb-ui.modal-wide .lead-item-picker__selected h3 { margin: 0; padding: 0; font-size: 16px; }
.lead-item-picker__selected-list { display: grid; gap: 8px; max-height: 210px; overflow-y: auto; overscroll-behavior: contain; }
.lead-item-picker__selected-list .empty-state { padding: 28px 16px; }
.lead-item-picker__selected-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 40px; gap: 8px; align-items: center; }
.lead-item-picker__selected-name { display: grid; gap: 2px; min-width: 0; }
.lead-item-picker__selected-name > strong, .lead-item-picker__selected-name > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-item-picker__selected-row .btn { width: 40px; min-width: 40px; height: 40px; padding: 0; }
.resource-tab-content { display: grid; gap: 14px; padding-top: 14px; }
.entity-explanation { margin: 0; color: var(--kvant-muted); }
.data-table-shell { min-width: 0; padding: 0 14px 14px; }
.data-table-host { min-width: 0; }

.data-table-shell--controls-right .dt-topbar > .dt-controls-length {
  margin-left: auto;
}

.data-table-shell--controls-right .dt-topbar > .dt-controls-search {
  margin-left: 0;
}

.dt-topbar:has(> .dt-controls-custom--start) {
  align-items: center;
  flex-wrap: wrap;
}

.dt-topbar:has(> .dt-controls-custom--start) > .dt-controls-custom--start {
  display: flex;
  align-items: center;
  gap: 10px;
  order: 1;
  flex: 0 0 auto;
  width: auto;
  margin-right: auto;
}

.dt-controls-custom--start > .branch-context { margin-bottom: 0; }
.dt-controls-custom--start > .branch-context .select-component-wrapper {
  width: clamp(240px, 24vw, 360px);
  max-width: 100%;
}
.dt-controls-custom--start > .branch-context .select2-container { margin-bottom: 0; }

.dt-topbar:has(> .dt-controls-custom--start) > .dt-controls-length {
  order: 2;
  flex: 0 0 auto;
  width: auto;
  margin-left: auto;
}

.dt-topbar:has(> .dt-controls-custom--start) > .dt-controls-search {
  order: 3;
  flex: 0 0 260px;
  width: 260px;
  margin-left: 0;
}

@media (max-width: 680px) {
  .schedule-resource-filter {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .schedule-resource-filter__toggle {
    justify-self: start;
  }

  .dt-topbar:has(> .dt-controls-custom--start) > .dt-controls-custom--start {
    flex: 0 0 auto;
    width: 100%;
    margin-right: 0;
  }

  .dt-topbar:has(> .dt-controls-custom--start) > .dt-controls-length {
    margin-left: 0;
  }

  .dt-controls-custom--start > .branch-context .select-component-wrapper {
    width: 100%;
  }
}

.app-shell--data-table {
  height: 100dvh;
  min-height: 0;
}
.app-shell--data-table .main {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 0;
}
.app-shell--data-table .page-header,
.app-shell--data-table .impersonation-banner,
.app-shell--data-table #setupNotice,
.app-shell--data-table .branch-context,
.app-shell--data-table .metrics {
  flex: 0 0 auto;
}
.app-shell--data-table .page-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}
.app-shell--data-table .data-table-shell {
  flex: 1 1 auto;
  min-height: 0;
}
.app-shell--data-table .page-content > .panel:has(.data-table-shell),
.app-shell--data-table .page-content > .tabs-container,
.app-shell--data-table .tabs-container > .tab-content.active,
.app-shell--data-table .resource-tab-content,
.app-shell--data-table .resource-tab-content > .panel:has(.data-table-shell) {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

html.kvant-short-viewport .app-shell--data-table,
html.kvant-short-viewport .app-shell--data-table .main {
  height: auto;
}
html.kvant-short-viewport .app-shell--data-table {
  min-height: 100dvh;
}
html.kvant-short-viewport .app-shell--data-table .main {
  min-height: 0;
  overflow: visible;
}
html.kvant-short-viewport .app-shell--data-table .page-content,
html.kvant-short-viewport .app-shell--data-table .page-content > .panel:has(.data-table-shell),
html.kvant-short-viewport .app-shell--data-table .page-content > .tabs-container,
html.kvant-short-viewport .app-shell--data-table .tabs-container > .tab-content.active,
html.kvant-short-viewport .app-shell--data-table .resource-tab-content,
html.kvant-short-viewport .app-shell--data-table .resource-tab-content > .panel:has(.data-table-shell) {
  flex: 0 0 auto;
  height: auto;
  overflow: visible;
}
html.kvant-short-viewport .app-shell--data-table .data-table-shell,
html.kvant-short-viewport .app-shell--data-table .msweb-dt-fit-parent.msweb-dt-fit-parent--overflow {
  flex: 1 1 auto;
  overflow: visible;
}
html.kvant-short-viewport .app-shell--data-table .dt-scroll-body,
html.kvant-short-viewport .app-shell--data-table .dataTables_scrollBody {
  height: auto !important;
  max-height: none !important;
  overflow-y: visible !important;
}

[data-theme="dark"] .login-card { box-shadow: 0 18px 50px rgb(0 0 0 / 28%); }
.profile-sso-wrap { position: relative; width: min(624px, 100%); min-height: 620px; margin: 0 auto; overflow: hidden; border-radius: 10px; background: var(--kvant-surface); box-shadow: 0 1px 4px rgb(0 0 0 / 7%); }
.profile-sso-frame { display: block; width: 100%; min-height: 620px; border: 0; }
.profile-sso-loader { position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; background: var(--kvant-surface); }
.profile-sso-loader__spinner { width: 32px; height: 32px; border: 3px solid rgb(21 94 239 / 20%); border-top-color: var(--kvant-primary); border-radius: 50%; animation: profile-sso-spin .8s linear infinite; }
@keyframes profile-sso-spin { to { transform: rotate(360deg); } }
[data-theme="dark"] .impersonation-banner {
  border-color: #854d0e;
  background: #422006;
  color: #fde68a;
}
[data-theme="dark"] .demo-mode-banner { border-color: #315a91; background: #172b49; color: #dbeafe; }
[data-theme="dark"] .api-token { background: #1e293b; }

@media (min-height: 700px) {
  .app-shell--schedule {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  .app-shell--schedule .main {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  .app-shell--schedule .page-header,
  .app-shell--schedule .impersonation-banner,
  .app-shell--schedule #setupNotice,
  .app-shell--schedule .metrics {
    flex: 0 0 auto;
  }
  .app-shell--schedule .page-content {
    flex: 1 1 auto;
    min-height: 0;
  }
  .app-shell--schedule .schedule-calendar { height: 100%; }
}

@media (max-height: 699px) {
  .app-shell--schedule .schedule-calendar { min-height: 480px; }
}

@media (max-width: 850px) {
  .demo-mode-banner { align-items: stretch; flex-direction: column; }
  .demo-mode-banner__message { display: grid; }
  .demo-mode-banner__actions { width: 100%; }
  .demo-mode-banner__actions .btn { flex: 1 1 0; }
  .app-shell, .app-shell.app-shell--sidebar-collapsed { grid-template-columns: 56px minmax(0, 1fr); }
  #sidebar { position: fixed; z-index: 1200; inset: 0 auto 0 0; height: 100dvh; }
  #sidebar.msweb-sidebar-shell--collapsed { --msweb-sidebar-shell-collapsed-width: 56px; }
  .main { padding: 14px; }
  .metrics { grid-template-columns: 1fr; }
  .app-shell--schedule .metrics { grid-template-columns: 1fr; }
  .app-shell--schedule .metrics > .branch-context .select-component-wrapper { width: min(420px, 100%); }
  .app-shell--schedule .schedule-resource-filter { grid-column: 1 / -1; }
  .app-shell--schedule .schedule-view-filter { grid-column: 1 / -1; }
  .list-row { grid-template-columns: 1fr 1fr; }
  .form-template-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .crm-setup-notice { align-items: stretch; flex-direction: column; }
  .crm-setup-notice__action .btn { width: 100%; }
  .lead-intake__client-row, .lead-intake__item-row { grid-template-columns: 1fr; }
  .lead-intake__client-row .btn { width: 100%; }
  .lead-intake__remove { justify-self: end; padding: 0; }
  .lead-item-picker { grid-template-rows: auto auto; min-height: 0; }
  .lead-item-picker__selected-row { grid-template-columns: minmax(0, 1fr) 100px 40px; }
  .lead-view__client { align-items: stretch; flex-direction: column; }
  .lead-view__client-actions { display: grid; grid-template-columns: 1fr; }
  .lead-view__client-actions .btn, .lead-view > .btn:last-child { width: 100%; }
  .lead-view__item { grid-template-columns: 1fr; gap: 10px; }
  .lead-view__copy { width: 100%; }
}

@media (max-width: 520px) {
  .page-header { align-items: flex-start; }
  .page-header h1 { font-size: 22px; }
  .settings-section__header { align-items: stretch; flex-direction: column; }
  .settings-section__actions .btn { width: 100%; }
  .form-grid, .resource-checks { grid-template-columns: 1fr; }
  .form-grid > .form-group { grid-column: 1 !important; }
  .list-row { grid-template-columns: 1fr; }
  .branch-context { align-items: stretch; flex-direction: column; gap: 4px; }
  .branch-context .select-component-wrapper,
  .branch-context .select2-container { width: 100% !important; min-width: 0; }
  .certificate-actions { width: 100%; justify-content: stretch; }
  .certificate-actions .btn { flex: 1 1 100%; }
  .certificate-mail-editor-page__smtp-fields { grid-template-columns: 1fr; }
  .gift-mail-preview-pane__frame { min-height: 520px; }
}
.tips-page { display: grid; gap: 20px; max-width: 1000px; }
.tips-card { display: grid; gap: 16px; }
.tips-card__title { margin: 0; }
.tips-card__actions, .tips-links { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.tips-card__status { font-weight: 600; }
.tips-card__status--success { color: var(--success-color, #16803c); }
.tips-qr { display: grid; gap: 12px; justify-items: start; }
.tips-email-settings { display: grid; gap: 14px; max-width: 520px; }
@media (max-width: 700px) {
  .tips-page { max-width: 100%; }
  .tips-card__actions, .tips-links { align-items: stretch; flex-direction: column; }
  .tips-links > * { max-width: 100%; }
  .tips-qr { justify-items: center; }
}
