/* ============================================================
   Локон.Про — дизайн-система админки
   Источник: Админка.dc.html (docs/design/спецификация-приложения.md)
   ============================================================ */

body {
  --bg:#F3F1F7; --panel:#FFFFFF; --bg2:#F7F5FA; --ink:#18151D; --mut:#74707C; --faint:#A29DAC;
  --line:#EAE6EF; --acc:#7C3AED; --acc2:#A855F7; --deep:#241044; --soft:#F4EEFE;
  --shadow:0 12px 32px rgba(36,16,68,.08);
  --nav:#F3F1F7; --navink:#6F6A7A; --navtitle:#241044; --navborder:#EAE6EF;
  --navhover-bg:#E7E1F6; --navhover-ink:#6D28D9; --navbadge-bg:#E4D8FB; --navbadge-ink:#6D28D9;
  margin:0; font-family:'Onest',-apple-system,'Segoe UI',sans-serif;
  -webkit-font-smoothing:antialiased; background:var(--bg); color:var(--ink);
}
body.dark {
  --bg:#0A0713; --panel:#141020; --bg2:#1B1530; --ink:#F1EDF8; --mut:#9B93AB; --faint:#6E657F;
  --line:#28203C; --acc:#8B5CF6; --acc2:#A855F7; --deep:#E9DFFB; --soft:#221838;
  --shadow:0 12px 32px rgba(0,0,0,.5);
  --nav:#0E0A18; --navink:#8E85A3; --navtitle:#F1EDF8; --navborder:rgba(255,255,255,.08);
  --navhover-bg:rgba(255,255,255,.06); --navhover-ink:#FFFFFF;
  --navbadge-bg:rgba(255,255,255,.14); --navbadge-ink:#FFFFFF;
  color-scheme:dark;
}
* { box-sizing:border-box; }
a { color:var(--acc); text-decoration:none; }
button, input, select { font-family:inherit; }
input[type=checkbox] { accent-color:#7C3AED; }

/* ---------- Shell ---------- */
.shell { display:grid; grid-template-columns:246px 1fr; min-height:100vh; }
.shell > div { min-width:0; }   /* иначе широкая сетка календаря растягивает всю страницу */
.shell.collapsed { grid-template-columns:70px 1fr; }

/* Сайдбар */
.sidebar { background:var(--nav); border-right:1px solid var(--navborder); display:flex; flex-direction:column;
  padding:18px 12px; gap:4px; position:sticky; top:0; height:100vh; overflow-y:auto; }
.sidebar .logo { display:flex; align-items:center; gap:10px; padding:6px 8px 18px; }
/* Переключатель салонов сети — только когда салонов больше одного */

/* Формы разделов. Раньше эти правила лежали в <style> внутри самих страниц — а в
   StaffPage блок оказался внутри условия и на вкладке «Кабинеты» не рендерился вовсе.
   Держим их здесь: одно место, работает на любой вкладке. */
.s-input { width:100%; box-sizing:border-box; padding:11px 13px; border:1px solid var(--line);
           border-radius:11px; background:var(--panel); color:var(--ink); font-size:13.5px;
           font-family:inherit; outline:none; }
.s-input:focus { border-color:var(--acc); }

/* Кабинеты и оборудование */
.res-form { display:grid; gap:12px; align-items:end; max-width:720px;
            grid-template-columns:minmax(200px,2fr) minmax(160px,1.1fr) auto; }
.res-actions { display:flex; gap:8px; }
@media (max-width:700px) {
    .res-form { grid-template-columns:1fr; }
    .res-actions { grid-column:1/-1; }
}

/* Техкарта: услуга — материал — расход — кнопка */
.recipe-form { display:grid; gap:12px; align-items:end; max-width:820px;
               grid-template-columns:minmax(180px,1.5fr) minmax(180px,1.5fr) minmax(120px,.8fr) auto; }
@media (max-width:760px) {
    .recipe-form { grid-template-columns:1fr 1fr; }
    .recipe-form > .btn { grid-column:1/-1; }
}

/* Схема оплаты мастера и ставки по салонам */
.table .trow.scheme-row, .scheme-row { background:var(--bg2); padding:0 !important;
                                        box-shadow:inset 3px 0 0 var(--acc); cursor:default; }
.scheme-box { display:flex; flex-direction:column; gap:12px; padding:16px 20px; }
.scheme-title { font-size:13.5px; color:var(--deep); }
.scheme-hint { font-size:11.5px; line-height:1.5; color:var(--mut); }
.scheme-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:12px; max-width:640px; }
.scheme-actions { display:flex; gap:10px; flex-wrap:wrap; }
.rate-row { display:grid; gap:12px; align-items:end; padding:12px 0; border-top:1px dashed var(--line);
            grid-template-columns:minmax(120px,1.4fr) repeat(3, minmax(110px,1fr)) auto; }
.rate-row:first-of-type { border-top:none; }
.rate-name { font-size:13.5px; font-weight:600; padding-bottom:11px; overflow-wrap:anywhere; }
.rate-row:not(:first-of-type) .c-field label { display:none; }
.rate-actions { display:flex; gap:10px; align-items:center; }
.rate-actions .btn { padding:10px 14px; font-size:12.5px; }
@media (max-width:900px) {
    .rate-row { grid-template-columns:1fr 1fr; }
    .rate-name { grid-column:1/-1; padding-bottom:0; }
    .rate-actions { grid-column:1/-1; }
    .rate-row:not(:first-of-type) .c-field label { display:block; }
}

