:root {
  --brand-dark: #232c48;
  --brand-darker: #465991;
  --brand-blue: #586fb5;
  --brand-accent: #1e51f7;
  --brand-light: #dee2f0;
  --ink-900: #0f1426;
  --ink-700: #2c355a;
  --ink-500: #4b5565;
  --surface: #ffffff;
  --surface-muted: #f5f7fb;
  --border-soft: #e1e6f3;
  --shadow-sm: 0 10px 30px rgba(15, 20, 38, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 20, 38, 0.18);
  --radius-lg: 20px;
  --radius-md: 14px;
  --bs-body-font-family: "Poppins", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --bs-body-color: var(--ink-900);
  --bs-body-bg: var(--surface-muted);
  --bs-primary: var(--brand-blue);
  --bs-primary-rgb: 88, 111, 181;
  --bs-link-color: var(--brand-blue);
  --bs-link-hover-color: var(--brand-darker);
  --bs-border-color: var(--border-soft);
  --bs-border-radius: 0.9rem;
  --bs-border-radius-lg: 1.1rem;
}

* {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(1200px circle at 8% -20%, rgba(88, 111, 181, 0.25), transparent 55%),
    radial-gradient(900px circle at 110% 10%, rgba(70, 89, 145, 0.2), transparent 50%),
    linear-gradient(180deg, #f4f6fb 0%, #eef2f9 60%, #f8f9fd 100%);
  color: var(--ink-900);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(400px circle at 10% 30%, rgba(30, 81, 247, 0.08), transparent 60%),
    radial-gradient(500px circle at 90% 20%, rgba(88, 111, 181, 0.1), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.app-shell,
.app-footer,
header {
  position: relative;
  z-index: 1;
}

.app-shell {
  flex: 1;
}

.app-main {
  padding-top: 2rem;
}

.app-navbar {
  background: linear-gradient(135deg, #232c48 0%, #2b3560 100%);
  box-shadow: 0 10px 30px rgba(15, 20, 38, 0.18);
}

.app-navbar .nav-link {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus {
  color: #ffffff;
}

.app-navbar .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.2);
}

.app-navbar .navbar-toggler-icon {
  filter: invert(1);
}

.page-intro {
  max-width: 860px;
}

.page-title {
  font-size: clamp(2rem, 2.5vw + 1rem, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.75rem;
  align-items: stretch;
}

.hero-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  backdrop-filter: blur(6px);
}

.hero-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.status-item {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.status-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-500);
}

.status-badge {
  display: inline-block;
  font-size: 0.83rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  width: fit-content;
}

.status-ok {
  color: #0f5f22;
  background: #daf5e1;
}

.status-error {
  color: #8f1f1f;
  background: #ffe0e0;
}

.status-pending {
  color: #7a5b02;
  background: #fff3cd;
}

.status-count {
  font-size: 1.4rem;
  line-height: 1;
  font-weight: 700;
}

.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
}

.table {
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.table thead th {
  background: #eef2fa;
  color: var(--ink-700);
  border-bottom: 1px solid var(--border-soft);
}

.table tbody tr {
  border-color: var(--border-soft);
}

.form-control,
.form-select {
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-soft);
  border-radius: 0.75rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 0.2rem rgba(88, 111, 181, 0.2);
}

.btn {
  border-radius: 999px;
  font-weight: 500;
}

.btn-primary {
  background: linear-gradient(135deg, #586fb5 0%, #1e51f7 100%);
  border: none;
  box-shadow: 0 12px 24px rgba(30, 81, 247, 0.2);
}

.btn-primary:hover,
.btn-primary:focus {
  filter: brightness(1.05);
}

.btn-outline-primary {
  border-color: #586fb5;
  color: #586fb5;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: #586fb5;
  color: #ffffff;
}

.btn-outline-secondary {
  border-color: rgba(35, 44, 72, 0.25);
  color: #2b3560;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background: #2b3560;
  color: #ffffff;
}

.btn-outline-dark {
  border-color: rgba(35, 44, 72, 0.4);
  color: #232c48;
}

.btn-outline-dark:hover,
.btn-outline-dark:focus {
  background: #232c48;
  color: #ffffff;
}

.badge {
  font-weight: 500;
  letter-spacing: 0.02em;
}

.progress {
  background-color: rgba(35, 44, 72, 0.08);
  border-radius: 999px;
}

.progress-bar {
  background: linear-gradient(135deg, #586fb5 0%, #1e51f7 100%);
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-intro,
.stagger > * {
  animation: float-in 700ms ease forwards;
  opacity: 0;
}

.stagger > *:nth-child(1) { animation-delay: 80ms; }
.stagger > *:nth-child(2) { animation-delay: 160ms; }
.stagger > *:nth-child(3) { animation-delay: 240ms; }
.stagger > *:nth-child(4) { animation-delay: 320ms; }
.stagger > *:nth-child(5) { animation-delay: 400ms; }

@media (prefers-reduced-motion: reduce) {
  .page-intro,
  .stagger > * {
    animation: none;
    opacity: 1;
  }
}

/* ── Dashboard: Upload Cards ─────────────────────────────── */
.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.upload-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  transition: box-shadow 200ms ease, border-color 200ms ease;
}

.upload-card:hover {
  box-shadow: var(--shadow-sm);
}

.upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.75rem 1.25rem;
  border: 2px dashed var(--border-soft);
  border-radius: var(--radius-md);
  margin: 0.75rem;
  min-height: 180px;
  transition: border-color 200ms ease, background-color 200ms ease;
  cursor: pointer;
}

.upload-dropzone.drag-over {
  border-color: var(--brand-accent);
  background: rgba(30, 81, 247, 0.04);
}

.upload-icon {
  font-size: 2rem;
  color: var(--brand-blue);
  margin-bottom: 0.5rem;
}

.drop-hint {
  font-size: 0.85rem;
  color: var(--ink-500);
}

.upload-status-badge {
  font-size: 0.8rem;
}

.file-info {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-700);
}

/* ── Dashboard: Nav Tabs Override ────────────────────────── */
#dashTabs .nav-link {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-weight: 500;
}

#dashTabs .nav-link.active {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: transparent;
}

#dashTabContent {
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
