/* Dark Theme Styles */
[data-bs-theme="dark"] body {
    background-color: #2a3038; /* Un gris azulado oscuro, menos negro que antes */
    color: #e1e1e1; /* Texto un poco menos brillante para reducir contraste */
}

[data-bs-theme="dark"] .form-container,
[data-bs-theme="dark"] .document-view,
[data-bs-theme="dark"] .card {
    background-color: #343a42 !important; /* Un gris ligeramente más claro para los contenedores */
    color: #e1e1e1;
    border: 1px solid #4a5159; /* Borde sutil */
}

[data-bs-theme="dark"] .navbar {
    background-color: #343a42 !important;
    border-bottom: 1px solid #4a5159;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #2a3038; /* Fondo igual al del body para integración */
    color: #e1e1e1;
    border-color: #555c66; /* Borde un poco más visible */
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #343a42;
    color: #fff;
    border-color: #80bdff; /* Un azul suave para el foco */
    box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .15); /* Sombra más sutil */
}

[data-bs-theme="dark"] .section-header {
    border-bottom-color: #555c66;
}

[data-bs-theme="dark"] .section-header h3 {
    color: #a6cfff; /* Un azul más claro y suave */
}

[data-bs-theme="dark"] .field-label,
[data-bs-theme="dark"] .card-title,
[data-bs-theme="dark"] .card-text,
[data-bs-theme="dark"] .page-link,
[data-bs-theme="dark"] label,
[data-bs-theme="dark"] .form-check-label {
    color: #c5c8ca; /* Gris claro para etiquetas, mejor legibilidad */
}
/* Estilo para las etiquetas de campo en la vista de detalle (modo oscuro) */
[data-bs-theme="dark"] .field-label {
    background-color: #2a3038;
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid #4a5159;
    color: #a6cfff; /* Mismo azul suave que los títulos de sección */
}

/* Estilo para los valores de campo en la vista de detalle (modo oscuro) */
[data-bs-theme="dark"] .document-view .field-value {
  background-color: #4a4a4a !important;
  border-radius: 4px !important;
  padding: 8px !important;
  min-height: 38px !important;
  color: #d1deff !important;
}

[data-bs-theme="dark"] .signature-pad {
    background-color: #e1e1e1; /* Fondo claro para la firma, para que el trazo oscuro resalte */
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #343a42;
    border-color: #4a5159;
}
[data-bs-theme="dark"] .dropdown-item { color: #c5c8ca; }
[data-bs-theme="dark"] .dropdown-item:hover { background-color: #495057; }

/* Fondos de sección específicos para el tema oscuro */
/* Se eliminan los gradientes y se usa un color base uniforme para un look más limpio y profesional */
[data-bs-theme="dark"] .form-section.internal,
[data-bs-theme="dark"] .form-section.insurance,
[data-bs-theme="dark"] .form-section.patient,
[data-bs-theme="dark"] .form-section.context,
[data-bs-theme="dark"] .form-section.clinical,
[data-bs-theme="dark"] .form-section.glasgow,
[data-bs-theme="dark"] .form-section.antecedentes,
[data-bs-theme="dark"] .form-section.firmas,
[data-bs-theme="dark"] .form-section.adjuntos {
    background-image: none;
    background-color: #343a42;
}

[data-bs-theme="dark"] .form-section {
    border-color: #4a5159;
}

[data-bs-theme="dark"] .form-section:hover {
    border-color: #666f7b;
}

[data-bs-theme="dark"] .btn-outline-primary {
    color: #a6cfff;
    border-color: #a6cfff;
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
    background-color: #a6cfff;
    color: #2a3038;
}

[data-bs-theme="dark"] .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

[data-bs-theme="dark"] .page-link {
    background-color: #2a3038;
    border-color: #4a5159;
}

[data-bs-theme="dark"] .fixed-bottom {
    background-color: #343a42 !important;
    border-top: 1px solid #4a5159;
}