:root{
  --bg:#020617;
  --panel:#0f172a;
  --panel2:#111c31;
  --text:#eaf2ff;
  --muted:#94a3b8;
  --line:rgba(148,163,184,.18);
  --blue:#38bdf8;
  --cyan:#67e8f9;
  --purple:#8b5cf6;
  --red:#fb7185;
  --green:#22c55e;
  --shadow:0 28px 90px rgba(0,0,0,.45);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}

body{
  margin:0;
  min-height:100vh;
  font-family:Inter,"Segoe UI",Arial,sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at 18% 15%,rgba(56,189,248,.18),transparent 30%),
    radial-gradient(circle at 82% 8%,rgba(139,92,246,.22),transparent 34%),
    linear-gradient(135deg,#020617,#07111f 50%,#10172d);
  overflow-x:hidden;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px,transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.028) 1px,transparent 1px);
  background-size:44px 44px;
  mask-image:linear-gradient(to bottom,rgba(0,0,0,.6),transparent 75%);
}

a{text-decoration:none;color:inherit}

button,input,select,textarea{
  font-family:inherit;
}

input,select,textarea{
  width:100%;
  background:rgba(2,6,23,.72);
  color:var(--text);
  border:1px solid var(--line);
  border-radius:16px;
  padding:15px 17px;
  margin-bottom:14px;
  outline:none;
  transition:.25s ease;
}

textarea{
  min-height:230px;
  resize:vertical;
  line-height:1.6;
  font-family:Consolas,monospace;
}

input:focus,select:focus,textarea:focus{
  border-color:rgba(103,232,249,.75);
  box-shadow:0 0 0 4px rgba(56,189,248,.12);
}

button{
  border:0;
  border-radius:16px;
  padding:15px 22px;
  font-weight:900;
  color:white;
  cursor:pointer;
  background:linear-gradient(135deg,var(--blue),var(--purple));
  box-shadow:0 16px 38px rgba(56,189,248,.22);
  transition:.25s ease;
}

button:hover{
  transform:translateY(-2px);
  box-shadow:0 20px 48px rgba(139,92,246,.33);
}

/* LOGIN */
.login-body{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}

.login-card{
  width:100%;
  max-width:430px;
  padding:40px;
  border-radius:34px;
  background:
    linear-gradient(180deg,rgba(15,23,42,.88),rgba(15,23,42,.68)),
    radial-gradient(circle at top right,rgba(56,189,248,.14),transparent 36%);
  border:1px solid var(--line);
  box-shadow:var(--shadow);
  backdrop-filter:blur(22px);
  text-align:center;
  animation:fadeUp .55s ease both;
}

.login-logo{
  width:68px;
  height:68px;
  margin:0 auto 24px;
  display:grid;
  place-items:center;
  border-radius:24px;
  background:linear-gradient(135deg,var(--blue),var(--purple));
  box-shadow:0 0 45px rgba(56,189,248,.35);
  font-weight:950;
}

.login-head span{
  display:block;
  color:#7dd3fc;
  font-size:12px;
  font-weight:900;
  letter-spacing:.9px;
  text-transform:uppercase;
}

.login-head h1{
  margin:12px 0 6px;
  font-size:42px;
  line-height:1;
  letter-spacing:-1.4px;
}

.login-head h1 span{
  display:inline;
  color:var(--blue);
  font-size:.45em;
  text-shadow:0 0 24px rgba(56,189,248,.45);
}

.login-head p{
  margin:0 0 28px;
  color:var(--muted);
}

.login-card label{
  display:block;
  text-align:left;
  margin:12px 0 8px;
  color:#cbd5e1;
  font-size:13px;
  font-weight:800;
}

.login-card input{
  height:52px;
}

.login-card button{
  width:100%;
  height:52px;
  margin-top:10px;
}

.login-foot{
  margin-top:22px;
  padding-top:18px;
  border-top:1px solid rgba(148,163,184,.15);
  color:var(--muted);
  font-size:12px;
}

/* APP */
.app-shell{
  display:flex;
  min-height:100vh;
}

.sidebar{
  width:270px;
  padding:28px 22px;
  border-right:1px solid var(--line);
  background:
    linear-gradient(180deg,rgba(2,6,23,.94),rgba(2,6,23,.78)),
    radial-gradient(circle at top,rgba(56,189,248,.13),transparent 35%);
  backdrop-filter:blur(22px);
  position:sticky;
  top:0;
  height:100vh;
}

.brand,.brand-box h1{
  margin:0 0 10px;
  font-size:28px;
  font-weight:950;
  letter-spacing:-1px;
}

.brand span,.brand-box span{
  color:var(--blue);
  text-shadow:0 0 18px rgba(56,189,248,.45);
}

