:root{
  --bg:#121826;
  --bg2:#0b1020;
  --card:#182234;
  --card2:#202b40;
  --text:#e8edf7;
  --muted:#9aa7bd;
  --primary:#60a5fa;
  --primary2:#3b82f6;
  --accent:#22c55e;
  --border:#2d3a52;
  --danger:#ef4444;
  --ok:#22c55e;
  --warn:#f59e0b;
  --shadow:0 18px 45px rgba(0,0,0,.28);
  --radius:16px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:Inter,Arial,Helvetica,sans-serif;
  background:
    radial-gradient(circle at top left,rgba(96,165,250,.14),transparent 34%),
    linear-gradient(135deg,var(--bg2),var(--bg));
  color:var(--text);
  min-height:100vh;
}

a{color:var(--primary);text-decoration:none}
a:hover{color:#93c5fd}

.topbar{
  height:68px;
  background:rgba(13,20,35,.88);
  backdrop-filter:blur(14px);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 28px;
  position:sticky;
  top:0;
  z-index:10;
  border-bottom:1px solid rgba(255,255,255,.08);
  box-shadow:0 10px 30px rgba(0,0,0,.24);
}
.brand a{color:#fff;font-size:20px;letter-spacing:.01em}
.user{color:var(--muted);font-size:14px}
.user a{color:#bfdbfe;font-weight:700}

.layout{display:flex;min-height:calc(100vh - 68px)}
.sidebar{
  width:260px;
  background:rgba(18,27,43,.78);
  border-right:1px solid rgba(255,255,255,.08);
  padding:18px;
  position:sticky;
  top:68px;
  height:calc(100vh - 68px);
  backdrop-filter:blur(12px);
}
.sidebar a{
  display:block;
  padding:6px 9px;
  border-radius:13px;
  color:#c7d2e5;
  margin-bottom:6px;
  transition:.18s ease;
}
.sidebar a:hover,
.sidebar a.active{
  background:linear-gradient(135deg,rgba(96,165,250,.22),rgba(34,197,94,.10));
  color:#fff;
  box-shadow:inset 0 0 0 1px rgba(96,165,250,.22);
  transform:translateX(2px);
}

.content{flex:1;padding:30px;min-width:0}
.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:20px}
.page-head h1{margin:0;font-size:30px;letter-spacing:-.03em}

.card{
  background:linear-gradient(180deg,var(--card),#151f31);
  border:1px solid rgba(255,255,255,.08);
  border-radius:var(--radius);
  padding:23px;
  margin-bottom:20px;
  box-shadow:var(--shadow);
  font-size: 0.9rem;
}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:16px}
.stat{font-size:36px;font-weight:850;letter-spacing:-.04em;color:#fff}
.muted{color:var(--muted)}

.table-wrap{
  overflow:auto;
  border-radius:15px;
  border:1px solid rgba(255,255,255,.08);
  background:var(--card);
}
table{width:100%;border-collapse:collapse;background:transparent;min-width:820px}
th,td{padding:13px 14px;border-bottom:1px solid rgba(255,255,255,.07);text-align:left;vertical-align:top}
th{
  background:#111a2b;
  font-size:12px;
  text-transform:uppercase;
  color:#93a4bd;
  letter-spacing:.05em;
  white-space:nowrap;
}
tr:hover td{background:rgba(96,165,250,.045)}
tr:last-child td{border-bottom:0}

.btn,button{
  display:inline-block;
  background:linear-gradient(135deg,var(--primary2),#2563eb);
  color:#fff;
  border:0;
  border-radius:12px;
  padding:10px 15px;
  cursor:pointer;
  box-shadow:0 10px 22px rgba(37,99,235,.25);
  transition:.18s ease;
  font-size: 0.8rem;
}
.btn:hover,button:hover{background:linear-gradient(135deg,#60a5fa,#2563eb);color:#fff;transform:translateY(-1px)}
.btn.secondary{background:#334155;box-shadow:none}
.btn.danger{background:linear-gradient(135deg,#ef4444,#b91c1c);box-shadow:0 10px 22px rgba(239,68,68,.18)}
.btn.light{background:rgba(96,165,250,.15);color:#bfdbfe;box-shadow:inset 0 0 0 1px rgba(96,165,250,.25)}
.btn.small{padding:7px 10px;font-size:13px;border-radius:10px}

input,select,textarea{
  width:100%;
  padding:12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#0f1728;
  color:var(--text);
  outline:none;
}
input:focus,select:focus,textarea:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 4px rgba(96,165,250,.14);
}
input::placeholder,textarea::placeholder{color:#6f7e95}
label{font-size:14px;color:#dbe4f2}
.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:15px}
.actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}

.flash{
  background:rgba(34,197,94,.12);
  border:1px solid rgba(34,197,94,.28);
  color:#bbf7d0;
  padding:13px 14px;
  border-radius:13px;
  margin-bottom:16px;
}
.login{max-width:430px;margin:75px auto}

.badge{
  display:inline-block;
  padding:5px 10px;
  border-radius:999px;
  background:rgba(96,165,250,.16);
  color:#bfdbfe;
  font-size:12px;
  border:1px solid rgba(96,165,250,.22);
}
.badge.ok{background:rgba(34,197,94,.14);color:#bbf7d0;border-color:rgba(34,197,94,.24)}
.badge.warn{background:rgba(245,158,11,.14);color:#fde68a;border-color:rgba(245,158,11,.26)}
.badge.danger{background:rgba(239,68,68,.14);color:#fecaca;border-color:rgba(239,68,68,.25)}
.badge.muted{background:rgba(148,163,184,.14);color:#cbd5e1;border-color:rgba(148,163,184,.20)}

.searchbar{display:flex;gap:10px;align-items:center;justify-content:space-between;margin-bottom:15px}
.search{max-width:380px}
.detail-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:13px}
.kv{padding:13px;border:1px solid rgba(255,255,255,.08);border-radius:14px;background:#111a2b}
.kv b{display:block;font-size:12px;text-transform:uppercase;color:#8fa1bb;margin-bottom:6px;letter-spacing:.04em}
.section-title{display:flex;justify-content:space-between;align-items:center;gap:12px}
.empty{padding:16px;color:#9aa7bd;background:#111a2b;border-radius:13px;border:1px dashed rgba(255,255,255,.12)}

::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-track{background:#0f1728}
::-webkit-scrollbar-thumb{background:#334155;border-radius:999px}
::-webkit-scrollbar-thumb:hover{background:#475569}

@media(max-width:850px){
  .layout{display:block}
  .sidebar{position:static;width:auto;height:auto;display:grid;grid-template-columns:repeat(2,1fr);gap:6px}
  .sidebar a{margin-bottom:0}
  .content{padding:17px}
  .topbar{padding:0 15px}
  .page-head{display:block}
  .page-head h1{font-size:25px;margin-bottom:12px}
  .actions{display:block}
  .actions .btn{margin-bottom:6px}
  .grid{grid-template-columns:1fr}
}