/* Карточка тарифа: период выбирается сегментом, оплата — отдельной кнопкой снизу */
.plan-card { flex:1; min-width:210px; display:flex; flex-direction:column; gap:10px;
             border:1px solid var(--line); border-radius:14px; padding:14px 16px; }
.plan-card.current { border-color:var(--acc); box-shadow:0 0 0 3px var(--soft); }
.plan-name { font-size:15px; color:var(--deep); }
.plan-badge { margin-left:7px; font-size:11px; font-weight:600; color:var(--acc);
              background:var(--soft); border-radius:999px; padding:2px 8px; }
.plan-price { display:block; font-size:12.5px; color:var(--mut); margin-top:2px; }
.plan-period { width:100%; }
.plan-period button { flex:1; font-size:12.5px; padding:7px 4px; }
.plan-total { font-size:13.5px; font-weight:600; color:var(--deep); }
.plan-save { display:block; font-size:11.5px; font-weight:500; color:#16A34A; margin-top:2px; }
.plan-pay { width:100%; margin-top:auto; }

/* Полоса «подписка не оплачена» — над всем интерфейсом, на каждой странице */
.expired-bar { position:sticky; top:0; z-index:60; display:flex; gap:10px; align-items:center;
               flex-wrap:wrap; padding:10px 18px; background:#FEF2F2; border-bottom:1px solid #FECACA;
               color:#7F1D1D; font-size:13px; }
.expired-bar b { color:#991B1B; }
.expired-bar button { margin-left:auto; border:none; background:#DC2626; color:#fff; font:inherit;
                      font-size:12.5px; font-weight:600; padding:7px 14px; border-radius:9px; cursor:pointer; }
.expired-bar button:hover { background:#B91C1C; }

/* Росчерк клиента в карточке документа: подпись с планшета, не картинка-заглушка */
.signature { display:block; width:100%; max-width:220px; height:52px; object-fit:contain;
             border:1px solid var(--line); border-radius:8px; background:#fff; padding:2px 6px; }

/* Полоса демо-режима. Тон спокойный: это не ошибка, а подсказка, где посетитель находится */
.demo-bar { position:sticky; top:0; z-index:60; display:flex; gap:10px; align-items:center;
            flex-wrap:wrap; padding:10px 18px; background:#EEF2FF; border-bottom:1px solid #C7D2FE;
            color:#312E81; font-size:13px; }
.demo-bar b { color:#3730A3; }
.demo-bar a { margin-left:auto; background:var(--acc); color:#fff; text-decoration:none;
              font-size:12.5px; font-weight:600; padding:7px 14px; border-radius:9px; }
.demo-bar a:hover { filter:brightness(.94); }

/* Плитки показателей (Склад, Аналитика, Финансы, Сертификаты). Раньше объявлялись
   только в «Сертификатах» — на остальных страницах плитки слипались без отступов. */
.kpi-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:14px; }
.kpi { display:flex; flex-direction:column; gap:4px; }
.kpi-label { font-size:12px; color:var(--mut); text-transform:uppercase; letter-spacing:.04em; }
.kpi-value { font-size:24px; color:var(--deep); }
.kpi-sub { font-size:12px; color:var(--mut); }

/* Поля форм — общие для всех разделов. Раньше объявлялись внутри отдельных страниц,
   и там, где их не было (например «Зарплаты»), браузер рисовал нативные контролы. */
.c-field { display:flex; flex-direction:column; min-width:0; }
.c-field label { font-size:12.5px; font-weight:600; display:block; margin-bottom:5px; color:var(--ink); }
.c-input { width:100%; box-sizing:border-box; padding:10px 13px; border:1px solid var(--line);
           border-radius:10px; background:var(--panel); color:var(--ink); font-size:13.5px;
           font-family:inherit; outline:none; appearance:none; -webkit-appearance:none; }
.c-input:focus { border-color:var(--acc); }
.c-input:disabled { opacity:.55; cursor:not-allowed; }
/* Многострочные поля: тянем только по вертикали, вбок ломало бы сетку формы */
textarea.c-input { min-height:62px; line-height:1.5; resize:vertical; }

/* Стрелка у select рисуется фоном: нативная выглядит инородно рядом с остальными полями */
select.c-input { padding-right:34px; cursor:pointer;
  background-image:url("data:image/svg+xml;charset=utf-8,%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='%2374707C' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 13px center; }
/* Числовые поля без «крутилок»: они ломают высоту и всё равно неудобны мышью */
.c-input[type=number]::-webkit-outer-spin-button,
.c-input[type=number]::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.c-input[type=number] { -moz-appearance:textfield; }

/* Плашка о событии календаря: поверх всего, гаснет сама через 8 секунд */
.live-alert { position:fixed; right:20px; bottom:20px; z-index:999; max-width:340px; cursor:pointer;
              background:var(--deep); color:#fff; border-radius:14px; padding:13px 16px;
              font-size:13.5px; line-height:1.5; box-shadow:0 10px 30px rgba(0,0,0,.25);
              animation:liveAlertIn .18s ease-out; }
@keyframes liveAlertIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.notify-ask { width:100%; margin:0 0 10px; padding:8px 10px; border-radius:10px; font:inherit; font-size:12.5px;
               background:var(--soft); color:var(--acc); border:1px solid transparent; cursor:pointer; text-align:left; }
.notify-ask:hover { border-color:var(--acc); }
.org-switch { width:100%; margin:0 0 14px; padding:8px 32px 8px 10px; border-radius:10px; font:inherit; font-size:13px;
              background:var(--bg2); color:var(--ink); border:1px solid var(--line); cursor:pointer; outline:none;
              appearance:none; -webkit-appearance:none;
              background-image:url("data:image/svg+xml;charset=utf-8,%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='%2374707C' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
              background-repeat:no-repeat; background-position:right 11px center; }
.sidebar .logo-mark { width:34px; height:34px; border-radius:10px; background:linear-gradient(135deg,#7C3AED,#A855F7);
  color:#fff; font-size:16px; font-weight:800; display:flex; align-items:center; justify-content:center; flex:none; }
.sidebar .logo b { display:block; font-size:14.5px; color:var(--navtitle); }
.sidebar .logo span { font-size:11px; color:var(--navink); }
.nav-item { display:flex; align-items:center; gap:11px; padding:10px 12px; border-radius:11px; border:none; cursor:pointer;
  background:transparent; color:var(--navink); font-size:13.5px; font-weight:600; width:100%; text-align:left; }
.nav-item:hover { background:var(--navhover-bg); color:var(--navhover-ink); }
.nav-item.active { background:linear-gradient(135deg,var(--acc),var(--acc2)); color:#fff; }
.nav-item.active:hover { background:linear-gradient(135deg,var(--acc),var(--acc2)); color:#fff; }
.nav-item.active .badge { background:rgba(255,255,255,.22); color:#fff; }
.nav-item .ico { width:20px; height:20px; flex:none; display:inline-flex; align-items:center;
  justify-content:center; font-size:15px; }
.nav-item .ico svg { width:20px; height:20px; display:block; }
.nav-item .badge { margin-left:auto; background:var(--navbadge-bg); color:var(--navbadge-ink); font-size:10.5px; font-weight:700;
  padding:2px 7px; border-radius:99px; }
.sidebar .bottom { margin-top:auto; border-top:1px solid var(--navborder); padding-top:10px; display:flex; flex-direction:column; gap:2px; }
.shell.collapsed .nav-label, .shell.collapsed .logo b, .shell.collapsed .logo span, .shell.collapsed .nav-item .badge { display:none; }
.shell.collapsed .nav-item { justify-content:center; padding:10px 0; }

/* Топбар */
.topbar { position:sticky; top:0; z-index:20; height:64px; background:var(--panel); border-bottom:1px solid var(--line);
  display:flex; align-items:center; gap:18px; padding:0 22px; }
.topbar .titles b { display:block; font-size:17px; color:var(--deep); letter-spacing:-.015em; }
.topbar .titles span { font-size:12.5px; color:var(--mut); }
.search-box { flex:1; max-width:420px; margin:0 auto; position:relative; }
.topbar .search { background:var(--panel); border:1px solid var(--line); border-radius:11px; padding:7px 10px 7px 14px;
  font-size:13px; color:var(--mut); display:flex; gap:8px; align-items:center; }
.topbar .search:focus-within { border-color:var(--acc); background:var(--panel); }
.topbar .search input { flex:1; border:none; outline:none; background:none; font-family:inherit;
  font-size:13px; color:var(--ink); min-width:0; }
.search-drop { position:absolute; z-index:70; top:calc(100% + 6px); left:0; right:0; max-height:60vh; overflow-y:auto;
  background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:6px;
  box-shadow:0 18px 44px rgba(36,16,68,.18); display:flex; flex-direction:column; }
.search-group { font-size:10.5px; text-transform:uppercase; letter-spacing:.05em; color:var(--mut);
  padding:8px 10px 4px; }
.search-hit { display:flex; flex-direction:column; gap:2px; text-align:left; padding:8px 10px; background:none;
  border:none; border-radius:9px; cursor:pointer; font-family:inherit; color:var(--ink); }
.search-hit:hover { background:var(--navhover-bg); }
.search-hit b { font-size:13.5px; }
.search-hit span { font-size:11.5px; color:var(--mut); }
.search-empty { padding:14px 10px; font-size:13px; color:var(--mut); text-align:center; }
.topbar .user-wrap { position:relative; }
/* Профиль — кнопка: по клику открывается меню с профилем, темой и выходом */
.topbar .user { display:flex; align-items:center; gap:10px; background:none; border:1px solid transparent;
  border-radius:12px; padding:5px 8px 5px 5px; cursor:pointer; font:inherit; text-align:left; }
.topbar .user:hover { border-color:var(--line); background:var(--bg2); }
.topbar .user-caret { font-size:11px; color:var(--mut); margin-left:2px; }
@media (max-width:720px) { .topbar .user-name, .topbar .user-caret { display:none; } }

/* Прозрачная подложка ловит клик мимо меню */
.user-backdrop { position:fixed; inset:0; z-index:60; }
.user-menu { position:absolute; right:0; top:calc(100% + 8px); z-index:61; min-width:250px;
  background:var(--panel); border:1px solid var(--line); border-radius:14px;
  box-shadow:var(--shadow); padding:6px; display:flex; flex-direction:column; gap:2px; }
.user-menu-head { display:flex; align-items:center; gap:10px; padding:10px 10px 12px;
  border-bottom:1px solid var(--line); margin-bottom:4px; }
.user-menu-head b { display:block; font-size:13.5px; color:var(--ink); }
.user-menu-head span span { font-size:11.5px; color:var(--mut); }
.user-menu-item { display:flex; align-items:center; gap:10px; width:100%; padding:9px 10px;
  border:none; background:none; border-radius:10px; font:inherit; font-size:13.5px;
  color:var(--ink); cursor:pointer; text-align:left; }
.user-menu-item:hover { background:var(--bg2); }
.user-menu-item svg { width:17px; height:17px; flex:none; opacity:.75; }
.user-menu-item .ico { width:17px; text-align:center; flex:none; opacity:.8; }
.user-menu-item.danger { color:#DC2626; }
.user-menu-item.danger:hover { background:rgba(220,38,38,.08); }
.user-menu-sep { height:1px; background:var(--line); margin:4px 2px; }
/* Аватар пользователя. Раньше кружок был описан только для шапки, и те же
   инициалы в меню и в окне профиля рисовались квадратом без фона. */
.avatar-g { border-radius:99px; background:linear-gradient(135deg,var(--acc),var(--acc2));
  color:#fff; font-weight:700; display:flex; align-items:center; justify-content:center; flex:none; }
/* Фото профиля. object-fit:cover обязателен: сервер обрезает картинку в квадрат,
   но при любом рассогласовании размеров лицо не должно растянуться. */
.avatar-photo { border-radius:99px; object-fit:cover; flex:none; display:block;
  background:var(--bg2); border:1px solid var(--line); }
.topbar .user .avatar-g, .topbar .user .avatar-photo { width:36px; height:36px; font-size:12.5px; }
.topbar .user b { display:block; font-size:13px; color:var(--ink); }
.topbar .user span { font-size:11px; color:var(--mut); }
.bell { position:relative; }
.bell::after { content:''; position:absolute; top:7px; right:8px; width:7px; height:7px; border-radius:99px; background:#DC2626; }

.content { padding:24px; display:flex; flex-direction:column; gap:18px; min-width:0; }

/* ---------- Компоненты ---------- */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; border:none; cursor:pointer;
  font-size:14px; font-weight:600; border-radius:11px; padding:10px 18px; transition:.15s; }
.btn-primary { background:var(--acc); color:#fff; }
.btn-primary:hover { background:var(--acc2); }
.btn-outline { background:transparent; border:1px solid var(--line); color:var(--ink); }
.btn-outline:hover { border-color:var(--acc); color:var(--acc); }
.btn:disabled { background:var(--line); color:var(--mut); cursor:not-allowed; }
.icon-btn { width:36px; height:36px; border-radius:10px; border:1px solid var(--line); background:transparent;
  color:var(--ink); cursor:pointer; font-size:15px; display:inline-flex; align-items:center; justify-content:center; }

.panel { background:var(--panel); border:1px solid var(--line); border-radius:18px; padding:20px; }
.kpi-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:14px; }
.kpi b { display:block; font-size:26px; font-weight:700; color:var(--deep); letter-spacing:-.02em; margin:4px 0; }
.kpi .label { font-size:12.5px; color:var(--mut); }
.kpi .delta { font-size:12px; font-weight:600; }
.up { color:#16A34A; } .down { color:#DC2626; } .neutral { color:var(--mut); }

.pill { display:inline-block; font-size:11.5px; font-weight:600; padding:4px 10px; border-radius:99px; white-space:nowrap; }
.st-confirmed { background:#DCFCE7; color:#16A34A; }
.st-paid { background:var(--soft); color:var(--acc); }
.st-waiting { background:#FEF3C7; color:#B45309; }
.st-new { background:#DBEAFE; color:#2563EB; }
.st-risk { background:#FEE2E2; color:#DC2626; }

.avatar { width:34px; height:34px; border-radius:99px; background:var(--soft); color:var(--acc); font-weight:700; font-size:12.5px;
  display:inline-flex; align-items:center; justify-content:center; flex:none; }

/* Таблица */
.table { border:1px solid var(--line); border-radius:16px; overflow:hidden; }
.table .thead, .table .trow { display:grid; padding:13px 20px; align-items:center; gap:12px; }
.table .thead { background:var(--bg2); font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--mut); }
.table .trow { border-top:1px solid var(--line); font-size:13.5px; cursor:pointer;
                background:var(--panel); }   /* строки на белом, даже когда таблица лежит прямо на фоне страницы */
.table .trow:hover { background:var(--bg2); }
.table-wrap { overflow-x:auto; }

/* Сегмент-табы */
.seg { display:inline-flex; flex-wrap:wrap; background:var(--bg2); padding:4px; border-radius:10px; gap:2px; }
.seg button { padding:7px 14px; border-radius:8px; font-size:13px; font-weight:600; border:none; cursor:pointer;
  background:transparent; color:var(--mut); }
.seg button.active { background:var(--panel); color:var(--acc); box-shadow:0 1px 4px rgba(0,0,0,.06); }

/* ИИ-блок */
.ai-frame { border-radius:18px; padding:1.5px; background:linear-gradient(135deg,var(--acc),var(--acc2)); }
.ai-inner { background:var(--panel); border-radius:16.5px; padding:20px; display:flex; flex-direction:column; gap:16px; }
.ai-avatar { width:38px; height:38px; border-radius:11px; background:linear-gradient(135deg,var(--acc),var(--acc2));
  color:#fff; font-size:12px; font-weight:800; display:flex; align-items:center; justify-content:center; }

/* Календарь */
.cal-grid { display:grid; grid-template-columns:56px repeat(3,1fr); border-top:1px solid var(--line); }
.cal-grid > div { border-bottom:1px solid var(--line); padding:8px; min-height:56px; }
.cal-time { font-size:11px; color:var(--mut); padding-top:12px !important; }
.cal-evt { border-radius:8px; padding:7px 10px; cursor:pointer; }
.cal-evt b { display:block; font-size:12px; color:var(--ink); }
.cal-evt span { font-size:10.5px; color:var(--mut); }
.cal-head { display:flex; align-items:center; gap:8px; font-size:13px; font-weight:700; color:var(--ink); padding:12px 8px !important; }
.cal-head .avatar { width:26px; height:26px; font-size:10px; }

/* Перенос записей мышью: ячейка часа делится на две получасовые зоны сброса */
.cal-cell { display:flex; flex-direction:column; padding:0 !important; }
.drop-zone { flex:1; min-height:28px; padding:3px 6px; display:flex; flex-direction:column; gap:3px;
             border-radius:6px; transition:background .1s, box-shadow .1s; }
.drop-zone.over { background:var(--soft); box-shadow:inset 0 0 0 2px var(--acc); }
.cal-evt.draggable { cursor:grab; }
.cal-evt.draggable:active { cursor:grabbing; }
.cal-evt.dragging { opacity:.45; }
/* Плашка результата переноса */
.dnd-toast { position:fixed; left:50%; bottom:26px; transform:translateX(-50%); z-index:80;
             padding:11px 18px; border-radius:12px; font-size:13.5px; font-weight:600; color:#fff;
             box-shadow:0 10px 30px rgba(20,10,40,.28); }
.dnd-toast.ok { background:#16A34A; }
.dnd-toast.err { background:#DC2626; }
/* Индикатор живого обновления календаря */
.live-dot { display:inline-flex; align-items:center; gap:6px; font-size:11.5px; color:var(--mut); }
.live-dot i { width:7px; height:7px; border-radius:99px; background:#16A34A; display:block;
              animation:livePulse 2s ease-in-out infinite; }
.live-dot.off i { background:var(--mut); animation:none; }
@keyframes livePulse { 0%,100% { opacity:1 } 50% { opacity:.25 } }

/* Заглушка раздела */
.stub { display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:16px; padding:80px 24px; }
.stub .big { width:72px; height:72px; border-radius:20px; background:var(--soft); color:var(--acc); font-size:30px;
  display:flex; align-items:center; justify-content:center; }

/* Служебный баннер ошибок Blazor: скрыт, показывается фреймворком при сбое */
#blazor-error-ui { display:none; position:fixed; bottom:0; left:0; right:0; z-index:100;
  background:#FEF3C7; color:#B45309; padding:12px 20px; font-size:13.5px; }
#blazor-error-ui .dismiss { cursor:pointer; float:right; }

.burger-btn { display:none; }
@media (max-width:1080px) {
  .burger-btn { display:inline-flex; }
  .shell, .shell.collapsed { grid-template-columns:1fr; }
  .sidebar { position:fixed; z-index:40; width:246px; transform:translateX(-110%); transition:.25s; }
  .shell.nav-open .sidebar { transform:translateX(0); }
  .search-box { display:none; }
}

/* ---------- Выпадающий список с поиском (SearchPicker) ---------- */
.sp-add { width:42px; padding:0; font-size:18px; font-weight:600; flex:none; }
.sp-list { position:absolute; z-index:70; top:calc(100% + 4px); left:0; right:0; max-height:240px; overflow-y:auto;
  background:var(--panel); border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow); padding:4px; }
.sp-item { padding:9px 12px; border-radius:9px; cursor:pointer; }
.sp-item:hover { background:var(--bg2); }
.sp-item.selected { background:var(--soft); }
.sp-item b { display:block; font-size:13.5px; color:var(--ink); font-weight:600; }
.sp-item span { font-size:12px; color:var(--mut); }
.sp-empty { padding:12px; font-size:13px; color:var(--mut); text-align:center; }
.quick-add { display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:8px; margin-top:8px;
  padding:12px; background:var(--bg2); border-radius:12px; }

/* ---------- Всплывающий календарь ---------- */
.dp-anchor { position:relative; }
.dp-backdrop { position:fixed; inset:0; z-index:55; }
.dp { position:absolute; z-index:56; top:calc(100% + 8px); left:0; width:300px; padding:14px;
  background:var(--panel); border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow); }
.dp-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.dp-head b { font-size:14.5px; color:var(--deep); }
.dp-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; }
.dp-dow { text-align:center; font-size:11px; font-weight:700; color:var(--mut); padding-bottom:4px; }
.dp-day { height:34px; border:none; border-radius:9px; background:transparent; cursor:pointer;
  font-size:13px; font-weight:600; color:var(--ink); font-family:inherit; }
.dp-day:hover { background:var(--bg2); }
.dp-day.muted { color:var(--faint); font-weight:500; }
.dp-day.today { color:var(--acc); }
.dp-day.selected { background:linear-gradient(135deg,var(--acc),var(--acc2)); color:#fff; }
.dp-today { width:100%; margin-top:10px; padding:9px; border:1px solid var(--line); border-radius:10px;
  background:transparent; color:var(--acc); font-size:13px; font-weight:600; cursor:pointer; font-family:inherit; }
.dp-today:hover { border-color:var(--acc); }

/* Кнопка-дата в шапке календаря */
.date-btn { background:transparent; border:none; cursor:pointer; font-family:inherit; font-size:15.5px;
  font-weight:700; color:var(--deep); padding:6px 10px; border-radius:10px; display:flex; align-items:center; gap:8px; }
.date-btn:hover { background:var(--bg2); }
.date-btn .caret { font-size:11px; color:var(--mut); }

/* Список записей дня */
.day-row { display:grid; grid-template-columns:62px 6px 1fr auto; gap:12px; align-items:center;
  padding:12px 20px; border-top:1px solid var(--line); cursor:pointer; }
.day-row:hover { background:var(--bg2); }
.day-row .bar { width:6px; height:34px; border-radius:3px; }
.day-row .time { font-size:13.5px; font-weight:700; color:var(--deep); font-variant-numeric:tabular-nums; }
.day-row b { display:block; font-size:14px; color:var(--ink); }
.day-row span.sub { font-size:12.5px; color:var(--mut); }
.master-head { cursor:pointer; border-radius:10px; }
.master-head:hover { background:var(--bg2); }

/* Шапка колонок мастеров */
.cal-scroll { overflow-x:auto; max-width:100%; }
.cal-corner { display:flex; align-items:flex-end; padding:12px 8px 10px; font-size:10.5px; color:var(--mut); }
.count-badge { width:24px; height:24px; flex:none; border-radius:99px; display:inline-flex; align-items:center;
  justify-content:center; font-size:11px; font-weight:700;
  background:var(--soft); color:var(--acc); }
.count-badge.empty { background:var(--bg2); color:var(--faint); }
.link-btn { background:none; border:none; padding:0; cursor:pointer; font-family:inherit;
  font-size:12.5px; font-weight:600; color:var(--acc); text-decoration:underline; text-underline-offset:2px; }
.link-btn:hover { color:var(--acc2); }

/* Всплывающее окно (карточка клиента и т.п.) */
.modal-back { position:fixed; inset:0; z-index:60; background:rgba(20,10,40,.55); backdrop-filter:blur(6px);
  display:flex; align-items:center; justify-content:center; padding:20px; overflow:auto; }
.modal-card { width:100%; max-width:640px; border-radius:22px; display:flex; flex-direction:column; gap:14px;
  max-height:calc(100vh - 40px); overflow:auto; }

/* Выпадающее меню формата выгрузки */
.price-menu { position:absolute; top:calc(100% + 8px); left:0; z-index:50; min-width:230px;
  background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:6px;
  box-shadow:0 18px 40px rgba(36,16,68,.18); display:flex; flex-direction:column; }
.price-menu button { display:flex; flex-direction:column; gap:2px; text-align:left; padding:9px 12px;
  background:none; border:none; border-radius:10px; cursor:pointer; font-family:inherit; color:var(--ink); }
.price-menu button:hover { background:var(--navhover-bg); }
.price-menu button b { font-size:13.5px; }
.price-menu button span { font-size:11.5px; color:var(--mut); }

/* Поля форм: используются календарём, услугами и формой новой записи */
.m-field label { font-size:12.5px; font-weight:600; display:block; margin-bottom:5px; }
.m-input { width:100%; padding:11px 13px; border:1px solid var(--line); border-radius:11px; background:var(--panel);
  color:var(--ink); font-size:13.5px; outline:none; }
.m-input:focus { border-color:var(--acc); }

/* Лента комментариев к записи */
.comment-feed { display:flex; flex-direction:column; gap:10px; max-height:260px; overflow-y:auto; }
.comment { background:var(--bg2); border-radius:12px; padding:10px 12px; display:flex; flex-direction:column; gap:4px; }
.comment-head { display:flex; justify-content:space-between; gap:10px; font-size:12px; }
.comment-head b { color:var(--deep); }
.comment-head span { color:var(--mut); }
.comment-text { font-size:13.5px; line-height:1.45; white-space:pre-wrap; }

/* Записи клиента в поиске по календарю */
.client-appt { display:flex; justify-content:space-between; align-items:center; gap:12px; width:100%;
  padding:10px 12px; background:var(--bg2); border:1px solid transparent; border-radius:12px;
  cursor:pointer; font-family:inherit; color:var(--ink); }
.client-appt:hover { border-color:var(--acc); }

/* Пункты меню-заглушки: бейдж «скоро» вместо счётчика */
.nav-item .badge.badge-soon { background:transparent; color:var(--mut); border:1px solid var(--line);
  font-size:9.5px; text-transform:uppercase; letter-spacing:.04em; }
.nav-item.active .badge.badge-soon { border-color:rgba(255,255,255,.4); color:rgba(255,255,255,.85); }

/* Колокольчик уведомлений: индикатор непрочитанного */
.notify-btn { position:relative; }
.notify-btn svg { width:18px; height:18px; }
.notify-btn.has-dot::after { content:""; position:absolute; top:6px; right:6px; width:8px; height:8px;
  border-radius:99px; background:#DC2626; border:2px solid var(--card); }

/* Вкладки настроек: панель чужой вкладки скрывается, но остаётся в разметке —
   введённое в полях не теряется при переключении */
.tab-off { display: none !important; }

/* Значок «?» рядом с настройкой: пояснение показывает браузер через title —
   всплывающую подсказку не изобретаем, она должна работать и с клавиатуры */
.hint-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; flex: none;
  border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg2); color: var(--mut);
  font-size: 11px; font-weight: 700; line-height: 1; cursor: help;
}
.hint-dot:hover, .hint-dot:focus { border-color: var(--acc); color: var(--acc); outline: none; }

/* ---------- ИИ-помощник ---------- */
.ai-toolbar { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.ai-range { font-size:12.5px; color:var(--mut); font-variant-numeric:tabular-nums; }
.ai-status { margin-left:auto; display:inline-flex; align-items:center; gap:7px; font-size:12.5px; color:var(--mut); }
.ai-status i { width:8px; height:8px; border-radius:99px; background:var(--faint); }
.ai-status.on i { background:#16A34A; box-shadow:0 0 0 3px rgba(22,163,74,.15); }
.ai-status.off i { background:#F59E0B; }
.ai-warning { background:#FEF3C7; color:#92400E; border-radius:12px; padding:10px 14px; font-size:13px; line-height:1.45; }
body.dark .ai-warning { background:rgba(245,158,11,.14); color:#FCD34D; }

.ai-layout { display:grid; grid-template-columns:minmax(0,1fr) 380px; gap:18px; align-items:start; }
.ai-main, .ai-side { display:flex; flex-direction:column; gap:18px; min-width:0; }
.ai-side { position:sticky; top:82px; }
.ai-two { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:18px; }
/* Уже 1700 px таблице мастеров не хватает места рядом с чатом: одна колонка,
   сигналы — сразу под показателями, чат — под разбором */
@media (max-width:1699px) {
  .ai-layout { display:flex; flex-direction:column; align-items:stretch; }
  .ai-main, .ai-side { display:contents; }
  .ai-signals { order:1; }
  .ai-report-card { order:2; }
  .ai-chat-card { order:3; }
  .ai-table-panel { order:4; }
  .ai-two { order:5; }
  .ai-signals .ai-sig-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); column-gap:24px; }
}

.ai-head { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.ai-head-text { flex:1; min-width:180px; display:flex; flex-direction:column; gap:2px; }
.ai-title { font-size:15px; color:var(--deep); }
.ai-sub { font-size:12px; color:var(--mut); }
.ai-h { display:block; font-size:15px; color:var(--deep); margin-bottom:14px; }
.ai-muted { display:block; font-size:13px; color:var(--mut); }
.ai-panel-head { display:flex; justify-content:space-between; align-items:baseline; gap:12px; flex-wrap:wrap; padding:18px 20px 12px; }
.ai-panel-head b { font-size:15px; color:var(--deep); }
.ai-panel-head span { font-size:12px; color:var(--mut); }

.ai-lock { display:flex; flex-direction:column; gap:8px; background:var(--soft); border-radius:14px; padding:14px 16px; font-size:13px; line-height:1.5; }
.ai-lock b { color:var(--deep); }
.ai-thinking { display:flex; align-items:center; gap:12px; background:var(--bg2); border-radius:14px; padding:14px 16px; font-size:13px; color:var(--mut); line-height:1.5; }
.ai-error { background:#FEE2E2; color:#B91C1C; border-radius:12px; padding:10px 14px; font-size:13px; }
body.dark .ai-error { background:rgba(220,38,38,.16); color:#FCA5A5; }
.ai-check { background:#FEF3C7; color:#92400E; border-radius:12px; padding:10px 14px; font-size:13px; line-height:1.45; }
body.dark .ai-check { background:rgba(245,158,11,.14); color:#FCD34D; }
.ai-empty { background:var(--bg2); border-radius:14px; padding:16px 18px; font-size:13.5px; line-height:1.6; color:var(--ink); }

.ai-dots { display:inline-flex; gap:4px; flex:none; }
.ai-dots i { width:7px; height:7px; border-radius:99px; background:var(--acc); animation:ai-dot 1.2s infinite ease-in-out; }
.ai-dots i:nth-child(2) { animation-delay:.15s; }
.ai-dots i:nth-child(3) { animation-delay:.3s; }
@keyframes ai-dot { 0%, 80%, 100% { opacity:.25; transform:translateY(0); } 40% { opacity:1; transform:translateY(-3px); } }
@media (prefers-reduced-motion:reduce) { .ai-dots i { animation:none; opacity:.7; } }

.ai-report { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:12px; }
.ai-section { background:var(--bg2); border-radius:14px; padding:14px 16px; min-width:0; }
.ai-section h3 { margin:0 0 8px; font-size:13px; text-transform:uppercase; letter-spacing:.04em; color:var(--acc); }
.ai-section ul { margin:0; padding-left:18px; display:flex; flex-direction:column; gap:7px; }
.ai-section li, .ai-section p { font-size:13.5px; line-height:1.55; color:var(--ink); overflow-wrap:anywhere; }
.ai-section p { margin:0 0 6px; }
.ai-section li b { color:var(--deep); }
.ai-sec-main { grid-column:1 / -1; background:var(--soft); }
.ai-sec-todo { grid-column:1 / -1; border:1px solid var(--acc); background:var(--panel); }
.ai-sec-todo li::marker { color:var(--acc); }
.ai-meta { display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; font-size:12px; color:var(--mut); }
.ai-foot { display:flex; gap:14px; align-items:center; flex-wrap:wrap; border-top:1px solid var(--line); padding-top:14px; }
.ai-history { width:auto; max-width:100%; flex:0 1 380px; padding:8px 12px; font-size:13px; }
.ai-auto { display:flex; gap:9px; align-items:flex-start; flex:1 1 280px; font-size:12.5px; line-height:1.45; color:var(--mut); cursor:pointer; }
.ai-auto input { margin-top:2px; }

.ai-table-panel { padding:0; overflow:hidden; }
.ai-mtable { min-width:900px; }
.ai-mrow { display:grid; grid-template-columns:minmax(180px,1.6fr) 140px 140px 90px 100px 100px 58px 84px 70px; gap:10px;
  align-items:center; padding:11px 20px; border-top:1px solid var(--line); font-size:13px; }
.ai-mhead { background:var(--bg2); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--mut); }
.ai-mrow em { font-style:normal; font-size:11.5px; font-weight:600; white-space:nowrap; }
.ai-mname { display:flex; flex-direction:column; gap:2px; min-width:0; }
.ai-mname b { color:var(--deep); }
.ai-mname span { font-size:12px; color:var(--mut); display:flex; flex-wrap:wrap; gap:4px; align-items:center; }
.ai-mname .pill { font-style:normal; font-size:10px; padding:2px 7px; }
.ai-load { display:flex; flex-direction:column; gap:5px; }
.ai-bar { display:block; height:6px; border-radius:99px; background:var(--bg2); overflow:hidden; }
.ai-bar i { display:block; height:100%; border-radius:99px; background:linear-gradient(90deg,var(--acc),var(--acc2)); }
.ai-bar i.quiet { background:linear-gradient(90deg,#F59E0B,#FBBF24); }
.ai-bar i.peak { background:linear-gradient(90deg,#16A34A,#22C55E); }

.ai-heat { display:grid; grid-template-columns:34px repeat(3,minmax(0,1fr)); gap:5px; }
.ai-heat-h { font-size:11px; color:var(--mut); text-align:center; padding-bottom:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ai-heat-d { font-size:12px; font-weight:600; color:var(--mut); display:flex; align-items:center; }
.ai-heat-c { border-radius:8px; padding:9px 4px; text-align:center; font-size:12px; font-weight:600; font-variant-numeric:tabular-nums; }
.ai-heat-c.empty { background:var(--bg2); color:var(--faint); }
.ai-heat-c.quiet { box-shadow:inset 0 -3px 0 #F59E0B; }
.ai-heat-c.peak { outline:2px solid #16A34A; outline-offset:-2px; }
.ai-legend { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-top:12px; font-size:11.5px; color:var(--mut); }
.ai-legend i { width:12px; height:12px; border-radius:4px; display:inline-block; margin-left:6px; }
.ai-legend i.quiet { background:var(--bg2); box-shadow:inset 0 -3px 0 #F59E0B; }
.ai-legend i.peak { outline:2px solid #16A34A; }

.ai-cats { display:flex; flex-direction:column; gap:11px; }
.ai-cat { display:flex; flex-direction:column; gap:5px; }
.ai-cat-top { display:flex; justify-content:space-between; gap:10px; font-size:13px; }
.ai-cat-top b { color:var(--deep); }
.ai-cat-top em { font-style:normal; font-size:11.5px; font-weight:600; }

.ai-signals { display:flex; flex-direction:column; gap:12px; }
.ai-sig-list { display:flex; flex-direction:column; gap:12px; }
.ai-signal { display:flex; gap:10px; padding-top:12px; border-top:1px solid var(--line); }
.ai-sig-dot { width:9px; height:9px; border-radius:99px; margin-top:5px; flex:none; background:var(--acc); }
.ai-sig-decline .ai-sig-dot, .ai-sig-cancellations .ai-sig-dot { background:#DC2626; }
.ai-sig-overload .ai-sig-dot, .ai-sig-high-check .ai-sig-dot { background:#16A34A; }
.ai-sig-retention .ai-sig-dot, .ai-sig-category .ai-sig-dot, .ai-sig-time .ai-sig-dot { background:#F59E0B; }
.ai-sig-body { display:flex; flex-direction:column; gap:3px; min-width:0; font-size:13px; line-height:1.5; }
.ai-sig-body b { font-size:12px; color:var(--mut); text-transform:uppercase; letter-spacing:.03em; }
.ai-sig-actions { display:flex; gap:14px; flex-wrap:wrap; margin-top:2px; font-size:12.5px; font-weight:600; }

.ai-chat { gap:12px; }
.ai-msgs { display:flex; flex-direction:column; gap:10px; max-height:420px; overflow-y:auto; padding-right:2px; }
.ai-hello { font-size:13px; color:var(--mut); line-height:1.5; }
.ai-msg { max-width:92%; border-radius:14px; padding:10px 13px; font-size:13.5px; line-height:1.55; display:flex; flex-direction:column; gap:4px; overflow-wrap:anywhere; }
.ai-msg.me { align-self:flex-end; background:var(--acc); color:#fff; border-bottom-right-radius:5px; }
.ai-msg.bot { align-self:flex-start; background:var(--bg2); color:var(--ink); border-bottom-left-radius:5px; }
.ai-msg.err { align-self:flex-start; background:#FEE2E2; color:#B91C1C; }
body.dark .ai-msg.err { background:rgba(220,38,38,.16); color:#FCA5A5; }
.ai-chips { display:flex; flex-wrap:wrap; gap:6px; }
.ai-chips button { border:1px solid var(--line); background:var(--panel); color:var(--ink); border-radius:99px; padding:6px 11px;
  font-size:12px; cursor:pointer; text-align:left; line-height:1.3; }
.ai-chips button:hover:not(:disabled) { border-color:var(--acc); color:var(--acc); }
.ai-chips button:disabled { opacity:.5; cursor:default; }
.ai-input { display:flex; gap:8px; align-items:center; }
.ai-input .m-input { flex:1; min-width:0; }
.ai-input .btn { width:42px; height:42px; padding:0; font-size:18px; flex:none; }
.ai-note { font-size:11.5px; color:var(--mut); line-height:1.45; }

/* Карточка ИИ на дашборде */
.ai-dash { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); gap:14px; }
@media (max-width:900px) { .ai-dash { grid-template-columns:1fr; } }
.ai-dash-block { background:var(--bg2); border-radius:14px; padding:14px 16px; display:flex; flex-direction:column; gap:8px; min-width:0; }
.ai-dash-block > b { font-size:12px; text-transform:uppercase; letter-spacing:.04em; color:var(--acc); }
.ai-dash-block ul { margin:0; padding-left:18px; display:flex; flex-direction:column; gap:6px; font-size:13.5px; line-height:1.5; }
.ai-dash-sig { display:flex; gap:9px; font-size:13px; line-height:1.45; }
