*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  background: #f1f5f9;
  color: #0f172a;
  min-height: 100vh;
}

/* ── Auth ── */
body.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: white;
  border-radius: 8px;
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.auth-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #1e40af;
}

.auth-card .subtitle {
  color: #64748b;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

/* ── Navbar ── */
.navbar {
  background: #1e3a5f;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.nav-brand {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.3px;
  color: #93c5fd;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s;
}

.nav-links a:hover, .nav-links a.active {
  color: white;
  border-bottom-color: #60a5fa;
}

.nav-user {
  color: #64748b;
  font-size: 0.82rem;
}

.nav-logout {
  color: #94a3b8 !important;
  font-size: 0.78rem !important;
}

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

.page-header {
  margin-bottom: 1.25rem;
}

.page-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

/* ── Cards ── */
.card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border: 1px solid #e2e8f0;
}

.card-table { padding: 1.25rem; }

/* ── Forms ── */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 180px;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-group-submit { flex: 0; min-width: auto; }

input[type="text"], input[type="password"], input[type="date"], select {
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: #0f172a;
  background: white;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.btn-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

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

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

.btn-primary { background: #1e40af; color: white; }
.btn-primary:hover { background: #1d3a9e; }
.btn-secondary { background: #f1f5f9; color: #0f172a; border: 1px solid #cbd5e1; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-full { width: 100%; }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.78rem; }

/* ── Alerts ── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 5px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* ── File drop ── */
.file-drop {
  position: relative;
  border: 2px dashed #cbd5e1;
  border-radius: 6px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
}

.file-drop:hover { border-color: #3b82f6; }

.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
  box-shadow: none;
}

#fileLabel { color: #64748b; font-size: 0.875rem; pointer-events: none; }

.format-info {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0.75rem 0 1rem;
  padding: 0.6rem 0.75rem;
  background: #f8fafc;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

/* ── Result card ── */
.result-card {
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  margin-top: 1rem;
  border: 1px solid;
}

.result-success { background: #f0fdf4; border-color: #86efac; }
.result-error   { background: #fef2f2; border-color: #fecaca; color: #dc2626; }

.result-table { margin: 0.75rem 0; border-collapse: collapse; width: 100%; max-width: 400px; }
.result-table td { padding: 0.3rem 0.5rem; font-size: 0.85rem; border-bottom: 1px solid #e2e8f0; }
.result-table td:first-child { color: #64748b; width: 180px; }

.error-list { margin-top: 0.75rem; }
.error-list ul { font-size: 0.82rem; color: #dc2626; padding-left: 1.25rem; margin-top: 0.25rem; }

.result-actions { margin-top: 1rem; }

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

.date-badge {
  background: #dbeafe;
  color: #1e40af;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.table-scroll { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.data-table th {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  padding: 0.5rem 0.75rem;
  text-align: right;
  font-weight: 600;
  color: #475569;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.data-table th:first-child { text-align: center; }

.data-table td {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.data-table tbody tr:hover td { background: #f8fafc; }
.zero { color: #cbd5e1; }

/* ── Info grid ── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.info-card {
  background: white;
  border-radius: 8px;
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
}

.info-card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: #1e40af;
}

.info-card p {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.no-data { color: #94a3b8; text-align: center; padding: 2rem; }
.no-data p { margin-bottom: 1rem; }
