/* ===== PALETA PÚRPURA - SISTEMA MARCACIÓN GPS ===== */
:root {
    --snpp-purple-dark: #7C3AED;
    --snpp-purple: #8B5CF6;
    --snpp-purple-light: #A78BFA;
    --snpp-purple-pale: #DDD6FE;
    --snpp-purple-very-pale: #F5F3FF;
    --snpp-amber: #D97706;
    --snpp-red: #DC2626;
    --snpp-gray: #6B7280;
    --snpp-white: #FFFFFF;
}

/* ===== ESTILOS GENERALES ===== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--snpp-purple-very-pale);
    color: #374151;
}

/* ===== CABECERA SUPERIOR ===== */
.r-topheader {
    background: linear-gradient(135deg, var(--snpp-purple-dark) 0%, var(--snpp-purple) 100%) !important;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
    border-bottom: 3px solid var(--snpp-purple-light);
}

/* Logo */
[data-itemid="logo"] a {
    color: white !important;
    font-weight: 700;
    font-size: 24px;
    padding: 15px 0;
}

[data-itemid="logo"] a:hover {
    color: var(--snpp-purple-pale) !important;
}

/* Menú de Navegación */
.r-menu.navbar-nav > li > a {
    color: white !important;
    font-weight: 500;
    padding: 15px 20px !important;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 5px;
}

.r-menu.navbar-nav > li > a:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    transform: translateY(-1px);
}

