/* Admin console. Builds on app.css tokens. Bars: one series per chart, validated:
   light #D98E04 (below 3:1 on the surface, so every bar carries a visible value label and a
   table view is one click away), dark #BF7F05 (inside the dark lightness band, >= 3:1). */
:root { --bar: #D98E04; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bar: #BF7F05; } }
:root[data-theme="dark"] { --bar: #BF7F05; }

.ad-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 12px; margin-top: 14px; }
.ad-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 2px; }
.ad-kpi .k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 500; }
.ad-kpi .v { font-family: var(--font-display); font-size: 34px; font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums; }
.ad-kpi .s { font-size: 12px; color: var(--muted); }
.ad-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; margin-top: 14px; }
.ad-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.ad-card h3 { font-size: 20px; font-weight: 600; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ad-card h3 .sub { font-family: var(--font-body); font-size: 13px; color: var(--muted); font-weight: 400; }
.ad-card .linkbtn { margin-left: auto; font-size: 13px; background: none; border: 0; color: var(--accent-ink); cursor: pointer; padding: 0; }
.ad-chart { position: relative; width: 100%; margin-top: 8px; }
.ad-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.ad-chart .grid { stroke: var(--line-2); stroke-width: 1; }
.ad-chart .base { stroke: var(--line); stroke-width: 1; }
.ad-chart .bar { fill: var(--bar); }
.ad-chart .hit { fill: transparent; cursor: default; }
.ad-chart .hit:hover + .bar, .ad-chart g.on .bar { filter: brightness(1.12); }
.ad-chart text { font-family: var(--font-body); font-size: 11px; fill: var(--muted); }
.ad-chart text.val { fill: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.ad-tbl { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.ad-tbl th, .ad-tbl td { padding: 4px 6px; border-bottom: 1px solid var(--line-2); text-align: right; font-variant-numeric: tabular-nums; }
.ad-tbl th:first-child, .ad-tbl td:first-child { text-align: left; }
.ad-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--fg); color: var(--bg); border-radius: 6px; padding: 6px 9px; font-size: 12px; line-height: 1.35; box-shadow: var(--shadow); white-space: nowrap; }
.ad-tip b { font-weight: 600; }
.ad-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.ad-tools input[type="search"] { width: 240px; max-width: 100%; }
.ad-tools .spacer { flex: 1; }
table.ad-list th.sortable { cursor: pointer; user-select: none; }
table.ad-list th.sortable:hover { color: var(--fg); }
table.ad-list th .dir { font-size: 10px; margin-left: 3px; }
table.ad-list td.num, table.ad-list th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.ad-list tr.row { cursor: pointer; }
table.ad-list tr.off td { opacity: .55; }
.ad-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--line); }
.ad-dot.hot { background: var(--ok); }
.ad-dot.warm { background: var(--accent); }
.ad-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.ad-roles .pill { text-transform: none; letter-spacing: 0; font-weight: 500; }
.ad-sys { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; margin: 8px 0 0; }
.ad-sys dt { color: var(--muted); }
.ad-sys dd { margin: 0; word-break: break-word; }
.ad-feed { display: grid; gap: 2px; font-size: 13px; margin-top: 6px; }
.ad-feed div { display: grid; grid-template-columns: 110px 110px 1fr; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--line-2); }
.ad-feed .num { color: var(--muted); }
.ad-note { font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .ad-feed div { grid-template-columns: 1fr; gap: 0; } }
.ad-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; margin-top: 10px; }
.ad-mini div { border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; display: grid; }
.ad-mini .k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ad-mini .v { font-weight: 600; font-variant-numeric: tabular-nums; }
dialog.confirm { width: min(440px, calc(100vw - 32px)); }
dialog.confirm .dlg-b p { margin: 0; color: var(--muted); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }
