:root{
  --bg:#0b1220;
  --panel:#0f172a;
  --panel2:#111c33;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --line:rgba(148,163,184,.18);
  --ok:#22c55e;
  --warn:#f59e0b;
  --bad:#ef4444;
  --btn:#1f2a44;
  --btn2:#243152;
  --shadow: 0 10px 30px rgba(0,0,0,.25);
  --radius: 14px;
  --radius2: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:linear-gradient(180deg, #070b14, var(--bg));
  color:var(--text);
  font-family:var(--sans);
}
a{color:inherit}
.container{max-width:1100px;margin:0 auto;padding:14px 14px 24px}
.topbar{
  position:sticky; top:0; z-index:20;
  background:rgba(15,23,42,.86);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}
.topbar-inner{
  max-width:1100px; margin:0 auto;
  padding:10px 14px;
  display:flex; align-items:center; justify-content:space-between;
}
.brand-title{font-weight:800; letter-spacing:.2px}
.brand-sub{font-size:12px;color:var(--muted); margin-top:2px}
.topbar-actions{display:flex; gap:8px; align-items:center}

.tabs{
  position:sticky; top:56px; z-index:15;
  display:flex; gap:6px;
  padding:10px 14px;
  overflow:auto;
  background:rgba(11,18,32,.92);
  border-bottom:1px solid var(--line);
}
.tab{
  border:1px solid var(--line);
  background:rgba(31,42,68,.65);
  color:var(--text);
  padding:8px 10px;
  border-radius:999px;
  font-size:13px;
  white-space:nowrap;
}
.tab.active{
  background:rgba(56,189,248,.14);
  border-color:rgba(56,189,248,.35);
}

.card{
  background:linear-gradient(180deg, rgba(17,28,51,.92), rgba(15,23,42,.92));
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:14px;
}
.hr{height:1px;background:var(--line); margin:12px 0}
.row{display:flex; align-items:center; justify-content:space-between; gap:10px}
.grid{display:grid; gap:12px}
.grid.two{grid-template-columns:1fr 1fr}
@media(max-width:860px){ .grid.two{grid-template-columns:1fr} .tabs{top:54px}}
.flex{display:flex; gap:8px; align-items:center; flex-wrap:wrap}
.right{margin-left:auto}
.muted{color:var(--muted)}
.mini{font-size:12px}

label{display:block; font-size:12px; color:var(--muted); margin:10px 0 6px}
input,select,textarea{
  width:100%;
  padding:10px 10px;
  border-radius:12px;
  border:1px solid rgba(148,163,184,.22);
  background:rgba(2,6,23,.35);
  color:var(--text);
  outline:none;
}
textarea{min-height:110px; resize:vertical}
input[disabled]{opacity:.75}
.helpbox{
  border:1px dashed rgba(148,163,184,.28);
  padding:10px;
  border-radius:12px;
}

.btn,.btn-primary,.btn-danger{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(148,163,184,.22);
  background:rgba(31,42,68,.8);
  color:var(--text);
  cursor:pointer;
}
.btn-xs{padding:7px 10px; font-size:12px; border-radius:999px}
.btn-primary{background:rgba(34,197,94,.14); border-color:rgba(34,197,94,.35)}
.btn-danger{background:rgba(239,68,68,.12); border-color:rgba(239,68,68,.35)}

.pill{
  display:inline-flex; align-items:center; gap:6px;
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.22);
  background:rgba(31,42,68,.55);
}
.pill.ok{border-color:rgba(34,197,94,.4); background:rgba(34,197,94,.12)}
.pill.warn{border-color:rgba(245,158,11,.45); background:rgba(245,158,11,.12)}
.pill.bad{border-color:rgba(239,68,68,.45); background:rgba(239,68,68,.12)}

.kpi{display:grid; grid-template-columns:repeat(4,1fr); gap:12px}
@media(max-width:860px){.kpi{grid-template-columns:repeat(2,1fr)}}
.k{background:rgba(2,6,23,.25); border:1px solid rgba(148,163,184,.18); border-radius:14px; padding:12px}
.k .v{font-size:20px; font-weight:800}
.k .t{font-size:12px; color:var(--muted); margin-top:2px}

.list{display:flex; flex-direction:column; gap:10px}
.list-item{
  display:flex; justify-content:space-between; gap:10px;
  padding:12px;
  border:1px solid rgba(148,163,184,.18);
  border-radius:14px;
  background:rgba(2,6,23,.22);
}
table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
th,td{
  padding:10px;
  border-bottom:1px solid rgba(148,163,184,.18);
  vertical-align:top;
}
th{color:var(--muted); font-weight:700; text-align:left}

.toast{
  position:fixed; left:50%; bottom:16px;
  transform:translateX(-50%);
  background:rgba(2,6,23,.92);
  border:1px solid rgba(148,163,184,.25);
  padding:10px 14px;
  border-radius:999px;
  box-shadow:var(--shadow);
  z-index:50;
}

dialog{
  width:min(760px, 94vw);
  border:none;
  border-radius:18px;
  padding:0;
  background:transparent;
}
dialog::backdrop{background:rgba(0,0,0,.55)}
.dlg-head,.dlg-foot,.dlg-body{
  background:linear-gradient(180deg, rgba(17,28,51,.96), rgba(15,23,42,.96));
  border:1px solid rgba(148,163,184,.2);
}
.dlg-head{
  padding:12px 14px;
  border-top-left-radius:18px;
  border-top-right-radius:18px;
  border-bottom:none;
}
.dlg-body{padding:14px}
.dlg-foot{
  padding:12px 14px;
  border-bottom-left-radius:18px;
  border-bottom-right-radius:18px;
  border-top:none;
}
