/* Оформление админки, один файл на все страницы.
   Классы состояний (active, open, show, hidden, is-*, on, overridden, needs-start)
   переключает JS — не переименовывать.
   Темы: без data-theme решает система, поэтому светлая — на голом :root,
   а тёмная описана дважды: в media-запросе и в [data-theme="dark"]. */

/* Токены — светлая тема */
:root{
  --ground:#EEF2F3;
  --surface:#FFFFFF;
  --surface-2:#F3F6F7;
  --surface-3:#E7EDEF;
  --line:#D8E1E4;
  --line-soft:#E6ECEE;

  --text:#0E1719;
  --text-muted:#33484F;
  --text-faint:#55707A;
  --disabled:#B6C6CB;

  --accent:#0E7C73;
  --accent-ink:#FFFFFF;
  --accent-soft:rgba(14,124,115,.10);
  --accent-line:rgba(14,124,115,.30);

  --amber:#B45309;
  --amber-soft:rgba(180,83,9,.10);
  --danger:#DC2626;
  --danger-soft:rgba(179,53,47,.10);
  --green:#0B9E45;
  --green-soft:rgba(47,125,82,.10);

  --room-ibiza:#D9542C;
  --room-bali:#0E9B78;
  --room-male:#6A4CE0;

  --shadow:0 1px 2px rgba(14,23,25,.05), 0 6px 20px rgba(14,23,25,.06);
  --shadow-lift:0 2px 6px rgba(14,23,25,.08), 0 18px 44px rgba(14,23,25,.14);

  --radius-lg:16px; --radius-md:11px; --radius-sm:8px;
  --slot:34px;   /* высота получаса в расписании */

  --font:'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* Системная тёмная; :not([data-theme="light"]) — чтобы ручной выбор победил. */
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --ground:#080D0F;
    --surface:#0F1619;
    --surface-2:#151F23;
    --surface-3:#1B282D;
    --line:#22333A;
    --line-soft:#182428;

    --text:#E8F1F2;
    --text-muted:#BFD2D8;
    --text-faint:#A8BEC6;
    --disabled:#3B4C53;

    --accent:#49D6C4;
    --accent-ink:#04211F;
    --accent-soft:rgba(73,214,196,.12);
    --accent-line:rgba(73,214,196,.34);

    --amber:#FF9A52;
    --amber-soft:rgba(255,154,82,.13);
    --danger:#FF5A4E;
    --danger-soft:rgba(255,107,99,.13);
    --green:#3DDC84;
    --green-soft:rgba(95,208,138,.13);

    --room-ibiza:#FF8360;
    --room-bali:#35D6A8;
    --room-male:#9B87FF;

    --shadow:0 1px 2px rgba(0,0,0,.5), 0 10px 30px rgba(0,0,0,.42);
    --shadow-lift:0 2px 8px rgba(0,0,0,.55), 0 24px 60px rgba(0,0,0,.6);
  }
}

:root[data-theme="dark"]{
  --ground:#080D0F;
  --surface:#0F1619;
  --surface-2:#151F23;
  --surface-3:#1B282D;
  --line:#22333A;
  --line-soft:#182428;

  --text:#E8F1F2;
  --text-muted:#BFD2D8;
  --text-faint:#A8BEC6;
  --disabled:#3B4C53;

  --accent:#49D6C4;
  --accent-ink:#04211F;
  --accent-soft:rgba(73,214,196,.12);
  --accent-line:rgba(73,214,196,.34);

  --amber:#FF9A52;
  --amber-soft:rgba(255,154,82,.13);
  --danger:#FF5A4E;
  --danger-soft:rgba(255,107,99,.13);
  --green:#3DDC84;
  --green-soft:rgba(95,208,138,.13);

  --room-ibiza:#FF8360;
  --room-bali:#35D6A8;
  --room-male:#9B87FF;

  --shadow:0 1px 2px rgba(0,0,0,.5), 0 10px 30px rgba(0,0,0,.42);
  --shadow-lift:0 2px 8px rgba(0,0,0,.55), 0 24px 60px rgba(0,0,0,.6);
}

/* База */
*{ box-sizing:border-box; }

body{
  margin:0;
  background:var(--ground);
  color:var(--text);
  font-family:var(--font);
  font-size:14px;
  line-height:1.5;
  padding-bottom:60px;
  -webkit-font-smoothing:antialiased;
}
a{ color:var(--accent); }
button, input, select, textarea{ font-family:inherit; font-size:inherit; }
button{ cursor:pointer; }
:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; border-radius:4px; }
@media (prefers-reduced-motion: reduce){ *{ animation:none !important; transition:none !important; } }

/* Время и деньги — моноширинными цифрами. */
.time-range, .price-line span:last-child, .price-total, .sched-time,
.hour-cell, .lc-time, .booking-time, .booking-total, .stat-value,
.sb-value, td.num, .candidate-meta, .h-time{
  font-variant-numeric:tabular-nums;
}
.time-range, .sched-time, .hour-cell, .lc-time, .stat-value, .sb-value{
  font-family:var(--mono);
}

/* Шапка */
header.top{
  position:sticky; top:0; z-index:15;
  background:var(--surface);
  border-bottom:1px solid var(--line);
  padding:12px 16px 11px;
}
/* Три зоны: название, меню, управление. */
.top-row{
  display:grid; grid-template-columns:1fr auto 1fr;
  align-items:center; gap:14px;
}
.top-row > .brand{ justify-self:start; }
.top-row > nav.links{ justify-self:center; }
.top-actions{
  justify-self:end; display:flex; align-items:center; gap:10px; flex-wrap:nowrap;
}
@media (max-width:900px){
  .top-row{ grid-template-columns:1fr auto; row-gap:10px; }
  .top-row > nav.links{ grid-column:1 / -1; justify-self:center; }
}
.brand{
  font-weight:600; font-size:15.5px; letter-spacing:-.01em;
  display:flex; align-items:center; gap:9px;
}
.brand::before{
  content:''; width:26px; height:26px; border-radius:8px; flex:none;
  background:linear-gradient(150deg, var(--accent), var(--room-ibiza));
}
nav.links{ display:flex; gap:2px; flex-wrap:wrap; }
nav.links a{
  padding:6px 11px; border-radius:var(--radius-sm);
  text-decoration:none; color:var(--text-faint);
  font-size:15.5px; font-weight:500;
  transition:background .15s, color .15s;
}
nav.links a:hover{ background:var(--surface-2); color:var(--text-muted); }
nav.links a.active{ background:var(--accent-soft); color:var(--accent); font-weight:600; }
.admin-menu{ position:relative; flex:none; }
.admin-label{
  font-size:15px; font-weight:500; color:var(--text-muted);
  background:var(--surface-2); border:1px solid var(--line);
  padding:5px 12px; border-radius:999px; white-space:nowrap;
  cursor:pointer; transition:.15s;
}
.admin-label:hover{ background:var(--surface-3); color:var(--text); }
.admin-caret{ font-size:11px; opacity:.6; }
.admin-dropdown{
  position:absolute; top:calc(100% + 6px); right:0; z-index:60; min-width:210px;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-md); box-shadow:var(--shadow-lift);
  padding:12px; display:flex; flex-direction:column; gap:10px;
}
/* [hidden] из браузера слабее display:flex выше. */
.admin-dropdown[hidden]{ display:none; }
.admin-dropdown-who{ font-size:14px; color:var(--text-faint); line-height:1.5; }
.admin-dropdown-who b{ color:var(--text); font-size:15.5px; font-weight:600; }
.admin-dropdown-exit{
  display:block; text-align:center; text-decoration:none;
  padding:10px 14px; border-radius:var(--radius-sm);
  background:var(--danger-soft); color:var(--danger);
  font-size:15.5px; font-weight:600; transition:.15s;
}
.admin-dropdown-exit:hover{ background:var(--danger); color:var(--surface); }
.wrap{ max-width:1240px; margin:0 auto; padding:0 16px; }
header.top .wrap{ padding:0; max-width:none; }

.theme-btn{
  width:32px; height:32px; border-radius:var(--radius-sm);
  border:1px solid var(--line); background:var(--surface-2);
  color:var(--text-muted); display:grid; place-items:center;
  font-size:14px; line-height:1; transition:.15s; flex:none;
}
.theme-btn:hover{ background:var(--surface-3); color:var(--text); }

/* Верхняя полоса: «Добавить запись» и новая заявка */
.topstrip{
  display:grid; grid-template-columns:1fr 2fr; gap:12px; margin:0;
}
@media (max-width:700px){ .topstrip{ grid-template-columns:1fr; } }

.big-add-btn{
  display:grid; place-items:center; gap:6px; min-height:150px; padding:16px;
  border-radius:var(--radius-lg); border:1px solid var(--green);
  background:var(--green); color:var(--surface);
  font-size:21px; font-weight:700; letter-spacing:-.01em; line-height:1.25;
  box-shadow:var(--shadow); cursor:pointer;
  transition:transform .12s, box-shadow .15s, filter .15s;
}
.big-add-btn:hover{ filter:brightness(1.06); transform:translateY(-1px); box-shadow:var(--shadow-lift); }
.big-add-btn:active{ transform:translateY(0); }

.new-req-slot{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-lg); box-shadow:var(--shadow);
  padding:14px 16px; min-height:150px;
  display:flex; flex-direction:column; gap:9px;
}
.new-req-slot.is-empty{ align-items:center; justify-content:center; }
.nr-empty{ font-size:16px; color:var(--text-faint); }

