:root {
  --brand: #6366f1;
  --brand-2: #a855f7;
}

* { -webkit-tap-highlight-color: transparent; }

body { overflow-x: hidden; }

/* Animated background orbs */
#bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
#bg-orbs::before,
#bg-orbs::after {
  content: "";
  position: absolute;
  width: 42rem;
  height: 42rem;
  border-radius: 9999px;
  filter: blur(120px);
  opacity: 0.22;
}
#bg-orbs::before {
  background: radial-gradient(circle, #6366f1, transparent 60%);
  top: -10rem;
  left: -8rem;
}
#bg-orbs::after {
  background: radial-gradient(circle, #a855f7, transparent 60%);
  bottom: -12rem;
  right: -8rem;
}

.brand-logo {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

/* Glassmorphism */
.glass {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

.card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 1rem;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.card:hover {
  border-color: rgba(129, 140, 248, 0.35);
}

/* Inputs */
.input {
  width: 100%;
  border-radius: 0.7rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.62rem 0.85rem;
  font-size: 0.875rem;
  color: #f1f5f9;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: #64748b; }
.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}
select.input { appearance: none; cursor: pointer; }
textarea.input { resize: vertical; }

label.req::after { content: " *"; color: #fb7185; }

/* Buttons */
.btn-primary, .btn-ghost, .btn-danger, .btn-soft {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 0.9rem;
  border-radius: 0.7rem;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  box-shadow: 0 8px 24px -8px rgba(99, 102, 241, 0.6);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; filter: none; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.btn-soft {
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.2);
}
.btn-soft:hover { background: rgba(99, 102, 241, 0.22); }
.btn-danger {
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.25);
}
.btn-danger:hover { background: rgba(244, 63, 94, 0.22); color: #fff; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  height: 2.1rem; width: 2.1rem; border-radius: 0.6rem;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  color: #94a3b8; cursor: pointer; transition: all .15s ease;
}
.btn-icon:hover { background: rgba(255,255,255,0.12); color: #fff; }
.btn-icon:disabled { opacity: .4; cursor: not-allowed; }

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  text-align: center; padding: 3rem 1rem;
  border: 1px dashed rgba(255,255,255,0.12); border-radius: 1rem;
  background: rgba(255,255,255,0.02);
}

/* Status dot pulse */
.live-dot {
  position: relative; display: inline-block; height: .55rem; width: .55rem; border-radius: 9999px; background: #f43f5e;
}
.live-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 9999px; background: #f43f5e;
  animation: ping 1.4s cubic-bezier(0,0,.2,1) infinite;
}
@keyframes ping { 75%, 100% { transform: scale(2.4); opacity: 0; } }

.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Log viewer */
.log-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; line-height: 1.5;
  background: #0b1020; border: 1px solid rgba(255,255,255,0.08);
  border-radius: .6rem; padding: .8rem; height: 360px; overflow: auto;
  white-space: pre-wrap; word-break: break-word; color: #cbd5e1;
}

.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: 11px; font-weight: 600; padding: .2rem .6rem; border-radius: 9999px;
}

/* Search clear button */
.search-clear { transition: color .15s ease, opacity .15s ease; cursor: pointer; background: none; border: none; padding: 0; line-height: 0; }

.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
