:root {
  --bg: #09131a;
  --bg-soft: rgba(13, 27, 36, 0.82);
  --panel: rgba(10, 23, 31, 0.88);
  --panel-border: rgba(148, 187, 211, 0.18);
  --text: #eff7fb;
  --muted: #8ca7b6;
  --accent: #62f3c8;
  --accent-strong: #1dc89a;
  --accent-soft: rgba(98, 243, 200, 0.14);
  --warn: #ffd36d;
  --danger: #ff8d83;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --font-display: "Bahnschrift", "Segoe UI Variable Display", "Trebuchet MS", sans-serif;
  --font-body: "Aptos", "Segoe UI Variable Text", "Tahoma", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(34, 123, 145, 0.33), transparent 36%),
    radial-gradient(circle at 85% 12%, rgba(82, 217, 166, 0.2), transparent 28%),
    linear-gradient(160deg, #051018 0%, #07131d 52%, #0c2027 100%);
  color: var(--text);
}

button,
input,
a {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

.page-shell {
  position: relative;
  max-width: 1360px;
  margin: 0 auto;
  padding: 40px 20px 64px;
}

.aurora {
  position: fixed;
  z-index: -1;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.42;
  pointer-events: none;
}

.aurora-left {
  top: -6rem;
  left: -8rem;
  background: rgba(68, 175, 195, 0.44);
}

.aurora-right {
  right: -8rem;
  bottom: -10rem;
  background: rgba(98, 243, 200, 0.18);
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
  gap: 20px;
}

.panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 24%),
    var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: panel-enter 560ms ease both;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.24), transparent 60%);
}

.panel-hero {
  margin-bottom: 20px;
  padding: 32px;
}

.hero-copy h1,
.panel h2 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

.hero-copy h1 {
  max-width: none;
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 1;
  white-space: nowrap;
}

.eyebrow,
.panel-kicker,
.metric-label,
.summary-label,
.field-label,
.subtle-text {
  color: var(--muted);
}

.eyebrow,
.panel-kicker {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
}

.hero-text {
  max-width: 52ch;
  margin: 16px 0 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #d7e9f2;
}

.summary-card {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.28rem;
}

.panel-form,
.panel-summary,
.panel-tasks,
.panel-images {
  padding: 24px;
}

.panel-summary {
  animation-delay: 80ms;
}

.panel-tasks {
  grid-column: 1 / 2;
  animation-delay: 140ms;
}

.panel-cancelled {
  grid-column: 1 / 2;
  padding: 24px;
  animation-delay: 180ms;
}

.panel-images {
  grid-column: 2 / 3;
  grid-row: 2 / 4;
  animation-delay: 220ms;
}

.panel-header,
.images-toolbar,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pull-form {
  display: grid;
  gap: 18px;
}

.field-group {
  display: grid;
  gap: 10px;
}

.field-label {
  font-size: 0.95rem;
}

input[type="text"] {
  width: 100%;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

input[type="text"]:focus {
  border-color: rgba(98, 243, 200, 0.6);
  box-shadow: 0 0 0 5px rgba(98, 243, 200, 0.14);
  transform: translateY(-1px);
}

.helper-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip,
.ghost-button,
.primary-button,
.secondary-button,
.danger-button {
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.chip,
.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.chip {
  padding: 9px 14px;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button {
  padding: 12px 16px;
  border-radius: 999px;
}

a.primary-button,
a.secondary-button,
a.danger-button,
a.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary-button {
  color: #04261f;
  background: linear-gradient(135deg, var(--accent) 0%, #b5ffe9 100%);
  box-shadow: 0 12px 24px rgba(98, 243, 200, 0.22);
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.secondary-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}

.danger-button {
  color: #2f0603;
  background: linear-gradient(135deg, #ff9d86 0%, #ffd4c9 100%);
}

.chip:hover,
.ghost-button:hover,
.primary-button:hover,
.secondary-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.chip:active,
.ghost-button:active,
.primary-button:active,
.secondary-button:active,
.danger-button:active {
  transform: translateY(0);
}

.chip:disabled,
.ghost-button:disabled,
.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.form-hint,
.subtle-text,
.task-meta,
.image-meta,
.empty-state p {
  font-size: 0.94rem;
  color: var(--muted);
}

.archive-usage-block {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.archive-usage-block strong {
  font-size: 1.05rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.task-list,
.image-list {
  display: grid;
  gap: 14px;
}

.image-list {
  margin-top: 12px;
}

.empty-state {
  padding: 28px 20px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 1.06rem;
}

.task-card,
.image-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.task-head,
.image-head,
.task-row,
.task-actions,
.image-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-head,
.image-head {
  align-items: flex-start;
}

.task-title,
.image-title {
  margin: 0;
  font-size: 1.05rem;
  word-break: break-word;
}

.task-meta,
.image-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.task-actions,
.image-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-badge::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

.status-pending {
  color: var(--warn);
  background: rgba(255, 211, 109, 0.12);
}

.status-running {
  color: #7ed6ff;
  background: rgba(126, 214, 255, 0.12);
}

.status-success {
  color: var(--accent);
  background: var(--accent-soft);
}

.status-cancelled {
  color: #ffbe7a;
  background: rgba(255, 190, 122, 0.12);
}

.status-failed {
  color: var(--danger);
  background: rgba(255, 141, 131, 0.13);
}

.task-error {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 141, 131, 0.12);
  color: #ffd2ce;
}

.log-frame {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(3, 10, 15, 0.92);
}

.log-frame summary {
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  color: #d0e5f2;
}

.log-frame summary::-webkit-details-marker {
  display: none;
}

.task-log {
  margin: 0;
  padding: 0 14px 14px;
  max-height: 18rem;
  overflow: auto;
  font-size: 0.83rem;
  line-height: 1.55;
  color: #b8ceda;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Consolas", "Cascadia Mono", monospace;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
  z-index: 10;
}

.toast {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 20, 28, 0.94);
  box-shadow: var(--shadow);
  animation: toast-in 240ms ease both;
}

.toast strong {
  display: block;
  margin-bottom: 4px;
}

.toast p {
  margin: 0;
  color: var(--muted);
}

.toast-error {
  border-color: rgba(255, 141, 131, 0.28);
}

.toast-success {
  border-color: rgba(98, 243, 200, 0.24);
}

@keyframes panel-enter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .panel-images {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 820px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-header,
  .images-toolbar,
  .form-actions,
  .task-head,
  .image-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-copy h1 {
    white-space: normal;
  }

  .archive-usage-block {
    justify-items: start;
  }
}

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

  .panel-hero,
  .panel-form,
  .panel-summary,
  .panel-tasks,
  .panel-images {
    padding: 18px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }
}
