:root {
  /* Paleta de Colores Ajustada (Logo Ch4) */
  --primary: #15803d;
  /* Verde Corporativo (Green-700) */
  --primary-hover: #166534;
  /* Verde Oscuro (Green-800) */
  --success: #16a34a;
  /* Verde éxito */
  --warning: #f59e0b;
  /* Amarillo */
  --danger: #dc2626;
  /* Rojo */
  --neutral: #4b5563;
  /* Gris */

  --bg-light: #f3f4f6;
  --white: #ffffff;
  --text-dark: #111827;
  /* Negro casi puro */
  --text-light: #374151;
  /* Gris oscuro */
  --border-color: #e5e7eb;

  /* Espaciado */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;

  /* Bordes */
  --radius: 0.5rem;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

body.dark-mode {
  --bg-light: #111827;
  --white: #1f2937;
  --text-dark: #f9fafb;
  --text-light: #9ca3af;
  --border-color: #374151;
  --primary: #22c55e;
  --primary-hover: #16a34a;
}

body.dark-mode .card,
body.dark-mode .app-header {
  border: 1px solid var(--border-color);
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background-color: #374151;
  color: var(--text-dark);
}

body.dark-mode input:disabled,
body.dark-mode select:disabled,
body.dark-mode textarea:disabled {
  background-color: #4b5563;
  /* Gray-600 */
  color: #d1d5db;
  /* Gray-300 */
  opacity: 0.6;
}

body.dark-mode .solicitud-item {
  background-color: #262f3e;
}


* {
  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-dark);
  line-height: 1.5;
  min-height: 100vh;
}

/* --- Layout Generico --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-md);
}

.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: var(--spacing-sm);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
}

@media (min-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- Componentes: Cards --- */
.card {
  background-color: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.card-header {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--spacing-xs);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- Componentes: Formularios --- */
.form-group {
  margin-bottom: var(--spacing-sm);
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--text-light);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input:disabled,
select:disabled,
textarea:disabled {
  background-color: #f3f4f6;
  color: var(--text-light);
  cursor: not-allowed;
  opacity: 0.7;
}

/* --- Componentes: Botones --- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  text-align: center;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
  width: 100%;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-success {
  background-color: var(--success);
  color: var(--white);
}

.btn-danger {
  background-color: var(--danger);
  color: var(--white);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-dark);
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
  width: auto;
  padding: 0;
}

/* --- Componentes: Listas y Solicitudes --- */
.solicitud-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  position: relative;
}

.solicitud-item.urgente {
  border-left: 5px solid var(--danger);
}

.solicitud-item.en_proceso {
  border-left: 5px solid var(--warning);
  background-color: #fffbeb;
}

.solicitud-item.completado {
  border-left: 5px solid var(--success);
  opacity: 0.8;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
}

.badge-pendiente {
  background-color: #e5e7eb;
  color: #374151;
}

.badge-urgente {
  background-color: #fecaca;
  color: #991b1b;
}

.badge-en_proceso {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-completado {
  background-color: #bbf7d0;
  color: #166534;
}

.badge-cancelado {
  background-color: #f3f4f6;
  color: #9ca3af;
  text-decoration: line-through;
}

/* --- Header y Navegación --- */
.app-header {
  background-color: var(--white);
  padding: var(--spacing-sm) var(--spacing-md);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

.user-info {
  font-weight: 600;
}

/* --- Toasts (Notificaciones) --- */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.toast {
  background-color: var(--text-dark);
  color: var(--white);
  padding: 1rem;
  border-radius: var(--radius);
  margin-top: 10px;
  min-width: 300px;
  animation: slideIn 0.3s ease-out;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-lg);
}

.toast-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  margin-left: 10px;
  opacity: 0.7;
  padding: 0 5px;
}

.toast-close:hover {
  opacity: 1;
}

.toast-success {
  background-color: var(--success);
  color: #fff;
}

.toast-error {
  background-color: var(--danger);
  color: #fff;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

/* --- Tablas (Admin) --- */
table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: var(--bg-light);
  font-weight: 600;
}

.stats-container {
  display: flex;
  justify-content: space-between;
  text-align: center;
  gap: var(--spacing-xs);
}

.stat-box {
  background: var(--bg-light);
  padding: var(--spacing-xs);
  border-radius: var(--radius);
  flex: 1;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* --- Logo --- */
.logo-login {
  display: block;
  max-width: 200px;
  margin: 0 auto 1.5rem auto;
  border-radius: 8px;
}

.logo-header {
  max-height: 40px;
  margin-right: 15px;
  vertical-align: middle;
  border-radius: 4px;
}

/* --- Skeletons (Loading States) --- */
.skeleton {
  background: #e5e7eb;
  background-image: linear-gradient(to right, #e5e7eb 0%, #f3f4f6 20%, #e5e7eb 40%, #e5e7eb 100%);
  background-repeat: no-repeat;
  background-size: 200% 100%;
  display: inline-block;
  border-radius: var(--radius);
  animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.skeleton-card {
  padding: var(--spacing-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: var(--spacing-sm);
  background: var(--white);
}

.skeleton-title {
  height: 1.5rem;
  width: 60%;
  margin-bottom: 0.75rem;
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
  width: 100%;
}