.r-menu.navbar-nav > li.dropdown.open > a {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* Submenús */
.dropdown-menu {
    background: white !important;
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-top: 3px solid var(--snpp-purple);
    margin-top: 5px;
}

.dropdown-menu > li > a {
    color: var(--snpp-purple-dark) !important;
    padding: 12px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.dropdown-menu > li > a:hover {
    background: var(--snpp-purple-pale) !important;
    color: var(--snpp-purple-dark) !important;
    border-left: 3px solid var(--snpp-purple);
    padding-left: 25px;
}

/* ===== BÚSQUEDA Y CONTROLES SUPERIORES ===== */
.navbar-form .form-control {
    border: 2px solid #E5E7EB;
    border-radius: 25px;
    padding: 8px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.navbar-form .form-control:focus {
    border-color: var(--snpp-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.navbar-form .btn-primary {
    background: linear-gradient(135deg, var(--snpp-purple-dark) 0%, var(--snpp-purple) 100%) !important;
    border: none !important;
    border-radius: 25px !important;
    margin-left: 5px;
}

/* Botón de Usuario */
[data-itemid="username_button"] .btn-default {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    border-radius: 25px;
    padding: 8px 20px;
    transition: all 0.3s ease;
}

[data-itemid="username_button"] .btn-default:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    transform: translateY(-1px);
}

/* ===== TABLA CON SCROLL HORIZONTAL ===== */
.r-grid {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #E5E7EB;
    margin-bottom: 20px;
    overflow: hidden;
}

/* Contenedor de tabla con scroll */
.table-responsive-custom {
    overflow-x: auto;
    max-width: 100%;
    border-radius: 12px;
}

/* Aplicar scroll a la tabla existente */
.rnr-gridtable {
    min-width: 1200px; /* Fuerza el scroll horizontal */
    width: 100%;
    margin-bottom: 0;
}

/* Encabezados de tabla */
.ewTableHeader {
    background: linear-gradient(135deg, var(--snpp-purple-dark) 0%, var(--snpp-purple) 100%) !important;
    color: white !important;
    font-weight: 600 !important;
    border: none !important;
    padding: 15px 12px !important;
    position: sticky;
    top: 0;
    z-index: 10;
}

.ewTableHeader th {
    border: none !important;
    font-size: 14px;
    white-space: nowrap;
}

/* Filas de tabla */
.rnr-gridtable tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #E5E7EB;
}

.rnr-gridtable tbody tr:hover {
    background-color: var(--snpp-purple-very-pale) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.1);
}

.rnr-gridtable tbody td {
    padding: 12px !important;
    border-color: #E5E7EB !important;
    vertical-align: middle;
    font-size: 14px;
}

/* Filas alternas */
.ewTableAltRow {
    background-color: #F8FAFC !important;
}

/* Botones de acción en tabla */
[data-itemid="grid_edit"] a,
[data-itemid="grid_view"] a {
    color: var(--snpp-purple) !important;
    transition: all 0.3s ease;
    padding: 6px 10px;
    border-radius: 6px;
    display: inline-block;
}

[data-itemid="grid_edit"] a:hover,
[data-itemid="grid_view"] a:hover {
    background-color: var(--snpp-purple-pale);
    color: var(--snpp-purple-dark) !important;
    transform: scale(1.1);
}

/* Checkbox en tabla */
[data-itemid="grid_checkbox"] input[type="checkbox"] {
    accent-color: var(--snpp-purple);
    transform: scale(1.2);
    cursor: pointer;
}

/* ===== PANEL DE BÚSQUEDA ===== */
.searchOptions.panel {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    overflow: hidden;
}

.panel-primary > .panel-heading {
    background: linear-gradient(135deg, var(--snpp-purple-dark) 0%, var(--snpp-purple) 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600;
    border-radius: 16px 16px 0 0 !important;
}

.srchPanelRow {
    padding: 15px;
    border-bottom: 1px solid #E5E7EB;
    transition: background-color 0.3s ease;
}

.srchPanelRow:hover {
    background-color: var(--snpp-purple-very-pale);
}

.srchPanelRow label {
    color: var(--snpp-purple-dark);
    font-weight: 600;
    margin-bottom: 8px;
}

/* ===== FORMULARIOS ADD/EDIT/VIEW ===== */
.r-small-page {
    background: var(--snpp-purple-very-pale);
    min-height: 100vh;
    padding: 20px 0;
}

.r-form {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #E5E7EB;
    margin-bottom: 20px;
    overflow: hidden;
}

/* Títulos de páginas */
[data-itemid="add_header"] h2,
[data-itemid="edit_header"] h2,
[data-itemid="view_header"] h2 {
    color: var(--snpp-purple-dark);
    font-weight: 700;
    margin: 20px 0;
    text-align: center;
    font-size: 28px;
}

/* Secciones de formulario */
.form-section .panel-heading {
    background: linear-gradient(135deg, var(--snpp-purple-dark) 0%, var(--snpp-purple) 100%) !important;
    border: none !important;
    border-radius: 12px 12px 0 0 !important;
    color: white !important;
    padding: 20px;
}

.form-section .panel-heading h4 {
    color: white !important;
    font-weight: 600;
    margin: 0;
    font-size: 18px;
}

.form-section .panel-body {
    padding: 30px;
    background: white;
}

/* Campos de formulario */
.r-integrated-field {
    margin-bottom: 25px;
    padding: 15px;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.r-integrated-field:hover {
    border-color: var(--snpp-purple-pale);
    background-color: var(--snpp-purple-very-pale);
}

.r-edit-label {
    color: var(--snpp-purple-dark) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    margin-bottom: 8px !important;
}

.r-edit-label .icon-required {
    color: var(--snpp-red);
    margin-left: 4px;
}

/* Campos de entrada */
.form-control {
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    padding: 12px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #F8FAFC;
}

.form-control:focus {
    border-color: var(--snpp-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    background: white;
}

/* Selects */
select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%237C3AED' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

/* Textareas */
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* ===== BOTONES ===== */
/* Botones Primarios */
[data-itemid="add_save"] a,
[data-itemid="edit_save"] a,
[data-itemid="login_button"] a {
    background: linear-gradient(135deg, var(--snpp-purple-dark) 0%, var(--snpp-purple) 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 12px 30px !important;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    color: white !important;
    display: inline-block;
    margin: 5px;
}

[data-itemid="add_save"] a:hover,
[data-itemid="edit_save"] a:hover,
[data-itemid="login_button"] a:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.6);
    background: linear-gradient(135deg, var(--snpp-purple) 0%, var(--snpp-purple-light) 100%) !important;
}

/* Botones Secundarios */
[data-itemid="add_reset"] a,
[data-itemid="add_back_list"] a,
[data-itemid="edit_back_list"] a,
[data-itemid="view_back_list"] a,
[data-itemid="edit_reset"] a {
    background: white !important;
    border: 2px solid var(--snpp-purple) !important;
    border-radius: 12px !important;
    padding: 12px 30px !important;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease !important;
    color: var(--snpp-purple) !important;
    display: inline-block;
    margin: 5px;
}

[data-itemid="add_reset"] a:hover,
[data-itemid="add_back_list"] a:hover,
[data-itemid="edit_back_list"] a:hover,
[data-itemid="view_back_list"] a:hover,
[data-itemid="edit_reset"] a:hover {
    background: var(--snpp-purple-pale) !important;
    transform: translateY(-1px);
    color: var(--snpp-purple-dark) !important;
}

/* Botones de Peligro/Cancelar */
[data-itemid="add_cancel"] a,
[data-itemid="edit_close"] a,
[data-itemid="view_close"] a {
    background: white !important;
    border: 2px solid var(--snpp-gray) !important;
    border-radius: 12px !important;
    padding: 12px 30px !important;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease !important;
    color: var(--snpp-gray) !important;
    display: inline-block;
    margin: 5px;
}

[data-itemid="add_cancel"] a:hover,
[data-itemid="edit_close"] a:hover,
[data-itemid="view_close"] a:hover {
    background: #F3F4F6 !important;
    transform: translateY(-1px);
    color: var(--snpp-gray) !important;
}

/* ===== ESTILOS PARA ICONO DE MAPA ===== */
/* Reemplazar "Ver Ubicación" con icono de mapa */
[data-fieldname="link_mapa"] a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    color: transparent !important;
    font-size: 0;
    background: linear-gradient(135deg, var(--snpp-purple-dark) 0%, var(--snpp-purple) 100%);
    border-radius: 12px;
    padding: 12px;
    width: 50px;
    height: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
    position: relative;
}

[data-fieldname="link_mapa"] a::before {
    content: "📍";
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

[data-fieldname="link_mapa"] a:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.5);
    background: linear-gradient(135deg, var(--snpp-purple) 0%, var(--snpp-purple-light) 100%);
}

[data-fieldname="link_mapa"] a:active {
    transform: translateY(-1px) scale(1.02);
}

/* Tooltip para mostrar información al pasar el mouse */
[data-fieldname="link_mapa"] a::after {
    content: "Ver ubicación en Google Maps";
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--snpp-purple-dark);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-fieldname="link_mapa"] a::before {
    z-index: 2;
    position: relative;
}

[data-fieldname="link_mapa"] a:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: -45px;
}

/* Alternativa con icono SVG (más profesional) */
[data-fieldname="link_mapa"].svg-version a::before {
    content: "📍";
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5a2.5 2.5 0 0 1 0-5 2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px 24px;
    width: 100%;
    height: 100%;
}

/* Estilos responsivos para el icono del mapa */
@media (max-width: 768px) {
    [data-fieldname="link_mapa"] a {
        width: 45px;
        height: 45px;
        padding: 10px;
    }
    
    [data-fieldname="link_mapa"] a::before {
        font-size: 20px;
    }
    
    [data-fieldname="link_mapa"] a::after {
        font-size: 11px;
        padding: 6px 10px;
        bottom: -35px;
    }
    
    [data-fieldname="link_mapa"] a:hover::after {
        bottom: -40px;
    }
}

/* Asegurar que el contenedor del campo tenga suficiente espacio */
[data-fieldname="link_mapa"] .r-integrated-field {
    min-height: 80px;
    display: flex;
    align-items: center;
}

