﻿/* ============================================
   RESET & BASE STYLES
   ============================================ */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
}

html {
    font-size: 14.5px;
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    min-height: 100vh;
    /* 1. Fondo base: Lo suavicé un poco para que sea menos amarillo huevo y más crema papel */
    background-color: #fdfdf5;
    background-image:
    /* --- NUEVOS (Tonos Pastel y Transparencias Altas) --- */
    /* 1. Arriba Derecha: Dorado muy sutil. 
       Opacidad bajada de 0.3 a 0.15 para que no distraiga. */
    linear-gradient(225deg, rgba(230, 180, 50, 0.25) 20%, transparent 20%),
    /* 2. Centro Derecha: Verde menta suave (Tu opción recomendada).
       Bajado de 0.6 (muy oscuro) a 0.2. */
    linear-gradient(300deg, transparent 85%, rgba(100, 180, 160, 0.3) 85%),
    /* 3. Centro Izquierda: Amarillo luz.
       Muy sutil, casi imperceptible, solo da brillo. */
    linear-gradient(55deg, rgba(245, 220, 80, 0.3) 22%, transparent 22%),
    /* 4. Arriba Centro: Verde pálido amplio.
       Funciona como una cortina de luz muy suave. */
    linear-gradient(190deg, rgba(200, 230, 200, 0.20) 35%, transparent 35%),
    /* --- ORIGINALES (Suavizados) --- */
    /* 5. Abajo Derecha: Verde orgánico.
       CORREGIDO: Antes tenías transparent 80% y color 70% (eso causaba error visual).
       Ahora ambos en 75% para una línea nítida pero suave. */
    linear-gradient(115deg, transparent 80%, rgba(129, 199, 132, 0.35) 80%),
    /* 6. Arriba (Grande): Amarillo crema.
       Para unificar todo el encabezado sin saturar. */
    linear-gradient(170deg, rgba(240, 230, 140, 0.30) 20%, transparent 20%);
    /* 3. Fijar el fondo */
    background-attachment: fixed;
    background-size: cover;
    background-repeat: no-repeat;
}


@media (min-width: 768px) {
    html {
        font-size: 14.5px;
    }
}

/* ============================================
   LAYOUT STYLES
   ============================================ */
.page-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 75vh;
    width: 100%;
    padding: 2rem 0;
}

/*.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}
*/

.container {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 1rem;
}

/* ============================================
   FORM STYLES
   ============================================ */
.form-label {
    color: #495057;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 8px;
    border: 1px solid #605e5c;
    border-radius: 5px;
    font-size: 14px;
}

    .form-control:focus {
        border-color: #0078d4;
        outline: none;
        box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.3);
    }

