/* Админ-панель TrainSpace. Основа — макеты docs/mockups/admin/*.html.
   Цвета зала приходят переменными --lh/--lc/--la/--lb (светлая) и --dh/--dc/--dbr/--da/--db (тёмная) из AdminLayout. */

:root {
    --danger: #FA5861;          /* отмены, ошибки, «Важно» — не зависит от темы */
    --ok: #2E9E5B;
    --warn: #B57414;
    --rad: 9px;                 /* единое скругление контейнеров и кнопок, как в клиенте; пилюли (20px+) — свои */
    --rad-in: 7px;              /* поля ввода */
    font-family: Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-size: 14px; background: #F3F6FA; color: #14202E; }
button, input, select { font: inherit; color: inherit; }
/* Нет связи с сервером веба (App.razor, переподключение): бегущая полоса сверху, страница не реагирует */
html.ts-offline body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; z-index: 9999; height: 3px;
    background: linear-gradient(90deg, transparent, #00B8D4, transparent); background-size: 50% 100%; background-repeat: no-repeat;
    animation: ts-offline 1.2s linear infinite; }
html.ts-offline body { cursor: progress; }
@keyframes ts-offline { from { background-position: -50% 0; } to { background-position: 150% 0; } }
button { cursor: pointer; background: none; border: 0; }
fieldset { border: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }

/* ── Тема ── */
.adm, .auth-page {
    --primary: var(--lh, #1E4E8C); --secondary: var(--lc, #1A7FB0); --accent: var(--la, #00B8D4); --bg: var(--lb, #F3F6FA);
    --card: #FFFFFF; --border: #DCE3EC; --text: #14202E; --muted: #5A6B7D;
    --side: color-mix(in srgb, var(--primary) 80%, #000); --sidetext: #C9D8EA;
    background: var(--bg); color: var(--text);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .adm, :root:not([data-theme="light"]) .auth-page {
        --primary: var(--dh, #17406F); --secondary: var(--dc, #2A6F95); --accent: var(--da, #00B8D4); --bg: var(--db, #0E0E0E);
        --card: #161B22; --border: var(--dbr, #2A3540); --text: #EDEDED; --muted: #9AA7B5;
        --side: #0B1520; --sidetext: #9FB0C2;
    }
    :root:not([data-theme="light"]) body { background: #0E0E0E; color: #EDEDED; }
}
:root[data-theme="dark"] .adm, :root[data-theme="dark"] .auth-page {
    --primary: var(--dh, #17406F); --secondary: var(--dc, #2A6F95); --accent: var(--da, #00B8D4); --bg: var(--db, #0E0E0E);
    --card: #161B22; --border: var(--dbr, #2A3540); --text: #EDEDED; --muted: #9AA7B5;
    --side: #0B1520; --sidetext: #9FB0C2;
}
:root[data-theme="dark"] body { background: #0E0E0E; color: #EDEDED; }
/* В тёмной теме основной цвет тёмный — иконки ✎ в строках светлее, чтобы читались */
:root[data-theme="dark"] .ib:not(.del) { color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ib:not(.del) { color: var(--accent); } }

/* ── Каркас ── */
.adm { display: flex; height: 100vh; overflow: hidden; }
.adm.boot { align-items: center; justify-content: center; padding: 16px; }
aside { width: 232px; background: var(--side); color: var(--sidetext); padding: 16px 12px; flex-shrink: 0; overflow-y: auto;
        padding-left: max(12px, env(safe-area-inset-left)); }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; font-weight: 700; font-size: 15px; line-height: 1.25; text-decoration: none; }
.logo span { width: 34px; height: 34px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: #1B2430; font-weight: 800; flex-shrink: 0; font-size: 13px; }
/* Футер: копирайт внизу страницы (в админке — после содержимого) */
.adm-foot { margin-top: auto; padding-top: 16px; text-align: center; font-size: 12px; color: var(--muted); }
.adm-foot a { color: inherit; }
.adm-foot .ver, .cl-foot .ver { display: block; margin-top: 4px; font-size: 11px; opacity: .6; }   /* версия веба — строкой под футером */
.logo b { min-width: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }   /* название — до двух строк */
a.logo:hover b { text-decoration: underline; }
.logo span.img { background: none; overflow: hidden; }   /* логотип зала вместо букв (боковое меню тёмное — сначала логотип для тёмного фона) */
.logo span.img img { width: 100%; height: 100%; object-fit: contain; }
.grp { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .6; margin: 14px 8px 6px; }
nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: inherit; text-decoration: none; margin-bottom: 2px; }
nav a:hover { background: rgba(255,255,255,.06); }
nav a.on { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.i { width: 18px; text-align: center; opacity: .85; }
main { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow: hidden; }
header { min-height: 60px; background: var(--primary); color: #fff; border-bottom: 2px solid var(--accent); display: flex; align-items: center;
         gap: 10px; padding: env(safe-area-inset-top) max(24px, env(safe-area-inset-right)) 0 24px; flex-shrink: 0; }
.sp { flex: 1; }
.sel { border: 1px solid rgba(255,255,255,.25); border-radius: 8px; padding: 7px 10px; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; max-width: 220px; }
.sel option { color: #14202E; }
.ic { width: 36px; height: 36px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; position: relative; flex-shrink: 0; }
.burger { display: none; }
.me { position: relative; }
.av { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.2); color: #fff; display: grid; place-items: center; font-weight: 600; }
button.av { box-shadow: 0 0 0 1px var(--accent); }   /* аватар в шапке — внешняя рамка 1 px цвета акцента, как в клиентской шапке */
/* Фото человека поверх круга с буквами (PersonPhoto): нет фото — картинка убирается, видны буквы */
:has(> .ph-img) { position: relative; overflow: hidden; }
.cl-name { display: inline-flex; align-items: center; gap: 8px; }   /* «Клиенты»: аватар + имя */
.cp-photo:has(> .ph-img) { cursor: zoom-in; }
.cp-photo { width: 72px; height: 72px; font-size: 24px; margin-bottom: 8px; background: color-mix(in srgb, var(--primary) 40%, transparent); color: var(--text); }
.ph-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.menu { position: absolute; right: 0; top: 44px; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--rad);
        min-width: 220px; box-shadow: 0 10px 30px rgba(0,0,0,.18); z-index: 60; overflow: hidden; }
.menu-shade { position: fixed; inset: 0; z-index: 59; }   /* прозрачная подложка под меню: клик мимо — закрыть */
.menu .who { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.menu .who small { display: block; color: var(--muted); font-size: 12px; }
.menu .mi { width: 100%; text-align: left; padding: 10px 14px; }
.menu .mi:hover { background: var(--bg); }
.content { flex: 1; overflow: auto; padding: 24px; padding-inline: max(24px, calc((100% - 1600px) / 2));   /* страница не шире 1600px на широких мониторах */
    padding-bottom: max(24px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 20px; }
.scrim { display: none; }

/* ── Общие элементы ── */
h1 { font-size: 22px; }
.sub { color: var(--muted); margin-top: 4px; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.btn { background: var(--primary); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; font-weight: 600; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.danger { background: var(--danger); }
.btn2 { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.wide { width: 100%; }
.alert { background: rgba(250,88,97,.12); color: var(--danger); border: 1px solid rgba(250,88,97,.4); border-radius: var(--rad); padding: 10px 12px; display: flex; gap: 8px; align-items: center; }
.alert .x { margin-left: auto; color: inherit; }
.empty { background: var(--card); border: 1px dashed var(--border); border-radius: var(--rad); padding: 32px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; color: var(--muted); }
.skeleton { height: 220px; border-radius: var(--rad); background: linear-gradient(90deg, var(--card), var(--border), var(--card)); background-size: 200% 100%; animation: sk-in .3s ease .4s both, sk 1.4s infinite; }   /* быстрая загрузка — заглушки не видно, долгая — проявляется */
@keyframes sk { to { background-position: -200% 0; } }
@keyframes sk-in { from { opacity: 0; } to { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation-duration: .3s, 4s; } }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.acts { display: inline-flex; gap: 6px; flex-shrink: 0; white-space: nowrap; margin-left: auto; }
.ib { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); display: grid; place-items: center; font-size: 14px; color: var(--primary); background: var(--card); flex-shrink: 0; }
.ib.del { color: var(--danger); }
.in { border: 1px solid var(--border); border-radius: var(--rad-in); padding: 8px 10px; background: var(--bg); color: var(--text); width: 100%; min-width: 0; }
.in.bad { border-color: var(--danger); }
select.in { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 24px;
    background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23889'/%3E%3C/svg%3E") no-repeat right 10px center; }
select.in:disabled, .in:disabled { opacity: .5; cursor: default; }
.fld { display: flex; flex-direction: column; gap: 4px; }
.fld > span { font-size: 12px; color: var(--muted); }
.fld small, .hint { font-size: 12px; color: var(--muted); }
.sw { width: 36px; height: 20px; border-radius: 20px; background: var(--ok); position: relative; flex-shrink: 0; }
.sw::after { content: ""; position: absolute; right: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; }
.sw.no { background: var(--border); }
.sw.no::after { right: auto; left: 2px; }
.act { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }

/* ── Зал и филиалы ── */
.club { background: var(--card); border: 1px solid var(--border); border-radius: var(--rad); padding: 16px; }
.gh { display: flex; gap: 14px; align-items: center; }
.gh .lg2 { width: 52px; height: 52px; border-radius: var(--rad); background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; flex-shrink: 0; }
.gh h2 { font-size: 18px; }
.gh small, .bh small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.nm { min-width: 0; }
.brl { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.bc { background: var(--card); border: 1px solid var(--border); border-radius: var(--rad); overflow: hidden; display: flex; flex-direction: column; }
.bc.inactive { opacity: .6; }
.bc.inactive .bt { background: var(--border) !important; }
.bt { height: 6px; }
.bb { padding: 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.bh { display: flex; gap: 12px; align-items: flex-start; }
.bh h3 { font-size: 16px; }
.lg { width: 44px; height: 44px; border-radius: var(--rad); display: grid; place-items: center; color: #fff; font-weight: 800; flex-shrink: 0; }
.status { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.now { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; }
.now.o { background: rgba(46,158,106,.14); color: var(--ok); }
.now.c { background: var(--bg); color: var(--muted); }
.hrs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; font-size: 11px; text-align: center; }
.hrs div { background: var(--bg); border-radius: 6px; padding: 6px 2px; }
.hrs b { display: block; font-size: 12px; margin-bottom: 2px; }
.hrs .off { color: var(--muted); }
.hrs .td { box-shadow: inset 0 0 0 2px var(--primary); }
.exc { font-size: 12px; color: var(--warn); background: rgba(227,155,0,.12); border-radius: 8px; padding: 7px 10px; }
.more { font-size: 12px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; font-size: 13px; }
.kv span:nth-child(odd) { color: var(--muted); }
.bf { border-top: 1px solid var(--border); padding: 10px 16px; display: flex; gap: 8px; font-size: 13px; color: var(--muted); }

/* ── Шторка справа ── */
.drawer-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 39; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 520px; max-width: 100%; background: var(--card); color: var(--text); border-left: 1px solid var(--border);
          z-index: 40; display: flex; flex-direction: column; box-shadow: -12px 0 30px rgba(0,0,0,.12); border-top: 3px solid var(--accent);
          padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); animation: slide .22s ease-out; }
@keyframes slide { from { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .drawer { animation-duration: .5s; } }
.dh { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.dh h3 { font-size: 16px; }
.x { margin-left: auto; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px; display: grid; place-items: center; }
.tabs { display: flex; flex-wrap: wrap; gap: 0 4px; padding: 0 18px; border-bottom: 1px solid var(--border); }   /* без прокрутки: не влезают — вторая строка */
.tabs button { padding: 10px; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--text); border-color: var(--primary); font-weight: 600; }
.db { flex: 1; overflow: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.mf { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
/* Полоса долгого действия (UploadProgress): над кнопками шторки или у кнопки загрузки */
.upl { margin-top: 8px; }
.drawer > .upl { margin: 0; padding: 12px 18px 0; border-top: 1px solid var(--border); }
.drawer > .upl + .mf { border-top: 0; }
.upl-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.upl-bar { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--muted) 22%, transparent); overflow: hidden; }
.upl-fill { height: 100%; width: var(--to); background: var(--accent); border-radius: 3px; animation: upl-creep 8s cubic-bezier(.2, .7, .3, 1); }
@keyframes upl-creep { from { width: var(--from); } }
.sec { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 10px; }
.hr { display: grid; grid-template-columns: 110px 44px 1fr 1fr; gap: 8px; align-items: center; font-size: 13px; }
.ex { display: grid; grid-template-columns: 1fr auto 30px; gap: 8px; align-items: center; font-size: 13px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.ex .note { grid-column: 1 / -1; }
.chk { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.stat { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--rad); font-size: 13px; margin-top: 6px; }
.stat small { display: block; color: var(--muted); font-size: 12px; }
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.th { display: flex; gap: 10px; align-items: center; border: 1px solid var(--border); border-radius: var(--rad); padding: 10px; cursor: pointer; }
.th.on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.th input { position: absolute; opacity: 0; pointer-events: none; }
.th small { display: block; color: var(--muted); font-size: 12px; }
.swatch { width: 34px; height: 34px; border-radius: 8px; position: relative; flex-shrink: 0; overflow: hidden; }
.swatch i { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; }

/* ── Окно подтверждения ── */
.smod { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.smb { background: var(--card); color: var(--text); border-radius: var(--rad); width: 460px; max-width: 100%; border-top: 3px solid var(--accent); }
.smb h3 { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; font-size: 16px; }
.sfm { padding: 16px 20px; color: var(--muted); }
.smf { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ── Вход ── */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { background: var(--card, #fff); border: 1px solid var(--border, #DCE3EC); border-radius: var(--rad); padding: 28px; width: 400px; max-width: 100%;
             display: flex; flex-direction: column; gap: 14px; border-top: 3px solid var(--accent, #00B8D4); position: relative; color: var(--text, #14202E); }
.auth-card .sub { margin-top: -8px; }
.auth-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
.auth-logo img.ts-logo { display: block; height: 44px; max-width: 220px; object-fit: contain; }
.auth-logo span { width: 40px; height: 40px; border-radius: var(--rad); background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 15px; }
.auth-langs { position: absolute; top: 14px; right: 16px; display: flex; gap: 4px; }
.auth-langs a { font-size: 12px; color: var(--muted); text-decoration: none; padding: 3px 6px; border-radius: 6px; }
.auth-langs a.on { background: var(--bg); color: var(--text); font-weight: 600; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.auth-form .in { font-size: 14px; padding: 10px 12px; }
.auth-form .btn { padding: 11px; margin-top: 4px; }

/* ── Адаптив: до 1200 px — меню-иконки, ☰ разворачивает поверх ── */
@media (max-width: 1200px) {
    aside { width: 68px; padding: 16px 10px; }
    aside .logo { justify-content: center; padding: 4px 0 18px; }
    aside .logo b, nav a .t { display: none; }
    aside .grp { height: 1px; background: rgba(255,255,255,.12); margin: 10px 6px; font-size: 0; }
    nav a { justify-content: center; padding: 10px 0; }
    nav a .i { font-size: 16px; width: auto; }
    .burger { display: grid; }
    .adm.nav aside { position: fixed; left: 0; top: 0; bottom: 0; z-index: 30; width: 250px; padding: 16px 12px; }
    .adm.nav aside .logo { justify-content: flex-start; padding: 4px 8px 18px; }
    .adm.nav aside .logo b, .adm.nav nav a .t { display: inline; }
    .adm.nav aside .grp { height: auto; background: none; font-size: 11px; margin: 14px 8px 6px; }
    .adm.nav nav a { justify-content: flex-start; padding: 8px 10px; }
    .adm.nav main { margin-left: 68px; }
    .adm.nav .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 25; }
    .adm:not(.nav) nav a:hover::after { content: attr(data-t); position: fixed; left: 74px; background: var(--text); color: var(--card); font-size: 13px;
        padding: 6px 10px; border-radius: 6px; white-space: nowrap; z-index: 30; pointer-events: none; }
}

/* ── До 760 px — меню выезжает по ☰, шторки на весь экран ── */
@media (max-width: 760px) {
    .adm { height: auto; min-height: 100vh; overflow: visible; }
    main { height: auto; overflow: visible; }
    .content { overflow: visible; padding: 16px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
    aside { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 30; transform: translateX(-100%); transition: transform .2s; padding: 16px 12px; }
    .adm.nav aside { transform: none; }
    .adm.nav main { margin-left: 0; }
    aside .logo { justify-content: flex-start; padding: 4px 8px 18px; }
    aside .logo b, nav a .t { display: inline; }
    aside .grp { height: auto; background: none; font-size: 11px; margin: 14px 8px 6px; }
    nav a { justify-content: flex-start; padding: 8px 10px; }
    header { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); gap: 8px; }
    .sel { max-width: 130px; }
    .top { flex-direction: column; align-items: stretch; }
    .brl { grid-template-columns: 1fr; }
    .drawer { width: 100%; border-left: 0; }
    .hr { grid-template-columns: 80px 40px 1fr 1fr; }
    .themes { grid-template-columns: 1fr; }
    .kv { grid-template-columns: 100px 1fr; }
}

/* ── Страницы по ссылкам из писем ── */
/* «или» + кнопка Google на входе */
.auth-forgot { align-self: flex-end; margin-top: -6px; font-size: 13px; color: var(--accent); }
.auth-or { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; color: var(--muted); font-size: 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
/* Вход Google: наша кнопка в стиле панели, поверх — прозрачная кнопка Google (iframe 40 px, по центру) */
.g-signin { position: relative; }
.g-btn { display: flex; align-items: center; justify-content: center; gap: 10px; box-sizing: border-box; height: 42px; width: 100%;
    border: 1px solid var(--border); border-radius: var(--rad); background: transparent; color: var(--text); font-weight: 600; font-size: 14px;
    opacity: .5; transition: border-color .15s, background .15s, opacity .15s; }
.g-signin.ready .g-btn { opacity: 1; }
.g-signin.ready:hover .g-btn { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.g-hit { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; opacity: .01; }.auth-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-form small { font-size: 12px; color: var(--muted); }
.auth-form small.err { color: var(--danger); }
.auth-card a.btn, .auth-card a.btn2 { text-decoration: none; text-align: center; display: block; }
@media (max-width: 420px) { .auth-form .two { grid-template-columns: 1fr; } }

/* ── Фокус заголовка после перехода (для экранных дикторов) — без рамки ── */
h1:focus, h1:focus-visible { outline: none; }

/* ── Таблицы и уведомления ── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--rad); padding: 16px; }
.card.list { padding: 0; overflow: auto; }
.rt { width: 100%; border-collapse: collapse; }
.rt th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.rt td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.rt tr:last-child td { border-bottom: 0; }
.rt code { font-size: 12px; background: var(--bg); padding: 2px 6px; border-radius: 6px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: var(--bg); border: 1px solid var(--border); margin-left: 6px; white-space: nowrap; }
.tag.warn { color: var(--warn); border-color: rgba(227,155,0,.4); background: rgba(227,155,0,.12); }
.notice { background: rgba(46,158,91,.12); color: var(--ok); border: 1px solid rgba(46,158,91,.4); border-radius: var(--rad); padding: 10px 12px; display: flex; gap: 8px; align-items: center; }
.notice .x { margin-left: auto; color: inherit; }
@media (max-width: 760px) {
    .card.list { overflow: visible; padding: 0; background: none; border: 0; }
    .rt, .rt tbody, .rt tr, .rt td { display: block; width: 100%; }
    .rt tr:first-child { display: none; }
    .rt tr { background: var(--card); border: 1px solid var(--border); border-radius: var(--rad); padding: 12px; margin-bottom: 10px; }
    .rt td { border: 0; padding: 3px 0; }
    .rt td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); font-size: 12px; }
}

/* ── Поля форм: подписи заметнее, активное поле — рамка акцента ── */
.fld > span, .auth-form label > span { font-size: 13px; font-weight: 600; color: var(--text); opacity: .9; }
.fld small, .hint, .auth-form small { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.in:focus, .in:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.sec { color: var(--accent); font-weight: 600; }

/* ── Выбор темы: выбранный вариант — рамка акцента, лёгкая заливка и галочка ── */
.th { position: relative; transition: border-color .15s, background .15s; }
.th:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.th.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.th.on::after { content: "✓"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%;
                background: var(--accent); color: #10161D; font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.th.on > span:last-child { font-weight: 600; padding-right: 26px; }

/* ── Роли и права ── */
.scope-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.scope-bar .lbl { color: var(--muted); font-size: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--card); border-radius: 20px; padding: 6px 12px; font-size: 13px; white-space: nowrap; }
.chip.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--card)); font-weight: 600; }
.matrix { overflow: auto; }
.matrix table { width: 100%; border-collapse: collapse; min-width: 640px; }
.matrix th, .matrix td { border-bottom: 1px solid var(--border); padding: 8px 10px; }
.matrix th.rc { text-align: center; vertical-align: top; min-width: 130px; font-weight: 500; }
.matrix th.rc b { display: block; font-size: 14px; }
.matrix th.rc small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.matrix th.rc small.lock { color: var(--warn); }
.matrix th.pc { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; vertical-align: bottom; }
.matrix td.pc { font-size: 13px; }
.matrix td.pc small { display: block; color: var(--muted); font-size: 11.5px; }
.matrix tr.mod td { background: var(--bg); color: var(--accent); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.matrix td.cc { text-align: center; position: relative; }
.acts.center { margin: 6px auto 0; }
.ck { width: 26px; height: 26px; border-radius: 7px; border: 1.5px solid var(--border); background: var(--card); color: #10161D;
      font-weight: 800; font-size: 14px; display: inline-grid; place-items: center; }
.ck.on { background: var(--accent); border-color: var(--accent); }
.ck.fix { opacity: .55; }
.ck:disabled { cursor: default; }
.ck:disabled:not(.on) { opacity: .35; }
.ov, .legend .ov { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
td.cc .ov { position: absolute; top: 6px; right: calc(50% - 22px); }
.legend { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.smf.col { flex-direction: column; align-items: stretch; }

/* ── Персонал ── */
.muted { color: var(--muted); }
.rt td.right { text-align: right; }
.chk.row { padding: 6px 0; font-size: 14px; }

/* ── Группы и расписание ── */
.page-tabs { padding: 0; border-bottom: 1px solid var(--border); }
.cal-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.cal-bar .nav { display: flex; gap: 6px; align-items: center; }
.cal-bar .period { margin-left: 6px; font-size: 15px; text-transform: capitalize; }
.cal-bar .filters { display: flex; gap: 8px; }
.cal-bar .filters .in { width: auto; min-width: 150px; }
.ses { --gc: var(--primary); display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left;
       background: color-mix(in srgb, var(--gc) 14%, var(--card)); border: 2px solid #8e8e8e; border-left: 5px solid var(--gc);
       border-radius: 8px; padding: 6px 8px; font-size: 12.5px; color: var(--text); }
.ses .tm { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ses b { font-size: 13px; line-height: 1.25; }
.ses small { color: var(--muted); font-size: 11.5px; }
.ses .st { color: var(--danger); font-weight: 600; }
.ses.mine { border-color: #D92B2B; border-left-color: var(--gc); }
.ses.cancel { background: repeating-linear-gradient(135deg, var(--card) 0 6px, color-mix(in srgb, var(--danger) 12%, var(--card)) 6px 12px); opacity: .8; }
.ses.cancel b { text-decoration: line-through; }
.ses.compact { flex-direction: row; gap: 5px; padding: 3px 6px; border-width: 1px; border-left-width: 4px; font-size: 11.5px; white-space: nowrap; overflow: hidden; }
.ses.compact b { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.ses:hover { filter: brightness(1.06); }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 8px; overflow-x: auto; }
.cal-week .col, .cal-day .col { background: var(--card); border: 1px solid var(--border); border-radius: var(--rad); padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 160px; }
.cal-week .col.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-week .col.past { opacity: .6; }
.cal-week .ch { display: flex; gap: 6px; align-items: baseline; padding: 2px 4px 6px; border-bottom: 1px solid var(--border); }
.cal-week .ch span { color: var(--muted); }
.cal-day { display: grid; grid-template-columns: repeat(var(--cols), minmax(220px, 1fr)); gap: 10px; overflow-x: auto; }
.cal-day .ch { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.cal-day .ch small, .cal-day .none { color: var(--muted); font-size: 12px; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-month .wd { font-size: 12px; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-month .cell { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 4px; min-height: 110px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-month .cell.out { opacity: .45; }
.cal-month .cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-month .dn { align-self: flex-start; font-size: 12px; font-weight: 600; padding: 1px 6px; border-radius: 6px; }
.cal-month .dn:hover { background: var(--bg); }
.cal-month .items { display: flex; flex-direction: column; gap: 3px; }
.cal-month .ses.compact { flex-shrink: 0; min-height: 22px; align-items: center; line-height: 1.25; }
.cal-month .ses.compact > :first-child { opacity: .75; font-variant-numeric: tabular-nums; }
.legend .lg-mine, .legend .lg-cancel { display: inline-block; width: 14px; height: 10px; border-radius: 3px; border: 2px solid #D92B2B; margin-left: 8px; }
.legend .lg-cancel { border-color: var(--border); background: repeating-linear-gradient(135deg, var(--card) 0 3px, color-mix(in srgb, var(--danger) 30%, var(--card)) 3px 6px); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.tag.mine { color: #D92B2B; border-color: rgba(217,43,43,.45); }
.block { display: block; margin-top: 2px; }
.rt td.over { color: var(--danger); font-weight: 600; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.clr { width: 30px; height: 30px; border-radius: 8px; border: 2px solid transparent; }
.clr.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--card) inset; }
.slot { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr 30px; gap: 6px; align-items: center; }
.room-row { display: grid; grid-template-columns: 1fr 30px; gap: 6px; align-items: center; }
.main-pick { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; font-size: 12px; color: var(--muted); }
.chk.row { display: flex; gap: 8px; align-items: center; }
.swc { width: 20px; height: 20px; accent-color: var(--accent); flex-shrink: 0; }
.stat { justify-content: space-between; cursor: pointer; }
.rooms { display: flex; gap: 6px; flex-wrap: wrap; }
.rooms span { font-size: 12px; border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 760px) {
    .cal-bar { flex-direction: column; align-items: stretch; }
    .cal-bar .filters { flex-direction: column; }
    .cal-week { grid-template-columns: 1fr; }
    .cal-week .col { min-height: 0; }
    .cal-day { grid-template-columns: 1fr; }
    .cal-month .cell { min-height: 70px; }
    .cal-month .ses.compact b { display: none; }
    .slot { grid-template-columns: 1fr 1fr; }
}

/* ── Отмены, переносы, рассылка ── */
.ses.closed { border-color: var(--warn); border-style: dashed; }
.btn2.small { padding: 4px 10px; font-size: 12px; }
.danger-text { color: var(--danger); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.alert.warn { color: var(--warn); background: rgba(227,155,0,.12); border-color: rgba(227,155,0,.4); }
.alert.warn .btn2 { margin-left: auto; }
.dispatch { display: flex; flex-direction: column; gap: 10px; }
textarea.in { resize: vertical; font: inherit; line-height: 1.4; }
.skeleton.small { height: 60px; }

/* «Не разослано» — заметная метка поверх штриховки, без зачёркивания */
.ses .nd { display: inline-block; margin-top: 3px; font-size: 11px; font-weight: 700; color: #1B1300; background: #F2B33D;
           border-radius: 6px; padding: 1px 6px; text-decoration: none; }
.ses.compact .nd { margin-top: 0; padding: 0 4px; }

/* ── Виды спорта ── */
.discipline-list { display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.discipline-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.discipline { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--rad); padding: 10px 12px; text-align: left; }
.discipline.on { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.discipline.add:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.discipline .nm { flex: 1; min-width: 0; }
.discipline .nm small { display: block; color: var(--muted); font-size: 12px; }
.discipline .ord { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #10161D; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.discipline .plus { width: 26px; height: 26px; border-radius: 50%; border: 1.5px dashed var(--muted); color: var(--muted); display: grid; place-items: center; flex-shrink: 0; }
.ib:disabled { opacity: .35; cursor: default; }
.card.soon { border-style: dashed; color: var(--muted); display: flex; flex-direction: column; gap: 4px; max-width: 720px; }
.card.soon b { color: var(--text); }

/* ── Ранги ── */
.belt { display: block; flex-shrink: 0; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.belt-preview { display: grid; place-items: center; padding: 14px; background: var(--bg); border-radius: var(--rad); }
.level-name { display: flex; gap: 10px; align-items: center; }
.levels td.ord { white-space: nowrap; width: 72px; }
.levels td.ord .ib { display: inline-grid; width: 26px; height: 26px; }
.hidden-level td { opacity: .55; }
.card.transition { display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.fld.inline { flex-direction: row; align-items: center; gap: 8px; }
.fld.inline .in { width: 80px; }
.chips .sp { flex: 1; }
.clr-custom { width: 30px; height: 30px; border: 1px dashed var(--border); border-radius: 8px; padding: 0; background: none; cursor: pointer; }

/* Блоки страницы не сжимаются по высоте: карточки с overflow:auto во flex-колонке иначе схлопываются до нуля,
   когда страница длиннее экрана (прокручивается вся область .content) */
.content > * { flex-shrink: 0; }

/* ── Регистрация атлета ── */
.auth-card.wide { width: 520px; }
.auth-card.doc-card { width: 780px; }   /* /terms, /privacy */
.doc-body { line-height: 1.55; font-size: 14px; }
.doc-body h2 { font-size: 17px; margin: 22px 0 8px; }
.doc-body ul { padding-left: 20px; margin: 6px 0; }
.doc-body li { margin: 4px 0; }
.doc-body a, .doc-links a { color: var(--accent); }
.doc-links { margin-top: 24px; font-size: 13px; color: var(--muted); }
.auth-card .center { text-align: center; }
.auth-card .small, .sub.small { font-size: 13px; }
.steps { display: flex; gap: 6px; }
.steps span { flex: 1; text-align: center; font-size: 12px; padding: 6px 4px; border-radius: 8px; background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.steps span.on { border-color: var(--accent); color: var(--text); font-weight: 600; }
.steps span.done { color: var(--ok); }
.club-pick { display: flex; flex-direction: column; padding: 10px 12px; border-radius: var(--rad); background: color-mix(in srgb, var(--accent) 10%, var(--card)); border: 1px solid var(--accent); }
.club-pick small { color: var(--muted); }
.pick, .consent { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--rad); cursor: pointer; }
.pick.on, .consent.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.pick input, .consent input { margin-top: 3px; accent-color: var(--accent); width: 18px; height: 18px; flex-shrink: 0; }
.pick span, .consent span { display: flex; flex-direction: column; gap: 2px; color: var(--text); font-size: 14px; }
.pick small, .consent small { color: var(--muted); font-size: 12.5px; }
.consent a, .link { color: var(--accent); text-decoration: underline; background: none; border: 0; padding: 0; font-size: inherit; cursor: pointer; }
.rules-box { max-height: 240px; overflow: auto; font-size: 13px; padding: 10px 12px; background: var(--bg); border-radius: var(--rad); border: 1px solid var(--border); }
.row-btns .grow { flex: 1; }

/* ── QR регистрации ── */
.qr-dlg .sfm { display: flex; flex-direction: column; gap: 10px; align-items: stretch; color: var(--text); }
.qr-box { width: 240px; height: 240px; margin: 0 auto; background: #fff; border-radius: var(--rad); padding: 8px; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.copy-row { display: flex; gap: 8px; }
.qr-dlg .center { text-align: center; font-size: 16px; }
@media print {
    body * { visibility: hidden; }
    .qr-dlg, .qr-dlg * { visibility: visible; }
    .qr-dlg { position: fixed; inset: 0; width: auto; border: 0; box-shadow: none; background: #fff; color: #000; }
    .qr-dlg .smf, .qr-dlg h3 .x, .qr-dlg .copy-row button { display: none; }
    .qr-box { width: 70mm; height: 70mm; }
}

/* ── Клиенты, страница атлета ── */
.in.search { max-width: 360px; }
.empty.my { align-items: flex-start; text-align: left; }
.empty.my h1 { color: var(--text); }
.auth-form .pick, .auth-form .consent { flex-direction: row; align-items: flex-start; }
.auth-card p a, .auth-card small a { color: var(--accent); }
/* Мобильные: карточка входа/регистрации не шире экрана, длинный email переносится */
.auth-page { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.auth-page { grid-template-rows: 1fr auto; }   /* карточка по центру, копирайт — внизу экрана */
.auth-card { box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .auth-page { padding: 12px; } .auth-card { padding: 20px 16px; } }

/* Форматированный текст: показ (.rtx) и редактор (.rte) */
.rtx { line-height: 1.5; overflow-wrap: anywhere; }
.rtx > :first-child { margin-top: 0; }
.rtx > :last-child { margin-bottom: 0; }
.rtx p, .rtx div { margin: 0 0 .6em; }
.rtx h3 { font-size: 1.15em; margin: .9em 0 .4em; }
.rtx h4 { font-size: 1.05em; margin: .8em 0 .3em; }
.rtx ul, .rtx ol { margin: 0 0 .6em; padding-left: 1.4em; }
.rtx li { margin: .15em 0; }
.rtx a { color: var(--accent); }
.rtx blockquote { margin: 0 0 .6em; padding-left: .8em; border-left: 3px solid var(--border); color: var(--muted); }
.rte { border: 1px solid var(--border); border-radius: var(--rad); background: var(--card, #fff); overflow: hidden; }
.rte:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.rte.bad { border-color: var(--danger); }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-bottom: 1px solid var(--border); background: var(--bg); }
.rte-bar button { min-width: 32px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.rte-bar button:hover { background: var(--card, #fff); }
.rte-bar button.on { background: var(--accent); color: #fff; }
.rte-sep { width: 1px; margin: 4px 3px; background: var(--border); }
.rte-area { padding: 10px 12px; font-size: 14px; color: var(--text); outline: none; overflow-y: auto; max-height: 60vh; }
.rte-area:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.rte.off .rte-area { opacity: .7; }

/* Пароль с глазом */
.pw { position: relative; display: block; }
.pw input { width: 100%; box-sizing: border-box; padding-right: 42px; }
.pw-eye { position: absolute; top: 0; right: 0; bottom: 0; width: 40px; border: 0; background: transparent; cursor: pointer; color: var(--muted);
    background-repeat: no-repeat; background-position: center; background-size: 20px; opacity: .8; }
.pw-eye::before { content: ""; display: block; width: 20px; height: 20px; margin: auto; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat; }
.pw-eye.on::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.9 17.9A10 10 0 0 1 12 19c-6.4 0-10-7-10-7a18 18 0 0 1 5.1-5.9M9.9 5.2A9 9 0 0 1 12 5c6.4 0 10 7 10 7a18 18 0 0 1-2.2 3.2M14.1 14.1a3 3 0 1 1-4.2-4.2'/%3E%3Cpath d='M2 2l20 20'/%3E%3C/svg%3E");
            mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.9 17.9A10 10 0 0 1 12 19c-6.4 0-10-7-10-7a18 18 0 0 1 5.1-5.9M9.9 5.2A9 9 0 0 1 12 5c6.4 0 10 7 10 7a18 18 0 0 1-2.2 3.2M14.1 14.1a3 3 0 1 1-4.2-4.2'/%3E%3Cpath d='M2 2l20 20'/%3E%3C/svg%3E"); }
.pw-eye:hover, .pw-eye.on { color: var(--accent); opacity: 1; }

/* Телефон: код страны + номер */
.phone { display: grid; grid-template-columns: minmax(96px, 120px) minmax(0, 1fr); gap: 8px; }
.phone.bad .in { border-color: var(--danger); }
.auth-form .lbl { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.auth-form .lbl > span { font-size: 13px; font-weight: 600; color: var(--text); opacity: .9; }

/* Абонементы и платежи */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--border); border-radius: var(--rad); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tile small { color: var(--muted); font-size: 12px; }
.tile b { font-size: 20px; }
.tile.bad { border-color: rgba(250,88,97,.5); } .tile.bad b { color: var(--danger); }
.tile.warn { border-color: rgba(227,155,0,.5); } .tile.warn b { color: var(--warn); }
.btn.sm, .btn2.sm { padding: 5px 10px; font-size: 13px; }
.stat.static { cursor: default; flex-wrap: wrap; }
.stat.static > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat.free { border-color: var(--accent); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; }
.warn-text { color: var(--warn); }
.dot-red { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); margin-left: 4px; vertical-align: middle; }
.sub-card { border: 1px solid var(--accent); border-radius: var(--rad); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; margin-top: 8px;
    background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.sub-card.next { border-style: dashed; background: var(--card); }
.sub-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sub-head .price { font-weight: 700; white-space: nowrap; }
.sub-head .price small { font-weight: 400; color: var(--muted); }
.form-card { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; border-color: var(--accent); }
.group-picks { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.group-picks.bad .pick { border-color: var(--danger); }
.group-picks .pick { align-items: center; font-size: 14px; }
.group-picks .pick small { margin-left: auto; }
.gdot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; margin-right: 4px; vertical-align: middle; }
.charges { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.charge { border: 1px solid var(--border); border-radius: var(--rad); padding: 10px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
.charge.overdue { border-color: rgba(250,88,97,.5); border-left: 3px solid var(--danger); }
.charge .ch-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.charge .ch-sum { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.charge .row-btns { grid-column: 1 / -1; }
/* Строка счёта: справа метка долга / статуса, «Принять» и меню «⋯» (разовые и абонемент — одного вида) */
.charge { align-items: center; }
.charge .ch-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.charge .ch-acts .tag { margin-left: 0; }
.sec-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.sec-row .btn2 { text-transform: none; letter-spacing: 0; font-weight: 400; }
.menu-wrap { position: relative; display: inline-flex; }
.ib.more { color: var(--muted); }
.menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 190px; display: flex; flex-direction: column; padding: 4px;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--rad); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.menu-pop button { text-align: left; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.menu-pop button:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.menu-pop button:disabled { opacity: .45; cursor: default; }
/* «Абонементы и платежи» → «Виды счетов» */
.ctypes { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.ctype { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; }
.ctype.off { opacity: .6; }
.ctype .grow, .row-btns .in.grow { flex: 1; min-width: 160px; }
/* Баланс атлета: остаток сверху, лента движений */
.bal-head b { font-size: 20px; }
.bal-list { display: flex; flex-direction: column; }
.bal-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 2px 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.bal-row:last-child { border-bottom: 0; }
.bal-row small { grid-column: 2 / -1; }
.bal-row .up { color: #1F9D55; }
.bal-row .down { color: var(--danger); }
.bal-edge { font-weight: 600; background: var(--hover, transparent); }
.bal-edge small { font-weight: 400; }
.bal-period { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-bottom: 8px; }
.bal-period .fld { min-width: 0; }
.bal-period .dmy { grid-template-columns: 54px minmax(0, 1fr) 66px; gap: 4px; }
.bal-period .dmy .in { padding: 6px 4px 6px 8px; font-size: 13px; }
.bal-quick { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.bal-quick .btn2 { border-radius: 9px; }
@media (max-width: 520px) { .bal-row { grid-template-columns: minmax(0, 1fr) auto; } .bal-row > span:first-child { grid-column: 1 / -1; } .bal-row small { grid-column: 1 / -1; } }
.tag.ok { color: #1F9D55; border-color: rgba(31,157,85,.4); background: rgba(31,157,85,.12); }
.tag.bad { color: var(--danger); border-color: rgba(250,88,97,.4); background: rgba(250,88,97,.12); }
.details { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border: 1px solid var(--border); border-radius: var(--rad); padding: 10px 12px; margin-top: 6px; }
.details > div { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.details small { color: var(--muted); font-size: 12px; }
.rt tr.click { cursor: pointer; }
.rt tr.click:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card.plan { text-align: left; display: flex; flex-direction: column; gap: 8px; color: var(--text); cursor: pointer; }
.card.plan:hover { border-color: var(--accent); }
.card.plan.off { opacity: .6; border-style: dashed; }
.plan-groups { display: flex; flex-wrap: wrap; gap: 4px; }
.plan-groups .tag { margin-left: 0; }
.cash-card { display: flex; flex-direction: column; gap: 6px; }
.cash-card .pick { align-items: center; }
.cash-card .pick span { flex-direction: row; flex-wrap: wrap; gap: 4px; flex: 1; font-size: 13px; }
.cash-card .pick .right { margin-left: auto; white-space: nowrap; }
.sticky-bar { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px;
    background: var(--card); border: 1px solid var(--accent); border-radius: var(--rad); padding: 10px 14px; box-shadow: 0 -6px 20px rgba(0,0,0,.15); }
@media (max-width: 760px) { .details { grid-template-columns: 1fr; } }
/* Клиенты: короткие колонки без переносов, долг — кнопка оплаты под тарифом */
/* Клиенты: без горизонтальной прокрутки — длинное переносится (метка «email не подтверждён» под имя, согласия — друг под друга);
   в одну строку только возраст и дата «С» */
.rt.clients td { white-space: normal; }
.rt.clients th { text-align: center; }
.rt.clients td:nth-child(4), .rt.clients td:nth-child(6) { white-space: nowrap; }
.rt.clients td:first-child .tag { display: inline-block; margin: 2px 0 0; }
.rt.clients td:first-child b { margin-right: 6px; }
.rt.clients td:last-child .tag { display: inline-block; margin: 2px 4px 2px 0; }
.rt.clients td:nth-child(5) small { overflow-wrap: anywhere; }
.rt td.nowrap { white-space: nowrap; }
.rt td.nowrap .btn { margin-left: 8px; }
td > .tag:first-child { margin-left: 0; }
th.ctr, td.ctr { text-align: center; }
/* Согласия в «Клиентах»: пилюли одной ширины (по самой широкой — «нет»), по центру; перенос на вторую строку — тоже по центру */
.cons-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.cons-tags .tag { margin: 0; min-width: 5.5em; box-sizing: border-box; text-align: center; }   /* пилюля первой в ячейке — ровно по левому краю, как текст */
.pay-tag { display: block; width: fit-content; margin: 4px 0 0; cursor: pointer; font: inherit; font-size: 11px; }
.pay-tag:hover { background: var(--danger); color: #fff; }
.alert .push { margin-left: auto; }
@media (max-width: 760px) { .rt.clients td { white-space: normal !important; } }

/* Посещения */
.att { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 14px; align-items: start; }
.att-list { display: flex; flex-direction: column; gap: 6px; }
.att-session { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "t cnt" "b b" "s s"; gap: 2px 8px; text-align: left;
    background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--c); border-radius: var(--rad); padding: 10px 12px; color: var(--text); cursor: pointer; }
.att-session .t { grid-area: t; font-size: 12px; color: var(--muted); }
.att-session b { grid-area: b; }
.att-session small { grid-area: s; }
.att-session .cnt { grid-area: cnt; justify-self: end; font-weight: 700; font-size: 13px; }
.att-session.on { border-color: var(--accent); border-left-color: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.att-session.off { opacity: .55; }
.att-roster { display: flex; flex-direction: column; gap: 10px; }
.att-rows { display: flex; flex-direction: column; gap: 6px; }
.att-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--rad); }
.att-row.marked { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.att-row .who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.att-row .who small { display: flex; flex-wrap: wrap; gap: 4px; }
.att-row > .av + .who { margin-right: auto; flex: 1; }   /* аватар — рядом с именем, а не по space-between */
.att-row .who .tag { margin-left: 0; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { padding: 6px 10px; font-size: 13px; color: var(--muted); background: var(--card); border: 0; border-right: 1px solid var(--border); cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button.on { color: #fff; font-weight: 600; }
.seg button.on.present { background: #1F9D55; }
.seg button.on.late { background: var(--warn); }
.seg button.on.excused { background: #5B7BB4; }
.seg button.on.none { background: var(--muted); }
.seg button:disabled { cursor: default; }
.att-add { display: flex; flex-direction: column; gap: 6px; }
.att-add .pick { text-align: left; background: var(--card); color: var(--text); }
.ok-btn { cursor: pointer; color: #1F9D55; border-color: rgba(31,157,85,.4); font: inherit; font-size: 11px; }
@media (max-width: 900px) { .att { grid-template-columns: 1fr; } }
.cal-bar .nav .period { white-space: nowrap; }
.cal-bar .nav { flex-wrap: wrap; }
.cal-bar .nav .in { width: auto; }
/* Строка состава не прыгает, когда метки исчезают (например, «тренер 18:30» после «Не был») */
.att-row { min-height: 58px; }
.att-row .who small { min-height: 20px; }

/* Аттестации */
.belt-step { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.belt-step span { font-size: 13px; }
.belt-card { display: flex; flex-direction: column; gap: 10px; }
.belt-now { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px; border: 1px solid var(--border); border-radius: var(--rad); }
.belt-now > div { display: flex; flex-direction: column; gap: 3px; }
.next-step { border: 1px dashed var(--border); border-radius: var(--rad); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.next-step.ready { border: 1px solid rgba(31,157,85,.6); background: rgba(31,157,85,.06); }
.crit { display: flex; flex-direction: column; gap: 4px; }
.crit-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.crit-row.met { color: #1F9D55; }
.crit-row label { display: flex; gap: 8px; align-items: center; color: var(--text); cursor: pointer; }
.crit-row input { accent-color: var(--accent); width: 16px; height: 16px; }
.now-new { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stat.hist { justify-content: flex-start; gap: 12px; }
.stat.hist .ib { margin-left: auto; }
.rt.cands td:first-child, .rt.cands th:first-child { width: 32px; }
.rt.cands input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.rt.cands td small { display: block; }
.inline-date { flex-direction: row; align-items: center; gap: 8px; }
.inline-date .in { width: auto; }

/* Поля даты: системный календарь в цвет темы (сам выпадающий календарь браузер стилизовать не даёт) */
input[type=date], input[type=time] { accent-color: var(--accent); cursor: pointer; }
input[type=date]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .75; border-radius: 6px; padding: 3px; }
input[type=date]::-webkit-calendar-picker-indicator:hover { opacity: 1; background: color-mix(in srgb, var(--accent) 20%, transparent); }
:root[data-theme="dark"] input[type=date], :root[data-theme="dark"] input[type=time] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) input[type=date], :root:not([data-theme="light"]) input[type=time] { color-scheme: dark; } }
:root[data-theme="light"] input[type=date] { color-scheme: light; }
/* Дата рождения: день / месяц / год */
.dmy { display: grid; grid-template-columns: minmax(70px, .8fr) minmax(0, 1.6fr) minmax(80px, 1fr); gap: 8px; }
.dmy.bad .in { border-color: var(--danger); }
/* Заголовки разделов меню — цветом акцента, заметнее пунктов */
aside .grp { color: var(--accent); opacity: 1; font-weight: 700; letter-spacing: .08em; }
@media (min-width: 1201px) { aside .grp:not(:first-child) { margin-top: 18px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); } }
/* Текст на нескольких языках: вкладки над редактором */
.mlt { display: flex; flex-direction: column; gap: 6px; }
.mlt-tabs { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.mlt-tabs button { position: relative; padding: 5px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--muted); font-weight: 600; font-size: 12px; cursor: pointer; }
.mlt-tabs button.on { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 14%, var(--card)); }
.mlt-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #1F9D55; margin-left: 5px; vertical-align: middle; }
.mlt-tabs small { flex-basis: 100%; font-size: 12px; }   /* подсказка — отдельной строкой под кнопками языков */
/* Карточка тренера */
.instructor-discipline { display: flex; flex-direction: column; gap: 8px; }
.instructor-discipline.on { border-left: 3px solid var(--accent); padding-left: 10px; }
.instructor-belt { display: flex; flex-direction: column; gap: 8px; }
.cert { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 10px 40px 10px 10px; border: 1px solid var(--border); border-radius: var(--rad); }
.cert .ib { position: absolute; top: 8px; right: 6px; }
.rt td.right .btn2.sm { margin-right: 6px; }
.rt td.instructor-col { white-space: nowrap; width: 1%; }
.rt td.right .acts { display: inline-flex; gap: 6px; min-width: 76px; justify-content: flex-end; }
.menu a.mi { display: block; color: var(--text); text-decoration: none; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; max-width: 1000px; }
.dmy.compact { display: inline-grid; grid-template-columns: 64px 128px 86px; gap: 6px; }
.dmy.compact .in { padding: 6px 8px; }
.cal-bar .filters .dmy .in { min-width: 0; width: 100%; }
@media (max-width: 480px) { .dmy.compact { grid-template-columns: 58px 1fr 78px; width: 100%; } }
.instructor-line { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--muted); font-size: 12px; }

/* Журнал изменений */
.audit { display: flex; flex-direction: column; gap: 10px; }
.audit-day { font-weight: 600; margin-top: 6px; text-transform: capitalize; }
.audit-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.audit-row:last-child { border-bottom: none; }
.audit-time { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 42px; }
.audit-ic { width: 22px; text-align: center; }
.audit-ic.insert { color: #1F9D55; }
.audit-ic.delete { color: var(--danger); }
.audit-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.audit-diff { width: 100%; font-size: 13px; }
.audit-diff td { word-break: break-word; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pager .nav { display: flex; gap: 8px; align-items: center; }
.pager .nav .in { width: auto; }

/* Новости (макет news.html) */
.tag.acc { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.news-feed { display: flex; flex-direction: column; gap: 12px; }
.news-card { padding: 14px 16px; display: flex; gap: 16px; align-items: stretch; position: relative; }
.news-card.draft { border-style: dashed; }
.news-thumb { width: 84px; height: 84px; flex-shrink: 0; border-radius: var(--rad); display: grid; place-items: center; font-size: 26px;
              background: linear-gradient(135deg, #cfd6df, #9aa5b3); opacity: .9; }
.news-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.news-tags { display: flex; gap: 6px; }
.nbadge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 5px;
          background: color-mix(in srgb, var(--primary) 30%, transparent); color: var(--text); }
.nbadge.bad { background: color-mix(in srgb, var(--danger) 75%, transparent); color: #fff; }
.nbadge.acc { background: rgba(227,155,0,.18); color: #E39B00; }
.nbadge.draft { background: transparent; border: 1px dashed var(--border); color: var(--muted); }
.news-title { font-size: 16px; }
.news-body { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.news-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; margin-top: 2px; }
.news-meta .pill { font-size: 12px; }
.news-langs { font-size: 11px; letter-spacing: .04em; }
.news-acts { display: flex; gap: 6px; align-self: flex-end; }
@media (max-width: 760px) { .news-thumb { width: 56px; height: 56px; font-size: 20px; } .news-acts { position: absolute; top: 12px; right: 12px; } }

/* Дашборд */
.cap { text-transform: capitalize; }
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.dash-tile { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none; }
a.dash-tile:hover { border-color: var(--accent); }
.dash-tile.warn { border-color: var(--warn); }
.dash-tile.warn b { color: var(--warn); }
.dash-tile small { color: var(--muted); font-size: 13px; }
.dash-tile b { font-size: 28px; line-height: 1.1; }
.dash-tile span { font-size: 13px; }
.up { color: #1F9D55; }
.down { color: var(--danger); }
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.dash-card h3 { margin: 0; font-size: 16px; }
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-head a { color: var(--accent); }
.dash-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; height: 170px; align-items: end; }
.dash-bar { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 6px; }
.dash-bar i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: var(--primary); }
.dash-bar.now i { background: var(--accent); }
.dash-bar small { color: var(--muted); font-size: 12px; text-align: center; text-transform: capitalize; }
.dash-bar.now small { color: var(--accent); }
.dash-att { display: flex; flex-direction: column; }
.dash-att .att { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.dash-att .att:last-child { border-bottom: none; }
.dash-att .att small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.dash-att .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.dash-att .dot.bad { background: var(--danger); }
.dash-att .dot.warn { background: #E39B00; }
.dash-table { width: 100%; }
.dash-table tr.live td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.dash-table tr.cancel td { opacity: .6; }
/* Мои тренировки — как в аккордеоне: полоса акцента слева, лёгкий фон, метка «твоя» */
.dash-table tr.mine td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.dash-table tr.mine td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg); font-size: 12px; }

/* Выпадающий список с галочками (группы новости) */
.msel { position: relative; }
.msel-btn { text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; }
.msel-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msel-btn::after { content: "▾"; color: var(--muted); }
.msel.bad .msel-btn { border-color: var(--danger); }
.msel-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; background: var(--card); border: 1px solid var(--border);
             border-radius: var(--rad); box-shadow: 0 10px 30px rgba(0,0,0,.25); max-height: 280px; overflow: auto; padding: 4px; display: flex; flex-direction: column; }
.msel-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.msel-item:hover { background: var(--bg); }
.msel-item.on { font-weight: 600; }
.msel-clear { align-self: flex-start; margin: 4px 10px 6px; }
.mlt-tabs button.bad { color: var(--danger); border-color: var(--danger); }

/* Расходы (макет expenses.html) */
.dash-tile.warn { border-color: rgba(227,155,0,.5); }
.dash-grid.two-even { grid-template-columns: 1fr 1fr; }
@media (max-width: 1000px) { .dash-grid.two-even { grid-template-columns: 1fr; } }
.rt.expenses td.num, .rt.expenses th.num { text-align: right; white-space: nowrap; }
.block { display: block; }
.doc-ic { background: none; border: 0; font-size: 17px; padding: 0 2px; cursor: pointer; }
button.tag { cursor: pointer; }
.sum-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 14px; }
.sum-bar { grid-column: 1 / -1; display: block; height: 4px; border-radius: 2px; background: var(--accent); min-width: 2px; }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; }
.seg.wide button.on { background: var(--primary); }
.docs { display: flex; gap: 8px; flex-wrap: wrap; }
.doc { position: relative; display: inline-flex; width: 46px; height: 46px; border: 1px solid var(--border); border-radius: 8px; align-items: center; justify-content: center; font-size: 20px; }
.doc.pending { opacity: .55; border-style: dashed; }
.doc-open { background: none; border: 0; font-size: 20px; cursor: pointer; }
.doc-del { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--danger); font-size: 10px; line-height: 1; cursor: pointer; }
.drop { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 18px; border: 1px dashed var(--border); border-radius: var(--rad); color: var(--muted); cursor: pointer; position: relative; text-align: center; }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop:hover { border-color: var(--accent); }
.msel-item.create { color: var(--accent); font-weight: 600; }
.btn2.danger { color: var(--danger); margin-right: auto; }

/* Дежурства (макет duty.html) */
.duty-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.duty-legend span { display: inline-flex; gap: 6px; align-items: center; }
.duty-legend .lg { width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--border); }
.duty-legend .lg.now { border-color: #2E7CF6; }
.duty-legend .lg.mine { border-color: var(--danger); }
.duty-legend .lg.lg-empty { border: 2px dashed var(--danger); }
.duty-branch { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.duty-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.duty-head > b { font-size: 16px; }
.duty-toggle { display: inline-flex; gap: 8px; align-items: center; background: none; border: 0; padding: 4px 0; color: inherit; font: inherit; cursor: pointer; }
.duty-toggle:disabled { cursor: default; opacity: .6; }
.duty-period { width: auto; }
.duty-nav { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.duty-nav .period { margin-right: 6px; font-weight: 600; }
.duty-slots { display: grid; gap: 10px; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.duty-slots.week { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.duty-slots.month { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.duty-slots.day .duty-slot { min-height: 66px; padding: 6px 8px; }
.duty-slots.day .duty-who span:last-child { font-size: 12px; }
.duty-wd { font-size: 12px; color: var(--muted); text-align: center; }
@media (max-width: 900px) {
  .duty-slots.week, .duty-slots.month { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .duty-slots.day { gap: 4px; }
  .duty-slots.day .duty-who span:last-child { display: none; }   /* на узком — только инициалы */
}
.duty-slot { position: relative; border: 1px solid var(--border); border-radius: var(--rad); padding: 10px; display: flex; flex-direction: column; gap: 6px; min-height: 78px; background: var(--card); }
.duty-slot small { color: var(--muted); font-size: 12px; }
.duty-slot.past { opacity: .55; }
.duty-slot.free { border: 2px dashed color-mix(in srgb, var(--danger) 70%, transparent); }
.duty-slot.now { border: 2px solid #2E7CF6; }
.duty-slot.mine { border: 2px solid var(--danger); }
.duty-who { display: flex; gap: 8px; align-items: center; background: none; border: 0; padding: 0; color: inherit; text-align: left; cursor: pointer; font-size: 14px; }
.duty-who:disabled { cursor: default; }
.av.sm { width: 28px; height: 28px; font-size: 11px; background: color-mix(in srgb, var(--primary) 40%, transparent); color: var(--text); flex-shrink: 0; }
.duty-pick { min-width: 200px; }
.msel-item.danger { color: var(--danger); }

/* Тема и логотип (макет theme.html) */
.theme-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
@media (max-width: 1200px) { .theme-layout { grid-template-columns: 1fr; } }
.theme-main { display: flex; flex-direction: column; gap: 16px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.theme-card { border: 2px solid var(--border); border-radius: var(--rad); padding: 10px; background: var(--card); color: inherit; display: flex; flex-direction: column; gap: 8px; cursor: pointer; text-align: left; }
.theme-card.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.theme-card:disabled { cursor: default; }
.theme-card .theme-pal { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); height: 40px; border-radius: 8px; overflow: hidden; }
.theme-card .theme-pal i { display: block; }
.logo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .logo-row { grid-template-columns: 1fr; } }
.logo-box { display: flex; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: var(--rad); padding: 10px; flex-wrap: wrap; }
.logo-box.compact { border: 0; padding: 0; flex-wrap: nowrap; }
.logo-img { width: 64px; height: 64px; border-radius: var(--rad); display: grid; place-items: center; background: #F4F6F9 repeating-conic-gradient(#e6e9ee 0 25%, transparent 0 50%) 0 0 / 12px 12px; flex-shrink: 0; overflow: hidden; font-size: 11px; text-align: center; }
.logo-box.dark .logo-img { background: #1B2430; }
.logo-box.compact .logo-img { width: 40px; height: 40px; }
.logo-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-acts { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.theme-branch { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.theme-branch:last-child { border-bottom: 0; }
.theme-branch .grow { flex: 1; min-width: 140px; }
.theme-branch select { width: auto; min-width: 150px; }
.theme-preview { position: sticky; top: 0; }
.phones { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.phone { display: flex; flex-direction: column; gap: 6px; }
.phone-screen { border-radius: 22px; border: 6px solid #0b0f14; overflow: hidden; min-height: 330px; display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; font-size: 12px; }
.ph-head { display: flex; align-items: center; gap: 6px; padding: 10px 8px; color: #fff; }
.ph-head img { width: 24px; height: 24px; object-fit: contain; }
.ph-head b { flex: 1; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-logo { width: 24px; height: 24px; border-radius: 6px; background: rgba(255,255,255,.2); display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.ph-card { margin: 0 8px; border: 1px solid; border-radius: var(--rad); padding: 8px; display: flex; flex-direction: column; gap: 3px; }
.ph-card small { opacity: .7; font-size: 10px; }
.ph-tag { align-self: flex-start; color: #fff; font-size: 9px; font-weight: 700; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; }

/* Дежурства: аккордеон филиалов (если филиалов больше одного) */
.duty-branch.acc .duty-head { cursor: pointer; }
.duty-branch.acc:not(.open) { padding: 12px 16px; }
.duty-branch.acc:not(.open):hover { border-color: var(--accent); }
.acc-chev { color: var(--muted); width: 14px; }
.duty-ctrls { display: contents; }
.duty-now { font-size: 13px; color: var(--muted); margin-left: auto; }
.duty-now.free { color: var(--danger); }

/* Новости: фото и свои типы */
.news-thumb.photo { position: relative; overflow: hidden; background: var(--bg); }
.news-thumb.photo img { width: 100%; height: 100%; object-fit: cover; }
.news-thumb .n { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: var(--rad); }
.doc.photo { overflow: visible; padding: 0; }
.doc.photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; }
.type-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.type-row.off { opacity: .6; }
.type-row .grow { flex: 1; }
.type-form { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.type-form .seg button { background: var(--card); }
.type-form .seg button.on { background: color-mix(in srgb, var(--accent) 18%, var(--card)); }

.nbadge.sched { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.when-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
small.err { color: var(--danger); }

/* Соцсети зала (макет branches.html) */
.card.social { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.social-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.social-row:last-child { border-bottom: 0; }
.social-row.off { opacity: .55; }
.social-row .acts { margin-left: auto; display: flex; gap: 6px; }
.soc-url { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.soc-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: #607089; flex-shrink: 0; }
.soc-ic.facebook { background: #1877F2; } .soc-ic.instagram { background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF); }
.soc-ic.tiktok { background: #111; } .soc-ic.youtube { background: #FF0000; } .soc-ic.telegram { background: #229ED9; } .soc-ic.whatsapp { background: #25D366; }
.qr-row { display: flex; gap: 12px; align-items: center; }
.qr-box { width: 120px; height: 120px; border: 1px solid var(--border); border-radius: var(--rad); background: #fff; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.qr-box img, .qr-gen svg { width: 100%; height: 100%; object-fit: contain; }
.qr-gen { display: block; width: 110px; height: 110px; }
.qr-acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.bh .lg.logo { background: transparent; overflow: hidden; }
.bh .lg.logo img { width: 100%; height: 100%; object-fit: contain; }

/* Карточка клиента: обзор, физ. данные, согласия */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.kv-card { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--rad); flex-wrap: wrap; }
.consent-line { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 4px 0; }
.consent-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.consent-row > div { flex: 1; }
.weight-bars { display: flex; gap: 6px; align-items: flex-end; height: 120px; }
.weight-bars .wb { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 4px; max-width: 40px; }
.weight-bars .wb i { display: block; background: var(--accent); border-radius: 4px 4px 0 0; }
.weight-bars .wb small { font-size: 10px; color: var(--muted); text-align: center; }

/* Магазин — заглушка */
.shop-soon { align-items: center; }
.shop-soon .shop-ic { font-size: 42px; }
.shop-soon h2 { margin: 0; color: var(--text); }
.shop-soon ul { text-align: left; margin: 0; padding-left: 18px; color: var(--muted); }

/* Приватное занятие: выбранные атлеты */
.pill.picked { display: inline-flex; gap: 6px; align-items: center; margin: 0 6px 6px 0; }

/* Состояние системы (суперадмин) */
.health { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); grid-auto-rows: 1fr; gap: 16px; align-items: stretch; }   /* все окна одной высоты (по самому высокому), в ряду — одной ширины */
.health .card { display: flex; flex-direction: column; gap: 10px; }
.health-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.health-head h3 { margin: 0; }
.health-steps td { vertical-align: top; }
.health-steps .st { width: 24px; font-weight: 700; color: #1F9D55; }
.health-steps tr.bad .st, .health-steps tr.bad b { color: #FA5861; }
.health-steps .ms { white-space: nowrap; text-align: right; color: var(--muted); }
.health-steps .small { font-size: 12px; word-break: break-word; }

fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }   /* блок полей без рамки (пояс тренера после аттестаций — только чтение) */

/* Переключатель «Панель / Моё» в шапке (у кого есть и роль персонала, и атлет / родитель) */
/* Лента «режим + филиал» (панель и клиент): режим стопкой слева — активный с полосой акцента, филиал справа */
.ts-rib { display: inline-flex; align-items: stretch; flex-shrink: 0; border-radius: 10px; overflow: hidden; background: rgba(0,0,0,.22); }
.ts-rib .rib-m { display: flex; flex-direction: column; }
.ts-rib .rib-m a, .ts-rib .rib-m b { display: block; padding: 5px 12px 5px 8px; border-left: 4px solid transparent;
    font: 600 11px/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.ts-rib .rib-m a { color: rgba(255,255,255,.55); text-decoration: none; transition: color .15s; }
.ts-rib .rib-m a:hover { color: #fff; }
.ts-rib .rib-m b { color: #fff; background: rgba(255,255,255,.1); border-left-color: #F0B429; }
.ts-rib .rib-b { display: flex; align-items: center; gap: 9px; padding: 0 16px; font-size: 14px; color: #E6EDF5; white-space: nowrap; }
.ts-rib .rib-m + .rib-b { border-left: 1px solid rgba(255,255,255,.14); }
.ts-rib .rib-b .led { width: 8px; height: 8px; border-radius: 50%; background: #3DDC84; box-shadow: 0 0 8px #3DDC84; flex-shrink: 0; }
@media (prefers-reduced-motion: reduce) { .ts-rib .rib-b .led { animation: none !important; } }
@media (max-width: 420px) { .ts-rib .rib-m a, .ts-rib .rib-m b { padding: 4px 8px 4px 6px; letter-spacing: .04em; } header .ic { flex-shrink: 0; } }

/* Режим тренера в панели: «Твоя тренировка сейчас» на дашборде, «Я веду» в посещениях, заметки в карточке клиента */
.dash-live { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; padding: 14px 18px; border-left: 4px solid var(--c, var(--accent)); color: inherit; text-decoration: none; }
.dash-live .grow { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dash-live .grow b { font-size: 17px; overflow-wrap: anywhere; }
.dash-live small { color: var(--muted); font-size: 12px; }
.dash-live-n { display: flex; flex-direction: column; align-items: flex-end; }
.dash-live-n b { font-size: 22px; }
.dot-live { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); flex-shrink: 0; animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dot-live { animation-duration: 4s; } }
.lead-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* «Я веду»: справа в строке кнопок; переключатель → после нажатия зелёная пилюля «✓ Ты ведёшь · 18:24» */
.lead-bar { align-items: center; }
.lead-bar .lead-gap { flex: 1; }   /* «Я веду» слева, остальные кнопки — справа */
.lead-btn { display: inline-flex; }   /* обёртка: у disabled-кнопки title не всплывает — подсказка на обёртке */
.lead-btn:has(.lead-sw:disabled) { cursor: help; }
.lead-sw { display: inline-flex; align-items: center; gap: 10px; padding: 5px 6px 5px 14px; border-radius: 999px; background: var(--card); color: var(--text); border: 1px solid var(--border); font: inherit; font-weight: 600; cursor: pointer; }
.lead-sw .sw { width: 38px; height: 22px; border-radius: 999px; background: var(--border); position: relative; transition: background .15s; }
.lead-sw .sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: left .15s; }
.lead-sw:hover:not(:disabled) .sw { background: color-mix(in srgb, var(--ok) 55%, var(--border)); }
.lead-sw:disabled { opacity: .45; pointer-events: none; }
.lead-on { font-size: 13px; font-weight: 600; padding: 5px 14px; border-radius: 999px; color: #1F9D55; border: 1px solid rgba(31,157,85,.45); background: rgba(31,157,85,.12); white-space: nowrap; }
/* Дашборд: «Тренировки сегодня» — аккордеон по времени начала; мои — полоса акцента; составы одного времени рядом */
.dash-acc { border: 1px solid var(--border); border-radius: var(--rad); background: var(--card); overflow: hidden; }
.dash-acc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; }
.dash-acc-top h3 { margin: 0; }
.dash-acc-empty { padding: 0 16px 14px; }
.dash-acc-top a { color: var(--accent); }
.dash-acc-row { width: 100%; display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; padding: 12px 16px; background: none; border: 0; border-top: 1px solid var(--border); border-left: 4px solid transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.dash-acc-row.mine { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.dash-acc-row.past { opacity: .55; }
.dash-acc-row.on { opacity: 1; }
.dash-acc-row .chev { width: 12px; color: var(--muted); }
.dash-acc-row .t { display: inline-flex; align-items: center; gap: 6px; min-width: 104px; font-weight: 600; }
.dash-acc-row .g { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dash-acc-row .cnt { white-space: nowrap; }
.dash-acc-body { border-top: 1px solid var(--border); padding: 0 16px; }
.dash-acc-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 0; }
.dash-acc-col + .dash-acc-col { border-top: 1px solid var(--border); }   /* тренировки одного времени — друг под другом, через черту */
.dash-acc-col h4 { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-weight: 400; }
.notes { display: flex; flex-direction: column; gap: 10px; }
.note { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.note-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.note-head .push { margin-left: auto; }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* NFC-метки */
.nfc-row { display: flex; align-items: center; gap: 8px; }
.nfc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.nfc-card { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.nfc-card.bad { border-color: var(--danger); }
.nfc-card.off { opacity: .65; }
.nfc-head { display: flex; align-items: flex-start; gap: 10px; }
.nfc-head b { overflow-wrap: anywhere; }
.nfc-ico { font-size: 20px; }
.nfc-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.nfc-dl dt { color: var(--muted); }
.nfc-dl dd { margin: 0; overflow-wrap: anywhere; }
.nfc-active { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.nfc-warn { color: var(--danger); font-size: 13px; font-weight: 600; }

/* ── Вход: вид клиентского веба (всегда тёмный, фон «Сеть», карточка — стекло с полосой и лучом, как блоки правой колонки) ── */
html:root .auth-page.auth-dark {
    --primary: var(--dh, #1E4E8C); --secondary: var(--dc, #2A6F95); --accent: var(--da, #00B8D4); --bg: #121A26;
    --card: rgba(18,26,38,.72); --border: rgba(255,255,255,.16); --text: #EEF2F6; --muted: #93A1B2;
    background: #121A26; color: var(--text);
}
body:has(.auth-dark) { background: #121A26; color: #EEF2F6; }
.auth-dark > :not(canvas) { position: relative; z-index: 1; }
@property --auth-beam { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@property --auth-gx { syntax: '<percentage>'; inherits: false; initial-value: 90%; }
@property --auth-gy { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
.auth-dark .auth-card { isolation: isolate; border: 1px solid var(--border); border-left: 4px solid var(--accent);
    background: radial-gradient(circle 220px at var(--auth-gx) var(--auth-gy), color-mix(in srgb, var(--accent) 6%, transparent), transparent 70%), var(--card);   /* свет — 30 % от прежней яркости (20 %) */
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: auth-glow 7s ease-in-out infinite alternate; }
/* Луч по рамке: у большой карточки ярче и с «головой», чем у блоков колонки — иначе теряется на длинной рамке */
.auth-dark .auth-card::before { content: ""; position: absolute; inset: -1px; left: -4px; border-radius: inherit; padding: 2px; pointer-events: none; z-index: 1; opacity: .8;
    background: conic-gradient(from var(--auth-beam), transparent 0 65%, color-mix(in srgb, var(--accent) 40%, transparent) 78%, var(--accent) 88%, #fff 90%, transparent 92%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); animation: auth-beam 8s linear infinite; }
@keyframes auth-beam { to { --auth-beam: 360deg; } }
@keyframes auth-glow { to { --auth-gx: 15%; --auth-gy: 85%; } }
.auth-logo .ts-name { font-size: 26px; font-weight: 800; letter-spacing: .01em; }
.auth-dark .in { background: rgba(0,0,0,.35); border-radius: var(--rad); }
.auth-dark .btn2 { background: transparent; }
.auth-dark .auth-langs a.on { background: rgba(255,255,255,.06); box-shadow: inset 2px 0 0 var(--accent); }

/* Клиенты: выбор галочками и разовый счёт нескольким */
.rt .sel-col { width: 36px; padding-right: 0; }
.rt tr.picked td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.sel-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px;
           padding: 10px 14px; background: var(--card); border: 1px solid var(--accent); border-radius: var(--rad); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.sel-bar .grow { flex: 1; }
.alert.ok { color: var(--ok, #2ECC71); background: rgba(46,204,113,.12); border-color: rgba(46,204,113,.4); margin-top: 12px; }
.batch-who { font-size: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; overflow-wrap: anywhere; }
.batch-sum { display: flex; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 14px; }

/* Роли и права: название права — кнопка подсказки */
.matrix .perm-name { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.matrix .perm-name:hover { color: var(--accent); }
.matrix .perm-i { color: var(--muted); font-size: 12px; }
.perm-help { display: flex; flex-direction: column; gap: 10px; line-height: 1.5; }
.perm-help p { margin: 0; }
.perm-help b { color: var(--text); }

/* Суперадмин: новая NFC-метка */
.nfc-new { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 10px 0; }
.nfc-new .fld { min-width: 180px; }

/* Техники и планы (TechniquesPage, TechniqueDrawer, ProgramEditorPage, GroupProgramPanel) */
.tq-table td { vertical-align: middle; }
.tq-table tr.off { opacity: .55; }
.tq-ex { font-size: 11px; font-weight: 700; color: #B07A00; background: rgba(224,160,32,.16); border-radius: 8px; padding: 1px 7px; margin-left: 6px; white-space: nowrap; }
.tq-lv { display: inline-flex; gap: 6px; align-items: center; }
.tq-vid { font-size: 11px; color: #fff; background: #FF0033; border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
.tq-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.tq-plan { cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.tq-plan.off { opacity: .6; }
.tq-plan h3 { font-size: 16px; }
.tq-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag.acc { background: var(--sel, rgba(0,184,212,.12)); border-color: transparent; color: var(--secondary); font-weight: 600; }
.tq-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.tq-belts { display: flex; gap: 6px; flex-wrap: wrap; }
.tq-belts button, .tq-ten button { border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; background: var(--card); color: var(--text); display: flex; gap: 6px; align-items: center; font: inherit; font-size: 12px; cursor: pointer; }
.tq-belts button.on, .tq-ten button.on { border-color: var(--secondary); box-shadow: 0 0 0 1px var(--secondary); }
.tq-ten { display: flex; gap: 4px; flex-wrap: wrap; }
.tq-ten button { width: 34px; justify-content: center; font-weight: 600; }
.tq-ten button.on { background: var(--secondary); color: #fff; }
.tq-video { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 8px; margin-bottom: 8px; }
.tq-video .grow { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tq-ord { display: flex; flex-direction: column; }
.tq-vk { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #FF0033; color: #fff; flex-shrink: 0; }
.tq-more summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.tq-more { display: flex; flex-direction: column; gap: 10px; }
.tq-drop { display: flex; justify-content: center; align-items: center; min-height: 70px; border: 1px dashed var(--border); border-radius: 10px; cursor: pointer; overflow-wrap: anywhere; padding: 10px; }
.tq-drop input[type=file], label.btn2 input[type=file] { display: none; }
.tq-report { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.tq-report .ok { color: var(--ok); }
.tq-report .bad { color: var(--danger); overflow-wrap: anywhere; }
.tq-pre { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tq-params { display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--border); }
.tq-mini { display: flex; flex-wrap: wrap; gap: 4px; }
.tq-mini a { min-width: 28px; height: 26px; padding: 0 4px; border-radius: 6px; background: var(--bg); border: 1px solid var(--border); display: grid; place-items: center; font-size: 11px; color: var(--text); text-decoration: none; }
.tq-mini a.fill { background: var(--sel, rgba(0,184,212,.12)); }
.tq-mini a.on { background: var(--accent); border-color: var(--accent); color: #06222A; font-weight: 700; }
.tq-ed { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; margin-top: 16px; }
.tq-weeks { display: flex; flex-direction: column; gap: 12px; }
.tq-wk { border: 1px solid var(--border); border-radius: 12px; background: var(--card); overflow: hidden; scroll-margin-top: 70px; }
.tq-wk.cur { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tq-wh { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tq-wt { flex: 1; min-width: 160px; }
.tq-wc { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.tq-tc { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-height: 70px; }
.tq-wc .tq-tc + .tq-tc { border-left: 1px solid var(--border); }
.tq-any .tq-tc { border-top: 1px solid var(--border); min-height: 0; }
.tq-tc.on { background: rgba(0,184,212,.08); box-shadow: inset 0 0 0 2px var(--accent); }
.tq-tc .tl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.tq-row { display: flex; gap: 6px; align-items: center; border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; font-size: 13px; }
.tq-row .n { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tq-row.txt { font-style: italic; background: var(--bg); }
.tq-add { border: 1px dashed var(--border); border-radius: 8px; padding: 5px 8px; background: none; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.tq-lib { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 24px); overflow: auto; }
.tq-libl { display: flex; flex-direction: column; gap: 6px; }
.tq-it { display: flex; gap: 6px; align-items: center; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; background: var(--card); color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.tq-it .n { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tq-it:disabled { cursor: default; opacity: .7; }
.tq-text { display: flex; gap: 6px; }
.tq-gp { display: flex; flex-direction: column; gap: 14px; }
.tq-now { display: flex; gap: 12px; align-items: center; background: var(--bg); border-radius: 10px; padding: 12px; }
.tq-big { font-size: 26px; font-weight: 800; color: var(--secondary); }
.tq-hist { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.tq-hist b { color: var(--text); }
@media (max-width: 1000px) { .tq-ed { grid-template-columns: minmax(0, 1fr); } .tq-lib { position: static; max-height: none; } }
@media (max-width: 600px) { .tq-wc { grid-template-columns: minmax(0, 1fr); } .tq-wc .tq-tc + .tq-tc { border-left: 0; border-top: 1px solid var(--border); } .tq-table .hm { display: none; } }

/* Широкий экран: контент не шире 1600 px, меню слева прижато к линии контента (свободное место — снаружи),
   управление в шапке — по правой границе контента. --fr — половина свободного места (1880 = меню 232 + 1600 + поля 48) */
@media (min-width: 1201px) {
    .adm { --fr: max(0px, (100vw - 1880px) / 2); }
    .adm > aside { margin-left: var(--fr); }   /* меню — колонкой 232 px у контента, слева — фон страницы */
    .adm .content { padding-inline: 24px calc(24px + var(--fr)); }
    .adm header { padding-right: calc(24px + var(--fr)); }
}

/* Фон «сеть» (tsClient.startNet, без свечения у мыши): холст под меню и контентом */
.adm { position: relative; }
.adm-net { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.adm > main { position: relative; z-index: 1; }
/* меню над холстом; только когда оно в потоке — на узком экране и в открытом по ☰ оно position: fixed (z-index 30),
   и relative здесь его перебивало: скрытое меню занимало 250 px слева, страница уезжала вправо */
@media (min-width: 761px) { .adm > aside { position: relative; z-index: 1; } }
.adm > main, .adm .content { background: transparent; }

/* Модули клуба (ModulesPage) */
.mdl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; max-width: 1100px; }
.mdl { display: flex; flex-direction: column; gap: 6px; }
.mdl.off { opacity: .7; }
.mdl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mdl-head b { overflow-wrap: anywhere; }
.mdl-head .sw { border: 0; cursor: pointer; }
.mdl-head .sw:disabled { cursor: default; opacity: .6; }
.mdl-need { color: var(--warn); }

/* ── Банк (BankPage, макет admin/bank.html) ── */
.btn.small { padding: 5px 12px; font-size: 12px; }
.dash-tile.bad { border-color: rgba(250,88,97,.5); }
.dash-tile.bad b { color: var(--danger); }
.bk-h { font-size: 15px; margin: 4px 0 -4px; }
.bk-conns { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.bk-conn { display: flex; flex-direction: column; gap: 10px; padding: 16px; text-align: left; }
.bk-head { display: flex; gap: 12px; align-items: center; }
.bk-logo { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; flex-shrink: 0; }
.bk-logo.small { width: 30px; height: 30px; border-radius: 8px; font-size: 11px; }
.bk-name { flex: 1; min-width: 0; }
.bk-name b { display: block; }
.bk-name small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.bk-st { font-size: 11px; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.bk-st.ok { background: rgba(46,158,91,.14); color: var(--ok); }
.bk-st.warn { background: rgba(227,155,0,.16); color: var(--warn); }
.bk-st.bad { background: rgba(250,88,97,.14); color: var(--danger); }
.bk-meter { height: 6px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.bk-meter i { display: block; height: 100%; background: var(--ok); }
.bk-meter.warn i { background: var(--warn); }
.bk-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.bk-err { color: var(--danger); font-size: 12px; overflow-wrap: anywhere; }
.bk-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.bk-ok { color: var(--ok); font-size: 12px; overflow-wrap: anywhere; }
.bk-acc { text-align: left; overflow-wrap: anywhere; }
.bk-add { border-style: dashed; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; min-height: 150px; text-align: center; }
.bk-add b { color: var(--accent); font-size: 15px; }
.bk-list { display: flex; flex-direction: column; gap: 0; padding: 0; }
.bk-list .tabs { padding: 0 12px; }
.bk-count { color: var(--danger); margin-left: 4px; }
.bk-bar { padding: 12px 14px; }
.bk-tbl td.num, .bk-tbl th.num { text-align: right; white-space: nowrap; }
.bk-tbl td { vertical-align: top; }
.bk-ref { font-family: ui-monospace, monospace; font-size: 12px; background: var(--bg); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; display: inline-block; max-width: 100%; }
.bk-ref mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.bk-why { display: block; color: var(--danger); font-size: 12px; margin-top: 4px; }
.bk-amt { color: var(--ok); }
.bk-amt.neg { color: var(--text); }
.bk-amt.big { font-size: 20px; }
.bk-row-acts { text-align: right; }
.bk-row-acts > button { margin: 2px 0 2px 4px; }
.bk-banks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bk-bank { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; display: flex; gap: 10px; align-items: center; background: var(--card); text-align: left; overflow-wrap: anywhere; }
.bk-bank img { width: 30px; height: 30px; object-fit: contain; border-radius: 6px; flex-shrink: 0; }
.bk-bank.on, .bk-cand.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.bk-steps { margin: 0 0 0 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.45; }
.bk-tx { display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.bk-cands { display: flex; flex-direction: column; gap: 8px; }
.bk-cand { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; background: var(--card); text-align: left; }
.bk-av { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12px; flex-shrink: 0; }
.bk-cand-t { flex: 1; min-width: 0; }
.bk-cand-t small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.bk-opt { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
@media (max-width: 760px) {
    .bk-banks { grid-template-columns: 1fr; }
    .bk-row-acts { text-align: left; }
    .bk-row-acts > button { margin: 2px 4px 2px 0; }
}
