/* MindIT Admin MVP — Этап 10. Светлый интерфейс, синие акценты, карточки (референсы 13/14). */

:root {
    --bg: #f5f8fd;
    --surface: #ffffff;
    --ink: #0b1b3f;
    --ink-2: #26375c;
    --muted: #66769a;
    --blue: #1463ff;
    --blue-600: #0a4fe0;
    --blue-50: #eef4ff;
    --blue-100: #dbe7ff;
    --line: #e4ebf6;
    --green: #12a150;
    --green-50: #e6f7ee;
    --red: #e5384b;
    --red-50: #fdecee;
    --amber: #b7791f;
    --amber-50: #fff6e0;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 6px 22px rgba(18, 52, 120, 0.07);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body.admin {
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
h1, h2, p, dl, dd, ul, ol { margin: 0; padding: 0; }
h1 { font-size: 28px; line-height: 1.2; font-weight: 750; letter-spacing: -0.01em; }
h2 { font-size: 18px; font-weight: 700; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.link { color: var(--blue); font-weight: 600; }
svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------------------- layout */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 16px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; padding: 2px 6px; }
.brand strong { display: block; font-size: 22px; letter-spacing: -0.02em; line-height: 1; }
.brand small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 12px 12px; border-radius: 12px; color: var(--ink-2); font-weight: 600; text-decoration: none !important; }
.nav-item svg { font-size: 20px; color: var(--muted); }
.nav-item:hover { background: var(--blue-50); }
.nav-item.is-active { background: var(--blue-100); color: var(--blue-600); }
.nav-item.is-active svg { color: var(--blue); }
.nav-item.is-disabled { opacity: 0.55; cursor: not-allowed; }
.nav-item.is-disabled:hover { background: none; }
.soon { margin-left: auto; font-style: normal; font-size: 10px; font-weight: 600; background: var(--line); color: var(--muted); border-radius: 999px; padding: 2px 7px; white-space: nowrap; }
.help-box { margin-top: auto; display: flex; gap: 10px; background: var(--blue-50); border-radius: 12px; padding: 12px; color: var(--muted); font-size: 13px; }
.help-box svg { color: var(--blue); font-size: 22px; }

.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; padding: 14px 28px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-spacer { flex: 1; }
.account { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; display: grid; place-items: center; }
.account-name strong { display: block; font-size: 14px; }
.account-name small { color: var(--muted); font-size: 12px; }
.logout-form { margin: 0; }
.page { padding: 26px 32px 48px; max-width: 1500px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head > div:first-child { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.page-head p { flex-basis: 100%; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.col-main, .col-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* ------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card > * + * { margin-top: 14px; }
.card-head { display: flex; gap: 14px; align-items: flex-start; margin: 0 !important; }
.card-head p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.card-head.compact { align-items: center; gap: 10px; }
.card-head.compact h2 small { font-weight: 500; color: var(--muted); font-size: 13px; }
.card-head.with-action { justify-content: space-between; flex-wrap: wrap; }
.card-head-info { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.card-icon { color: var(--blue); font-size: 22px; display: grid; }
.step { width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; display: grid; place-items: center; flex: none; }
.badge { background: var(--blue-100); color: var(--blue-600); border-radius: 999px; padding: 1px 9px; font-size: 13px; font-weight: 700; margin-left: 6px; }
.msg-avatar-sm { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.name-cell { display: flex; align-items: center; gap: 8px; }
.row-actions { display: flex; gap: 8px; align-items: center; }
.row-actions form { display: contents; }
.empty-block { padding: 28px 12px; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; padding: 11px 18px; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn svg { font-size: 18px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-600); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--blue-50); }
.btn-soft { background: var(--blue-50); color: var(--blue-600); }
.btn-soft:hover { background: var(--blue-100); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--blue-50); }
.icon-btn.danger { color: var(--red); border-color: #f3c6cb; background: var(--red-50); }
.icon-btn.danger:hover { background: #fbdadd; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.field + .field { margin-top: 12px; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; margin: 0 !important; }
input[type=text], input[type=url], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
    width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 42px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-100); border-color: var(--blue); }
.input-icon { position: relative; display: block; }
.input-icon svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--blue); font-size: 18px; pointer-events: none; }
.input-icon input { padding-left: 38px; }
.field.inline select { width: auto; min-width: 150px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-2); font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }

