:root{
  --bg:#0b1220;
  --panel:#0f1b31;
  --card:#111f3a;
  --text:#e8eefc;
  --muted:#a8b4d6;
  --line:rgba(255,255,255,.10);
  --brand:#5eead4;
  --brand2:#60a5fa;
  --danger:#fb7185;
  --ok:#34d399;
  --shadow: 0 14px 40px rgba(0,0,0,.35);
  --radius: 14px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, Arial;
  background: radial-gradient(900px 600px at 70% -10%, rgba(96,165,250,.35), transparent 60%),
              radial-gradient(900px 700px at 20% 10%, rgba(94,234,212,.20), transparent 60%),
              var(--bg);
  color:var(--text);
}
a{color:inherit; text-decoration:none}
.container{display:flex; min-height:100vh}

.sidebar{
  width:280px;
  background: rgba(15,27,49,.72);
  backdrop-filter: blur(10px);
  border-left:1px solid var(--line);
  padding:18px 16px;
}
.brand{
  display:flex; align-items:center; gap:10px;
  padding:10px 10px 18px;
}
.brand .logo{
  width:44px; height:44px; border-radius:14px;
  background: linear-gradient(135deg, rgba(94,234,212,.22), rgba(96,165,250,.22));
  border:1px solid var(--line);
  display:grid; place-items:center;
}
.brand .title{
  line-height:1.1;
}
.brand .title b{display:block; font-size:18px}
.brand .title span{font-size:12px; color:var(--muted)}

.nav{
  margin-top:14px;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.nav a{
  padding:10px 12px;
  border-radius:12px;
  color:var(--muted);
  display:flex;
  gap:10px;
  align-items:center;
  border:1px solid transparent;
}
.nav a:hover{
  background: rgba(255,255,255,.06);
  border-color: var(--line);
  color:var(--text);
}
.nav a.active{
  background: linear-gradient(135deg, rgba(94,234,212,.12), rgba(96,165,250,.10));
  border-color: rgba(94,234,212,.25);
  color:var(--text);
}
.nav small{margin-top:18px; color:var(--muted); padding:0 12px; opacity:.9}

.main{
  flex:1;
  padding:20px 22px 34px;
}
.topbar{
  display:flex; justify-content:space-between; align-items:center;
  gap:12px;
  margin-bottom:16px;
}
.topbar .page-title{
  font-size:20px;
  font-weight:700;
}
.badge{
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  color:var(--muted);
  font-size:12px;
}
.btn{
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
}
.btn:hover{background: rgba(255,255,255,.09)}
.btn.primary{
  border-color: rgba(94,234,212,.30);
  background: linear-gradient(135deg, rgba(94,234,212,.18), rgba(96,165,250,.14));
}
.btn.danger{
  border-color: rgba(251,113,133,.35);
  background: rgba(251,113,133,.10);
}
.grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:12px;
}
.card{
  background: rgba(17,31,58,.70);
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding:14px;
  box-shadow: var(--shadow);
}
.card h4{margin:0 0 6px; font-size:13px; color:var(--muted); font-weight:600}
.card .value{font-size:22px; font-weight:800}
.card .sub{margin-top:6px; color:var(--muted); font-size:12px}

.panel{
  margin-top:12px;
  background: rgba(17,31,58,.55);
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding:14px;
}
.panel h3{margin:0 0 12px; font-size:16px}

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 10px;
}
.table th{
  text-align:right;
  color:var(--muted);
  font-weight:600;
  font-size:12px;
  padding:0 10px 8px;
}
.table td{
  padding:12px 10px;
  background: rgba(255,255,255,.05);
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
}
.table tr td:first-child{border-right:1px solid var(--line); border-top-right-radius:12px; border-bottom-right-radius:12px;}
.table tr td:last-child{border-left:1px solid var(--line); border-top-left-radius:12px; border-bottom-left-radius:12px;}

.form{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:12px;
}
.field{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.field label{font-size:12px; color:var(--muted)}
.input, select, textarea{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.05);
  color:var(--text);
  outline:none;
}
textarea{min-height:110px; resize:vertical}
.half{grid-column: span 1}
.full{grid-column: span 2}
.row{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.alert{
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  margin:10px 0 14px;
  background: rgba(255,255,255,.05);
}
.alert.success{border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.10)}
.alert.error{border-color: rgba(251,113,133,.35); background: rgba(251,113,133,.10)}

.kpi{
  display:flex; gap:10px; flex-wrap:wrap;
}
.kpi .pill{
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:999px;
  background: rgba(255,255,255,.04);
  color:var(--muted);
  font-size:12px;
}

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

@media (max-width:1100px){
  .grid{grid-template-columns: repeat(2, 1fr);}
}
@media (max-width:860px){
  .sidebar{display:none}
  .grid{grid-template-columns:1fr}
  .form{grid-template-columns:1fr}
  .full{grid-column: span 1}
}
