:root{
  --bg:#0b1220;
  --card:#0f172a;
  --muted:#94a3b8;
  --text:#e5e7eb;
  --line:#1f2a44;
  --pri:#2563eb;
  --danger:#ef4444;
  --shadow: 0 12px 30px rgba(0,0,0,.35);
  --r:18px;
}

*{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:var(--bg);
}
a{color:inherit}
.muted{color:var(--muted)}
.small{font-size:12px}

.bg{
  position:fixed; inset:0;
  background:
    radial-gradient(800px 500px at 20% 10%, rgba(37,99,235,.18), transparent 60%),
    radial-gradient(700px 450px at 80% 30%, rgba(34,197,94,.10), transparent 60%),
    radial-gradient(900px 650px at 50% 90%, rgba(239,68,68,.10), transparent 60%);
  pointer-events:none;
}

.container{max-width:1100px;margin:0 auto;padding:16px}
.card{
  background: rgba(15,23,42,.85);
  border:1px solid rgba(31,42,68,.9);
  border-radius:var(--r);
  box-shadow:var(--shadow);
  padding:16px;
  backdrop-filter: blur(10px);
}

.btn{
  border:1px solid rgba(31,42,68,.9);
  background:#0b1327;
  color:var(--text);
  padding:12px 14px;
  border-radius:14px;
  cursor:pointer;
}
.btn:hover{filter:brightness(1.08)}
.btn.primary{background:rgba(37,99,235,.95); border-color:rgba(37,99,235,.95)}
.btn.danger{background:rgba(239,68,68,.9); border-color:rgba(239,68,68,.9)}
.iconbtn{
  border:1px solid rgba(31,42,68,.9);
  background:#0b1327;
  color:var(--text);
  width:42px; height:42px;
  border-radius:14px;
  cursor:pointer;
}

input,select,textarea{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(31,42,68,.9);
  background:#0b1327;
  color:var(--text);
  outline:none;
}
input:focus,select:focus,textarea:focus{border-color:rgba(37,99,235,.8)}

.field{display:grid;gap:6px}
.field span{font-size:13px;color:var(--muted)}
.form{display:grid;gap:12px}
.row{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.msg{margin:0;min-height:18px;font-size:13px;color:#fde68a}
.h1{margin:0;font-size:18px}
.h2{margin:0;font-size:16px}
.kpi{font-size:26px;margin:8px 0 0;font-weight:800}

.layout{min-height:100%;display:grid;grid-template-columns:300px 1fr}
.sidebar{
  position:sticky;top:0;height:100vh;
  padding:14px;
  border-right:1px solid rgba(31,42,68,.9);
  background: rgba(8,12,22,.85);
  backdrop-filter: blur(10px);
}
.nav{display:grid;gap:6px;margin-top:14px}
.nav a{
  text-decoration:none;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid transparent;
}
.nav a:hover{background:rgba(37,99,235,.12);border-color:rgba(37,99,235,.25)}
.nav a.active{background:rgba(37,99,235,.18);border-color:rgba(37,99,235,.35)}
.main{min-width:0}
.topbar{
  position:sticky;top:0;z-index:5;
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;padding:14px 16px;
  border-bottom:1px solid rgba(31,42,68,.9);
  background: rgba(8,12,22,.75);
  backdrop-filter: blur(10px);
}
@media (max-width: 980px){
  .layout{grid-template-columns:1fr}
  .sidebar{
    position:fixed;inset:0 auto 0 0;
    width:min(320px, 86vw);
    transform:translateX(-105%);
    transition:transform .2s ease;
    z-index:10;
  }
  .sidebar.open{transform:translateX(0)}
}