[data-fieldname="link_mapa"] .col-md-6 {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

/* ===== ESTADOS GPS ===== */
/* Badges para estados GPS */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-activo {
    background-color: var(--snpp-purple);
    color: white;
}

.status-en-linea {
    background-color: var(--snpp-purple-light);
    color: white;
}

.status-inactivo {
    background-color: var(--snpp-amber);
    color: white;
}

.status-sin-conexion {
    background-color: var(--snpp-red);
    color: white;
}

.status-ubicacion {
    background-color: #06B6D4;
    color: white;
}

/* ===== PAGINACIÓN ===== */
.pagination {
    margin: 20px 0;
}

.pagination > li > a,
.pagination > li > span {
    border: 2px solid #E5E7EB;
    border-radius: 8px !important;
    margin: 0 3px;
    color: var(--snpp-purple-dark);
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination > li > a:hover {
    background-color: var(--snpp-purple-pale);
    border-color: var(--snpp-purple);
    color: var(--snpp-purple-dark);
}

.pagination > .active > a,
.pagination > .active > span {
    background: linear-gradient(135deg, var(--snpp-purple-dark) 0%, var(--snpp-purple) 100%) !important;
    border-color: var(--snpp-purple) !important;
}

/* ===== MENSAJES DE ALERTA ===== */
.alert {
    border-radius: 12px;
    border: none;
    padding: 20px;
    font-size: 14px;
    margin: 20px 0;
}

.alert-success {
    background-color: var(--snpp-purple-pale);
    color: var(--snpp-purple-dark);
    border-left: 4px solid var(--snpp-purple);
}

.alert-danger {
    background-color: #FEF2F2;
    color: var(--snpp-red);
    border-left: 4px solid var(--snpp-red);
}

.alert-warning {
    background-color: #FFFBEB;
    color: var(--snpp-amber);
    border-left: 4px solid var(--snpp-amber);
}

.alert-info {
    background-color: #EFF6FF;
    color: #1E40AF;
    border-left: 4px solid #3B82F6;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    background: transparent;
    padding: 15px 0;
    margin-bottom: 0;
}

.breadcrumb > li > a {
    color: var(--snpp-purple);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb > li > a:hover {
    color: var(--snpp-purple-dark);
    text-decoration: underline;
}

.breadcrumb > .active {
    color: var(--snpp-gray);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .r-grid {
        margin: 10px;
        border-radius: 12px;
    }
    
    .table-responsive-custom {
        border-radius: 8px;
    }
    
    .r-form {
        margin: 10px;
        padding: 15px;
    }
    
    .form-section .panel-body {
        padding: 20px;
    }
    
    .r-integrated-field {
        padding: 10px;
    }
    
    /* Botones en móvil */
    [data-itemid="add_save"] a,
    [data-itemid="edit_save"] a,
    [data-itemid="add_reset"] a,
    [data-itemid="add_back_list"] a {
        display: block;
        width: 100%;
        margin: 5px 0;
        text-align: center;
    }
    
    /* Menú en móvil */
    .r-menu.navbar-nav > li > a {
        padding: 12px 15px !important;
        margin: 2px 0;
        text-align: center;
    }
}

/* ===== ANIMACIONES Y EFECTOS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.r-form {
    animation: fadeIn 0.5s ease-out;
}

/* Efectos de hover suaves */
.btn, .form-control, .r-integrated-field {
    transition: all 0.3s ease;
}

/* Sombras para profundidad */
.panel, .r-form, .searchOptions.panel {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* ===== SCROLLBAR PERSONALIZADO ===== */
.table-responsive-custom::-webkit-scrollbar {
    height: 8px;
}

.table-responsive-custom::-webkit-scrollbar-track {
    background: #F1F5F9;
    border-radius: 4px;
}

.table-responsive-custom::-webkit-scrollbar-thumb {
    background: var(--snpp-purple);
    border-radius: 4px;
}

.table-responsive-custom::-webkit-scrollbar-thumb:hover {
    background: var(--snpp-purple-dark);
}

/* Scrollbar para el panel de búsqueda */
.panel-body::-webkit-scrollbar {
    width: 6px;
}

.panel-body::-webkit-scrollbar-track {
    background: #F1F5F9;
}

.panel-body::-webkit-scrollbar-thumb {
    background: var(--snpp-purple);
    border-radius: 3px;
}

/* ===== MENSAJES DE ERROR PERSONALIZADOS ===== */
.custom-error-message {
    background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%);
    border: 2px solid #FECACA;
    border-radius: 16px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(254, 202, 202, 0.3);
    border-left: 6px solid #EF4444;
    animation: slideInUp 0.5s ease-out;
}

.custom-error-message .error-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 20px;
}

.custom-error-message .error-content h4 {
    color: #DC2626;
    margin: 0 0 12px 0;
    font-weight: 700;
    font-size: 20px;
    text-align: center;
}

.custom-error-message .error-content p {
    color: #7F1D1D;
    margin: 0 0 15px 0;
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
}

.custom-error-message .error-details {
    background: rgba(239, 68, 68, 0.1);
    border-radius: 10px;
    padding: 12px 15px;
    margin: 15px 0;
    border-left: 3px solid #EF4444;
}

.custom-error-message .detail-title {
    font-weight: 600;
    color: #DC2626;
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
}

.custom-error-message .error-details span:last-child {
    color: #7F1D1D;
    font-size: 13px;
}

.custom-error-message .error-suggestion {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    border: 1px solid #FECACA;
}

.custom-error-message .suggestion-title {
    font-weight: 700;
    color: var(--snpp-purple-dark);
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
}

.custom-error-message .error-suggestion ul {
    margin: 0;
    padding-left: 20px;
    color: #374151;
}

.custom-error-message .error-suggestion li {
    margin-bottom: 5px;
    font-size: 13px;
    line-height: 1.4;
}

/* Mensajes de éxito personalizados */
.custom-success-message {
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border: 2px solid #DDD6FE;
    border-radius: 16px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(221, 214, 254, 0.3);
    border-left: 6px solid var(--snpp-purple);
    animation: slideInUp 0.5s ease-out;
}

.custom-success-message .success-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 20px;
}

.custom-success-message .success-content h4 {
    color: var(--snpp-purple-dark);
    margin: 0 0 12px 0;
    font-weight: 700;
    font-size: 20px;
    text-align: center;
}

/* Animación para los mensajes */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== ESTILOS ESPECÍFICOS PARA GPS ===== */
.gps-marker {
    background: var(--snpp-purple);
    border: 3px solid white;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.5);
}

