:root {
  --bg: #000000;
  --panel: #18181b;
  --panel-soft: #101012;
  --border: #27272a;
  --border-hover: #3f3f46;
  --text: #f4f4f5;
  --text-body: #d4d4d8;
  --muted: #a1a1aa;
  --faint: #71717a;
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --success: #10b981;
  --danger: #ef4444;
  --violet: #8b5cf6;
  --sidebar-width: 316px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }

.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 18px auto 18px 18px; z-index: 30; width: var(--sidebar-width);
  display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(145deg, #090a0c 0%, #050607 100%);
  border: 1px solid #26282d; border-radius: 18px;
  box-shadow: 0 22px 70px rgba(0,0,0,.48); transition: width .22s ease, transform .22s ease;
}
.sidebar-head { min-height: 92px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px 0 29px; }
.brand { display: flex; align-items: center; gap: 18px; color: #f7f7f8; font-size: 22px; font-weight: 760; letter-spacing: .08em; text-decoration: none; white-space: nowrap; }
.brand-logo { display: block; flex: 0 0 auto; width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 0 12px rgba(245,158,11,.28)); }
.sidebar-collapse { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; padding: 0; border-color: #1e2024; background: #15171b; }
.sidebar-collapse svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-nav { flex: 1; padding: 18px 12px 10px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.nav-group + .nav-group { margin-top: 28px; }
.nav-label { padding: 0 18px 11px; color: #666977; font-size: 11px; font-weight: 700; letter-spacing: .1em; white-space: nowrap; }
.nav-item { position: relative; display: flex; align-items: center; gap: 20px; min-height: 50px; margin: 2px 0; padding: 0 18px; border-radius: 12px; color: #c6cada; font-size: 16px; text-decoration: none; white-space: nowrap; transition: .16s ease; }
.nav-item > svg { flex: 0 0 auto; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { color: var(--text); background: #15171a; }
.nav-item.active { color: #ffbf18; background: linear-gradient(90deg,rgba(245,158,11,.18),rgba(245,158,11,.09)); }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 5px; bottom: 5px; width: 4px; border-radius: 0 4px 4px 0; background: #ffb900; box-shadow: 0 0 12px rgba(255,185,0,.5); }
.new-badge { margin-left: auto; padding: 3px 10px; border-radius: 999px; background: #6543d7; color: white; font-size: 11px; font-weight: 700; box-shadow: 0 0 12px rgba(101,67,215,.35); }
.sidebar-footer { margin: 0 12px 14px; padding-top: 14px; border-top: 1px solid #24262a; }
.plan-card,.account-card { display: flex; align-items: center; gap: 13px; min-height: 66px; padding: 9px 12px; border-radius: 13px; color: #f2f2f4; text-decoration: none; overflow: hidden; }
.plan-card { background: linear-gradient(110deg,#111317,#0b0c0e); }
.plan-card:hover,.account-card:hover { background-color: #15171a; }
.footer-icon,.avatar { display: grid; place-items: center; flex: 0 0 auto; width: 46px; height: 46px; border-radius: 13px; }
.footer-icon { color: #ffbd00; background: rgba(245,158,11,.12); }
.footer-icon svg { width: 26px; height: 26px; fill: currentColor; stroke: currentColor; stroke-width: 1.4; }
.avatar { border-radius: 50%; background: linear-gradient(145deg,#37383c,#17181b); font-size: 20px; font-weight: 650; }
.footer-copy { display: grid; min-width: 0; line-height: 1.3; white-space: nowrap; }
.footer-copy strong { font-size: 14px; }
.footer-copy small { color: #8d91a0; font-size: 12px; }
.footer-chevron { margin-left: auto; width: 17px; height: 17px; fill: none; stroke: #8d91a0; stroke-width: 2; }
.workspace { min-height: 100vh; margin-left: calc(var(--sidebar-width) + 36px); transition: margin-left .22s ease; }
body.sidebar-compact { --sidebar-width: 158px; }
body.sidebar-rail { --sidebar-width: 76px; }
body.sidebar-compact .brand-name, body.sidebar-compact .nav-item > span:not(.new-badge), body.sidebar-compact .footer-copy, body.sidebar-compact .footer-chevron,
body.sidebar-rail .brand-name, body.sidebar-rail .nav-item > span, body.sidebar-rail .footer-copy, body.sidebar-rail .footer-chevron, body.sidebar-rail .sidebar-collapse { display: none; }
body.sidebar-compact .sidebar-head { padding: 0 18px; }
body.sidebar-compact .brand { margin-left: 10px; }
body.sidebar-compact .sidebar-nav { padding-left: 8px; padding-right: 8px; }
body.sidebar-compact .nav-item { width: 68px; padding: 0; justify-content: center; }
body.sidebar-compact .nav-item.active { background: linear-gradient(90deg,rgba(245,158,11,.17),rgba(245,158,11,.03)); }
body.sidebar-compact .nav-label { padding-left: 12px; font-size: 10px; }
body.sidebar-compact .new-badge { position: absolute; top: 11px; right: 7px; width: 9px; height: 9px; padding: 0; font-size: 0; }
body.sidebar-compact .plan-card, body.sidebar-compact .account-card { width: 60px; padding: 7px; }
body.sidebar-rail .sidebar { inset-left: 18px; }
body.sidebar-rail .sidebar-head { justify-content: center; padding: 0; min-height: 92px; }
body.sidebar-rail .brand { cursor: pointer; }
body.sidebar-rail .brand-logo { width: 42px; height: 42px; }
body.sidebar-rail .sidebar-nav { padding: 18px 7px 8px; }
body.sidebar-rail .nav-label { height: 1px; margin: 18px 7px; padding: 0; background: #23252a; font-size: 0; }
body.sidebar-rail .nav-group + .nav-group { margin-top: 8px; }
body.sidebar-rail .nav-item { min-height: 50px; padding: 0; justify-content: center; gap: 0; }
body.sidebar-rail .nav-item.active::before { left: -7px; }
body.sidebar-rail .sidebar-footer { margin: 0 7px 13px; }
body.sidebar-rail .plan-card, body.sidebar-rail .account-card { justify-content: center; padding: 6px; }
.topbar { height: 72px; display: flex; align-items: center; padding: 0 28px; border-bottom: 1px solid var(--border); background: rgba(0,0,0,.92); }
.topbar h1 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.page-heading { min-width: 0; }
.page-heading p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.sidebar-toggle { display: none; width: 38px; height: 38px; margin-right: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--text); }
.page-content { padding: 24px 28px 40px; }
.empty-page { min-height: calc(100vh - 137px); }
.sidebar-backdrop { display: none; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.panel h2, .panel h3 { margin: 0 0 14px; }
.muted { color: var(--muted); }
.button, button { border: 1px solid var(--border-hover); background: #27272a; color: var(--text); padding: 8px 11px; border-radius: 8px; cursor: pointer; text-decoration: none; }
.button:hover, button:hover { border-color: var(--accent); color: var(--accent-hover); }
.primary-action { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 700; }
.primary-action:hover { background: var(--accent-hover); color: #000; }
button.danger { color: #f87171; }
button:disabled { opacity: .45; cursor: not-allowed; }
.detail-options { margin-top: 16px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.detail-options summary { cursor: pointer; }
.detail-options .production-actions { justify-content: flex-start; margin-left: 0; }
.badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: #27272a; color: var(--muted); font-size: 12px; }
.badge.completed { background: #063d2c; color: #34d399; }
.badge.running { background: #422d05; color: #fbbf24; }
.badge.failed, .badge.cancelled { background: #450a0a; color: #f87171; }
.badge.queued, .badge.paused { background: #2e1065; color: #a78bfa; }
.empty-state { min-height: 180px; display: grid; place-items: center; color: var(--faint); }

@media (max-width: 860px) {
  body.sidebar-compact, body.sidebar-rail { --sidebar-width: 292px; }
  .sidebar { inset: 10px auto 10px 10px; transform: translateX(calc(-100% - 20px)); width: 292px; }
  .sidebar.open { transform: translateX(0); }
  body.sidebar-compact .brand-name, body.sidebar-compact .nav-item > span:not(.new-badge), body.sidebar-compact .footer-copy, body.sidebar-compact .footer-chevron,
  body.sidebar-rail .brand-name, body.sidebar-rail .nav-item > span, body.sidebar-rail .footer-copy, body.sidebar-rail .footer-chevron, body.sidebar-rail .sidebar-collapse { display: initial; }
  body.sidebar-compact .sidebar-head, body.sidebar-rail .sidebar-head { justify-content: space-between; padding: 0 24px 0 29px; }
  body.sidebar-compact .brand { margin-left: 0; }
  body.sidebar-compact .sidebar-nav, body.sidebar-rail .sidebar-nav { padding: 18px 12px 10px; }
  body.sidebar-compact .nav-label, body.sidebar-rail .nav-label { height: auto; margin: 0; padding: 0 18px 11px; background: none; font-size: 11px; }
  body.sidebar-compact .nav-group + .nav-group, body.sidebar-rail .nav-group + .nav-group { margin-top: 28px; }
  body.sidebar-compact .nav-item, body.sidebar-rail .nav-item { width: auto; padding: 0 18px; justify-content: flex-start; gap: 20px; }
  body.sidebar-compact .new-badge { position: static; width: auto; height: auto; margin-left: auto; padding: 3px 10px; font-size: 11px; }
  body.sidebar-compact .plan-card, body.sidebar-compact .account-card, body.sidebar-rail .plan-card, body.sidebar-rail .account-card { width: auto; justify-content: flex-start; padding: 9px 12px; }
  .workspace { margin-left: 0; }
  .sidebar-toggle { display: inline-grid; place-items: center; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.65); }
  .sidebar-backdrop.show { display: block; }
  .topbar, .page-content { padding-left: 16px; padding-right: 16px; }
}
