
:root{
  --bg:#0b0e14; --panel:#111827; --card:#0f172a; --muted:#9ca3af; --text:#e5e7eb;
  --border:#1f2937; --primary:#2563eb; --danger:#ef4444; --ok:#22c55e;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 16px;
}
*{box-sizing:border-box}
body{
  margin:0; font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1200px 800px at 20% 10%, rgba(37,99,235,.25), transparent 60%),
              radial-gradient(900px 600px at 90% 30%, rgba(34,197,94,.14), transparent 55%),
              var(--bg);
  color:var(--text);
}
code{background:rgba(255,255,255,.06); padding:.12rem .35rem; border-radius:8px}
a{color:#93c5fd}
.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px; background:rgba(17,24,39,.75); backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}
.brand{font-weight:800; letter-spacing:.2px}
.shell{max-width:1200px; margin:0 auto; padding:18px}
.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);
  padding:16px;
}
.login{max-width:720px; margin:24px auto}
h1,h2,h3{margin:0 0 10px 0}
.muted{color:var(--muted)}
.small{font-size:12px}
.row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.row.space{justify-content:space-between}
.grid2{display:grid; grid-template-columns: 1fr 1fr; gap:12px}
.grid3{display:grid; grid-template-columns: repeat(3, 1fr); gap:12px}
.grid4{display:grid; grid-template-columns: repeat(4, 1fr); gap:12px}
label{display:flex; flex-direction:column; gap:6px; font-size:13px}
input, select{
  background:rgba(0,0,0,.25);
  border:1px solid var(--border);
  color:var(--text);
  padding:10px 10px;
  border-radius:12px;
  outline:none;
}
input:focus, select:focus{border-color: rgba(37,99,235,.7)}
.btn{
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
}
.btn:hover{background: rgba(255,255,255,.07)}
.btn-primary{background: rgba(37,99,235,.85); border-color: rgba(37,99,235,.9)}
.btn-primary:hover{background: rgba(37,99,235,1)}
.btn-danger{background: rgba(239,68,68,.9); border-color: rgba(239,68,68,.9)}
.btn-ghost{background:transparent}
.error{color:#fca5a5}
.hidden{display:none!important}
.app{display:grid; grid-template-columns: 260px 1fr; gap:14px; align-items:start}
.sidebar{
  position:sticky; top:74px;
  height: calc(100vh - 96px);
  overflow:auto;
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(17,24,39,.55);
  backdrop-filter: blur(10px);
  padding:14px;
}
.sidebar-title{font-weight:700; margin-bottom:10px}
.nav{display:flex; flex-direction:column; gap:8px}
.navbtn{
  text-align:left;
  width:100%;
  padding:10px 10px;
  border-radius:12px;
  background: rgba(255,255,255,.03);
  border:1px solid var(--border);
  color:var(--text);
  cursor:pointer;
}
.navbtn.active{border-color: rgba(37,99,235,.8); background: rgba(37,99,235,.18)}
.navgroup{margin-top:10px}
.navgroup-title{font-size:12px; color:var(--muted); margin:8px 2px}
.sidebar-footer{margin-top:14px; padding-top:12px; border-top:1px solid var(--border)}
.content{display:flex; flex-direction:column; gap:14px}
.cards{display:grid; grid-template-columns: repeat(2, 1fr); gap:12px}
.kpi-title{color:var(--muted); font-size:12px}
.kpi{font-size:28px; font-weight:800}
.tablewrap{overflow:auto; border-radius:12px; border:1px solid var(--border)}
.table{width:100%; border-collapse:collapse; font-size:13px; background:rgba(0,0,0,.18)}
.table th,.table td{padding:10px; border-bottom:1px solid rgba(31,41,55,.9); text-align:left; white-space:nowrap}
.table tbody tr:hover{background:rgba(255,255,255,.04); cursor:pointer}
.divider{height:1px; background:var(--border); margin:14px 0}
.toast{
  position:fixed; right:18px; bottom:18px;
  background: rgba(17,24,39,.95);
  border:1px solid var(--border);
  padding:12px 14px;
  border-radius:14px;
  box-shadow: var(--shadow);
  max-width:420px;
}
.dndlist{list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:8px}
.dnditem{
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  padding:10px;
  border-radius:12px;
  display:flex; gap:10px; align-items:center; justify-content:space-between;
}
.dnditem.dragging{opacity:.6}
.badge{font-size:12px; padding:3px 8px; border-radius:999px; background:rgba(255,255,255,.06); border:1px solid var(--border)}
.badge.ok{border-color: rgba(34,197,94,.7); background: rgba(34,197,94,.12)}
.badge.no{border-color: rgba(239,68,68,.7); background: rgba(239,68,68,.12)}
.editorWrap{margin-top:10px}
.canvas{
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16/9;
  background: rgba(0,0,0,.25);
  border:1px dashed rgba(255,255,255,.25);
  border-radius: 18px;
  position: relative;
  overflow:hidden;
}
.zone{
  position:absolute;
  border:2px solid rgba(37,99,235,.75);
  background: rgba(37,99,235,.12);
  border-radius:14px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  padding:8px;
  user-select:none;
}
.zone .ztag{font-size:12px; font-weight:700}
.zone .handle{
  width:14px; height:14px;
  border-radius:4px;
  background: rgba(255,255,255,.7);
  cursor:nwse-resize;
}

.card.subtle{
  box-shadow:none;
  background: rgba(255,255,255,.02);
}
h4{margin:0 0 8px 0}
