:root {
  --bg: #070a13;
  --bg-2: #0c1120;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-2: rgba(255, 255, 255, 0.06);
  --panel-solid: #111827;
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --text: #e6e9f2;
  --muted: #8b93a7;
  --dim: #5b6377;
  --primary: #7c83ff;
  --primary-2: #22d3ee;
  --primary-soft: rgba(124, 131, 255, 0.14);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.13);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.13);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.13);
  --grad: linear-gradient(135deg, #818cf8 0%, #22d3ee 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
code, pre, .mono { font-family: var(--mono); font-size: 0.92em; }
svg.i { width: 1.1em; height: 1.1em; flex: none; vertical-align: -0.18em; }
::selection { background: rgba(124, 131, 255, 0.35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- Background ---------- */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-blobs span {
  position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%;
  filter: blur(90px); opacity: 0.18; animation: float 26s ease-in-out infinite alternate;
}
.bg-blobs span:nth-child(1) { background: #4f46e5; top: -18vmax; left: -12vmax; }
.bg-blobs span:nth-child(2) { background: #0891b2; bottom: -22vmax; right: -14vmax; animation-delay: -8s; }
.bg-blobs span:nth-child(3) { background: #9333ea; top: 30%; left: 45%; width: 30vmax; height: 30vmax; opacity: 0.1; animation-delay: -16s; }
@keyframes float { to { transform: translate(6vmax, 4vmax) scale(1.12); } }

/* ---------- Boot / logo ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 11px; background: var(--grad); position: relative; flex: none;
  box-shadow: 0 8px 24px -6px rgba(124, 131, 255, 0.6);
}
.logo-mark::after {
  content: ""; position: absolute; inset: 9px; border: 2.5px solid #fff; border-radius: 4px; transform: rotate(45deg) scale(0.8);
}
.logo-mark.big { width: 64px; height: 64px; border-radius: 20px; animation: pulse-logo 1.4s var(--ease) infinite; }
.logo-mark.big::after { inset: 18px; border-width: 4px; }
@keyframes pulse-logo { 50% { transform: scale(0.9) rotate(8deg); } }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 22px 14px; display: flex; flex-direction: column; gap: 6px;
  background: rgba(7, 10, 19, 0.6); backdrop-filter: blur(18px); border-right: 1px solid var(--border); z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; font-weight: 750; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand small { display: block; font-size: 0.7rem; color: var(--dim); font-weight: 500; letter-spacing: 0; }
.nav-section { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); padding: 14px 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--muted);
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease); position: relative;
}
.nav-link:hover { background: var(--panel-2); color: var(--text); text-decoration: none; transform: translateX(2px); }
.nav-link.active { background: var(--primary-soft); color: #fff; }
.nav-link.active::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad);
}
.nav-link svg { width: 18px; height: 18px; flex: none; }
.sidebar .spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border); }
.avatar {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; flex: none;
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.35), rgba(34, 211, 238, 0.35)); color: #fff; text-transform: uppercase;
}
.user-chip .who { min-width: 0; flex: 1; }
.user-chip .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .who span { font-size: 0.75rem; color: var(--muted); }

.main { min-width: 0; padding: 30px 38px 60px; }
.topbar { display: none; }
.page { animation: page-in 0.45s var(--ease); max-width: 1320px; margin: 0 auto; }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.75rem; letter-spacing: -0.03em; font-weight: 750; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.85rem; margin-bottom: 10px; }
.back svg { width: 15px; height: 15px; }

/* ---------- Cards ---------- */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px;
  backdrop-filter: blur(10px); position: relative;
}
.card h2, .card h3 { margin: 0 0 16px; font-size: 1rem; font-weight: 650; display: flex; align-items: center; gap: 10px; }
.card h2 .muted, .card h3 .muted { font-weight: 450; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 0.82rem; }
.mt { margin-top: 18px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stagger > * { animation: rise 0.55s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.985); } }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { padding: 18px 18px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); position: relative; overflow: hidden; }
.kpi::after {
  content: ""; position: absolute; inset: auto -30% -60% auto; width: 120px; height: 120px; border-radius: 50%;
  background: var(--kpi-color, var(--primary)); opacity: 0.12; filter: blur(30px);
}
.kpi .label { color: var(--muted); font-size: 0.8rem; display: flex; align-items: center; gap: 7px; }
.kpi .label svg { width: 15px; height: 15px; color: var(--kpi-color, var(--primary)); }
.kpi .value { font-size: 1.65rem; font-weight: 750; letter-spacing: -0.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 0.78rem; color: var(--dim); margin-top: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 11px;
  border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text); cursor: pointer; font-weight: 560;
  transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.25s, opacity 0.2s; white-space: nowrap;
  text-decoration: none !important; user-select: none;
}
.btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.22); }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--grad); border-color: transparent; color: #0b0f1a; box-shadow: 0 10px 26px -10px rgba(124, 131, 255, 0.8); }
.btn.primary:hover { box-shadow: 0 14px 32px -10px rgba(34, 211, 238, 0.8); filter: brightness(1.08); }
.btn.danger { background: var(--danger-soft); border-color: rgba(239, 68, 68, 0.35); color: #fca5a5; }
.btn.danger:hover { background: rgba(239, 68, 68, 0.22); }
.btn.success { background: var(--success-soft); border-color: rgba(34, 197, 94, 0.35); color: #86efac; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.sm { padding: 6px 11px; font-size: 0.83rem; border-radius: 9px; }
.btn.icon { padding: 7px; }
.btn.loading { color: transparent !important; position: relative; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff; animation: spin 0.7s linear infinite;
}
.btn.primary.loading::after { border-color: rgba(11, 15, 26, 0.3); border-top-color: #0b0f1a; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 0.82rem; color: var(--muted); font-weight: 520; }
.field .hint { font-size: 0.76rem; color: var(--dim); }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 13px; border-radius: 11px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border-2);
  outline: none; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(124, 131, 255, 0.18); background: rgba(0, 0, 0, 0.35); }
.input::placeholder { color: var(--dim); }
textarea.input { min-height: 90px; resize: vertical; font-family: var(--mono); font-size: 0.85rem; }
select.input option { background: var(--panel-solid); }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; padding: 4px 0; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 40px; height: 23px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); position: relative; transition: background 0.25s; }
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff;
  transition: transform 0.3s var(--ease); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(17px); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2px 14px; }

