body {
  display: flex;
  flex-direction: column;
}

/* Navbar styling */
.navbar {
  background-color: hsl(var(--primary));
  color: white;
  height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  position: relative;
  box-shadow: 0 4px 12px rgba(10, 24, 48, 0.1);
}

.navbar::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-color: hsl(var(--accent));
}

.nav-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.nav-brand span {
  color: hsl(var(--accent));
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-email {
  font-size: 14px;
  color: #cbd5e1;
}

.btn-signout {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.btn-signout:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: white;
}

/* Layout structure */
.main-content {
  max-width: 1400px;
  width: 100%;
  margin: 40px auto;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.bottom-content {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto 40px auto;
  padding: 0 40px;
}

.card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: hsl(var(--primary));
  border-bottom: 2px solid hsl(var(--border));
  padding-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Form control elements */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group.full-width {
  grid-column: span 2;
}

.btn-action {
  padding: 12px;
  background-color: hsl(var(--primary));
  color: white;
  border: none;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-action:hover {
  background-color: #0b1a32;
}

.btn-action:disabled {
  background-color: #94a3b8;
  cursor: not-allowed;
}

/* Console logs & progress bar */
.progress-section {
  background-color: #f8fafc;
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  padding: 20px;
}

.progress-bar-container {
  width: 100%;
  height: 10px;
  background-color: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background-color: #3b82f6;
  transition: width 0.3s ease;
}

.progress-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  text-align: center;
  margin-bottom: 10px;
}

.stat-box {
  background: white;
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  padding: 10px;
}

.stat-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: hsl(var(--primary));
}

.stat-lbl {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
}

.current-file {
  font-size: 13px;
  color: #64748b;
  margin-top: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.console-log {
  background-color: #0f172a;
  color: #38bdf8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  height: 250px;
  padding: 15px;
  border-radius: 6px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: break-word;
  border: 1px solid #1e293b;
}

/* SFN Executions table */
.table-container {
  overflow-x: auto;
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
}

.sfn-table {
  width: 100%;
  min-width: 1200px;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  table-layout: fixed;
}

/* Explicit SFN Table Column Widths */
.sfn-table th:nth-child(1), .sfn-table td:nth-child(1) { width: 240px; } /* Execution Name */
.sfn-table th:nth-child(2), .sfn-table td:nth-child(2) { width: 90px; }  /* Status */
.sfn-table th:nth-child(3), .sfn-table td:nth-child(3) { width: 160px; } /* Start Date */
.sfn-table th:nth-child(4), .sfn-table td:nth-child(4) { width: 220px; } /* Files */
.sfn-table th:nth-child(5), .sfn-table td:nth-child(5) { width: 180px; } /* Input */
.sfn-table th:nth-child(6), .sfn-table td:nth-child(6) { width: 230px; } /* Error Details */
.sfn-table th:nth-child(7), .sfn-table td:nth-child(7) { width: 80px; }  /* Action */

.sfn-table th {
  background-color: #f1f5f9;
  color: hsl(var(--primary));
  font-weight: 600;
  padding: 12px 8px 12px 14px;
  border-bottom: 1px solid hsl(var(--border));
}

.sfn-table td {
  padding: 12px 8px 12px 14px;
  border-bottom: 1px solid hsl(var(--border));
  vertical-align: top;
  word-break: break-word;
}

.sfn-table tr:hover {
  background-color: #faf9f6;
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-failed {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.btn-restart {
  background-color: white;
  border: 1px solid hsl(var(--primary));
  color: hsl(var(--primary));
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-restart:hover {
  background-color: hsl(var(--primary));
  color: white;
}

.btn-restart:disabled {
  border-color: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
    gap: 30px;
    margin: 20px auto;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 0 20px;
  }

  .main-content, .bottom-content {
    padding: 0 20px;
    margin: 20px auto;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .form-group.full-width {
    grid-column: span 1;
  }

  .progress-stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .card {
    padding: 20px;
  }
}

@media (max-width: 520px) {
  .navbar {
    flex-direction: column;
    height: auto;
    padding: 15px 20px;
    gap: 10px;
    align-items: flex-start;
  }

  .navbar::after {
    height: 3px;
  }

  .nav-user {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .progress-stats {
    grid-template-columns: 1fr;
  }
}

/* SFN table details & files column styling */
.sfn-file-item {
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 11px;
  margin-bottom: 4px;
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 4px;
}
.sfn-file-item:last-child {
  margin-bottom: 0;
}

.json-details {
  font-size: 11px;
  margin-top: 4px;
}
.json-details summary {
  cursor: pointer;
  color: hsl(var(--primary));
  font-weight: 600;
  outline: none;
  user-select: none;
  padding: 2px 0;
}
.json-details summary:hover {
  text-decoration: underline;
}
.json-details pre {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 8px;
  max-height: 150px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 4px 0 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.btn-move {
  background-color: white;
  border: 1px solid #f59e0b;
  color: #f59e0b;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-move:hover {
  background-color: #f59e0b;
  color: white;
}

.btn-move:disabled {
  border-color: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
}

/* Custom Toggle Switch for delete option */
.switch-container {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
  flex-shrink: 0;
}

.switch-container input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .2s ease;
  border-radius: 22px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s ease;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(10, 24, 48, 0.2);
}

.switch-container input:checked + .slider {
  background-color: hsl(var(--primary));
}

.switch-container input:focus + .slider {
  box-shadow: 0 0 0 2px rgba(11, 26, 50, 0.15);
}

.switch-container input:checked + .slider:before {
  transform: translateX(20px);
}

.switch-label {
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.btn-stop {
  padding: 12px;
  background-color: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-stop:hover {
  background-color: #dc2626;
}

.btn-stop:disabled {
  background-color: #fca5a5;
  cursor: not-allowed;
}

