/* ===== ESTILOS GENERALES Y LOGIN ===== */
:root {
    --color-guinda: #7B1E3A;
    --color-hover: #B87333;
    --color-guinda-claro: rgba(123, 30, 58, 0.1);
    --color-dorado: #B87333;
    --color-dorado-claro: rgba(184, 115, 51, 0.1);
    --fondo: #f8f8f8;
    --fuente-principal: 'Soberana Sans', Arial, sans-serif;
    --fuente-titulos: 'Soberana Titular', 'Soberana Sans', Arial, sans-serif;
    --fuente-texto: 'Soberana Texto', 'Soberana Sans', Georgia, serif;
    --fuente-condensada: 'Soberana Sans Condensed', 'Soberana Sans', Arial, sans-serif;
}

/* FONDO FIJO EN TODA LA PÁGINA */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: var(--fuente-principal);
    background: url('recursos/FondoSonora.png') no-repeat center center fixed;
    background-size: cover;
}

/* Contenedor principal sin scroll */
.login-main-container {
    height: 100vh;
    overflow: hidden;
}

/* Columnas del login */
.login-left-column {
    /*background: rgba(123, 30, 58, 0.85);
    backdrop-filter: blur(5px);*/
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-right-column {
    /*background: white;*/
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /*box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);*/
}

/* Contenido izquierdo */
.login-left-content {
    color: white;
    text-align: center;
    padding: 2rem;
    max-width: 500px;
}

.login-left-content h1,
.login-left-content h3,
.login-left-content p {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Formulario de login */
.login-container {
    max-width: 380px;
    padding: 30px 25px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.login-title {
    color: var(--color-guinda);
    font-size: 1.5rem;
    margin-bottom: 8px;
    font-weight: bold;
    text-align: center;
}

.login-subtitle {
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 25px;
    text-align: center;
}

.btn-login {
    background-color: var(--color-guinda);
    color: #FFFFFF;
    border: none;
    font-size: 0.9rem;
    padding: 8px;
    transition: background-color 0.2s;
}

.btn-login:hover {
    background-color: var(--color-hover);
    color: #FFFFFF;
}

.form-control {
    font-size: 0.9rem;
    padding: 6px 10px;
    border: 1px solid #ddd;
}

.form-control:focus {
    border-color: var(--color-guinda);
    box-shadow: 0 0 0 0.2rem rgba(123, 30, 58, 0.1);
}

.login-link {
    color: #7b1e3a !important;
    text-decoration: none !important;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.login-link:hover {
    color: #B87333 !important;
    text-decoration: none !important;
}

/* Ajustes responsivos */
@media (max-width: 767.98px) {
    .login-left-column {
        display: none !important;
    }
    
    .login-right-column {
        width: 100%;
        background: rgba(255, 255, 255, 0.95);
    }
}

/* Eliminar cualquier padding/margin que pueda causar scroll */
.container-fluid {
    padding: 0;
}

.row.g-0 {
    margin: 0;
}

/* ===== FUENTES SOBERANA ===== */
@font-face {
    font-family: 'Soberana Sans';
    src: url('../fuentes/SoberanaSans-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Soberana Sans';
    src: url('../fuentes/SoberanaSans-Italic.otf') format('opentype');
    font-weight: 400;
    font-style: italic;
}

@font-face {
    font-family: 'Soberana Sans';
    src: url('../fuentes/SoberanaSans-Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'Soberana Sans';
    src: url('../fuentes/SoberanaSans-LightItalic.otf') format('opentype');
    font-weight: 300;
    font-style: italic;
}

@font-face {
    font-family: 'Soberana Sans';
    src: url('../fuentes/SoberanaSans-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Soberana Sans';
    src: url('../fuentes/SoberanaSans-BoldItalic.otf') format('opentype');
    font-weight: 700;
    font-style: italic;
}

@font-face {
    font-family: 'Soberana Sans';
    src: url('../fuentes/SoberanaSans-Black.otf') format('opentype');
    font-weight: 900;
    font-style: normal;
}

@font-face {
    font-family: 'Soberana Sans';
    src: url('../fuentes/SoberanaSans-BlackItalic.otf') format('opentype');
    font-weight: 900;
    font-style: italic;
}

@font-face {
    font-family: 'Soberana Sans';
    src: url('../fuentes/SoberanaSans-Ultra.otf') format('opentype');
    font-weight: 800;
    font-style: normal;
}

@font-face {
    font-family: 'Soberana Sans';
    src: url('../fuentes/SoberanaSans-Ultraltalic.otf') format('opentype');
    font-weight: 800;
    font-style: italic;
}

/* Fuentes Soberana Sans Condensed */
@font-face {
    font-family: 'Soberana Sans Condensed';
    src: url('../fuentes/SoberanaSansCondensed-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Soberana Sans Condensed';
    src: url('../fuentes/SoberanaSansCondensed-Italic.otf') format('opentype');
    font-weight: 400;
    font-style: italic;
}

@font-face {
    font-family: 'Soberana Sans Condensed';
    src: url('../fuentes/SoberanaSansCondensed-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Soberana Sans Condensed';
    src: url('../fuentes/SoberanaSansCondensed-BoldItalic.otf') format('opentype');
    font-weight: 700;
    font-style: italic;
}

/* Fuentes Soberana Texto */
@font-face {
    font-family: 'Soberana Texto';
    src: url('../fuentes/SoberanaTexto-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Soberana Texto';
    src: url('../fuentes/SoberanaTexto-Italic.otf') format('opentype');
    font-weight: 400;
    font-style: italic;
}

@font-face {
    font-family: 'Soberana Texto';
    src: url('../fuentes/SoberanaTexto-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Soberana Texto';
    src: url('../fuentes/SoberanaTexto-BoldItalic.otf') format('opentype');
    font-weight: 700;
    font-style: italic;
}

/* Fuentes Soberana Titular */
@font-face {
    font-family: 'Soberana Titular';
    src: url('../fuentes/SoberanaTitular-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Soberana Titular';
    src: url('../fuentes/SoberanaTitular-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

/* ===== SIDEBAR COLAPSABLE ===== */
.sidebar {
    background: url("../recursos/SonoraCactusSideBar.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    min-height: 100vh;
    padding-top: 20px;
    position: fixed;
    width: 250px;
    z-index: 1030 !important;
    transition: all 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    height: 100vh;
    left: 0;
    top: 0;
}

/* Sidebar colapsado */
.sidebar.collapsed {
    width: 70px;
    overflow: hidden !important;
}

/* Cabecera del sidebar con logo y flecha */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px 15px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 15px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .logo-container {
    display: none !important;
}

.logo-escudo {
    height: 70px;
    width: auto;
}

.logo-text {
    font-family: var(--fuente-titulos);
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

/* Botón de colapsar/expandir */
.collapse-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

.collapse-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Items del sidebar */
.sidebar-item {
    padding: 12px 15px;
    cursor: pointer;
    font-size: 0.85rem;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.sidebar.collapsed .sidebar-item a {
    justify-content: center;
}

.sidebar-item:hover {
    background-color: var(--color-hover);
    border-left: 3px solid white;
}

.sidebar-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-left: 3px solid white;
    font-weight: 500;
}

.sidebar-item.active:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-left: 3px solid white;
}

/* Texto de los items - se oculta cuando está colapsado */
.sidebar-item-text {
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-item-text {
    display: none !important;
}

/* Iconos */
.sidebar-item i {
    font-size: 1.1rem;
    min-width: 20px;
    text-align: center;
}

/* Cerrar sesión */
.cerrar-sesion {
    margin-top: auto;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 20px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar.collapsed .cerrar-sesion {
    margin: 20px 10px;
    padding: 12px 0;
    justify-content: center;
}

.sidebar.collapsed .cerrar-sesion .sidebar-item-text {
    display: none !important;
}

.cerrar-sesion:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.cerrar-sesion i {
    margin-right: 0;
}

/* Contenido principal */
.main-content {
    margin-left: 250px;
    padding: 20px;
    transition: all 0.3s ease;
    min-height: 100vh;
    background: url('recursos/FondoSonora.png') no-repeat center center fixed;
    background-size: cover;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 70px;
}

/* Botón de menú móvil */
.menu-toggle-mobile {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1300;
    background: var(--color-guinda);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    display: none;
    font-size: 1.1rem;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.menu-toggle-mobile:hover {
    background-color: var(--color-hover);
}

/* ===== SOLUCIÓN PARA MODALES BOOTSTRAP ===== */
.modal {
    z-index: 1060 !important;
}

.modal-backdrop {
    z-index: 1040 !important;
}

/* ===== CORRECCIÓN PARA SIDEBAR EN MÓVIL ===== */
@media (max-width: 767.98px) {
    .menu-toggle-mobile {
        display: flex;
        z-index: 1300;
    }
    
    .sidebar {
        transform: translateX(-100%);
        z-index: 1250;
        width: 280px;
        overflow-y: auto;
        box-shadow: 3px 0 15px rgba(0,0,0,0.3);
    }
    
    .sidebar.show {
        transform: translateX(0);
        z-index: 1250;
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
        padding-top: 70px;
    }
    
    .sidebar.collapsed ~ .main-content {
        margin-left: 0;
    }
}

/* ===== CARDS MUNICIPALES ===== */
.card-municipal {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    background-color: white;
    margin-bottom: 25px;
    overflow: hidden;
}

.card-municipal:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12);
}

.card-municipal .card-header {
    background-color: var(--color-guinda);
    color: white;
    padding: 12px 20px;
    border-bottom: none;
    font-weight: 500;
}

.card-municipal .card-body {
    padding: 20px;
    background-color: white;
}

.card-municipal .card-footer {
    background-color: var(--color-guinda-claro);
    padding: 12px 20px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.card-municipal.dorada .card-header {
    background-color: var(--color-dorado);
}

.card-municipal.dorada .card-footer {
    background-color: var(--color-dorado-claro);
}

.card-municipal .btn-card {
    background-color: var(--color-guinda);
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 0.85rem;
}

.card-municipal .btn-card:hover {
    background-color: var(--color-dorado);
}

.card-municipal.dorada .btn-card {
    background-color: var(--color-dorado);
}

.card-municipal.dorada .btn-card:hover {
    background-color: var(--color-guinda);
}

/* ===== SWEETALERT2 ===== */
.swal2-popup {
    font-family: 'Arial', sans-serif;
    border-radius: 8px !important;
    border-top: 4px solid #7B1E3A !important;
}

.swal2-title {
    color: #7B1E3A !important;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
}

.swal2-icon.swal2-error {
    color: #7B1E3A !important;
    border-color: #7B1E3A !important;
}

.swal2-x-mark-line-left, 
.swal2-x-mark-line-right {
    background-color: #7B1E3A !important;
}

.swal2-confirm {
    background-color: #7B1E3A !important;
    border: none !important;
    transition: background 0.3s !important;
}

.swal2-confirm:hover {
    background-color: #B87333 !important;
}

.swal2-content {
    color: #555 !important;
}

/* ===== TABLAS ===== */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    border-collapse: collapse;
    font-size: 13px;
}

.table th {
    font-weight: 600;
    padding: 2px 10px;
    text-align: left;
}

.table td {
    padding: 2px 10px;
    border-top: 1px solid #dee2e6;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: var(--color-guinda-claro);
}

/* ===== ALERTS ===== */
.alert {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.alert-guinda {
    background-color: var(--color-guinda-claro);
    border-left: 4px solid var(--color-guinda);
    color: var(--color-guinda);
}

.alert-dorada {
    background-color: var(--color-dorado-claro);
    border-left: 4px solid var(--color-dorado);
    color: var(--color-dorado);
}

/* ===== LISTAS ===== */
.list-group-item {
    padding: 12px 15px;
    background-color: transparent;
    border-color: rgba(0,0,0,0.05);
}

/* ===== BOTONES ===== */
.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.btn-guinda {
    background-color: var(--color-guinda);
    border-color: var(--color-guinda);
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-guinda:hover {
    background-color: var(--color-hover);
    border-color: var(--color-hover);
    color: white;
}

/* ===== BADGES ===== */
.badge {
    font-weight: 500;
    padding: 5px 8px;
}

.badge.bg-guinda {
    background-color: var(--color-guinda);
    color: white;
}

/* ===== RESPONSIVE TABLAS ===== */
@media (max-width: 767.98px) {
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ===== VISTA DE CARTILLA ===== */
.profile-img-container {
    border: 3px solid var(--color-guinda);
    border-radius: 50%;
    padding: 5px;
    display: inline-block;
}

.text-guinda {
    color: var(--color-guinda);
}

.bg-guinda-light {
    background-color: var(--color-guinda-claro);
    color: var(--color-guinda);
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.datos-section {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.datos-section:last-child {
    border-bottom: none;
}

.document-status {
    background-color: var(--color-guinda-claro);
    padding: 15px;
    border-radius: 5px;
}

/* Progress bar */
.progress {
    background-color: #e9ecef;
    border-radius: 5px;
}

.progress-bar {
    border-radius: 5px;
}

/* Paginación */
.pagination {
    margin-bottom: 0;
}

.page-item .page-link {
    color: var(--color-guinda);
    border: 1px solid #dee2e6;
    padding: 0.3rem 0.6rem;
}

.page-item.active .page-link {
    background-color: var(--color-guinda);
    border-color: var(--color-guinda);
    color: white;
}

.page-item.disabled .page-link {
    color: #6c757d;
}

.page-item:not(.disabled):not(.active) .page-link:hover {
    background-color: var(--color-guinda-claro);
    color: var(--color-guinda);
}

/* Estilos para el texto de información */
.dataTables_info {
    font-size: 0.85rem;
    color: #6c757d;
    padding-top: 0.5rem;
}

.vehicle-img-container {
    border: 2px solid var(--color-guinda);
    border-radius: 8px;
    padding: 5px;
    background-color: white;
}

.vehicle-img {
    max-height: 200px;
    object-fit: cover;
}

.bg-guinda {
    background-color: var(--color-guinda);
    color: white;
}

.timeline {
    position: relative;
    padding-left: 20px;
}

.timeline-item {
    position: relative;
    padding-bottom: 15px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-point {
    position: absolute;
    left: -20px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--color-dorado);
    border: 2px solid white;
}

.timeline-content {
    padding-left: 10px;
    border-left: 2px solid var(--color-guinda-claro);
}

.timeline-item:last-child .timeline-content {
    border-left: 2px solid transparent;
}

.progress {
    background-color: #e9ecef;
    border-radius: 5px;
}

.progress-bar {
    font-size: 0.75rem;
    font-weight: 500;
}

.weapon-img-container {
    border: 2px solid var(--color-guinda);
    border-radius: 8px;
    padding: 5px;
    background-color: white;
}

.weapon-img {
    max-height: 200px;
    object-fit: contain;
}

.bg-guinda-light {
    background-color: var(--color-guinda-claro);
    color: var(--color-guinda);
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.datos-section {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.datos-section:last-child {
    border-bottom: none;
}

.list-group-item {
    padding: 12px 15px;
    background-color: transparent;
    border-color: rgba(0,0,0,0.05);
}

.progress {
    background-color: #e9ecef;
    border-radius: 5px;
}

.progress-bar {
    font-size: 0.75rem;
    font-weight: 500;
}

.badge.bg-guinda {
    background-color: var(--color-guinda);
    color: white;
}

/* Estructura ultracompacta */
.footer-ultracompact {
    position: fixed;
    bottom: 0;
    left: 250px;
    right: 0;
    background: var(--color-guinda);
    padding: 8px 0;
    border-top: 1px solid var(--color-dorado);
    z-index: 100;
    font-size: 0.75rem;
}

.footer-ultracompact .small {
    margin-bottom: 0;
    line-height: 1.3;
}

.footer-ultracompact a {
    color: white;
    text-decoration: none;
    white-space: nowrap;
}

.footer-ultracompact a:hover {
    color: var(--color-dorado);
}

/* Ajuste para móviles */
@media (max-width: 767.98px) {
    .footer-ultracompact {
        left: 0;
        position: relative;
        text-align: center;
    }
    
    .footer-ultracompact .row > div {
        margin-bottom: 10px;
    }
    
    .footer-ultracompact .text-md-end {
        text-align: center !important;
    }
}

.sidebar {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.sidebar > .logo-container {
    margin-top: auto;
    padding-bottom: 20px;
}

/* Opcional: estilo para la barra de desplazamiento */
.sidebar::-webkit-scrollbar {
    width: 8px;
}
.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

#cardEdicion {
    transition: all 0.3s ease;
    overflow: hidden;
}

.card-header {
    font-weight: 600;
}

/* ===== CABECERA PRINCIPAL ===== */
.cabecera-principal {
    background-image: url("../img/fondo-cabecera.jpg");
    background-color: #7B1E3A;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #fff;
    position: relative;
    z-index: 10;
}

/* Título de cabecera */
.titulo-cabecera {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1.4;
    color: #fff;
}

/* Overlay opcional si usas imagen */
.cabecera-principal::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 0;
}

.cabecera-principal > * {
    position: relative;
    z-index: 1;
}

/* Asegurar que el contenedor esté centrado */
.text-center {
    text-align: center !important;
}

/* Espaciado para los enlaces */
.mx-2 {
    margin-left: 0.5rem !important;
    margin-right: 0.5rem !important;
    color: #777;
}
loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(255, 255, 255, 0.95);
            z-index: 9999;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            
            /* Desaparece después de 3 segundos */
            animation: hideOverlay 0.5s ease-in-out 3s forwards;
        }
        
        .loading-text {
            margin-top: 20px;
            font-size: 1.2em;
            color: #333;
            font-weight: 500;
        }
        
        @keyframes hideOverlay {
            to {
                opacity: 0;
                visibility: hidden;
            }
        }
        
        /* Ocultar por defecto - se mostrará con JavaScript si es la primera vez */
        .loading-overlay {
            display: none;
        }
        
        /* Clase para mostrar el spinner */
        .show-loading {
            display: flex !important;
        }