/* ---------- Status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: 0.76rem; font-weight: 600;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.running { color: #86efac; background: var(--success-soft); border-color: rgba(34, 197, 94, 0.25); }
.badge.running .dot { animation: ping 2s infinite; }
.badge.error, .badge.failed { color: #fca5a5; background: var(--danger-soft); border-color: rgba(239, 68, 68, 0.25); }
.badge.deploying, .badge.queued, .badge.building { color: #c4b5fd; background: var(--primary-soft); border-color: rgba(124, 131, 255, 0.3); }
.badge.deploying .dot, .badge.queued .dot, .badge.building .dot { animation: blink 1s infinite; }
.badge.stopped { color: #fcd34d; background: var(--warning-soft); border-color: rgba(245, 158, 11, 0.25); }
.badge.success { color: #86efac; background: var(--success-soft); border-color: rgba(34, 197, 94, 0.25); }
.badge.role { color: #a5b4fc; background: var(--primary-soft); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); } 70%, 100% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } }
@keyframes blink { 50% { opacity: 0.3; } }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 12px; border: 1px solid; margin-bottom: 18px; animation: rise 0.4s var(--ease); }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.alert.error { background: var(--danger-soft); border-color: rgba(239, 68, 68, 0.3); color: #fecaca; }
.alert.warning { background: var(--warning-soft); border-color: rgba(245, 158, 11, 0.3); color: #fde68a; }
.alert.info { background: var(--primary-soft); border-color: rgba(124, 131, 255, 0.3); color: #c7d2fe; }

/* ---------- Site cards ---------- */
.site-card {
  display: block; color: inherit; padding: 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border);
  transition: transform 0.35s var(--ease), border-color 0.3s, box-shadow 0.35s, background 0.3s; position: relative; overflow: hidden;
}
.site-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: var(--grad); opacity: 0;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  transition: opacity 0.35s;
}
.site-card:hover { transform: translateY(-4px); text-decoration: none; box-shadow: var(--shadow); background: var(--panel-2); }
.site-card:hover::before { opacity: 0.8; }
.site-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.site-card h3 { margin: 0; font-size: 1.08rem; letter-spacing: -0.01em; }
.site-card .url { font-family: var(--mono); font-size: 0.82rem; color: var(--primary-2); margin-top: 3px; display: block; }
.site-card .spark { height: 52px; margin: 16px -4px 10px; }
.site-card .meta { display: flex; gap: 16px; font-size: 0.8rem; color: var(--muted); flex-wrap: wrap; }
.site-card .meta b { color: var(--text); font-weight: 650; }
.site-card .owner { font-size: 0.75rem; color: var(--dim); margin-top: 10px; }

