:root {
  color-scheme: dark;
}

.admin-page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: #eceaf0;
  background:
    radial-gradient(60% 90% at 100% 0%, rgba(216, 255, 95, 0.05), transparent 60%),
    #0a0c12;
}

/* Top */
.a-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  padding: 20px 28px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.a-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.a-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--ink);
  background: var(--lime);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 900;
}

.a-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.a-brand-copy strong {
  font-size: 11.5px;
  letter-spacing: 0.1em;
}

.a-brand-copy small {
  color: #777f8e;
  font-size: 9px;
  letter-spacing: 0.16em;
}

.a-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.a-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #a5acb9;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.a-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  animation: a-pulse 2.4s ease-out infinite;
}

.a-live.is-offline i {
  background: var(--coral);
  animation: none;
}

.a-live.is-offline {
  color: #d89c8e;
}

.a-updated {
  color: #6f7787;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.a-btn {
  height: 31px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 9px;
  color: #c3c8d1;
  background: rgba(255, 255, 255, 0.03);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.a-btn:hover {
  color: var(--lime);
  border-color: rgba(216, 255, 95, 0.4);
}

.a-btn-primary {
  color: var(--ink);
  border-color: var(--lime);
  background: var(--lime);
  font-weight: 700;
}

.a-btn-primary:hover {
  color: var(--ink);
  background: #e4ff7a;
}

/* Layout */
.a-main {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Metrics */
.a-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.a-metric {
  padding: 18px 20px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.am-label {
  color: #777f8e;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.14em;
}

.a-metric strong {
  color: #f6f4ee;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.a-metric strong small {
  font-size: 18px;
}

.a-metric:first-child strong {
  color: var(--lime);
}

.am-unit {
  color: #5f6776;
  font-size: 9.5px;
  letter-spacing: 0.08em;
}

/* Panels */
.a-panels {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
}

.a-panel {
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-head h2 {
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.panel-head h2 small {
  margin-left: 8px;
  color: #6f7787;
  font-size: 10px;
  font-weight: 500;
}

.panel-sub {
  color: #5f6776;
  font-size: 9.5px;
}

/* Accuracy bars */
.acc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.acc-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) 118px;
  align-items: center;
  gap: 12px;
}

.acc-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.acc-n {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 19px;
  padding: 0 5px;
  border-radius: 5px;
  color: var(--ink);
  background: var(--lime);
  font-size: 9.5px;
  font-weight: 800;
}

.acc-tag {
  min-width: 0;
  overflow: hidden;
  color: #aab1bd;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acc-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.acc-fill {
  display: block;
  height: 100%;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(216, 255, 95, 0.4), var(--lime));
  transition: width 0.5s var(--ease-out);
}

.acc-fill.is-zero {
  background: rgba(255, 255, 255, 0.12);
}

.acc-num {
  color: #c3c8d1;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.acc-num b {
  color: var(--lime);
  font-size: 12px;
}

.acc-num .acc-answered {
  color: #6f7787;
  margin-left: 7px;
}

/* Ratio */
.ratio-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 4px;
}

.ratio-bar {
  height: 18px;
  display: flex;
  border-radius: 999px;
  background: rgba(255, 122, 89, 0.35);
  overflow: hidden;
}

.ratio-correct {
  display: block;
  height: 100%;
  width: 0;
  background: var(--lime);
  transition: width 0.55s var(--ease-out);
}

.ratio-legend {
  display: flex;
  gap: 22px;
  color: #aab1bd;
  font-size: 11px;
}

.ratio-legend li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.ratio-legend b {
  color: #f6f4ee;
  font-variant-numeric: tabular-nums;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-correct {
  background: var(--lime);
}

.dot-wrong {
  background: #ff7a59;
}

.ratio-note {
  color: #5f6776;
  font-size: 9.5px;
  line-height: 1.6;
}

/* Results */
.filter-row {
  align-items: center;
  flex-wrap: wrap;
}

.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filters input,
.filters select {
  height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 9px;
  color: #eceaf0;
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
}

.filters input {
  width: 170px;
}

.filters input::placeholder {
  color: #5f6776;
}

.filters select {
  min-width: 96px;
  color: #c3c8d1;
}

.filters :is(input, select):focus {
  outline: none;
  border-color: rgba(216, 255, 95, 0.55);
}

.table-wrap {
  max-height: 460px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 14px;
  text-align: left;
  color: #777f8e;
  background: #10131b;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

tbody td {
  padding: 9px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: #c3c8d1;
  white-space: nowrap;
}

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.028);
}

.td-q b {
  color: #f6f4ee;
}

.td-q span {
  color: #6f7787;
  margin-left: 6px;
  font-size: 10px;
}

.td-result {
  font-weight: 750;
}

.td-result.is-correct {
  color: var(--lime);
}

.td-result.is-wrong {
  color: #ff967f;
}

.td-duration {
  color: #8b93a3;
  font-variant-numeric: tabular-nums;
}

.td-time {
  color: #8b93a3;
  font-variant-numeric: tabular-nums;
}

.table-empty {
  padding: 26px 16px;
  color: #5f6776;
  font-size: 11px;
  text-align: center;
}

/* Footer */
.a-foot {
  padding: 14px 28px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: #4f5766;
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@keyframes a-pulse {
  0% { box-shadow: 0 0 0 0 rgba(216, 255, 95, 0.35); }
  60% { box-shadow: 0 0 0 7px rgba(216, 255, 95, 0); }
  100% { box-shadow: 0 0 0 0 rgba(216, 255, 95, 0); }
}

/* Responsive */
@media (max-width: 1080px) {
  .a-panels { grid-template-columns: 1fr; }
  .acc-row { grid-template-columns: 120px minmax(0, 1fr) 108px; }
}

@media (max-width: 700px) {
  .a-top { padding: 14px 16px 12px; }
  .a-updated { display: none; }
  .a-main { padding: 14px 16px 20px; gap: 14px; }
  .a-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .a-metric strong { font-size: 28px; }
  .acc-row { grid-template-columns: 96px minmax(0, 1fr); row-gap: 4px; }
  .acc-num { grid-column: 2; text-align: left; }
  .filters { width: 100%; }
  .filters input { flex: 1; width: auto; min-width: 0; }
  .a-foot { padding: 12px 16px 16px; font-size: 7.5px; }
}