/* Admin panel (admin.html): the studio's tokens from es.css, a plain scrolling page. External file: the CSP forbids inline styles. */
body.admin { height: auto; min-height: 100%; }
html:has(body.admin) { height: auto; }
.ad-wrap { max-width: 1180px; margin: 0 auto; padding: 18px 16px 80px; }
.ad-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.ad-brand { display: flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.ad-brand img { width: 28px; height: 28px; }
.ad-top-right { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.ad-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.ad-head h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.ad-period { margin: 6px 0 16px; font-size: 13px; }
.small { font-size: 13px; margin: 0 0 12px; }

.ad-seg { display: inline-flex; background: var(--tint-2); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.ad-seg button { padding: 7px 12px; border-radius: 9px; color: var(--ink-2); font-weight: 500; font-size: 13px; }
.ad-seg button:hover { color: var(--ink); }
.ad-seg button.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
[data-theme="dark"] .ad-seg button.active { background: var(--tint-3); }

.ad-btn { background: var(--primary); color: var(--primary-ink); border-radius: var(--r-ctl); padding: 9px 16px; font-weight: 600; white-space: nowrap; }
.ad-btn:disabled { opacity: .5; cursor: default; }
.ad-btn.ghost { background: var(--tint-2); color: var(--ink); font-weight: 500; padding: 6px 12px; }
.ad-btn.link { background: none; color: var(--accent); padding: 0; font-weight: 500; }
.ad-x { color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.ad-x:hover { color: var(--accent); background: var(--accent-soft); }

.ad-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; min-width: 0; }
.ad-card h2 { font-size: 16px; margin: 0 0 12px; }
.ad-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ad-card-head h2 { margin: 0; }
.ad-denied { max-width: 520px; margin: 80px auto; text-align: center; }
.ad-denied a { color: var(--accent); }
.ad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ad-grid .ad-card { margin-bottom: 16px; }

.ad-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; min-width: 0; }
.kpi .k-label { font-size: 12px; color: var(--muted); }
.kpi .k-value { font-size: 22px; font-weight: 650; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi .k-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi .up { color: var(--green); }
.kpi .down { color: var(--accent); }
.kpi.neg .k-value { color: var(--accent); }

.ad-legend { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.ad-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.sw.rev { background: var(--green); }
.sw.exp { background: var(--accent); }
.sw.pro { background: var(--ink); height: 3px; border-radius: 2px; width: 14px; }
.ad-chart { position: relative; width: 100%; }
.ad-chart svg { width: 100%; height: 280px; display: block; overflow: visible; stroke: none; }
.ad-chart .grid { stroke: var(--line); stroke-width: 1; }
.ad-chart .zero { stroke: var(--line-2); stroke-width: 1.5; }
.ad-chart .axis { fill: var(--muted); font-size: 11px; }
.ad-chart .bar-rev { fill: var(--green); }
.ad-chart .bar-exp { fill: var(--accent); }
.ad-chart .line-pro { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ad-chart .dot-pro { fill: var(--ink); }
.ad-chart .hit { fill: transparent; }
.ad-chart .hit:hover, .ad-chart .hit.on { fill: var(--tint-2); }
.ad-empty { color: var(--muted); padding: 40px 0; text-align: center; }
.ad-tip { position: fixed; z-index: 10; pointer-events: none; background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); border-radius: 12px; padding: 8px 12px; font-size: 12px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.ad-tip b { display: block; font-size: 12px; margin-bottom: 2px; }

.ad-rows { display: flex; flex-direction: column; gap: 8px; }
.ad-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 14px; }
.ad-row .ad-meter { grid-column: 1 / -1; height: 6px; border-radius: 4px; background: var(--tint-2); overflow: hidden; }
.ad-row .ad-meter i { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.ad-row .val { font-variant-numeric: tabular-nums; font-weight: 600; }

.ad-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.ad-filters input, .ad-filters select, .ad-legend select, .ad-form input, .ad-form select {
  background: var(--tint); border: 1px solid var(--line-2); border-radius: 10px; padding: 7px 10px; font-size: 13px; min-width: 0; }
.ad-filters input { width: 200px; }
.ad-table-wrap { overflow: auto; max-height: 560px; margin: 0 -4px; }
.ad-table thead th { position: sticky; top: 0; background: var(--card); z-index: 1; }
.ad-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ad-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ad-table th[data-sort] { cursor: pointer; user-select: none; }
.ad-table th[data-sort]:hover { color: var(--ink); }
.ad-table th.sorted.desc::after { content: " ↓"; }
.ad-table th.sorted.asc::after { content: " ↑"; }
.ad-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ad-table tr:last-child td { border-bottom: 0; }
.ad-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ad-table .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--ink-2); }
.ad-table .nowrap { white-space: nowrap; }
.ad-table .empty td { color: var(--muted); text-align: center; padding: 20px; }
.ad-kpis.usage { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 8px; }
@media (max-width: 820px) { .ad-kpis.usage { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ad-steps { width: 100%; margin: 0 0 4px; padding-left: 20px; display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.ad-report-text { max-width: 420px; font-size: 13px; line-height: 1.5; }
.ad-report-text small { display: block; color: var(--ink-2); margin-top: 4px; }
.ad-report-text q { quotes: "«" "»"; }
#reports audio { width: 220px; height: 32px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--tint-2); color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--amber-soft); color: var(--amber); }
.pill.bad { background: var(--accent-soft); color: var(--accent); }

.ad-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.ad-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.ad-form label.grow { flex: 1; min-width: 180px; }
.ad-form input[type="number"] { width: 110px; }
.ad-error { color: var(--accent); font-size: 13px; margin: -4px 0 10px; }

@media (max-width: 1000px) { .ad-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .ad-grid { grid-template-columns: 1fr; gap: 0; }
  .ad-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ad-card { padding: 14px; }
  .ad-filters input { width: 100%; }
  .ad-filters { width: 100%; }
  #who { display: none; }
  .ad-chart svg { height: 220px; }
}

/* site dropdowns (assets/dropdown.css), compact for the admin filters (2026-11-07) */
.ad-filters .dd, .ad-legend .dd { flex: none; min-width: 150px; }
.ad-filters .dd-btn, .ad-legend .dd-btn, .ad-form .dd-btn { height: 34px; padding: 0 8px 0 10px; border-radius: 10px; background: var(--tint); font-size: 13px; font-weight: 400; }
