:root {
  --bg: #0f1419;
  --surface: rgba(22, 28, 36, 0.85);
  --surface-border: rgba(255, 255, 255, 0.08);
  --text: #e7ecf3;
  --text-muted: #8b9cb3;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #22c55e;
  --error: #ef4444;
  --radius: 12px;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
  font-family: "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.25), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(99, 102, 241, 0.12), transparent),
    var(--bg);
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.page--workspace {
  max-width: 1280px;
}

.page--center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}

.card--auth {
  text-align: center;
}

.logo__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.logo__icon--sm {
  width: 32px;
  height: 32px;
  font-size: 0.7rem;
  margin-bottom: 0;
  margin-right: 0.5rem;
}

.card__title {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.card__subtitle {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.form {
  text-align: left;
}

.field {
  display: block;
  margin-bottom: 1rem;
}

.field__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.field__input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s;
}

.field__input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--primary-hover);
}

.btn--block {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem;
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--surface-border);
}

.btn--ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn--sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.alert {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-align: left;
}

.alert--error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.alert--success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--surface-border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__brand {
  display: flex;
  align-items: center;
  font-weight: 600;
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.badge {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.2rem 0.6rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(12px);
}

.panel__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.panel__title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.panel__desc {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.file-requirements {
  margin: 0 0 1.25rem 1.25rem;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.7;
}

.panel__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  border: 2px dashed var(--surface-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover,
.dropzone--active {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.06);
}

.dropzone__input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.dropzone__icon {
  font-size: 2rem;
  opacity: 0.6;
  margin-bottom: 0.5rem;
}

.dropzone__text {
  font-weight: 500;
}

.dropzone__hint {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.table-wrap {
  overflow-x: auto;
  margin: 0 -0.25rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--surface-border);
}

.table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
}

.mono {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}

.muted {
  color: var(--text-muted);
  font-size: 0.85rem;
  max-width: 280px;
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.tag--success {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.tag--failed {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.tag--queued {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}

.tag--running {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

.tag--completed {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.logo-img {
  display: block;
  border-radius: 12px;
  flex-shrink: 0;
}

.logo-img--sm {
  border-radius: 10px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-left: 0.65rem;
}

.brand-text__title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.25;
}

.brand-text__sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.chart-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 0.75rem 0.5rem 0.25rem;
}

.chart-card__title {
  margin: 0 0 0.25rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.chart-box {
  height: 240px;
}

.range-tabs {
  display: flex;
  gap: 0.35rem;
}

.range-tab {
  border: 1px solid var(--surface-border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 8px;
  padding: 0.3rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.range-tab--active,
.range-tab:hover {
  color: var(--text);
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.12);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 1.25rem;
  align-items: start;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: 720px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.task-card {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.task-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.task-card__title strong {
  font-size: 1rem;
}

.task-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
  font-size: 0.82rem;
}

.task-meta dt {
  color: var(--text-muted);
  float: left;
  margin-right: 0.35rem;
}

.task-meta dd {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-error {
  margin: 0.5rem 0 0;
  color: #fca5a5;
  font-size: 0.85rem;
}

.task-logs {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.task-logs ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

.artifact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.task-empty-artifacts {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
}

@media (max-width: 960px) {
  .charts-grid,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .task-list {
    max-height: none;
  }
}

.empty {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
  margin: 0;
}

@media (max-width: 640px) {
  .table th:nth-child(3),
  .table td:nth-child(3) {
    display: none;
  }
}