.form-container {
    padding: 20px;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.form-group {
    flex: 1 1 100%;
    min-width: 0;
}

    .form-group.full-width {
        flex: 0 0 100%;
    }

    .form-group label {
        display: block;
        margin-bottom: 5px;
        color: #323130;
        font-weight: 500;
    }

.form-row {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

    .form-row:last-child {
        justify-content: center;
    }

/* ============================================
   SELECT STYLES
   ============================================ */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

select.custom-disabled {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 8px;
}

/* ============================================
   BUTTON STYLES
   ============================================ */
.btn-azure {
    padding: 10px 20px;
    background-color: #0078d4;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

    .btn-azure:hover {
        background-color: #106ebe;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }

    .btn-azure:active {
        background-color: #005a9e;
        transform: scale(0.98);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }

    .btn-azure::after {
        content: '';
        display: block;
        position: absolute;
        border-radius: 50%;
        width: 0;
        height: 0;
        top: 50%;
        left: 50%;
        background-color: rgba(255, 255, 255, 0.3);
        transform: translate(-50%, -50%);
        opacity: 0;
    }

    .btn-azure:active::after {
        width: 150px;
        height: 150px;
        opacity: 1;
        transition: all 0.5s ease;
    }

    .btn-azure:focus {
        outline: 2px solid #ffffff;
        outline-offset: 2px;
    }

    .btn-azure.loading {
        pointer-events: none;
        opacity: 0.8;
    }

        .btn-azure.loading::before {
            content: '';
            display: inline-block;
            width: 1em;
            height: 1em;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            border-top-color: white;
            animation: spin 1s ease infinite;
            margin-right: 10px;
            vertical-align: middle;
        }

.postular-btn {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 3px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

    .postular-btn[disabled] {
        background-color: transparent;
        border: none;
        cursor: default;
        padding: 0;
    }

.center-button {
    display: flex;
    justify-content: center;
}

/* ============================================
   LOGIN STYLES
   ============================================ */
.login-container {
    background: #fff;
    width: 25rem;
    height: 30rem;
    display: flex;
    overflow: hidden;
}

.login-info {
    background: #06AF41;
    color: #fff;
    padding: 1rem;
    width: 50%;
    display: flex;
    box-shadow: revert;
    flex-direction: column;
    justify-content: center;
    font-family: 'Roboto';
    text-align: justify;
}

    .login-info p {
        font-size: 0.80rem;
        line-height: 1.5;
    }

.login-form {
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.login-Session {
    padding: 0.2rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    max-width: 600px;
    margin: 1rem auto;
}

/* ============================================
   HEADER & NAVIGATION STYLES
   ============================================ */
.header-section {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
}

.header-title {
    font-size: 1.2rem;
    margin: 0;
}

.header-subtitle {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

.nav-tabs {
    padding: 0 15px;
    border-bottom: 1px solid #dee2e6;
}

    .nav-tabs .nav-link {
        color: #495057;
        border: none;
        padding: 10px 15px;
    }

        .nav-tabs .nav-link.active {
            color: #007bff;
            border-bottom: 2px solid #007bff;
            background: none;
        }

/* ============================================
   AVATAR STYLES
   ============================================ */
.avatar {
    width: 40px;
    height: 40px;
    background-color: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 10px;
}

/* ============================================
   AZURE FORM CONTAINER
   ============================================ */
.azure-form-container {
    max-width: 100%;
    margin: 5vh auto 0;
    padding: 20px 15px 15px;
    justify-content: center;
    align-items: center;
    background-color: #f0f6ff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

    .azure-form-container h2 {
        color: #0078d4;
        margin-bottom: 20px;
        font-weight: 600;
    }

/* ============================================
   RUN-DV STYLES
   ============================================ */
.run-dv-container {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.run-input {
    flex: 1;
    min-width: 0;
}

.dv-input {
    width: 30px;
    flex-shrink: 0;
}

.run-dv-group {
    flex: 1 1 calc(50% - 10px);
}

/* ============================================
   INPUT GROUP STYLES
   ============================================ */
.input-group-text {
    height: 100%;
    display: flex;
    align-items: center;
}

.input-group .form-control {
    height: calc(1.5em + .75rem + 1px);
}

/* ============================================
   VERIFICATION CODE STYLES
   ============================================ */
.verification-code-container {
    display: flex;
    gap: 10px;
}

.verification-input {
    width: 45px;
    height: 45px;
    border: 2px solid #ccc;
    border-radius: 8px;
    text-align: center;
    font-size: 24px;
    color: #28a745;
}

    .verification-input:focus {
        border-color: #28a745;
        outline: none;
        box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
    }

/* ============================================
   CUSTOM READONLY/DISABLED STYLES
   ============================================ */
.custom-readonly,
.custom-disabled {
    background-color: #fff !important;
    opacity: 1 !important;
    cursor: default !important;
}

    .custom-readonly:focus,
    .custom-disabled:focus {
        outline: none !important;
        box-shadow: none !important;
    }

/* ============================================
   MODAL STYLES
   ============================================ */
.modal-content {
    border-radius: 15px;
    overflow: hidden;
}

.modal-dialog {
    max-width: 450px;
    margin: 1.75rem auto;
}

#mapModal .modal-dialog {
    max-width: 70%;
    margin: 1.75rem auto;
}

/* ============================================
   LOADER STYLES
   ============================================ */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader-container {
    text-align: center;
}

.preloader {
    position: absolute;
    width: 1250px;
    height: 1000px;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 35px;
    height: 35px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #1976d2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.hide-preloader {
    display: none !important;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ============================================
   MAP STYLES
   ============================================ */
#map {
    height: 350px !important;
    width: 100% !important;
    z-index: 1;
    margin-top: 10px;
    border-radius: 4px;
}

.leaflet-top,
.leaflet-bottom {
    z-index: 1000;
}

/* ============================================
   TABLE STYLES
   ============================================ */
.custom-table {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

    .custom-table thead th {
        background-color: #f8f9fa;
        font-weight: 600;
        padding: 1rem;
        font-size: 0.9rem;
        color: #495057;
    }

    .custom-table tbody td {
        padding: 1rem;
        vertical-align: middle;
    }

    .custom-table tr:hover {
        background-color: rgba(0, 0, 0, 0.02);
    }

/* ============================================
   STATUS BADGE STYLES
   ============================================ */
.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
}

.status-active {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-waiting {
    background-color: #fff3e0;
    color: #ef6c00;
}

.status-resolved {
    background-color: #e3f2fd;
    color: #1976d2;
}

.status-cancelled {
    background-color: #ffebee;
    color: #c62828;
}

.status-default {
    background-color: #f5f5f5;
    color: #616161;
}

/* ============================================
   GRID STYLES
   ============================================ */
#gridJob {
    min-width: 100%;
    overflow-x: auto;
}

.e-grid .e-groupcaption {
    font-weight: bold !important;
    font-size: 14px !important;
}

.e-grid .e-row {
    cursor: pointer;
}

/* ============================================
   DETAIL POPUP STYLES
   ============================================ */
.detail-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.detail-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.detail-popup-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #edf2f7;
    background: white;
}

.header-content {
    display: flex;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}

    .close-btn:hover {
        color: #2d3748;
    }

.detail-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 5rem);
}

.main-info-card {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.info-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #edf2f7;
}

.info-content {
    padding: 1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.info-section {
    background: white;
    padding: 1.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.section-title {
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #edf2f7;
}

    .info-row:last-child {
        border-bottom: none;
    }

.info-label {
    color: #718096;
    font-weight: 500;
}

.info-value {
    color: #2d3748;
    font-weight: 500;
}

.description-section,
.location-section {
    background: white;
    padding: 1.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-top: 1.5rem;
}

.description-content,
.location-content {
    color: #4a5568;
    line-height: 1.6;
    margin-top: 0.5rem;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
    display: none;
}

.clickable {
    cursor: pointer;
}

#tabFiles {
    display: none;
}

/* ============================================
   SURVEY STYLES
   ============================================ */
.survey-question {
    border-left: 4px solid #e9ecef;
    transition: all 0.3s ease;
}

    .survey-question.answered {
        border-left: 4px solid #1976d2;
    }

.btn-outline-primary {
    transition: all 0.2s;
}

    .btn-outline-primary:hover {
        transform: scale(1);
    }

.btn-check:checked + .btn-outline-primary {
    font-weight: bold;
}

/* ============================================
   BORDER ALERT STYLES
   ============================================ */
@keyframes marchingAnts {
    0% {
        background-position: 0 0, 0 100%, 0 0, 100% 0;
    }

    100% {
        background-position: 100% 0, 0 0, 0 100%, 0 0;
    }
}

.border-alert {
    position: relative;
    border: none !important;
    border-radius: 8px;
}

    .border-alert::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 5px;
        background-image: linear-gradient(to right, #dc3545 50%, transparent 50%), linear-gradient(to bottom, #dc3545 50%, transparent 50%), linear-gradient(to left, #dc3545 50%, transparent 50%), linear-gradient(to top, #dc3545 50%, transparent 50%);
        background-position: 0 0, 100% 0, 0 100%, 0 0;
        background-size: 8px 2px, 2px 8px, 8px 2px, 2px 8px;
        background-repeat: repeat-x, repeat-y, repeat-x, repeat-y;
        pointer-events: none;
    }

@keyframes pulseText {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

.validation-alert {
    font-weight: bold !important;
    color: #dc3545 !important;
    display: flex;
    align-items: center;
}

    .validation-alert i {
        margin-right: 5px;
    }

/* ============================================
   BORDER GROUP STYLES
   ============================================ */
.border-group {
    position: relative;
    border: 1px solid #666;
    border-radius: 5px;
    padding: 20px 0px 10px 0px;
    font-size: 12.5px;
    margin-bottom: 8px;
    background-color: #f5f5f5;
    margin-top: 20px;
}

.border-group-title {
    position: absolute;
    border: 1px solid #666;
    top: -12px;
    left: 10px;
    padding: 0 10px;
    border-radius: 5px;
    background-color: #f5f5f5;
    font-weight: 500;
    font-size: 12px;
    color: black;
}

.border-group-container {
    width: 100%;
}

/* ============================================
   TIMELINE STYLES
   ============================================ */
.timeline-container {
    position: relative;
    padding-left: 30px;
    margin-top: 15px;
}

    .timeline-container::before {
        content: '';
        position: absolute;
        left: 20px;
        top: 5px;
        bottom: 0;
        width: 2px;
        background: linear-gradient(to bottom, #28a745, #20c997);
        border-radius: 1px;
    }

.timeline-item {
    position: relative;
    padding-bottom: 25px;
    margin-left: 10px;
    animation: slideInUp 0.4s ease-out;
}

    .timeline-item:last-child {
        padding-bottom: 0;
    }

    .timeline-item:nth-child(2) {
        animation-delay: 0.1s;
    }

    .timeline-item:nth-child(3) {
        animation-delay: 0.2s;
    }

    .timeline-item:nth-child(4) {
        animation-delay: 0.3s;
    }

    .timeline-item:nth-child(5) {
        animation-delay: 0.4s;
    }

.timeline-marker {
    position: absolute;
    left: -25px;
    top: 3px;
    width: 12px;
    height: 12px;
    background: #28a745;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #28a745;
    z-index: 2;
}

.timeline-item:first-child .timeline-marker {
    background: #20c997;
    box-shadow: 0 0 0 2px #20c997;
}

.timeline-content {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 15px;
    margin-left: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

    .timeline-content:hover {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        transform: translateY(-1px);
    }

.timeline-date {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 5px;
}

.timeline-message {
    color: #333;
    font-size: 0.95rem;
    line-height: 1.4;
    margin: 0;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

@media screen and (max-width: 768px) {
    #boxContainer {
        margin-top: -25px !important;
        position: relative !important;
    }

    /* Deshabilitar el centrado vertical del container padre */
    .container {
        justify-content: flex-start !important;
        padding-top: 0 !important;
    }

    .page-wrapper {
        align-items: flex-start !important;
        padding-top: 0 !important;
    }

    .grid-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #gridJob {
        min-width: 100%;
    }

    .timeline-container {
        padding-left: 25px;
    }

    .timeline-marker {
        left: -20px;
        width: 10px;
        height: 10px;
    }

    .timeline-container::before {
        left: -15px;
    }

    .timeline-content {
        margin-left: 0;
        font-size: 0.9rem;
    }
}

@media screen and (max-width: 480px) {
    #boxContainer {
        margin-top: -35px !important;
        position: relative !important;
    }

    /* Deshabilitar el centrado vertical del container padre */
    .container {
        justify-content: flex-start !important;
        padding-top: 0 !important;
    }

    .page-wrapper {
        align-items: flex-start !important;
        padding-top: 0 !important;
    }

    #gridJob {
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    .form-row {
        width: 100%;
        flex-direction: column;
        margin: 0 auto;
        gap: 15px;
    }

    #mapModal .modal-dialog {
        max-width: 95% !important;
        margin: 10px auto;
        justify-content: center;
        align-items: center;
    }

    #map {
        height: 300px !important;
    }

    #mapModal .modal-body {
        padding: 10px;
    }

    .custom-table thead th,
    .custom-table tbody td {
        padding: 0.75rem;
    }

    .status-badge {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 767px) {
    .postular-btn {
        padding: 4px 8px;
        font-size: 12px;
    }

    .header-title {
        font-size: 20px !important;
    }
}

@media (max-width: 576px) {
    .rating-options {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-around;
        gap: 10px;
    }

    .rating-option {
        margin-bottom: 10px;
    }

    .scroll-indicator {
        padding: 10px 25px;
        font-size: 18px;
        bottom: 15px;
    }

    .phone-display-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .phone-number {
        margin-right: 0;
        margin-bottom: 10px;
        width: 100%;
    }

    .phone-buttons-container {
        width: 100%;
        justify-content: center;
    }
}

@media (min-width: 900px) {
    .form-group {
        flex: 1 1 calc(50% - 10px);
    }

        .form-group.full-width {
            flex: 0 0 100%;
        }
}


/* ============================================
   TABLA RESPONSIVE
   ============================================ */

/* Wrapper con scroll horizontal */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

/* ============================================
   TABLA RESPONSIVE - CORREGIDO
   ============================================ */

/* Para tablets y móviles grandes (768px) */
@media (max-width: 768px) {
    .hide-on-mobile {
        display: none !important;
    }
    .custom-table thead th,
    .custom-table tbody td {
        padding: 0.75rem;
        font-size: 13px;
    }
    /* Hacer el número de caso más visible */
    .fw-bold {
        display: block;
        margin-bottom: 0.25rem;
    }
}

/* Para móviles pequeños (480px) */
@media (max-width: 480px) {

    /* ⭐ Resetear contenedores padre */
    .form-row {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .form-group.full-width {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }

    /* ⭐ Contenedor de la tabla */
    .table-responsive {
        border: 1px solid #dee2e6;
        border-radius: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* ⭐ TABLA: Ancho mínimo que FUERZA scroll */
    #tabFiles,
    .custom-table {
        min-width: 100% !important; /* Que ocupe todo el ancho disponible */
        width: 100% !important;
        margin: 0 !important;
        table-layout: auto !important;
    }

    /* ⭐ Mantener columnas ocultas */
    .hide-on-mobile {
        display: none !important;
    }

    /* ⭐ Reducir padding y fuente */
    .custom-table thead th,
    .custom-table tbody td {
        padding: 0.5rem 0.3rem !important;
        font-size: 10px !important;
        white-space: nowrap;
        text-align: left !important;
    }

    /* ⭐ Ajustar badges */
    .status-badge {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.4rem !important;
        white-space: nowrap;
    }

    /* ⭐ Número de caso más pequeño */
    .fw-bold {
        font-size: 9px !important;
    }

        .fw-bold i {
            font-size: 8px !important;
            margin-left: 2px !important;
        }

    /* ⭐ Título de la tabla */
    .header-title {
        font-size: 1rem !important;
        margin-bottom: 0.5rem !important;
    }
}


/* ==========================================================================
   CUSTOM GRID POPUP STYLES
   Copia exacta del estilo visual de 'detail-popup' pero con dimensiones para Grilla
   ========================================================================== */

/* 1. Contenedor Principal */
.custom-grid-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000; /* Mayor que el estándar */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px; /* Mismo padding que detail-popup */
}

    .custom-grid-popup.hidden {
        display: none;
    }

/* 2. Overlay */
.custom-grid-overlay {
    /* Usamos fixed para asegurar que cubra todo el viewport */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Color negro al 50% de opacidad */
    background-color: rgba(0, 0, 0, 0.5) !important;
    /* El difuminado (blur) */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px); /* Soporte Safari */
    /* Z-Index: Debe estar dentro del popup pero detrás de la tarjeta */
    z-index: 0;
}

/* 3. LA TARJETA (Debe estar por encima del overlay) */
.custom-grid-card {
    position: relative;
    z-index: 10;
    background: white !important;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 97vw;
    max-width: 1200px;
    height: 70vh;
    min-height: 500px; /* ⭐ Altura mínima razonable */
    max-height: 90vh; /* ⭐ Máximo para pantallas grandes */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


/* 5. Body (Contenedor de la Grilla) */
.custom-grid-body {
    flex: 1; /* ⭐ Crece para llenar el espacio disponible */
    overflow: hidden;
    min-height: 0; /* ⭐ Importante para flex shrinking */
    display: flex;
    flex-direction: column;
    padding: 0 10px 10px 10px; /* Márgenes de 10px */
}

/* ⭐ La grilla ocupa 100% del contenedor */
#gridAppliedBenefits {
    height: 100% !important;
    width: 100%;
}

/* Asegurar scroll correcto */
.e-grid .e-gridcontent {
    overflow-x: auto !important;
    overflow-y: auto !important;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
    .custom-grid-card {
        max-width: 90vw;
        height: 75vh;
        min-height: 460px;
    }

    .popup-header {
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    .custom-grid-card {
        width: 95vw;
        max-width: 95vw;
        height: 75vh;
        min-height: 400px;
    }

    .popup-header {
        padding: 1rem;
    }

    .grid-container {
        padding: 0 8px 8px 8px;
    }

    /* Ajustar tamaño de fuente en móvil */
    #gridAppliedBenefits .e-headercell,
    #gridAppliedBenefits .e-rowcell {
        padding: 0.5rem 0.375rem !important;
        font-size: 0.8125rem !important;
    }

    /* Ocultar columnas en móvil */
    #gridAppliedBenefits .e-grid th[e-mappingname="Created"],
    #gridAppliedBenefits .e-grid td[e-mappingname="Created"],
    #gridAppliedBenefits .e-grid th[e-mappingname="Resulted"],
    #gridAppliedBenefits .e-grid td[e-mappingname="Resulted"] {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .custom-grid-card {
        width: 98vw;
        height: 85vh;
        min-height: 350px;
        border-radius: 0.5rem;
    }

    .popup-header {
        padding: 0.75rem;
    }

    .grid-container {
        padding: 0 6px 6px 6px;
    }

    #gridAppliedBenefits .e-headercell,
    #gridAppliedBenefits .e-rowcell {
        padding: 0.375rem 0.25rem !important;
        font-size: 0.75rem !important;
    }
}



/* ==========================================================================
   BADGE VOLVER A INICIO (GLOBAL)
   ========================================================================== */

.home-badge {
    /* Fixed: Se queda fijo en la pantalla aunque hagas scroll */
    position: fixed; 
    top: 60px; /* Separación desde el techo de la ventana */
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999; /* Muy alto para que nada lo tape (modales, mapas, etc) */
    
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none !important;
    gap: 4px;
    cursor: pointer;
}

.home-badge-icon {
    width: 60px; /* Un poco más pequeño para no molestar tanto en global */
    height: 60px;
    background: white;
    border: 3px solid #0078d4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.home-badge-icon i {
    font-size: 26px;
    color: #0078d4;
    transition: color 0.3s ease;
}

.home-badge-text {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #0078d4;
    text-align: center;
    line-height: 1.1;
    background-color: rgba(255, 255, 255, 0.9); /* Fondo blanco semitransparente para leerse sobre cualquier fondo */
    padding: 2px 6px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

/* Efectos Hover */
.home-badge:hover .home-badge-icon {
    transform: scale(1.1);
    background-color: #0078d4;
    border-color: #005a9e;
    box-shadow: 0 8px 20px rgba(0, 120, 212, 0.3);
}

.home-badge:hover .home-badge-icon i {
    color: white;
}

.home-badge:hover .home-badge-text {
    color: #005a9e;
    transform: translateY(2px);
}

/* ==========================================================================
   ESPACIO PARA EL CONTENIDO
   ========================================================================== */
/* Esto empuja el contenido hacia abajo para que el botón 
   no tape el título de tus páginas */
.content-with-badge {
    padding-top: 100px !important; 
}

/* Ajuste para móviles: botón más pequeño y texto al lado */
@media (max-width: 768px) {
    .home-badge {
        top: 10px;
        flex-direction: row; /* Cambiar a horizontal */
        gap: 10px; /* Espacio entre ícono y texto */
        align-items: center;
    }

    .home-badge-icon {
        width: 50px;
        height: 50px;
    }

        .home-badge-icon i {
            font-size: 20px;
        }
    .home-badge-text {
        margin-left: -3px;
        font-size: 11px;
        line-height: 1.3;
        white-space: nowrap;
        background: white;
        color: #0078d4;
        padding: 8px 16px;
        border: 3px solid #0078d4;
        border-radius: 20px;
        box-shadow: 0 2px 8px rgba(0, 120, 212, 0.15);
        position: relative;
    }

        /* Cola de la burbuja (triángulo apuntando al círculo) */
        .home-badge-text::before {
            content: '';
            position: absolute;
            left: -10px;
            top: 50%;
            transform: translateY(-50%);
            width: 0;
            height: 0;
            border-top: 8px solid transparent;
            border-bottom: 8px solid transparent;
            border-right: 10px solid #0078d4;
        }

        /* Relleno blanco interior del triángulo */
        .home-badge-text::after {
            content: '';
            position: absolute;
            left: -6px;
            top: 50%;
            transform: translateY(-50%);
            width: 0;
            height: 0;
            border-top: 6px solid transparent;
            border-bottom: 6px solid transparent;
            border-right: 8px solid white;
        }

        .home-badge-text br {
            display: none;
        }

    .content-with-badge {
        padding-top: 90px !important;
    }
}





