/* Общие стили админ-приложения: вкладки, строки, штрафы, модалки. */

.demo-banner {
  max-width: 920px;
  margin: 14px auto 0;
  padding: 10px 16px;
  background: rgba(255, 180, 84, 0.12);
  border: 1px solid rgba(255, 180, 84, 0.35);
  color: var(--warning);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.4;
}
.demo-banner b { color: var(--warning); }
@media (max-width: 960px) { .demo-banner { margin: 14px 20px 0; } }

/* ------------------------------------------------------------- вкладки */
.tabs {
  max-width: 920px;
  margin: 0 auto 20px;
  padding: 0 20px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab {
  flex: 0 0 auto;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.tab:hover { color: var(--text); }
.tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #06101e;
}
.tab-badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.tab.is-active .tab-badge { background: #06101e; color: var(--accent); }

.subtabs {
  display: flex;
  gap: 6px;
  margin: 16px 0 4px;
  overflow-x: auto;
}
.subtab {
  flex: 0 0 auto;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.subtab.is-active {
  background: var(--surface-3);
  border-color: var(--border);
  color: var(--text);
}

.search.compact { width: auto; max-width: 190px; padding: 9px 12px; font-size: 14px; }
.mt12 { margin-top: 12px; }
.code-inline {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  letter-spacing: 0.08em;
  color: var(--accent);
}

/* ----------------------------------------------------------- перекличка */
.rollcall, .people-list, .fines-list, .pending-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.row-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.row-card.is-on {
  border-color: rgba(92, 219, 149, 0.35);
  background: rgba(92, 219, 149, 0.07);
}
.row-card.is-off { opacity: 0.75; }
.row-card.is-dropped { opacity: 0.5; }

.av {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: var(--accent);
}
.row-main { flex: 1 1 auto; min-width: 0; }
.row-name {
  font-weight: 600;
  font-size: 15px;
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.row-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.row-actions { display: flex; gap: 6px; flex: 0 0 auto; }

.note-chip {
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(79, 140, 255, 0.14);
  border: 1px solid rgba(79, 140, 255, 0.3);
  color: var(--accent-2);
  cursor: pointer;
}
.note-chip.empty {
  background: transparent;
  border-style: dashed;
  border-color: var(--border);
  color: var(--muted);
}

.pill {
  font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}
.pill-self { background: rgba(92,219,149,.14); border-color: rgba(92,219,149,.4); color: var(--success); }
.pill-manual { background: rgba(79,140,255,.14); border-color: rgba(79,140,255,.4); color: var(--accent-2); }
.pill-excused { background: rgba(255,180,84,.14); border-color: rgba(255,180,84,.4); color: var(--warning); }
.pill-debt { background: rgba(255,107,107,.14); border-color: rgba(255,107,107,.4); color: var(--danger); }

/* ---------------------------------------------------------------- штрафы */
.fine-card {
  padding: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}
.fine-top {
  display: flex; align-items: flex-start; gap: 12px;
  justify-content: space-between;
}
.fine-amt {
  font-size: 20px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--danger); white-space: nowrap;
}
.fine-amt.paid { color: var(--success); }
.fine-amt.void { color: var(--muted); text-decoration: line-through; }
.fine-reason { font-size: 13px; color: var(--muted); margin-top: 3px; }
.fine-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* Заглушка скриншота перевода — рисуем, чтобы не тащить картинку. */
.shot {
  margin-top: 10px;
  width: 150px;
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, #1d2438, #161c2c);
  border: 1px solid var(--border);
}
.shot.mini { width: 120px; padding: 10px; }
.shot-line {
  height: 6px; border-radius: 3px;
  background: rgba(255,255,255,.12);
  margin-bottom: 7px;
}
.shot-line.w70 { width: 70%; } .shot-line.w60 { width: 60%; } .shot-line.w40 { width: 40%; }
.shot-amt {
  margin-top: 8px; font-size: 15px; font-weight: 800; color: var(--danger);
}

/* ------------------------------------------------------------- бот-чат */
.chat { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.msg {
  max-width: 82%;
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
}
.msg.bot {
  align-self: flex-start;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
}
.msg.user {
  align-self: flex-end;
  background: rgba(79, 140, 255, 0.16);
  border: 1px solid rgba(79, 140, 255, 0.35);
  border-bottom-right-radius: 5px;
}
.msg-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.msg-btn {
  font-size: 12.5px; font-weight: 600;
  padding: 6px 10px; border-radius: 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  color: var(--text);
}
.msg-btn.ok { background: rgba(92,219,149,.14); border-color: rgba(92,219,149,.4); color: var(--success); }
.msg-btn.no { background: rgba(255,107,107,.12); border-color: rgba(255,107,107,.35); color: var(--danger); }

/* ------------------------------------------------------------- модалка */
.modal-wrap {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(4, 7, 15, 0.72);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease both;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal {
  width: 100%; max-width: 420px;
  max-height: 88vh; overflow-y: auto;
  margin: 0;
}
.modal .hero-top { margin-bottom: 14px; }

.toast {
  position: fixed;
  left: 50%; bottom: 26px;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--surface-3);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  animation: toastIn 0.2s ease both;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.empty-row {
  padding: 22px;
  text-align: center;
  color: var(--muted);
  font-style: italic;
  font-size: 14px;
}
.muted-block { opacity: 0.85; }

@media (max-width: 640px) {
  .row-card { flex-wrap: wrap; }
  .row-actions { width: 100%; justify-content: flex-end; }
  .search.compact { max-width: 130px; }
  .msg { max-width: 92%; }
}

/* Подсказка «привяжи Telegram» в кабинете. */
.link-note {
  max-width: 920px;
  margin: 0 auto 18px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: rgba(79, 140, 255, 0.10);
  border: 1px solid rgba(79, 140, 255, 0.32);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.45;
}
.link-note > div { flex: 1 1 260px; }
@media (max-width: 960px) { .link-note { margin: 0 20px 18px; } }

/* Плитки сводных чисел на экране супер-админа. */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.kpi {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.kpi-num {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}
.kpi-num.accent { color: var(--accent); }
.kpi-num.danger { color: var(--danger); }
.kpi-num.success { color: var(--success); }
.kpi-num.warn { color: var(--warning); }
.kpi-label {
  margin-top: 5px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.table tbody tr.clickable { cursor: pointer; }
