
:root {
  --bg: #07111d;
  --bg-elevated: rgba(11, 22, 36, 0.86);
  --bg-soft: rgba(14, 30, 49, 0.72);
  --panel: rgba(20, 35, 56, 0.92);
  --panel-strong: rgba(25, 43, 68, 0.98);
  --border: rgba(110, 151, 184, 0.2);
  --border-strong: rgba(98, 182, 255, 0.34);
  --text: #f4f8fb;
  --muted: #93a6b8;
  --brand-orange: #ff9f43;
  --brand-blue: #4ec5ff;
  --brand-ice: #dff6ff;
  --danger: #ff7b72;
  --success: #5ee5a1;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  --font: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(78, 197, 255, 0.12), transparent 34%),
    radial-gradient(circle at bottom right, rgba(255, 159, 67, 0.12), transparent 28%),
    linear-gradient(180deg, #050b14 0%, #07111d 48%, #091724 100%);
  color: var(--text);
  font-family: var(--font);
}

body {
  position: relative;
  overflow-x: hidden;
}

body[data-auth-state="locked"] {
  background: #050b14;
}

body[data-auth-state="locked"] .ambient-grid,
body[data-auth-state="locked"] .ambient-glow {
  display: none;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.8), transparent 84%);
  pointer-events: none;
}

.ambient-glow {
  position: fixed;
  width: 32rem;
  height: 32rem;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.22;
  pointer-events: none;
}

.ambient-glow-a {
  top: -10rem;
  left: -8rem;
  background: rgba(78, 197, 255, 0.45);
}

.ambient-glow-b {
  right: -12rem;
  bottom: -16rem;
  background: rgba(255, 159, 67, 0.42);
}

.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 24px;
}

body[data-auth-state="locked"] .page-shell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-panel,
.workspace {
  max-width: 1440px;
  margin: 0 auto;
}

.login-panel {
  width: 100%;
  max-width: 360px;
  min-height: auto;
}

.brand-mark,
.login-card,
.control-rail,
.hero-panel,
.preview-panel,
.activity-card {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.brand-mark {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 560px;
  background:
    linear-gradient(150deg, rgba(255, 159, 67, 0.16), rgba(78, 197, 255, 0.1)),
    var(--bg-elevated);
}

.brand-badge,
.mini-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--brand-blue);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.brand-badge::before,
.mini-label::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-orange), var(--brand-blue));
  box-shadow: 0 0 16px rgba(78, 197, 255, 0.6);
}

.brand-title {
  margin: 18px 0 10px;
  font-size: clamp(2.6rem, 4vw, 4.4rem);
  line-height: 0.95;
}

.brand-copy {
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.02rem;
}

.login-card {
  padding: 34px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-card-minimal {
  padding: 22px;
  gap: 12px;
  justify-content: flex-start;
}

.login-card-minimal input {
  width: 100%;
  padding: 14px 16px;
  color: var(--text);
  outline: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(7, 17, 29, 0.72);
}

.login-card-minimal input:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 4px rgba(78, 197, 255, 0.12);
}

.login-minimal-brand {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--brand-ice);
}

.login-card h1 {
  margin: 10px 0 10px;
  font-size: 2rem;
}

.login-card p {
  color: var(--muted);
  margin-top: 0;
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
}

.control-rail {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.rail-header,
.topbar,
.panel-heading,
.brand-stack,
.health-chips,
.hero-stats,
.form-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-stack {
  justify-content: flex-start;
  align-items: center;
}

.brand-sub,
.identity-meta,
.status-inline,
.workflow-opt small,
.empty-state {
  color: var(--muted);
}

.identity-card,
.stat-card,
.preview-card,
.workflow-opt,
.field textarea,
.field input,
.job-facts div,
.recent-job {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  border-radius: 18px;
}

.identity-card,
.hero-panel,
.preview-panel,
.activity-card {
  padding: 18px;
}

.identity-value,
.topbar-title,
.meta-value,
.job-meta-strong {
  font-size: 1rem;
  font-weight: 700;
}

.mode-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(6, 17, 28, 0.65);
}

