/* ── Reset & Base ─────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --navy: #1b2a4a;
  --navy-light: #243b6a;
  --blue-accent: #3b82f6;
  --green: #16a34a;
  --amber: #f59e0b;
  --red: #dc2626;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05);
}

html {
  font-size: 15px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--blue-accent);
  text-decoration: none;
}

/* ── Header / Navbar ─────────────────────────────────────── */
.navbar {
  background: var(--navy);
  color: #fff;
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar .brand {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.navbar .user-area {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.navbar .user-email {
  opacity: 0.85;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--blue-accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #2563eb;
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

/* ── Card ────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

/* ── Layout ──────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--gray-700);
}

/* ── Login Page ──────────────────────────────────────────── */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem 2rem;
}

.login-card h1 {
  font-size: 1.4rem;
  text-align: center;
  margin-bottom: 0.25rem;
  color: var(--navy);
}

.login-card .subtitle {
  text-align: center;
  color: var(--gray-500);
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.35rem;
}

.form-group input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color 0.15s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--blue-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.login-card .btn-primary {
  width: 100%;
  padding: 0.7rem;
  font-size: 1rem;
  margin-top: 0.5rem;
}

.error-msg {
  background: #fef2f2;
  color: var(--red);
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}

.error-msg.visible {
  display: block;
}

/* ── Pipeline Status Cards ───────────────────────────────── */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.status-card {
  position: relative;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--gray-300);
}

.status-card.completed {
  border-left-color: var(--green);
}

.status-card.running {
  border-left-color: var(--amber);
}

.status-card.failed {
  border-left-color: var(--red);
}

.status-card .client-name {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.status-card .schedule {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-bottom: 0.75rem;
}

.status-card .status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-completed {
  background: #dcfce7;
  color: var(--green);
}

.badge-running {
  background: #fef3c7;
  color: #b45309;
}

.badge-failed {
  background: #fee2e2;
  color: var(--red);
}

.badge-pending {
  background: var(--gray-100);
  color: var(--gray-500);
}

.status-card .meta {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: var(--gray-500);
  line-height: 1.7;
}

.status-card .meta strong {
  color: var(--gray-700);
}

/* ── Reports Table ───────────────────────────────────────── */
.reports-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.reports-toolbar select {
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fff;
}

.reports-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.reports-table thead {
  background: var(--gray-100);
}

.reports-table th,
.reports-table td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--gray-200);
}

.reports-table th {
  font-weight: 600;
  color: var(--gray-700);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reports-table tbody tr:hover {
  background: var(--gray-50);
}

.reports-table .download-link {
  color: var(--blue-accent);
  font-weight: 500;
  cursor: pointer;
}

.reports-table .download-link:hover {
  text-decoration: underline;
}

/* ── Utility ─────────────────────────────────────────────── */
.text-muted {
  color: var(--gray-500);
}

.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.info-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--gray-300);
  border-top-color: var(--blue-accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .navbar {
    padding: 0 1rem;
  }

  .container {
    padding: 1.25rem 1rem;
  }

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

  .reports-table th:nth-child(4),
  .reports-table td:nth-child(4),
  .reports-table th:nth-child(5),
  .reports-table td:nth-child(5) {
    display: none;
  }
}