.alert { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 16px; }
.card .alert { margin-bottom: 0; }
.alert ul { padding-left: 18px; }
.alert svg { margin-top: 2px; }
.alert-error { background: var(--red-50); color: #a5202f; border: 1px solid #f3c6cb; }
.alert-success { background: var(--green-50); color: #0b6b36; border: 1px solid #bfe8d0; }
.alert-warn { background: var(--amber-50); color: var(--amber); border: 1px solid #f3dfaa; }
.info-box { display: flex; gap: 10px; background: var(--blue-50); border-radius: 12px; padding: 14px; color: var(--muted); font-size: 13.5px; align-self: start; }
.info-box svg { color: var(--blue); margin-top: 2px; }

.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 11px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.pill.big { font-size: 14px; padding: 6px 14px; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-green { background: var(--green-50); color: var(--green); }
.pill-gray { background: var(--line); color: var(--muted); }
.status-finished { background: var(--green-50); color: var(--green); }
.status-started { background: var(--amber-50); color: var(--amber); }
.status-opened { background: var(--blue-100); color: var(--blue-600); }
.status-not_opened { background: var(--line); color: var(--muted); }

/* ------------------------------------------------------------- webinar page */
.video-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.dropzone { border: 2px dashed #b9cff5; border-radius: 14px; background: #fafcff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 24px 14px; cursor: pointer; min-height: 200px; color: var(--ink); }
.dropzone svg { font-size: 44px; color: var(--blue); }
.dropzone small { color: var(--muted); font-size: 12.5px; }
.dropzone.is-drag { background: var(--blue-50); border-color: var(--blue); }
.video-preview video { width: 100%; aspect-ratio: 16 / 9; background: #0b1b3f; border-radius: 12px; display: block; }
.video-empty { aspect-ratio: 16 / 9; display: grid; place-items: center; background: var(--blue-50); color: var(--muted); border-radius: 12px; }
.video-meta { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-top: 10px; }
.video-meta strong { display: block; word-break: break-all; font-size: 14px; }
.video-meta .muted { font-size: 13px; }
.progress { position: relative; margin-top: 10px; height: 26px; background: var(--blue-50); border-radius: 999px; overflow: hidden; }
.progress-bar { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--blue-100); transition: width 0.2s; }
.progress span { position: relative; display: block; text-align: center; line-height: 26px; font-size: 13px; color: var(--blue-600); font-weight: 600; }

.schedule-grid, .cta-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 18px; }
.schedule-row { display: grid; grid-template-columns: minmax(150px, 1.4fr) minmax(130px, 1fr) 40px auto; gap: 10px; align-items: center; margin-bottom: 10px; }
.row-note { font-size: 12px; color: var(--muted); }
.empty-note { margin-bottom: 12px; }
.tz-note { margin-top: 12px; font-size: 13px; color: var(--muted); }
.past { margin-top: 4px; font-size: 14px; }
.past summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.past ul { list-style: none; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }

.facts { display: flex; flex-direction: column; }
.facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { font-weight: 600; text-align: right; }
.facts.wide dd { max-width: 60%; word-break: break-word; }
.facts .highlight dd { color: var(--blue-600); }
.mini-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-kpi { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; font-size: 12.5px; color: var(--muted); }
.mini-kpi svg { color: var(--blue); font-size: 20px; }
.mini-kpi b { color: var(--ink); font-size: 20px; }

.dialog { border: none; border-radius: 18px; padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: 0 24px 70px rgba(11, 27, 63, 0.3); }
.dialog::backdrop { background: rgba(11, 27, 63, 0.45); }
.dialog-form { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.dialog-form .field + .field { margin-top: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ------------------------------------------------------------- analytics */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; gap: 14px; align-items: center; }
.kpi > svg { font-size: 34px; color: var(--blue); }
.kpi span { display: block; color: var(--muted); font-size: 13px; }
.kpi b { display: block; font-size: 26px; line-height: 1.2; }
.kpi small { color: var(--muted); font-size: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 860px; }
.table th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 650; padding: 10px 12px; background: #fafcff; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafcff; }
.user-link { display: block; color: var(--ink); }
.user-link strong { display: block; }
.user-link small { color: var(--muted); font-size: 12px; }
.yes { color: var(--green); display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.chat-count { display: inline-flex; align-items: center; gap: 5px; color: var(--blue-600); font-weight: 600; }
.empty-row { text-align: center; color: var(--muted); padding: 28px !important; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; }

.detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 20px; }
.detail-grid + .card, .card + .card { margin-top: 20px; }
.detail-grid > .card { margin-top: 0; }
.chat-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.chat-item { border-radius: 12px; padding: 10px 14px; background: var(--blue-50); }
.chat-item.manager { background: var(--green-50); }
.chat-item blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid var(--blue); color: var(--muted); font-size: 13px; }
.chat-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.chat-meta b { color: var(--ink); }
.chat-item p { margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.timeline { list-style: none; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 78px 16px minmax(0, 1fr); gap: 10px; padding: 8px 0; position: relative; }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; text-align: right; }
.timeline .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); margin-top: 6px; position: relative; z-index: 1; }
.timeline li::before { content: ""; position: absolute; left: 88px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.timeline strong { display: block; }
.timeline small { display: block; color: var(--muted); }
.timeline code { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------- ефір (Stage 12.5) */
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-left: auto; animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(229, 56, 75, .45); } 50% { box-shadow: 0 0 0 5px rgba(229, 56, 75, 0); } }

.live-topbar { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.live-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.live-title-row h1 { margin: 0; }
.live-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 8px; color: var(--muted); font-size: 14px; }
.live-meta span { display: inline-flex; align-items: center; gap: 6px; }
.live-meta svg { font-size: 17px; }
.live-connected { display: flex; align-items: center; gap: 12px; background: var(--green-50); border: 1px solid #bfe8d0; border-radius: var(--radius); padding: 12px 18px; }
.live-connected .live-dot { margin-left: 0; }
.live-connected strong { display: block; color: #0b6b36; }
.live-connected small { color: var(--muted); }

.live-empty { text-align: center; padding: 60px 20px; }
.live-empty svg { font-size: 44px; color: var(--muted); margin-bottom: 12px; }
.live-empty h2 { margin: 0 0 6px; }
.live-empty p { color: var(--muted); }
.live-countdown { margin-top: 18px; font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--blue); }

.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.live-col .card-head.compact { margin-bottom: 4px; }

.scripted-tabs { display: flex; gap: 8px; margin: 14px 0 10px; }
.scripted-tab { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 14px; font-size: 13.5px; font-weight: 650; color: var(--muted); cursor: pointer; }
.scripted-tab .badge { margin-left: 8px; }
.scripted-tab.is-active { border-color: var(--blue-100); background: var(--blue-50); color: var(--blue-600); }
.scripted-panel.hidden { display: none; }
.scripted-list { display: flex; flex-direction: column; gap: 10px; max-height: 560px; overflow-y: auto; }
.scripted-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px; align-items: start; }
.scripted-item.is-sent { opacity: .65; }
.scripted-item.is-next { border-color: var(--blue-100); background: var(--blue-50); }
.scripted-time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; grid-column: 1 / -1; }
.scripted-name { font-weight: 700; font-size: 14px; }
.scripted-text { font-size: 13.5px; color: var(--ink-2); margin: 2px 0 6px; }
.scripted-status { font-size: 12.5px; font-weight: 650; display: inline-flex; align-items: center; gap: 5px; }
.scripted-status.sent { color: var(--green); }
.scripted-status.next { color: var(--blue); }
.scripted-status.scheduled { color: var(--muted); }
.scripted-empty { color: var(--muted); font-size: 14px; padding: 12px 2px; }

.live-video-wrap { position: relative; border-radius: var(--radius); overflow: hidden; background: #0a1a45; aspect-ratio: 16 / 9; }
.live-video-wrap video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.live-video-wrap .live-video-badge { position: absolute; top: 12px; left: 12px; background: rgba(0,0,0,.55); color: #fff; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.live-video-badge .live-dot { margin-left: 0; }
.live-stats-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.live-progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 18px; font-weight: 650; }
.live-progress-track { height: 8px; border-radius: 999px; background: var(--line); margin-top: 8px; overflow: hidden; }
.live-progress-bar { height: 100%; background: var(--green); border-radius: 999px; transition: width .4s ease; }
.live-progress-pct { text-align: right; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.live-info-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.live-info-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.live-info-card span { display: block; font-size: 12.5px; color: var(--muted); }
.live-info-card strong { display: block; font-size: 17px; margin-top: 4px; }
.live-info-card small { color: var(--muted); font-size: 12.5px; }

.live-chat-messages { display: flex; flex-direction: column; gap: 12px; max-height: 520px; overflow-y: auto; padding-right: 2px; }
.live-msg { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
.live-msg-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.live-msg-head { display: flex; align-items: baseline; gap: 8px; }
.live-msg-name { font-weight: 700; font-size: 13.5px; }
.live-msg-time { font-size: 12px; color: var(--muted); }
.live-msg-text { font-size: 13.5px; margin: 2px 0 0; color: var(--ink-2); }
.live-msg.is-manager .live-msg-avatar { background: var(--green); }
.live-msg-reply { display: inline-block; margin-top: 6px; font-size: 12.5px; color: var(--blue); background: none; border: none; padding: 0; cursor: pointer; font-weight: 650; }
.live-chat-empty { color: var(--muted); font-size: 14px; padding: 12px 2px; }
.live-reply-form { display: flex; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.live-reply-form input { flex: 1 1 auto; }
.live-reply-form input:disabled, .live-reply-form .icon-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.live-reply-note { font-size: 12px; color: var(--muted); margin-top: 8px; }
.live-reply-target { font-size: 12.5px; color: var(--blue); margin-bottom: 6px; display: none; }
.live-reply-target.is-active { display: block; }

/* ------------------------------------------------------------- login */
.login-body { display: grid; place-items: center; padding: 20px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 34px; width: min(420px, 100%); display: flex; flex-direction: column; gap: 18px; }
.login-brand { padding: 0; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .field + .field { margin-top: 0; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
    .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .col-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
    .live-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; padding: 12px 14px; gap: 12px; }
    .nav { flex-direction: row; flex-wrap: wrap; }
    .help-box { display: none; }
    .page { padding: 18px 14px 40px; }
    .video-grid, .schedule-grid, .cta-grid, .detail-grid { grid-template-columns: minmax(0, 1fr); }
    .schedule-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; }
    .row-note { grid-column: 1 / -1; }
    .topbar { padding: 10px 14px; }
}

/* ------------------------------------------------------------- запис ефіру (Stage 14) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn-sm { padding: 7px 12px; font-size: 13.5px; border-radius: 10px; }
.btn.is-copied { color: var(--green); border-color: #bfe8d0; background: var(--green-50); }
.icon-btn-soft { width: 34px; height: 34px; border-color: transparent; background: var(--blue-50); color: var(--blue); }
.card + .card, .rec-picker-card + .card { margin-top: 18px; }

.rec-picker-card { display: flex; align-items: center; gap: 18px; padding: 14px 18px; }
.rec-picker-card > * + * { margin-top: 0; }
.rec-picker-label { font-weight: 750; font-size: 16px; white-space: nowrap; }
.rec-picker { position: relative; flex: 1 1 auto; min-width: 0; }
.rec-picker summary { list-style: none; display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px 8px 8px; cursor: pointer; background: #fff; }
.rec-picker summary::-webkit-details-marker { display: none; }
.rec-picker[open] summary, .rec-picker summary:hover { border-color: var(--blue-100); }
.rec-thumb { width: 68px; height: 40px; border-radius: 8px; background: linear-gradient(135deg, #0b1b3f, #1463ff); color: #fff; display: grid; place-items: center; flex: none; }
.rec-thumb svg { font-size: 20px; }
.rec-picker-text { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.rec-picker-text strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-picker-text small { color: var(--muted); font-size: 13px; }
.rec-chevron { color: var(--blue); transition: transform .15s; }
.rec-picker[open] .rec-chevron { transform: rotate(180deg); }
.rec-options { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px rgba(11, 27, 63, .16); padding: 6px; max-height: 360px; overflow-y: auto; }
.rec-options a { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; color: var(--ink); text-decoration: none !important; }
.rec-options a:hover { background: var(--blue-50); }
.rec-options a.is-selected { background: var(--blue-100); }

.rec-card { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.rec-card > * + * { margin-top: 0; }
.rec-video video { width: 100%; aspect-ratio: 16 / 9; background: #0b1b3f; border-radius: 12px; display: block; }
.rec-info { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rec-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rec-title-row h2 { font-size: 20px; }
.rec-status { margin-left: auto; }
.rec-status svg { font-size: 15px; }
.rec-facts { list-style: none; display: flex; flex-direction: column; gap: 9px; font-size: 15px; }
.rec-facts li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rec-facts li svg { color: var(--muted); font-size: 18px; align-self: center; }
.rec-facts span { color: var(--muted); }
.rec-facts small { color: var(--muted); }
.rec-file { word-break: break-all; }
.rec-action { justify-content: flex-start; padding: 13px 16px; }
.rec-action span { flex: 1 1 auto; text-align: left; }
.btn-secondary.rec-action { background: var(--blue-50); border-color: var(--blue-100); color: var(--ink); }
.btn-secondary.rec-action svg { color: var(--blue); }

.period-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.period-form input[type=date] { width: auto; min-height: 40px; padding: 7px 10px; }
.period-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 14px; }
.period-label svg { color: var(--blue); }
.period-dash { color: var(--muted); }

.replay-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.rkpi { border-radius: 14px; padding: 14px; display: flex; gap: 12px; align-items: flex-start; }
.rkpi > svg { font-size: 30px; margin-top: 2px; }
.rkpi b { display: block; font-size: 28px; line-height: 1.1; }
.rkpi span { display: block; font-size: 14px; color: var(--ink); margin-top: 2px; }
.rkpi small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.rkpi-blue { background: #eef4ff; } .rkpi-blue > svg { color: var(--blue); }
.rkpi-green { background: #e9f8f0; } .rkpi-green > svg { color: var(--green); }
.rkpi-sky { background: #eaf3ff; } .rkpi-sky > svg { color: #1f7aff; }
.rkpi-violet { background: #f3eefe; } .rkpi-violet > svg { color: #7c3aed; }
.rkpi-amber { background: #fff7e2; } .rkpi-amber > svg { color: #e4a400; }

.replay-table { min-width: 980px; }
.replay-table tr.is-new td { background: var(--green-50); }
.replay-table .col-num { color: var(--muted); width: 36px; }
.row-menu { position: relative; }
.row-menu summary { list-style: none; width: 36px; height: 36px; }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 15; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(11, 27, 63, .14); padding: 4px; min-width: 200px; }
.row-menu-list button { width: 100%; text-align: left; border: none; background: none; font: inherit; padding: 9px 12px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.row-menu-list button:hover { background: var(--blue-50); }
#created-url { font-size: 14px; }
.empty-block > svg { font-size: 40px; color: var(--muted); }

@media (max-width: 1500px) {
    .replay-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
    .rec-card { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
    .rec-picker-card { flex-direction: column; align-items: stretch; gap: 8px; }
    .rec-thumb { width: 56px; height: 36px; }
    .replay-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rkpi b { font-size: 24px; }
    .rec-action { white-space: normal; }
    .rec-title-row h2 { font-size: 18px; }
    .rec-status { margin-left: 0; }
    .rkpi { padding: 12px 10px; gap: 8px; }
    .rkpi > svg { font-size: 24px; }
    .rkpi span { font-size: 13px; }
    .rkpi small { font-size: 11.5px; }
    .period-form { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; }
    .period-form input[type=date] { width: 100%; }
    .period-label, .period-form .btn { grid-column: 1 / -1; }
    .period-form .btn { width: 100%; }
    /* Таблиця → картки: широка таблиця на телефоні нечитабельна. */
    .replay-table-wrap { border: none; overflow: visible; }
    .replay-table { min-width: 0; }
    .replay-table thead { display: none; }
    .replay-table, .replay-table tbody, .replay-table tr, .replay-table td { display: block; width: 100%; }
    .replay-table tr { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
    .replay-table td { border: none; padding: 3px 0; display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 13.5px; }
    .replay-table td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; }
    .replay-table td.col-num { display: none; }
    .replay-table td.col-name, .replay-table td.col-actions, .replay-table td.empty-row { grid-column: 1 / -1; }
    .replay-table td.col-name::before, .replay-table td.col-actions::before, .replay-table td.empty-row::before { content: none; }
    .replay-table td.col-actions .row-actions { width: 100%; }
    .replay-table td.col-actions .js-copy-link { flex: 1 1 auto; }
    .replay-table tr:hover { background: none; }
}
