:root{
  --bg:#020617;
  --panel:#07111f;
  --panel2:#0b1728;
  --line:rgba(148,163,184,.18);
  --line2:rgba(34,197,94,.24);
  --text:#e5edf6;
  --muted:#93a4b8;
  --green:#22c55e;
  --cyan:#22d3ee;
  --red:#ef4444;
  --yellow:#f59e0b;
  --blue:#60a5fa;
}
*{ box-sizing:border-box; }
body{
  margin:0;
  min-height:100vh;
  background:radial-gradient(circle at 20% 0%, rgba(34,197,94,.12), transparent 34%), var(--bg);
  color:var(--text);
  font-family:Inter, Segoe UI, Arial, sans-serif;
}
button,input{ font:inherit; }
.shell{
  width:min(1180px, 100%);
  margin:0 auto;
  padding:22px;
}
.topbar,.dashboardHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.eyebrow{
  margin:0 0 6px;
  color:var(--green);
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.12em;
}
h1,h2,p{ margin:0; }
h1{ font-size:clamp(26px, 4vw, 42px); letter-spacing:0; }
h2{ font-size:24px; }
.statusPill{
  min-width:112px;
  padding:10px 14px;
  border:1px solid var(--line);
  border-radius:999px;
  color:var(--muted);
  text-align:center;
  background:rgba(15,23,42,.72);
}
.statusPill.online{
  color:#dcfce7;
  border-color:rgba(34,197,94,.45);
  background:rgba(20,83,45,.55);
}
.authGrid,.bottomGrid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:16px;
  margin-top:20px;
}
.authGrid.singleAuth{
  grid-template-columns:minmax(0, 1fr) minmax(260px, 420px);
}
.panel{
  border:1px solid var(--line);
  border-radius:8px;
  background:linear-gradient(180deg, rgba(15,23,42,.92), rgba(2,6,23,.88));
  padding:16px;
}
.panelTitle{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}
.panelTitle span{ font-size:18px; font-weight:800; }
.panelTitle small{ color:var(--muted); text-align:right; }
.setupText{
  margin:0;
  color:var(--muted);
  line-height:1.55;
}
label{
  display:grid;
  gap:7px;
  color:var(--muted);
  font-size:13px;
  margin-top:11px;
}
input{
  width:100%;
  min-height:43px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#030712;
  color:var(--text);
  padding:10px 12px;
  outline:none;
}
input:focus{ border-color:rgba(34,211,238,.62); box-shadow:0 0 0 3px rgba(34,211,238,.12); }
.primaryButton,.secondaryButton,.ghostButton,.dangerButton{
  min-height:42px;
  border-radius:8px;
  border:1px solid transparent;
  padding:9px 13px;
  color:var(--text);
  font-weight:800;
  cursor:pointer;
}
.primaryButton{ width:100%; margin-top:14px; background:linear-gradient(135deg, #16a34a, #0891b2); }
.secondaryButton{ background:rgba(8,47,73,.74); border-color:rgba(34,211,238,.3); }
.ghostButton{ background:rgba(15,23,42,.66); border-color:var(--line); }
.dangerButton{ background:rgba(127,29,29,.78); border-color:rgba(248,113,113,.34); }
.dashboard{ margin-top:22px; }
.actions{ display:flex; flex-wrap:wrap; gap:10px; justify-content:flex-end; }
#agentMeta{ color:var(--muted); margin-top:6px; }
.summaryStrip{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:10px;
  margin:16px 0;
}
.summaryItem{
  border:1px solid var(--line);
  border-radius:8px;
  padding:13px;
  background:rgba(15,23,42,.72);
}
.summaryItem strong{ display:block; font-size:22px; margin-bottom:4px; }
.summaryItem span{ color:var(--muted); font-size:13px; }
.serviceGrid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:14px;
}
.serviceCard{
  position:relative;
  min-height:246px;
  border:1px solid var(--line);
  border-radius:8px;
  background:linear-gradient(180deg, rgba(11,23,40,.96), rgba(2,6,23,.94));
  padding:15px;
}
.serviceCard::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:4px;
  border-radius:8px 0 0 8px;
  background:var(--blue);
}
.serviceCard.running::before{ background:var(--green); }
.serviceCard.stopped::before,.serviceCard.error::before{ background:var(--red); }
.serviceCard.paused::before{ background:var(--yellow); }
.cardTop{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
}
.cardTop h3{ margin:0; font-size:20px; }
.badge{
  padding:6px 9px;
  border-radius:999px;
  color:#dbeafe;
  background:rgba(37,99,235,.28);
  border:1px solid rgba(96,165,250,.28);
  font-size:12px;
  font-weight:800;
}
.running .badge{ color:#dcfce7; background:rgba(22,101,52,.52); border-color:rgba(34,197,94,.3); }
.stopped .badge,.error .badge{ color:#fee2e2; background:rgba(127,29,29,.52); border-color:rgba(248,113,113,.34); }
.paused .badge{ color:#fef3c7; background:rgba(120,53,15,.55); border-color:rgba(245,158,11,.34); }
.metaGrid{
  display:grid;
  gap:8px;
  margin:14px 0;
  color:var(--muted);
  font-size:13px;
}
.metaGrid b{ color:var(--text); font-weight:700; }
.cardActions{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px;
}
.resultList{
  display:grid;
  gap:8px;
  max-height:320px;
  overflow:auto;
}
.resultItem{
  border:1px solid var(--line);
  border-radius:8px;
  padding:10px;
  background:rgba(2,6,23,.46);
  color:var(--muted);
}
.resultItem b{ color:var(--text); }
.logBox{
  min-height:280px;
  max-height:420px;
  overflow:auto;
  margin:0;
  padding:12px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#030712;
  color:#cbd5e1;
  white-space:pre-wrap;
}
.toast{
  position:fixed;
  left:50%;
  bottom:18px;
  transform:translateX(-50%);
  width:min(520px, calc(100% - 24px));
  padding:13px 15px;
  border:1px solid rgba(34,197,94,.32);
  border-radius:8px;
  background:#04111f;
  color:var(--text);
  box-shadow:0 18px 42px rgba(0,0,0,.38);
}
@media (max-width: 900px){
  .authGrid,.bottomGrid,.serviceGrid,.summaryStrip{ grid-template-columns:1fr; }
  .topbar,.dashboardHeader{ align-items:flex-start; flex-direction:column; }
  .actions{ width:100%; justify-content:stretch; }
  .actions button{ flex:1; }
}