.empty { text-align: center; padding: 60px 20px; }
.empty .illu { width: 96px; height: 96px; margin: 0 auto 18px; border-radius: 28px; background: var(--primary-soft); display: grid; place-items: center; animation: bob 3s ease-in-out infinite; }
.empty .illu svg { width: 44px; height: 44px; color: var(--primary); }
.empty h3 { margin: 0 0 6px; font-size: 1.2rem; }
.empty p { color: var(--muted); margin: 0 auto 22px; max-width: 420px; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-3deg); } }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--panel); border: 1px solid var(--border); margin-bottom: 20px; width: max-content; max-width: 100%; overflow-x: auto; }
.tab { padding: 8px 15px; border-radius: 9px; color: var(--muted); cursor: pointer; border: 0; background: transparent; font-weight: 560; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; transition: color 0.2s, background 0.25s; }
.tab svg { width: 15px; height: 15px; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--panel-2); color: #fff; box-shadow: inset 0 0 0 1px var(--border-2); }

/* ---------- URL hero ---------- */
.url-hero {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-2); margin-bottom: 18px; flex-wrap: wrap;
}
.url-hero .globe { width: 38px; height: 38px; border-radius: 11px; background: var(--grad); display: grid; place-items: center; color: #0b0f1a; flex: none; }
.url-hero .globe svg { width: 20px; height: 20px; }
.url-hero a { font-family: var(--mono); font-size: 1.05rem; font-weight: 600; word-break: break-all; }
.url-hero .grow { flex: 1; min-width: 200px; }

/* ---------- Info list ---------- */
.info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.info .item { padding: 11px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.info .item:nth-child(odd) { padding-right: 16px; }
.info .k { font-size: 0.75rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; }
.info .v { font-family: var(--mono); font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.copy { cursor: pointer; color: var(--dim); display: inline-grid; place-items: center; padding: 2px; border-radius: 6px; border: 0; background: none; transition: color 0.2s, background 0.2s; }
.copy:hover { color: var(--text); background: var(--panel-2); }
.copy svg { width: 14px; height: 14px; }

.meter { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; margin-top: 7px; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--grad); width: 0; transition: width 1s var(--ease); }
.meter.warn > span { background: linear-gradient(90deg, #f59e0b, #ef4444); }

/* ---------- Dropzone ---------- */
.dropzone {
  position: relative; border-radius: var(--radius); padding: 34px 20px; text-align: center; cursor: pointer;
  background: rgba(124, 131, 255, 0.04); transition: background 0.3s, transform 0.3s var(--ease);
  background-image: linear-gradient(90deg, var(--border-2) 50%, transparent 0), linear-gradient(90deg, var(--border-2) 50%, transparent 0),
    linear-gradient(0deg, var(--border-2) 50%, transparent 0), linear-gradient(0deg, var(--border-2) 50%, transparent 0);
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y; background-size: 14px 1.5px, 14px 1.5px, 1.5px 14px, 1.5px 14px;
  background-position: 0 0, 0 100%, 0 0, 100% 0;
}
.dropzone:hover { background-color: rgba(124, 131, 255, 0.08); }
.dropzone.drag {
  background-color: rgba(124, 131, 255, 0.14); transform: scale(1.01);
  background-image: linear-gradient(90deg, var(--primary) 50%, transparent 0), linear-gradient(90deg, var(--primary) 50%, transparent 0),
    linear-gradient(0deg, var(--primary) 50%, transparent 0), linear-gradient(0deg, var(--primary) 50%, transparent 0);
  animation: ants 0.6s linear infinite;
}
@keyframes ants { to { background-position: 14px 0, -14px 100%, 0 -14px, 100% 14px; } }
.dropzone .ico { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); transition: transform 0.4s var(--ease); }
.dropzone:hover .ico, .dropzone.drag .ico { transform: translateY(-5px) scale(1.06); }
.dropzone .ico svg { width: 26px; height: 26px; }
.dropzone b { display: block; font-size: 1.02rem; margin-bottom: 3px; }
.dropzone span { color: var(--muted); font-size: 0.86rem; }
.dropzone input { display: none; }
.dropzone.compact { padding: 20px; display: flex; align-items: center; gap: 16px; text-align: left; }
.dropzone.compact .ico { margin: 0; flex: none; width: 46px; height: 46px; }
.file-pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 6px 12px; border-radius: 99px; background: var(--primary-soft); font-size: 0.84rem; animation: rise 0.35s var(--ease); }

.progress { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; margin-top: 14px; }
.progress span { display: block; height: 100%; background: var(--grad); width: 0; transition: width 0.25s; position: relative; overflow: hidden; }
.progress span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- Deployment steps ---------- */
.steps { display: flex; align-items: flex-start; gap: 0; margin: 6px 0 18px; overflow-x: auto; padding-bottom: 4px; }
.step { flex: 1; min-width: 92px; display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; font-size: 0.78rem; color: var(--dim); text-align: center; }
.step::before { content: ""; position: absolute; top: 16px; left: calc(-50% + 20px); right: calc(50% + 20px); height: 2px; background: var(--border-2); border-radius: 2px; }
.step:first-child::before { display: none; }
.step .bubble { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1.5px solid var(--border-2); transition: all 0.4s var(--ease); z-index: 1; }
.step .bubble svg { width: 16px; height: 16px; }
.step.active { color: var(--text); }
.step.active .bubble { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); box-shadow: 0 0 0 6px rgba(124, 131, 255, 0.12); animation: breathe 1.4s ease-in-out infinite; }
.step.done { color: var(--muted); }
.step.done .bubble { background: var(--success); border-color: var(--success); color: #052e14; animation: pop 0.45s var(--ease); }
.step.done::before, .step.active::before { background: linear-gradient(90deg, var(--success), var(--primary)); }
.step.failed { color: #fca5a5; }
.step.failed .bubble { background: var(--danger); border-color: var(--danger); color: #fff; animation: shake 0.45s; }
@keyframes breathe { 50% { box-shadow: 0 0 0 10px rgba(124, 131, 255, 0.04); } }
@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.15); } }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

.terminal {
  background: #05070d; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; font-family: var(--mono); font-size: 0.8rem;
  line-height: 1.6; color: #cbd5e1; max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; position: relative;
}
.terminal.tall { max-height: 620px; min-height: 300px; }
.terminal .ok { color: #86efac; }
.terminal .err { color: #fca5a5; }
.terminal .warn { color: #fcd34d; }
.terminal .head { color: #a5b4fc; font-weight: 600; }
.terminal .cursor { display: inline-block; width: 8px; height: 15px; background: var(--primary); vertical-align: -3px; animation: blink 1s steps(1) infinite; }
.terminal-bar { display: flex; gap: 6px; margin-bottom: 10px; }
.terminal-bar i { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; opacity: 0.8; }
.terminal-bar i:nth-child(2) { background: #f59e0b; }
.terminal-bar i:nth-child(3) { background: #22c55e; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
table.table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
.table th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--dim); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background 0.2s; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn { margin-left: 4px; }
.status-code { font-family: var(--mono); font-weight: 600; }
.status-code.s2 { color: #86efac; } .status-code.s3 { color: #93c5fd; } .status-code.s4 { color: #fcd34d; } .status-code.s5 { color: #fca5a5; }

/* ---------- Charts ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { transform-box: fill-box; transform-origin: bottom; animation: grow 0.8s var(--ease) both; animation-delay: calc(var(--i) * 18ms); transition: opacity 0.2s; }
.chart .bar:hover { opacity: 0.75; }
.chart .grid-line { stroke: rgba(255, 255, 255, 0.06); stroke-dasharray: 3 4; }
.chart text { fill: var(--dim); font-size: 10px; font-family: var(--font); }
@keyframes grow { from { transform: scaleY(0); } }
.sparkline { display: block; }
.sparkline path.line { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: draw 1.6s var(--ease) forwards; }
.sparkline path.area { opacity: 0; animation: fade 1s 0.5s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.78rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.codes { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, 0.06); margin: 10px 0 12px; }
.codes span { transition: width 1s var(--ease); }

/* ---------- Feed ---------- */
.feed { display: flex; flex-direction: column; }
.feed .ev { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); animation: rise 0.4s var(--ease) both; }
.feed .ev:last-child { border-bottom: 0; }
.feed .ev .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--panel-2); color: var(--muted); }
.feed .ev .ico svg { width: 15px; height: 15px; }
.feed .ev .ico.good { background: var(--success-soft); color: var(--success); }
.feed .ev .ico.bad { background: var(--danger-soft); color: var(--danger); }
.feed .ev .ico.info { background: var(--primary-soft); color: var(--primary); }
.feed .ev .txt { min-width: 0; flex: 1; font-size: 0.87rem; }
.feed .ev .txt small { display: block; color: var(--dim); font-size: 0.75rem; margin-top: 1px; }

/* ---------- Env editor ---------- */
.env-row { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 8px; margin-bottom: 8px; animation: rise 0.3s var(--ease); }
.env-row .input { font-family: var(--mono); font-size: 0.85rem; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 410px; padding: 38px 34px; border-radius: 24px; background: rgba(13, 18, 32, 0.7); border: 1px solid var(--border-2); backdrop-filter: blur(20px); box-shadow: var(--shadow); animation: auth-in 0.7s var(--ease); }
.auth-card.shake { animation: shake 0.45s; }
.auth-card .brand { justify-content: center; flex-direction: column; text-align: center; padding: 0 0 26px; gap: 14px; }
.auth-card .brand .logo-mark { width: 54px; height: 54px; border-radius: 17px; animation: bob 4s ease-in-out infinite; }
.auth-card .brand .logo-mark::after { inset: 15px; border-width: 3.5px; }
.auth-card h1 { font-size: 1.5rem; margin: 0; letter-spacing: -0.03em; }
.auth-card .tagline { color: var(--muted); font-size: 0.9rem; font-weight: 450; }
.auth-card .btn { width: 100%; padding: 12px; margin-top: 6px; }
@keyframes auth-in { from { opacity: 0; transform: translateY(24px) scale(0.97); } }
.auth-foot { text-align: center; margin-top: 18px; font-size: 0.78rem; color: var(--dim); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(3, 5, 10, 0.65); backdrop-filter: blur(6px); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade-in 0.25s; overflow-y: auto; }
.modal { width: 100%; max-width: 520px; background: #0e1424; border: 1px solid var(--border-2); border-radius: 20px; box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.8); animation: modal-in 0.4s var(--ease); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal.wide { max-width: 720px; }
.modal-head { padding: 20px 22px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-head h3 { margin: 0; font-size: 1.12rem; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { padding: 0 22px 20px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.modal-backdrop.closing { animation: fade-out 0.2s forwards; }
.modal-backdrop.closing .modal { animation: modal-out 0.2s forwards; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(20px) scale(0.96); } }
@keyframes modal-out { to { opacity: 0; transform: translateY(10px) scale(0.97); } }
.secret-box { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, 0.35); border: 1px dashed var(--primary); font-family: var(--mono); word-break: break-all; }
.secret-box span { flex: 1; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 11px; align-items: flex-start; min-width: 280px; max-width: 400px; padding: 13px 15px;
  border-radius: 14px; background: rgba(17, 24, 39, 0.92); border: 1px solid var(--border-2); backdrop-filter: blur(12px);
  box-shadow: var(--shadow); animation: toast-in 0.45s var(--ease); font-size: 0.88rem;
}
.toast.out { animation: toast-out 0.3s forwards; }
.toast .ico { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.toast .ico svg { width: 14px; height: 14px; }
.toast.success .ico { background: var(--success-soft); color: var(--success); }
.toast.error .ico { background: var(--danger-soft); color: var(--danger); }
.toast.info .ico { background: var(--primary-soft); color: var(--primary); }
.toast b { display: block; margin-bottom: 1px; }
.toast span { color: var(--muted); }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px) scale(0.95); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

/* ---------- Confetti ---------- */
.confetti { position: fixed; top: 0; left: 0; width: 9px; height: 14px; z-index: 300; pointer-events: none; border-radius: 2px; animation: confetti 1.6s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
@keyframes confetti {
  0% { transform: translate(var(--x0), var(--y0)) rotate(0); opacity: 1; }
  100% { transform: translate(var(--x1), var(--y1)) rotate(var(--r)); opacity: 0; }
}

/* ---------- Skeleton ---------- */
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 50%, var(--panel) 75%); background-size: 200% 100%; animation: sk 1.3s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

.code-block { position: relative; }
.code-block pre { margin: 0; padding: 14px 16px; border-radius: 12px; background: #05070d; border: 1px solid var(--border); overflow-x: auto; font-size: 0.8rem; line-height: 1.6; color: #cbd5e1; }
.code-block .copy { position: absolute; top: 8px; right: 8px; background: var(--panel-2); }
.kbd { font-family: var(--mono); font-size: 0.8em; padding: 2px 7px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--border); }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-105%); transition: transform 0.35s var(--ease); }
  .layout.menu-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; background: rgba(7, 10, 19, 0.8); backdrop-filter: blur(14px); }
  .topbar .brand { padding: 0; font-size: 1.05rem; }
  .main { padding: 20px 16px 50px; }
  .grid-2, .grid-3, .form-grid, .info { grid-template-columns: 1fr; }
  .info .item:nth-child(odd) { padding-right: 0; }
  .page-head h1 { font-size: 1.45rem; }
  .env-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
