body {
    background-color: #f5f6fa;
    font-family: 'Segoe UI', Arial, sans-serif;
}

h2 {
    color: #003366;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* Estilos personalizados para mensajes */
.alert-danger {
    background-color: #ffe6e6 !important;
    border-color: #ff9999 !important;
    color: #cc0000 !important;
    border-left: 5px solid #dc3545 !important;
}

.alert-danger i {
    color: #dc3545 !important;
}

.alert-warning {
    background-color: #fff4e6 !important;
    border-color: #ffcc80 !important;
    color: #e65100 !important;
    border-left: 5px solid #ff9800 !important;
}

.alert-warning i {
    color: #ff9800 !important;
}

.alert-success {
    background-color: #e8f5e8 !important;
    border-color: #81c784 !important;
    color: #2e7d32 !important;
    border-left: 5px solid #4caf50 !important;
}

.alert-success i {
    color: #4caf50 !important;
}

.table {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.table th {
    background: #e9ecef;
    color: #003366;
    font-weight: 500;
    border-bottom: 2px solid #dee2e6;
}

.table td, .table th {
    vertical-align: middle;
}

.btn-primary, .btn-outline-primary {
    color: white;
    background-color: #003366;
    border-color: #003366;
}

.btn-primary:hover, .btn-outline-primary:hover {
    background-color: #00509e;
    border-color: #00509e;
}

/* Estilos para paginación */
.pagination .page-link {
    color: #003366;
    border-color: #dee2e6;
}

.pagination .page-link:hover {
    color: #001f3f;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: #003366;
    border-color: #003366;
    color: #fff;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
}

.btn-danger {
    background-color: #c82333;
    border-color: #c82333;
}

.btn-danger:hover {
    background-color: #a71d2a;
    border-color: #a71d2a;
}

.btn-agregar {
    background-color: #00b188;
    color: #fff;
    font-weight: 500;
    border-radius: 0.375rem;
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
    border: none;
    transition: background 0.2s;
    display: inline-block;    /* Asegura que el ancho se adapte al texto */
    width: auto;              /* No fuerza el ancho */
    min-width: 0;             /* No fuerza un mínimo */
    box-sizing: border-box;   /* Para evitar sorpresas con el padding */
}

.btn-agregar:hover, .btn-agregar:focus {
    background-color: #00c988;
    color: #fff;
    text-decoration: none;
}

.form-control {
    border-radius: 0.5rem;
}

.card {
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    background: #fff;
    padding: 2rem;
    margin-bottom: 2rem;
}

.card-header-primary {
    background-color: #003366;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -2rem -2rem 0rem -2rem;
    padding: 1rem 2rem;
    border-bottom: 4px solid #307198;
}

.card-title-main {
    margin-bottom: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff !important;
}

/* Bloques secciones de detalle reutilizables */
.detail-section {
    border: 1px solid #dee2e6; /* gris suave */
    border-radius: 0.75rem;
    padding: 1.5rem;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.footer {
    background-color: #2c3e50 !important;
    color: white;
}
.footer h5 {
    color: white;
    font-size: 1.1rem;
}
.footer a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}
.footer a:hover {
    color: #3498db !important;
}
.social-icons a:hover {
    opacity: 0.8;
}

/* =================================================================== */
/* Estilos para select personalizado de razas                          */
/* =================================================================== */

.custom-select-wrapper {
    position: relative;
    width: 100%;
}

/* Usar form-control como base para consistencia */
.custom-select-input {
    /* Heredar todo de form-control, solo añadir flecha */
    /* La clase form-control ya está incluida en el HTML */
    border-radius: 0.375rem !important; /* Forzar las esquinas redondeadas de form-select */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236c757d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 16px 12px !important;
    padding-right: 2.25rem !important; /* Espacio exacto para la flecha */
    appearance: none !important; /* Quitar estilos nativos del navegador */
}

.custom-select-input:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.custom-select-input:focus + .custom-dropdown {
    display: block;
}

.custom-dropdown:hover {
    display: block;
}

.custom-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1060; /* Mayor que dropdowns de Bootstrap */
    max-height: 200px;
    overflow-y: auto;
    margin-top: 2px;
}

.custom-option {
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    border: none; /* Quitar líneas separadoras */
    transition: background-color 0.1s ease-out;
}

.custom-option:hover,
.custom-option:focus {
    color: #f0f8ff; /* Azul claro para hover */
    background-color: #3584E4; /* Texto azul oscuro para contraste */
}


/* =================================================================== */
/* Estilos para el nuevo menú de usuario en la cabecera              */
/* =================================================================== */

.header-actions .dropdown-menu {
    margin-top: 0.5rem !important;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.header-actions .dropdown-item {
    font-weight: 500;
    color: #343a40;
}

.header-actions .dropdown-item:hover {
    background-color: #f8f9fa;
    color: #003366;
}

.header-actions .dropdown-item i {
    color: #6c757d;
    width: 20px; /* Alineación de los iconos */
}



/* =================================================================== */
/* Estilos para las tablas
/* =================================================================== */

.table-light th a {
    text-decoration: none;
    color: inherit;
}

.table-light th a:hover {
    text-decoration: none;
}

/* Indicador de ordenación para columnas inactivas */
.sort-indicator-inactive {
    color: #adb5bd; /* Gris suave para no distraer */
    opacity: 0.6;
    transition: opacity 0.2s ease-in-out;
}

/* Al pasar el ratón, el indicador se hace más visible */
.table-light th a:hover .sort-indicator-inactive {
    opacity: 1;
}

/* =================================================================== */
/* Unificar estilos para campos de solo lectura (readonly)           */
/* =================================================================== */

input[readonly],
textarea[readonly],
select[readonly],
input[readonly]:focus,
textarea[readonly]:focus,
select[readonly]:focus {
  background-color: #e9ecef; /* Color de fondo gris claro, estándar para campos inactivos */
  opacity: 1; /* Forzar opacidad para un color sólido */
  cursor: not-allowed; /* Muestra el cursor de 'no permitido' */
}
