:root{
  --bg:#0b0d12;
  --panel:#111522;
  --card:#141a2b;
  --text:#eef1ff;
  --muted:#aab2d5;
  --border:rgba(255,255,255,.08);
  --primary:#6ea8fe;
  --ok:#49d17d;

  --radius:18px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --pad:14px;
  --gap:14px;

  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background: radial-gradient(1200px 700px at 20% -10%, rgba(110,168,254,.25), transparent 60%),
              radial-gradient(900px 600px at 90% 10%, rgba(73,209,125,.18), transparent 55%),
              var(--bg);
}

.page{
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  display:flex;
  flex-direction:column;
  gap:16px;
}

.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; gap:16px; align-items:center; justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid var(--border);
  backdrop-filter: blur(10px);
  background: rgba(11,13,18,.65);
}

.topbar .top-actions{display:flex; gap:12px; align-items:center}
.admin-login{position:relative}
.admin-login-card{
  position:absolute;
  right:0;
  top:110%;
  background: var(--panel);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:10px;
  display:flex;
  gap:8px;
  box-shadow: var(--shadow);
  min-width: 280px;
}

.brand{display:flex; gap:12px; align-items:center}
.logo{font-size:22px; display:flex; align-items:center}
.logo-img{height:26px; width:auto; display:block}
.title{font-weight:800; letter-spacing:.2px}
.subtitle{font-size:12px; color:var(--muted); margin-top:2px}

.top-actions{display:flex; gap:10px; align-items:center; flex-wrap:wrap}

.hero{
  padding: 18px;
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(110,168,254,.12), rgba(73,209,125,.08));
  box-shadow: var(--shadow);
}
.eyebrow{
  display:inline-block;
  font-size:12px;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
  border:1px solid var(--border);
  padding:4px 8px;
  border-radius:999px;
}
.hero-cta{display:flex; gap:8px; flex-wrap:wrap; margin-top:10px}
.pill{
  padding:6px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.08);
  border:1px solid var(--border);
  font-size:12px;
  color: var(--muted);
}

.filters-card{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  background: rgba(17,21,34,.75);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--pad);
  box-shadow: var(--shadow);
}

.h1{font-size:22px; font-weight:900}
.h2{font-size:16px; font-weight:800}
.h3{font-size:13px; font-weight:800; margin: 10px 0 6px}
.muted{color:var(--muted); font-size:13px}

.input{
  background: rgba(255,255,255,.06);
  border:1px solid var(--border);
  border-radius: 12px;
  padding:10px 12px;
  color: var(--text);
  outline:none;
  min-width: 200px;
}
.input::placeholder{color:rgba(238,241,255,.55)}
select.input{
  background: rgba(255,255,255,.08);
  color: var(--text);
}
select.input option{
  background: #111522;
  color: var(--text);
}
.textarea{min-height: 110px; width:100%; resize:vertical}

