/* Minimal, dependency-free UI */
:root{
  --bg:#0b1220;
  --panel:#101a33;
  --panel2:#0f1830;
  --text:#e8eefc;
  --muted:#a7b3d3;
  --border:#223057;
  --accent:#fbb040;
  --danger:#ff5c5c;
  --ok:#3ddc97;
  --shadow: 0 14px 40px rgba(0,0,0,.35);
  --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;
  font-family: var(--sans);
  background: radial-gradient(1200px 800px at 10% 10%, #172449 0%, var(--bg) 55%, #070b14 100%);
  color: var(--text);
}

a{color:inherit}
.container{max-width:1200px;margin:0 auto;padding:24px}
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card.pad{padding:18px}

.topbar{
  display:flex; gap:14px; align-items:center; justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid var(--border);
  background: rgba(10,16,32,.65);
  backdrop-filter: blur(10px);
  position:sticky; top:0; z-index:20;
}
.brand{
  display:flex; align-items:center; gap:10px; font-weight:700;
  letter-spacing:.2px;
}
.brand .dot{
  width:10px;height:10px;border-radius:50%;background:var(--accent);
  box-shadow:0 0 0 5px rgba(251,176,64,.16);
}
.nav{
  display:flex; gap:8px; flex-wrap:wrap;
}
.nav a{
  text-decoration:none;
  padding:8px 10px;
  border-radius: 10px;
  color: var(--muted);
  border:1px solid transparent;
}
.nav a.active{
  color: var(--text);
  border-color: var(--border);
  background: rgba(255,255,255,.03);
}
.nav a:hover{color:var(--text)}

.row{display:flex; gap:16px}
.col{flex:1}

h1,h2,h3{margin:0 0 10px 0}
h1{font-size:22px}
h2{font-size:18px}
h3{font-size:15px}
p{margin:8px 0;color:var(--muted);line-height:1.5}

.badge{
  display:inline-flex; align-items:center; gap:6px;
  font-size:12px; padding:4px 8px; border-radius:999px;
  border:1px solid var(--border); color: var(--muted);
  background: rgba(255,255,255,.02);
}
.badge.ok{color: #bff5de; border-color: rgba(61,220,151,.35); background: rgba(61,220,151,.08)}
.badge.warn{color: #ffe2b6; border-color: rgba(251,176,64,.35); background: rgba(251,176,64,.08)}
.badge.danger{color: #ffd2d2; border-color: rgba(255,92,92,.35); background: rgba(255,92,92,.08)}

.btn{
  appearance:none; border:none; cursor:pointer;
  padding:9px 12px; border-radius: 10px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--border);
  color: var(--text);
  font-weight:600;
}
.btn:hover{background: rgba(255,255,255,.09)}
.btn.primary{background: rgba(251,176,64,.16); border-color: rgba(251,176,64,.45)}
.btn.primary:hover{background: rgba(251,176,64,.22)}
.btn.danger{background: rgba(255,92,92,.10); border-color: rgba(255,92,92,.35)}
.btn.danger:hover{background: rgba(255,92,92,.16)}
.btn.link{background:transparent;border-color:transparent;color:var(--muted);font-weight:600}
.btn.link:hover{color:var(--text); background: rgba(255,255,255,.04); border-color: var(--border)}
.btn:disabled{opacity:.55; cursor:not-allowed}

.input, select, textarea{
  width:100%;
  padding:10px 11px;
  border-radius: 10px;
  border:1px solid var(--border);
  background: rgba(5,9,18,.55);
  color: var(--text);
  outline:none;
}
textarea{min-height:90px; resize:vertical}
label{display:block; font-size:12px; color: var(--muted); margin:10px 0 6px}

.grid2{display:grid; grid-template-columns: 1fr 1fr; gap:12px}
.grid3{display:grid; grid-template-columns: 1fr 1fr 1fr; gap:12px}
@media (max-width: 860px){
  .grid2,.grid3{grid-template-columns:1fr}
  .row{flex-direction:column}
}

.tablewrap{overflow:auto; border-radius: 12px; border:1px solid var(--border)}
table{
  width:100%;
  border-collapse: collapse;
  min-width: 720px;
}
th, td{
  padding:10px 12px;
  border-bottom:1px solid rgba(34,48,87,.6);
  font-size: 13px;
}
th{
  text-align:left;
  color: var(--muted);
  font-weight:700;
  background: rgba(255,255,255,.03);
}
tr:hover td{background: rgba(255,255,255,.02)}
td.mono{font-family: var(--mono); font-size:12px; color:#d5def6}

.toolbar{
  display:flex; gap:10px; flex-wrap:wrap; align-items:center; justify-content:space-between;
  padding:14px 16px;
}
.toolbar .left{display:flex; gap:10px; flex-wrap:wrap; align-items:center}
.toolbar .right{display:flex; gap:10px; flex-wrap:wrap; align-items:center}

hr.sep{border:none; border-top:1px solid var(--border); margin:14px 0}

.toast{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  background: rgba(10,16,32,.88);
  border:1px solid var(--border);
  border-radius: 12px;
  padding:10px 12px;
  color: var(--text);
  box-shadow: var(--shadow);
  max-width: min(720px, calc(100vw - 20px));
  z-index: 99;
}

dialog{
  border:none;
  border-radius: 16px;
  padding:0;
  background: transparent;
  width: min(780px, calc(100vw - 16px));
}
dialog::backdrop{background: rgba(0,0,0,.55)}
.dialog-card{background: rgba(11,18,32,.96); border:1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow)}
.dialog-head{display:flex; justify-content:space-between; gap:12px; align-items:flex-start; padding:14px 16px; border-bottom:1px solid var(--border)}
.dialog-body{padding:14px 16px}
.dialog-foot{display:flex; justify-content:flex-end; gap:10px; padding:14px 16px; border-top:1px solid var(--border)}

.small{font-size:12px;color:var(--muted)}
.kpi{display:flex; gap:12px; flex-wrap:wrap}
.kpi .item{padding:12px 14px; border:1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,.03)}
.kpi .n{font-size:20px; font-weight:800}
.kpi .l{font-size:12px; color:var(--muted)}


/* Utility classes for CSP-safe layout */
.row{display:flex}
.gap10{gap:10px}
.align-start{align-items:flex-start}
.align-center{align-items:center}
.align-end{align-items:flex-end}
.justify-end{justify-content:flex-end}
.flex1{flex:1}
.container.narrow{max-width:820px}
.mt12{margin-top:12px}
.mt10{margin-top:10px}
.mt6{margin-top:6px}
.input.w-search{width:min(360px, 60vw)}
.input.w-search-sm{width:min(320px, 55vw)}
.input.w-190{width:190px}
.input.w-160{width:160px}
.spacer10{height:10px}
.info-box{padding:12px 14px; border:1px solid var(--border); border-radius:14px; background: rgba(255,255,255,.03)}
.fw800{font-weight:800}
.note-card{margin:10px 0; background: rgba(255,255,255,.02)}
.prewrap{white-space:pre-wrap}
.hidden{display:none !important}