.gps-marker.activo {
    background: var(--snpp-purple);
    animation: pulse 2s infinite;
}

.gps-marker.inactivo {
    background: var(--snpp-amber);
}

.gps-marker.alerta {
    background: var(--snpp-red);
    animation: blink 1s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(124, 58, 237, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(124, 58, 237, 0);
    }
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0.3;
    }
}

/* Tarjetas de estadísticas GPS */
.gps-stats-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--snpp-purple);
    transition: all 0.3s ease;
}

.gps-stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.15);
}

.gps-stats-card .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--snpp-purple-dark);
    margin-bottom: 5px;
}

.gps-stats-card .stat-label {
    color: var(--snpp-gray);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Mapa de calor */
.heat-map {
    background: linear-gradient(135deg, var(--snpp-purple-very-pale) 0%, var(--snpp-purple-pale) 100%);
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
}

/* ===== SOLUCIÓN CON SVG ===== */
[data-fieldname="link_mapa"] a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    color: transparent !important;
    font-size: 0;
    background: var(--snpp-purple-pale);
    border: 2px solid var(--snpp-purple-light);
    border-radius: 12px;
    padding: 12px;
    width: 50px;
    height: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
    position: relative;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237C3AED'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5a2.5 2.5 0 0 1 0-5 2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px 24px;
}

/* Ocultar el texto */
[data-fieldname="link_mapa"] a span {
    display: none !important;
}

/* Efectos hover */
[data-fieldname="link_mapa"] a:hover {
    background-color: var(--snpp-purple-light);
    border-color: var(--snpp-purple);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238B5CF6'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5a2.5 2.5 0 0 1 0-5 2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E");
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.25);
}

/* Tooltip */
[data-fieldname="link_mapa"] a::after {
    content: "Abrir en Google Maps";
    position: absolute;
    bottom: -45px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--snpp-purple-dark);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
    font-weight: 500;
}

[data-fieldname="link_mapa"] a:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: -50px;
}


/* ===== ESTILOS PARA FORMULARIO DE MARCACIÓN GPS - BOTONES ===== */
.function-add .r-small-page {
    background: linear-gradient(135deg, var(--snpp-purple-very-pale) 0%, #ffffff 100%);
    min-height: 100vh;
    padding: 20px 0;
}

.function-add .r-form {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #E5E7EB;
    margin-bottom: 20px;
    overflow: hidden;
}

/* ===== BOTONES PRINCIPALES ===== */
/* Botón Guardar */
.function-add [data-itemid="add_save"] a {
    background: linear-gradient(135deg, var(--snpp-purple-dark) 0%, var(--snpp-purple) 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 14px 35px !important;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    color: white !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 5px;
    min-width: 140px;
    position: relative;
    overflow: hidden;
}

.function-add [data-itemid="add_save"] a::before {
    content: "💾";
    margin-right: 8px;
    font-size: 18px;
}

.function-add [data-itemid="add_save"] a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.6);
    background: linear-gradient(135deg, var(--snpp-purple) 0%, var(--snpp-purple-light) 100%) !important;
}

.function-add [data-itemid="add_save"] a:active {
    transform: translateY(-1px);
}

/* Botón Reiniciar */
.function-add [data-itemid="add_reset"] a {
    background: white !important;
    border: 2px solid var(--snpp-purple) !important;
    border-radius: 12px !important;
    padding: 14px 35px !important;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease !important;
    color: var(--snpp-purple) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 5px;
    min-width: 140px;
}

.function-add [data-itemid="add_reset"] a::before {
    content: "🔄";
    margin-right: 8px;
    font-size: 16px;
}

.function-add [data-itemid="add_reset"] a:hover {
    background: var(--snpp-purple-pale) !important;
    transform: translateY(-2px);
    color: var(--snpp-purple-dark) !important;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

/* Botón Volver a la lista */
.function-add [data-itemid="add_back_list"] a {
    background: white !important;
    border: 2px solid var(--snpp-gray) !important;
    border-radius: 12px !important;
    padding: 14px 35px !important;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease !important;
    color: var(--snpp-gray) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 5px;
    min-width: 140px;
}

.function-add [data-itemid="add_back_list"] a::before {
    content: "←";
    margin-right: 8px;
    font-size: 16px;
}

.function-add [data-itemid="add_back_list"] a:hover {
    background: #F3F4F6 !important;
    transform: translateY(-2px);
    color: var(--snpp-gray) !important;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.2);
}

/* Botón Cancelar */
.function-add [data-itemid="add_cancel"] a {
    background: white !important;
    border: 2px solid var(--snpp-red) !important;
    border-radius: 12px !important;
    padding: 14px 35px !important;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease !important;
    color: var(--snpp-red) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 5px;
    min-width: 140px;
}

.function-add [data-itemid="add_cancel"] a::before {
    content: "✕";
    margin-right: 8px;
    font-size: 16px;
    font-weight: bold;
}