.new-req-slot.has-req{
  background:var(--amber-soft);
  border-color:color-mix(in srgb, var(--amber) 45%, transparent);
}
.nr-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.nr-title{ font-size:16px; font-weight:700; color:var(--amber); }
.nr-more{
  font-size:14px; font-weight:600; color:var(--amber);
  background:color-mix(in srgb, var(--amber) 18%, transparent);
  padding:3px 10px; border-radius:999px; white-space:nowrap;
}
.nr-body{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.nr-name{ font-size:19px; font-weight:700; letter-spacing:-.02em; }
.nr-when{ font-size:15px; color:var(--text-muted); margin-top:2px; font-variant-numeric:tabular-nums; }
.nr-phone{
  font-size:17px; font-weight:600; text-decoration:none; white-space:nowrap;
  color:var(--accent); background:var(--surface); padding:8px 14px; border-radius:999px;
  font-variant-numeric:tabular-nums;
}
.nr-phone:hover{ filter:brightness(1.06); }
.nr-actions{ display:flex; gap:8px; flex-wrap:wrap; margin-top:auto; }
.nr-actions .btn{ font-size:16px; padding:10px 16px; }

/* Баннер уведомлений */
.notify-banner{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  background:var(--amber-soft); border:1px solid color-mix(in srgb, var(--amber) 35%, transparent);
  color:var(--amber); border-radius:var(--radius-md);
  padding:11px 14px; margin:14px 0 0; font-size:15px; font-weight:500;
}
.notify-banner button{
  border:none; background:var(--amber); color:var(--surface);
  border-radius:var(--radius-sm); padding:7px 14px; font-weight:600; font-size:15px;
  white-space:nowrap;
}
.notify-banner.hidden{ display:none; }

/* Панель управления */
.toolbar{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; padding:16px 0 6px; position:relative; }
.toolbar2{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; padding:2px 0 14px; }
.toolbar select, .toolbar input[type=date]{
  padding:8px 11px; border:1px solid var(--line); border-radius:var(--radius-sm);
  font-size:15.5px; background:var(--surface); color:var(--text);
}

.day-btn, .cal-toggle-btn{
  padding:8px 13px; border:1px solid var(--line); border-radius:var(--radius-sm);
  background:var(--surface-2); font-size:15.5px; font-weight:500;
  color:var(--text-muted); transition:.15s;
}
.day-btn:hover, .cal-toggle-btn:hover{ background:var(--surface-3); color:var(--text); }
.day-btn.active{
  background:var(--accent); border-color:var(--accent); color:var(--accent-ink); font-weight:600;
}
.cal-toggle-btn{ color:var(--text); }

.shift-toggle-btn{
  padding:8px 14px; border-radius:var(--radius-sm); font-size:15.5px; font-weight:600;
  border:1px solid var(--line); background:var(--surface-2); color:var(--text-muted); transition:.15s;
}
.shift-toggle-btn.needs-start{
  border-color:color-mix(in srgb, var(--green) 45%, transparent);
  background:var(--green-soft); color:var(--green);
}
.shift-toggle-btn.is-active{
  border-color:color-mix(in srgb, var(--danger) 40%, transparent);
  background:var(--danger-soft); color:var(--danger);
}

.view-toggle{
  display:flex; gap:3px; padding:3px;
  background:var(--surface-2); border:1px solid var(--line); border-radius:var(--radius-sm);
}
.view-toggle-btn{
  border:none; background:none; padding:5px 10px; border-radius:6px;
  font-size:14px; line-height:1.3; opacity:.5; transition:.15s;
}
.view-toggle-btn:hover{ opacity:.8; }
.view-toggle-btn.active{ background:var(--surface); opacity:1; box-shadow:var(--shadow); }
.top-row .view-toggle{ flex:none; align-items:center; padding:2px; }
.top-row .view-toggle-btn{ padding:4px 9px; }

.pending-btn{
  position:relative; display:inline-flex; align-items:center; gap:8px;
  padding:8px 14px; border-radius:999px; font-size:15px; font-weight:600; transition:.15s;
  border:1px solid color-mix(in srgb, var(--amber) 35%, transparent);
  background:var(--amber-soft); color:var(--amber);
}
.pending-btn:hover{ filter:brightness(1.06); }
.pending-btn.unpaid-btn{
  border-color:color-mix(in srgb, var(--danger) 35%, transparent);
  background:var(--danger-soft); color:var(--danger);
}
.pending-btn.active{ background:var(--amber); border-color:var(--amber); color:var(--surface); }
.pending-btn .exit-x{ display:none; font-size:15px; line-height:1; opacity:.8; margin-left:2px; }
.pending-btn.active .exit-x{ display:inline; }
.pending-btn .exit-x:hover{ opacity:1; }
.pending-btn.unpaid-btn.active{ background:var(--danger); border-color:var(--danger); color:var(--surface); }
.pending-btn .count{
  display:inline-grid; place-items:center; min-width:20px; height:20px; padding:0 6px;
  border-radius:999px; font-size:14px; font-weight:700;
  background:color-mix(in srgb, currentColor 16%, transparent);
  font-variant-numeric:tabular-nums;
}
.refresh-note{ font-size:14.5px; color:var(--text-faint); margin-left:auto; }

/* Календарь */
.cal-popover{
  position:absolute; top:100%; left:0; margin-top:6px; z-index:25;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-lift);
  padding:14px; width:300px;
  opacity:0; pointer-events:none; transform:translateY(-6px); transition:.15s ease;
}
.cal-popover.open{ opacity:1; pointer-events:auto; transform:translateY(0); }
.cal-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.cal-month-label{ font-weight:600; font-size:14px; text-transform:capitalize; }
.cal-nav{
  width:28px; height:28px; border-radius:50%; border:1px solid var(--line);
  background:var(--surface-2); color:var(--text-muted); font-size:15px; line-height:1;
}
.cal-nav:hover{ background:var(--surface-3); color:var(--text); }
.cal-dow-row{
  display:grid; grid-template-columns:repeat(7,1fr); text-align:center;
  font-size:13px; color:var(--text-faint); font-weight:600; margin-bottom:5px;
  letter-spacing:.03em;
}
.cal-grid{ display:grid; grid-template-columns:repeat(7,1fr); gap:3px; }
.cal-day{
  aspect-ratio:1; display:flex; align-items:center; justify-content:center;
  border-radius:8px; font-size:15px; font-weight:500; cursor:pointer;
  background:var(--surface-2); color:var(--text); border:2px solid transparent;
  font-variant-numeric:tabular-nums; transition:.12s;
}
.cal-day:hover{ background:var(--surface-3); }
.cal-day.other-month{ visibility:hidden; cursor:default; }
.cal-day.load-none{ color:var(--text-faint); }
.cal-day.load-low{ background:var(--green-soft); color:var(--green); }
.cal-day.load-mid{ background:var(--amber-soft); color:var(--amber); }
.cal-day.load-high{ background:var(--danger-soft); color:var(--danger); }
.cal-day.has-override{ background:var(--amber-soft); color:var(--amber); }
.cal-day.is-today{ border-color:var(--accent-line); }
.cal-day.is-selected{ border-color:var(--accent); box-shadow:0 0 0 1px var(--accent); }
.cal-legend{ margin-top:10px; font-size:14px; color:var(--text-faint); text-align:center; }

/* Колонки номеров */
.rooms-columns{ display:grid; grid-template-columns:repeat(3,1fr); gap:14px; align-items:start; }
@media (max-width:900px){ .rooms-columns{ grid-template-columns:1fr; } }
.room-column{ display:flex; flex-direction:column; gap:12px; }
.room-column-header{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:10px 14px; border-radius:var(--radius-md);
  background:var(--surface); border:1px solid var(--line);
  border-left:3px solid var(--line);
  position:sticky; top:60px; z-index:8; box-shadow:var(--shadow);
}
.room-column-header.rc-ibiza{ border-left-color:var(--room-ibiza); }
.room-column-header.rc-bali{ border-left-color:var(--room-bali); }
.room-column-header.rc-male{ border-left-color:var(--room-male); }
.room-column-title{ font-weight:600; font-size:14.5px; letter-spacing:-.01em; }
.room-column-count{
  font-size:14px; font-weight:600; color:var(--text-faint);
  background:var(--surface-2); border:1px solid var(--line);
  border-radius:999px; padding:2px 9px; font-variant-numeric:tabular-nums;
}
.room-column-count.has-new{ color:var(--amber); border-color:color-mix(in srgb, var(--amber) 40%, transparent); background:var(--amber-soft); }
.room-column-empty{
  text-align:center; color:var(--text-faint); font-size:15px; padding:26px 0;
  border:1px dashed var(--line); border-radius:var(--radius-md);
}

/* Карточка брони */
.card{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-lg); box-shadow:var(--shadow);
  padding:15px 17px; display:flex; flex-direction:column; gap:11px;
  transition:box-shadow .15s;
}
.card:hover{ box-shadow:var(--shadow-lift); }
.card.is-new{ border-color:color-mix(in srgb, var(--amber) 45%, transparent); }
.card.is-upcoming{ border-color:color-mix(in srgb, var(--danger) 45%, transparent); }

.card-top{ display:flex; align-items:flex-start; justify-content:flex-start; gap:12px; flex-wrap:wrap; }
.time-range{ font-size:18px; font-weight:600; letter-spacing:-.02em; white-space:nowrap; }
.room-name{ font-size:15px; color:var(--text-faint); margin-top:2px; }
.badges{ display:flex; gap:5px; flex-wrap:wrap; justify-content:flex-start; }
.badge{
  font-size:13px; font-weight:600; letter-spacing:.04em; text-transform:uppercase;
  padding:3px 9px; border-radius:999px; white-space:nowrap;
  background:var(--surface-3); color:var(--text-faint);
}
.badge.pending{ background:var(--amber-soft); color:var(--amber); }
.badge.confirmed{ background:var(--accent-soft); color:var(--accent); }
.badge.arrived{ background:var(--green-soft); color:var(--green); }
.badge.completed{ background:var(--surface-3); color:var(--text-faint); }
.badge.cancelled{ background:var(--danger-soft); color:var(--danger); }
.badge.paid{ background:var(--green-soft); color:var(--green); }
.badge.unpaid{ background:var(--danger-soft); color:var(--danger); }
.badge.edited{ background:var(--surface-3); color:var(--text-muted); cursor:pointer; }
.badge.edited:hover{ background:var(--accent-soft); color:var(--accent); }
.badge.edit-btn{ background:var(--accent-soft); color:var(--accent); cursor:pointer; }
.badge.edit-btn:hover{ background:var(--accent); color:var(--accent-ink); }

.flag-note{
  font-size:15px; font-weight:500; padding:8px 11px; border-radius:var(--radius-sm);
}
.flag-note.new{ background:var(--amber-soft); color:var(--amber); }
.flag-note.upcoming{ background:var(--danger-soft); color:var(--danger); }
.card.no-prepay{
  border-color:var(--danger);
  box-shadow:inset 4px 0 0 var(--danger);
}
.no-prepay-flag{
  display:inline-block; font-size:14px; font-weight:600; color:var(--danger);
  background:var(--danger-soft); padding:3px 9px; border-radius:999px;
}

