/* Админка «Флэйм Падел». Цвета/шрифты — из brand/tokens.css (--fp-*). */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.fp { display: flex; min-height: 100vh; }

/* ── боковое меню ── */
.side {
  width: 232px; flex: 0 0 232px; background: var(--fp-navy); color: #fff;
  display: flex; flex-direction: column; padding: 20px 0;
}
.brand { padding: 0 22px 18px; }
.brand-title { font-family: var(--fp-font-display); font-size: 20px; letter-spacing: .5px; }
.brand-title .fl { color: var(--fp-accent); }
.brand-sub { color: var(--fp-lavender); font-size: 11px; margin-top: 2px; }
#nav { display: flex; flex-direction: column; margin-top: 6px; }
.nav-item {
  padding: 11px 22px; color: #b9bcdd; font-size: 13.5px; cursor: pointer;
  border-left: 3px solid transparent; user-select: none;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.active { color: #fff; background: #2a3160; border-left-color: var(--fp-accent); font-weight: 600; }
.side-foot { margin-top: auto; padding: 16px 22px 0; border-top: 1px solid rgba(255,255,255,.08); }
.whoami { font-size: 11px; color: var(--fp-lavender); margin-bottom: 6px; }
.link { background: none; border: none; color: var(--fp-accent); cursor: pointer; font: inherit; font-size: 12px; padding: 0; }

/* ── основное ── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 22px 28px 14px; border-bottom: 1px solid var(--fp-border);
}
.topbar h1 { margin: 0; font-size: 24px; }
.sub { color: var(--fp-ink-muted); font-size: 12.5px; margin-top: 4px; }
.badge {
  background: var(--fp-accent-soft); color: var(--fp-accent-dark);
  font-size: 11px; font-weight: 600; padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.badge.live { background: #E3F4EA; color: var(--fp-success); }
.view { padding: 18px 28px 32px; overflow: auto; }

/* ── фильтры ── */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select, .filters input {
  border: 1px solid var(--fp-border); background: var(--fp-surface);
  border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 12.5px; color: var(--fp-ink);
}

/* ── раскладка «сессии + панель» ── */
.split { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 20px; align-items: start; }
.split > div { min-width: 0; }                 /* даём 1fr-колонке право сжиматься */
.tablewrap { overflow-x: auto; border-radius: 12px; }
/* панель уходит под список, пока места мало (в т.ч. в узкой панели превью) */
@media (max-width: 1200px) { .split { grid-template-columns: 1fr; } .panel { position: static; } }

table.sessions { width: 100%; min-width: 560px; border-collapse: collapse; background: var(--fp-surface); border-radius: 12px; overflow: hidden; }
table.sessions th {
  text-align: left; font-size: 11.5px; color: var(--fp-navy); background: #f0ede3;
  padding: 10px 12px; font-weight: 700; white-space: nowrap;
}
table.sessions td { padding: 11px 12px; border-top: 1px solid #f0ede3; font-size: 13px; white-space: nowrap; }
table.sessions td.players { white-space: normal; }   /* игроки могут переноситься */
table.sessions tr { cursor: pointer; }
table.sessions tr:hover td { background: #faf9f4; }
table.sessions tr.sel td { background: var(--fp-accent-soft); }
.score { font-weight: 700; color: var(--fp-navy); }
.vid { color: var(--fp-accent-dark); font-weight: 600; }
.vid.no { color: var(--fp-lavender); font-weight: 400; }
.court-badge { font-weight: 700; }

/* ── правая панель сессии ── */
.panel { background: var(--fp-navy); color: #fff; border-radius: 14px; padding: 16px; position: sticky; top: 8px; }
.panel h3 { margin: 0 0 2px; font-size: 14px; }
.panel .p-sub { color: var(--fp-lavender); font-size: 11px; margin-bottom: 12px; }
.player { position: relative; background: #0c1030; border-radius: 10px; overflow: hidden; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; }
.player video { width: 100%; height: 100%; object-fit: cover; display: block; }
.player .ph { color: var(--fp-lavender); font-size: 12px; text-align: center; padding: 0 16px; }
.p-btns { display: flex; gap: 6px; margin: 12px 0; }
.p-btns button { flex: 1; background: #2a3160; color: #cfd2ea; border: none; border-radius: 7px; padding: 8px 0; font: inherit; font-size: 11px; cursor: pointer; }
.p-btns button:hover { background: #343c72; }
.stat-row { display: flex; justify-content: space-between; font-size: 12px; padding: 5px 0; border-top: 1px solid rgba(255,255,255,.07); }
.stat-row .k { color: var(--fp-lavender); }
.stat-row .v { font-weight: 700; }
.panel .accent-btn { display: block; width: 100%; margin-top: 14px; background: var(--fp-accent); color: #fff; border: none; border-radius: 10px; padding: 11px; font: inherit; font-weight: 700; cursor: pointer; }
.accent-btn { display: inline-block; background: var(--fp-accent); color: #fff; border: none; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.accent-btn:hover { filter: brightness(1.05); }

/* ── формы настроек ── */
.frow { display: grid; grid-template-columns: 180px 1fr; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.frow label { color: var(--fp-ink-muted); font-size: 12.5px; }
.frow input, .view select { border: 1px solid var(--fp-border); border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 13px; color: var(--fp-ink); background: var(--fp-surface); max-width: 420px; }
@media (max-width: 640px) { .frow { grid-template-columns: 1fr; } }

.team-h { color: #fff; font-weight: 700; font-size: 12px; margin: 12px 0 4px; }
.team-p { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 3px 0; color: #cfd2ea; }
.team-p .tp-x { color: var(--fp-lavender); white-space: nowrap; }
.onec code, .view code { background: #f0ede3; border-radius: 5px; padding: 2px 6px; font-size: 12px; }
.empty { color: var(--fp-ink-muted); padding: 40px; text-align: center; }
.panel-empty { color: var(--fp-lavender); text-align: center; padding: 40px 12px; font-size: 12.5px; }

/* ── клиенты / плитки обзора ── */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.tile { background: var(--fp-surface); border: 1px solid var(--fp-border); border-radius: 14px; padding: 16px; }
.tile .t-val { font-family: var(--fp-font-display); font-size: 28px; color: var(--fp-navy); }
.tile .t-lab { color: var(--fp-ink-muted); font-size: 12px; margin-top: 4px; }
table.clients { width: 100%; border-collapse: collapse; background: var(--fp-surface); border-radius: 12px; overflow: hidden; }
table.clients th { text-align: left; font-size: 11.5px; color: var(--fp-navy); background: #f0ede3; padding: 10px 12px; }
table.clients td { padding: 10px 12px; border-top: 1px solid #f0ede3; font-size: 13px; }
.lvl { display: inline-block; min-width: 20px; text-align: center; padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; color: #fff; }
.stub { color: var(--fp-ink-muted); background: var(--fp-surface); border: 1px dashed var(--fp-border); border-radius: 14px; padding: 28px; }

/* ── диалог входа ── */
.modal-bg { position: fixed; inset: 0; background: rgba(27,33,76,.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: var(--fp-surface); border-radius: 16px; padding: 24px; width: 420px; max-width: 92vw; }
.modal h2 { margin: 0 0 6px; font-family: var(--fp-font-display); color: var(--fp-navy); }
.modal p { color: var(--fp-ink-muted); font-size: 12.5px; margin: 0 0 14px; }
.modal input { width: 100%; border: 1px solid var(--fp-border); border-radius: 10px; padding: 10px 12px; font: inherit; margin-bottom: 10px; }
.modal .row { display: flex; gap: 8px; }
.modal .accent-btn { background: var(--fp-accent); color: #fff; border: none; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.modal .ghost { background: none; border: 1px solid var(--fp-border); border-radius: 10px; padding: 10px 16px; font: inherit; cursor: pointer; color: var(--fp-ink); }

/* ── перелинковка ── */
a.lnk { color: var(--fp-accent-dark); text-decoration: none; border-bottom: 1px dotted rgba(192,80,28,.45); }
a.lnk:hover { color: var(--fp-accent); border-bottom-style: solid; }
a.lnk.lnk-light { color: #fff; border-bottom-color: rgba(255,255,255,.35); }
a.lnk.lnk-light:hover { color: var(--fp-coral-light); }
a.link { color: var(--fp-accent); text-decoration: none; font-size: 12px; }
table tr[style*="cursor: pointer"]:hover td, table tr[style*="cursor:pointer"]:hover td { background: #faf9f4; }
.ghost-btn { background: var(--fp-surface); color: var(--fp-ink); border: 1px solid var(--fp-border); border-radius: 10px; padding: 8px 14px; font: inherit; font-size: 12.5px; cursor: pointer; }
.ghost-btn:hover { border-color: var(--fp-accent); color: var(--fp-accent-dark); }

/* ── формы действий ── */
.modal .fl { display: block; font-size: 12px; color: var(--fp-ink-muted); margin: 8px 0 4px; }
.modal select { width: 100%; border: 1px solid var(--fp-border); border-radius: 10px; padding: 10px 12px; font: inherit; background: var(--fp-surface); color: var(--fp-ink); margin-bottom: 4px; }
.modal input[type=date], .modal input[type=time], .modal input[type=number] { margin-bottom: 4px; }
.optlist { position: absolute; left: 0; right: 0; top: 100%; background: var(--fp-surface); border: 1px solid var(--fp-border); border-radius: 10px; box-shadow: 0 8px 24px rgba(27,33,76,.12); z-index: 5; max-height: 220px; overflow: auto; }
.optlist:empty { display: none; }
.optlist .opt { padding: 8px 12px; font-size: 13px; cursor: pointer; }
.optlist .opt:hover { background: var(--fp-accent-soft); }
.modal .row { display: flex; gap: 8px; margin-top: 6px; }
