@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  color-scheme: light;

  --bg-body: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f8fafc;
  --bg-card-header: #f8fafc;

  --accent-primary: #1d4ed8;
  --accent-primary-hover: #1e40af;
  --accent-primary-soft: #dbeafe;
  --accent-cyan: #0369a1;

  --status-success: #047857;
  --status-success-bg: #d1fae5;
  --status-warning: #b45309;
  --status-warning-bg: #fef3c7;
  --status-danger: #b91c1c;
  --status-danger-bg: #fee2e2;
  --status-info: #0369a1;
  --status-info-bg: #e0f2fe;
  --status-purple: #6b21a8;
  --status-purple-bg: #f3e8ff;

  --text-main: #0f172a;
  --text-secondary: #1e293b;
  --text-muted: #475569;
  --text-dim: #64748b;

  --border-color: #cbd5e1;
  --border-strong: #94a3b8;
  --radius-xl: 14px;
  --radius-lg: 10px;
  --radius-md: 6px;

  --font-main: 'Plus Jakarta Sans', 'Outfit', system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 8px 22px rgba(15, 23, 42, 0.12);
  --transition: all 0.2s ease-in-out;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  font-size: 0.92rem;
}

/* Fix option tag background */
select option {
  background-color: #ffffff !important;
  color: #0f172a !important;
  padding: 8px 12px;
}

/* Native date picker icon fix */
::-webkit-calendar-picker-indicator {
  opacity: 0.8;
  cursor: pointer;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #e2e8f0;
}
::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

/* Panels & Cards */
.glass-panel, .card-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.glass-panel:hover, .card-panel:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

/* Navigation Bar */
.navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0.65rem 1.5rem;
}

.navbar-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.2rem;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  color: #1e293b !important;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.86rem;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--accent-primary) !important;
  background: #f1f5f9;
}

.nav-link.active {
  color: #0f172a !important;
  background: #e2e8f0;
  font-weight: 800;
}

/* Layout Container */
.main-container {
  max-width: 1440px;
  margin: 1.5rem auto 3rem;
  padding: 0 1.5rem;
}

/* Header Section */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title h1 {
  font-size: 1.7rem;
  font-weight: 800;
  color: #0f172a;
}

.page-title p {
  color: #475569;
  font-size: 0.92rem;
  font-weight: 600;
  margin-top: 0.15rem;
}

/* Filter Controls */
.filter-bar {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
}

.form-control, .form-select, input, select, textarea {
  background-color: #ffffff !important;
  border: 1px solid var(--border-color) !important;
  color: #0f172a !important;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  outline: none;
  transition: var(--transition);
}

.form-control:focus, .form-select:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: #1d4ed8 !important;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #ffffff !important;
  border: 1px solid var(--border-color) !important;
  color: #0f172a !important;
}

.btn-secondary:hover {
  background: #f1f5f9 !important;
}

.btn-success {
  background: #059669 !important;
  color: #ffffff !important;
}

.btn-danger {
  background: #dc2626 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.22);
}

.btn-danger:hover {
  background: #b91c1c !important;
  transform: translateY(-1px);
}

.btn-danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-sm {
  padding: 0.38rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.15rem;
  margin-bottom: 1.75rem;
}

.kpi-card {
  background: #ffffff;
  padding: 1.25rem 1.35rem;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: #2563eb;
}