.workflow-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gap);
}
.workflow-card{
  padding:14px;
  border-radius:16px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  box-shadow: var(--shadow);
  display:flex;
  flex-direction:column;
  gap:10px;
  cursor:pointer;
  transition: transform .08s ease, border-color .08s ease;
}
.workflow-card:hover{transform: translateY(-2px); border-color: rgba(110,168,254,.45);}
.workflow-card.active{border-color: rgba(110,168,254,.7); background: rgba(110,168,254,.08);}
.workflow-card .card-top{display:flex; justify-content:space-between; align-items:center}
.meta-row{display:flex; gap:8px; flex-wrap:wrap; color:var(--muted); font-size:12px}
.card-actions{display:flex; gap:8px; flex-wrap:wrap}
.empty{
  margin-top:10px;
  padding:12px;
  border:1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

.btn{
  border:none;
  border-radius: 12px;
  padding:10px 12px;
  background: var(--primary);
  color:#0b0d12;
  font-weight:800;
  cursor:pointer;
}
.btn:active{transform: translateY(1px)}
.btn-ghost{
  background: rgba(255,255,255,.06);
  color: var(--text);
  border:1px solid var(--border);
}

.list{display:flex; flex-direction:column; gap:10px}
.workflow-item{
  padding:12px;
  border-radius: 14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  cursor:pointer;
}
.workflow-item:hover{background: rgba(255,255,255,.06)}
.workflow-item.active{
  border-color: rgba(110,168,254,.45);
  background: rgba(110,168,254,.12);
}
.workflow-name{font-weight:900}
.workflow-meta{margin-top:6px; font-size:12px; color: var(--muted)}

.steps{display:flex; flex-direction:column; gap:12px; margin-top: 12px}
.step{
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  border-radius: 16px;
  padding: 12px;
}
.step-head{display:flex; justify-content:space-between; gap:10px; align-items:flex-start}
.step-title{font-weight:900}
.step-goal{margin-top:4px; font-size:12px; color: var(--muted)}

.prompt{
  margin-top:10px;
  border:1px solid var(--border);
  background: rgba(20,26,43,.55);
  border-radius: 14px;
  padding: 12px;
}
.prompt-head{
  display:flex; justify-content:space-between; gap:10px; align-items:flex-start;
}
.prompt-title{font-weight:900}
.badges{display:flex; gap:8px; flex-wrap:wrap; margin-top:6px}
.badge{
  font-size:11px;
  padding: 4px 8px;
  border-radius: 999px;
  border:1px solid var(--border);
  color: var(--muted);
  background: rgba(255,255,255,.04);
}
.prompt-actions{display:flex; gap:8px}
.code{
  margin-top:10px;
  white-space:pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  background: rgba(0,0,0,.25);
  border:1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}

.admin{margin-top:12px}
.hidden{display:none}
.divider{height:1px; background: var(--border); margin: 12px 0}

.drawer{
  position:fixed;
  top:60px; bottom:20px; left:12px; right:32%;
  background: rgba(17,21,34,.95);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--pad);
  z-index: 20;
  overflow:auto;
}
.drawer-head{
  display:flex; justify-content:space-between; gap:12px; align-items:flex-start;
  position:sticky; top:0; background: rgba(17,21,34,.95); padding-bottom:6px;
}
.drawer-actions{display:flex; gap:8px; flex-wrap:wrap}
.drawer-backdrop{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
  z-index: 15;
}

.admin-drawer{
  position:fixed;
  right:0; top:0; bottom:0;
  width: min(30vw, 480px);
  background: rgba(11,13,18,.98);
  border-left:1px solid var(--border);
  padding: var(--pad);
  box-shadow: -10px 0 30px rgba(0,0,0,.35);
  z-index:30;
  overflow:auto;
}
.admin-head{
  display:flex; align-items:center; justify-content:space-between;
  position:sticky; top:0; background: rgba(11,13,18,.98); padding-bottom:8px;
}
.admin-body{display:flex; flex-direction:column; gap:14px}
.admin-block{
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--pad);
  background: rgba(255,255,255,.02);
}
.stack{display:flex; flex-direction:column; gap:8px}

.toast{
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20,26,43,.92);
  border:1px solid var(--border);
  padding: 10px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-weight:800;
}

.footer{
  position:fixed;
  bottom:0; left:0; right:0;
  padding:8px 12px;
  text-align:center;
  color: var(--muted);
  font-size:12px;
  background: rgba(11,13,18,.55);
  border-top:1px solid var(--border);
  backdrop-filter: blur(6px);
  z-index:5;
}
.footer-inner{max-width:1200px; margin:0 auto;}

@media (max-width: 980px){
  .page{padding:12px}
  .drawer{top:70px; bottom:70px; left:12px; right:12px;}
  .drawer-head{flex-direction:column; position:static}
  .admin-login-card{right:auto; left:0}
  .admin-drawer{width:92vw;}
}
