:root{
  --bg: #0b1220;
  --panel: rgba(255,255,255,.06);
  --panel2: rgba(255,255,255,.04);
  --border: rgba(255,255,255,.10);
  --border2: rgba(255,255,255,.08);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.65);
  --muted2: rgba(255,255,255,.52);
  --brand: #2a5bff;
  --danger: #ff4d5a;
  --good: rgba(80, 200, 120, .22);
  --warn: rgba(255, 200, 80, .22);
  --bad: rgba(255, 80, 80, .22);
  --shadow: 0 18px 55px rgba(0,0,0,.35);
  --radius: 16px;
}

* { box-sizing: border-box; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:
    radial-gradient(1200px 700px at 20% -10%, rgba(42,91,255,.22), transparent 55%),
    radial-gradient(1000px 700px at 100% 0%, rgba(0,255,190,.10), transparent 55%),
    var(--bg);
  color: var(--text);
}

a{ color: inherit; text-decoration:none; }
h1,h2,h3{ margin:0 0 10px; letter-spacing: -0.3px; }
p{ margin: 0 0 10px; }
.muted{ color: var(--muted); }
.small{ font-size: 12px; }
.w-full{ width:100%; }

.app-shell{
  min-height: 100vh;
  display:flex;
}

.sidebar{
  width: 270px;
  padding: 18px 14px;
  border-right: 1px solid var(--border2);
  background: rgba(10,16,30,.75);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 10px 10px 16px;
  border-bottom: 1px solid var(--border2);
  margin-bottom: 12px;
}

.logo-mark{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 800;
  background: rgba(42,91,255,.18);
  border: 1px solid rgba(42,91,255,.35);
}

.brand-text .brand-name{
  font-weight: 800;
}
.brand-text .brand-sub{
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.nav{
  display:flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 6px;
}

.nav-item{
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  border: 1px solid transparent;
  background: transparent;
}
.nav-item:hover{
  color: var(--text);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border2);
}

.sidebar-footer{
  margin-top: auto;
  padding: 12px 10px;
  border-top: 1px solid var(--border2);
}

.user-chip{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border2);
}
.user-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(80, 200, 120, .9);
  box-shadow: 0 0 0 4px rgba(80, 200, 120, .12);
}
.user-email{
  font-size: 13px;
  color: var(--muted);
  max-width: 190px;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main{
  flex: 1;
  min-width: 0;
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border2);
  background: rgba(11,18,32,.72);
  backdrop-filter: blur(10px);
}
.topbar-inner{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
}
.page-title{
  font-weight: 800;
  color: rgba(255,255,255,.90);
}
.topbar-actions{
  display:flex;
  gap: 10px;
  align-items:center;
}

.content{
  padding: 22px 22px 40px;
  max-width: 1200px;
}

.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-pad{ padding: 18px; }

.grid{
  display:grid;
  gap: 14px;
}
.grid-3{
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 980px){
  .sidebar{ display:none; }
  .grid-3{ grid-template-columns: 1fr; }
}

.stat{
  padding: 16px;
}
.stat .label{
  font-size: 12px;
  color: var(--muted2);
}
.stat .value{
  font-size: 22px;
  font-weight: 900;
  margin-top: 6px;
}

.table-wrap{
  overflow:auto;
  border-radius: 14px;
  border: 1px solid var(--border2);
  background: rgba(0,0,0,.12);
}

.table{
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}
.table th, .table td{
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  vertical-align: top;
}
.table th{
  text-align:left;
  font-size: 12px;
  color: var(--muted2);
  letter-spacing: .2px;
  font-weight: 700;
  background: rgba(255,255,255,.03);
}
.table td .sub{
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border2);
  color: rgba(255,255,255,.88);
  white-space: nowrap;
}
.pill::before{
  content:"";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.7);
}
.pill-green{ background: var(--good); }
.pill-amber{ background: var(--warn); }
.pill-red{ background: var(--bad); }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(42,91,255,.45);
  background: rgba(42,91,255,.92);
  color: white;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover{ filter: brightness(1.05); }
.btn-secondary{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
}
.btn-ghost{
  border: 1px solid var(--border);
  background: transparent;
  color: rgba(255,255,255,.90);
}
.btn-danger{
  border: 1px solid rgba(255,77,90,.55);
  background: rgba(255,77,90,.92);
}

.form{
  display:flex;
  flex-direction: column;
  gap: 10px;
}
label{
  font-size: 12px;
  color: var(--muted2);
  margin-top: 6px;
}
input, select, textarea{
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border2);
  background: rgba(0,0,0,.22);
  color: var(--text);
}
textarea{ resize: vertical; }

.alert{
  background: rgba(255, 80, 80, .14);
  border: 1px solid rgba(255, 80, 80, .35);
  padding: 12px;
  border-radius: 12px;
  margin: 10px 0;
}

.auth-wrap{
  max-width: 520px;
  margin: 28px auto;
}
.auth-title{
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 6px;
}
.auth-sub{
  color: var(--muted);
  margin-bottom: 10px;
}
