/* Crash Cart admin — extends app.css */
.adm { max-width: 1280px; }
.admtag { font: 700 13px var(--body); background: var(--pink); color: #fff; padding: 2px 8px; border-radius: 99px; vertical-align: middle; }
.admtabs { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(8px); background: rgba(29,11,69,.85); }
.badge { background: var(--pink); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
.adm .btn { padding: 7px 12px; font-size: 14px; box-shadow: 0 3px 0 rgba(0,0,0,.35); margin: 2px; }
.adm .btn.mini { padding: 4px 8px; font-size: 12px; }
.adm .form input, .adm .form select { padding: 8px 10px; }
.filters.left { justify-content: flex-start; align-items: center; }
.filters input { padding: 9px 12px; border-radius: 12px; border: 0; background: rgba(255,255,255,.95); color: #1d0b45; font-weight: 700; min-width: 240px; flex: 1; max-width: 420px; }
.chk { display: flex; gap: 6px; align-items: center; font-weight: 700; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid2 > .card { margin: 0; }
.warn { border-color: var(--orange); background: rgba(255,138,31,.15); font-weight: 700; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.kpi b { display: block; font: 700 28px/1.1 var(--display); color: #fff; }
.kpi span { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.kpi small { display: block; color: var(--muted); font-size: 12px; }
.kpi.alert b { color: var(--yellow); }

.chart svg { width: 100%; height: 220px; display: block; }
.chart .bar { fill: var(--cyan); }
.chart .bar:hover, .chart .hit:hover + .bar { fill: #7fe0ff; }
.chart .axis { fill: var(--muted); font: 600 11px var(--body); }
.chart .grid { stroke: rgba(255,255,255,.12); stroke-width: 1; }
.tip { position: fixed; pointer-events: none; background: #fff; color: #1d0b45; border-radius: 10px; padding: 8px 10px; font: 700 13px/1.35 var(--body); box-shadow: 0 8px 24px rgba(0,0,0,.4); z-index: 70; }

.tblwrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: rgba(255,255,255,.05); }
.tbl tr.sel td { background: rgba(255,210,0,.10); }
#job-log { max-height: 320px; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .qstem { max-width: 460px; }
.pctbar { display: inline-block; width: 70px; height: 8px; background: rgba(255,255,255,.15); border-radius: 99px; vertical-align: middle; margin-right: 6px; overflow: hidden; }
.pctbar i { display: block; height: 100%; background: var(--cyan); border-radius: 99px; }
.st { display: inline-block; border-radius: 99px; padding: 1px 8px; font-size: 12px; font-weight: 800; }
.st.live { background: rgba(47,214,123,.25); color: #8ff0b8; }
.st.suspended { background: rgba(255,138,31,.25); color: #ffc07f; }
.st.retired { background: rgba(255,255,255,.12); color: var(--muted); }
.dec { display: inline-block; border-radius: 8px; padding: 2px 9px; font-weight: 800; font-size: 13px; }
.dec.fix { background: var(--a1); } .dec.keep { background: var(--a3); } .dec.retire { background: #6b5a99; }
.dec.needs_admin { background: var(--orange); color: #2a1060; } .dec.error { background: var(--red); }

.rv { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin: 10px 0; }
.rv .head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rv .head .when { margin-left: auto; color: var(--muted); font-size: 12px; }
.rv .rat { background: rgba(0,0,0,.25); border-left: 4px solid var(--cyan); padding: 8px 12px; border-radius: 0 10px 10px 0; margin: 8px 0; }
.rv .flags { font-size: 13px; color: var(--muted); }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.diff > div { background: rgba(0,0,0,.2); border-radius: 12px; padding: 10px; font-size: 13px; }
.diff h5 { margin: 0 0 4px; font: 800 12px var(--body); text-transform: uppercase; color: var(--muted); }
.diff ol { margin: 4px 0; padding-left: 20px; }
.ok { color: var(--green); font-weight: 800; }

.dist { margin: 8px 0; }
.dist .opt { display: grid; grid-template-columns: 28px 1fr 120px; gap: 8px; align-items: center; margin: 5px 0; }
.dist .opt .sh { width: 24px; height: 24px; }
.dist .opt .txt { font-weight: 700; }
.dist .opt .txt.correct::after { content: ' ✔'; color: var(--green); }
.dist .opt .bar { height: 12px; background: rgba(255,255,255,.12); border-radius: 99px; overflow: hidden; }
.dist .opt .bar i { display: block; height: 100%; border-radius: 99px; }
.dist .opt .bar i.a0 { background: var(--a0); } .dist .opt .bar i.a1 { background: var(--a1); } .dist .opt .bar i.a2 { background: var(--a2); } .dist .opt .bar i.a3 { background: var(--a3); }
.dist .opt small { color: var(--muted); font-weight: 700; }
.dlg.wide { max-width: 860px; background: #241056; color: #fff; }
.dlg.wide .muted { color: var(--muted); }
.dlg.wide blockquote { border-left: 4px solid var(--a1); margin: 8px 0; padding: 6px 12px; font-style: italic; background: rgba(0,0,0,.2); border-radius: 0 10px 10px 0; }
.log { background: rgba(0,0,0,.35); border-radius: 12px; padding: 10px; font: 12px/1.45 ui-monospace, Menlo, monospace; max-height: 260px; overflow: auto; white-space: pre-wrap; }
@media (max-width: 760px) { .grid2, .diff { grid-template-columns: 1fr; } .tbl { font-size: 12px; } .filters input { min-width: 0; } }

.logbar { display: flex; gap: 6px; justify-content: flex-end; margin: 8px 0 4px; }
.tbl .qopts ol { margin: 0; padding-left: 18px; list-style: upper-alpha; }
.tbl .qopts li { margin: 1px 0; }
.tbl .qopts li.ok { color: var(--green); font-weight: 800; }
.tbl .qopts small { color: var(--muted); font-weight: 600; }
/* Question editor + import */
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.qe-side { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 0; }
.qe-side legend { font-weight: 800; padding: 0 6px; }
.qe-opt { display: grid; grid-template-columns: 18px 1fr 1fr; gap: 6px; align-items: center; margin: 6px 0; }
.qe textarea, .qe input { width: 100%; box-sizing: border-box; }
.qcheck { list-style: none; padding: 0; margin: 10px 0; font-size: 13px; }
.qcheck li { padding: 3px 0; }
.qerr { color: #ff8a8a; font-weight: 700; } .qwarn { color: var(--orange); } .qok { color: #7be08a; font-weight: 700; }
#imp-preview td { font-size: 12px; }
@media (max-width: 760px) { .grid4 { grid-template-columns: 1fr 1fr; } .qe-opt { grid-template-columns: 18px 1fr; } }
.msg { border-top: 1px solid var(--line); padding: 6px 0; }
/* Action buttons wrap inside a fixed-width cell instead of widening the table */
.tbl td.acts { width: 270px; min-width: 200px; }
.tbl div.acts { display: flex; flex-wrap: wrap; gap: 6px; }
.tbl div.acts .btn { margin: 0; }
#t-src td:first-child { overflow-wrap: anywhere; min-width: 220px; }
/* Phone: each source becomes a card (labels from data-l) instead of a too-wide table */
@media (max-width: 760px) {
  #t-src, #t-src tbody, #t-src tr, #t-src td { display: block; width: auto; min-width: 0; }
  #t-src tr:first-child { display: none; }
  #t-src tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  #t-src td { border: 0; padding: 4px 0; }
  #t-src td.num { display: inline-block; margin-right: 12px; text-align: left; }
  #t-src td.num::before { content: attr(data-l) ' '; color: var(--muted); font-size: 11px; }
}
.mix { background: rgba(0,0,0,.18); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
.mix .chk { display: block; margin: 4px 0; font-size: 14px; }
.tbl td.share input { width: 70px; padding: 4px 6px; border-radius: 8px; border: 0; background: #fff; color: #1d0b45; font-weight: 800; }
.tbl td.share input:disabled { opacity: .5; }
.tbl td.share small { display: block; color: var(--muted); font-size: 11px; line-height: 1.3; margin-top: 3px; }
@media (max-width: 760px) { #t-src td.share { display: block; } }
.badge:empty { display: none; }
.tbl select.revmode { width: 100%; padding: 4px 6px; border-radius: 8px; font-size: 12px; font-weight: 700; color: #1d0b45; }
