/* Admin console — shares tokens with app.css, denser layout, mono data */
.admin { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.admin-side { position: sticky; top: 0; height: 100vh; padding: 22px 14px; display: flex; flex-direction: column; gap: 6px; }
.admin-side .brand { padding: 0 10px 20px; }
.admin-main { padding: 28px clamp(18px, 4vw, 48px); max-width: 1200px; }

.admin-h { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.admin-sub { color: var(--muted); margin-bottom: 26px; font-size: 0.92rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat { padding: 18px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); position: relative; overflow: hidden; animation: fade-up .5s var(--spring) both; }
.stat::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--aurora); opacity: .8; }
.stat b { font-family: 'JetBrains Mono', monospace; font-size: 1.7rem; display: block; }
.stat span { color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.stat.warn::before { background: var(--danger); }

.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 26px; }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px; }
.chart-card h4 { font-family: var(--font-display); font-size: 0.92rem; margin-bottom: 12px; }
.chart-card svg { width: 100%; height: auto; display: block; }
.chart-line { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.chart-fill { opacity: 0.18; }
.chart-axis { font-size: 9px; fill: var(--muted); font-family: 'JetBrains Mono', monospace; }

.admin-toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.admin-toolbar input, .admin-toolbar select {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 10px 14px; font-size: 0.92rem; color: var(--text);
}
.admin-toolbar input { flex: 1; min-width: 200px; }
.admin-toolbar input:focus, .admin-toolbar select:focus { outline: none; border-color: var(--accent); }

.atable { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; font-size: 0.88rem; }
.atable-wrap { overflow-x: auto; border-radius: var(--r-md); }
.atable th { text-align: left; padding: 12px 14px; color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--border); white-space: nowrap; }
.atable td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.atable tr:last-child td { border-bottom: none; }
.atable tr { transition: background 0.15s; }
.atable tbody tr:hover { background: var(--surface2); }
.atable .mono { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; color: var(--muted); }
.atable .avatar { width: 32px; height: 32px; font-size: 0.72rem; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user .cu { line-height: 1.25; }
.cell-user .cu small { color: var(--muted); display: block; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.pill.ok { background: rgba(52, 211, 153, 0.14); color: var(--ok); }
.pill.bad { background: rgba(248, 113, 113, 0.14); color: var(--danger); }
.pill.info { background: rgba(139, 92, 246, 0.14); color: var(--accent); }
.pill.dim { background: var(--surface2); color: var(--muted); }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions .btn-sm { padding: 5px 11px; font-size: 0.78rem; }

.ctrl-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 22px; margin-bottom: 16px; }
.ctrl-card h4 { font-family: var(--font-display); margin-bottom: 6px; }
.ctrl-card .desc { color: var(--muted); font-size: 0.88rem; margin-bottom: 14px; }
.flag-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.flag-row:last-child { border-bottom: none; }
.flag-row .fl b { display: block; font-size: 0.95rem; }
.flag-row .fl span { color: var(--muted); font-size: 0.82rem; }

.switch { position: relative; width: 48px; height: 27px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; cursor: pointer; z-index: 2; margin: 0; }
.switch .track { position: absolute; inset: 0; background: var(--surface3); border-radius: 999px; transition: background 0.25s; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; background: #fff; border-radius: 50%; transition: transform 0.25s var(--spring); box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--aurora); }
.switch input:checked + .track::after { transform: translateX(21px); }

.report-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px; margin-bottom: 12px; animation: fade-up .4s var(--spring) both; }
.report-card .rc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.report-card .rc-target { background: var(--surface2); border-radius: var(--r-sm); padding: 12px; font-size: 0.9rem; margin: 10px 0; border-left: 3px solid var(--accent); }
.report-card .rc-reason { color: var(--muted); font-size: 0.9rem; }

.top-post { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.top-post:last-child { border-bottom: none; }
.top-post .n { font-family: 'JetBrains Mono', monospace; color: var(--muted); }
.top-post .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pager { display: flex; gap: 8px; align-items: center; margin-top: 14px; color: var(--muted); font-size: 0.88rem; }

/* horizontal bars (reaction breakdown) */
.hbar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.hbar-label { width: 28px; text-align: center; font-size: 1rem; }
.hbar { flex: 1; height: 10px; background: var(--surface2); border-radius: 6px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--aurora); border-radius: 6px; transition: width 0.6s var(--spring); }
.hbar-n { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: var(--muted); min-width: 34px; text-align: right; }

.vbadge { filter: drop-shadow(0 1px 3px rgba(139, 92, 246, 0.45)); }
.report-card .avatar { width: 40px; height: 40px; }

@media (max-width: 900px) {
  .admin { grid-template-columns: 74px 1fr; }
  .admin-side .brand-name, .admin-side .nav-item { font-size: 0; gap: 0; justify-content: center; }
  .admin-side .nav-item .ni { font-size: 1.25rem; }
  .admin-side .nav-item .badge { font-size: 0.62rem; right: 4px; top: 2px; min-width: 16px; height: 16px; }
}

@media (max-width: 600px) {
  .admin { grid-template-columns: 58px 1fr; }
  .admin-side { padding: 14px 6px; }
  .admin-main { padding: 18px 10px; }
  .admin-h { font-size: 1.3rem; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)); gap: 10px; }
  .stat { padding: 12px; }
  .stat b { font-size: 1.25rem; }
  .row-actions .btn-sm { padding: 4px 8px; font-size: 0.72rem; }
  .atable th, .atable td { padding: 8px 10px; }
  .chart-grid { grid-template-columns: 1fr; }
}
