:root{
  --bg1:#050a1a;
  --bg2:#0b2a5b;
  --text:#eef3ff;
  --muted:#b9c6ff;
  --line:rgba(255,255,255,.12);
  --accent:#22c55e;
  --accent2:#38bdf8;
  --danger:#fb7185;
  --warn:#fbbf24;
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background: radial-gradient(1200px 800px at 15% 10%, #123a8a 0%, var(--bg2) 35%, var(--bg1) 100%);
}

.topbar{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
  backdrop-filter: blur(10px);
  background: rgba(5,10,25,.78);
}

.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:48px; height:48px;
  display:grid; place-items:center;
  font-weight:1000;
  border-radius:14px;
  background: linear-gradient(135deg, var(--accent2) 0%, #2563eb 45%, #7c3aed 100%);
  box-shadow:0 12px 30px rgba(0,0,0,.35);
}

h1{margin:0; font-size:18px}
.sub{margin:2px 0 0; color:var(--muted); font-size:12px}

.wrap{max-width:1150px; margin:18px auto; padding:0 14px 40px}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.06) 0%, rgba(255,255,255,.03) 100%);
  border:1px solid var(--line);
  border-radius:18px;
  padding:16px;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
  margin-bottom:16px;
}

h2{margin:0 0 10px; font-size:16px}
h3{margin:0 0 6px; font-size:14px}
.hint{margin:0 0 12px; color:var(--muted); font-size:13px; line-height:1.4}
.mini{margin:0; color:var(--muted); font-size:12px}

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
@media (max-width:950px){
  .grid2{grid-template-columns:1fr}
}

.panel{
  padding:12px;
  border-radius:16px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.18);
}

.lbl{display:block; font-size:12px; color:var(--muted); margin-bottom:6px; font-weight:900}

.file{
  width:100%;
  border:1px dashed rgba(255,255,255,.25);
  border-radius:12px;
  padding:10px;
  background: rgba(0,0,0,.25);
  color:var(--text);
  font-weight:800;
}

.meta{margin-top:8px; font-size:12px; color:var(--muted)}

.controls{
  margin-top:14px;
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap:12px;
}
@media (max-width:950px){
  .controls{grid-template-columns:1fr}
}
.ctrl{
  padding:12px;
  border-radius:16px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.18);
}
.ctrl input, .ctrl select{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.25);
  color:var(--text);
  font-weight:900;
}
.actions{display:flex; flex-direction:column; gap:10px; justify-content:center}

.btn{
  padding:11px 14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.16);
  cursor:pointer;
  font-weight:1000;
  color:var(--text);
  background: rgba(255,255,255,.06);
  transition: transform .08s ease, filter .08s ease;
}
.btn:hover{transform: translateY(-1px); filter:brightness(1.06)}
.btn:disabled{opacity:.55; cursor:not-allowed; transform:none}

.btnPrimary{background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 45%, #7c3aed 100%)}
.btnAccent{background: linear-gradient(135deg, var(--accent) 0%, #16a34a 55%, #0ea5e9 100%)}
.btnGhost{background: rgba(255,255,255,.06)}

.warn{
  margin-top:12px;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(251,191,36,.35);
  background: rgba(251,191,36,.12);
  color:#ffe9b6;
  font-weight:900;
}
.hidden{display:none}

.msg{
  margin-top:12px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.18);
  color:var(--muted);
  font-weight:900;
  min-height:18px;
}

.summary{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:12px;
}
@media (max-width:950px){
  .summary{grid-template-columns:1fr 1fr}
}
.kpi{
  padding:12px;
  border-radius:16px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.18);
}
.kpiTitle{color:var(--muted); font-size:12px; font-weight:1000}
.kpiVal{font-size:22px; font-weight:1100; margin-top:6px}

.tabs{display:flex; gap:10px; margin-bottom:10px; flex-wrap:wrap}
.tab{
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.2);
  color:var(--text);
  font-weight:1100;
  cursor:pointer;
}
.tab.active{
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 55%, #7c3aed 100%);
}
.tabPane{display:none}
.tabPane.active{display:block}

.tableWrap{overflow:auto; border-radius:16px; border:1px solid var(--line)}
table{
  width:100%;
  border-collapse:collapse;
  min-width:1200px;
  background: rgba(0,0,0,.18);
}
th, td{
  border-bottom:1px solid rgba(255,255,255,.08);
  padding:10px;
  text-align:left;
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
}
th{
  position:sticky; top:0;
  background: rgba(10,20,45,.92);
  z-index:2;
}

.badCell{
  background: rgba(251,191,36,.22) !important;
  outline:1px solid rgba(251,191,36,.55);
}

.missRow td{ background: rgba(251,113,133,.10); }

.tag{
  display:inline-block;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  font-weight:1100;
}
.tag.missing{
  border-color: rgba(251,113,133,.45);
  background: rgba(251,113,133,.16);
  color:#ffd7de;
}
.tag.mismatch{
  border-color: rgba(251,191,36,.45);
  background: rgba(251,191,36,.18);
  color:#ffe9b6;
}

.footer{color:var(--muted); font-size:12px; padding:8px 4px}
