body { font-family: Arial, sans-serif; margin: 0; background: #060b16; color: #e2e8f0; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar { background: #0b1220; border-right: 1px solid #1e293b; padding: 24px 18px; display: flex; flex-direction: column; gap: 24px; }
.brand-block { padding: 8px 6px; }
.brand-title { font-size: 22px; font-weight: 800; color: #f8fafc; }
.sidebar-nav { display: grid; gap: 10px; }
.nav-link { text-align: left; background: #111827; border: 1px solid #334155; color: #cbd5e1; padding: 12px 14px; border-radius: 12px; cursor: pointer; font-weight: 700; }
.nav-link.active, .nav-link:hover { background: #172554; border-color: #2563eb; color: #dbeafe; }
.sidebar-footer { margin-top: auto; display: grid; gap: 12px; }
.logout-form { display: block; }
.main-shell { padding: 24px; }
.view.hidden { display: none !important; }
.view.active { display: block; }
.container.narrow { max-width: 460px; padding-top: 72px; }
.card { background: #111827; border: 1px solid #334155; border-radius: 16px; padding: 20px; margin-bottom: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.18); }
.hero-card { background: linear-gradient(180deg, #111827, #0f172a); }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
label { display: block; font-size: 14px; margin-bottom: 6px; color: #cbd5e1; }
input, select, textarea, button { width: 100%; box-sizing: border-box; border-radius: 10px; border: 1px solid #475569; background: #0b1220; color: #f8fafc; padding: 10px 12px; }
textarea { min-height: 120px; resize: vertical; }
button { background: #2563eb; border: none; cursor: pointer; font-weight: 700; }
button:hover { background: #1d4ed8; }
button.secondary { background: #334155; }
button.danger { background: #7f1d1d; }
button.danger:hover { background: #991b1b; }
button:disabled { cursor: not-allowed; opacity: 0.6; }
.inline { display: flex; gap: 12px; align-items: center; }
.inline > * { width: auto; }
.task-row { align-items: end; margin-bottom: 12px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.stack { display: grid; gap: 8px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.actions > * { width: auto; min-width: 160px; }
.mt16 { margin-top: 16px; }
pre { white-space: pre-wrap; word-break: break-word; background: #020617; border: 1px solid #334155; padding: 12px; border-radius: 8px; }
.small { font-size: 12px; color: #94a3b8; }
.result-links { display: grid; gap: 8px; margin-bottom: 12px; }
.result-links a { color: #93c5fd; display: inline-block; }
.result-summary { margin-bottom: 12px; padding: 12px; border-radius: 8px; border: 1px solid #1d4ed8; background: #172554; color: #dbeafe; }
.pill { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; border: 1px solid #475569; background: #0b1220; color: #cbd5e1; text-transform: lowercase; }
.pill.success { border-color: #166534; background: #052e16; color: #bbf7d0; }
.pill.pending { border-color: #92400e; background: #451a03; color: #fde68a; }
.pill.error { border-color: #991b1b; background: #450a0a; color: #fecaca; }
.stage-panel { margin-bottom: 16px; padding: 14px; border-radius: 12px; border: 1px solid #334155; background: #0b1220; }
.stage-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 10px; }
.stage-title { font-weight: 700; color: #f8fafc; }
.progress-shell { height: 12px; border-radius: 999px; background: #1e293b; overflow: hidden; margin-bottom: 12px; border: 1px solid #334155; }
.progress-bar { height: 100%; width: 35%; border-radius: 999px; background: linear-gradient(90deg, #2563eb, #60a5fa, #93c5fd); background-size: 200% 100%; animation: indeterminate 1.4s linear infinite; }
.progress-bar.done { width: 100%; animation: none; background: linear-gradient(90deg, #16a34a, #4ade80); }
.progress-bar.error { width: 100%; animation: none; background: linear-gradient(90deg, #dc2626, #f87171); }
.stage-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stage-step { text-align: center; padding: 10px 8px; border-radius: 10px; border: 1px solid #334155; background: #111827; color: #94a3b8; font-size: 13px; }
.stage-step.active { border-color: #2563eb; background: #172554; color: #dbeafe; }
.stage-step.done { border-color: #166534; background: #052e16; color: #bbf7d0; }
.stage-step.error { border-color: #991b1b; background: #450a0a; color: #fecaca; }
.history-list { display: grid; gap: 16px; }
.history-card { background: #111827; border: 1px solid #334155; border-radius: 16px; padding: 18px; display: grid; gap: 14px; }
.history-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.history-meta { display: grid; gap: 4px; }
.history-title { font-size: 18px; font-weight: 700; color: #f8fafc; }
.history-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.history-field { padding: 10px 12px; border-radius: 12px; border: 1px solid #334155; background: #0b1220; }
.history-label { display: block; font-size: 11px; text-transform: uppercase; color: #94a3b8; margin-bottom: 4px; }
.history-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.history-actions a, .history-actions button { width: auto; min-width: 140px; text-align: center; }
.history-media { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.history-image, .history-video { width: 100%; border-radius: 14px; border: 1px solid #334155; background: #020617; display: block; }
.history-image { max-height: 320px; object-fit: cover; }
.prompt-box { padding: 12px; border-radius: 12px; border: 1px solid #334155; background: #0b1220; color: #e2e8f0; white-space: pre-wrap; word-break: break-word; }
.error { margin-bottom: 16px; padding: 10px 12px; border-radius: 8px; border: 1px solid #7f1d1d; background: #450a0a; color: #fecaca; }
.login-form { display: grid; gap: 16px; }
@keyframes indeterminate {
  0% { transform: translateX(-120%); background-position: 0% 50%; }
  100% { transform: translateX(320%); background-position: 100% 50%; }
}
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid #1e293b; }
}
@media (max-width: 640px) {
  .section-head, .inline, .stage-head, .history-top { flex-direction: column; align-items: stretch; }
  .actions > * { width: 100%; }
  .stage-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