.client-row{ display:flex; align-items:center; justify-content:flex-start; gap:10px; flex-wrap:wrap; }
.client-row .client-phone{ margin-left:auto; }
.client-row .history-btn{ margin-left:auto; white-space:nowrap; }
.client-row .history-btn + .client-phone{ margin-left:0; }
#historyList{ max-height:64vh; overflow-y:auto; }
.client-name{ font-weight:600; font-size:14.5px; }
.client-phone{
  color:var(--accent); text-decoration:none; font-size:15px; font-weight:500;
  padding:5px 11px; border-radius:999px; background:var(--accent-soft); white-space:nowrap;
  font-variant-numeric:tabular-nums;
}
.client-phone:hover{ background:color-mix(in srgb, var(--accent) 20%, transparent); }
.comment-note{
  font-size:15px; color:var(--text-muted); background:var(--surface-2);
  border-radius:var(--radius-sm); padding:8px 11px;
}

.price-row{ border-top:1px solid var(--line-soft); padding-top:11px; display:flex; flex-direction:column; gap:4px; }
.price-line{ display:flex; justify-content:space-between; font-size:15px; color:var(--text-faint); }
.price-line span:last-child{ color:var(--text-muted); font-weight:500; }
.price-total{
  display:flex; justify-content:space-between; align-items:baseline;
  margin-top:5px; padding-top:9px; border-top:1px solid var(--line-soft);
  font-size:17px; font-weight:600; letter-spacing:-.02em;
}
.addons-note{ font-size:14.5px; color:var(--text-faint); margin-top:4px; line-height:1.45; }
.source-tag{ font-size:14px; color:var(--text-faint); margin-top:6px; }

.actions{ display:flex; flex-direction:column; gap:6px; }
.actions-row{ display:flex; gap:6px; flex-wrap:wrap; }
.actions-corner{ justify-content:flex-end; margin-top:2px; }
.locked-note{
  font-size:15px; color:var(--text-faint); background:var(--surface-2);
  border-radius:var(--radius-sm); padding:9px 12px;
}

/* Кнопки */
.btn{
  border-radius:var(--radius-sm); padding:8px 13px; font-size:15px; font-weight:600;
  border:1px solid var(--line); background:var(--surface-2); color:var(--text-muted);
  transition:.15s;
}
.btn:hover{ background:var(--surface-3); color:var(--text); }
.btn-primary{ background:var(--accent); border-color:var(--accent); color:var(--accent-ink); }
.btn-primary:hover{ filter:brightness(1.08); background:var(--accent); color:var(--accent-ink); }
.btn-ghost{ background:var(--surface-2); color:var(--text-muted); }
.btn-green{
  background:var(--green-soft); border-color:color-mix(in srgb, var(--green) 40%, transparent); color:var(--green);
}
.btn-green:hover{ background:var(--green); color:var(--surface); }
.btn-danger{
  background:var(--danger-soft); border-color:color-mix(in srgb, var(--danger) 35%, transparent); color:var(--danger);
}
.btn-danger:hover{ background:var(--danger); color:var(--surface); }
.small-btn{
  background:var(--surface-2); border:1px solid var(--line); border-radius:999px;
  padding:6px 12px; font-size:14.5px; font-weight:600; color:var(--accent);
}
.small-btn:hover{ background:var(--accent-soft); }
.rm-btn{ border:none; background:none; color:var(--danger); font-size:14px; padding:2px 4px; }
.rm-btn:hover{ filter:brightness(1.2); }

/* Расписание */
.schedule-wrap{
  overflow-x:auto; background:var(--surface);
  border:1px solid var(--line); border-radius:var(--radius-lg);
  box-shadow:var(--shadow);
}
/* Столбцы номеров равной ширины — длинная заметка не должна распирать свой. */
table.schedule{ width:100%; border-collapse:collapse; min-width:600px; table-layout:fixed; }
table.schedule td.sched-cell{ overflow-wrap:anywhere; }
table.schedule th{
  background:var(--surface-2); font-size:14px; font-weight:600;
  letter-spacing:.08em; text-transform:uppercase; color:var(--text-faint);
  padding:11px 12px; text-align:left;
  position:sticky; top:0; z-index:4; border-bottom:1px solid var(--line);
}
table.schedule th.rc-ibiza{ color:var(--room-ibiza); box-shadow:inset 0 -2px 0 var(--room-ibiza); }
table.schedule th.rc-bali{ color:var(--room-bali); box-shadow:inset 0 -2px 0 var(--room-bali); }
table.schedule th.rc-male{ color:var(--room-male); box-shadow:inset 0 -2px 0 var(--room-male); }
table.schedule th:first-child{ width:62px; }

table.schedule td{ border:none; border-top:1px solid var(--line-soft); vertical-align:top; padding:0; }
table.schedule td.hour-cell{
  color:var(--text-faint); font-size:14px; font-weight:400;
  text-align:right; padding:3px 12px 0 0; white-space:nowrap;
  height:var(--slot); box-sizing:border-box;
  border-right:1px solid var(--line-soft);
}
table.schedule td.empty-slot{ height:var(--slot); box-sizing:border-box; border-left:1px solid var(--line-soft); }
table.schedule td.buffer-slot{
  height:var(--slot); box-sizing:border-box; border-left:1px solid var(--line-soft);
  background:repeating-linear-gradient(135deg,
    transparent 0 5px, var(--surface-2) 5px 10px);
}
table.schedule td.sched-cell{
  padding:8px 10px; border-left:1px solid var(--line-soft);
  border-radius:var(--radius-sm); cursor:pointer;
  background:var(--surface-2);
  box-shadow:inset 3px 0 0 var(--line);
  transition:filter .15s;
}
table.schedule td.sched-cell:hover{ filter:brightness(1.06); }
table.schedule td.sched-cell.st-pending{ background:var(--amber-soft); box-shadow:inset 3px 0 0 var(--amber); }
table.schedule td.sched-cell.st-confirmed{ background:var(--accent-soft); box-shadow:inset 3px 0 0 var(--accent); }
table.schedule td.sched-cell.st-arrived{ background:var(--green-soft); box-shadow:inset 3px 0 0 var(--green); }
/* «Без предоплаты» перебивает статусную заливку; сильнее только накладка. */
table.schedule td.sched-cell.no-prepay{
  background:color-mix(in srgb, var(--danger) 22%, var(--surface));
  box-shadow:inset 0 0 0 2px var(--danger);
}
.sched-noprepay{
  font-size:13px; font-weight:700; color:var(--danger);
  margin-bottom:4px; letter-spacing:.02em;
}
table.schedule td.sched-cell.has-overlap{
  background:var(--danger-soft); box-shadow:inset 0 0 0 2px var(--danger);
}

.sched-booking{ font-size:14.5px; line-height:1.4; position:relative; padding-bottom:13px; }
.sched-booking + .sched-booking{ margin-top:6px; padding-top:6px; border-top:1px dashed var(--line); }
.sched-time{ font-weight:500; font-size:14px; color:var(--text-muted); }
.sched-name{ color:var(--text); font-weight:600; letter-spacing:-.01em; }
.sched-money{ font-family:var(--mono); font-size:13.5px; font-weight:600; color:var(--text); }
.sched-discount{ font-size:13px; color:var(--amber); margin-top:1px; }
.sched-source{ font-size:13px; color:var(--text-muted); margin-top:1px; }
.sched-comment{ color:var(--text-faint); font-style:italic; margin-top:2px; }
.sched-author{ position:absolute; right:0; bottom:0; font-size:13px; color:var(--text-faint); }
.sched-overlap{ font-size:13px; font-weight:700; color:var(--danger); margin-bottom:4px; letter-spacing:.02em; }
.sched-overlap + .sched-booking{ border-top:none; }

.sched-note{
  color:var(--danger); font-size:17px; font-weight:400; line-height:1.35;
  white-space:pre-wrap; overflow-wrap:anywhere; margin-top:6px;
  overflow-y:auto; overscroll-behavior:contain;   /* высоту задаёт fitScheduleNotes() */
}
.sched-note:empty{ margin-top:0; }
.sched-note-input{
  display:block; width:100%; min-height:48px; margin:0; resize:none; overflow:hidden;
  color:var(--danger) !important; font-size:17px !important; font-weight:400; line-height:1.35 !important;
  background:var(--surface) !important;
  border:1.5px dashed var(--danger) !important; border-radius:var(--radius-sm);
  padding:6px 8px !important;
}
/* Двойное нажатие не должно масштабировать страницу. */
table.schedule td.sched-cell{ touch-action:manipulation; }
.has-overlap .sched-booking + .sched-booking{ border-top:1px dashed var(--danger); padding-top:4px; margin-top:4px; }

.now-marker{
  position:absolute; left:0; right:0; height:1px; background:var(--danger);
  z-index:6; pointer-events:none;
}
.now-marker::before{
  content:''; position:absolute; left:0; top:-3.5px;
  width:8px; height:8px; border-radius:50%; background:var(--danger);
}

