/* Minimal, fast, clean */
:root{
  --bg:#0b0f14;
  --card:#0f1620;
  --card2:#121b26;
  --text:#e7eef7;
  --muted:#9fb0c3;
  --line:rgba(255,255,255,.08);
  --primary:#7c5cff;
  --primary2:#5aa7ff;
  --danger:#ff5c7c;
  --ok:#45d483;
  --warn:#ffcc66;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: linear-gradient(180deg, #070a0e 0%, #0b0f14 60%);
  color:var(--text);
}

.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  gap:16px;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
  background: rgba(11,15,20,.92);
  backdrop-filter: blur(10px);
}
.brand{display:flex; gap:12px; align-items:center}
.logo{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:rgba(124,92,255,.15);border:1px solid rgba(124,92,255,.35)}
.title{font-weight:700; letter-spacing:.2px}
.subtitle{font-size:12px;color:var(--muted);margin-top:2px}

.layout{display:grid;grid-template-columns: 48% 52%; gap:14px; padding:14px; max-width:1600px; margin:0 auto}
.panel{display:flex;flex-direction:column; gap:14px; min-height: calc(100vh - 72px)}
.card{
  background: linear-gradient(180deg, var(--card) 0%, var(--card2) 100%);
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  box-shadow: 0 12px 28px rgba(0,0,0,.25);
}
.table-card{padding:0}
.table-head{display:flex;justify-content:space-between; align-items:center; padding:12px 14px; border-bottom:1px solid var(--line)}
.table-wrap{max-height:56vh; overflow:auto; border-radius:0 0 16px 16px}
table{width:100%; border-collapse:collapse}
th,td{padding:10px 12px; border-bottom:1px solid var(--line); font-size:13px; vertical-align:middle}
th{position:sticky;top:0;background:rgba(18,27,38,.98); text-align:left; font-size:12px; color:var(--muted); letter-spacing:.3px}
tr{cursor:pointer}
tr:hover{background:rgba(124,92,255,.08)}
tr.active{background:rgba(90,167,255,.10)}
.muted{color:var(--muted)}
.small{font-size:12px}
.row{display:flex; align-items:center; gap:10px; flex-wrap:wrap}
.meta{font-size:12px; color:var(--muted)}
.filters{display:grid;grid-template-columns: 1.4fr .7fr .9fr .9fr .8fr; gap:10px; margin-top:10px}
.field label{display:block;font-size:12px;color:var(--muted); margin-bottom:6px}
input[type="search"], select, input[type="date"], textarea{
  width:100%;
  background: rgba(255,255,255,.03);
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 10px;
  color:var(--text);
  outline:none;
}
textarea{resize:vertical}
input[type="range"]{width:100%}
.hint{font-size:12px;color:var(--muted);margin-top:4px}

.btn{
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:600;
  font-size:13px;
}
.btn:hover{border-color: rgba(124,92,255,.45)}
.btn-primary{background: rgba(124,92,255,.18); border-color: rgba(124,92,255,.35)}
.btn-secondary{background: rgba(90,167,255,.14); border-color: rgba(90,167,255,.28)}
.btn-ghost{background: transparent}
.btn:disabled{opacity:.5; cursor:not-allowed}
.file input{display:none}

.stats{display:flex; gap:10px; flex-wrap:wrap; margin-top:10px}
.stat{padding:10px 12px; border-radius:14px; border:1px solid var(--line); background: rgba(255,255,255,.02)}
.stat .k{font-size:12px;color:var(--muted)}
.stat .v{font-weight:800;font-size:18px;margin-top:2px}

.detail-head{display:flex; align-items:flex-start; justify-content:space-between; gap:10px}
.d-title{font-size:16px; font-weight:800}
.d-sub{font-size:12px;color:var(--muted); margin-top:3px}
.detail-actions{display:flex; gap:10px}
.chips{display:flex; gap:8px; flex-wrap:wrap; margin:10px 0 6px}
.chip{padding:6px 10px; border-radius:999px; font-size:12px; border:1px solid var(--line); background: rgba(255,255,255,.02)}
.chip.ok{border-color: rgba(69,212,131,.35); background: rgba(69,212,131,.12)}
.chip.warn{border-color: rgba(255,204,102,.35); background: rgba(255,204,102,.12)}
.chip.bad{border-color: rgba(255,92,124,.35); background: rgba(255,92,124,.12)}
.grid2{display:grid; grid-template-columns: 1fr 1fr; gap:10px; margin:10px 0 6px}
.kpi{padding:10px 12px; border-radius:14px; border:1px solid var(--line); background: rgba(255,255,255,.02)}
.kpi .k{font-size:12px;color:var(--muted)}
.kpi .v{font-weight:800; font-size:14px; margin-top:4px}

.tabs{display:flex; gap:8px; margin-top:12px; flex-wrap:wrap}
.tab{
  padding:9px 10px;
  border-radius:12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.02);
  color:var(--muted);
  cursor:pointer;
  font-weight:700;
  font-size:13px;
}
.tab.active{background: rgba(124,92,255,.16); border-color: rgba(124,92,255,.35); color:var(--text)}
.tabpane{display:none; margin-top:12px}
.tabpane.active{display:block}

.section{margin-top:12px}
.section h3{margin:0 0 8px 0; font-size:13px; color:var(--muted); letter-spacing:.2px}
.box{
  border:1px solid var(--line);
  background: rgba(255,255,255,.02);
  border-radius:14px;
  padding:12px;
  line-height:1.45;
  font-size:13px;
}
.mono{white-space:pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace}
.copyrow{display:flex; justify-content:flex-end; margin-top:8px}
.note{padding:12px}

.toast{
  position:fixed; bottom:18px; left:50%; transform:translateX(-50%);
  background: rgba(15,22,32,.96);
  border:1px solid var(--line);
  padding:10px 12px;
  border-radius:14px;
  font-size:13px;
  box-shadow: 0 14px 32px rgba(0,0,0,.35);
}

.footer{padding:2px 2px 8px 2px}

@media (max-width: 1100px){
  .layout{grid-template-columns: 1fr; }
  .filters{grid-template-columns: 1fr 1fr; }
  .table-wrap{max-height:46vh}
}