.kpi-card.kpi-warning::before { background: #d97706; }
.kpi-card.kpi-danger::before { background: #dc2626; }
.kpi-card.kpi-success::before { background: #059669; }

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.kpi-title {
  font-size: 0.85rem;
  color: #0f172a !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 800;
}

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: #f1f5f9;
  color: #0f172a;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  color: #0f172a !important;
}

.kpi-subtitle {
  font-size: 0.85rem;
  color: #334155 !important;
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 992px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  padding: 1.35rem 1.5rem;
}

.card-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title-bar h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Anomalies Section */
.anomalies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 768px) {
  .anomalies-grid {
    grid-template-columns: 1fr;
  }
}

.anomaly-card {
  padding: 1.35rem 1.5rem;
}

.anomaly-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.anomaly-item {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.anomaly-item:hover {
  background: #ffffff;
  border-color: #94a3b8;
}

.worker-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.worker-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.88rem;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

.worker-details .name {
  font-weight: 800;
  font-size: 0.92rem;
  color: #0f172a;
}

.worker-details .sub {
  font-size: 0.8rem;
  color: #475569;
  font-weight: 600;
}

/* Badges */
.badge {
  padding: 0.35rem 0.7rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-success { background: #d1fae5; color: #047857 !important; border: 1px solid #a7f3d0; }
.badge-warning { background: #fef3c7; color: #b45309 !important; border: 1px solid #fde68a; }
.badge-danger { background: #fee2e2; color: #b91c1c !important; border: 1px solid #fecaca; }
.badge-info { background: #e0f2fe; color: #0369a1 !important; border: 1px solid #bae6fd; }
.badge-purple { background: #f3e8ff; color: #6b21a8 !important; border: 1px solid #e9d5ff; }

/* Table Container */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
  background: #ffffff;
}

.custom-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.73rem;
  letter-spacing: 0.05em;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border-color);
}

.custom-table td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border-color);
  color: #0f172a;
  font-weight: 600;
}

.custom-table tbody tr:hover {
  background: #f1f5f9;
}

/* Suggested Actions Panel */
.actions-panel {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.75rem;
}

.actions-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.action-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.action-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #dbeafe;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.action-content h4 {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.2rem;
}

.action-content p {
  font-size: 0.83rem;
  color: #475569;
  font-weight: 500;
}

/* Textarea / Import Area */
.import-area {
  width: 100%;
  min-height: 220px;
  background: #ffffff !important;
  border: 2px dashed var(--border-strong) !important;
  border-radius: var(--radius-lg);
  color: #0f172a !important;
  padding: 1rem;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.88rem;
  outline: none;
  resize: vertical;
  transition: var(--transition);
}

.import-area:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15) !important;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 0;
  color: #64748b;
  font-size: 0.85rem;
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
  background: #ffffff;
}

/* Botones de Asistencia - Identidad Propia de Color Distinta para SÍ (Verde) y NO (Rojo) */

/* Botón SÍ (Presente) - Desmarcado: Verde pastel suave con texto e icono verde oscuro */
.btn-asistencia-pres {
  background-color: #f0fdf4 !important;
  border: 1.5px solid #86efac !important;
  color: #166534 !important;
  font-weight: 800 !important;
  font-size: 0.82rem !important;
  padding: 0.45rem 0.65rem !important;
  border-radius: 8px !important;
  transition: all 0.15s ease-in-out !important;
  opacity: 1 !important;
  box-shadow: 0 1px 2px rgba(22, 163, 74, 0.08) !important;
  text-decoration: none !important;
}

.btn-asistencia-pres i {
  color: #16a34a !important;
  margin-right: 4px;
}

.btn-asistencia-pres:hover {
  background-color: #dcfce7 !important;
  border-color: #16a34a !important;
  color: #14532d !important;
}

/* Botón SÍ (Presente) - MARCADO: Verde Sólido Intenso con texto e icono blanco */
.btn-check:checked + label.btn-asistencia-pres,
.btn-check[value="Presente"]:checked + label {
  background-color: #16a34a !important;
  border-color: #15803d !important;
  color: #ffffff !important;
  box-shadow: 0 3px 8px rgba(22, 163, 74, 0.45) !important;
}

.btn-check:checked + label.btn-asistencia-pres i,
.btn-check[value="Presente"]:checked + label i {
  color: #ffffff !important;
}

/* Botón NO (Ausente) - Desmarcado: Rojo pastel suave con texto e icono rojo oscuro */
.btn-asistencia-aus {
  background-color: #fef2f2 !important;
  border: 1.5px solid #fca5a5 !important;
  color: #991b1b !important;
  font-weight: 800 !important;
  font-size: 0.82rem !important;
  padding: 0.45rem 0.65rem !important;
  border-radius: 8px !important;
  transition: all 0.15s ease-in-out !important;
  opacity: 1 !important;
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.08) !important;
  text-decoration: none !important;
}

.btn-asistencia-aus i {
  color: #dc2626 !important;
  margin-right: 4px;
}

.btn-asistencia-aus:hover {
  background-color: #fee2e2 !important;
  border-color: #dc2626 !important;
  color: #7f1d1d !important;
}

/* Botón NO (Ausente) - MARCADO: Rojo Sólido Intenso con texto e icono blanco */
.btn-check:checked + label.btn-asistencia-aus,
.btn-check[value="Ausente"]:checked + label {
  background-color: #dc2626 !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
  box-shadow: 0 3px 8px rgba(220, 38, 38, 0.45) !important;
}

.btn-check:checked + label.btn-asistencia-aus i,
.btn-check[value="Ausente"]:checked + label i {
  color: #ffffff !important;
}