/* Модальные окна */
.modal-backdrop{
  position:fixed; inset:0; background:rgba(4,10,12,.6); backdrop-filter:blur(3px);
  z-index:60; opacity:0; pointer-events:none; transition:.16s;
}
.modal-backdrop.open{ opacity:1; pointer-events:auto; }
.modal{
  position:fixed; left:50%; top:50%; transform:translate(-50%,-48%) scale(.98);
  background:var(--surface); border:1px solid var(--line);
  border-radius:20px; padding:22px; width:calc(100% - 36px); max-width:392px;
  max-height:86vh; overflow-y:auto; z-index:61;
  opacity:0; pointer-events:none; transition:.16s; box-shadow:var(--shadow-lift);
}
.modal.open{ opacity:1; pointer-events:auto; transform:translate(-50%,-50%) scale(1); }
.modal-wide{ max-width:480px; }
.modal h3{ margin:0 0 14px; font-size:17px; font-weight:600; letter-spacing:-.01em; padding-right:34px; }
.modal-x{
  position:absolute; right:14px; top:14px; z-index:2;
  width:30px; height:30px; border-radius:50%;
  border:1px solid var(--line); background:var(--surface-2); color:var(--text-muted);
  font-size:14px; line-height:1; display:grid; place-items:center;
  cursor:pointer; transition:.15s;
}
.modal-x:hover{ background:var(--danger-soft); border-color:var(--danger); color:var(--danger); }
.modal input, .modal select, .modal textarea{
  width:100%; padding:10px 12px; border:1px solid var(--line);
  border-radius:var(--radius-sm); background:var(--surface-2); color:var(--text);
  margin-bottom:10px;
}
.modal input:focus, .modal select:focus, .modal textarea:focus{
  border-color:var(--accent); outline:none;
}
.field-label{
  display:block; font-size:14px; font-weight:600; color:var(--text-faint);
  letter-spacing:.05em; text-transform:uppercase; margin:12px 0 5px;
}
.modal .row{ display:flex; gap:8px; margin-top:16px; }
.modal .row button{ flex:1; padding:11px; border-radius:var(--radius-sm); font-size:15.5px; }
.two-col{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.modal-quote{
  background:var(--surface-2); border-radius:var(--radius-md);
  padding:11px 13px; margin-top:12px; font-size:15px; color:var(--text-muted);
  display:flex; justify-content:space-between; align-items:center; gap:10px;
}
.bonus-box{
  background:var(--accent-soft); border-radius:var(--radius-md);
  padding:11px 13px; margin-bottom:12px;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.bonus-box-text{ font-size:15px; color:var(--text-muted); }
.bonus-box button{ white-space:nowrap; }

.addon-check-row{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:9px 0; border-bottom:1px solid var(--line-soft); font-size:15px;
}
.addon-check-row:last-child{ border-bottom:none; }
.qty-stepper-mini{
  display:flex; align-items:center; gap:8px; flex:none;
  background:var(--surface-2); border:1px solid var(--line);
  border-radius:999px; padding:3px 5px;
}
.qty-stepper-mini button{
  width:24px; height:24px; border-radius:50%; border:none;
  background:var(--surface); color:var(--text-muted); font-size:14px; line-height:1;
}
.qty-stepper-mini button:hover{ color:var(--text); }
.qty-stepper-mini span{ min-width:18px; text-align:center; font-weight:600; font-size:15px; font-variant-numeric:tabular-nums; }

.extra-row{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:9px 0; border-bottom:1px solid var(--line-soft); font-size:15px;
}
.extra-row:last-child{ border-bottom:none; }
.extra-empty{ color:var(--text-faint); font-size:15px; text-align:center; padding:16px 0; }
.extra-suggest{
  border:1px solid var(--line); border-radius:var(--radius-sm);
  background:var(--surface); box-shadow:var(--shadow-lift);
  max-height:210px; overflow-y:auto; margin-bottom:10px; display:none;
}
.extra-suggest.open{ display:block; }
.extra-suggest-item{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:9px 12px; border-bottom:1px solid var(--line-soft); cursor:pointer; font-size:15px;
}
.extra-suggest-item:last-child{ border-bottom:none; }
.extra-suggest-item:hover{ background:var(--surface-2); }
.extra-suggest-price{ color:var(--text-muted); font-weight:600; font-variant-numeric:tabular-nums; }
.extra-suggest-stock{ font-size:14px; color:var(--text-faint); }
.extra-suggest-stock.low{ color:var(--danger); font-weight:600; }

.conflict-item{
  border-bottom:1px solid var(--line-soft); padding:11px 0;
  display:flex; flex-direction:column; gap:7px;
}
.conflict-item-name{ font-size:15px; font-weight:500; line-height:1.4; }
.conflict-item-price{ font-size:15px; color:var(--danger); font-weight:600; font-variant-numeric:tabular-nums; }
.conflict-item-controls{ display:flex; align-items:center; gap:9px; }
.conflict-add-btn{
  border:1px solid var(--line); background:var(--surface-2); color:var(--text-muted);
  border-radius:var(--radius-sm); padding:6px 12px; font-size:15px; font-weight:600;
}
.conflict-add-btn:hover{ background:var(--danger-soft); color:var(--danger); }

.history-row{
  display:flex; justify-content:space-between; align-items:flex-start; gap:12px;
  padding:10px 0; border-bottom:1px solid var(--line-soft);
}
.history-row:last-child{ border-bottom:none; }
.history-row.is-undone{ opacity:.45; text-decoration:line-through; }
.history-row .h-label{ font-weight:600; font-size:15px; }
.history-row .h-detail{ font-size:14.5px; color:var(--text-muted); margin-top:2px; line-height:1.45; }
.history-row .h-admin{ font-size:14px; color:var(--text-faint); margin-top:2px; }
.history-row .h-time{ font-size:14px; color:var(--text-faint); white-space:nowrap; }

.client-lookup-card{
  background:var(--surface-2); border:1px solid var(--line);
  border-radius:var(--radius-md); padding:11px 13px; margin-bottom:10px;
}
.client-lookup-card .clc-name{ font-weight:600; font-size:15.5px; }
.client-lookup-card .clc-row{ font-size:15px; color:var(--text-muted); margin-top:2px; }

/* Заметка о госте: мини-карточка и клиентская база. */
.clc-note, .client-note{
  margin-top:9px; padding:8px 10px; font-size:15px; line-height:1.45;
  border:1px solid var(--line); border-radius:var(--radius-sm);
  white-space:pre-wrap; overflow-wrap:anywhere;
}
.clc-note{ background:var(--surface); }
.client-note{ background:var(--surface-2); }
.clc-note.is-empty, .client-note.is-empty{ color:var(--text-faint); }
.clc-note-btn, .client-note-btn{ margin-top:8px; }
.clc-note-edit, .client-note-edit{ margin-top:8px; }
.clc-note-input, .client-note-input{ width:100%; resize:vertical; margin-bottom:8px; }

/* Всплывающее сообщение */
.toast{
  position:fixed; left:16px; right:16px; bottom:20px; max-width:460px; margin:0 auto;
  background:var(--danger); color:#fff; padding:13px 16px; border-radius:var(--radius-md);
  font-size:15.5px; font-weight:500; box-shadow:var(--shadow-lift);
  transform:translateY(160%); transition:transform .25s cubic-bezier(.2,.9,.3,1); z-index:70;
}
.toast.show{ transform:translateY(0); }

/* Выработка (shifts.php) */
.live-card{
  background:linear-gradient(150deg,
    color-mix(in srgb, var(--accent) 88%, black),
    color-mix(in srgb, var(--accent) 55%, var(--room-male)));
  color:#fff; border-radius:var(--radius-lg); padding:20px 22px;
  margin:18px 0; box-shadow:var(--shadow);
}
.live-card .lc-label{ font-size:13px; opacity:.75; font-weight:600; text-transform:uppercase; letter-spacing:.08em; }
.live-card .lc-time{ font-size:32px; font-weight:600; margin:5px 0 12px; letter-spacing:-.02em; }
.live-card .lc-row{
  display:flex; justify-content:space-between; font-size:15px; opacity:.92;
  padding:6px 0; border-top:1px solid rgba(255,255,255,.18);
}
.live-card .lc-closed{ font-size:14px; opacity:.85; }

.stat-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin:16px 0; }
@media (max-width:600px){ .stat-grid{ grid-template-columns:1fr; } }
.stat-box{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-md); padding:13px; text-align:center; box-shadow:var(--shadow);
}
.stat-box .sb-label{ font-size:13px; color:var(--text-faint); font-weight:600; text-transform:uppercase; letter-spacing:.06em; }
.stat-box .sb-value{ font-size:17px; font-weight:600; margin-top:4px; letter-spacing:-.02em; }

.section-card{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-lg); box-shadow:var(--shadow);
  padding:16px 18px; margin-bottom:16px;
}
.section-title{
  font-size:14.5px; font-weight:600; margin-bottom:12px;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  text-transform:uppercase; letter-spacing:.07em; color:var(--text-faint);
}
select#adminFilter{
  width:100%; padding:10px 12px; border:1px solid var(--line);
  border-radius:var(--radius-sm); background:var(--surface-2); color:var(--text); margin-bottom:14px;
}
.shift-row{ background:var(--surface-2); border-radius:var(--radius-md); padding:12px 14px; margin-bottom:8px; }
.shift-top{ display:flex; justify-content:space-between; align-items:center; gap:8px; }
.shift-date{ font-weight:600; font-size:15.5px; font-variant-numeric:tabular-nums; }
.shift-open-badge{
  font-size:13px; font-weight:700; color:var(--green); background:var(--green-soft);
  padding:2px 9px; border-radius:999px; white-space:nowrap; letter-spacing:.04em;
}
.shift-admin{ font-size:14px; color:var(--text-faint); margin-top:2px; }
.shift-stats{ display:flex; gap:16px; margin-top:9px; font-size:15px; color:var(--text-faint); flex-wrap:wrap; }
.shift-stats b{ color:var(--text); font-weight:600; font-variant-numeric:tabular-nums; }
.shift-edit-btn{ border:none; background:none; color:var(--text-faint); font-size:14px; padding:2px 4px; }
.shift-edit-btn:hover{ color:var(--accent); }
.empty-note{ color:var(--text-faint); font-size:15.5px; padding:22px 0; text-align:center; }

.rate-row, .compare-row{
  display:flex; justify-content:space-between; align-items:center;
  padding:9px 0; border-top:1px solid var(--line-soft); font-size:15px;
}
.rate-row:first-of-type, .compare-row:first-of-type{ border-top:none; }
.rate-row input{
  width:84px; padding:7px 9px; border:1px solid var(--line); border-radius:var(--radius-sm);
  background:var(--surface-2); color:var(--text); text-align:right; font-variant-numeric:tabular-nums;
}
.compare-rank{ font-weight:700; color:var(--text-faint); width:22px; font-variant-numeric:tabular-nums; }
.bonus-row{
  display:flex; justify-content:space-between; align-items:center;
  padding:9px 0; border-top:1px solid var(--line-soft); font-size:15px;
}
.bonus-row:first-of-type{ border-top:none; }
.bonus-amount{ font-weight:600; font-variant-numeric:tabular-nums; }
.bonus-amount.positive{ color:var(--green); }
.bonus-amount.negative{ color:var(--danger); }

/* Тарифы (tariffs.php) */
.tab-bar{ display:flex; flex-wrap:wrap; gap:6px; padding:16px 0 4px; }
.tab-btn{
  padding:8px 14px; border:1px solid var(--line); border-radius:999px;
  background:var(--surface-2); font-size:15px; font-weight:500;
  color:var(--text-faint); white-space:nowrap; transition:.15s;
}
.tab-btn:hover{ color:var(--text-muted); background:var(--surface-3); }
.tab-btn.active{ background:var(--accent); border-color:var(--accent); color:var(--accent-ink); font-weight:600; }
.tab-panel{ display:none; }
.tab-panel.active{ display:block; }

