:root {
  --bg: #f6f8fb;
  --surface: #fff;
  --surface-soft: #eef3f6;
  --surface-blue: #eaf5fc;
  --ink: #17232b;
  --muted: #65737d;
  --line: #dbe3e8;
  --primary: #00669f;
  --primary-strong: #004f7d;
  --aqua: #42dfd0;
  --aqua-strong: #20c7b8;
  --aqua-deep: #006c64;
  --aqua-soft: #c9faf3;
  --success: #087b61;
  --warning: #a86300;
  --fund-bg: #fff1b8;
  --fund-border: #b77900;
  --fund-ink: #4d3900;
  --commercial-bg: #bdeee5;
  --commercial-border: #168b7e;
  --commercial-ink: #004b46;
  --danger: #b3261e;
  --danger-soft: #ffdedb;
  --shadow: 0 16px 40px rgba(37, 67, 83, .08);
  --radius: 22px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; }
body.high-contrast { --bg: #fff; --surface-soft: #e8edf0; --ink: #071117; --muted: #35444d; --line: #7b8b94; --primary: #004f7d; }
body.high-contrast .surface, body.high-contrast .stat { border-width: 2px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgba(0, 102, 159, .28); outline-offset: 2px; }
.skip-link { position: fixed; z-index: 200; left: 16px; top: -60px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; }
.skip-link:focus { top: 12px; }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: 252px; display: flex; flex-direction: column; padding: 22px 16px 16px; background: #f0f3f5; border-right: 1px solid var(--line); }
.brand { width: 100%; display: flex; align-items: center; gap: 12px; padding: 5px 10px 25px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px 14px 14px 5px; background: var(--primary); color: #fff; font-size: 22px; font-weight: 800; }
.brand strong { display: block; color: var(--primary); font-size: 20px; letter-spacing: -.03em; }
.brand small, .profile small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
#main-nav { display: flex; flex-direction: column; gap: 5px; }
.nav-group { display: grid; gap: 4px; }
.nav-item { width: 100%; min-height: 47px; display: flex; align-items: center; gap: 12px; padding: 0 14px; border: 0; border-radius: 13px; background: transparent; color: #4f5c66; font-weight: 650; cursor: pointer; transition: .18s ease; }
.nav-item:hover { background: rgba(255,255,255,.7); color: var(--primary); }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: 0 4px 10px rgba(0, 102, 159, .16); }
.nav-item.schedule-parent.group-active { background: #dfeef7; color: var(--primary); }
.nav-item.active .count { background: rgba(255,255,255,.18); color: #fff; }
.nav-item svg { width: 20px; height: 20px; }
.nav-item .nav-chevron { width: 18px; height: 18px; display: grid; place-items: center; margin-left: auto; transition: transform .18s ease; }
.nav-item .nav-chevron svg { width: 17px; height: 17px; }
.nav-item .nav-chevron.open { transform: rotate(90deg); }
.nav-item .count { margin-left: auto; min-width: 23px; height: 23px; display: grid; place-items: center; border-radius: 99px; background: rgba(255,255,255,.75); font-size: 11px; }
.schedule-subnav { display: grid; gap: 3px; padding: 1px 0 5px 37px; }
.schedule-link { min-height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: #586872; font-size: 13px; font-weight: 650; text-align: left; cursor: pointer; transition: background-color .18s ease, color .18s ease; }
.schedule-link:hover { background: rgba(255,255,255,.75); color: var(--primary); }
.schedule-link.active { background: var(--primary); color: #fff; }
.sidebar-foot { margin-top: auto; display: grid; gap: 12px; }
.profile { display: grid; grid-template-columns: 38px 1fr 18px; align-items: center; gap: 10px; width: 100%; padding: 10px 8px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.profile strong { font-size: 12px; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #cfe6f4; color: var(--primary); font-size: 12px; font-weight: 800; }

.app-shell { min-height: 100vh; margin-left: 252px; }
.topbar { position: sticky; top: 0; z-index: 35; height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.topbar h1 { margin: 0; font-size: 22px; color: var(--primary); letter-spacing: -.02em; }
.eyebrow { margin: 0 0 2px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.api-status { display: flex; align-items: center; gap: 7px; margin-right: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; font-weight: 650; }
.api-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(8,123,97,.1); }
.icon-button { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.icon-button:hover { background: var(--surface-soft); }
.icon-button svg { width: 21px; height: 21px; }
.notification-button b { position: absolute; right: 3px; top: 1px; width: 18px; height: 18px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; background: var(--danger); color: #fff; font-size: 9px; }
.mobile-menu { display: none; }

#workspace { padding: 34px; animation: enter .28s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-head h2 { margin: 0 0 7px; font-size: clamp(28px, 3vw, 39px); line-height: 1.08; letter-spacing: -.045em; }
.page-head p { max-width: 680px; margin: 0; color: var(--muted); line-height: 1.55; }
.head-actions, .toolbar, .inline, .filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar { justify-content: space-between; margin-bottom: 18px; }

.primary, .secondary, .ghost, .danger-button, .forward { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: 12px; font-weight: 750; cursor: pointer; transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease; }
.primary { border: 1px solid var(--aqua-strong); background: var(--aqua); color: #003d38; }
.primary:hover { border-color: #16b5a8; background: #55eadc; transform: translateY(-1px); }
.primary:active { transform: translateY(0); background: var(--aqua-strong); }
.forward { border: 1px solid var(--primary); background: var(--primary); color: #fff; }
.forward:hover { border-color: var(--primary-strong); background: var(--primary-strong); transform: translateY(-1px); }
.forward:active { transform: translateY(0); background: #00466f; }
.secondary { border: 1px solid var(--primary); background: #fff; color: var(--primary); }
.secondary:hover { background: var(--surface-blue); }
.ghost { border: 1px solid var(--line); background: #fff; color: #47555f; }
.ghost:hover { border-color: #b7c6cf; background: var(--surface-soft); }
.ghost.active { border-color: var(--primary); background: var(--surface-blue); color: var(--primary); }
.danger-button { border: 1px solid var(--danger); background: #fff; color: var(--danger); }
.danger-button:hover { background: var(--danger-soft); }
.wide { width: 100%; }
button svg { width: 18px; height: 18px; }

.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 22px rgba(37,67,83,.04); }
.padded { padding: 22px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stack { display: grid; gap: 16px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.section-title h3 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.section-title p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

.search { position: relative; min-width: 270px; flex: 1; }
.search svg { position: absolute; left: 13px; top: 50%; width: 18px; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; height: 44px; padding: 0 14px 0 42px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.field { display: grid; gap: 7px; align-content: start; }
.field label { color: #44535d; font-size: 12px; font-weight: 750; }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cbd7de; border-radius: 11px; background: #fff; color: var(--ink); }
.field input[type="checkbox"] { width: 18px; height: 18px; min-height: 18px; padding: 0; border-radius: 4px; accent-color: var(--primary); }
.field label:has(> input[type="checkbox"]) { display: flex; align-items: center; gap: 9px; min-height: 32px; }
.field textarea { min-height: 88px; resize: vertical; }
.form-error { min-height: 20px; margin-top: 10px; color: var(--danger); font-size: 12px; font-weight: 750; }
.segmented { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-soft); }
.segmented button { min-height: 36px; padding: 0 13px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.segmented button.active { background: #fff; color: var(--primary); box-shadow: 0 2px 7px rgba(37,67,83,.09); }

.stat { min-height: 134px; padding: 18px; border-radius: 18px; background: #fff; border: 1px solid var(--line); }
.stat .stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 650; }
.stat strong { display: block; margin: 18px 0 6px; font-size: 30px; letter-spacing: -.04em; }
.stat small { color: var(--success); font-weight: 650; }
.stat .warning-text { color: var(--warning); }
.stat-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; background: var(--surface-blue); color: var(--primary); }

.lane-block { padding: 18px; border-bottom: 1px solid var(--line); }
.lane-block:last-child { border-bottom: 0; }
.lane-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.lane-head strong { color: var(--primary); font-size: 12px; text-transform: uppercase; letter-spacing: .065em; }
.lane-times, .pool-lane { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 7px; min-width: 600px; }
.lane-times { align-items: center; padding: 0 9px 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.lane-time-grid, .pool-lane-track { display: grid; grid-template-columns: repeat(var(--steps), minmax(36px, 1fr)); gap: 3px; }
.lane-time-grid { align-items: center; }
.lane-times .time { padding: 3px; color: var(--muted); font-size: 11px; text-align: center; }
.pool-lanes { display: grid; gap: 8px; }
.pool-lane { position: relative; align-items: stretch; padding: 7px; border: 2px dashed #258bc2; border-radius: 14px; background: #f4fbff; }
.pool-lane::after { content: ""; position: absolute; inset: 5px 8px; z-index: 0; border-top: 1px solid rgba(37,139,194,.12); border-bottom: 1px solid rgba(37,139,194,.12); pointer-events: none; }
.lane-label, .pool-lane-track { position: relative; z-index: 1; }
.pool-lane-track { min-width: 0; }
.pool-lane-track .slot { grid-row: 1; }
.lane-label { display: flex; align-items: center; gap: 7px; padding: 0 5px; color: #00669f; font-size: 12px; font-weight: 800; }
.lane-label svg { width: 31px; height: 31px; flex: 0 0 auto; color: #087db7; stroke-width: 1.65; }
.lane-label .swimmer-icon { width: 38px; height: 34px; flex: 0 0 auto; object-fit: contain; }
.slot { min-height: 50px; display: grid; place-items: center; padding: 7px; border: 1px solid transparent; border-radius: 11px; background: #f7f9fa; color: var(--primary); cursor: pointer; transition: .16s ease; }
.slot:hover { transform: translateY(-2px); box-shadow: 0 9px 18px rgba(37,67,83,.11); }
.slot.busy { background: #0d7ebd; color: #fff; }
.slot.full { background: var(--aqua); color: #004b45; }
.slot.selected { outline: 3px solid var(--success); outline-offset: 2px; }
.slot b { font-size: 12px; }
.slot small { opacity: .8; font-size: 9px; }
.slot.group-slot { align-content: center; gap: 4px; padding-inline: 5px; }
.slot.group-slot b, .slot.group-slot small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot.group-slot b { font-size: 10px; }
.slot.slot-span { min-width: 0; overflow: hidden; border-color: rgba(13,126,189,.2); }
.slot.slot-span:not(.busy):not(.full) { background: #e4f4fc; color: #0b6090; }
.slot.slot-span small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot.free-slot.compact { padding-inline: 3px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; background: #f0f3f5; }
.legend .busy-dot { background: #0d7ebd; }
.legend .full-dot { background: var(--aqua); }

.mini-calendar { padding: 20px; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.calendar-head h3 { margin: 0; font-size: 18px; }
.calendar-head .icon-button { background: var(--primary); color: #fff; }
.calendar-head .icon-button:hover { background: var(--primary-strong); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.calendar-grid span { display: grid; place-items: center; min-height: 34px; border-radius: 9px; font-size: 12px; }
.calendar-grid .weekday { min-height: 24px; color: var(--muted); font-size: 10px; font-weight: 750; }
.calendar-grid .muted { color: #bcc5ca; }
.calendar-grid button { min-height: 34px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; }
.calendar-grid button:hover { background: var(--surface-soft); }
.calendar-grid button.today { box-shadow: inset 0 0 0 2px #258bc2; }
.calendar-grid button.active { background: var(--primary); color: #fff; }
.calendar-grid button.active.today { box-shadow: inset 0 0 0 2px rgba(255,255,255,.75); }

.selection { overflow: hidden; }
.selection-accent { height: 7px; background: var(--aqua); }
.selection-body { padding: 21px; }
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 25px; padding: 3px 9px; border-radius: 999px; background: var(--surface-blue); color: var(--primary); font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge.success { background: #d8f4e9; color: #07684f; }
.badge.warning { background: #fff0cf; color: #8a5200; }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.gray { background: var(--surface-soft); color: var(--muted); }
.person-list { display: grid; gap: 8px; margin: 16px 0; }
.person-row { display: grid; gap: 12px; padding: 14px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.person-row:hover { border-color: #c4d2da; background: #fbfdfe; }
.person-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person-row .meta { min-width: 0; flex: 1; }
.person-row strong, .person-row small { display: block; }
.person-row strong { font-size: 12px; }
.person-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.person-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.empty { padding: 30px 16px; color: var(--muted); text-align: center; }
.service-schedule { min-height: 430px; padding: 24px; }
.service-schedule-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.service-schedule-head h3 { margin: 0; font-size: 20px; }
.service-schedule-head p { max-width: 620px; margin: 6px 0 0; color: var(--muted); line-height: 1.5; }
.service-examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.service-examples span { padding: 7px 10px; border-radius: 9px; background: var(--surface-soft); color: #52626c; font-size: 12px; font-weight: 650; }
.service-empty { min-height: 250px; display: grid; place-content: center; justify-items: center; gap: 8px; }
.service-empty svg { width: 32px; height: 32px; color: var(--primary); }
.service-empty strong { color: var(--ink); }
.service-empty small { max-width: 470px; line-height: 1.5; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 14px; border-bottom: 1px solid #e8edef; vertical-align: middle; }
.data-table tbody tr { cursor: pointer; transition: .13s ease; }
.data-table tbody tr:hover { background: #f7fafb; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.table-person { display: flex; align-items: center; gap: 10px; }
.table-person strong, .table-person small { display: block; }
.table-person small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.table-actions { display: flex; justify-content: flex-end; gap: 5px; }
.small-button { min-height: 34px; padding: 0 11px; border: 1px solid var(--primary); border-radius: 9px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 800; cursor: pointer; transition: background-color .18s ease, transform .18s ease; }
.small-button:hover { background: var(--primary-strong); transform: translateY(-1px); }
.small-button.destructive { border-color: #e4aaa6; background: #fff; color: var(--danger); }
.small-button.destructive:hover { background: var(--danger-soft); }

.chart { position: relative; min-height: 250px; padding: 14px 8px 0; }
.bar-chart { height: 210px; display: flex; align-items: flex-end; justify-content: space-around; gap: 10px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, transparent 0 51px, #edf1f3 52px); }
.bar-group { height: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 4px; position: relative; }
.bar { width: min(28px, 38%); min-height: 4px; border-radius: 7px 7px 0 0; background: var(--primary); transition: height .35s ease; }
.bar.alt { background: var(--aqua); }
.bar-group label { position: absolute; bottom: -25px; color: var(--muted); font-size: 10px; }
.donut-wrap { display: flex; align-items: center; justify-content: center; gap: 28px; min-height: 230px; }
.donut { width: 150px; height: 150px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--primary) 0 58%, var(--aqua) 58% 82%, #d8e2e8 82% 100%); }
.donut::after { content: "78%"; width: 98px; height: 98px; display: grid; place-items: center; border-radius: 50%; background: #fff; font-size: 24px; font-weight: 800; }
.chart-legend { display: grid; gap: 12px; }
.chart-legend span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; }

.settings-list { display: grid; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row strong, .setting-row small { display: block; }
.setting-row small { max-width: 570px; margin-top: 4px; color: var(--muted); line-height: 1.45; }
.access-list { gap: 0; }
.access-person { display: grid; grid-template-columns: minmax(150px, 210px) 1fr; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.access-person:last-child { border-bottom: 0; }
.access-person-head strong, .access-person-head small { display: block; }
.access-person-head strong { font-size: 14px; }
.access-person-head small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.access-room-list { display: grid; gap: 8px; }
.access-room { min-height: 45px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 6px 6px 12px; border-radius: 11px; background: var(--surface-soft); }
.access-room-name { min-width: 0; color: var(--ink); font-size: 12px; font-weight: 700; }
.access-room-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.staff-card-drawer { width: min(760px, calc(100vw - 28px)); padding-bottom: 0; }
.staff-card-form { display: grid; gap: 0; }
.staff-card-section { padding: 22px 0; border-bottom: 1px solid var(--line); }
.staff-card-section h3 { margin: 0 0 6px; font-size: 16px; }
.staff-card-section > p { margin: 0 0 15px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.permission-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.permission-option { min-height: 68px; display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; }
.permission-option:has(input:checked) { border-color: #71b8dc; background: var(--surface-blue); }
.permission-option input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); flex: 0 0 auto; }
.permission-option strong, .permission-option small { display: block; }
.permission-option strong { font-size: 12px; }
.permission-option small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.room-permission-list { display: grid; gap: 7px; }
.room-permission { min-height: 58px; display: grid; grid-template-columns: minmax(180px,1fr) minmax(210px,280px); align-items: center; gap: 16px; padding: 8px 10px 8px 13px; border-radius: 11px; background: var(--surface-soft); }
.room-permission strong, .room-permission small { display: block; }
.room-permission strong { font-size: 12px; }
.room-permission small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.room-permission select { width: 100%; }
.sticky-actions { position: sticky; z-index: 4; bottom: 0; margin: 0 -28px; padding: 14px 28px; border-top: 1px solid var(--line); background: #fff; }
.switch { position: relative; width: 48px; height: 28px; flex: 0 0 auto; border: 0; border-radius: 99px; background: #cbd4d9; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.15); transition: .18s ease; }
.switch.on { background: var(--success); }
.switch.on::after { transform: translateX(20px); }
.task-list { display: grid; gap: 8px; }
.task { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.task input { width: 20px; height: 20px; accent-color: var(--success); }
.task.done .task-copy { text-decoration: line-through; color: var(--muted); }
.task-copy strong, .task-copy small { display: block; }
.task-copy small { margin-top: 4px; color: var(--muted); }

.overlay { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: flex-end; background: rgba(12,29,39,.38); backdrop-filter: blur(2px); animation: fade .18s ease both; }
@keyframes fade { from { opacity: 0; } }
.drawer { width: min(500px, 100%); height: 100%; overflow: auto; padding: 24px clamp(20px, 3vw, 30px) 32px; background: #fff; box-shadow: -20px 0 60px rgba(12,29,39,.14); animation: slide .25s ease both; }
@keyframes slide { from { transform: translateX(35px); opacity: .7; } }
.dialog-wrap { align-items: center; justify-content: center; padding: 18px; }
.dialog { width: min(560px, 100%); max-height: min(760px, calc(100vh - 36px)); overflow: auto; padding: 24px; border-radius: 24px; background: #fff; box-shadow: var(--shadow); animation: pop .2s ease both; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.dialog.large { width: min(760px, 100%); }
.overlay-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.overlay-head h2 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.overlay-head p { margin: 5px 0 0; color: var(--muted); }
.close-button { width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 auto; border: 0; border-radius: 50%; background: var(--surface-soft); cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.form-grid .full { grid-column: 1 / -1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 23px; padding-top: 18px; border-top: 1px solid var(--line); position: sticky; bottom: -24px; z-index: 2; padding-bottom: 24px; margin-bottom: -24px; background: #fff; }
.steps { display: flex; align-items: center; gap: 8px; margin: -5px 0 20px; }
.steps span { flex: 1; height: 4px; border-radius: 99px; background: var(--line); }
.steps span.active { background: var(--primary); }
.callout { display: flex; gap: 10px; padding: 13px; border-radius: 12px; background: var(--surface-blue); color: #24485e; line-height: 1.45; }
.callout.warning { background: #fff3d9; color: #784d0a; }
.callout.danger { background: var(--danger-soft); color: var(--danger); }

.toast-root { position: fixed; z-index: 150; right: 20px; top: 92px; display: grid; gap: 10px; }
.toast { min-width: 270px; max-width: 390px; display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); animation: slideToast .25s ease both; }
@keyframes slideToast { from { opacity: 0; transform: translateX(18px); } }
.toast-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: #d8f4e9; color: var(--success); }
.toast strong, .toast small { display: block; }
.toast small { margin-top: 3px; color: var(--muted); }

@media (max-width: 1120px) {
  .split { grid-template-columns: 1fr; }
  .split > aside { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .sidebar { width: 220px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  .app-shell { margin-left: 0; }
  .mobile-menu { display: grid; }
  .api-status span { display: none; }
  #workspace { padding: 24px 18px 90px; }
  .topbar { padding: 0 18px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head .head-actions { width: 100%; }
  .grid-3, .grid-2, .split > aside { grid-template-columns: 1fr; }
  .table-scroll, .lane-scroll { overflow-x: auto; }
  .data-table { min-width: 720px; }
}
@media (max-width: 560px) {
  .topbar h1 { font-size: 18px; }
  .api-status { display: none; }
  .page-head h2 { font-size: 29px; }
  .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search { min-width: 0; width: 100%; }
  .toolbar .filters { width: 100%; }
  .toolbar .filters > * { flex: 1; }
  .dialog { padding: 19px; border-radius: 20px; }
  .dialog-actions { bottom: -19px; padding-bottom: 19px; margin-bottom: -19px; }
  .pool-lane-pills { grid-template-columns: 1fr; }
  .toast-root { right: 12px; left: 12px; top: 84px; }
  .toast { min-width: 0; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Единый округлый вид всех выпадающих списков портала. */
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 40px !important;
  border-radius: 16px !important;
  background-color: #fff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2300669f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 13px center !important;
  background-size: 16px !important;
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
select:hover { border-color: #9eb9c8 !important; background-color: #f8fcfe !important; }
select:focus-visible { border-color: var(--primary) !important; box-shadow: 0 0 0 4px rgba(0,102,159,.1); }
select:disabled { background-color: var(--surface-soft) !important; color: var(--muted); cursor: not-allowed; }

/* Resource calendar MVP in the same visual system as the pool */
.api-status.offline i { background: var(--danger); box-shadow: 0 0 0 4px rgba(179,38,30,.1); }
.loading-state { min-height: 55vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); }
.loading-state span { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.calendar-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; }
.calendar-toolbar select, .calendar-toolbar input { min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.date-control { display: flex; align-items: center; gap: 7px; }
.calendar-summary { display: flex; gap: 0; margin-bottom: 13px; border-block: 1px solid var(--line); }
.calendar-summary span { min-width: 120px; padding: 14px 24px 14px 0; margin-right: 24px; border-right: 1px solid var(--line); }
.calendar-summary strong, .calendar-summary small { display: block; }
.calendar-summary strong { font-size: 23px; letter-spacing: -.04em; }
.calendar-summary small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.funding-legend { display: flex; gap: 18px; justify-content: flex-end; margin: 10px 0; color: var(--muted); font-size: 12px; }
.funding-legend span { display: flex; align-items: center; gap: 6px; }
.funding-legend i { width: 10px; height: 10px; border-radius: 3px; }
.funding-legend .fund { background: var(--fund-border); }
.funding-legend .commercial { background: var(--commercial-border); }
.timeline { min-width: 950px; overflow: hidden; border-radius: 16px; }
.timeline-hours, .timeline-row { display: grid; grid-template-columns: 210px minmax(700px, 1fr); }
.timeline-hours { position: relative; z-index: 8; min-height: 44px; border-bottom: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 10px; }
.timeline-hours > span { padding: 15px; font-weight: 800; text-transform: uppercase; }
.timeline-hours > div { display: flex; justify-content: space-between; align-items: center; padding: 0 8px; }
.timeline-hours b { font-weight: 650; }
.floor-divider { padding: 9px 15px; border-block: 1px solid #cfe4f0; background: #edf6fb; color: var(--primary); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.timeline-row { min-height: 78px; margin: 8px; border: 2px dashed #258bc2; border-radius: 14px; overflow: hidden; background: #f4fbff; }
.timeline-row:last-child { border-bottom: 2px dashed #258bc2; }
.resource-label { display: grid; grid-template-columns: 46px 1fr; align-items: center; gap: 6px; padding: 9px 14px; border: 0; border-right: 1px solid var(--line); background: #fff; text-align: left; cursor: pointer; }
.resource-label:hover { background: #eaf5fc; }
.resource-label strong { color: var(--primary); font-size: 11px; }
.resource-label span { font-size: 12px; font-weight: 720; line-height: 1.25; }
.timeline-track { position: relative; min-width: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(6.25% - 1px), rgba(37,139,194,.15) calc(6.25% - 1px) 6.25%); cursor: crosshair; }
.current-time-line { position: absolute; z-index: 5; top: 0; bottom: 0; width: 2px; background: #e14c3d; pointer-events: none; }
.current-time-line::before { content: ""; position: absolute; top: -1px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: #e14c3d; }
.schedule-event { min-width: 0; overflow: hidden; border: 2px solid; color: #16333f; text-align: left; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, filter .16s ease; }
.timeline-track > .schedule-event { position: absolute; top: 7px; bottom: 7px; z-index: 2; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 6px 8px; border-radius: 8px; }
.schedule-event:hover, .schedule-event:focus-visible { z-index: 4; transform: translateY(-1px); filter: saturate(1.08); box-shadow: 0 8px 18px rgba(20,54,53,.16); }
.event-time, .event-title, .event-meta { min-width: 0; display: block; overflow: hidden; }
.event-time { flex: 0 0 auto; font-size: 9px; font-style: normal; font-weight: 800; line-height: 1; white-space: nowrap; }
.event-time b { font: inherit; }
.event-time i { font-style: normal; font-weight: 650; opacity: .75; }
.event-time em { font-style: normal; }
.event-title { display: -webkit-box; flex: 0 1 auto; overflow: hidden; font-size: 10px; line-height: 1.08; white-space: normal; overflow-wrap: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.event-meta { flex: 0 0 auto; font-size: 8px; font-weight: 720; line-height: 1; opacity: .82; white-space: nowrap; text-overflow: ellipsis; }
.event-meta span { display: block; overflow: hidden; text-overflow: ellipsis; }
.event-specialist { margin-top: 2px; }
.timeline-track > .event-compact { gap: 2px; padding-inline: 5px; }
.event-compact .event-time i, .event-compact .event-specialist { display: none; }
.event-compact .event-title { font-size: 9px; -webkit-line-clamp: 2; }
.event-wide .event-title { font-size: 11px; }
.funding-fund { border-color: var(--fund-border) !important; background: var(--fund-bg) !important; color: var(--fund-ink) !important; }
.funding-commercial { border-color: var(--commercial-border) !important; background: var(--commercial-bg) !important; color: var(--commercial-ink) !important; }
.schedule-event.blocked { border-color: #7d858a !important; background: #edf0f1 !important; color: #5a6368; }
.desktop-schedule, .columns-scroll { overflow-x: auto; padding-bottom: 8px; }
.columns-grid { display: grid; grid-template-columns: 72px repeat(var(--resources), minmax(145px, 1fr)); min-width: calc(72px + var(--resources) * 145px); overflow: hidden; border-radius: 16px; }
.columns-corner, .columns-head { position: sticky; top: 78px; z-index: 7; min-height: 72px; padding: 11px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); background: #fff; }
.columns-corner { left: 0; z-index: 9; display: grid; place-items: center; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.columns-head strong, .columns-head span { display: block; }
.columns-head strong { color: var(--primary); font-size: 11px; }
.columns-head span { margin-top: 4px; font-size: 11px; line-height: 1.25; }
.hour-label { position: sticky; left: 0; z-index: 5; min-height: 76px; padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 11px; }
.column-cell { min-height: 76px; padding: 5px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fbfcfc; cursor: crosshair; }
.column-cell:hover { background: #f2f7f6; }
.column-cell .schedule-event { width: 100%; min-height: 54px; padding: 7px; border-radius: 7px; }
.mobile-schedule { display: none; }
.slot-facts { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin-bottom: 25px; border-block: 1px solid var(--line); }
.slot-facts span { padding: 14px 8px; }
.slot-facts small, .slot-facts strong { display: block; }
.slot-facts small { color: var(--muted); font-size: 10px; }
.slot-facts strong { margin-top: 4px; font-size: 12px; }
.settings-layout { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; align-items: start; }
.settings-layout .surface { box-shadow: none; border-radius: 16px; }
.view-chip { min-height: 43px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; border: 1px solid var(--primary); border-radius: 12px; background: #fff; color: var(--primary); font-weight: 750; }
.view-chip svg { width: 18px; height: 18px; }
.input-readonly { min-height: 44px; display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid #cbd7de; border-radius: 11px; background: var(--surface-blue); color: var(--primary); font-weight: 750; }
.input-readonly svg { width: 25px; height: 25px; }
.input-readonly .swimmer-icon { width: 34px; height: 30px; object-fit: contain; }
.pool-lane-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pool-lane-pills label { margin: 0; cursor: pointer; }
.pool-lane-pills input { position: absolute; opacity: 0; pointer-events: none; }
.pool-lane-pills span { min-height: 72px; display: grid; grid-template-columns: 38px 1fr; grid-template-rows: 1fr 1fr; align-items: center; column-gap: 7px; padding: 9px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.pool-lane-pills .swimmer-icon { grid-row: 1 / 3; width: 36px; height: 32px; object-fit: contain; }
.pool-lane-pills b, .pool-lane-pills small { display: block; }
.pool-lane-pills b { align-self: end; color: var(--primary); font-size: 11px; }
.pool-lane-pills small { align-self: start; color: var(--muted); font-size: 9px; }
.pool-lane-pills input:checked + span { border-color: #258bc2; background: #e4f4fc; box-shadow: inset 0 0 0 1px #258bc2; }
.pool-lane-pills input:disabled + span { opacity: .48; cursor: not-allowed; }
.pool-dashboard { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.pool-board { overflow: hidden; }
.pool-board-head { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.pool-board-head h3 { margin: 0; font-size: 20px; }
.pool-board-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.pool-side { display: grid; gap: 16px; position: sticky; top: 96px; }
.pool-day-card { overflow: hidden; }
.pool-day-card h3 { margin: 16px 0 4px; font-size: 22px; }
.pool-day-card p { margin: 17px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.pool-day-stats { display: grid; grid-template-columns: repeat(3,1fr); margin-top: 18px; border-block: 1px solid var(--line); }
.pool-day-stats span { padding: 13px 8px 13px 0; }
.pool-day-stats strong, .pool-day-stats small { display: block; }
.pool-day-stats strong { color: var(--primary); font-size: 21px; }
.pool-day-stats small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.login-brand { display: grid; justify-items: center; margin: 4px 0 28px; }
.login-brand span { width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 11px; border-radius: 18px 18px 18px 6px; background: var(--primary); color: #fff; font-size: 28px; font-weight: 850; }
.login-brand strong { color: var(--primary); font-size: 28px; letter-spacing: -.04em; }
.login-brand small { margin-top: 3px; color: var(--muted); }
body.logged-out .sidebar, body.logged-out .app-shell { visibility: hidden; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }

@media (max-width: 1100px) {
  .desktop-schedule { overflow-x: auto; }
  .calendar-toolbar { align-items: flex-start; flex-direction: column; }
  .settings-layout { grid-template-columns: 1fr; }
  .pool-dashboard { grid-template-columns: 1fr; }
  .pool-side { position: static; grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .desktop-schedule { display: none; }
  .mobile-schedule { display: grid; gap: 8px; }
  .mobile-event { display: grid; grid-template-columns: 55px 1fr auto; align-items: center; gap: 10px; padding: 13px; border: 0; border-left: 4px solid; border-radius: 11px; text-align: left; }
  .mobile-event time { color: var(--primary); font-size: 12px; font-weight: 800; }
  .mobile-event strong, .mobile-event small { display: block; }
  .mobile-event small { margin-top: 3px; color: var(--muted); font-size: 10px; }
  .mobile-event b { font-size: 11px; }
  .calendar-summary { overflow-x: auto; }
  .calendar-summary span { min-width: 96px; padding-right: 16px; margin-right: 16px; }
  .date-control, .calendar-toolbar .filters { width: 100%; }
  .date-control input { min-width: 0; flex: 1; }
  .calendar-toolbar .filters select { flex: 1; min-width: 0; }
  .slot-facts { grid-template-columns: 1fr; }
  .pool-side { grid-template-columns: 1fr; }
  .pool-board-head { align-items: flex-start; flex-direction: column; }
  .pool-side .mini-calendar { display: none; }
  .lane-scroll { margin-inline: -12px; padding-inline: 12px; }
  .person-actions .small-button { flex: 1 1 calc(50% - 4px); }
  .settings-layout .padded { padding: 16px; }
  .setting-row { align-items: flex-start; flex-direction: column; gap: 10px; }
  .setting-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .access-person { grid-template-columns: 1fr; gap: 10px; }
  .access-room { align-items: flex-start; flex-direction: column; gap: 8px; padding: 11px; }
  .access-room-actions { width: 100%; justify-content: space-between; }
  .permission-grid { grid-template-columns: 1fr; }
  .room-permission { grid-template-columns: 1fr; gap: 8px; }
  .sticky-actions { margin-inline: -18px; padding-inline: 18px; }
}

.offline-banner { position: fixed; z-index: 180; inset: 0 0 auto; display: none; padding: 9px 18px; background: #8f2d25; color: #fff; font-size: 12px; font-weight: 750; text-align: center; }
.offline-banner.show { display: block; }
.setting-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.drawer .section-title { align-items: flex-start; flex-wrap: wrap; }
.drawer .section-title > h3 { flex: 1 0 100%; }
.drawer .section-title .setting-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; padding-right: 4px; }
.drawer .setting-actions > button { max-width: 100%; }
.settings-wide { grid-column: 1 / -1; }

/* Week, month and recurring schedule */
[hidden] { display: none !important; }
.calendar-mode-bar { display: flex; justify-content: flex-end; margin: -4px 0 12px; }
.calendar-mode { min-width: 260px; }
.calendar-mode button { flex: 1; }
.repeat-mark { color: var(--primary); font-size: 13px; }
.week-matrix { display: grid; grid-template-columns: 210px repeat(7, minmax(96px, 1fr)); min-width: 920px; overflow: hidden; }
.week-matrix > * { min-height: 52px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.matrix-head { padding: 10px 8px; background: #f8fafb; text-align: center; }
.matrix-head strong, .matrix-head small { display: block; }
.matrix-head small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.matrix-floor { grid-column: 1 / -1; min-height: 30px !important; padding: 8px 12px; background: #edf6fb; color: var(--primary); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.matrix-room { display: flex; align-items: center; gap: 8px; padding: 8px 12px; text-align: left; }
.matrix-room b { min-width: 42px; color: var(--primary); font-size: 10px; }
.matrix-room span { font-size: 10px; font-weight: 720; line-height: 1.25; }
.load-cell { position: relative; display: block; width: 100%; padding: 8px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f7fafc; color: var(--ink); text-align: left; cursor: pointer; }
.load-cell::before { content: ""; position: absolute; inset: 6px; border-radius: 8px; background: #eef6fb; }
.load-cell.mid::before { background: #d8edf8; }
.load-cell.high::before { background: #bde3f4; }
.load-cell.full::before { background: #bdeee5; }
.load-cell strong, .load-cell small { position: relative; display: block; }
.load-cell strong { font-size: 11px; }
.load-cell small { margin-top: 3px; color: #4d5e68; font-size: 9px; }
.load-cell.recurring strong::after { content: " ↻"; color: var(--primary); }
.load-cell:hover, .load-cell:focus-visible, .month-day:hover, .month-day:focus-visible { z-index: 2; outline: 3px solid rgba(0, 102, 159, .25); outline-offset: -3px; }
.planner-label { display: flex; align-items: baseline; gap: 12px; margin: 0 0 10px 2px; }
.planner-label strong { color: var(--primary); }
.planner-label small { color: var(--muted); }
.week-planner-scroll { overflow-x: auto; padding-bottom: 8px; }
.week-planner { display: grid; grid-template-columns: 64px repeat(7, minmax(125px, 1fr)); min-width: 940px; overflow: hidden; }
.week-planner > * { min-height: 68px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.planner-corner, .planner-day { min-height: 58px; padding: 10px; background: #f8fafb; text-align: center; }
.planner-corner { display: grid; place-items: center; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.planner-day strong, .planner-day small { display: block; }
.planner-day small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.planner-time { padding: 10px; color: var(--muted); font-size: 10px; }
.planner-cell { min-width: 0; padding: 5px; background: #fbfcfd; cursor: pointer; }
.planner-cell .schedule-event { width: 100%; min-height: 56px; padding: 7px; border-radius: 7px; }
.month-calendar { display: grid; grid-template-columns: repeat(7, minmax(112px, 1fr)); min-width: 800px; overflow: hidden; }
.month-weekday { min-height: 36px; padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f8fafb; color: var(--muted); font-size: 9px; font-weight: 850; text-align: center; }
.month-day { min-height: 132px; padding: 9px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.month-day.muted { background: #fafbfc; color: #a6b1b8; }
.month-day.today { box-shadow: inset 0 0 0 2px var(--primary); }
.month-day-head { display: flex; align-items: center; justify-content: space-between; }
.month-day-head b { color: var(--primary); font-size: 10px; }
.floor-bars { display: grid; gap: 6px; margin-top: 11px; }
.floor-bars i { display: grid; grid-template-columns: 28px 1fr 26px; align-items: center; gap: 5px; font-style: normal; }
.floor-bars small, .floor-bars em { color: var(--muted); font-size: 8px; font-style: normal; }
.floor-bars b, .popover-floor-list i { height: 6px; border-radius: 8px; background: linear-gradient(90deg, var(--primary) var(--load), #e9eef1 var(--load)); }
.month-repeat { display: block; margin-top: 10px; padding: 5px 6px; border-radius: 6px; background: #eaf5fc; color: #38515f; font-size: 8px; }
.calendar-load-popover { position: fixed; z-index: 90; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 17px; overflow-x: hidden; overflow-y: auto; border: 1px solid #bdd1dc; border-radius: 14px; background: #fff; box-shadow: 0 12px 34px rgba(23, 48, 61, .22); }
.calendar-popover-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.calendar-popover-head span, .calendar-popover-head strong, .calendar-popover-head small { min-width: 0; display: block; overflow-wrap: anywhere; }
.calendar-popover-head small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.calendar-popover-head > b { color: var(--primary); font-size: 22px; }
.calendar-popover-list { display: grid; gap: 7px; max-height: 270px; margin-top: 12px; overflow-y: auto; }
.popover-event, .popover-room { width: 100%; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: #f9fbfc; color: var(--ink); text-align: left; }
.popover-event strong, .popover-event small, .popover-room strong, .popover-room small { display: block; }
.popover-event strong, .popover-room strong { font-size: 10px; }
.popover-event small, .popover-room small { margin-top: 3px; color: #4b5e68; font-size: 9px; }
.popover-floor-list { display: grid; gap: 8px; margin-top: 12px; }
.popover-floor-list span { display: grid; grid-template-columns: 58px 1fr 32px; align-items: center; gap: 8px; font-size: 9px; }
.popover-floor-list i { --load: 0%; }
.calendar-popover-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 7px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.calendar-popover-actions.single { grid-template-columns: 1fr; }
.calendar-popover-actions button { min-width: 0; min-height: 38px; padding-inline: 10px; white-space: normal; }
.slot-popover-head > b { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; font-size: 10px; }
.slot-funding-dot.fund { background: var(--fund-bg); color: var(--fund-ink); }
.slot-funding-dot.commercial { background: var(--commercial-bg); color: var(--commercial-ink); }
.slot-popover-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 0; }
.slot-popover-facts span, .slot-popover-facts small, .slot-popover-facts strong { min-width: 0; display: block; }
.slot-popover-facts small { margin-bottom: 3px; color: var(--muted); font-size: 9px; }
.slot-popover-facts strong { overflow-wrap: anywhere; font-size: 11px; line-height: 1.25; }
.slot-popover-hint { padding-top: 10px; border-top: 1px solid var(--line); color: #4b5e68; font-size: 9px; line-height: 1.35; }
.empty.compact { min-height: 52px; padding: 16px; }
.recurrence-toggle { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid #bdd1dc; border-radius: 12px; background: #f3f9fc; cursor: pointer; }
.recurrence-toggle input { width: 19px; height: 19px; accent-color: var(--primary); }
.recurrence-toggle strong, .recurrence-toggle small { display: block; }
.recurrence-toggle small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.recurrence-fields { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; }
.weekday-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.weekday-pills label { margin: 0; cursor: pointer; }
.weekday-pills input { position: absolute; opacity: 0; pointer-events: none; }
.weekday-pills span { width: 38px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); font-size: 10px; font-weight: 800; }
.weekday-pills input:checked + span { border-color: var(--primary); background: var(--primary); color: #fff; }
.recurrence-preview-actions, .preview-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; }
.recurrence-preview-actions small { color: var(--muted); font-size: 9px; }
.series-preview { margin-top: 12px; }
.preview-loading { padding: 12px; border-radius: 9px; background: #eaf5fc; color: var(--primary); }
.preview-summary { margin-bottom: 8px; }
.preview-summary span { color: #087b61; font-size: 10px; }
.preview-summary .has-conflicts { color: var(--danger); }
.preview-dates { display: grid; gap: 6px; max-height: 210px; overflow-y: auto; }
.preview-dates > span { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 10px; }
.preview-dates b { color: var(--primary); }
.preview-dates em { color: #087b61; font-size: 9px; font-style: normal; }
.preview-dates .conflict { border-color: #e5b6b1; background: #fff7f6; }
.preview-dates .conflict em { color: var(--danger); }
.range-mobile section { display: grid; gap: 7px; }
.mobile-day-head { display: flex; justify-content: space-between; padding: 11px 3px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.mobile-day-head span { color: var(--primary); font-size: 10px; }

@media (max-width: 700px) {
  .calendar-mode-bar { justify-content: stretch; }
  .calendar-mode { width: 100%; }
  .calendar-load-popover { right: 12px !important; bottom: 12px; left: 12px !important; top: auto !important; width: auto !important; max-height: 72vh; overflow-y: auto; }
  .recurrence-fields { padding: 11px; }
}

/* Карточка клиента: подсказки, чекбоксы, метки */
.field-hint { display:block; margin-top:-1px; color:var(--muted,#7a8699); font-size:12px; line-height:1.35; }
.field label.check { display:flex; align-items:center; gap:10px; font-weight:500; cursor:pointer; }
.field label.check input[type=checkbox] { width:18px; height:18px; margin:0; flex:none; accent-color:var(--accent,#2f7fd0); }
.client-number { color:var(--muted,#7a8699); font-variant-numeric:tabular-nums; white-space:nowrap; }
.chip { display:inline-block; margin-left:6px; padding:2px 8px; border-radius:999px; background:var(--chip-bg,#eef2f7); color:var(--chip-fg,#51607a); font-size:11px; font-weight:600; vertical-align:middle; }
.chip.fund { background:#fdf0d5; color:#8a5a00; }
