:root{
  --bg-200:#0f1115;
  --bg-250:#121522;
  --bg-300:#171a21;
  --panel:#151a24;
  --border:#2a2f3a;

  --white-90:#e8eaf0;
  --white-70:#aeb6c6;
  --muted:#94a3b8;

  --accent:#6aa9ff;
  --danger:#ff6b6b;
  --ok:#34d399;

  --shadow:0 12px 30px rgba(0,0,0,.35);
  --r:16px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

html[data-theme="light"]{
  --bg-200:#f4f6fb;
  --bg-250:#ffffff;
  --bg-300:#f0f3f9;
  --panel:#ffffff;
  --border:#dde3ee;

  --white-90:#101828;
  --white-70:#344054;
  --muted:#667085;

  --accent:#2563eb;
  --danger:#dc2626;
  --ok:#059669;

  --shadow:0 12px 30px rgba(16,24,40,.10);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  background:radial-gradient(1200px 600px at 15% -10%, rgba(106,169,255,.14), transparent 55%),
             radial-gradient(900px 500px at 90% 0%, rgba(52,211,153,.10), transparent 55%),
             var(--bg-200);
  color:var(--white-90);
}

a{color:inherit;text-decoration:none}
.wrap{max-width:1200px;margin:0 auto;padding:22px}
.topbar{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:14px 16px;border:1px solid var(--border);
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border-radius:var(--r);box-shadow:var(--shadow);
}
.brand{display:flex;align-items:center;gap:10px}
.logo{
  width:38px;height:38px;border-radius:12px;
  background:linear-gradient(135deg, rgba(106,169,255,.9), rgba(52,211,153,.7));
  box-shadow:0 10px 20px rgba(0,0,0,.25);
}
.brand .t{font-weight:900;letter-spacing:.2px}
.nav{display:flex;gap:10px;flex-wrap:wrap}
.pill{
  padding:8px 10px;border:1px solid var(--border);border-radius:999px;
  color:var(--white-70);background:rgba(255,255,255,.03);
}
.pill.active{border-color:rgba(106,169,255,.55);color:var(--white-90)}
.right{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.small{color:var(--muted);font-size:.9rem}
.btn{
  display:inline-flex;align-items:center;gap:8px;
  padding:9px 12px;border-radius:12px;border:1px solid var(--border);
  background:rgba(255,255,255,.03);color:var(--white-90);
  cursor:pointer;
}
.btn:hover{border-color:rgba(106,169,255,.55)}
.btn.primary{background:rgba(106,169,255,.16);border-color:rgba(106,169,255,.55)}
.btn.danger{background:rgba(255,107,107,.12);border-color:rgba(255,107,107,.45)}
.grid{
  display:grid;grid-template-columns:repeat(12,1fr);gap:14px;margin-top:16px;
}
.card{
  grid-column:span 12;
  border:1px solid var(--border);background:rgba(255,255,255,.03);
  border-radius:var(--r);box-shadow:var(--shadow);
  padding:14px;
}
@media(min-width:900px){
  .span4{grid-column:span 4}
  .span6{grid-column:span 6}
  .span8{grid-column:span 8}
}
.hrow{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.h1{margin:0;font-size:18px;font-weight:900}
.kpi{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}
.k{
  padding:10px 12px;border-radius:14px;border:1px solid var(--border);
  background:rgba(0,0,0,.12);min-width:160px;
}
.k .v{font-weight:900;font-size:18px}
.k .l{color:var(--muted);font-size:.85rem;margin-top:3px}
.badge{padding:6px 10px;border-radius:999px;border:1px solid var(--border);font-weight:800;font-size:.85rem}
.badge.ok{border-color:rgba(52,211,153,.55);background:rgba(52,211,153,.10)}
.badge.down{border-color:rgba(255,107,107,.55);background:rgba(255,107,107,.10)}
.table{width:100%;border-collapse:separate;border-spacing:0 10px;margin-top:8px}
.table th{color:var(--muted);font-size:.85rem;text-align:left;padding:0 10px}
.table td{
  background:rgba(255,255,255,.03);
  border:1px solid var(--border);
  padding:12px 10px;
}
.table tr td:first-child{border-top-left-radius:14px;border-bottom-left-radius:14px}
.table tr td:last-child{border-top-right-radius:14px;border-bottom-right-radius:14px}
.input, textarea{
  width:100%;
  padding:10px 12px;border-radius:12px;
  border:1px solid var(--border);background:rgba(0,0,0,.10);
  color:var(--white-90);outline:none;
}
html[data-theme="light"] .input, html[data-theme="light"] textarea{
  background:rgba(0,0,0,.03);
}
.row{display:grid;grid-template-columns:1fr;gap:10px}
@media(min-width:760px){.row{grid-template-columns:1fr 1fr}}
.help{color:var(--muted);font-size:.9rem;margin-top:6px}
hr.sep{border:none;border-top:1px solid var(--border);margin:12px 0}

/* ===== Auth Page ===== */
.auth-body{
  min-height:100vh;
  background: radial-gradient(900px 480px at 20% 10%, rgba(106,169,255,.10), transparent 60%),
              radial-gradient(900px 480px at 70% 0%, rgba(43,255,210,.08), transparent 55%),
              var(--bg-200);
  color:var(--white-90);
}

.auth-wrap{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:16px;
  padding:28px 18px;
  max-width:960px;
  margin:0 auto;
}

.auth-brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  border:1px solid var(--border);
  border-radius:18px;
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  box-shadow: var(--shadow);
}

.brand-badge{
  width:40px;height:40px;border-radius:12px;
  background:linear-gradient(135deg, rgba(106,169,255,.95), rgba(43,255,210,.75));
}

.brand-title{font-weight:900;font-size:18px;line-height:1;}
.brand-sub{color:var(--white-70);font-size:13px;margin-top:2px;}

.auth-card{max-width:520px;}

.auth-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.h1{font-size:22px;font-weight:950;letter-spacing:.2px;}
.muted{color:var(--white-70);}

.pill{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
  color:var(--white-70);
  font-weight:800;
  font-size:12px;
}

.card{
  border:1px solid var(--border);
  background:var(--bg-250);
  border-radius:18px;
  box-shadow:var(--shadow);
  padding:16px;
}

.alert{
  padding:10px 12px;
  border-radius:14px;
  font-weight:850;
  margin:10px 0 12px;
}
.alert.error{border:1px solid rgba(255,107,107,.45); background:rgba(255,107,107,.10); color:var(--white-90);}

.form{margin-top:10px;}
.field{display:flex;flex-direction:column;gap:6px;}
.field span{font-weight:850;color:var(--white-70);font-size:13px;}

.field input{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background:var(--bg-200);
  color:var(--white-90);
  outline:none;
}

.field input:focus{
  border-color: rgba(106,169,255,.55);
  box-shadow: 0 0 0 4px rgba(106,169,255,.12);
}

.grid-2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:10px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
  color:var(--white-90);
  text-decoration:none;
  font-weight:900;
}

.btn.primary{
  background:rgba(106,169,255,.14);
  border-color:rgba(106,169,255,.35);
}

.btn.ghost{background:transparent;}

.help{
  margin-top:12px;
  color:var(--white-70);
  font-size:13px;
  line-height:1.4;
}

.help code{
  padding:2px 6px;
  border:1px solid var(--border);
  border-radius:10px;
  background:rgba(255,255,255,.03);
}

.auth-footer{
  font-size:12px;
  padding:0 2px;
}

/* Mobile */
@media (max-width: 640px){
  .auth-wrap{padding:20px 14px;}
  .auth-card{max-width:100%;}
  .grid-2{grid-template-columns:1fr;}
}

/* ===== LOGIN (standalone) — force center, ignore app layout ===== */
html, body { height: 100%; }

body.auth-body{
  margin:0;
  min-height:100vh;
  display:grid;
  place-items:center;   /* hard center both axis */
  padding:28px 16px;
}

/* if your main app adds sidebar padding via body or wrapper, neutralize it here */
body.auth-body .app,
body.auth-body .layout,
body.auth-body .wrap{
  padding:0 !important;
  margin:0 !important;
  min-height:auto !important;
}

.auth-wrap{
  width:100%;
  max-width:720px;
  display:flex;
  flex-direction:column;
  gap:16px;
  align-items:center;   /* center children horizontally */
}

/* keep brand + card same width, centered */
.auth-brand,
.auth-card{
  width:100%;
  max-width:520px;
}

@media (max-width: 640px){
  body.auth-body{ padding:20px 14px; }
  .auth-brand, .auth-card{ max-width:100%; }
  .grid-2{ grid-template-columns:1fr !important; }
}