.date-label{ font-size:16px; font-weight:600; margin:18px 0 2px; text-transform:capitalize; letter-spacing:-.01em; }
.date-sub{ font-size:15px; color:var(--text-faint); margin-bottom:14px; }

.room-card{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-lg); box-shadow:var(--shadow);
  padding:15px 17px; margin-bottom:12px;
}
.room-title{ font-weight:600; font-size:14.5px; margin-bottom:10px; letter-spacing:-.01em; }
.zone-row, .bar-zone-row{ padding:10px 0; border-top:1px solid var(--line-soft); }
.zone-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.bar-zone-row{ display:flex; flex-direction:column; gap:8px; }
.zone-row:first-of-type, .bar-zone-row:first-of-type{ border-top:none; }
.zone-name{ font-size:15px; font-weight:500; }
.zone-time{ font-size:14px; color:var(--text-faint); font-variant-numeric:tabular-nums; }
.zone-default{ font-size:14px; color:var(--text-faint); margin-top:2px; }
.zone-input-wrap, .bar-zone-input-wrap{ display:flex; align-items:center; gap:8px; }
.bar-zone-input-wrap{ align-items:flex-end; gap:14px; flex-wrap:wrap; }
.stock-price-group{ display:flex; flex-direction:column; gap:4px; }
.stock-price-label{ font-size:13px; font-weight:600; color:var(--text-faint); text-transform:uppercase; letter-spacing:.05em; }
.zone-input-wrap input, .bar-zone-input-wrap input{
  width:88px; padding:8px 10px; border:1px solid var(--line); border-radius:var(--radius-sm);
  font-size:14px; font-weight:600; text-align:right;
  background:var(--surface-2); color:var(--text); font-variant-numeric:tabular-nums;
}
.zone-input-wrap input.overridden{
  border-color:var(--amber); background:var(--amber-soft); color:var(--amber);
}
.zone-reset{ border:none; background:none; color:var(--text-faint); font-size:15px; padding:3px; }
.zone-reset:hover{ color:var(--accent); }
.zone-reset:disabled{ opacity:.25; cursor:default; }

.save-bar{
  position:fixed; left:0; right:0; bottom:0; z-index:20;
  background:var(--surface); border-top:1px solid var(--line);
  padding:12px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow:0 -4px 24px rgba(0,0,0,.16);
}
.save-bar .inner{ max-width:1240px; margin:0 auto; display:flex; gap:10px; align-items:center; }
.save-btn{
  flex:1; background:var(--accent); color:var(--accent-ink); border:none;
  border-radius:var(--radius-md); padding:13px; font-weight:600; font-size:14.5px;
}
.save-btn:disabled{ opacity:.4; cursor:not-allowed; }
.save-note{ font-size:14.5px; color:var(--text-faint); }
.owner-note{
  background:var(--surface-2); border-radius:var(--radius-md);
  padding:11px 14px; font-size:15px; color:var(--text-muted); margin-top:14px;
}

/* Выручка, поиск, таблицы */
h1{ font-size:19px; font-weight:600; margin:20px 0 6px; letter-spacing:-.01em; }
h2{ font-size:15px; font-weight:600; margin:26px 0 10px; letter-spacing:-.01em; }

form.filters, .search-form{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:16px; }
form.filters input[type=date], .search-form input{
  padding:9px 12px; border:1px solid var(--line); border-radius:var(--radius-sm);
  background:var(--surface); color:var(--text); font-size:15.5px;
}
.search-form input{ flex:1; min-width:200px; }
form.filters button, .search-form button{
  padding:9px 16px; border-radius:var(--radius-sm); border:1px solid var(--accent);
  background:var(--accent); color:var(--accent-ink); font-weight:600; font-size:15.5px;
}
.preset-link{
  font-size:15px; padding:6px 12px; border-radius:999px;
  background:var(--surface-2); border:1px solid var(--line);
  color:var(--text-muted); text-decoration:none; font-weight:500;
}
.preset-link:hover{ background:var(--surface-3); color:var(--text); }

.stat-card{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-md); padding:14px 16px; box-shadow:var(--shadow);
}
.stat-label{ font-size:13px; color:var(--text-faint); font-weight:600; text-transform:uppercase; letter-spacing:.06em; }
.stat-value{ font-size:21px; font-weight:600; margin-top:5px; letter-spacing:-.02em; }

table{ width:100%; border-collapse:collapse; margin-bottom:12px; }
th, td{
  border-bottom:1px solid var(--line-soft); padding:10px 12px;
  text-align:left; font-size:15px;
}
th{
  background:var(--surface-2); font-weight:600; font-size:14px;
  text-transform:uppercase; letter-spacing:.06em; color:var(--text-faint);
  border-bottom:1px solid var(--line);
}
tr:last-child td{ border-bottom:none; }
td.num, th.num{ text-align:right; font-variant-numeric:tabular-nums; }
.undo-link{ color:var(--accent); text-decoration:none; font-weight:600; font-size:15px; }
.status-badge{
  font-size:13px; font-weight:600; padding:3px 9px; border-radius:999px;
  background:var(--surface-3); color:var(--text-faint); text-transform:uppercase; letter-spacing:.04em;
}
.status-badge.arrived{ background:var(--green-soft); color:var(--green); }
.status-badge.completed{ background:var(--surface-3); color:var(--text-faint); }

.client-card{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-lg); box-shadow:var(--shadow);
  padding:16px 18px; margin-bottom:16px;
}
.booking-row{ padding:11px 0; border-top:1px solid var(--line-soft); }
.booking-row:first-child{ border-top:none; }
.booking-top{ display:flex; justify-content:space-between; align-items:center; gap:10px; }
.booking-time{ font-weight:600; font-size:15.5px; font-variant-numeric:tabular-nums; }
.booking-total{ font-weight:600; font-variant-numeric:tabular-nums; }
.booking-addons{ font-size:14.5px; color:var(--text-faint); margin-top:3px; }

/* Объединение дублей (dedupe.php) */
.group-card{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-lg); box-shadow:var(--shadow);
  padding:16px 18px; margin-bottom:16px;
}
.group-phone{ font-size:14px; color:var(--text-faint); font-weight:600; margin-bottom:10px; font-variant-numeric:tabular-nums; }
.candidate{ display:flex; align-items:flex-start; gap:10px; padding:10px 0; border-top:1px dashed var(--line); }
.candidate:first-of-type{ border-top:none; }
.candidate input[type=radio]{ margin-top:4px; accent-color:var(--accent); }
.candidate-name{ font-weight:600; font-size:14px; }
.candidate-meta{ font-size:14.5px; color:var(--text-faint); margin-top:2px; }
.merge-btn{
  margin-top:12px; width:100%; background:var(--accent); color:var(--accent-ink);
  border:none; border-radius:var(--radius-sm); padding:11px; font-weight:600; font-size:14px;
}
.message{ padding:12px 14px; border-radius:var(--radius-md); font-size:15.5px; font-weight:500; margin-bottom:16px; }
.message.ok{ background:var(--green-soft); color:var(--green); }
.message.err{ background:var(--danger-soft); color:var(--danger); }
.intro{ color:var(--text-muted); font-size:15.5px; margin-bottom:16px; }

/* Вход (login.php) */
body.login-page{
  display:flex; align-items:center; justify-content:center;
  min-height:100vh; padding:20px; padding-bottom:20px;
}
.box{
  background:var(--surface); border:1px solid var(--line);
  border-radius:20px; padding:30px 28px; width:100%; max-width:352px;
  box-shadow:var(--shadow-lift);
}
.box h1{ font-size:18px; margin:0 0 4px; }
.box .box-sub{ font-size:15px; color:var(--text-faint); margin-bottom:20px; }
.box input{
  width:100%; padding:12px 14px; border:1px solid var(--line);
  border-radius:var(--radius-md); background:var(--surface-2); color:var(--text);
  font-size:15px; margin-bottom:12px;
}
.box input:focus{ border-color:var(--accent); outline:none; }
.box button{
  width:100%; padding:13px; background:var(--accent); color:var(--accent-ink);
  border:none; border-radius:var(--radius-md); font-weight:600; font-size:15px;
}
.error{
  background:var(--danger-soft); color:var(--danger);
  padding:11px 13px; border-radius:var(--radius-sm); font-size:15px;
  margin-bottom:14px; font-weight:500;
}

.hidden{ display:none !important; }

/* Разное */

.presets{ display:flex; gap:6px; flex-wrap:wrap; padding-bottom:14px; }
.preset-link.active{ background:var(--accent); border-color:var(--accent); color:var(--accent-ink); }
form.filters label{ font-size:15px; color:var(--text-faint); display:flex; align-items:center; gap:7px; }

.history-toggle{
  font-size:15px; font-weight:600; color:var(--accent);
  background:none; border:none; padding:10px 0 0;
}
.history-toggle:hover{ text-decoration:underline; }
.history{ display:none; margin-top:10px; }
.history.open{ display:block; }
.history-row.is-undone .h-label{ color:var(--text-faint); text-decoration:line-through; }

.detail-modal-body .card{ box-shadow:none; border:none; padding:0; margin:0; }
.detail-modal-body .card:hover{ box-shadow:none; }

/* Полоса состояния: смена и номера */
.statusbar{
  display:grid; grid-template-columns:minmax(240px, 1fr) 2fr;
  gap:14px; margin:18px 0 4px;
}
@media (max-width:960px){ .statusbar{ grid-template-columns:1fr; } }

.shift-card{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-lg); box-shadow:var(--shadow);
  padding:16px 18px; display:flex; flex-direction:column;
  justify-content:space-between; gap:12px; min-height:150px;
}
.shift-card.is-running{ border-color:var(--accent-line); }
.shift-label{
  font-size:13px; letter-spacing:.09em; text-transform:uppercase;
  color:var(--text-faint); font-weight:600;
}
.shift-live{ display:flex; align-items:center; gap:9px; margin-top:3px; }
.shift-time{ font-size:27px; font-weight:600; letter-spacing:-.02em; }
.pulse{
  width:7px; height:7px; border-radius:50%; background:var(--green); flex:none;
  animation:sauna-pulse 2.4s ease-out infinite;
}
.pulse[hidden]{ display:none; }
@keyframes sauna-pulse{
  0%{ box-shadow:0 0 0 0 color-mix(in srgb, var(--green) 55%, transparent); }
  70%{ box-shadow:0 0 0 8px transparent; }
  100%{ box-shadow:0 0 0 0 transparent; }
}
.shift-meta{ font-size:15px; color:var(--text-faint); display:flex; gap:14px; flex-wrap:wrap; }
.shift-meta b{ color:var(--text-muted); font-weight:600; font-variant-numeric:tabular-nums; }
.shift-card .shift-toggle-btn{ width:100%; padding:10px; }