.mode-btn,
.ghost-btn,
.primary-btn,
.workflow-opt {
  font: inherit;
  cursor: pointer;
}

.mode-btn,
.ghost-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 12px 14px;
  border-radius: 12px;
}

.mode-btn.active,
.ghost-btn:hover,
.workflow-opt.active {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(26, 53, 84, 0.7);
}

.prompt-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field span {
  font-size: 0.84rem;
  color: var(--brand-ice);
}

.field textarea,
.field input {
  width: 100%;
  padding: 16px 18px;
  color: var(--text);
  outline: none;
}

.field textarea {
  min-height: 200px;
  resize: vertical;
}

.field textarea,
.field input {
  background: rgba(7, 17, 29, 0.72);
}

.field textarea:focus,
.field input:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 4px rgba(78, 197, 255, 0.12);
}

.workflow-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.workflow-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px;
  text-align: left;
}

.workflow-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(147, 166, 184, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.workflow-opt.active .workflow-dot {
  background: linear-gradient(135deg, var(--brand-orange), var(--brand-blue));
  box-shadow: 0 0 18px rgba(78, 197, 255, 0.35);
}

.primary-btn {
  border: none;
  padding: 15px 18px;
  border-radius: 14px;
  color: #08111d;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand-orange), #ffbf5b 48%, var(--brand-blue));
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.ghost-btn {
  border-color: var(--border);
}

.workspace-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topbar {
  padding: 6px 4px;
}

.health-chips {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.health-chip {
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(9, 24, 38, 0.7);
  font-size: 0.78rem;
  color: var(--brand-ice);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.9fr);
  gap: 18px;
  background:
    linear-gradient(140deg, rgba(255, 159, 67, 0.1), transparent 45%),
    linear-gradient(320deg, rgba(78, 197, 255, 0.1), transparent 48%),
    var(--panel-strong);
}

.hero-panel h2 {
  margin: 8px 0 10px;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.hero-panel p {
  margin: 0;
  max-width: 48rem;
  color: var(--muted);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
  padding: 16px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 10px;
}

.stat-card strong {
  font-size: 1.05rem;
}

.preview-panel,
.activity-card {
  background: var(--panel);
}

.preview-grid,
.activity-grid {
  display: grid;
  gap: 16px;
}

.preview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.preview-card {
  overflow: hidden;
}

.preview-card header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  color: var(--muted);
}

.preview-frame {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at center, rgba(78, 197, 255, 0.12), transparent 48%),
    linear-gradient(180deg, rgba(9, 20, 33, 0.98), rgba(5, 12, 20, 0.98));
}

.preview-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview-placeholder {
  color: var(--muted);
  font-size: 0.92rem;
}

.activity-grid {
  grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.05fr);
}

.job-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.job-facts div {
  padding: 14px;
}

.job-facts dt {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}

.job-facts dd {
  margin: 0;
  font-weight: 700;
}

.recent-jobs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
}

.recent-job {
  padding: 14px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.recent-job:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: rgba(22, 41, 64, 0.85);
}

.recent-job-top,
.recent-job-bottom {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.recent-job-top {
  margin-bottom: 8px;
}

.recent-job-status {
  color: var(--success);
}

.recent-job-status.is-error {
  color: var(--danger);
}

.ghost-link {
  color: var(--brand-blue);
  text-decoration: none;
}

@media (max-width: 1120px) {
  .workspace,
  .login-panel,
  .hero-panel,
  .activity-grid {
    grid-template-columns: 1fr;
  }

  .page-shell {
    padding: 18px;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 12px;
  }

  .preview-grid,
  .hero-stats,
  .job-facts {
    grid-template-columns: 1fr;
  }

  .control-rail,
  .preview-panel,
  .activity-card,
  .hero-panel,
  .login-card,
  .brand-mark {
    border-radius: 18px;
  }
}