.brand-box{
  margin-bottom:34px;
}

.brand-box small{
  color:var(--muted);
}

.logo-glow{
  width:56px;
  height:56px;
  margin-bottom:14px;
  border-radius:20px;
  background:linear-gradient(135deg,var(--blue),var(--purple));
  box-shadow:0 0 45px rgba(56,189,248,.38);
}

.sidebar nav,.menu{
  display:grid;
  gap:9px;
}

.sidebar nav a,.menu a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:14px 16px;
  border-radius:17px;
  color:#a8b3c7;
  transition:.25s ease;
  border:1px solid transparent;
}

.sidebar nav a:hover,.menu a:hover{
  color:white;
  background:linear-gradient(90deg,rgba(56,189,248,.14),rgba(139,92,246,.08));
  border-color:rgba(56,189,248,.16);
  transform:translateX(4px);
}

.sidebar nav a.logout,.menu a.logout{
  margin-top:12px;
  color:#fecaca;
  background:rgba(251,113,133,.06);
}

.sidebar-footer{
  margin-top:28px;
  padding:14px;
  border-radius:18px;
  background:rgba(15,23,42,.55);
  border:1px solid var(--line);
  color:var(--muted);
  font-size:12px;
}

.main-content{
  flex:1;
  padding:42px 34px;
}

.page-title{
  margin-bottom:26px;
}

.page-title h1{
  margin:0 0 10px;
  font-size:38px;
  line-height:1.1;
  letter-spacing:-1px;
}

.page-title p{
  margin:0;
  color:#a7c7df;
}

.stats-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:18px;
  margin-bottom:24px;
}

.stat-card,.panel-card{
  border:1px solid var(--line);
  background:
    linear-gradient(180deg,rgba(15,23,42,.78),rgba(15,23,42,.58)),
    radial-gradient(circle at top right,rgba(56,189,248,.09),transparent 34%);
  border-radius:28px;
  box-shadow:var(--shadow);
  backdrop-filter:blur(18px);
  animation:fadeUp .45s ease both;
}

.stat-card{
  padding:25px;
}

.stat-card span{
  color:var(--muted);
  font-size:13px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.8px;
}

.stat-card strong{
  display:block;
  font-size:38px;
  margin-top:12px;
}

.panel-card{
  padding:26px;
  margin-bottom:24px;
}

.panel-card h2{
  margin:0 0 22px;
  font-size:25px;
}

.form-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:14px;
}

.form-grid button{
  grid-column:span 2;
}

table{
  width:100%;
  border-collapse:collapse;
}

th,td{
  padding:16px 14px;
  border-bottom:1px solid var(--line);
  text-align:left;
}

th{
  color:var(--muted);
  font-size:13px;
  font-weight:900;
}

td{
  color:#dbeafe;
}

.badge{
  display:inline-flex;
  padding:7px 11px;
  border-radius:999px;
  background:rgba(56,189,248,.12);
  color:#7dd3fc;
  font-size:12px;
  font-weight:900;
  border:1px solid rgba(56,189,248,.18);
}

.alert{
  padding:14px 16px;
  border-radius:16px;
  margin-bottom:16px;
  border:1px solid var(--line);
}

.alert.success{
  background:rgba(34,197,94,.12);
  color:#86efac;
}

.alert.error{
  background:rgba(239,68,68,.12);
  color:#fca5a5;
}

.log-line{
  padding:12px 14px;
  border-radius:15px;
  margin-bottom:9px;
  background:rgba(2,6,23,.58);
  border:1px solid var(--line);
  color:var(--muted);
  font-family:Consolas,monospace;
  font-size:13px;
}