.cal-dow{ color:var(--text-faint); font-weight:400; margin-left:6px; font-size:15px; }

.brand-name{ font-weight:600; font-size:15px; letter-spacing:-.01em; }
.brand-sub{
  font-size:13px; color:var(--text-faint);
  letter-spacing:.08em; text-transform:uppercase; margin-top:1px;
}
.admin-label{ display:inline-flex; align-items:center; gap:8px; padding:4px 12px 4px 5px; }
.who-dot{
  width:22px; height:22px; border-radius:50%; flex:none;
  background:var(--accent-soft); color:var(--accent);
  display:grid; place-items:center; font-size:13px; font-weight:700;
}

/* Панель управления и поля цен */


.save-chip{
  border:1px solid var(--accent-line); background:var(--accent-soft); color:var(--accent);
  border-radius:999px; padding:6px 13px; font-size:14.5px; font-weight:600;
  white-space:nowrap; transition:.15s;
}
.save-chip:hover{ background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.save-chip:active{ transform:translateY(1px); }

.reset-chip{
  border:1px solid var(--line); background:var(--surface-2); color:var(--text-faint);
  border-radius:999px; padding:6px 12px; font-size:14.5px; font-weight:500;
  white-space:nowrap; transition:.15s;
}
.reset-chip:hover:not(:disabled){ color:var(--amber); border-color:color-mix(in srgb, var(--amber) 40%, transparent); background:var(--amber-soft); }
.reset-chip:disabled{ opacity:.35; cursor:default; }

.shift-edit-btn{
  border:1px solid var(--line); background:var(--surface); color:var(--text-faint);
  border-radius:999px; padding:5px 11px; font-size:14px; font-weight:600; white-space:nowrap;
}
.shift-edit-btn:hover{ color:var(--accent); border-color:var(--accent-line); background:var(--accent-soft); }

/* Поле суммы со знаком валюты; родные стрелки number убраны. */
.money-field{ position:relative; display:inline-flex; align-items:center; }
.money-field i{
  position:absolute; right:11px; font-style:normal;
  font-size:14.5px; color:var(--text-faint); pointer-events:none; font-weight:500;
}
.money-field input{ padding-right:34px !important; text-align:right; }

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

.zone-input-wrap{ gap:7px; }
.bar-zone-input-wrap{ gap:16px; row-gap:10px; align-items:flex-end; }
.bar-zone-input-wrap .stock-price-group > div{ display:flex; align-items:center; gap:7px; }
.rate-row .money-field input{ width:96px; }

.modal-sub{
  font-size:15px; color:var(--text-faint); margin:-8px 0 16px;
}
.modal-sub b{ color:var(--text-muted); font-weight:600; }

/* Поля ввода. color-scheme привязан к выбранной теме, а не к системной —
   иначе при тёмной системе и светлой панели поля становились чёрными. */

:root{ color-scheme: light; }
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){ color-scheme: dark; }
}
:root[data-theme="dark"]{ color-scheme: dark; }
:root[data-theme="light"]{ color-scheme: light; }

input[type="text"], input[type="number"], input[type="date"],
input[type="time"], input[type="password"], input[type="search"],
input[type="tel"], input[type="datetime-local"], select, textarea{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  background:var(--surface-2);
  color:var(--text);
  font-family:inherit;
  font-size:14px;
  line-height:1.4;
  transition:border-color .15s, background .15s;
}
input:focus, select:focus, textarea:focus{
  border-color:var(--accent); outline:none;
  background:var(--surface);
}
input::placeholder, textarea::placeholder{ color:var(--text-faint); }
input:disabled, select:disabled, textarea:disabled{
  opacity:.5; cursor:not-allowed; background:var(--surface-3);
}

/* Своя стрелка у select — родная в каждом браузере своя. */
select{
  -webkit-appearance:none; -moz-appearance:none; appearance:none;
  padding-right:36px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%237E959C' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 13px center;
  cursor:pointer;
}
select:hover{ border-color:var(--accent-line); }

/* Иконку календаря в input[type=date] перекрашиваем под тёмную тему. */
:root[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
:root[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator{
  filter:invert(1) opacity(.65);
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) input[type="date"]::-webkit-calendar-picker-indicator,
  :root:not([data-theme="light"]) input[type="time"]::-webkit-calendar-picker-indicator{
    filter:invert(1) opacity(.65);
  }
}

/* Частные размеры, которые сбило правило выше */
.zone-input-wrap input, .bar-zone-input-wrap input{
  width:88px; padding:8px 10px; text-align:right; font-weight:600;
}
.money-field input{ padding-right:34px; }
.rate-row input{ width:96px; padding:7px 9px; text-align:right; }
.toolbar select, .toolbar input[type="date"]{ width:auto; padding:8px 11px; font-size:15.5px; }
form.filters input[type="date"], .search-form input{ width:auto; }
.search-form input{ flex:1; min-width:200px; }
.modal input, .modal select, .modal textarea{ margin-bottom:10px; }
.candidate input[type="radio"]{ width:auto; padding:0; }

#ownerFilterCard .field-label{ margin-top:0; }
select#adminFilter{ margin-bottom:0; }

/* Каталог (Тарифы → Услуги / Опции / Бар). Скрытая позиция — приглушённая, не удалённая. */
.catalog-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; margin-bottom:10px; flex-wrap:wrap;
}
.catalog-head .room-title{ margin-bottom:0; }
.catalog-head .btn{ padding:7px 13px; font-size:15px; white-space:nowrap; }

.catalog-actions{ display:flex; gap:6px; justify-content:flex-end; }

/* Категории внутри «Бар/еда» и «Услуги» — раскрываются нажатием. */
.cat-block{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-lg); box-shadow:var(--shadow);
  margin-bottom:10px; overflow:hidden;
}
.cat-summary{
  list-style:none; cursor:pointer; user-select:none;
  display:flex; align-items:center; gap:10px;
  padding:15px 17px; font-size:17px; font-weight:600; letter-spacing:-.01em;
  transition:background .15s;
}
.cat-summary::-webkit-details-marker{ display:none; }
.cat-summary::before{
  content:'▸'; font-size:14px; color:var(--text-faint);
  transition:transform .15s; flex:none;
}
.cat-block[open] > .cat-summary::before{ transform:rotate(90deg); }
.cat-summary:hover{ background:var(--surface-2); }
.cat-block[open] > .cat-summary{ border-bottom:1px solid var(--line-soft); }
.cat-body{ padding:13px 17px 15px; }
.cat-body .catalog-head{ margin-bottom:10px; display:flex; justify-content:flex-end; }

.catalog-note{
  margin-top:12px; padding-top:10px; border-top:1px solid var(--line-soft);
  font-size:14.5px; color:var(--text-faint); line-height:1.45;
}

.row-hidden{ opacity:.55; }
.row-hidden .zone-name{ text-decoration:line-through; text-decoration-thickness:1px; }

.hidden-badge{
  display:inline-block; margin-left:6px; padding:1px 7px;
  border-radius:999px; font-size:13px; font-weight:700; letter-spacing:.03em;
  text-transform:uppercase; text-decoration:none;
  background:var(--amber-soft); color:var(--amber);
}

.danger-chip{ color:var(--danger); }
.danger-chip:hover:not(:disabled){
  color:var(--danger); background:var(--danger-soft);
  border-color:color-mix(in srgb, var(--danger) 40%, transparent);
}

/* Настройка, которая сейчас ни на что не влияет (в отличие от .owner-note — «нельзя»). */
.warn-note{
  background:var(--amber-soft); border:1px solid color-mix(in srgb, var(--amber) 32%, transparent);
  border-radius:var(--radius-md); padding:11px 14px; margin-bottom:12px;
  font-size:15px; line-height:1.5; color:var(--text-muted);
}
.warn-note b{ color:var(--amber); font-weight:700; }
.warn-note code{ font-family:var(--mono); font-size:14px; }

/* Кнопки акций в окне скидок */
.discount-chips{ display:flex; flex-wrap:wrap; gap:7px; margin-bottom:12px; }

.discount-chip{
  display:flex; flex-direction:column; align-items:flex-start; gap:2px;
  padding:8px 12px; border:1px solid var(--line); border-radius:var(--radius-sm);
  background:var(--surface-2); color:var(--text-muted);
  font-family:var(--font); font-size:15px; text-align:left;
  cursor:pointer; transition:background .12s, border-color .12s, color .12s;
}
.discount-chip:hover{ background:var(--surface-3); border-color:var(--accent-line); color:var(--text); }
.discount-chip:active{ transform:translateY(1px); }
.discount-chip.active{
  background:var(--accent-soft); border-color:var(--accent); color:var(--text);
}

.discount-chip-name{ font-weight:600; }
.discount-chip-sum{ font-family:var(--mono); font-size:14.5px; color:var(--text-faint); }
.discount-chip.active .discount-chip-sum{ color:var(--accent); font-weight:600; }

.discount-chips-note{ font-size:15px; color:var(--text-faint); padding:4px 0; }

/* Зарплата: за что · формула · сумма */
.pay-breakdown{ margin-top:10px; border-top:1px solid var(--line-soft); }

.pay-row{
  display:grid; grid-template-columns:minmax(96px,auto) 1fr auto;
  gap:10px; align-items:baseline;
  padding:7px 0; border-bottom:1px solid var(--line-soft);
  font-size:15px;
}
.pay-row:last-child{ border-bottom:none; }
.pay-row-label{ font-weight:600; color:var(--text-muted); }
.pay-row-formula{ color:var(--text-faint); font-size:14px; }
.pay-row-amount{ font-family:var(--mono); font-weight:600; white-space:nowrap; }
.pay-row-total{ border-top:1px solid var(--line); margin-top:2px; padding-top:9px; }
.pay-row-total .pay-row-label,
.pay-row-total .pay-row-amount{ color:var(--text); font-weight:700; font-size:15.5px; }

