:root {
  --primary: #2f557f;  /* Denim */
  --secondary: #ffa92d; /* Warm Yellow */
  --tertiary: #3e8391;  /* Ming Green */
  --bg-light: #f8fafc;
  --bg-dark: #0f172a;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --white: #ffffff;
  --card-radius: 12px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.header-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--tertiary) 100%);
}

.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-tertiary { color: var(--tertiary); }

.bg-primary { background-color: var(--primary); }
.bg-secondary { background-color: var(--secondary); }
.bg-tertiary { background-color: var(--tertiary); }

.btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
}

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

.btn-secondary {
  background-color: var(--secondary);
  color: var(--primary);
}

.btn-tertiary {
  background-color: var(--tertiary);
  color: white;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card {
  background: var(--white);
  border-radius: var(--card-radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid #e2e8f0;
}

.sidebar {
  width: 280px;
  height: 100vh;
  background: var(--white);
  border-right: 1px solid #e2e8f0;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.main-content {
  margin-left: 280px;
  padding: 40px;
  min-height: 100vh;
  transition: var(--transition);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  border-left: 4px solid transparent;
}

.nav-link:hover, .nav-link.active {
  background: #f1f5f9;
  color: var(--primary);
  border-left-color: var(--primary);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  padding: 24px;
  border-radius: var(--card-radius);
  background: white;
  border-left: 5px solid var(--primary);
  box-shadow: var(--shadow);
}

.stat-card h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.stat-card .value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.badge {
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-pending { background: #fef3c7; color: #92400e; } /* Yellow for initial pending */
.badge-pending_hr { background: #e0f2fe; color: #0369a1; } /* Blue for HR step */
.badge-approved { background: #dcfce7; color: #166534; } /* Green for approved */
.badge-rejected { background: #fee2e2; color: #991b1b; } /* Red for rejected */

.dashboard-content-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 32px;
    margin-top: 32px;
}

@media (max-width: 992px) {
    .dashboard-content-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
}

/* Calendar Styles */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  text-align: center;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-day:hover:not(.empty) {
  background: var(--primary-soft);
  color: var(--primary);
  transform: scale(1.05);
}

.calendar-day.empty {
  cursor: default;
}

.day-active {
  border: 1.5px solid var(--primary);
  font-weight: 800;
  color: var(--primary);
}

.day-vacation {
  background: var(--tertiary) !important;
  color: white !important;
  border-radius: 50% !important;
  font-weight: 800;
}

.calendar-header {
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-bottom: 8px;
}

.day-active {
  background: var(--primary);
  color: white;
}

.day-vacation {
  background: var(--tertiary);
  color: white;
}

.day-pending {
  background: var(--secondary);
  color: var(--primary);
}

/* Glassmorphism effects */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

/* Signature Pad */
.signature-container {
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  border-radius: 8px;
  position: relative;
  margin-top: 8px;
  width: 100%;
  overflow: hidden;
}

.signature-canvas {
  width: 100%;
  height: 150px;
  cursor: crosshair;
  touch-action: none; /* Prevent scrolling while signing */
}

.signature-img {
  max-height: 40px;
  max-width: 100%;
  object-fit: contain;
  filter: contrast(120%) brightness(90%);
  mix-blend-mode: multiply; /* Make signature background blend */
}

.signature-clear {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  font-size: 0.75rem;
  background: rgba(0,0,0,0.05);
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  cursor: pointer;
}

/* Signature Pad mockup (Removing old placeholder) */
.signature-box {
  display: none;
}

/* Bottom Nav for Mobile */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e2e8f0;
  z-index: 1000;
  padding: 8px 12px;
  justify-content: space-around;
  box-shadow: 0 -4px 6px -1px rgba(0,0,0,0.05);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 600;
  gap: 4px;
}

.mobile-nav-item.active {
  color: var(--primary);
}

.mobile-nav-item .material-symbols-outlined {
  font-size: 24px;
}

/* BOTÓN CERRAR SESIÓN FLOTANTE / RESPONSIVE */
.logout-btn-header {
    background: #f1f5f9;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    border: 1px solid #e2e8f0;
}

/* RESPONSIVE SYSTEM - OVERRIDE */
@media (min-width: 993px) {
    .mobile-nav { display: none !important; }
}

@media (max-width: 992px) {
  .sidebar { 
      display: none !important; 
  }
  .main-content { 
      margin-left: 0 !important; 
      padding: 16px 16px 100px !important; 
      width: 100% !important;
  }
  .mobile-nav { 
      display: flex !important; 
  }
  
  /* Arreglo de superposición de texto en Dashboard */
  header div {
      flex-direction: column;
      align-items: flex-start !important;
      gap: 16px;
  }
  
  .logout-btn-header {
      align-self: flex-start;
  }

  .stat-grid { 
      grid-template-columns: 1fr !important; 
      gap: 12px !important;
  }
  
  .card { 
      padding: 16px !important; 
  }

  h1 { font-size: 1.6rem !important; }
  
  /* Tablas responsivas */
  table th:nth-child(2), table td:nth-child(2),
  table th:nth-child(3), table td:nth-child(3) {
     display: none; 
  }
}

@media (max-width: 480px) {
    h1 { font-size: 1.4rem !important; }
    .stat-card .value { font-size: 1.5rem !important; }
}

/* Modal System */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 2000;
  animation: fadeIn 0.3s ease-out;
}

.modal-card {
  background: white;
  width: 100%;
  max-width: 500px;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.3s ease-out;
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-family: 'Material Symbols Outlined';
  font-size: 24px;
  transition: var(--transition);
}

.btn-icon:hover {
  color: #ef4444;
  transform: rotate(90deg);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
