:root {
  --bg: #0b1120;
  --card: #111a2e;
  --border: #1e2d4a;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #38bdf8;
  --accent: #22c55e;
  --danger: #ef4444;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.muted { color: var(--muted); font-size: 0.9rem; }

.auth-shell { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 420px; }
.brand-badge { display: inline-block; padding: 0.25rem 0.65rem; border-radius: 999px; background: #1e293b; color: var(--primary); font-size: 0.78rem; margin-bottom: 0.75rem; }

.topbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; padding: 0.9rem 1.5rem; background: var(--card); border-bottom: 1px solid var(--border); }
.topbar-left { display: flex; align-items: center; gap: 0.75rem; }
.topbar-nav { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.container { max-width: 1240px; margin: 1.5rem auto; padding: 0 1.25rem; }
.section-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1.15rem; margin-bottom: 1rem; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.split-2, .studio-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 900px) { .split-2, .studio-split { grid-template-columns: 1fr; } }

label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.88rem; margin-bottom: 0.75rem; }
input, select, textarea { background: #0f172a; color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 0.55rem 0.7rem; font: inherit; }
.checkbox-row { flex-direction: row; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }

.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.75rem; }
.inline-form { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.form-actions { display: flex; gap: 0.6rem; align-items: center; margin-top: 0.5rem; flex-wrap: wrap; }

.btn, .nav-btn, .subtab-btn { border: 1px solid var(--border); background: #1e293b; color: var(--text); border-radius: 8px; padding: 0.5rem 0.9rem; cursor: pointer; font: inherit; font-size: 0.88rem; }
.btn-primary { background: var(--primary); color: #082f49; border-color: transparent; font-weight: 600; }
.btn-accent { background: var(--accent); color: #052e16; border-color: transparent; font-weight: 600; }
.btn-ghost { background: transparent; }
.btn-danger-outline { background: transparent; border-color: var(--danger); color: #fca5a5; }
.nav-btn.active, .subtab-btn.active { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.pill { padding: 0.2rem 0.55rem; border-radius: 999px; font-size: 0.75rem; background: #1e293b; color: var(--primary); }
.pill-ok { background: #052e16; color: #86efac; }
.pill-err { background: #450a0a; color: #fca5a5; }

.yaml-mode-tabs { display: flex; gap: 0.5rem; margin-bottom: 0.8rem; }
.preview-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.code-editor { width: 100%; min-height: 360px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.83rem; direction: ltr; text-align: left; line-height: 1.45; }

.error-box { background: #450a0a; color: #fca5a5; padding: 0.6rem; border-radius: 8px; margin-bottom: 0.75rem; font-size: 0.85rem; }
.toast { padding: 0.7rem 1rem; border-radius: 8px; background: #0c4a6e; border: 1px solid var(--primary); margin-bottom: 1rem; }
.simple-list { list-style: none; padding: 0; margin: 0; }
.simple-list li { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.perm-row { display: flex; justify-content: space-between; align-items: center; padding: 0.65rem 0; border-bottom: 1px solid var(--border); gap: 0.5rem; flex-wrap: wrap; }
