:root {
  --primary: #002f5f;
  --primary-light: #114983;
  --accent: #cc3366;
  --text: #333333;
  --gray: #6b7280;
  --border: #e2e6ea;
  --bg: #f5f7fa;
  --ok: #1a9c5b;
  --warn: #d97706;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}

header img {
  height: 32px;
}

header h1 {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin: 0;
}

main {
  max-width: 860px;
  margin: 32px auto;
  padding: 0 20px;
}

.card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 24px;
}

.card h2 {
  font-size: 15px;
  color: var(--primary);
  margin: 0 0 16px;
}

.script-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.script-option {
  flex: 1;
  min-width: 180px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 13px;
  text-align: center;
  transition: all 0.15s ease;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}

.script-option:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.script-option.selected {
  border-color: var(--primary);
  background: #eef4fa;
  color: var(--primary);
  font-weight: 600;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 28px;
  text-align: center;
  color: var(--gray);
  cursor: pointer;
  font-size: 13px;
}

.dropzone.dragover {
  border-color: var(--primary);
  background: #eef4fa;
}

#file-list {
  margin-top: 12px;
  font-size: 12px;
  color: var(--gray);
}

button.primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
}

button.primary:disabled {
  background: var(--gray);
  cursor: not-allowed;
}

button.secondary {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
}

button.secondary.danger {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}

.nav-pill-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gray);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}

.nav-pill-item:hover {
  color: var(--primary);
  background: #ffffff;
}

.nav-pill-item.active {
  background: var(--primary);
  color: #ffffff;
}

.nav-pill-icon {
  display: inline-flex;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.nav-pill-icon svg {
  width: 100%;
  height: 100%;
}

@media (max-width: 640px) {
  .nav-pill-label {
    display: none;
  }
  .nav-pill-item {
    padding: 8px 10px;
  }
}

.job {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.job:last-child {
  border-bottom: none;
}

.job-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.job-info small {
  color: var(--gray);
}

.job-info small.job-warning {
  color: var(--accent);
  font-weight: 600;
}

.progress-bar {
  width: 100%;
  max-width: 320px;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.job-info small.progress-label {
  color: var(--primary);
  margin-top: 4px;
}

.monitoring-summary {
  display: flex;
  gap: 24px;
  padding: 12px 16px;
  margin-bottom: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.monitor-stat {
  display: flex;
  flex-direction: column;
}

.monitor-stat .monitor-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.monitor-stat .monitor-label {
  font-size: 11px;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.badge.in_progress {
  background: #fdf1dc;
  color: var(--warn);
}

.badge.completed {
  background: #e3f6ec;
  color: var(--ok);
}

.badge.attention {
  background: #fde3e3;
  color: var(--accent);
}

.job-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reference-date {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--gray);
}

#error-banner {
  display: none;
  background: #fde3e3;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  white-space: pre-wrap;
}

.empty {
  color: var(--gray);
  font-size: 13px;
}

.subtitle {
  font-size: 12.5px;
  color: var(--gray);
  margin: -8px 0 16px;
  line-height: 1.5;
}

.pending-queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 10px;
  font-size: 13px;
}

.pending-queue-item .remove-queue {
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  background: none;
  border: none;
}

#queue-progress {
  margin-top: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12.5px;
}

#queue-progress .queue-progress-line {
  margin-bottom: 6px;
}

#queue-progress .queue-progress-line:last-child {
  margin-bottom: 0;
}