.function-add [data-itemid="add_cancel"] a:hover {
    background: #FEF2F2 !important;
    transform: translateY(-2px);
    color: var(--snpp-red) !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

/* ===== BOTÓN PERSONALIZADO - SACAR FOTO ===== */
.function-add [data-itemid="custom_button"] a {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 12px 25px !important;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease !important;
    color: white !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.function-add [data-itemid="custom_button"] a::before {
    content: "📷";
    margin-right: 8px;
    font-size: 16px;
}

.function-add [data-itemid="custom_button"] a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
}

/* ===== BOTONES DE MENSAJES ===== */
/* Botones dentro de mensajes de alerta */
.function-add .alert .btn {
    border-radius: 8px !important;
    padding: 8px 16px !important;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    margin: 2px 5px;
}

.function-add .alert .btn-default {
    background: white !important;
    border: 2px solid var(--snpp-purple) !important;
    color: var(--snpp-purple) !important;
}

.function-add .alert .btn-default:hover {
    background: var(--snpp-purple-pale) !important;
    transform: translateY(-1px);
}

/* ===== ESTILOS ADICIONALES PARA EL FORMULARIO ===== */
/* Títulos */
.function-add [data-itemid="add_header"] h2 {
    color: var(--snpp-purple-dark);
    font-weight: 700;
    margin: 20px 0;
    text-align: center;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--snpp-purple-dark) 0%, var(--snpp-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Sección del formulario */
.function-add .form-section .panel-heading {
    background: linear-gradient(135deg, var(--snpp-purple-dark) 0%, var(--snpp-purple) 100%) !important;
    border: none !important;
    border-radius: 12px 12px 0 0 !important;
    color: white !important;
    padding: 20px;
    text-align: center;
}

.function-add .form-section .panel-heading h4 {
    color: white !important;
    font-weight: 600;
    margin: 0;
    font-size: 1.3rem;
}

.function-add .form-section .panel-body {
    padding: 30px;
    background: white;
}

/* Campos del formulario */
.function-add .r-integrated-field {
    margin-bottom: 25px;
    padding: 15px;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: var(--snpp-purple-very-pale);
}

.function-add .r-integrated-field:hover {
    border-color: var(--snpp-purple-light);
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.1);
}

.function-add .r-edit-label {
    color: var(--snpp-purple-dark) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    margin-bottom: 8px !important;
}

/* Mensajes de alerta */
.function-add .alert {
    border-radius: 12px;
    border: none;
    padding: 20px;
    font-size: 14px;
    margin: 20px 0;
}

.function-add .alert-success {
    background-color: var(--snpp-purple-pale);
    color: var(--snpp-purple-dark);
    border-left: 4px solid var(--snpp-purple);
}

/* ===== EFECTOS ESPECIALES PARA BOTONES ===== */
/* Efecto de pulso en botón Guardar */
@keyframes pulse-save {
    0% {
        box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(124, 58, 237, 0.6), 0 0 0 10px rgba(124, 58, 237, 0.1);
    }
    100% {
        box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    }
}

.function-add [data-itemid="add_save"] a:focus {
    animation: pulse-save 2s infinite;
}

/* Efecto de carga en botones */
.function-add .btn-loading {
    position: relative;
    color: transparent !important;
}

.function-add .btn-loading::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .function-add .r-small-page {
        padding: 10px 0;
    }
    
    .function-add .r-form {
        margin: 10px;
        border-radius: 12px;
    }
    
    .function-add [data-itemid="add_save"] a,
    .function-add [data-itemid="add_reset"] a,
    .function-add [data-itemid="add_back_list"] a,
    .function-add [data-itemid="add_cancel"] a {
        display: block;
        width: 100%;
        margin: 8px 0;
        text-align: center;
    }
    
    .function-add [data-cellId="below-grid_c1"] {
        padding: 15px !important;
    }
    
    .function-add .form-section .panel-body {
        padding: 20px;
    }
    
    .function-add .r-integrated-field {
        padding: 12px;
        margin-bottom: 20px;
    }
}

/* ===== ANIMACIONES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.function-add [data-itemid="add_save"] a,
.function-add [data-itemid="add_reset"] a,
.function-add [data-itemid="add_back_list"] a,
.function-add [data-itemid="add_cancel"] a {
    animation: fadeInUp 0.6s ease-out;
}

.function-add [data-itemid="add_save"] a {
    animation-delay: 0.1s;
    animation-fill-mode: both;
}

.function-add [data-itemid="add_reset"] a {
    animation-delay: 0.2s;
    animation-fill-mode: both;
}

.function-add [data-itemid="add_back_list"] a {
    animation-delay: 0.3s;
    animation-fill-mode: both;
}

.function-add [data-itemid="add_cancel"] a {
    animation-delay: 0.4s;
    animation-fill-mode: both;
}

/* ===== ESTILOS PARA FORMULARIO DE VISTA MARCACIÓN GPS ===== */
.function-view .r-small-page {
    background: linear-gradient(135deg, var(--snpp-purple-very-pale) 0%, #ffffff 100%);
    min-height: 100vh;
    padding: 20px 0;
}

.function-view .r-form {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #E5E7EB;
    margin-bottom: 20px;
    overflow: hidden;
}

/* ===== TÍTULOS ===== */
.function-view [data-itemid="view_header"] h2 {
    color: var(--snpp-purple-dark);
    font-weight: 700;
    margin: 20px 0;
    text-align: center;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--snpp-purple-dark) 0%, var(--snpp-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== SECCIÓN DEL FORMULARIO ===== */
.function-view .form-section .panel-heading {
    background: linear-gradient(135deg, var(--snpp-purple-dark) 0%, var(--snpp-purple) 100%) !important;
    border: none !important;
    border-radius: 12px 12px 0 0 !important;
    color: white !important;
    padding: 20px;
    text-align: center;
}

.function-view .form-section .panel-heading h4 {
    color: white !important;
    font-weight: 600;
    margin: 0;
    font-size: 1.3rem;
}

.function-view .form-section .panel-body {
    padding: 30px;
    background: white;
}

/* ===== CAMPOS DEL FORMULARIO (VISTA) ===== */
.function-view .r-integrated-field {
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: var(--snpp-purple-very-pale);
    position: relative;
    overflow: hidden;
}

.function-view .r-integrated-field:hover {
    border-color: var(--snpp-purple-light);
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.1);
}

.function-view .bs-view-label {
    color: var(--snpp-purple-dark) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    margin-bottom: 8px !important;
    display: flex;
    align-items: center;
}

/* Valores de los campos */
.function-view .col-md-6 {
    color: #374151;
    font-size: 15px;
    font-weight: 500;
    padding: 10px 0;
    display: flex;
    align-items: center;
    min-height: 44px;
}

/* ===== ICONOS PARA CAMPOS ESPECÍFICOS ===== */
/* Campo ID Marcación */
.function-view [data-fieldname="id_marcacion"] .r-integrated-field::before {
    content: "🆔";
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--snpp-purple);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

/* Campo Fecha */
.function-view [data-fieldname="fecha_marcacion"] .r-integrated-field::before {
    content: "📅";
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--snpp-purple);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

/* Campo Usuario */
.function-view [data-fieldname="id_usuario"] .r-integrated-field::before,
.function-view [data-fieldname="usuario"] .r-integrated-field::before {
    content: "👤";
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--snpp-purple);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

/* Campo Imagen */
.function-view [data-fieldname="image"] .r-integrated-field::before {
    content: "📷";
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--snpp-purple);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

/* Campo Mapa */
.function-view [data-fieldname="link_mapa"] .r-integrated-field::before {
    content: "📍";
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--snpp-purple);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

/* Mostrar iconos al hacer hover */
.function-view .r-integrated-field:hover::before {
    opacity: 1;
    left: -15px;
}

/* ===== ESTILOS ESPECIALES PARA ENLACES ===== */




/* Imagen (si existe) */
.function-view [data-fieldname="image"] a {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--snpp-purple-pale);
    color: var(--snpp-purple-dark);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 1px solid var(--snpp-purple-light);
}

