body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", sans-serif;
  background: linear-gradient(180deg, #f6f1e8, #e8eef7);
  color: #192434;
}

.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px;
}

.hidden { display: none; }

.login-card,
.filters-card,
.overview-card,
.detail-card,
.tab-panel {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(13, 26, 48, 0.08);
}

.stack {
  display: grid;
  gap: 12px;
}

.workspace {
  display: grid;
  gap: 16px;
}

#overview-panel {
  display: grid;
  gap: 16px;
}

.filter-row {
  display: flex;
  gap: 12px;
  align-items: end;
}

.filter-row label {
  min-width: 180px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.toolbar {
  display: flex;
  gap: 8px;
}

.subtle {
  color: #64748b;
  margin: 4px 0 0;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 4px;
}

.tab {
  flex: 1 1 180px;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  background: #e6edf7;
  color: #27374e;
  font-weight: 600;
  text-align: center;
}

.tab.active {
  background: #145fd7;
  color: #fff;
}

.nested-tabs {
  margin-top: 8px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.panel-grid {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

input, textarea, select, button {
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid #ccd8e7;
  padding: 12px;
  font: inherit;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

button {
  border: none;
  background: #145fd7;
  color: #fff;
  font-weight: 600;
}

button.ghost {
  width: auto;
  background: #e7edf6;
  color: #26374e;
}

.hint {
  min-height: 20px;
  color: #a4312d;
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.remember-row input {
  width: auto;
}

.table-wrap {
  overflow-x: visible;
}

.job-group + .job-group {
  margin-top: 16px;
}

.job-group-title {
  margin: 0 0 10px;
  font-size: 16px;
}

.job-list {
  display: grid;
  gap: 10px;
}

.job-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  border: 1px solid #e4ebf2;
  border-radius: 14px;
  padding: 10px;
  background: #fff;
}

.job-cover {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  background: #eef3f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7a8aa1;
  font-size: 12px;
}

.job-cover img,
.job-cover video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.job-meta {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.job-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.job-id {
  font-weight: 700;
}

.job-subtle {
  color: #64748b;
  font-size: 13px;
}

.job-expanded {
  grid-column: 1 / -1;
  border-top: 1px solid #e4ebf2;
  padding-top: 10px;
}

.create-header h3 {
  margin: 0;
}

.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.status-queued { background: #fff1bf; color: #7c5c00; }
.status-running { background: #d9ebff; color: #0d4ea0; }
.status-succeeded { background: #daf7e5; color: #1b6d40; }
.status-failed { background: #ffe0df; color: #a1312c; }

.artifact {
  display: block;
  margin-top: 8px;
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-box {
  margin-top: 12px;
}

.preview-box img,
.preview-box video {
  width: 100%;
  max-width: 420px;
  border-radius: 14px;
  border: 1px solid #dbe4ef;
  background: #000;
}

@media (min-width: 980px) {
  .panel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 8px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar {
    width: 100%;
  }

  .toolbar button {
    flex: 1 1 0;
  }

  .action-row {
    justify-content: flex-start;
    gap: 6px;
  }

  .action-row button {
    width: auto;
    padding: 7px 10px;
    font-size: 12px;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-row label {
    min-width: 0;
  }

  .overview-card,
  .detail-card,
  .filters-card,
  .tab-panel {
    padding: 12px;
  }

  .preview-box img,
  .preview-box video {
    max-width: 100%;
  }

  .job-card {
    grid-template-columns: 72px 1fr;
    gap: 10px;
    padding: 8px;
  }

  .job-cover {
    width: 72px;
    height: 72px;
  }

  .job-group-title {
    font-size: 15px;
  }

  .job-subtle {
    font-size: 12px;
  }

  .tabs {
    gap: 6px;
  }

  .tab {
    flex: 1 1 calc(50% - 6px);
    padding: 9px 12px;
    font-size: 14px;
  }
}
