:root{
  --bg:#0b111b;
  --bg-2:#0f172a;
  --surface:rgba(16,24,40,.86);
  --surface-2:rgba(24,32,52,.9);
  --border:rgba(148,163,184,.18);
  --border-strong:rgba(148,163,184,.32);
  --text:#f8fafc;
  --muted:rgba(148,163,184,.9);
  --muted-2:rgba(148,163,184,.65);
  --accent:#38bdf8;
  --accent-2:#2dd4bf;
  --good:#22c55e;
  --warn:#f59e0b;
  --danger:#f43f5e;
  --radius-xl:20px;
  --radius-lg:16px;
  --radius-md:12px;
  --shadow-lg:0 24px 60px rgba(2,6,23,.45);
  --shadow-md:0 16px 40px rgba(2,6,23,.35);
  --font-body:"Manrope","Segoe UI","Helvetica Neue",Arial,sans-serif;
  --font-head:"Space Grotesk","Manrope","Segoe UI",sans-serif;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font-body);
  color:var(--text);
  background:
    radial-gradient(900px 600px at 10% 10%, rgba(56,189,248,.18), transparent 60%),
    radial-gradient(900px 600px at 85% 15%, rgba(45,212,191,.16), transparent 60%),
    radial-gradient(700px 500px at 50% 90%, rgba(245,158,11,.12), transparent 65%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

h1,h2,h3{margin:0; font-family:var(--font-head)}
h2{font-size:20px}
h3{font-size:16px}
a{color:var(--text); text-decoration:none}
a:hover{color:var(--accent)}
button,input,select{font-family:inherit}

.container{
  max-width:1480px;
  margin:0 auto;
  padding:20px;
  display:grid;
  grid-template-columns:280px 1fr;
  gap:20px;
}

.sidebar{
  position:sticky;
  top:20px;
  height:calc(100vh - 40px);
  border:1px solid var(--border);
  border-radius:var(--radius-xl);
  background:var(--surface);
  backdrop-filter:blur(18px);
  box-shadow:var(--shadow-lg);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.brand{
  padding:16px 18px;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.brand-left{display:flex; align-items:center; gap:12px; min-width:0}
.brand h1{font-size:15px; letter-spacing:.2px}
.brand .sub{font-size:12px; color:var(--muted-2)}
.logo{
  width:40px;
  height:40px;
  border-radius:14px;
  background:linear-gradient(135deg, rgba(56,189,248,.9), rgba(45,212,191,.85));
  box-shadow:0 12px 30px rgba(56,189,248,.25);
  flex:0 0 auto;
}

.pill{
  font-size:11px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid rgba(56,189,248,.35);
  background:rgba(56,189,248,.12);
  color:rgba(226,232,240,.9);
  white-space:nowrap;
}

.nav{
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.nav a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 14px;
  border-radius:var(--radius-lg);
  border:1px solid transparent;
  background:rgba(255,255,255,.03);
  color:var(--text);
  transition:all .16s ease;
}
.nav a:hover{
  border-color:var(--border);
  background:rgba(255,255,255,.06);
}
.nav a.active{
  border-color:rgba(56,189,248,.4);
  background:rgba(56,189,248,.12);
  box-shadow:0 10px 25px rgba(2,6,23,.25);
}
.nav a .pill{
  border-color:rgba(148,163,184,.3);
  background:rgba(15,23,42,.6);
  color:var(--muted);
}

.sidebar-footer{
  margin-top:auto;
  padding:14px 16px 18px;
  border-top:1px solid var(--border);
  display:flex;
  flex-direction:column;
  gap:12px;
}

.main{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:16px;
}

.topbar{
  position:sticky;
  top:20px;
  z-index:3;
  padding:16px 18px;
  border:1px solid var(--border);
  border-radius:var(--radius-xl);
  background:var(--surface);
  backdrop-filter:blur(18px);
  box-shadow:var(--shadow-md);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.titleblock{min-width:0}
.titleblock .muted{margin-top:4px}
.actions{display:flex; gap:10px; flex-wrap:wrap}

.btn{
  appearance:none;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  color:var(--text);
  padding:10px 16px;
  border-radius:999px;
  font-size:13px;
  font-weight:600;
  letter-spacing:.2px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  transition:transform .06s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.btn:hover{
  border-color:var(--border-strong);
  background:rgba(255,255,255,.08);
}
.btn:active{transform:scale(.98)}
.btn.primary{
  border-color:rgba(56,189,248,.5);
  background:linear-gradient(135deg, rgba(56,189,248,.24), rgba(45,212,191,.18));
  box-shadow:0 12px 30px rgba(56,189,248,.15);
}
.btn.danger{
  border-color:rgba(244,63,94,.45);
  background:rgba(244,63,94,.12);
  color:#fecdd3;
}
.btn.ghost{
  border-color:rgba(148,163,184,.3);
  background:rgba(15,23,42,.6);
  color:var(--muted);
}
.btn.sm{
  padding:6px 12px;
  font-size:12px;
  border-radius:999px;
}
.btn.full{width:100%}

.card{
  border:1px solid var(--border);
  border-radius:var(--radius-xl);
  background:var(--surface);
  box-shadow:var(--shadow-md);
  padding:18px;
}
.card.solid{background:var(--surface-2)}

.section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.section-head h3{font-size:16px}
.section-sub{margin-top:6px; color:var(--muted); font-size:13px}
.badge{
  font-size:12px;
  padding:6px 12px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.3);
  color:var(--muted);
  background:rgba(15,23,42,.5);
  white-space:nowrap;
}
.badge.warn{
  border-color:rgba(245,158,11,.35);
  color:#fbbf24;
  background:rgba(245,158,11,.12);
}
.badge.bad{
  border-color:rgba(244,63,94,.35);
  color:#fda4af;
  background:rgba(244,63,94,.12);
}

.divider{height:1px; background:var(--border); margin:16px 0}

.stats{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:12px;
}
.stat{
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:12px 14px;
  background:rgba(255,255,255,.03);
}
.stat .k{font-size:12px; color:var(--muted)}
.stat .v{margin-top:6px; font-size:22px; font-weight:700; font-family:var(--font-head)}
.stat .h{margin-top:6px; font-size:12px; color:var(--muted-2)}

.row{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.row-between{justify-content:space-between}
.row-lg{gap:16px}

.input,.file,select{
  border:1px solid var(--border);
  background:rgba(15,23,42,.6);
  color:var(--text);
  padding:11px 12px;
  border-radius:var(--radius-md);
  outline:none;
  min-width:240px;
}
.input.area{
  min-height:110px;
  resize:vertical;
  width:min(520px, 100%);
}
.input::placeholder{color:var(--muted-2)}
.file{padding:9px 12px}
.input:focus,.file:focus,select:focus{
  border-color:rgba(56,189,248,.5);
  box-shadow:0 0 0 4px rgba(56,189,248,.15);
}

.multi-select{
  min-width:240px;
}
.multi-select summary{
  list-style:none;
  cursor:pointer;
  border:1px solid var(--border);
  background:rgba(15,23,42,.6);
  color:var(--text);
  padding:9px 12px;
  border-radius:var(--radius-md);
  font-size:13px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.multi-select summary::-webkit-details-marker{display:none}
.multi-select summary::after{
  content:"▾";
  color:var(--muted-2);
  font-size:12px;
}
.multi-select[open] summary{
  border-color:rgba(56,189,248,.5);
  box-shadow:0 0 0 4px rgba(56,189,248,.15);
}
.multi-select-body{
  margin-top:8px;
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  background:rgba(15,23,42,.6);
  padding:8px 10px;
  max-height:240px;
  overflow:auto;
  display:block;
}
.check{
  display:block;
  padding:4px 0;
  font-size:12px;
}
.check input{margin-right:8px}

.table-wrap{
  overflow:auto;
  border-radius:var(--radius-lg);
  border:1px solid var(--border);
}
.table{
  width:100%;
  border-collapse:collapse;
  min-width:420px;
}
.table th,.table td{
  text-align:left;
  padding:12px;
  font-size:13px;
  border-bottom:1px solid var(--border);
}
.table th{
  color:var(--muted);
  background:rgba(15,23,42,.7);
  font-weight:600;
}
.table tr:hover td{background:rgba(255,255,255,.03)}
.table tr:last-child td{border-bottom:none}
.table .col-num{width:60px}
.table .col-id{width:90px}
.table .col-actions{width:140px}

.cell-title{font-weight:600}

.chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid rgba(56,189,248,.35);
  background:rgba(56,189,248,.12);
  color:rgba(226,232,240,.95);
  font-size:12px;
}

.label{
  font-size:12px;
  color:var(--muted-2);
}
.strong{
  font-weight:700;
  letter-spacing:.2px;
}

.hint{font-size:12px; color:var(--muted-2)}
.muted{color:var(--muted)}
.small{font-size:12px}

.alert{
  border-radius:var(--radius-md);
  padding:10px 12px;
  font-size:12px;
  border:1px solid var(--border);
  background:rgba(15,23,42,.6);
}
.alert.success{
  border-color:rgba(34,197,94,.35);
  background:rgba(34,197,94,.12);
  color:rgba(187,247,208,.9);
}
.alert.error{
  border-color:rgba(244,63,94,.35);
  background:rgba(244,63,94,.12);
  color:rgba(254,205,211,.9);
}

.split{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:16px;
}
.panel{
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  background:rgba(15,23,42,.6);
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.panel-head{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.panel-head h4{
  margin:0;
  font-size:15px;
  font-family:var(--font-head);
}
.list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.list-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border-radius:var(--radius-md);
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
}

.auth{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:20px;
}
.auth-card{
  max-width:520px;
  width:100%;
  display:flex;
  flex-direction:column;
  gap:16px;
}

@media (max-width:1140px){
  .stats{grid-template-columns:repeat(2, minmax(0,1fr))}
}
@media (max-width:900px){
  .container{grid-template-columns:1fr}
  .sidebar{position:relative; height:auto}
  .topbar{position:relative}
  .input,.file{min-width:180px}
}
@media (max-width:640px){
  .stats{grid-template-columns:1fr}
  .split{grid-template-columns:1fr}
  .actions{width:100%}
  .actions .btn{flex:1 1 auto}
}