.detail-toggle{
  margin-top:8px; padding:6px 11px; width:100%;
  border:1px solid var(--line); border-radius:var(--radius-sm);
  background:var(--surface-2); color:var(--text-muted);
  font-family:var(--font); font-size:14.5px; font-weight:600; cursor:pointer;
}
.detail-toggle:hover{ background:var(--surface-3); color:var(--text); }
.detail-toggle.open{ background:var(--accent-soft); border-color:var(--accent-line); color:var(--accent); }

.pay-detail{ margin-top:8px; }
.pay-detail-empty{ margin-top:8px; font-size:14.5px; color:var(--text-faint); }

.pd-booking{
  border:1px solid var(--line-soft); border-radius:var(--radius-sm);
  padding:9px 11px; margin-bottom:7px; background:var(--surface-2);
}
.pd-head{ display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:6px; }
.pd-title{ font-weight:600; font-size:15px; }
.pd-when{ font-size:14px; color:var(--text-faint); font-family:var(--mono); }

.pd-line{
  display:flex; justify-content:space-between; gap:12px; align-items:baseline;
  padding:3px 0; font-size:14px; color:var(--text-muted);
}
.pd-line b{ font-family:var(--mono); font-weight:600; color:var(--text); white-space:nowrap; }
.pd-line-muted{ color:var(--text-faint); }
.pd-line-muted b{ color:var(--text-faint); }
.pd-line-total{
  margin-top:4px; padding-top:6px; border-top:1px solid var(--line-soft);
  font-weight:600; color:var(--text);
}

.pay-settings input{
  width:100%; padding:9px 12px; margin-bottom:2px;
  border:1px solid var(--line); border-radius:var(--radius-sm);
  background:var(--surface); color:var(--text); font-size:15.5px;
}
.pay-settings-note{
  margin-top:10px; font-size:14.5px; color:var(--text-muted);
  background:var(--surface-2); border-radius:var(--radius-sm); padding:8px 11px;
}
.pay-settings-warn{
  margin-top:10px; font-size:14px; line-height:1.5; color:var(--text-faint);
  border-top:1px solid var(--line-soft); padding-top:9px;
}

.rate-hint{ color:var(--text-faint); font-size:14px; white-space:nowrap; }
.compare-parts{ font-size:14px; color:var(--text-faint); margin-top:2px; }
.field-hint{ font-size:14px; color:var(--text-faint); margin:-6px 0 10px; }

/* Календарь смен — отличия от общего .cal-* */
.cal-grid-shifts{ gap:4px; }

.cal-day-shift{
  aspect-ratio:auto; min-height:74px;
  flex-direction:column; align-items:stretch; justify-content:flex-start;
  gap:1px; padding:5px 5px 6px; cursor:default;
}
.cal-day-shift .cd-num{
  font-size:14px; font-weight:600; line-height:1.15; color:var(--text-faint);
}

.cal-day-shift.has-shift{ background:var(--accent-soft); cursor:pointer; }
.cal-day-shift.has-shift:hover{ background:var(--accent-line); }
.cal-day-shift.has-shift .cd-num{ color:var(--accent); }
.cal-day-shift.no-shift,
.cal-day-shift.no-shift:hover{ background:var(--surface-2); }

.cd-hours{
  margin-top:auto; font-family:var(--mono); font-size:13px;
  font-weight:600; color:var(--text); line-height:1.2;
}
.cd-money{ font-family:var(--mono); font-size:13px; color:var(--text-muted); line-height:1.2; }

.cal-month-totals{ margin-top:12px; border-top:1px solid var(--line-soft); }

@media (max-width:560px){
  .cal-day-shift{ min-height:66px; padding:4px 3px 5px; }
  .cd-money{ display:none; }
}

/* Детализация смены: строка на проданную позицию */
.sale{
  display:grid; grid-template-columns:1fr auto auto auto;
  gap:12px; align-items:baseline;
  padding:9px 0; border-top:1px solid var(--line-soft);
}
.sale:first-of-type{ border-top:none; }

.sale-what{ font-size:15px; font-weight:500; color:var(--text); }
.sale-qty{ font-family:var(--mono); font-size:14px; color:var(--text-muted); white-space:nowrap; }
.sale-price{
  font-family:var(--mono); font-size:14px; color:var(--text-muted);
  font-variant-numeric:tabular-nums; white-space:nowrap;
}
.sale-got{
  font-family:var(--mono); font-size:15px; font-weight:600; color:var(--green);
  font-variant-numeric:tabular-nums; white-space:nowrap;
}
.sale-pct{
  display:inline-block; margin-left:7px; padding:2px 7px; border-radius:999px;
  background:var(--surface-3); color:var(--text-muted);
  font-family:var(--font); font-size:13px; font-weight:700;
}
.sale-none{ font-family:var(--font); font-size:13px; font-weight:500; color:var(--text-faint); }

.sale-penalty .sale-what{ color:var(--text-muted); }
.sale-penalty .sale-price{ color:var(--amber); }

.sale-total{
  border-top:2px solid var(--line); margin-top:4px; padding-top:10px;
}
.sale-total .sale-what{ font-weight:700; font-size:15.5px; }
.sale-total .sale-got{ font-size:16px; font-weight:700; }
.sale-total .sale-price{ font-size:13.5px; }

@media (max-width:620px){
  .sale{ grid-template-columns:1fr auto; row-gap:2px; }
  .sale-qty{ grid-column:2; }
  .sale-price{ grid-column:2; text-align:right; }
  .sale-got{ grid-column:2; text-align:right; }
}

/* Карточка заявки */

.comment-block{
  background:var(--amber-soft); border-left:4px solid var(--amber);
  border-radius:var(--radius-sm); padding:12px 15px; margin:12px 0;
  font-size:16px; font-weight:500; line-height:1.5; color:var(--text);
}
.comment-label{
  display:block; font-size:13px; font-weight:700; text-transform:uppercase;
  letter-spacing:.06em; color:var(--amber); margin-bottom:4px;
}

/* Чек */
.r-group{
  font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:.06em;
  color:var(--text-faint); margin:12px 0 4px;
}
.r-group:first-child{ margin-top:0; }

.r-line{
  display:grid; grid-template-columns:1fr auto auto; gap:12px;
  align-items:baseline; padding:6px 0; font-size:16px;
}
.r-name{ color:var(--text); }
.r-qty{ font-family:var(--mono); font-size:14px; color:var(--text-muted); }
.r-sum{
  font-family:var(--mono); font-size:16px; font-weight:600;
  font-variant-numeric:tabular-nums; white-space:nowrap;
}

.r-discount .r-sum{ color:var(--green); }
.r-paid .r-name, .r-paid .r-sum{ color:var(--text-muted); }
.r-penalty .r-name{ color:var(--text-muted); }
.r-penalty .r-sum{ color:var(--amber); }

.r-total{
  display:flex; justify-content:space-between; gap:12px; align-items:baseline;
  border-top:2px solid var(--line); margin-top:10px; padding-top:10px;
  font-size:19px; font-weight:700;
}
.r-total.r-due{ color:var(--accent); font-size:20px; }
.r-total.r-settled{ color:var(--green); }

/* Действия */
.btn-main{ flex:1 1 auto; min-width:150px; font-size:16px; padding:13px 18px; }

/* Карточка брони на весь экран: шапка и «Закрыть» закреплены. */
.modal.modal-full{
  top:0; left:0; transform:none;
  width:100%; max-width:none;
  height:100dvh; max-height:100dvh;
  padding:0; border:none; border-radius:0;
  display:flex; flex-direction:column;
}
.modal.modal-full.open{ transform:none; }

.modal-full .detail-modal-body{
  flex:1 1 auto; overflow-y:auto;
  padding:20px 22px; min-height:0;
}
.modal-full > .row{
  flex:0 0 auto; margin:0 !important;
  padding:10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top:1px solid var(--line); background:var(--surface);
}
.modal-full > .row .btn{ width:100%; padding:12px; font-size:15px; }

/* В окне всё компактнее, чем в списке (не мельче 13px). */
.modal-full .detail-modal-body{ padding:12px 15px; }

.modal-full .card-top{ margin-bottom:7px; }
.modal-full .time-range{ font-size:18px; }
.modal-full .room-name{ font-size:14.5px; margin-top:1px; }
.modal-full .badge{ font-size:13px; padding:4px 9px; }

.modal-full .client-row{ padding:6px 0; }
.modal-full .client-name{ font-size:16px; }
.modal-full .client-phone{ font-size:15px; }

.modal-full .comment-block{
  font-size:15px; padding:7px 11px; margin:6px 0; line-height:1.35;
}
.modal-full .comment-label{ font-size:12.5px; margin-bottom:2px; }

.modal-full .price-row{ margin-top:8px; }
.modal-full .r-group{ font-size:12.5px; margin:6px 0 0; }
.modal-full .r-line{ font-size:15px; padding:2px 0; }
.modal-full .r-sum{ font-size:15px; }
.modal-full .r-qty{ font-size:13.5px; }
.modal-full .r-total{ font-size:17px; margin-top:6px; padding-top:6px; }
.modal-full .r-total.r-due{ font-size:18.5px; }

.modal-full .source-tag{ font-size:13px; margin-top:5px; line-height:1.25; }
.modal-full .flag-note, .modal-full .no-prepay-flag{ font-size:14px; padding:7px 10px; margin:6px 0; }

/* Кнопки теми же строками, что в списках, — только компактнее. */
.modal-full .actions{ margin-top:6px; padding-top:6px; gap:5px; }
.modal-full .actions-row{ gap:5px; }
.modal-full .actions .btn{ font-size:14.5px; padding:8px 11px; }
.modal-full .actions .btn-main{ flex:1 1 100%; font-size:15.5px; padding:11px 16px; }

.modal-full .card{ gap:6px; }
.modal-full .client-row{ padding:2px 0; }
.modal-full .source-tag{ margin-top:3px; }
.modal-full .day-peek{ margin-top:6px; padding-top:6px; }
.modal-full .day-peek-btn{ padding:8px 11px; }

@media (min-width:760px){
  .modal.modal-full{
    left:50%; top:50%; transform:translate(-50%,-48%);
    width:min(760px, 94vw); height:min(92dvh, 940px);
    border:1px solid var(--line); border-radius:20px;
  }
  .modal.modal-full.open{ transform:translate(-50%,-50%); }
}