.function-view [data-fieldname="image"] a::before {
    content: "🖼️";
    margin-right: 8px;
}

.function-view [data-fieldname="image"] a:hover {
    background: var(--snpp-purple-light);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

/* ===== BOTONES INFERIORES ===== */
.function-view [data-cellId="below-grid_c1"] {
    background: #F8FAFC;
    padding: 30px !important;
    text-align: center;
    border-top: 1px solid #E5E7EB;
}

/* Botón Volver a la lista */
.function-view [data-itemid="view_back_list"] a {
    background: white !important;
    border: 2px solid var(--snpp-purple) !important;
    border-radius: 12px !important;
    padding: 14px 35px !important;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease !important;
    color: var(--snpp-purple) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 5px;
    min-width: 160px;
}

.function-view [data-itemid="view_back_list"] a::before {
    content: "←";
    margin-right: 8px;
    font-size: 16px;
}

.function-view [data-itemid="view_back_list"] a:hover {
    background: var(--snpp-purple-pale) !important;
    transform: translateY(-2px);
    color: var(--snpp-purple-dark) !important;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

/* Botón Cerrar ventana */
.function-view [data-itemid="view_close"] a {
    background: white !important;
    border: 2px solid var(--snpp-gray) !important;
    border-radius: 12px !important;
    padding: 14px 35px !important;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease !important;
    color: var(--snpp-gray) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 5px;
    min-width: 160px;
}

.function-view [data-itemid="view_close"] a::before {
    content: "✕";
    margin-right: 8px;
    font-size: 16px;
    font-weight: bold;
}

.function-view [data-itemid="view_close"] a:hover {
    background: #F3F4F6 !important;
    transform: translateY(-2px);
    color: var(--snpp-gray) !important;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.2);
}

/* ===== ANIMACIONES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.function-view .r-grid {
    animation: fadeInUp 0.6s ease-out;
}

.function-view .r-integrated-field {
    animation: slideInFromLeft 0.6s ease-out;
    animation-fill-mode: both;
}

/* Animaciones escalonadas para campos */
.function-view [data-fieldname="id_marcacion"] .r-integrated-field {
    animation-delay: 0.1s;
}

.function-view [data-fieldname="fecha_marcacion"] .r-integrated-field {
    animation-delay: 0.2s;
}

.function-view [data-fieldname="id_usuario"] .r-integrated-field {
    animation-delay: 0.3s;
}

.function-view [data-fieldname="usuario"] .r-integrated-field {
    animation-delay: 0.4s;
}

.function-view [data-fieldname="image"] .r-integrated-field {
    animation-delay: 0.5s;
}

.function-view [data-fieldname="link_mapa"] .r-integrated-field {
    animation-delay: 0.6s;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .function-view .r-small-page {
        padding: 10px 0;
    }
    
    .function-view .r-form {
        margin: 10px;
        border-radius: 12px;
    }
    
    .function-view .form-section .panel-body {
        padding: 20px;
    }
    
    .function-view .r-integrated-field {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .function-view .bs-view-label {
        text-align: left !important;
        margin-bottom: 5px !important;
    }
    
    .function-view .col-md-3,
    .function-view .col-md-6 {
        width: 100%;
        text-align: left;
    }
    
    .function-view [data-itemid="view_back_list"] a,
    .function-view [data-itemid="view_close"] a {
        display: block;
        width: 100%;
        margin: 8px 0;
        text-align: center;
    }
    
    .function-view [data-cellId="below-grid_c1"] {
        padding: 20px 15px !important;
    }
    
    /* Ocultar iconos en móviles */
    .function-view .r-integrated-field::before {
        display: none;
    }
}

/* ===== MEJORAS VISUALES ADICIONALES ===== */
/* Línea decorativa en etiquetas */
.function-view .bs-view-label::after {
    content: "";
    display: block;
    width: 30px;
    height: 2px;
    background: linear-gradient(135deg, var(--snpp-purple-dark) 0%, var(--snpp-purple) 100%);
    margin-top: 4px;
    border-radius: 1px;
}

/* Efecto de borde en campos al hacer hover */
.function-view .r-integrated-field::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid transparent;
    border-radius: 12px;
    pointer-events: none;
    transition: all 0.3s ease;
}

.function-view .r-integrated-field:hover::after {
    border-color: var(--snpp-purple-light);
}

/* Estados especiales para campos importantes */
.function-view [data-fieldname="fecha_marcacion"] .r-integrated-field {
    background: linear-gradient(135deg, var(--snpp-purple-very-pale) 0%, #ffffff 100%);
    border-left: 4px solid var(--snpp-purple);
}

.function-view [data-fieldname="link_mapa"] .r-integrated-field {
    background: linear-gradient(135deg, #F0FDF4 0%, #ffffff 100%);
    border-left: 4px solid #10B981;
}


/* ===== ESTILOS PARA LISTA DE MARCACIONES GPS ===== */
.function-list .r-topbar-page {
    background: linear-gradient(135deg, var(--snpp-purple-very-pale) 0%, #ffffff 100%);
    min-height: 100vh;
}

.function-list .r-content {
    padding: 20px 0;
}

/* ===== BARRA SUPERIOR ===== */
.function-list .r-topheader {
    background: linear-gradient(135deg, var(--snpp-purple-dark) 0%, var(--snpp-purple) 100%) !important;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
    border-bottom: 3px solid var(--snpp-purple-light);
}

/* Búsqueda */
.function-list [data-itemid="simple_search"] .form-control {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transition: all 0.3s ease;
}

.function-list [data-itemid="simple_search"] .form-control:focus {
    border-color: white;
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
    color: white;
}

.function-list [data-itemid="simple_search"] .form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.function-list [data-itemid="simple_search"] .btn-primary {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 25px !important;
    color: white;
}

.function-list [data-itemid="simple_search"] .btn-primary:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

/* ===== PANEL DE BÚSQUEDA LATERAL ===== */
.function-list .searchOptions.panel {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    overflow: hidden;
    margin-bottom: 20px;
}

.function-list .searchOptions .panel-heading {
    background: linear-gradient(135deg, var(--snpp-purple-dark) 0%, var(--snpp-purple) 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600;
    border-radius: 16px 16px 0 0 !important;
    padding: 15px 20px;
}

.function-list .srchPanelRow {
    padding: 15px;
    border-bottom: 1px solid #E5E7EB;
    transition: background-color 0.3s ease;
}

.function-list .srchPanelRow:hover {
    background-color: var(--snpp-purple-very-pale);
}

.function-list .srchPanelRow label {
    color: var(--snpp-purple-dark);
    font-weight: 600;
    margin-bottom: 8px;
}

.function-list .bottomSearchButt {
    background: #F8FAFC;
    padding: 15px;
    border-top: 1px solid #E5E7EB;
}

.function-list .bottomSearchButt .btn {
    border-radius: 8px;
    font-weight: 500;
}

/* ===== BOTONES SUPERIORES ===== */
/* Botón Añadir */
.function-list [data-itemid="add"] a {
    background: linear-gradient(135deg, var(--snpp-purple-dark) 0%, var(--snpp-purple) 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 12px 25px !important;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
    color: white !important;
    display: inline-flex;
    align-items: center;
}

.function-list [data-itemid="add"] a::before {
    content: "➕";
    margin-right: 8px;
    font-size: 16px;
}

.function-list [data-itemid="add"] a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
    background: linear-gradient(135deg, var(--snpp-purple) 0%, var(--snpp-purple-light) 100%) !important;
}

/* ===== TABLA PRINCIPAL ===== */
.function-list .r-grid {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #E5E7EB;
    margin-bottom: 20px;
    overflow: hidden;
}

.function-list .rnr-gridtable {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

/* Encabezados de tabla */
.function-list .ewTableHeader {
    background: linear-gradient(135deg, var(--snpp-purple-dark) 0%, var(--snpp-purple) 100%) !important;
    color: white !important;
    font-weight: 600 !important;
    border: none !important;
    padding: 15px 12px !important;
    position: sticky;
    top: 0;
    z-index: 10;
}

.function-list .ewTableHeader th {
    border: none !important;
    font-size: 14px;
    white-space: nowrap;
    text-align: center;
}

/* Filas de tabla */
.function-list .rnr-gridtable tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #E5E7EB;
}

.function-list .rnr-gridtable tbody tr:hover {
    background-color: var(--snpp-purple-very-pale) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.1);
}

.function-list .rnr-gridtable tbody td {
    padding: 12px !important;
    border-color: #E5E7EB !important;
    vertical-align: middle;
    font-size: 14px;
    text-align: center;
}

/* Filas alternas */
.function-list .ewTableAltRow {
    background-color: #F8FAFC !important;
}

/* ===== BOTONES DE ACCIÓN EN TABLA ===== */
.function-list [data-itemid="grid_view"] a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: var(--snpp-purple-pale);
    color: var(--snpp-purple-dark) !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.function-list [data-itemid="grid_view"] a:hover {
    background: var(--snpp-purple);
    color: white !important;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Checkbox en tabla */
.function-list [data-itemid="grid_checkbox"] input[type="checkbox"],
.function-list [data-itemid="grid_checkbox_head"] input[type="checkbox"] {
    accent-color: var(--snpp-purple);
    transform: scale(1.2);
    cursor: pointer;
}

/* ===== ESTILOS ESPECÍFICOS PARA CAMPOS ===== */
/* Campo Fecha */
.function-list [data-field="fecha_marcacion"] {
    font-weight: 500;
    color: var(--snpp-purple-dark);
}

/* Campo Usuario */
.function-list [data-field="usuario"] {
    font-weight: 500;
    color: #374151;
}

/* Campo Imagen */
.function-list [data-field="image"] a {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--snpp-purple-pale);
    color: var(--snpp-purple-dark);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 12px;
    transition: all 0.3s ease;
    border: 1px solid var(--snpp-purple-light);
}

.function-list [data-field="image"] a::before {
    content: "📷";
    margin-right: 4px;
}

.function-list [data-field="image"] a:hover {
    background: var(--snpp-purple-light);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}





/* ===== PAGINACIÓN ===== */
.function-list .pagination {
    margin: 20px 0;
}

.function-list .pagination > li > a,
.function-list .pagination > li > span {
    border: 2px solid #E5E7EB;
    border-radius: 8px !important;
    margin: 0 3px;
    color: var(--snpp-purple-dark);
    font-weight: 500;
    transition: all 0.3s ease;
}

.function-list .pagination > li > a:hover {
    background-color: var(--snpp-purple-pale);
    border-color: var(--snpp-purple);
    color: var(--snpp-purple-dark);
}

.function-list .pagination > .active > a,
.function-list .pagination > .active > span {
    background: linear-gradient(135deg, var(--snpp-purple-dark) 0%, var(--snpp-purple) 100%) !important;
    border-color: var(--snpp-purple) !important;
}

/* ===== INFORMACIÓN DE REGISTROS ===== */
.function-list [data-itemid="details_found"] {
    color: var(--snpp-gray);
    font-weight: 500;
    font-size: 14px;
}

.function-list [data-itemid="page_size"] {
    color: var(--snpp-purple-dark);
    font-weight: 600;
    font-size: 14px;
}

/* ===== MENSAJES ===== */
.function-list .alert {
    border-radius: 12px;
    border: none;
    padding: 20px;
    font-size: 14px;
    margin: 20px 0;
}

.function-list .alert-success {
    background-color: var(--snpp-purple-pale);
    color: var(--snpp-purple-dark);
    border-left: 4px solid var(--snpp-purple);
}

/* ===== BREADCRUMB ===== */
.function-list .breadcrumb {
    background: transparent;
    padding: 15px 0;
    margin-bottom: 0;
}

.function-list .breadcrumb > li > a {
    color: var(--snpp-purple);
    text-decoration: none;
    font-weight: 500;
}

.function-list .breadcrumb > li > a:hover {
    color: var(--snpp-purple-dark);
    text-decoration: underline;
}

.function-list .breadcrumb > .active {
    color: var(--snpp-gray);
}

/* ===== ANIMACIONES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.function-list .r-grid {
    animation: fadeInUp 0.6s ease-out;
}

.function-list .searchOptions.panel {
    animation: slideInLeft 0.6s ease-out;
}

/* ===== SCROLLBAR PERSONALIZADO ===== */
.function-list .rnr-gridtable::-webkit-scrollbar {
    height: 8px;
}

.function-list .rnr-gridtable::-webkit-scrollbar-track {
    background: #F1F5F9;
    border-radius: 4px;
}

.function-list .rnr-gridtable::-webkit-scrollbar-thumb {
    background: var(--snpp-purple);
    border-radius: 4px;
}

.function-list .rnr-gridtable::-webkit-scrollbar-thumb:hover {
    background: var(--snpp-purple-dark);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 767px) {
    .function-list .r-content {
        padding: 10px;
    }
    
    .function-list .r-grid {
        margin: 10px;
        border-radius: 12px;
    }
    
    .function-list .rnr-gridtable {
        display: block;
        overflow-x: auto;
    }
    
    .function-list .ewTableHeader th {
        font-size: 12px;
        padding: 10px 8px !important;
    }
    
    .function-list .rnr-gridtable tbody td {
        padding: 10px 8px !important;
        font-size: 13px;
    }
    
    .function-list [data-itemid="add"] a {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }
    
    .function-list .r-left {
        margin-bottom: 20px;
    }
    
    /* Estilos para tabla responsive */
    .function-list [data-pageid="{$pageid}"][data-itemtype="grid_field"][data-field="fecha_marcacion"]:before {
        content: "📅 " attr(data-label);
        font-weight: 600;
        color: var(--snpp-purple-dark);
        display: block;
        margin-bottom: 5px;
    }
    
    .function-list [data-pageid="{$pageid}"][data-itemtype="grid_field"][data-field="image"]:before {
        content: "📷 " attr(data-label);
        font-weight: 600;
        color: var(--snpp-purple-dark);
        display: block;
        margin-bottom: 5px;
    }
    
    .function-list [data-pageid="{$pageid}"][data-itemtype="grid_field"][data-field="usuario"]:before {
        content: "👤 " attr(data-label);
        font-weight: 600;
        color: var(--snpp-purple-dark);
        display: block;
        margin-bottom: 5px;
    }
    

}

/* ===== BADGES Y ESTADOS ===== */
.function-list .badge-warning {
    background: var(--snpp-amber);
    color: white;
}

/* ===== BOTONES DE OPCIONES ===== */
.function-list [data-itemid="list_options"] .btn-default {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    border-radius: 25px;
    padding: 8px 20px;
    transition: all 0.3s ease;
}

.function-list [data-itemid="list_options"] .btn-default:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    transform: translateY(-1px);
}

/* ===== EFECTOS DE CARGA ===== */
.function-list .rnr-gridtable.loading {
    position: relative;
}

.function-list .rnr-gridtable.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.function-list .rnr-gridtable.loading::before {
    content: "🔄 Cargando...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
    color: var(--snpp-purple-dark);
    font-weight: 600;
}


/* Botón Borrar Registros */
.function-list [data-itemid="delete"] a {
    background: white !important;
    border: 2px solid var(--snpp-red) !important;
    border-radius: 12px !important;
    padding: 14px 28px !important;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease !important;
    color: var(--snpp-red) !important;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1);
}

.function-list [data-itemid="delete"] a::before {
    content: "🗑️";
    margin-right: 10px;
    font-size: 16px;
}

.function-list [data-itemid="delete"] a:hover {
    background: #FEF2F2 !important;
    transform: translateY(-2px);
    color: var(--snpp-red) !important;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.2);
}


.function-list [data-itemid="grid_edit"] a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--snpp-purple-pale);
    color: var(--snpp-purple-dark) !important;
    border-radius: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 2px solid transparent;
}

.function-list [data-itemid="grid_edit"] a:hover {
    background: var(--snpp-purple);
    color: white !important;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
    border-color: var(--snpp-purple-light);
}