:root{
  --bg:#0b1220;
  --panel:#0f1a33;
  --card:#101f3d;
  --muted:#93a4c7;
  --text:#e9efff;
  --line:rgba(255,255,255,.08);
  --accent:#7c5cff;
  --accent2:#2ee9a6;
  --danger:#ff5c7a;
  --warn:#ffcc66;
  --shadow: 0 12px 40px rgba(0,0,0,.35);
  --radius:18px;
  --radius2:14px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background:
    radial-gradient(900px 500px at 10% 10%, rgba(124,92,255,.35), transparent 60%),
    radial-gradient(900px 500px at 90% 20%, rgba(46,233,166,.22), transparent 60%),
    radial-gradient(900px 500px at 50% 100%, rgba(255,92,122,.12), transparent 60%),
    linear-gradient(180deg, var(--bg), #070b14);
}

a{color:inherit; text-decoration:none}
a:hover{opacity:.92}
.container{max-width:1200px; margin:0 auto; padding:22px}

.app{
  display:grid;
  grid-template-columns: 270px 1fr;
  gap:18px;
  min-height:100vh;
  padding:18px;
}

.sidebar{
  background: rgba(16,31,61,.65);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:18px;
  position:sticky;
  top:18px;
  height:calc(100vh - 36px);
  overflow:auto;
  backdrop-filter: blur(10px);
}

.brand{
  display:flex; align-items:center; gap:12px;
  padding:10px 10px 14px;
  border-bottom:1px solid var(--line);
  margin-bottom:14px;
}
.logo{
  width:38px; height:38px; border-radius:14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 30px rgba(124,92,255,.25);
}
.brand h1{font-size:14px; margin:0; letter-spacing:.4px}
.brand p{margin:2px 0 0; font-size:12px; color:var(--muted)}

.nav{display:flex; flex-direction:column; gap:8px; margin-top:10px}
.nav a{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px;
  border:1px solid transparent;
  border-radius: 14px;
  color:var(--text);
  background: rgba(255,255,255,.03);
}
.nav a:hover{border-color:var(--line); background: rgba(255,255,255,.06)}
.nav a.active{
  border-color: rgba(124,92,255,.45);
  background: rgba(124,92,255,.18);
}
.badge{
  margin-left:auto;
  font-size:12px;
  padding:2px 8px;
  border-radius:999px;
  background: rgba(255,255,255,.08);
  color: var(--muted);
  border:1px solid var(--line);
}

.main{
  background: rgba(16,31,61,.45);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  overflow:hidden;
}

.topbar{
  display:flex; gap:12px; align-items:center; justify-content:space-between;
  padding:16px 18px;
  border-bottom:1px solid var(--line);
  background: rgba(255,255,255,.03);
}
.title{
  display:flex; flex-direction:column; gap:2px;
}
.title h2{margin:0; font-size:18px}
.title span{color:var(--muted); font-size:12px}

.actions{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  color:var(--text);
  cursor:pointer;
}
.btn:hover{background: rgba(255,255,255,.08)}
.btn.primary{
  border-color: rgba(124,92,255,.45);
  background: rgba(124,92,255,.18);
}
.btn.danger{
  border-color: rgba(255,92,122,.45);
  background: rgba(255,92,122,.14);
}
.btn.small{padding:8px 10px; border-radius:12px; font-size:13px}

.content{padding:18px}
.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:14px;
}

.card{
  background: rgba(255,255,255,.04);
  border:1px solid var(--line);
  border-radius: var(--radius2);
  padding:14px;
}
.card h3{margin:0 0 8px; font-size:14px}
.card p{margin:0; color:var(--muted); font-size:12px}
.card .big{font-size:24px; margin-top:6px; color:var(--text); font-weight:700}

.kpi{grid-column: span 3}
@media (max-width: 1050px){
  .app{grid-template-columns: 1fr}
  .sidebar{position:relative; height:auto}
  .kpi{grid-column: span 6}
}
@media (max-width: 680px){
  .kpi{grid-column: span 12}
}

.table-wrap{
  overflow:auto;
  border-radius: var(--radius2);
  border:1px solid var(--line);
}
table{
  width:100%;
  border-collapse: collapse;
  min-width: 920px;
}
th,td{
  padding:10px 12px;
  border-bottom:1px solid var(--line);
  vertical-align:top;
  font-size:14px;
}
th{
  text-align:left;
  color:var(--muted);
  font-weight:600;
  background: rgba(255,255,255,.03);
  position:sticky;
  top:0;
}
tr:hover td{background: rgba(255,255,255,.03)}
.muted{color:var(--muted); font-size:12px}
.pill{
  display:inline-flex;
  align-items:center;
  padding:2px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  color:var(--muted);
  font-size:12px;
}
.pill.good{border-color:rgba(46,233,166,.35); background: rgba(46,233,166,.10); color:#c8ffe9}
.pill.warn{border-color:rgba(255,204,102,.35); background: rgba(255,204,102,.10); color:#fff0c8}

.form{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:12px;
}
.field{grid-column: span 6}
.field.full{grid-column: span 12}
label{display:block; margin-bottom:6px; color:var(--muted); font-size:12px}
input,select,textarea{
  width:100%;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(10,16,30,.65);
  color:var(--text);
  outline:none;
}
textarea{min-height:110px; resize:vertical}
input:focus,select:focus,textarea:focus{
  border-color: rgba(124,92,255,.55);
  box-shadow: 0 0 0 4px rgba(124,92,255,.12);
}

.notice{
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
}
.notice.error{border-color: rgba(255,92,122,.45); background: rgba(255,92,122,.10)}
.footer-actions{display:flex; gap:10px; align-items:center; flex-wrap:wrap}

.login-shell{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:22px;
}
.login-card{
  width:min(720px, 100%);
  background: rgba(16,31,61,.60);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:18px;
  backdrop-filter: blur(10px);
}
.login-head{
  display:flex; align-items:center; gap:12px;
  padding:8px 6px 14px;
  border-bottom:1px solid var(--line);
  margin-bottom:14px;
}
.login-head h2{margin:0; font-size:18px}
.login-head p{margin:2px 0 0; color:var(--muted); font-size:12px}