/* Состояния залиты цветом целиком — альфа .10 на белом не читалась. */

.badge.arrived{
  background:var(--green); color:#FFFFFF;
  font-weight:700; box-shadow:0 1px 3px rgba(11,158,69,.35);
}
:root[data-theme="dark"] .badge.arrived{ color:#04211F; }
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .badge.arrived{ color:#04211F; }
}

.badge.paid{
  background:var(--green-soft); color:var(--green);
  border:1.5px solid var(--green); font-weight:700;
}

.cal-day.load-low,
.cal-day.load-mid,
.cal-day.load-high{ color:#FFFFFF; font-weight:700; }
.cal-day.load-low{ background:var(--green); }
.cal-day.load-mid{ background:var(--amber); }
.cal-day.load-high{ background:var(--danger); }
.cal-day.load-low:hover{ background:var(--green); filter:brightness(1.1); }
.cal-day.load-mid:hover{ background:var(--amber); filter:brightness(1.1); }
.cal-day.load-high:hover{ background:var(--danger); filter:brightness(1.1); }
:root[data-theme="dark"] .cal-day.load-low,
:root[data-theme="dark"] .cal-day.load-mid,
:root[data-theme="dark"] .cal-day.load-high{ color:#08120F; }
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .cal-day.load-low,
  :root:not([data-theme="light"]) .cal-day.load-mid,
  :root:not([data-theme="light"]) .cal-day.load-high{ color:#08120F; }
}

/* Уборка в расписании — жёлтым: номер занят не гостем. */
table.schedule td.buffer-slot{
  background:repeating-linear-gradient(135deg,
    rgba(255,196,0,.30) 0 6px,
    rgba(255,196,0,.62) 6px 12px);
}
:root[data-theme="dark"] table.schedule td.buffer-slot,
:root:not([data-theme="light"]) table.schedule td.buffer-slot{
  background:repeating-linear-gradient(135deg,
    rgba(255,190,60,.22) 0 6px,
    rgba(255,190,60,.44) 6px 12px);
}

/* Услуга с договорной ценой — поле, а не подпись. */
.addon-row-priced{ align-items:center; gap:10px; flex-wrap:wrap; }
.addon-row-name{ flex:1 1 140px; font-size:15px; }
.addon-row-controls{ display:flex; align-items:center; gap:8px; }
.addon-price-field input{
  width:92px; text-align:right; padding:8px 26px 8px 10px !important;
  font-size:15px;
}
@media (max-width:420px){
  .addon-row-name{ flex:1 1 100%; }
  .addon-row-controls{ width:100%; justify-content:space-between; }
}

/* Процент за номер поделён между двумя админами. */
.sale-split{
  display:inline-block; margin-left:6px; padding:2px 8px; border-radius:999px;
  background:var(--amber-soft); color:var(--amber);
  font-family:var(--font); font-size:13px; font-weight:700;
}
.pd-note{
  margin:2px 0 6px; padding:6px 10px; border-radius:var(--radius-sm);
  background:var(--amber-soft); color:var(--text-muted);
  font-size:13.5px; line-height:1.35;
}

/* Вычеркнутая продажа остаётся видна зачёркнутой. */
.sale-voided .sale-what,
.sale-voided .sale-price,
.sale-voided .sale-qty{ text-decoration:line-through; color:var(--text-faint); }
.sale-voided .sale-got{ color:var(--text-faint); }

.sale-void{
  margin-left:8px; width:26px; height:26px; line-height:1;
  border:1px solid var(--line); border-radius:var(--radius-sm);
  background:var(--surface-2); color:var(--text-muted);
  font-family:var(--font); font-size:14px; font-weight:700; cursor:pointer;
  vertical-align:middle;
}
.sale-void:hover{ background:var(--danger-soft); color:var(--danger); border-color:var(--danger); }
.sale-void:focus-visible{ outline:3px solid var(--accent-line); outline-offset:2px; }

.r-voided .r-name, .r-voided .r-sum, .r-voided .r-qty{
  text-decoration:line-through; color:var(--text-faint);
}

/* Записи на день внутри карточки заявки */
.day-peek{ margin-top:10px; padding-top:10px; border-top:1px solid var(--line-soft); }
.day-peek-btn{ width:100%; text-align:center; justify-content:center; }
.day-peek-btn.is-open{ background:var(--accent-soft); color:var(--accent); }
.day-peek-body{ margin-top:10px; }
.day-peek-note{ font-size:13.5px; line-height:1.4; color:var(--text-faint); margin-bottom:8px; }
.day-peek-empty{
  padding:16px; text-align:center; color:var(--text-faint);
  border:1px dashed var(--line); border-radius:var(--radius-lg);
}
/* 48 строк — ограничиваем высоту, иначе карточка растянется на экраны. */
.day-peek-body .schedule-wrap{ max-height:420px; overflow-y:auto; }
.day-peek-body table.schedule{ min-width:520px; }

/* Касса: окно оплаты */
/* Длинный чек прокручивается, чтобы поля оплаты не уезжали. */
#payReceipt{
  max-height:34vh; overflow-y:auto;
  border:1px solid var(--line-soft); border-radius:var(--radius-md);
  padding:10px 12px; margin-bottom:12px;
}
.pay-due{
  display:flex; justify-content:space-between; align-items:baseline;
  font-size:15px; font-weight:600;
  padding:10px 12px; margin-bottom:14px;
  border-radius:var(--radius-md);
  background:var(--accent-soft); border:1px solid var(--accent-line);
}
.pay-due b{ font-family:var(--mono); font-size:22px; color:var(--accent); }

.pay-methods{ display:flex; gap:8px; margin-bottom:10px; flex-wrap:wrap; }
.pay-method{
  flex:1 1 110px; display:flex; flex-direction:column; align-items:center; gap:4px;
  padding:12px 8px; font-size:19px; cursor:pointer;
  background:var(--surface); color:var(--text);
  border:1.5px solid var(--line); border-radius:var(--radius-md);
  transition:border-color .12s, background .12s;
}
.pay-method span{ font-size:13.5px; font-weight:600; }
.pay-method:hover{ border-color:var(--accent-line); }
.pay-method.selected{
  border-color:var(--accent); background:var(--accent-soft); color:var(--accent);
}

.pay-split-row{ display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.pay-split{ margin-bottom:12px; }
.pay-split-row label{ flex:0 0 120px; font-size:14px; }
.pay-split-row input{ flex:1; margin:0; }

/* Автор строки чека */
.r-meta{
  display:block; font-size:12.5px; line-height:1.25;
  color:var(--text-faint); margin-top:1px;
}
.modal-full .r-meta{ font-size:12px; }

.pay-bonus-box{ flex-wrap:wrap; }
.pay-bonus-controls{ display:flex; align-items:center; gap:8px; }
.pay-bonus-controls input{ width:150px; margin-bottom:0 !important; }
.pay-bonus-controls .btn{ white-space:nowrap; }

.client-recent{ margin-top:6px; }
.client-recent-row{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:11px 14px; margin-bottom:8px;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-md); box-shadow:var(--shadow);
  text-decoration:none; color:inherit;
}
.client-recent-row:hover{ background:var(--surface-2); }
.client-recent-main{ min-width:0; }
.client-recent-name{ font-weight:600; font-size:15.5px; }
.client-recent-sub{ font-size:13.5px; color:var(--text-faint); margin-top:2px; }
.client-recent-when{
  text-align:right; font-size:13.5px; color:var(--text-muted);
  font-variant-numeric:tabular-nums; white-space:nowrap;
}
.client-recent-when b{ display:block; font-size:15px; color:var(--text); }
.client-recent-now{ color:var(--green); font-weight:600; }
.badge.bonus{ background:var(--accent-soft); color:var(--accent); text-transform:none; letter-spacing:0; }

/* Время начала: часы + минуты через 5 */
.time-pick{ display:flex; align-items:center; gap:6px; }
.time-pick select{ flex:1 1 0; min-width:0; }
.time-pick .tp-sep{ font-weight:600; color:var(--text-muted); }

/* Расписание на телефоне: три номера без горизонтальной прокрутки */
@media (max-width:600px){
  table.schedule,
  .day-peek-body table.schedule{ min-width:0; }
  .schedule-wrap{ overflow-x:hidden; }
  table.schedule th{ padding:8px 4px; font-size:11.5px; letter-spacing:.02em; }
  table.schedule th:first-child{ width:40px; }
  table.schedule td.hour-cell{ font-size:11.5px; padding:3px 4px 0 0; }
  table.schedule td.sched-cell{ padding:5px 5px; }
  .sched-booking{ font-size:12.5px; line-height:1.3; padding-bottom:0; }
  .sched-time{ font-size:12px; }
  .sched-money{ font-size:12px; }
  .sched-money-label{ display:none; }
  .sched-discount, .sched-source, .sched-noprepay, .sched-overlap{ font-size:11.5px; }
  .sched-author{ position:static; font-size:11px; }
  .sched-note, .sched-note-input{ font-size:14px !important; }
}
.modal .time-pick{ margin-bottom:10px; }
.modal .time-pick select{ margin-bottom:0; }

/* Окно создания: часы узким полем, справа акции 3+1 / 4+1 */
.hours-promo{ display:flex; gap:12px; align-items:flex-start; }
.hours-promo .hp-hours{ flex:0 0 110px; }
.hours-promo .hp-promo{ flex:1 1 auto; min-width:0; }
.promo-pick{ display:flex; gap:8px; margin-bottom:10px; }
.promo-btn{
  flex:0 0 auto; min-width:72px; padding:10px 16px;
  border:1px solid var(--line); border-radius:var(--radius-sm);
  background:var(--surface-2); color:var(--text-muted);
  font-family:var(--font); font-size:15px; font-weight:600; line-height:1.4;
  cursor:pointer; transition:background .12s, border-color .12s, color .12s;
}
.promo-btn:hover:not(:disabled){ background:var(--surface-3); border-color:var(--accent-line); color:var(--text); }
.promo-btn.active{ background:var(--accent-soft); border-color:var(--accent); color:var(--accent); }
.promo-btn:disabled{ opacity:.45; cursor:not-allowed; }
.promo-btn:focus-visible{ outline:3px solid var(--accent-line); outline-offset:2px; }
.field-hint.hint-warn{ color:var(--danger); }
