:root{
  --bg1:#070a14;
  --bg2:#0b1020;
  --panel:rgba(18,26,51,.86);
  --panel2:rgba(10,15,30,.7);
  --text:#e5e7eb;
  --muted:#94a3b8;
  --accent:#60a5fa;
  --accent2:#a78bfa;
  --ok:#34d399;
  --warn:#fbbf24;
  --danger:#fb7185;
  --border:rgba(148,163,184,.18);
  --shadow:0 18px 50px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(96,165,250,.18), transparent 60%),
    radial-gradient(800px 500px at 80% 20%, rgba(167,139,250,.14), transparent 60%),
    linear-gradient(120deg,var(--bg2),var(--bg1));
}

a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}

.app{
  display:grid;
  grid-template-columns:260px 1fr;
  min-height:100vh;
}

.sidebar{
  position:sticky;
  top:0;
  height:100vh;
  padding:18px;
  border-right:1px solid var(--border);
  background:linear-gradient(180deg, rgba(18,26,51,.92), rgba(10,15,30,.75));
  backdrop-filter: blur(10px);
}

.sb-brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px;
  border:1px solid var(--border);
  border-radius:16px;
  background:rgba(255,255,255,.03);
  box-shadow:var(--shadow);
}
.sb-logo{
  width:42px;height:42px;border-radius:14px;
  display:grid;place-items:center;
  font-weight:900; letter-spacing:.5px;
  background:linear-gradient(135deg, rgba(96,165,250,.32), rgba(167,139,250,.22));
  border:1px solid var(--border);
}
.sb-title{font-weight:800}
.sb-sub{color:var(--muted);font-size:12px;margin-top:2px}

.sb-nav{margin-top:14px;display:grid;gap:8px}
.sb-link{
  display:flex;align-items:center;gap:10px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
  color:var(--text);
  opacity:.92;
}
.sb-link:hover{opacity:1;background:rgba(255,255,255,.05)}
.sb-link.danger{border-color:rgba(251,113,133,.22); color:#fecdd3}
.sb-footer{position:absolute;left:18px;right:18px;bottom:18px}

.main{
  padding:22px;
}

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

.page-title{font-size:20px;font-weight:900;margin:0}
.page-sub{color:var(--muted);margin:6px 0 0}

.grid{
  display:grid;
  grid-template-columns:1fr;
  gap:16px;
}
@media(min-width:1050px){ .grid{grid-template-columns:1.2fr .8fr;} }

.card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:18px;
  padding:16px;
  box-shadow:var(--shadow);
  backdrop-filter: blur(10px);
}

h1,h2,h3{margin:0 0 10px}
h2{font-size:14px;color:#cbd5e1;font-weight:800;text-transform:uppercase;letter-spacing:.08em}

label{display:block;font-size:13px;color:#cbd5e1;margin:10px 0 6px}
input[type=text],input[type=password],input[type=number],textarea{
  width:100%;
  padding:11px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(11,16,32,.6);
  color:var(--text);
  outline:none;
}
textarea{min-height:120px;resize:vertical}
small{color:var(--muted)}

.row{display:flex;gap:12px;flex-wrap:wrap}
.row > *{flex:1}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:11px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:linear-gradient(135deg, rgba(96,165,250,.18), rgba(167,139,250,.14));
  color:var(--text);
  cursor:pointer;
  font-weight:800;
  letter-spacing:.2px;
}
.btn:hover{filter:brightness(1.06)}
.btn:disabled{
  opacity:.55;
  cursor:not-allowed;
  filter:none;
}
.btn.secondary{
  background:rgba(255,255,255,.05);
}
.btn.danger{
  background:rgba(251,113,133,.10);
  border-color:rgba(251,113,133,.22);
}

.badges{display:flex;gap:10px;flex-wrap:wrap;margin-top:8px}
.badge{
  display:inline-flex;
  gap:8px;
  align-items:center;
  font-size:12px;
  padding:7px 11px;
  border-radius:999px;
  border:1px solid var(--border);
  color:#cbd5e1;
  background:rgba(255,255,255,.03);
}
.badge.ok{border-color:rgba(52,211,153,.28); color:#a7f3d0}
.badge.warn{border-color:rgba(251,191,36,.28); color:#fde68a}
.badge.err{border-color:rgba(251,113,133,.28); color:#fecdd3}

.notice{
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(96,165,250,.08);
  color:#cbd5e1;
}
.notice.err{background:rgba(251,113,133,.08);color:#fecdd3;border-color:rgba(251,113,133,.22)}
.notice.ok{background:rgba(52,211,153,.08);color:#a7f3d0;border-color:rgba(52,211,153,.22)}

.video{
  width:100%;
  border-radius:14px;
  border:1px solid var(--border);
  background:#000;
}

hr{border:none;border-top:1px solid var(--border);margin:14px 0}

/* Quota progress */
.quota{
  margin-top:10px;
  padding:12px;
  border-radius:16px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
}
.qrow{display:flex;justify-content:space-between;gap:10px;color:#cbd5e1;font-size:13px}
.qbar{
  height:10px;border-radius:999px;overflow:hidden;
  background:rgba(148,163,184,.12);
  border:1px solid rgba(148,163,184,.18);
  margin-top:10px;
}
.qbar > div{
  height:100%;
  width:0%;
  background:linear-gradient(90deg, rgba(52,211,153,.9), rgba(96,165,250,.9));
  transition:width .6s ease;
}

/* Smooth progress (generate) */
.progress{
  margin-top:12px;
  border-radius:16px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
  padding:12px;
  display:none;
}
.pbar{
  height:10px;border-radius:999px;overflow:hidden;
  background:rgba(148,163,184,.12);
  border:1px solid rgba(148,163,184,.18);
}
.pbar > div{
  height:100%;
  width:2%;
  background:linear-gradient(90deg, rgba(96,165,250,.95), rgba(167,139,250,.95));
  transition:width .5s ease;
}
.pmeta{display:flex;justify-content:space-between;align-items:center;margin-top:10px;color:#cbd5e1;font-size:13px}
.pstep{color:var(--muted);font-size:12px;margin-top:6px}
