:root {
    --ef-primary: #0d6efd;
    --ef-primary-dark: #0a58ca;
    --ef-bg: #f8fafc;
    --ef-sidebar-bg: #1e293b;
    --ef-sidebar-color: #cbd5e1;
    --ef-card-border: #e2e8f0;
}

body {
    background-color: var(--ef-bg);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #334155;
}

.sidebar {
    background-color: var(--ef-sidebar-bg);
    min-height: 100vh;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

@media (max-width: 767.98px) {
    .sidebar.collapse.show {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 285px;
        max-width: 85vw;
        z-index: 1050;
        overflow-y: auto;
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
    }
}

.sidebar .nav-link {
    color: var(--ef-sidebar-color);
    padding: 0.65rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
}

.sidebar .nav-link i {
    font-size: 1.15rem;
    margin-right: 0.75rem;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
    background-color: var(--ef-primary);
}

.content-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar-top {
    background: #ffffff;
    border-bottom: 1px solid var(--ef-card-border);
    padding: 0.75rem 1.5rem;
}

@media (max-width: 767.98px) {
    .navbar-top {
        background: #1e3a8a;
        color: #ffffff;
        border-bottom: none;
        padding: 0.65rem 1rem;
    }
}

.card-custom {
    border: 1px solid var(--ef-card-border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    background: #ffffff;
}

.badge-sri-autorizado {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.badge-sri-pendiente {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.badge-sri-devuelta {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.table-custom thead th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid var(--ef-card-border);
}

.table-custom td {
    vertical-align: middle;
    font-size: 0.92rem;
}

.form-label {
    font-weight: 500;
    color: #334155;
    font-size: 0.88rem;
    margin-bottom: 0.25rem;
}

.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Estilos Limpios para el Login sin Menú */
.auth-container {
    background-color: #f1f5f9;
    min-height: 100vh;
}

.auth-card {
    background: #ffffff;
    border-radius: 1.25rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    padding: 2.25rem;
}

.auth-icon-badge {
    width: 64px;
    height: 64px;
    border-radius: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
    color: #ffffff;
    font-size: 2rem;
    box-shadow: 0 8px 16px rgba(13, 110, 253, 0.25);
}

.btn-white {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0;
}

.tracking-tight {
    letter-spacing: -0.025em;
}

/* Barra de Navegación Inferior para Móviles (Bottom Navigation) */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: #ffffff;
    border-top: 1px solid var(--ef-card-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1040;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 4px 6px;
    flex: 1;
    transition: color 0.15s ease;
    border: none;
    background: transparent;
    cursor: pointer;
}

.bottom-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 2px;
    line-height: 1;
}

.bottom-nav-item.active, .bottom-nav-item:hover {
    color: var(--ef-primary);
}

.bottom-nav-item.active i {
    color: var(--ef-primary);
}

.bottom-nav-fab {
    position: relative;
    top: -10px;
}

.bottom-nav-fab .fab-circle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #198754, #157347);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(25, 135, 84, 0.35);
    margin-bottom: 2px;
    transition: transform 0.15s ease;
}

.bottom-nav-fab:active .fab-circle {
    transform: scale(0.92);
}

.bottom-nav-fab .fab-circle i {
    font-size: 1.4rem;
    margin-bottom: 0;
    color: #ffffff;
}

.bottom-nav-fab span {
    color: #198754;
    font-weight: 600;
}

/* Espacio al final del contenido para que el Bottom Nav no tape nada en móvil */
@media (max-width: 767.98px) {
    body:has(.mobile-bottom-nav) {
        padding-bottom: 72px;
    }
}

/* Modal Overlay Robusto sin Desplazamientos no deseados */
.modal-custom-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 1055 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    margin: 0 !important;
    padding: 0 !important;
}

