:root {
  --bg: #070b14;
  --card: rgba(17, 24, 39, .62);
  --line: rgba(148, 163, 184, .16);
  --muted: #8b98ad;
  --accent: #38bdf8;
  --accent2: #a78bfa;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
}
html { color-scheme: dark; }
html { background: var(--bg); }
body {
  background: transparent;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
/* decorative backdrop: independent fixed layer so it survives any browser/webview quirk */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(56, 189, 248, .22), transparent 62%),
    radial-gradient(800px 520px at 100% 0%, rgba(167, 139, 250, .20), transparent 62%),
    radial-gradient(900px 600px at 50% 120%, rgba(52, 211, 153, .10), transparent 60%),
    linear-gradient(180deg, #0a1020 0%, #070b14 60%, #05070d 100%);
}
.card {
  background: var(--card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
}
.label { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.grad-text { background: linear-gradient(90deg, #7dd3fc, #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }

.input {
  width: 100%; padding: .6rem .9rem; border-radius: .75rem;
  background: rgba(2, 6, 23, .55); border: 1px solid var(--line); color: #e2e8f0;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56, 189, 248, .18); }
.input::placeholder { color: #475569; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1rem; border-radius: .75rem; font-size: .875rem; font-weight: 500;
  border: 1px solid var(--line); background: rgba(30, 41, 59, .6); color: #e2e8f0;
  cursor: pointer; transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: rgba(51, 65, 85, .7); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: rgba(56, 189, 248, .18); border-color: rgba(56, 189, 248, .4); color: #bae6fd; }
.btn-primary:hover { background: rgba(56, 189, 248, .28); }
.btn-ok { background: rgba(52, 211, 153, .16); border-color: rgba(52, 211, 153, .4); color: #a7f3d0; }
.btn-ok:hover { background: rgba(52, 211, 153, .26); }
.btn-danger { background: rgba(248, 113, 113, .14); border-color: rgba(248, 113, 113, .4); color: #fecaca; }
.btn-danger:hover { background: rgba(248, 113, 113, .24); }

.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .65rem; border-radius: 999px; font-size: .75rem; border: 1px solid var(--line); }
.pill .dot { width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.pill-ok { color: var(--ok); background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .3); }
.pill-warn { color: var(--warn); background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .3); }
.pill-bad { color: var(--bad); background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .3); }
.pill-idle { color: var(--muted); background: rgba(148, 163, 184, .08); }
.pill-ok .dot { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .45; transform: scale(1); } 50% { opacity: 1; transform: scale(1.3); } }

.seg { display: inline-flex; padding: .2rem; border-radius: .75rem; background: rgba(2, 6, 23, .5); border: 1px solid var(--line); }
.seg button { padding: .3rem .8rem; border-radius: .55rem; font-size: .8rem; color: var(--muted); cursor: pointer; }
.seg button.active { background: rgba(56, 189, 248, .18); color: #bae6fd; }

.msg-ok { color: var(--ok); } .msg-err { color: var(--bad); }
.fade-in { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* admin layout */
.nav-item {
  display: flex; align-items: center; gap: .65rem; width: 100%;
  padding: .6rem .85rem; border-radius: .75rem; color: var(--muted);
  font-size: .9rem; cursor: pointer; text-align: left; white-space: nowrap;
}
.nav-item:hover { background: rgba(148, 163, 184, .08); color: #e2e8f0; }
.nav-item.active { background: rgba(56, 189, 248, .14); color: #bae6fd; }
.kv { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-top: 1px solid var(--line); font-size: .875rem; }
.kv:first-child { border-top: 0; }
.kv span:first-child { color: var(--muted); }
table.t { width: 100%; font-size: .85rem; }
table.t th { text-align: left; font-weight: 500; color: var(--muted); padding: .5rem 0; }
table.t td { padding: .5rem 0; border-top: 1px solid var(--line); }
.steps { display: flex; gap: .5rem; align-items: center; font-size: .8rem; color: var(--muted); }
.step-n { width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); font-size: .75rem; }
.step.done .step-n { background: rgba(52, 211, 153, .18); border-color: rgba(52, 211, 153, .5); color: var(--ok); }
.step.cur .step-n { background: rgba(56, 189, 248, .2); border-color: var(--accent); color: #bae6fd; }
.step.cur { color: #e2e8f0; }
.toast {
  position: fixed; right: 1rem; bottom: 1rem; padding: .7rem 1rem; border-radius: .8rem; z-index: 50;
  background: rgba(15, 23, 42, .95); border: 1px solid var(--line); font-size: .875rem; max-width: 22rem;
}
@media (max-width: 767px) {
  .side { flex-direction: row !important; overflow-x: auto; }
}
