/* Панель управления CPBPA - веб-кабинет для компьютера.
   Палитра та же, что у приложения и сайта клуба (public/style.css), но файл
   самостоятельный: панель живёт на своём домене, корень сайта там - эта папка. */

:root {
  --navy: 0 19 34;
  --surface: 15 33 45;
  --teal: 3 140 147;
  --teal-bright: 2 172 178;
  --steel: 148 163 184;

  --bg: rgb(var(--navy));
  --card: rgb(var(--surface));
  --accent: rgb(var(--teal));
  --accent-bright: rgb(var(--teal-bright));
  --text: rgb(226 236 242);
  --heading: rgb(247 250 252);
  --muted: rgb(var(--steel));
  --line: rgb(var(--steel) / 22%);
  --ok: #2f9e44;
  --bad: #e5484d;
  --warn: #e0a82e;
  --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }
body {
  min-height: 100vh;
  font: 15px/1.45 "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent-bright); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; color: var(--heading); font-weight: 600; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }

/* --- кнопки и поля --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 14px;
  font: inherit; font-size: 14px; font-weight: 600;
  color: var(--heading); background: transparent;
  border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn--primary { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); }
.btn--danger { color: var(--bad); border-color: var(--bad); }
.btn--link { min-height: 0; padding: 4px 2px; font-weight: 500; color: var(--accent-bright); border: 0; }
.btn--small { min-height: 30px; padding: 0 10px; font-size: 13px; font-weight: 500; }
.btn--wide { width: 100%; }

.field { display: block; margin-bottom: 14px; min-width: 0; }
.field__label { display: block; margin-bottom: 5px; font-size: 13px; color: var(--muted); }
.field__hint { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px;
  font: inherit; color: var(--heading);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); }
.textarea { resize: vertical; min-height: 70px; }
.input--code { font-size: 26px; letter-spacing: .35em; text-align: center; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

.grid { display: grid; gap: 0 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid__wide { grid-column: 1 / -1; }

/* --- вход --- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login__card { width: 100%; max-width: 400px; padding: 28px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.login__brand { margin: 0 0 4px; font-size: 13px; letter-spacing: .14em; color: var(--accent-bright); }
.login__title { margin-bottom: 20px; }
.login__note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.login__error { margin: 14px 0 0; padding: 10px 12px; font-size: 14px; color: var(--heading); border: 1px solid var(--bad); border-radius: var(--radius); }
.login__form .btn--link { display: block; margin: 10px auto 0; }

/* --- каркас --- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--line);
}
.top__brand { font-weight: 600; color: var(--heading); }
.top__nav { display: flex; gap: 4px; flex: 1; }
.top__nav a { padding: 6px 12px; color: var(--muted); border-radius: 8px; }
.top__nav a:hover { color: var(--heading); text-decoration: none; }
.top__nav a.is-on { color: var(--heading); background: rgb(var(--teal) / 18%); }
.top__user { font-size: 13px; color: var(--muted); }

.main { max-width: 1240px; margin: 0 auto; padding: 24px; }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.head h1 { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.crumb { margin: 0 0 8px; font-size: 13px; }
.sub { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.panel { padding: 18px; margin-bottom: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.panel > h2 { margin-bottom: 14px; }
.empty { padding: 26px; text-align: center; color: var(--muted); }
.state { padding: 10px 12px; margin: 0 0 14px; font-size: 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.state--ok { border-color: var(--ok); }
.state--bad { border-color: var(--bad); }

/* --- вкладки --- */
.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { padding: 10px 14px; font: inherit; font-size: 14px; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--heading); }
.tab.is-on { color: var(--heading); border-bottom-color: var(--accent); }

/* --- таблицы --- */
.tools { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.tools .input, .tools .select { width: auto; min-width: 220px; }
.tools__grow { flex: 1; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.is-link { cursor: pointer; }
tbody tr.is-link:hover { background: rgb(var(--teal) / 8%); }
tr.is-muted td { color: var(--muted); }
td.num, th.num { text-align: right; white-space: nowrap; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn { margin-left: 6px; }
.small { font-size: 12px; color: var(--muted); }

.pill { display: inline-block; padding: 1px 8px; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.pill--ok { color: var(--ok); border-color: var(--ok); }
.pill--bad { color: var(--bad); border-color: var(--bad); }
.pill--warn { color: var(--warn); border-color: var(--warn); }

/* --- показатели --- */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }
.stat { padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.stat__label { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.stat__value { margin-top: 4px; font-size: 24px; font-weight: 600; color: var(--heading); }
.stat__note { font-size: 12px; color: var(--muted); }

/* --- повторяющиеся блоки формы (спикеры, программа...) --- */
.rep { margin-bottom: 16px; }
.rep__title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.rep__row { display: grid; gap: 8px; align-items: start; margin-bottom: 8px; }
.rep__row--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; }
.rep__row--3 { grid-template-columns: minmax(0, .5fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; }
.rep__del { min-height: 38px; padding: 0 10px; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.rep__del:hover { color: var(--bad); border-color: var(--bad); }

/* --- фото --- */
.cover { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.cover__img { width: 320px; max-width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); }
.shots { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.shot { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot__del { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; color: #fff; background: rgb(0 0 0 / 60%); border: 0; border-radius: 50%; cursor: pointer; }
.shot__del:hover { background: var(--bad); }
.drop { padding: 18px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* --- вход по билету --- */
.checkin { max-width: 560px; }
.found { padding: 16px; margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.found__name { margin: 0; font-size: 20px; font-weight: 600; color: var(--heading); }

/* --- уведомление --- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50;
  max-width: calc(100% - 32px); padding: 10px 16px;
  color: var(--heading); background: var(--card); border: 1px solid var(--accent); border-radius: var(--radius);
  box-shadow: 0 8px 28px rgb(0 0 0 / 40%);
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-bad { border-color: var(--bad); }

@media (max-width: 760px) {
  .top { flex-wrap: wrap; gap: 8px 14px; padding: 10px 14px; }
  .top__nav { order: 3; flex-basis: 100%; }
  .main { padding: 14px; }
  .grid, .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .rep__row--2, .rep__row--3 { grid-template-columns: minmax(0, 1fr); }
  .tools .input, .tools .select { width: 100%; min-width: 0; }
}

@media print {
  .top, .tabs, .tools, .btn, .toast { display: none !important; }
  body { color: #000; background: #fff; }
  .table-wrap, .panel, .stat { border-color: #999; background: #fff; }
  th, td, h1, h2, .stat__value { color: #000; }
}
