/* Bradao Booking — стили кабинета.
   Цвета заданы переменными: поменяй их здесь, и изменится весь сайт. */
:root {
  --bg: #F4F5F3;
  --surface: #FFFFFF;
  --soft: #F7F8F7;
  --ink: #1A1F24;
  --muted: #5B646D;
  --line: #E3E6E8;
  --line-strong: #CDD3D8;
  --sidebar: #2E3A50;
  --sidebar-2: #3A4760;
  --sidebar-ink: #C9D2E0;
  --sidebar-active: #46546F;
  --admin: #F2D21B;
  --admin-ink: #2B2400;
  --accent: #2B5F95;
  --accent-dark: #1F4770;
  --accent-tint: #E8EFF7;
  --good: #236343;  --good-tint: #E6F2EB;  --good-line: #A9D2B9;
  --warn: #7A5306;  --warn-tint: #FBF1DC;
  --bad: #9A3127;   --bad-tint: #F8E9E7;   --bad-line: #E2B5AF;
  /* Цвета записей в журнале: тело — статус визита, шапка — откуда запись */
  --st-planned: #CFEFD9;   --st-planned-line: #7FC79A;     /* Ожидание — зелёный */
  --st-confirmed: #D6E4F7; --st-confirmed-line: #8FB3E3;   /* Подтвердил — голубой */
  --st-arrived: #F7C7A3;   --st-arrived-line: #E8955F;     /* Клиент пришёл — оранжевый */
  --st-no_show: #F5BDB7;   --st-no_show-line: #DD7368;     /* Не пришёл — красный */
  --st-completed: #F4DECB; --st-completed-line: #D9A57E;   /* Оплачен — бледно-оранжевый */
  --src-manual: #2E9E6B;   /* шапка: запись создана вручную — зелёный */
  --src-online: #9C8CE6;   /* шапка: онлайн-запись — светло-фиолетовый */
  --radius: 10px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--bg); }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1 { font-size: 22px; font-weight: 600; margin: 0; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Каркас ---------------------------------------------------------------- */
.layout { display: flex; min-height: 100%; }
.sidebar { width: 236px; flex-shrink: 0; background: var(--sidebar); color: #E9EDF3; display: flex; flex-direction: column; gap: 14px; padding: 14px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; font-weight: 600; font-size: 16px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--admin); color: var(--admin-ink); display: grid; place-items: center; font-weight: 700; }

.calendar { background: var(--sidebar-2); border-radius: 12px; padding: 10px 8px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.cal-nav { all: unset; cursor: pointer; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; color: var(--sidebar-ink); font-size: 16px; }
.cal-nav:hover { background: var(--sidebar-active); color: #fff; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.cal-wd { font-size: 10px; color: var(--sidebar-ink); text-transform: lowercase; padding-bottom: 2px; }
.cal-day { display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; font-size: 11.5px; color: #E9EDF3; text-decoration: none; border: 1px solid rgba(255,255,255,.18); font-variant-numeric: tabular-nums; }
.cal-day:hover { background: var(--sidebar-active); color: #fff; }
.cal-day.weekend { color: #F4C9A6; }
.cal-day.other { opacity: .4; }
.cal-day.today { border-color: var(--admin); border-width: 2px; }
.cal-day.selected { background: #fff; color: var(--sidebar); font-weight: 700; border-color: #fff; }

.fav { background: transparent; }
.fav summary { cursor: pointer; list-style: none; padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.fav summary::-webkit-details-marker { display: none; }
.fav summary::after { content: "▾"; float: right; color: var(--sidebar-ink); }
.fav:not([open]) summary::after { content: "▸"; }
.fav summary:hover { background: var(--sidebar-2); }
.fav-links { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.fav-links a { padding: 7px 12px 7px 26px; border-radius: 8px; color: var(--sidebar-ink); text-decoration: none; font-size: 14px; }
.fav-links a:hover { background: var(--sidebar-2); color: #fff; }
.fav-links a.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }

.account { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 10px 8px 0; border-top: 1px solid rgba(255,255,255,.12); }
.account-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; margin: -6px; border-radius: 10px; color: #E9EDF3; text-decoration: none; }
.account-link:hover, .account-link.active { background: var(--sidebar-2); color: #fff; }
.account-ava { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; overflow: hidden; display: grid; place-items: center; background: #E6E3FA; color: #6B5FD3; font-size: 13px; font-weight: 700; }
.account-ava img { width: 100%; height: 100%; object-fit: cover; }
.account-who { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.account-who b { font-weight: 600; }
.account-who span { color: var(--sidebar-ink); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { all: unset; cursor: pointer; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--sidebar-ink); font-size: 16px; }
.icon-btn:hover { background: var(--sidebar-active); color: #fff; }
.icon-btn.dark { color: var(--muted); }
.icon-btn.dark:hover { background: var(--soft); color: var(--ink); }
.admin-btn { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; font-size: 14.5px; white-space: nowrap; border-radius: 10px; background: var(--admin); color: var(--admin-ink); font-weight: 700; text-decoration: none; }
.admin-btn:hover, .admin-btn.active { background: #FFE14D; color: var(--admin-ink); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 28px; background: var(--surface); border-bottom: 1px solid var(--line); }
.page-head .spacer { flex: 1; }
.content { padding: 22px 28px 40px; display: flex; flex-direction: column; gap: 18px; }

/* --- Элементы -------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-danger { color: var(--bad); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tile span { display: block; font-size: 12px; color: var(--muted); }
.tile b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }

.messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.messages li { padding: 10px 14px; border-radius: 8px; background: var(--accent-tint); color: var(--accent-dark); }
.messages li.success { background: var(--good-tint); color: var(--good); }
.messages li.error { background: var(--bad-tint); color: var(--bad); }
.messages li.warning { background: var(--warn-tint); color: var(--warn); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #EEF0F2; color: #3B444C; }
.badge.s-planned { background: var(--st-planned); color: #1E5E3C; }
.badge.s-confirmed { background: var(--st-confirmed); color: #24497A; }
.badge.s-arrived { background: var(--st-arrived); color: #7A3E12; }
.badge.s-completed { background: var(--st-completed); color: #6B3A12; }
.badge.s-no_show { background: var(--st-no_show); color: #7D221A; }
.badge.s-cancelled { background: #EEF0F2; color: #8A949B; text-decoration: line-through; }

/* --- Таблицы --------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--soft); padding: 10px 14px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 14px; border-bottom: 1px solid #EEF0F1; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .right { text-align: right; }
.table-wrap { overflow-x: auto; }

/* --- Формы ----------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13px; font-weight: 500; }
.field input[type=text], .field input[type=email], .field input[type=date], .field input[type=time],
.field input[type=number], .field input[type=search], .field input[type=password], .field select, .field textarea, .search {
  font: inherit; font-size: 15px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); width: 100%;
}
.field textarea { resize: vertical; }
.field .help { font-size: 12px; color: var(--muted); }
.errorlist { list-style: none; margin: 0; padding: 0; color: var(--bad); font-size: 13px; }
.form-errors { background: var(--bad-tint); color: var(--bad); border-radius: 8px; padding: 10px 14px; }
.checks { display: flex; flex-direction: column; gap: 6px; }
.checks label, .radios label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 400; }
.checks input, .radios input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.radios { display: flex; gap: 8px; flex-wrap: wrap; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* --- Журнал ---------------------------------------------------------------- */
body:has(.journal-wrap) .main { height: 100vh; }
.journal-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.journal-top h1 { font-size: 18px; }
.journal-top .spacer { flex: 1; }
.journal-messages { padding: 10px 20px 0; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.lg-planned { background: var(--st-planned); border: 1px solid var(--st-planned-line); }
.lg-confirmed { background: var(--st-confirmed); border: 1px solid var(--st-confirmed-line); }
.lg-arrived { background: var(--st-arrived); border: 1px solid var(--st-arrived-line); }
.lg-no_show { background: var(--st-no_show); border: 1px solid var(--st-no_show-line); }
.lg-manual { background: var(--src-manual); }
.lg-online { background: var(--src-online); }

.journal-wrap { flex: 1; min-height: 0; overflow: auto; background: var(--surface); }
.journal { display: grid; grid-template-columns: 52px repeat(var(--cols), minmax(190px, 1fr)) 52px; min-width: fit-content; }
.j-corner, .j-head { position: sticky; top: 0; z-index: 5; background: var(--soft); border-bottom: 1px solid var(--line-strong); height: 58px; }
.j-head { display: flex; align-items: center; gap: 10px; padding: 0 12px; border-left: 1px solid var(--line); min-width: 0; }
.j-head div { display: flex; flex-direction: column; min-width: 0; }
.j-head b { text-transform: uppercase; font-size: 14px; letter-spacing: .02em; }
.j-head span { text-transform: uppercase; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 34px; height: 34px; border-radius: 8px; background: var(--sidebar); color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 600; flex-shrink: 0; }

.j-times { position: relative; }
.j-time { position: absolute; right: 8px; font-size: 13px; font-weight: 600; transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.j-time:first-child { transform: translateY(2px); }
.j-time sup { font-size: 9px; margin-left: 1px; }
.j-time.half { font-size: 11px; font-weight: 400; color: var(--muted); }
.j-times.right .j-time { right: auto; left: 8px; }

/* Колонка мастера: серое — вне графика, белое — рабочее время. Линии — каждые 30 минут (44px). */
.j-col { position: relative; border-left: 1px solid var(--line); background: #E9ECEF;
  background-image: repeating-linear-gradient(to bottom, #D8DDE1 0 1px, transparent 1px 44px, #E1E5E8 44px 45px, transparent 45px 88px); }
.j-pause { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, #E4E7EA 0 6px, #EEF0F2 6px 12px); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); overflow: hidden; }
.j-pause span { display: block; padding: 3px 8px; font-size: 11.5px; color: var(--muted); }
.j-col.day-off::after { content: attr(data-off); position: absolute; top: 16px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 13px; }
.j-work { position: absolute; left: 0; right: 0; background: #fff;
  background-image: repeating-linear-gradient(to bottom, #DDE2E6 0 1px, transparent 1px 44px, #EEF1F3 44px 45px, transparent 45px 88px); }
.j-slot { all: unset; position: absolute; left: 0; right: 0; height: 44px; cursor: pointer; box-sizing: border-box; }
.j-slot span { display: none; position: absolute; right: 8px; top: 6px; font-size: 12px; color: var(--src-manual); font-weight: 600; }
.j-slot:hover { background: rgba(46, 158, 107, .08); }
.j-slot:hover span { display: block; }
.j-slot:focus-visible { outline: 2px solid var(--src-manual); outline-offset: -2px; }

.appt { all: unset; box-sizing: border-box; position: absolute; left: 5px; right: 5px; z-index: 2; cursor: pointer; border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; font-size: 12px; line-height: 1.3; color: var(--ink); background: var(--st-planned); border: 1px solid var(--st-planned-line); }
.appt:hover { box-shadow: 0 3px 12px rgba(0,0,0,.18); z-index: 3; }
.appt:focus-visible { outline: 2px solid var(--ink); }
.appt-head { display: flex; justify-content: space-between; gap: 6px; padding: 2px 7px; background: var(--src-manual); color: #fff; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.appt.src-online .appt-head { background: var(--src-online); }
.appt-flag { font-weight: 500; opacity: .95; }
.appt-body { display: flex; flex-direction: column; padding: 3px 7px; min-height: 0; overflow: hidden; }
.appt-body > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-services { font-weight: 600; font-size: 11.5px; }
.appt-body strong { font-weight: 600; }
.appt-phone { color: #3C454D; font-variant-numeric: tabular-nums; }
.appt-comment { font-style: italic; color: #3C454D; }
.appt.sm .appt-services, .appt.sm .appt-phone, .appt.sm .appt-comment { display: none; }
.appt.md .appt-phone, .appt.md .appt-comment, .appt.lg .appt-comment { display: none; }
.appt.xs { flex-direction: row; }
.appt.xs .appt-head { align-items: center; }
.appt.xs .appt-flag, .appt.xs .appt-services, .appt.xs .appt-phone, .appt.xs .appt-comment { display: none; }
.appt.xs .appt-body { justify-content: center; }
.appt.st-confirmed { background: var(--st-confirmed); border-color: var(--st-confirmed-line); }
.appt.st-arrived { background: var(--st-arrived); border-color: var(--st-arrived-line); }
.appt.st-no_show { background: var(--st-no_show); border-color: var(--st-no_show-line); }
.appt.st-no_show strong { text-decoration: line-through; }
.appt.st-completed { background: var(--st-completed); border-color: var(--st-completed-line); }
.appt.st-cancelled { background: repeating-linear-gradient(135deg, #F1F3F4 0 6px, #fff 6px 12px); border: 1px dashed var(--line-strong); opacity: .7; }
.appt.st-cancelled .appt-head { background: #9AA3AA; }
.now { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 4; pointer-events: none; }

/* --- Окно записи --------------------------------------------------------------- */
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(20, 26, 36, .55); display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
/* Окно записи во весь экран: всё стоит на месте, прокручивается только выбор услуг
   (и список клиентов, если он длинный). Кнопка «Сохранить запись» видна всегда. */
.modal-card { width: min(1180px, 100%); height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: hidden; background: #EEF1F5; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: var(--surface); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.modal-head h2 { margin: 0; }
.btn-delete { color: var(--bad); border-color: var(--bad-line); }
.btn-delete:hover { background: var(--bad-tint); color: var(--bad); border-color: var(--bad); }
.btn-delete[hidden] { display: none; }
.modal-head .spacer { flex: 1; }
.modal-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1.35fr 1fr; gap: 12px; padding: 12px; }
.mblock { background: var(--surface); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; overflow-y: auto; }
.mblock > * { flex-shrink: 0; }
.mblock .field input, .mblock .field select, .mblock .field textarea { font: inherit; font-size: 15px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); width: 100%; }
.mblock .field select { padding-right: 6px; }
.time-row { display: flex; align-items: center; gap: 8px; }
.time-row select { flex: 1; }
.phone-row { display: flex; gap: 8px; }
.phone-row select { width: 120px !important; flex-shrink: 0; }

.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.tool { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 18px; text-align: center; color: var(--ink); background: var(--soft); }
.tool span { font-size: 12.5px; line-height: 1.25; text-align: left; }
.tool small { display: block; font-size: 10.5px; color: var(--muted); }
.tool:hover { border-color: var(--line-strong); background: #fff; }
.tool.danger { color: var(--bad); }
.tool.soon { cursor: default; opacity: .55; }
.tool[hidden] { display: none; }

.status-switch { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.st-btn { all: unset; box-sizing: border-box; cursor: pointer; text-align: center; padding: 9px 6px; border-radius: 9px; font-size: 13px; font-weight: 600; border: 2px solid transparent; background: var(--soft); color: var(--muted); }
.st-btn.st-planned { background: var(--st-planned); color: #1E5E3C; }
.st-btn.st-confirmed { background: var(--st-confirmed); color: #24497A; }
.st-btn.st-arrived { background: var(--st-arrived); color: #7A3E12; }
.st-btn.st-no_show { background: var(--st-no_show); color: #7D221A; }
.st-btn:not(.on) { opacity: .55; }
.st-btn.on { border-color: var(--ink); opacity: 1; }
.st-btn:focus-visible { outline: 2px solid var(--accent); }

.svc-box { display: flex; flex-direction: column; gap: 10px; flex: 1 1 0; min-height: 110px; overflow-y: auto; margin: 0 -6px; padding: 0 6px 4px; }
.mblock > .svc-box { flex-shrink: 1; }
.svc-box .svc-search { position: sticky; top: 0; z-index: 1; background: var(--surface); box-shadow: 0 -4px 0 var(--surface), 0 8px 0 var(--surface); }
.svc-box[hidden] { display: none; }
.svc-search { font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 8px; width: 100%; }
.svc-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.svc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.svc-card { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); font-size: 12.5px; color: var(--muted); }
.svc-card b { font-size: 13.5px; color: var(--ink); font-weight: 600; }
.svc-card:hover { border-color: var(--line-strong); }
.svc-card.on { border: 2px solid var(--src-manual); background: #EAF7F0; padding: 9px 11px; }
.svc-list { display: flex; flex-direction: column; gap: 4px; }
.svc-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.svc-row:hover { background: var(--soft); }
.svc-row input { width: 17px; height: 17px; accent-color: var(--src-manual); margin: 0; }
.svc-row .muted { font-size: 12px; white-space: nowrap; }

/* Касса в окне записи */
.checkout { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: #FBFCFD; }
.checkout[hidden] { display: none; }
.checkout-items { display: flex; flex-direction: column; max-height: 136px; overflow-y: auto; }
.checkout-item { display: grid; grid-template-columns: 1fr auto 32px; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.checkout-item b { font-weight: 600; font-variant-numeric: tabular-nums; }
.checkout-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.checkout-row input { width: 110px; font: inherit; font-size: 15px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 8px; text-align: right; }
.checkout-row.total { font-size: 17px; font-weight: 700; padding-top: 4px; }
.checkout-row.total input { font-size: 17px; font-weight: 700; }
.discount-pct { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--st-planned); color: #1E5E3C; font-size: 12px; font-weight: 700; }
.discount-pct[hidden] { display: none; }
.paid-note { font-size: 13px; font-weight: 600; color: #6B3A12; background: var(--st-completed); border-radius: 8px; padding: 6px 10px; }
.paid-note[hidden] { display: none; }
.btn-pay { height: 42px; background: var(--src-manual); border-color: var(--src-manual); color: #fff; font-weight: 700; }
.btn-pay:hover { background: #247F56; border-color: #247F56; color: #fff; }
.btn-pay:disabled { opacity: .5; cursor: not-allowed; }
.btn-pay[hidden] { display: none; }

/* Окно оплаты — поверх окна записи */
.pay-modal { z-index: 60; background: rgba(20, 26, 36, .45); }
.pay-card { width: min(440px, 100%); height: auto; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); }
.pay-card .modal-head { gap: 14px; }
.pay-body { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.pay-lines { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.pay-lines > div { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.pay-lines .pay-total { font-size: 20px; font-weight: 700; padding-top: 8px; border-top: 1px solid var(--line); }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay-method { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 10px; border: 2px solid var(--line); border-radius: 12px; font-size: 26px; background: var(--soft); }
.pay-method span { font-size: 15px; font-weight: 600; }
.pay-method:hover { border-color: var(--line-strong); }
.pay-method.on { border-color: var(--src-manual); background: #EAF7F0; }
.pay-method:focus-visible { outline: 2px solid var(--accent); }
#pay-confirm { height: 46px; }
#pay-confirm[hidden], .pay-cancel[hidden], .pay-note[hidden] { display: none; }
.pay-cancel { height: 44px; border-color: var(--bad-line); }
.pay-cancel:hover { background: var(--bad-tint); color: var(--bad); border-color: var(--bad); }
.pay-note { font-size: 13px; background: var(--soft); border-radius: 8px; padding: 10px 12px; }
.pay-modal.viewing .pay-method { cursor: default; }
.pay-modal.viewing .pay-method:not(.on) { opacity: .45; }
.btn-pay.view { background: var(--surface); color: var(--src-manual); }
.btn-pay.view:hover { background: #EAF7F0; color: #1E5E3C; }
#pay-confirm:disabled { opacity: .5; cursor: not-allowed; }

.linked { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 12px; background: #EAF7F0; color: #1E5E3C; border-radius: 999px; padding: 2px 4px 2px 10px; }
.linked[hidden] { display: none; }
.linked button { all: unset; cursor: pointer; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; }
.linked button:hover { background: #CFEFD9; }
.client-list { display: flex; flex-direction: column; gap: 2px; flex: 1 1 0; min-height: 60px; overflow-y: auto; }
.mblock > .client-list { flex-shrink: 1; }
.client-item { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; padding: 7px 10px; border-radius: 8px; }
.client-item:hover { background: var(--soft); }
.client-item b { font-weight: 500; font-size: 14px; }
.client-item span { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.client-hidden { font-size: 13px; color: var(--muted); background: var(--soft); border-radius: 8px; padding: 10px 12px; }
.client-hidden[hidden], .client-fields[hidden], #bm-phone-field[hidden] { display: none; }
.client-fields { display: flex; flex-direction: column; gap: 12px; min-height: 0; flex: 1 1 0; }
.locked-note { font-size: 13px; background: var(--soft); border-radius: 8px; padding: 10px 12px; }
.locked-note[hidden], .form-errors[hidden] { display: none; }
.btn-save { margin-top: auto; height: 44px; background: var(--admin); border-color: var(--admin); color: var(--admin-ink); font-weight: 700; }
.btn-save:hover { background: #FFE14D; border-color: #FFE14D; color: var(--admin-ink); }
.btn-save[hidden] { display: none; }
.badge[hidden] { display: none; }
.badge.src-manual { background: #DDF2E7; color: #1E5E3C; }
.badge.src-online { background: #ECE8FC; color: #4B3BA0; }

/* --- Администрирование ------------------------------------------------------- */
.admin-menu { display: flex; flex-direction: column; gap: 2px; }
.am-group summary, .am-single { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; padding: 9px 10px; border-radius: 8px; color: #E9EDF3; text-decoration: none; font-size: 14.5px; font-weight: 500; }
.am-group summary::-webkit-details-marker { display: none; }
.am-group summary::after { content: "▸"; margin-left: auto; color: var(--sidebar-ink); font-size: 12px; }
.am-group[open] summary::after { content: "▾"; }
.am-group summary:hover, .am-single:hover { background: var(--sidebar-2); color: #fff; }
.am-group summary.active, .am-single.active { color: #fff; font-weight: 700; }
.am-single.active { background: var(--sidebar-active); }
.am-icon { width: 20px; text-align: center; font-size: 15px; }
.am-items { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px; }
.am-items a { padding: 7px 10px 7px 40px; border-radius: 8px; color: var(--sidebar-ink); text-decoration: none; font-size: 13.5px; }
.am-items a:hover { background: var(--sidebar-2); color: #fff; }
.am-items a.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.soon-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 640px; }
.soon-card h2 { margin: 0; }
.soon-card p { margin: 0; }
.soon-icon { font-size: 30px; }

/* --- Сотрудники ---------------------------------------------------------------- */
.head-title { display: flex; flex-direction: column; }
.btn-yellow { background: var(--admin); border-color: var(--admin); color: var(--admin-ink); font-weight: 600; }
.btn-yellow:hover { background: #FFE14D; border-color: #FFE14D; color: var(--admin-ink); }
.btn-add { background: #FDF3C4; border-color: #F5E08A; color: #6B5A00; font-weight: 600; }
.btn-add:hover { background: var(--admin); color: var(--admin-ink); }
.staff-filters { display: flex; flex-direction: column; gap: 14px; }
.staff-search { max-width: 900px; flex: 1; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 220px)); gap: 14px; }
.filter-grid .field span { font-size: 13px; color: var(--muted); }
.filter-grid select { font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 14px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--admin); font-weight: 600; }
.staff-group { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.staff-group summary { cursor: pointer; list-style: none; display: flex; flex-direction: column; padding: 14px 18px 14px 44px; position: relative; }
.staff-group summary::-webkit-details-marker { display: none; }
.staff-group summary::before { content: "⌄"; position: absolute; left: 18px; top: 14px; font-size: 18px; color: var(--muted); }
.staff-group[open] summary::before { content: "⌃"; top: 20px; }
.staff-group[open] summary { border-bottom: 1px solid var(--line); }
.staff-table { border: 0; border-radius: 0 0 12px 12px; table-layout: fixed; min-width: 760px; }
/* Одинаковые колонки во всех группах */
.staff-table th:nth-child(1) { width: 42%; }
.staff-table th:nth-child(2) { width: 20%; }
.staff-table th:nth-child(3) { width: 14%; }
.staff-table th:nth-child(4) { width: 9%; }
.staff-table th:nth-child(5) { width: 15%; }
.staff-table td { overflow-wrap: anywhere; }
.staff-table tr.dim td { opacity: .6; }
.emp { display: flex; gap: 12px; align-items: flex-start; }
.emp a { text-decoration: none; }
.emp-ava { width: 40px; height: 40px; border-radius: 10px; overflow: hidden; flex-shrink: 0; display: grid; place-items: center; background: #EEEBFB; color: #6B5FD3; font-weight: 700; font-size: 13px; }
.emp-ava img, .avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar { overflow: hidden; }
.emp-ava.big { width: 96px; height: 96px; font-size: 24px; border-radius: 16px; }
.emp-photo { display: flex; gap: 16px; align-items: center; }
.tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #EEF0F2; color: var(--muted); font-size: 11.5px; vertical-align: 1px; }
.tag.bad { background: var(--bad-tint); color: var(--bad); }
.pill-green { display: inline-block; padding: 3px 10px; border-radius: 6px; background: #E3F4E8; color: #1E6B3C; font-size: 13px; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #D5D9DD; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: #F2B705; }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.grid-2.tight { gap: 12px; }
.checks-inline { display: flex; gap: 18px; flex-wrap: wrap; }
.checks-inline label { display: flex; align-items: center; gap: 8px; }
.checks-inline input { width: 18px; height: 18px; accent-color: var(--accent); }
.staff-form .checks { max-height: 320px; overflow-y: auto; }
.form-actions { margin-top: 18px; }
.positions td { vertical-align: middle; }
.pos-icon { width: 40px; font-size: 18px; }

/* Боковая панель сотрудника */
.sp-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(20, 26, 36, .25); }
.sp-backdrop[hidden], .staff-panel[hidden] { display: none; }
.staff-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(960px, 100%); background: var(--surface);
  box-shadow: -12px 0 40px rgba(0,0,0,.18); display: flex; flex-direction: column; }
.sp-head { display: flex; align-items: center; gap: 10px; padding: 20px 24px 10px; }
.sp-head h2 { margin: 0; font-size: 24px; }
.sp-head .spacer, .sp-foot .spacer { flex: 1; }
.sp-tabs { display: flex; gap: 6px; padding: 6px 24px 12px; overflow-x: auto; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.sp-tabs button { all: unset; cursor: pointer; white-space: nowrap; padding: 8px 12px; border-radius: 8px; background: var(--soft); font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sp-tabs button:hover { color: var(--ink); }
.sp-tabs button.active { background: #FDF3C4; color: var(--ink); font-weight: 600; }
.sp-tabs .count { background: var(--admin); color: var(--admin-ink); border-radius: 999px; padding: 0 7px; font-size: 12px; }
.sp-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.sp-sec { display: flex; flex-direction: column; gap: 14px; max-width: 820px; }
.sp-sec[hidden] { display: none; }
.sp-sec h3 { margin: 6px 0 0; font-size: 18px; font-weight: 600; }
.sp-info { display: grid; grid-template-columns: 1fr 220px; gap: 28px; align-items: start; }
.sp-photo { display: flex; flex-direction: column; gap: 10px; }
.sp-photo input[type=file] { display: none; }
.sp-photo .emp-ava.big { width: 140px; height: 140px; }
.sp-services { max-height: none; }
.check-line { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check-line input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; accent-color: #E0A800; }
.check-line small { display: block; color: var(--muted); font-size: 12.5px; }
.switch-line { align-items: center; }
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-cards.three { grid-template-columns: repeat(3, 1fr); }
.choice-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 40px 14px 16px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; }
.choice-card b { font-size: 15px; }
.choice-card span { font-size: 13px; color: var(--muted); }
.choice-card input { position: absolute; right: 14px; top: 16px; width: 18px; height: 18px; accent-color: #E0A800; }
.choice-card:has(input:checked) { border: 2px solid var(--admin); padding: 13px 39px 13px 15px; background: #FFFBEA; }
.sp-login[hidden] { display: none; }
.perm-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.perm-copy { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.perm-copy select, .perm-select select { font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.perm-tools .svc-search { max-width: 320px; }
.perm-owner-note { font-size: 13px; background: #FFFBEA; border: 1px solid #F5E08A; border-radius: 8px; padding: 10px 12px; }
.perm-owner-note[hidden] { display: none; }
.perm-groups { display: flex; flex-direction: column; gap: 8px; }
.perm-group { background: var(--soft); border-radius: 12px; }
.perm-group[hidden] { display: none; }
.perm-group summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 40px; position: relative; }
.perm-group summary::-webkit-details-marker { display: none; }
.perm-group summary::before { content: "⌄"; position: absolute; left: 16px; top: 12px; color: var(--muted); font-size: 16px; }
.perm-group[open] summary::before { content: "⌃"; top: 18px; }
.perm-group-title { flex: 1; display: flex; flex-direction: column; }
.perm-list { padding: 4px 16px 14px 40px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); border-radius: 0 0 12px 12px; }
.perm-item[hidden] { display: none; }
.perm-check { display: flex; gap: 10px; align-items: flex-start; padding: 4px 0; cursor: pointer; font-size: 14px; }
.perm-check input { width: 17px; height: 17px; margin-top: 1px; accent-color: #E0A800; flex-shrink: 0; }
.perm-select { display: flex; flex-direction: column; gap: 4px; padding: 4px 0; font-size: 13px; color: var(--muted); max-width: 420px; }
.perm-children { padding-left: 27px; display: flex; flex-direction: column; gap: 2px; }
.perm-children.off { opacity: .45; }
.sp-foot { display: flex; gap: 10px; align-items: center; padding: 14px 24px; border-top: 1px solid var(--line); flex-shrink: 0; }
@media (max-width: 860px) {
  .sp-info, .choice-cards, .choice-cards.three { grid-template-columns: 1fr; }
}

/* --- Личный кабинет ---------------------------------------------------------- */
.acc { display: grid; grid-template-columns: 250px 1fr; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-height: 480px; }
.acc-menu { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-right: 1px solid var(--line); }
.acc-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 15px; }
.acc-menu a span { width: 20px; text-align: center; }
.acc-menu a:hover { background: var(--soft); }
.acc-menu a.active { background: #F1EFFC; font-weight: 600; }
.acc-body { padding: 24px 28px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.acc-body h2 { margin: 0; }
.acc-avatar { width: 136px; height: 136px; border-radius: 16px; overflow: hidden; display: grid; place-items: center; background: #EEEBFB; color: #8C80E6; font-size: 30px; font-weight: 500; }
.acc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.acc-photo-btn { cursor: pointer; }
.acc-hint { margin: -10px 0 0; }
.acc-field { display: flex; flex-direction: column; gap: 4px; }
.acc-label { font-size: 13px; color: var(--muted); }
.acc-view { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.acc-pencil { all: unset; cursor: pointer; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.acc-pencil:hover { background: var(--soft); color: var(--ink); }
.acc-edit { display: none; align-items: center; gap: 8px; flex-wrap: wrap; }
.acc-edit input[name=value] { font: inherit; font-size: 15px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 8px; min-width: 260px; }
.acc-field.editing .acc-view { display: none; }
.acc-field.editing .acc-edit { display: flex; }
.acc-form { max-width: 420px; }
.acc-info { max-width: 520px; border: 0; }
@media (max-width: 860px) {
  .acc { grid-template-columns: 1fr; }
  .acc-menu { border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; }
}

/* --- Вход ------------------------------------------------------------------ */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.auth .card { width: 100%; max-width: 380px; }

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; }
  .calendar { max-width: 320px; }
  body:has(.journal-wrap) .main { height: auto; }
  .journal-wrap { max-height: 80vh; }
  .modal { padding: 0; }
  .modal-card { height: 100vh; border-radius: 0; overflow-y: auto; }
  .modal-cols { grid-template-columns: 1fr; flex: none; }
  .mblock { overflow: visible; }
  .svc-box, .client-list { flex: none; max-height: 320px; }
  .grid-2 { grid-template-columns: 1fr; }
  .page-head, .content { padding-left: 16px; padding-right: 16px; }
}

/* --- График работы ----------------------------------------------------------- */
/* Цвета типов дня: поменяй здесь — изменится и таблица, и легенда. */
.k-work     { --k-bg: #CFF3D6; --k-line: #9BDDA9; --k-ink: #1F6B34; }
.k-day_off  { --k-bg: #EEF0F2; --k-line: #D5DADF; --k-ink: #5B646D; }
.k-sick     { --k-bg: #E3EBFD; --k-line: #A9BFF3; --k-ink: #2F4FA8; }
.k-vacation { --k-bg: #EEE8FD; --k-line: #C3B2F2; --k-ink: #5B3FB5; }
.k-unpaid   { --k-bg: #FFF1D6; --k-line: #F4CC7A; --k-ink: #8A5A00; }
.k-absence  { --k-bg: #FBE3E1; --k-line: #EBA59E; --k-ink: #9A3127; }
.k-paid_off { --k-bg: #FFF6CF; --k-line: #EFD66A; --k-ink: #7A6200; }
.info-dot { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid var(--muted); border-radius: 50%;
  font: italic 600 12px/1 Georgia, serif; color: var(--muted); vertical-align: 4px; margin-left: 6px; cursor: help; }
.btn-outline-yellow { border: 2px solid var(--admin); }
.btn-outline-yellow.on { background: #FFFBEA; }
.link-btn { all: unset; cursor: pointer; color: var(--muted); font-size: 14px; }
.link-btn:hover { color: var(--ink); }
.link-btn.danger { color: var(--bad); }
.link-btn[hidden] { display: none; }
.badge-count { display: inline-block; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; font-size: 12px; color: var(--muted); font-weight: 500; }

.sch-page { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sch-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sch-toolbar .spacer { flex: 1; }
.sch-arrow { width: 36px; padding: 0; font-size: 18px; }
.sch-title { margin: 0 6px; font-size: 20px; font-weight: 500; }
.sch-views { display: flex; gap: 6px; }
.sch-views a { padding: 7px 12px; border-radius: 8px; background: var(--soft); color: var(--ink); text-decoration: none; font-size: 14px; }
.sch-views a.on { background: #3A3F46; color: #fff; }
.sch-filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.sch-filters[hidden] { display: none; }
.sch-filters .field { min-width: 200px; }

.sch-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.sch { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.sch th, .sch td { border-bottom: 1px solid var(--line); padding: 0; }
.sch thead th { background: var(--surface); position: sticky; top: 0; z-index: 2; font-weight: 400; }
/* Ширины двух закреплённых колонок: 206 + 24 (отступы) + 1 (линия) = 231px — отсюда left у «Итого». */
.sch .sch-emp { position: sticky; left: 0; z-index: 3; background: var(--surface); box-sizing: content-box; width: 206px; min-width: 206px; max-width: 206px; text-align: left; padding: 10px 12px; border-right: 1px solid var(--line); }
.sch thead .sch-emp { z-index: 4; font-weight: 600; font-size: 15px; }
.sch .sch-total { position: sticky; left: 231px; z-index: 3; background: var(--surface); box-sizing: content-box; width: 68px; min-width: 68px; padding: 8px 10px; border-right: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.sch thead .sch-total { z-index: 4; text-align: left; font-size: 14px; }
.sch-total small { display: block; font-size: 11.5px; }
td.sch-total span { display: block; line-height: 1.8; white-space: nowrap; }
.sch-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sch-name b { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sch-name span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sch-emp .emp { display: flex; align-items: center; gap: 10px; }
.sch-more { position: relative; }
.sch-more summary { list-style: none; cursor: pointer; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.sch-more summary::-webkit-details-marker { display: none; }
.sch-more summary:hover { background: var(--soft); }
.sch-menu { position: absolute; left: 0; top: 26px; z-index: 10; min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; display: flex; flex-direction: column; }
.sch-menu a, .sch-menu button { all: unset; cursor: pointer; padding: 8px 10px; border-radius: 6px; font-size: 14px; color: var(--ink); font-weight: 400; }
.sch-menu a:hover, .sch-menu button:hover { background: var(--soft); }

.sch-dh { min-width: 46px; width: 46px; text-align: center; padding: 8px 2px !important; }
.sch.week .sch-dh { min-width: 120px; }
.sch-dh b { display: block; font-size: 16px; font-weight: 500; color: var(--muted); }
.sch-dh span { display: block; font-size: 12.5px; color: var(--muted); }
.sch-dh small { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.sch-dh.weekend b, .sch-dh.weekend span { color: #E0645A; }
.sch-dh.today b { background: var(--admin); color: var(--admin-ink); border-radius: 8px; display: inline-block; padding: 0 6px; }
.sch-dh.week-start, .sch-cell.week-start { border-left: 2px solid var(--line); }
.sch-cell { height: 72px; border-left: 1px solid #EEF0F2; position: relative; }
.sch.week .sch-cell { height: 96px; }
.sch-cell.weekend { background: #FCFCFD; }
.sch-cell.today { background: #FFFDF2; }
.can-edit .sch-cell { cursor: pointer; }
.can-edit .sch-cell:hover { background: #F5F7FA; }
.sch-cell.selected { background: #F3F6FB; }
.sch-cell.selected::after { content: ""; position: absolute; inset: 3px; border: 1.5px dashed #2E9E6B; border-radius: 6px; pointer-events: none; }
.sch-day { position: absolute; inset: 3px 2px; border-radius: 6px; background: var(--k-bg); color: var(--k-ink); display: flex; flex-direction: column; align-items: center; padding: 4px 1px; font-size: 10px; line-height: 1.25; overflow: hidden; }
.sch.week .sch-day { font-size: 12.5px; padding: 6px 8px; align-items: flex-start; }
.sch-day .ico { font-size: 15px; line-height: 1.3; }
.sch-day .lbl { font-size: 12px; }
.sch-day .brk { font-size: 10px; opacity: .85; }
.sch-day .cnt { margin-top: auto; align-self: flex-start; padding-left: 3px; font-size: 10.5px; font-weight: 600; }
.sch-empty { padding: 24px !important; }
.sch-legend i.sw { background: var(--k-bg); border: 1px solid var(--k-line); }

.sch-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(420px, 100%); background: var(--surface);
  box-shadow: -12px 0 40px rgba(0,0,0,.14); display: flex; flex-direction: column; }
.sch-panel[hidden] { display: none; }
.sch-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 8px; }
.sch-panel-head h2 { margin: 0; font-size: 21px; font-weight: 500; }
.sch-panel-body { flex: 1; overflow-y: auto; padding: 12px 24px; display: flex; flex-direction: column; gap: 16px; }
.sch-range { display: flex; align-items: center; gap: 8px; }
.sch-range input { width: 130px; }
.sch-breaks { display: flex; flex-direction: column; gap: 10px; }
.sch-break { display: flex; align-items: center; gap: 8px; }
.sch-break > span:first-child { font-size: 13px; color: var(--muted); width: 64px; }
.sch-break input { width: 124px; font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; }
.sch-new-tpl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: -6px; }
.sch-new-tpl[hidden] { display: none; }
.sch-new-tpl input { flex: 1 1 100%; font: inherit; font-size: 15px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 8px; }
.sch-new-tpl p { margin: 0; flex-basis: 100%; }
.sch-panel-foot { padding: 14px 24px 20px; display: flex; flex-direction: column; gap: 10px; }
.sch-panel-foot p { margin: 0; }
.sch-panel-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
body.sch-open .content { padding-right: 440px; }
@media (max-width: 860px) { body.sch-open .content { padding-right: 16px; } }

/* «Выгрузить в PDF» — это печать страницы: в окне печати выбери «Сохранить как PDF». */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  .sidebar, .sch-toolbar, .sch-filters, .sch-panel, #sch-pdf, .sch-more, .messages { display: none !important; }
  .layout, .main, .content { display: block !important; padding: 0 !important; margin: 0 !important; }
  .sch-wrap { overflow: visible; border: 0; }
  .sch .sch-emp, .sch .sch-total, .sch thead th { position: static; }
  .sch-dh { min-width: 0; width: auto; }
  .sch-cell { height: 46px; }
  .sch-day { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; }
}

/* --- Карточка услуги ---------------------------------------------------------- */
.service-form { max-width: 620px; }
.svc-masters { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.svc-masters legend { display: flex; align-items: center; gap: 8px; padding: 0 6px; }
.svc-masters p { margin: 0; }
.svc-masters-all { margin-left: 12px; font-size: 14px; font-weight: 400; align-items: center; }
.svc-masters-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.svc-master { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.svc-master:has(input:checked) { border-color: var(--admin); background: #FFFBEA; }
.svc-master input { width: 18px; height: 18px; accent-color: #E0A800; flex-shrink: 0; }
.svc-master-name { display: flex; flex-direction: column; min-width: 0; }
.svc-master-name small { color: var(--muted); font-size: 12.5px; }
.svc-delete { max-width: 620px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-color: var(--bad-line); }
.svc-delete p { margin: 4px 0 0; }
.svc-delete .btn { white-space: nowrap; flex-shrink: 0; }

/* --- Журнал: меню мастера и «Рабочее время» ---------------------------------- */
.j-head-btn { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; height: 100%; }
.j-head-btn:hover b, .j-head-btn[aria-expanded="true"] b { color: var(--accent); }
.j-head-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.j-head-caret { font-style: normal; color: var(--muted); margin-left: auto; }
.j-head .j-menu { position: absolute; top: 54px; left: 10px; z-index: 20; min-width: 250px; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.16); padding: 6px; }
.j-head .j-menu[hidden] { display: none; }
.j-menu button, .j-menu a { all: unset; box-sizing: border-box; cursor: pointer; padding: 9px 12px; border-radius: 7px; font-size: 14px; color: var(--ink); text-transform: none; }
.j-menu button:hover, .j-menu a:hover, .j-menu button:focus-visible, .j-menu a:focus-visible { background: var(--soft); }
.j-menu .danger { color: var(--bad); }
.wh-card { background: var(--surface); border-radius: 14px; width: min(440px, 100%); padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.wh-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.wh-head h2 { margin: 0; font-size: 20px; font-weight: 500; }
.wh-card p { margin: 0; }
.wh-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