.log-line.success{color:#86efac}
.log-line.failed{color:#fca5a5}
.log-line.running{color:#7dd3fc}

@keyframes fadeUp{
  from{opacity:0;transform:translateY(14px)}
  to{opacity:1;transform:translateY(0)}
}

@media(max-width:1000px){
  .stats-grid,.form-grid{
    grid-template-columns:1fr;
  }

  .form-grid button{
    grid-column:auto;
  }
}

@media(max-width:760px){
  .app-shell{
    display:block;
  }

  .sidebar{
    width:100%;
    height:auto;
    position:relative;
  }

  .sidebar nav,.menu{
    grid-template-columns:repeat(2,1fr);
  }

  .main-content{
    padding:24px 18px;
  }

  .page-title h1{
    font-size:30px;
  }

  .login-card{
    padding:32px 24px;
  }
}


.brand-box{
  display:flex;
  align-items:center;
  gap:14px;
  padding:14px;
  border-radius:24px;
  background:rgba(15,23,42,.55);
  border:1px solid rgba(148,163,184,.14);
  margin-bottom:28px;
}

.brand-icon{
  width:54px;
  height:54px;
  display:grid;
  place-items:center;
  border-radius:18px;
  background:linear-gradient(135deg,#38bdf8,#8b5cf6);
  box-shadow:0 0 34px rgba(56,189,248,.34);
  font-size:15px;
  font-weight:950;
}

.brand-box h1{
  margin:0;
  font-size:23px;
  line-height:1;
}

.brand-box small{
  display:block;
  margin-top:6px;
  color:#94a3b8;
  font-weight:700;
}

.menu a{
  position:relative;
  overflow:hidden;
}

.menu a i{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:13px;
  background:rgba(56,189,248,.08);
  color:#7dd3fc;
  font-style:normal;
}

.menu a:hover i{
  background:linear-gradient(135deg,#38bdf8,#8b5cf6);
  color:#fff;
}

.menu a.logout i{
  background:rgba(251,113,133,.12);
  color:#fb7185;
}

.sidebar-footer{
  margin-top:30px;
  padding:16px;
  border-radius:22px;
  background:linear-gradient(135deg,rgba(56,189,248,.10),rgba(139,92,246,.08));
  border:1px solid rgba(148,163,184,.14);
}

.sidebar-footer strong{
  display:block;
  font-size:14px;
}

.sidebar-footer span{
  display:block;
  margin-top:5px;
  font-size:12px;
  color:#94a3b8;
}

#live-log{
  max-height:350px;
  overflow:auto;
  padding:10px;
  border-radius:20px;
  background:rgba(2,6,23,.6);
  border:1px solid rgba(148,163,184,.15);
}

.log-line{
  display:flex;
  gap:10px;
  padding:10px 12px;
  margin-bottom:8px;
  border-radius:14px;
  font-size:13px;
  font-family:Consolas,monospace;
  background:rgba(15,23,42,.5);
  border:1px solid rgba(148,163,184,.1);
}

.log-time{
  color:#64748b;
}

.log-domain{
  color:#7dd3fc;
  font-weight:700;
}

.log-msg{
  flex:1;
}

/* STATUS */
.log-line.success{
  border-left:3px solid #22c55e;
  color:#86efac;
}

.log-line.failed{
  border-left:3px solid #ef4444;
  color:#fca5a5;
}

.log-line.running{
  border-left:3px solid #38bdf8;
  color:#7dd3fc;
}

.toast{
  position:fixed;
  bottom:30px;
  right:30px;
  padding:14px 18px;
  border-radius:14px;
  font-size:14px;
  font-weight:700;
  opacity:0;
  transform:translateY(20px);
  transition:.3s ease;
  z-index:9999;
}

.toast.show{
  opacity:1;
  transform:translateY(0);
}

.toast.success{
  background:#22c55e;
}

.toast.error{
  background:#ef4444;
}

.btn-small{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 12px;
  border-radius:12px;
  font-size:12px;
  font-weight:900;
  background:rgba(56,189,248,.12);
  color:#7dd3fc;
  border:1px solid rgba(56,189,248,.18);
  margin-right:6px;
  cursor:pointer;
}

.btn-danger{
  background:rgba(251,113,133,.12);
  color:#fda4af;
  border-color:rgba(251,113,133,.2);
}

.modal-backdrop{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(2,6,23,.72);
  backdrop-filter:blur(10px);
  z-index:9999;
  align-items:center;
  justify-content:center;
  padding:20px;
}

.modal-backdrop.show{
  display:flex;
}

.modal-card{
  width:100%;
  max-width:460px;
  padding:26px;
  border-radius:26px;
  background:rgba(15,23,42,.95);
  border:1px solid rgba(148,163,184,.18);
  box-shadow:0 30px 90px rgba(0,0,0,.55);
}

.modal-card h2{
  margin-top:0;
}

.modal-actions{
  display:flex;
  gap:10px;
}

.badge.generated{
  background:rgba(34,197,94,.14);
  color:#86efac;
  border-color:rgba(34,197,94,.25);
}

.badge.pending{
  background:rgba(56,189,248,.12);
  color:#7dd3fc;
}

.badge.failed{
  background:rgba(239,68,68,.12);
  color:#fca5a5;
  border-color:rgba(239,68,68,.22);
}

.live-log-box {
  background: #020617;
  border-radius: 12px;
  padding: 15px;
  max-height: 300px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 13px;
}

.log-line {
  padding: 6px 10px;
  margin-bottom: 5px;
  border-radius: 6px;
}

.log-line.success {
  color: #22c55e;
}

.log-line.failed {
  color: #ef4444;
}

.log-line.running {
  color: #38bdf8;
}