:root{
  --bg:#0b0f17;
  --card:#121a27;
  --muted:#9fb0c3;
  --text:#e9f0f7;
  --line:#223147;
  --good:#3ddc97;
  --warn:#ffcc66;
  --bad:#ff6b6b;
  --btn:#1b2a40;
  --btn2:#244064;
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: radial-gradient(1200px 600px at 20% 0%, #14233a, var(--bg));
  color:var(--text);
}
.header{
  padding:18px 16px;
  border-bottom:1px solid var(--line);
  backdrop-filter: blur(6px);
}
.brand{display:flex; gap:12px; align-items:center; max-width:1100px; margin:0 auto;}
.logo{
  width:40px; height:40px; border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, #2f7cff, #3ddc97);
  color:#08101d; font-weight:900;
}
h1{margin:0; font-size:22px}
.sub{margin:4px 0 0; color:var(--muted); font-size:13px}
.container{max-width:1100px; margin:0 auto; padding:16px}
.card{
  background: rgba(18,26,39,0.88);
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px;
  margin-bottom:14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
h2{margin:0 0 6px; font-size:18px}
.mini{margin:6px 0 10px; font-size:14px; color:#dce6f2}
.muted{color:var(--muted)}
.dropzone{
  border:1px dashed #3b5578;
  border-radius:14px;
  padding:18px;
  display:flex;
  align-items:center;
  gap:14px;
  cursor:pointer;
  background: rgba(11,15,23,0.25);
}
.dropzone:hover{border-color:#6aa7ff}
.dropzone input{display:none}
.dzText{display:flex; flex-direction:column; gap:4px}
.metaRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:10px;
  flex-wrap:wrap;
}
.pill{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(11,15,23,0.35);
  font-size:13px;
}
.btn{
  background: var(--btn);
  border:1px solid var(--line);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:600;
}
.btn:hover{background: #20334d}
.btn:disabled{opacity:.45; cursor:not-allowed}
.btn.primary{background: linear-gradient(135deg, #2f7cff, #3ddc97); border:none; color:#06101d}
.btn.primary:hover{filter:brightness(1.04)}
.btn.ghost{background: transparent}
.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}
@media (max-width: 920px){
  .grid2{grid-template-columns:1fr}
}
.form{display:grid; gap:10px}
label{display:grid; gap:6px; font-size:13px; color:#dce6f2}
select{
  width:100%;
  background: rgba(11,15,23,0.6);
  border:1px solid var(--line);
  color:var(--text);
  padding:10px;
  border-radius:12px;
}
.toggle{display:flex; align-items:center; gap:10px; user-select:none}
.toggle input{transform: scale(1.2)}
.errors{
  margin-top:12px;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(255,107,107,0.35);
  background: rgba(255,107,107,0.12);
  color:#ffd6d6;
  font-size:13px;
  white-space: pre-wrap;
}
.audit{
  margin-top:12px;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(61,220,151,0.25);
  background: rgba(61,220,151,0.08);
  color:#d9ffe9;
  font-size:13px;
  white-space: pre-wrap;
}
.resultsHeader{
  display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
}
.actions{display:flex; gap:10px; flex-wrap:wrap}
.kpis{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:10px;
  margin:12px 0 10px;
}
@media (max-width: 920px){
  .kpis{grid-template-columns: repeat(2, 1fr)}
}
.kpi{
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px 12px;
  background: rgba(11,15,23,0.35);
}
.k{font-size:12px; color:var(--muted)}
.v{font-size:18px; font-weight:800; margin-top:2px}
/* Results tables: 1 col (mobile) → 2 col (tablet) → 3 col (desktop) */
.tables{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

@media (min-width: 900px){
  .tables{ grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1280px){
  .tables{ grid-template-columns: 1fr 1fr 1fr; }
}
.tableWrap{
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px;
  background: rgba(11,15,23,0.25);
}
table{width:100%; border-collapse:collapse; font-size:13px}
th, td{padding:10px 8px; border-bottom:1px solid rgba(34,49,71,0.7)}
th{
  text-align:left;
  color:#dce6f2;
  cursor:pointer;
  user-select:none;
}
th.num, td.num{text-align:right}
tbody tr:hover{background: rgba(47,124,255,0.10)}
tbody tr.selected{background: rgba(61,220,151,0.10)}
.hint{margin-top:8px; font-size:12px}
.footer{padding:10px 2px; font-size:12px}
