:root {
  color-scheme: light;
  --ink: #173d59;
  --muted: #657b8d;
  --line: #d9e4e8;
  --panel: #ffffff;
  --canvas: #f5f7f7;
  --navy: #173d59;
  --blue: #397aa3;
  --blue-dark: #285c7d;
  --blue-soft: #eaf4f7;
  --green: #239b8b;
  --green-soft: #e8f7f4;
  --red: #d84b5b;
  --red-soft: #fff0f2;
  --amber: #dc8d7e;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(26, 39, 70, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 8% 4%, rgba(248,218,211,.7), transparent 25%), radial-gradient(circle at 92% 2%, rgba(214,235,241,.8), transparent 24%), linear-gradient(180deg, #fff8f7 0, var(--canvas) 320px); color: var(--ink); font-size: 16px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(57,122,163,.28); outline-offset: 2px; }
.hidden { display: none !important; }

.topbar { min-height: 126px; padding: 8px clamp(18px, 4vw, 56px); background: linear-gradient(90deg, #fff9f8, #f9f4f3 48%, #f1f8f9); color: var(--ink); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid rgba(57,122,163,.13); box-shadow: 0 10px 28px rgba(40,92,125,.08); position: relative; overflow: hidden; }
.brand { display: flex; align-items: center; justify-content: center; min-width: 0; }
.brand-logo { display: block; width: 360px; height: auto; }
.top-actions { position: absolute; right: clamp(18px, 4vw, 56px); display: flex; align-items: center; gap: 10px; }
.status-pill { border: 1px solid rgba(57,122,163,.18); background: rgba(255,255,255,.74); border-radius: 999px; padding: 8px 12px; display: inline-flex; align-items: center; gap: 8px; color: #416479; font-size: 14px; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #55d79a; box-shadow: 0 0 0 4px rgba(85,215,154,.12); }
.status-pill.disconnected .status-dot { background: #ef6b72; box-shadow: 0 0 0 4px rgba(239,107,114,.14); }

.app-shell { width: min(1460px, calc(100% - 32px)); margin: 22px auto 52px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 14px; padding: 10px 12px; background: rgba(255,255,255,.88); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 8px 24px rgba(30,49,84,.06); }
.mode-tabs { display: inline-flex; padding: 4px; background: #e5e9f1; border-radius: 12px; }
.mode-tab { border: 0; color: var(--muted); background: transparent; padding: 11px 18px; border-radius: 9px; font-weight: 800; }
.mode-tab.active { background: #fff; color: var(--ink); box-shadow: 0 2px 9px rgba(23,32,51,.09); }
.date-nav { display: flex; align-items: center; gap: 8px; }
.date-control { height: 46px; display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 0 12px; }
.date-control span { color: var(--muted); font-size: 13px; }
.date-control input { border: 0; color: var(--ink); font-weight: 700; background: transparent; }

.icon-button { width: 42px; height: 42px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; }
.topbar .icon-button { border-color: rgba(57,122,163,.2); background: rgba(255,255,255,.78); color: var(--blue-dark); }
.icon-button:hover { background: #f7f8fb; }
.icon-button:disabled { cursor: not-allowed; opacity: .35; }
.topbar .icon-button:hover { background: #fff; }
.icon-button svg, .primary-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.text-button { min-height: 42px; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; padding: 0 15px; font-weight: 700; }
.text-button:hover { border-color: #bfc8d7; }
.primary-button { min-height: 46px; border: 0; background: linear-gradient(135deg, var(--blue), #5a96b8); color: #fff; border-radius: 12px; padding: 0 19px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; box-shadow: 0 8px 20px rgba(57,122,163,.23); }
.primary-button:hover { background: var(--blue-dark); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.primary-button.compact { min-height: 40px; }
.danger-button { min-height: 42px; border: 1px solid #f2c6cc; background: var(--red-soft); color: #b83244; border-radius: 10px; padding: 0 15px; font-weight: 800; }

.customer-panel, .admin-panel { min-height: 88px; padding: 17px 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 24px; box-shadow: 0 8px 26px rgba(30,49,84,.05); }
.quick-booking-copy { display: grid; gap: 3px; min-width: 280px; }
.quick-booking-copy strong { font-size: 16px; }
.quick-booking-copy span { color: var(--muted); font-size: 13px; }
.duration-section { margin-left: auto; }
.rate-card { min-width: 146px; padding: 10px 13px; border: 1px solid #d2e3e8; border-radius: 12px; background: linear-gradient(145deg, #fff8f6, #edf7f9); }
.rate-card span, .rate-card strong, .rate-card small { display: block; }
.rate-card span { color: var(--muted); font-size: 12px; font-weight: 700; }
.rate-card strong { margin-top: 2px; color: var(--blue-dark); font-size: 21px; }
.rate-card small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.eyebrow { margin: 0 0 7px; color: var(--muted); text-transform: uppercase; letter-spacing: .085em; font-size: 12px; font-weight: 800; }
.duration-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.duration-button { border: 1px solid var(--line); color: var(--ink); background: #fff; min-height: 40px; padding: 0 15px; border-radius: 10px; font-weight: 800; }
.duration-button.active { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 5px 14px rgba(57,122,163,.22); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.legend-free { background: #fff; border: 1px solid #cbd3df; }
.legend-busy { background: #7fa9bf; }
.legend-selected { background: var(--green); }
.admin-copy { margin: 0; color: var(--muted); }
.admin-panel { display: block; }
.custom-time-on .booking-start-field, .custom-time-on .booking-time-picker { display: none !important; }
.custom-time-on #customTimeFields { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.custom-time-on #customTimeFields small { color: var(--muted); }
.daily-summary { margin-top: 14px; padding: 12px 15px; display: flex; flex-wrap: wrap; gap: 8px 22px; border: 1px solid #cbdce6; border-radius: 12px; background: #f2f8fb; }
.daily-summary span { font-size: 15px; }
.daily-summary strong { color: var(--blue-dark); font-size: 19px; }
.daily-summary small { flex-basis: 100%; color: var(--muted); }
.daily-summary.hidden { display: none; }
.admin-status-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.admin-actions { display: flex; gap: 9px; }
.employee-booking-controls { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.employee-booking-controls > div:first-child { display: grid; gap: 2px; }
.employee-booking-controls > div:first-child strong { font-size: 15px; }
.settings-dialog { width: min(1120px, calc(100% - 24px)); }
.settings-dialog-card { max-height: calc(100vh - 24px); }
.settings-dialog-header { margin-bottom: 14px; }
.settings-tabs { margin-bottom: 18px; padding: 4px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; border-radius: 12px; background: #e9eef2; }
.settings-tabs.single-tab { grid-template-columns: 1fr; }
.settings-tab { min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 800; }
.settings-tab.active { background: #fff; color: var(--ink); box-shadow: 0 2px 9px rgba(23,32,51,.09); }
.settings-dialog .booking-schedule-panel, .settings-dialog .user-management-panel, .settings-dialog .clients-panel { margin-top: 0; padding-top: 0; border-top: 0; }
.actions-table { min-width: 620px; }
.booking-schedule-panel { margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--line); }
.booking-schedule-copy { display: grid; gap: 3px; margin-bottom: 14px; }
.booking-schedule-copy strong { font-size: 17px; }
.booking-schedule-copy span, .special-days-heading span { color: var(--muted); font-size: 14px; }
.tariff-settings { margin-bottom: 14px; padding: 13px 14px; border: 1px solid #d5def3; border-radius: 13px; background: var(--blue-soft); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.tariff-settings > div strong, .tariff-settings > div span { display: block; }
.tariff-settings > div span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.tariff-settings label { width: min(250px, 100%); }
.tariff-settings input { background: #fff; font-size: 17px; font-weight: 800; }
.weekly-schedule { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.weekly-schedule-row { min-width: 0; padding: 12px; border: 1px solid #cfd8e6; border-radius: 13px; background: #fbfcff; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.weekly-schedule-row.disabled { background: #f5f7fa; }
.weekday-toggle { min-width: 150px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.weekday-toggle input { width: 20px; height: 20px; min-height: 20px; margin: 0; accent-color: var(--blue); }
.weekday-toggle span, .weekday-toggle strong, .weekday-toggle small { display: block; }
.weekday-toggle small { margin-top: 3px; color: var(--green); font-size: 12px; }
.weekly-schedule-row.disabled .weekday-toggle small { color: var(--muted); }
.weekday-times { display: grid; grid-template-columns: repeat(2, minmax(92px, 1fr)); gap: 8px; }
.weekday-times label, .special-day-fields label { display: grid; gap: 5px; }
.weekday-times label > span, .special-day-fields label > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.weekday-times input { min-height: 42px; padding: 8px 9px; }
.weekday-times input:disabled { color: #9aa4b3; background: #edf0f4; }
.special-days-section { margin-top: 16px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #f8faff; }
.special-days-heading strong, .special-days-heading span { display: block; }
.special-days-heading span { margin-top: 4px; }
.special-day-fields { margin-top: 13px; display: grid; grid-template-columns: minmax(150px, 1fr) minmax(120px, .7fr) minmax(120px, .7fr) auto; align-items: end; gap: 10px; }
.special-day-fields .text-button { min-height: 46px; }
.special-days-list { margin-top: 12px; display: grid; gap: 7px; }
.special-days-empty { margin: 0; color: var(--muted); font-size: 14px; }
.special-day-item { padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.special-day-item span, .special-day-item strong, .special-day-item small { display: block; }
.special-day-item small { margin-top: 2px; color: var(--muted); font-size: 13px; }
.special-day-remove { border: 0; background: transparent; color: #b83244; padding: 7px; font-weight: 700; }
.booking-schedule-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 14px; }
.booking-schedule-summary { flex: 1; color: var(--muted); font-size: 14px; }
.booking-schedule-panel .message { margin-top: 12px; }
.user-management-panel { margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--line); }
.user-management-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.user-management-heading > div { display: grid; gap: 3px; }
.user-management-heading > div > strong { font-size: 17px; }
.user-management-heading > div > span { color: var(--muted); font-size: 14px; }
.user-selector { margin-top: 14px; }
.user-selector select { max-width: 520px; font-weight: 800; }
.user-form { margin-top: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #f8faff; }
.user-form label small { color: var(--muted); font-size: 12px; font-weight: 500; }
.user-form input[readonly] { color: #6f7d8d; background: #edf1f5; }
.permissions-fieldset { margin: 15px 0 0; padding: 13px; border: 1px solid #cfd8e6; border-radius: 13px; background: #fff; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.permissions-fieldset legend { padding: 0 7px; color: var(--ink); font-size: 14px; font-weight: 800; }
.permissions-fieldset label { position: relative; min-height: 70px; padding: 11px 12px 11px 44px; border: 1px solid #d9e1eb; border-radius: 11px; background: #fbfcff; cursor: pointer; }
.permissions-fieldset input { position: absolute; left: 13px; top: 13px; width: 20px; min-height: 20px; height: 20px; padding: 0; accent-color: var(--blue); }
.permissions-fieldset label > span { display: grid; gap: 3px; }
.permissions-fieldset label small { color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.35; }
.permissions-fieldset:disabled { opacity: .72; }
.administrator-account-note { margin: 14px 0 0; padding: 11px 13px; border-radius: 10px; background: var(--blue-soft); color: var(--blue-dark); font-size: 14px; font-weight: 700; }
.user-form .message { margin-top: 13px; }
.user-form-actions { margin-top: 14px; display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.user-form-status { flex: 1; color: var(--muted); font-size: 14px; }
.clients-panel { margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--line); }
.clients-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.clients-heading > div { display: grid; gap: 3px; }
.clients-heading strong { font-size: 17px; }
.clients-heading span { color: var(--muted); font-size: 14px; }
.clients-count { flex: 0 0 auto; padding: 8px 11px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark) !important; font-weight: 800; }
.clients-toolbar { margin-top: 14px; display: grid; grid-template-columns: minmax(240px, 1fr) auto; align-items: end; gap: 10px; }
.clients-table-wrap { margin-top: 14px; overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
.clients-table { width: 100%; min-width: 760px; border-collapse: collapse; background: #fff; }
.clients-table th, .clients-table td { padding: 12px 14px; border-bottom: 1px solid #e8edf2; text-align: left; vertical-align: middle; }
.clients-table th { position: sticky; top: 0; z-index: 1; background: #f4f7fa; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.clients-table td { color: var(--ink); font-size: 14px; }
.clients-table td:first-child { font-weight: 800; }
.clients-table td:last-child { text-align: center; font-weight: 800; }
.clients-table a { color: var(--blue-dark); font-weight: 800; text-decoration: none; }
.clients-table tbody tr:last-child td { border-bottom: 0; }
.clients-empty { margin: 0; padding: 28px 18px; color: var(--muted); text-align: center; }
.clients-panel .message { margin-top: 12px; }

.schedule-card { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.schedule-heading { padding: 19px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: linear-gradient(90deg, #fff, #f8faff); }
.schedule-heading h1 { margin: 0; font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -.025em; }
.schedule-card.closed-day .schedule-heading .primary-button { display: none; }
.schedule-card.load-failed .schedule-heading .primary-button { display: none; }
.schedule-card.availability-only .schedule-heading .primary-button { display: none; }
.schedule-card.availability-only .schedule { max-height: none; min-height: 0; overflow: visible; }
.employee-mobile-view-tabs { display: none; }
.employee-bookings-list { display: grid; gap: 10px; padding: 14px 16px 20px; }
.employee-booking-card { width: 100%; min-height: 88px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: #fff; color: var(--ink); display: grid; grid-template-columns: minmax(92px, auto) 1fr auto; align-items: center; gap: 14px; text-align: left; box-shadow: 0 5px 16px rgba(30,49,84,.05); }
.employee-booking-card.editable { cursor: pointer; }
.employee-booking-card.editable:hover { border-color: #9bbdce; background: #f8fcfd; transform: translateY(-1px); }
.employee-booking-time { color: var(--blue-dark); font-size: 17px; font-weight: 900; white-space: nowrap; }
.employee-booking-main { min-width: 0; display: grid; gap: 3px; }
.employee-booking-main strong { overflow: hidden; color: var(--ink); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.employee-booking-main span { color: var(--blue-dark); font-size: 14px; font-weight: 800; }
.employee-booking-main small { overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.employee-booking-card > b { color: var(--ink); font-size: 15px; white-space: nowrap; }
.mobile-availability-view { display: grid; gap: 0; padding: 6px 22px 22px; }
.availability-helper { margin: 14px 0 4px; color: var(--muted); font-size: 14px; }
.availability-group { padding: 17px 0 19px; border-bottom: 1px solid var(--line); }
.availability-group:last-child { border-bottom: 0; }
.availability-group h2 { margin: 0 0 12px; color: var(--ink); font-size: 15px; }
.availability-times { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 120px)); gap: 10px; }
.availability-time-button { min-height: 48px; border: 1px solid #dce3ee; border-radius: 999px; background: #f1f4fa; color: var(--ink); font-size: 15px; font-weight: 800; }
.availability-time-button:hover { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); }
.availability-time-button:active { border-color: var(--blue); background: var(--blue); color: #fff; transform: scale(.97); }
.availability-empty { display: grid; gap: 5px; margin: 16px 0 2px; padding: 22px 16px; border: 1px dashed #cfd8e6; border-radius: 15px; background: #f8faff; text-align: center; }
.availability-empty strong { font-size: 16px; }
.availability-empty span { color: var(--muted); font-size: 14px; }
.schedule { overflow: auto; max-height: calc(100vh - 315px); min-height: 420px; overscroll-behavior: contain; scrollbar-gutter: stable; }
.closed-day-view { min-height: 360px; padding: 48px 22px; display: grid; align-content: center; justify-items: center; gap: 8px; text-align: center; }
.closed-day-view strong { font-size: 20px; }
.closed-day-view span { max-width: 600px; color: var(--muted); line-height: 1.55; }
.connection-error-view { min-height: 320px; padding: 44px 22px; display: grid; align-content: center; justify-items: center; gap: 10px; text-align: center; }
.connection-error-view strong { font-size: 20px; }
.connection-error-view span { max-width: 590px; color: var(--muted); line-height: 1.55; }
.connection-error-view .text-button { margin-top: 6px; }
.schedule-grid { --row-height: 22px; display: grid; grid-template-columns: 76px repeat(6, minmax(145px, 1fr)); grid-template-rows: 58px repeat(64, var(--row-height)); min-width: 950px; position: relative; }
.lane-header, .time-label { position: sticky; background: #fbfcfe; z-index: 5; }
.lane-header { top: 0; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); font-weight: 800; color: #22304a; }
.lane-header small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; margin-left: 5px; }
.corner-cell { left: 0; z-index: 7; border-left: 0; color: var(--muted); font-size: 13px; }
.time-label { left: 0; display: flex; align-items: flex-start; justify-content: center; padding-top: 2px; color: var(--muted); font-size: 12px; border-right: 1px solid var(--line); z-index: 6; }
.time-label.hour { color: var(--ink); font-weight: 800; }
.slot { border: 0; border-left: 1px solid var(--line); border-bottom: 1px solid #edf0f5; background: #fff; position: relative; padding: 0; }
.slot.quarter { border-bottom-color: #d8dee8; }
.slot.selectable:hover { background: #f7f9ff; }
.slot.selectable::after { content: "+"; position: absolute; inset: 7px; color: transparent; border: 1px dashed transparent; border-radius: 7px; display: grid; place-items: center; font-weight: 800; }
.slot.selectable:hover::after { color: var(--blue); border-color: #bcc6ff; background: var(--blue-soft); }
.booking-block { z-index: 3; margin: 3px 5px; border: 0; border-radius: 10px; padding: 8px 10px; color: #fff; text-align: left; overflow: hidden; background: linear-gradient(135deg, #4968db, #6f7fe7); box-shadow: 0 5px 13px rgba(62,80,191,.2); min-height: 36px; }
.booking-block strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.booking-block span { display: block; margin-top: 3px; opacity: .87; font-size: 12px; white-space: nowrap; }
.booking-block.admin-booking { cursor: pointer; }
.booking-block.admin-booking:hover { filter: brightness(.96); transform: translateY(-1px); }
.booking-block.private-booking strong { font-weight: 700; }
.booking-block.selected { background: linear-gradient(135deg, #139967, #24b67e); }
.mobile-lane-switcher { display: none; }

.loading-state { padding: 10px 22px; color: var(--muted); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 9px; }
.loading-state span { width: 15px; height: 15px; border: 2px solid #cbd3df; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.message { padding: 11px 13px; border-radius: 10px; font-size: 14px; }
.message.error { color: #a62f40; background: var(--red-soft); border: 1px solid #f1c8ce; }
#scheduleError { margin: 14px 22px 0; }

.dialog { width: min(760px, calc(100% - 24px)); max-height: calc(100vh - 24px); border: 0; padding: 0; border-radius: 22px; background: transparent; box-shadow: 0 30px 90px rgba(9,17,35,.35); }
.dialog::backdrop { background: rgba(10,17,31,.62); backdrop-filter: blur(3px); }
.small-dialog { width: min(440px, calc(100% - 24px)); }
.dialog-card { background: #fff; border-radius: 22px; padding: 24px; overflow: auto; }
.dialog-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.dialog-header h2 { margin: 0; font-size: 24px; }
.dialog-close { flex: 0 0 auto; }
.booking-progress { display: none; }
.booking-step + .booking-step { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.step-hint { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.booking-time-picker { display: none; }
.booking-time-empty { grid-column: 1 / -1; margin: 0; padding: 15px; border: 1px dashed #cfd8e6; border-radius: 13px; background: #f8faff; color: var(--muted); text-align: center; }
.booking-step-label, .wizard-button { display: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
label { display: grid; gap: 7px; color: var(--ink); font-size: 14px; font-weight: 700; }
label.full { grid-column: 1 / -1; }
fieldset.full { grid-column: 1 / -1; }
input, select, textarea { width: 100%; border: 1px solid #cfd6e2; background: #fff; color: var(--ink); border-radius: 10px; padding: 11px 12px; min-height: 44px; }
textarea { resize: vertical; }
.lane-fieldset { margin: 0; padding: 14px; border: 1px solid #cfd8e6; border-radius: 13px; background: #f8faff; }
.lane-fieldset legend { padding: 0 7px; color: var(--ink); font-size: 14px; font-weight: 800; }
.lane-fieldset p { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.lane-picker { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; }
.lane-choice { position: relative; cursor: pointer; }
.lane-choice input { position: absolute; opacity: 0; pointer-events: none; }
.lane-choice span { min-height: 54px; display: grid; place-items: center; border: 1px solid #ccd5e4; border-radius: 11px; background: #fff; color: #344057; font-size: 15px; font-weight: 800; transition: .16s ease; }
.lane-choice input:checked + span { color: #fff; border-color: var(--blue); background: linear-gradient(135deg, var(--blue), #64a0bd); box-shadow: 0 7px 16px rgba(57,122,163,.22); transform: translateY(-1px); }
.lane-choice input:focus-visible + span { outline: 3px solid rgba(57,122,163,.25); outline-offset: 2px; }
.lane-choice.unavailable { cursor: not-allowed; }
.lane-choice input:disabled + span { color: #98a2b3; border-style: dashed; background: #eef1f5; box-shadow: none; transform: none; }
.check-card { display: flex; grid-template-columns: none; align-items: center; gap: 11px; padding: 12px 13px; border: 1px solid #cfd6e2; border-radius: 11px; background: #fbfcff; cursor: pointer; }
.check-card input { width: 20px; min-height: 20px; height: 20px; margin: 0; padding: 0; accent-color: var(--blue); flex: 0 0 auto; }
.check-card span { display: grid; gap: 3px; }
.check-card strong { font-size: 14px; }
.check-card small { color: var(--muted); font-size: 13px; font-weight: 500; }
.booking-summary { margin-top: 17px; padding: 14px 16px; background: linear-gradient(135deg, #fff7f5, var(--blue-soft)); color: var(--blue-dark); border: 1px solid #d3e4e9; border-radius: 12px; }
.booking-summary-details { font-size: 14px; font-weight: 800; line-height: 1.45; }
.booking-total-row { margin-top: 11px; padding-top: 11px; border-top: 1px solid #cbdfe5; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.booking-total-row span { font-size: 14px; font-weight: 700; }
.booking-total-row strong { color: var(--blue-dark); font-size: 24px; }
.booking-price-formula { display: block; margin-top: 4px; color: #5c7889; font-size: 12px; font-weight: 600; }
.dialog-actions { display: flex; align-items: center; gap: 9px; margin-top: 18px; }
.dialog-spacer { flex: 1; }
.confirmation-dialog { width: min(540px, calc(100% - 24px)); }
.confirmation-card { text-align: center; }
.confirmation-mark { width: 64px; height: 64px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 34px; font-weight: 900; box-shadow: inset 0 0 0 1px rgba(35,155,139,.16); }
.confirmation-card h2 { margin: 0; font-size: 26px; }
.confirmation-note { max-width: 420px; margin: 10px auto 18px; color: var(--muted); line-height: 1.5; }
.confirmation-details { margin: 0; padding: 6px 16px; border: 1px solid var(--line); border-radius: 15px; background: #fbfdfd; text-align: left; }
.confirmation-details > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid #e8edef; }
.confirmation-details > div:last-child { border-bottom: 0; }
.confirmation-details dt { color: var(--muted); }
.confirmation-details dd { margin: 0; color: var(--ink); font-weight: 800; text-align: right; }
.confirmation-details .confirmation-total dd { color: var(--blue-dark); font-size: 21px; }
.confirmation-actions { justify-content: center; }
.hint { color: var(--muted); margin: 11px 0 0; font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; transform: translate(-50%, 140%); opacity: 0; background: var(--navy); color: #fff; padding: 12px 17px; border-radius: 11px; box-shadow: var(--shadow); transition: .24s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 800px) {
  .topbar { min-height: 110px; padding: 7px 16px; }
  .brand-logo { width: 300px; height: auto; }
  .top-actions { right: 16px; }
  .status-pill { display: none; }
  .app-shell { width: min(100% - 20px, 1460px); margin-top: 14px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .mode-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .date-nav { justify-content: space-between; }
  .date-control { flex: 1; }
  .date-control input { min-width: 0; }
  .customer-panel { align-items: flex-start; flex-direction: column; }
  .admin-panel { display: block; }
  .admin-status-row { align-items: flex-start; }
  .employee-booking-controls { align-items: stretch; flex-direction: column; }
  .employee-booking-controls .duration-picker { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .weekly-schedule { grid-template-columns: 1fr; }
  .permissions-fieldset { grid-template-columns: 1fr; }
  .special-day-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-booking-copy { min-width: 0; }
  .duration-section { margin-left: 0; width: 100%; }
  .rate-card { width: 100%; }
  .duration-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .duration-button { min-height: 50px; padding: 0 8px; }
  .schedule-heading { padding: 16px; flex-wrap: wrap; }
  .schedule-heading .primary-button { width: 100%; min-height: 50px; }
  .schedule-heading .primary-button svg { width: 22px; height: 22px; }
  .schedule { max-height: 68vh; min-height: 500px; overflow-x: hidden; }
  .form-grid { grid-template-columns: 1fr; }
  label.full { grid-column: auto; }
  fieldset.full { grid-column: auto; }
  .lane-picker { grid-template-columns: repeat(3, 1fr); }
  .dialog-card { padding: 18px; }
  .settings-dialog-card { max-height: none; }
  .dialog-actions { flex-wrap: wrap; }
  .danger-button { order: 2; width: 100%; }
}

@media (max-width: 700px) {
  body { overflow-x: hidden; }
  .customer-panel .legend { display: none; }
  .employee-mobile-view-tabs:not(.hidden) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; padding: 7px; background: #edf3f5; border-bottom: 1px solid var(--line); }
  .employee-mobile-view-tab { min-height: 44px; padding: 7px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 800; }
  .employee-mobile-view-tab.active { background: #fff; color: var(--blue-dark); box-shadow: 0 3px 12px rgba(30,49,84,.09); }
  .employee-mobile-view-tab span { min-width: 22px; min-height: 22px; margin-left: 4px; padding: 2px 6px; border-radius: 999px; background: #dce8ed; display: inline-grid; place-items: center; color: var(--blue-dark); font-size: 12px; }
  .employee-mobile-view-tab.active span { background: var(--blue); color: #fff; }
  .schedule-card.employee-bookings-view .schedule { max-height: none; min-height: 0; overflow: visible; }
  .schedule-card.employee-bookings-view .schedule-heading .primary-button { display: none; }
  .employee-bookings-list { padding: 12px; }
  .employee-booking-card { min-height: 96px; padding: 13px; grid-template-columns: 1fr auto; gap: 8px 12px; }
  .employee-booking-time { grid-column: 1 / -1; font-size: 18px; }
  .employee-booking-main small { white-space: normal; }
  .employee-booking-card > b { align-self: start; }
  .schedule-card.mobile-availability .schedule-heading .primary-button { display: none; }
  .schedule-card.mobile-availability .schedule { max-height: none; min-height: 0; overflow: visible; }
  .mobile-availability-view { display: grid; gap: 0; padding: 4px 16px 18px; }
  .availability-helper { margin: 12px 0 3px; color: var(--muted); font-size: 14px; }
  .availability-group { padding: 16px 0 18px; border-bottom: 1px solid var(--line); }
  .availability-group:last-child { border-bottom: 0; }
  .availability-group h2 { margin: 0 0 12px; color: var(--ink); font-size: 15px; }
  .availability-times { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
  .availability-time-button { min-height: 48px; border: 1px solid #dce3ee; border-radius: 999px; background: #f1f4fa; color: var(--ink); font-size: 15px; font-weight: 800; }
  .availability-time-button:hover { border-color: #bdc9e3; background: #e8edfa; }
  .availability-time-button:active { border-color: var(--blue); background: var(--blue); color: #fff; transform: scale(.97); }
  .availability-empty { display: grid; gap: 5px; margin: 16px 0 2px; padding: 22px 16px; border: 1px dashed #cfd8e6; border-radius: 15px; background: #f8faff; text-align: center; }
  .availability-empty strong { font-size: 16px; }
  .availability-empty span { color: var(--muted); font-size: 14px; }
  .mobile-lane-switcher { position: sticky; top: 0; z-index: 12; display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px; background: rgba(248,250,255,.96); border-bottom: 1px solid var(--line); scrollbar-width: none; scroll-snap-type: x proximity; }
  .mobile-lane-switcher::-webkit-scrollbar { display: none; }
  .mobile-lane-button { flex: 0 0 108px; min-height: 54px; padding: 7px 10px; border: 1px solid #d2d9e7; border-radius: 12px; background: #fff; color: var(--ink); text-align: left; scroll-snap-align: center; }
  .mobile-lane-button strong, .mobile-lane-button span { display: block; white-space: nowrap; }
  .mobile-lane-button strong { font-size: 14px; }
  .mobile-lane-button span { margin-top: 3px; color: var(--muted); font-size: 12px; }
  .mobile-lane-button.active { border-color: var(--blue); color: #fff; background: linear-gradient(135deg, var(--blue), #68a3be); box-shadow: 0 7px 18px rgba(57,122,163,.22); }
  .mobile-lane-button.active span { color: #eaf0ff; }
  .mobile-schedule-grid { --row-height: 30px; grid-template-columns: 72px minmax(0, 1fr); min-width: 0; }
  .mobile-schedule-grid .lane-header { top: 75px; min-height: 58px; }
  .mobile-schedule-grid .corner-cell { left: 0; }
  .mobile-schedule-grid .time-label { font-size: 13px; padding-top: 5px; }
  .mobile-schedule-grid .slot.selectable::after { inset: 5px 10px; }
  .mobile-schedule-grid .slot.selectable:active::after { color: var(--blue); border-color: #bcc6ff; background: var(--blue-soft); }
  .mobile-schedule-grid .booking-block { margin: 4px 9px; padding: 9px 12px; border-radius: 12px; }
  .mobile-schedule-grid .booking-block strong { font-size: 15px; }
  .mobile-schedule-grid .booking-block span { font-size: 13px; }

  .dialog { inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-height: none; margin: 0; border-radius: 0; }
  .dialog-card { height: 100%; border-radius: 0; padding: 0 16px 16px; }
  .dialog-header { position: sticky; top: 0; z-index: 4; margin: 0 -16px 16px; padding: 15px 16px 12px; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); }
  .settings-tabs { position: sticky; top: 72px; z-index: 3; margin: 0 0 16px; }
  .dialog-header h2 { font-size: 21px; }
  .booking-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 18px; }
  .booking-progress span { min-width: 0; display: grid; justify-items: center; gap: 5px; color: #8b99a6; font-size: 12px; font-weight: 800; text-align: center; }
  .booking-progress span::after { content: ""; width: 100%; height: 3px; border-radius: 999px; background: #e3e9ec; grid-row: 1; grid-column: 1; align-self: center; }
  .booking-progress i { z-index: 1; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #e3e9ec; color: #6d7e8c; font-style: normal; grid-row: 1; grid-column: 1; }
  .booking-progress span.active, .booking-progress span.done { color: var(--blue-dark); }
  .booking-progress span.active::after, .booking-progress span.done::after { background: #9cc2d4; }
  .booking-progress span.active i, .booking-progress span.done i { background: var(--blue); color: #fff; }
  .booking-step { display: none; }
  .booking-step.active { display: block; }
  .booking-step + .booking-step { margin-top: 0; padding-top: 0; border-top: 0; }
  .booking-start-field select { display: none; }
  .booking-time-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
  .booking-time-button { min-height: 48px; border: 1px solid #d5e0e4; border-radius: 999px; background: #f4f7f8; color: var(--ink); font-weight: 800; }
  .booking-time-button small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 700; }
  .booking-time-button.active { border-color: var(--blue); background: var(--blue); color: #fff; box-shadow: 0 6px 15px rgba(57,122,163,.22); }
  .booking-time-button.active small { color: #e8f5fa; }
  .form-grid { gap: 13px; }
  input, select, textarea { min-height: 50px; font-size: 16px; }
  .lane-choice span { min-height: 58px; font-size: 16px; }
  .booking-summary { font-size: 14px; line-height: 1.45; }
  .dialog-actions { position: sticky; bottom: -16px; z-index: 4; margin: 18px -16px -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.98); border-top: 1px solid var(--line); box-shadow: 0 -8px 22px rgba(25,38,65,.08); }
  .dialog-actions .dialog-spacer { display: none; }
  .dialog-actions .text-button { display: none; }
  .dialog-actions .wizard-button { display: inline-flex; flex: 1; min-height: 52px; }
  .dialog-actions .wizard-button.hidden { display: none; }
  .booking-step-label { display: block; flex: 1 1 100%; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
  .dialog-actions .primary-button { flex: 1; min-height: 52px; }
  .dialog-actions .danger-button { flex: 1 1 100%; }
  .confirmation-dialog { inset: 0; display: none; width: 100vw; height: 100vh; height: 100dvh; max-height: none; margin: 0; }
  .confirmation-dialog[open] { display: grid; }
  .confirmation-card { height: 100%; display: grid; align-content: center; padding: 28px 20px; }
  .confirmation-actions { position: static; margin: 22px 0 0; padding: 0; background: transparent; border: 0; box-shadow: none; }
  .confirmation-actions .text-button { display: inline-flex; flex: 1; min-height: 52px; align-items: center; justify-content: center; }
}

@media (max-width: 520px) {
  .topbar { min-height: 96px; }
  .brand-logo { width: 260px; height: auto; }
  .top-actions { display: none; }
  .date-nav .text-button { display: none; }
  .app-shell { width: calc(100% - 12px); margin-top: 8px; }
  .toolbar { padding: 8px; margin-bottom: 8px; }
  .customer-panel { padding: 14px; margin-bottom: 8px; }
  .admin-panel { padding: 14px; margin-bottom: 8px; }
  .admin-status-row { gap: 12px; }
  .admin-actions { flex-wrap: wrap; justify-content: flex-end; }
  .user-management-heading { align-items: stretch; flex-direction: column; }
  .user-management-heading .primary-button { width: 100%; }
  .user-selector select { max-width: none; }
  .user-form { padding: 12px; }
  .user-form-actions { align-items: stretch; flex-direction: column; }
  .user-form-actions .primary-button { width: 100%; }
  .settings-tabs { grid-template-columns: 1fr; }
  .settings-tab { min-height: 42px; }
  .clients-heading { align-items: flex-start; flex-direction: column; }
  .clients-toolbar { grid-template-columns: 1fr; }
  .tariff-settings { align-items: stretch; flex-direction: column; }
  .tariff-settings label { width: 100%; }
  .weekly-schedule-row { align-items: stretch; flex-direction: column; }
  .weekday-toggle { min-width: 0; }
  .weekday-times { width: 100%; }
  .special-day-fields { grid-template-columns: 1fr; }
  .booking-schedule-actions { align-items: stretch; flex-direction: column; }
  .booking-schedule-actions .primary-button { width: 100%; }
  .quick-booking-copy { display: none; }
  .legend { font-size: 13px; gap: 10px; }
  .legend { width: 100%; justify-content: space-between; }
  .schedule-card { border-radius: 17px; }
  .schedule-heading h1 { font-size: 21px; }
}

@media (max-width: 370px) {
  .availability-times { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .booking-time-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
