/* Admin page — uses tokens from academy.css */
:root { --line: rgba(255,255,255,.08); --muted: rgba(255,255,255,.6); --red: #e5484d; }

.loader--page { margin: 120px auto; }
.msg--page { max-width: 600px; margin: 120px auto; }

.adm-top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 20px;
  padding: 16px 40px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.adm-top__back { color: var(--muted); text-decoration: none; font-size: 16px; }
.adm-top__back:hover { color: #f9e36d; }
.adm-top__title { margin: 0; font-size: 24px; font-weight: 800; }
.adm-top__count { margin-inline-start: auto; color: var(--muted); font-size: 16px; }

.adm { max-width: 1200px; margin: 0 auto; padding: 32px 40px 80px; display: grid; gap: 28px; }

.panel { padding: 4px; border-radius: var(--radius); background: var(--gold); }
.panel__in { background: var(--card); border-radius: calc(var(--radius) - 2px); }

.panel__title { margin: 0; padding: 20px 24px 8px; font-size: 22px; font-weight: 800; }
.panel__head { display: flex; align-items: center; gap: 16px; padding: 12px 24px 8px 24px; }
.panel__head .panel__title { padding: 8px 0; }

/* Form */
.add {
  display: grid;
  grid-template-columns: 1.3fr 1fr auto;
  gap: 16px 20px;
  padding: 12px 24px 8px;
  align-items: end;
}
.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > span, .field legend { font-size: 15px; color: var(--muted); padding: 0; }
.field--courses { grid-column: 1 / -1; }

input[type="email"], input[type="text"], .search {
  height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: var(--white);
  color: var(--ink);
  font: 400 18px "Assistant", sans-serif;
  width: 100%;
}
input:focus-visible, .search:focus-visible { outline: none; border-color: #f9e36d; }
input[type="email"] { text-align: left; }
.search { max-width: 320px; margin-inline-start: auto; height: 42px; font-size: 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow: inset 0 -1px 3px rgba(255,255,255,.4);
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.chip input:checked + span { background: var(--gold); color: var(--ink); box-shadow: none; }
.chip input:focus-visible + span { outline: 2px solid #f9e36d; outline-offset: 2px; }
.chip--sm span { padding: 4px 12px; font-size: 14px; }

.btn-gold, .btn-ghost, .btn-danger {
  height: 46px;
  padding: 0 28px;
  border-radius: var(--radius);
  font: 800 18px "Assistant", sans-serif;
  cursor: pointer;
  border: 0;
}
.btn-gold { background: var(--gold); color: var(--ink); border: 1px solid #c3a158; justify-self: start; }
.btn-gold:hover { filter: brightness(1.06); }
.btn-gold[disabled] { opacity: .6; cursor: wait; }
.btn-ghost { background: var(--bg); color: var(--white); box-shadow: inset 0 -1px 3px rgba(255,255,255,.5); }
.btn-danger { background: var(--red); color: var(--white); }

.note { margin: 0; padding: 4px 24px 20px; min-height: 28px; font-size: 16px; color: #f9e36d; }
.note.is-error { color: #ff8a8d; }

/* Table */
.table-wrap { padding: 4px 24px 20px; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 16px; }
.tbl th {
  text-align: right;
  font-weight: 700;
  color: var(--muted);
  font-size: 14px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.is-blocked td { opacity: .5; }
.tbl tr.is-blocked td:last-child, .tbl tr.is-blocked td:nth-child(4) { opacity: 1; }

.who__name { font-weight: 700; }
.who__email { color: var(--muted); font-size: 14px; direction: ltr; text-align: right; }
.when { white-space: nowrap; color: var(--muted); font-size: 15px; }

.cp { display: grid; gap: 8px; min-width: 260px; }
.cp__row { display: flex; align-items: center; gap: 10px; }
.cp__bar { flex: 1; height: 6px; border-radius: 6px; background: var(--bg); overflow: hidden; min-width: 60px; }
.cp__bar span { display: block; height: 100%; background: var(--gold); }
.cp__num { font-size: 13px; color: var(--muted); white-space: nowrap; min-width: 42px; }

.badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.badge--ok { background: rgba(249, 227, 109, .15); color: #f9e36d; }
.badge--off { background: rgba(229, 72, 77, .18); color: #ff8a8d; }
.badge--new { background: rgba(255,255,255,.08); color: var(--muted); }

.acts { display: flex; gap: 8px; justify-content: flex-end; }
.act {
  height: 34px; padding: 0 14px;
  border-radius: 12px; border: 0;
  background: var(--bg);
  box-shadow: inset 0 -1px 3px rgba(255,255,255,.4);
  color: var(--white);
  font: 700 14px "Assistant", sans-serif;
  cursor: pointer; white-space: nowrap;
}
.act:hover { background: var(--gold); color: var(--ink); }
.act--danger:hover { background: var(--red); color: var(--white); }

.empty { color: var(--muted); text-align: center; padding: 24px 0 8px; margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Dialog */
.dlg {
  border: 0; padding: 0; border-radius: var(--radius);
  background: var(--gold); color: var(--white);
  max-width: 440px; width: calc(100% - 32px);
}
.dlg form { margin: 4px; padding: 24px; border-radius: calc(var(--radius) - 2px); background: var(--card); }
.dlg p { margin: 0 0 20px; font-size: 18px; line-height: 1.5; }
.dlg__btns { display: flex; gap: 10px; justify-content: flex-end; }
.dlg::backdrop { background: rgba(0,0,0,.6); }

/* Mobile: rows become cards */
@media (max-width: 860px) {
  .adm-top { padding: 14px 16px; flex-wrap: wrap; gap: 6px 16px; }
  .adm-top__title { font-size: 20px; }
  .adm { padding: 16px 16px 60px; gap: 20px; }
  .add { grid-template-columns: 1fr; padding: 8px 16px; }
  .panel__title { padding: 16px 16px 6px; }
  .panel__head { flex-wrap: wrap; padding: 8px 16px; }
  .search { max-width: none; }
  .note { padding: 4px 16px 16px; }
  .table-wrap { padding: 0 16px 12px; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .tbl td { border: 0; padding: 4px 0; }
  .cp { min-width: 0; }
  .acts { justify-content: flex-start; padding-top: 8px; }
}

.cp__name { font-size: 14px; font-weight: 700; min-width: 130px; white-space: nowrap; }

/* View log dialog */
.dlg--log { max-width: 760px; }
.log__title { margin: 0 0 14px; font-size: 20px; font-weight: 800; }
.log__list { max-height: 60vh; overflow-y: auto; margin-bottom: 18px; }
.log__empty { color: var(--muted); margin: 0 0 8px; }
.tbl--log td { padding: 8px 10px; font-size: 15px; }
.tbl--log th { padding: 8px 10px; }
@media (max-width: 860px) {
  .tbl--log thead { display: table-header-group; }
  .tbl--log, .tbl--log tbody { display: table; width: 100%; }
  .tbl--log tr { display: table-row; padding: 0; }
  .tbl--log td { display: table-cell; width: auto; }
}
