/* assets/css/style.css - VERSIÓN FINAL CORREGIDA */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --verde: #12503a;
    --verde-oscuro: #0a2e21;
    --dorado: #d9a23e;
    --dorado-hover: #b7862f;
    --bg: #f4f7fa;
    --text: #333;
    --muted: #6b7280;
    --white: #ffffff;
    --border: #e5e7eb;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =========================================
   ESTILOS PÚBLICOS (INDEX.PHP) - ACTUALIZADO
   ========================================= */

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    animation: fadeIn 0.8s ease-out;
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
        min-height: 70vh;
    }
}

/* Logo Principal */
.main-logo {
    width: 280px;
    max-width: 70vw;
    /* Ajustado para móviles pequeños */
    height: auto;
    display: block;
    margin: 0 auto 20px auto;
    animation: scaleIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.main-title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 700;
    color: var(--verde);
    margin: 0 0 10px 0;
    text-align: center;
    line-height: 1.2;
    animation: slideUpFade 0.8s ease-out 0.2s backwards;
}

.subtitle {
    color: var(--muted);
    font-size: 1rem;
    margin-bottom: 40px;
    text-align: center;
    line-height: 1.5;
    animation: slideUpFade 0.8s ease-out 0.4s backwards;
}

/* Botón Intranet */
.btn-intranet {
    background-color: var(--white);
    color: var(--verde);
    border: 1px solid var(--border);
    padding: 8px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn 1s ease-out 1s backwards;
}

.btn-intranet:hover {
    background-color: var(--verde);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(18, 80, 58, 0.2);
}

/* Buscador Estilo Píldora */
.search-box-container {
    width: 100%;
    display: flex;
    justify-content: center;
    animation: slideUpFade 0.8s ease-out 0.6s backwards;
    padding: 0 10px;
    /* Margen de seguridad lateral */
}

/* Buscador Estilo Píldora (ROBUSTO - POSICIONAMIENTO ABSOLUTO) */
.hero-input-group {
    position: relative;
    width: 100%;
    max-width: 650px;
    height: 60px;
    margin: 0 auto;
}

/* El input ocupa TODO el espacio y define el tamaño */
.hero-input-custom {
    width: 100%;
    height: 100%;
    padding: 10px 80px 10px 50px;
    /* Espacio para iconos izq/der */
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    outline: none;
    transition: 0.3s;
    background: var(--white);
    box-shadow: var(--shadow);
    color: #333;
    font-size: 1.1rem;
    font-family: 'Poppins', sans-serif;

    /* Propiedades de apariencia para limpiar estilos nativos (iOS) */
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
}

/* Focus effects */
.hero-input-custom:focus {
    border-color: var(--verde);
    box-shadow: 0 10px 25px rgba(18, 80, 58, 0.15);
    transform: translateY(-2px);
}

/* Icono Izquierdo (Hashtag) */
.input-icon-left {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dorado);
    font-size: 1.2rem;
    pointer-events: none;
    transition: 0.3s;
    z-index: 10;
}

/* Botón Derecho (Buscar) */
.btn-search-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--dorado);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    z-index: 10;
    animation: pulse 2s infinite;
}

.btn-search-icon:hover {
    background: var(--dorado-hover);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 10px rgba(217, 162, 62, 0.4);
}

/* RESPONSIVE BUSCADOR MOBILE (CRÍTICO iPHONE) */
@media (max-width: 480px) {
    .hero-input-group {
        height: 55px;
    }

    .hero-input-custom {
        font-size: 16px !important;
        /* Evita zoom en iOS */
        padding: 10px 55px 10px 45px !important;
    }

    .input-icon-left {
        left: 15px;
        font-size: 1rem;
    }

    .btn-search-icon {
        width: 40px;
        height: 40px;
        right: 6px;
        font-size: 0.9rem;
    }
}

/* Limpiar input number flechas (webkit) */
.hero-input-custom::-webkit-outer-spin-button,
.hero-input-custom::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ANIMACIONES */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(217, 162, 62, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(217, 162, 62, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(217, 162, 62, 0);
    }
}

/* ANIMACIONES */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Tarjeta Resultados */
.result-card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 800px;
    margin-top: 40px;
    overflow: hidden;
    animation: slideUpCard 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    border: 1px solid var(--border);
}

@keyframes slideUpCard {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.res-header {
    background: #f9fafb;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.label-muted {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 5px;
}

.res-number {
    margin: 0;
    color: var(--verde);
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.res-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-top: 5px;
}

.divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 0;
}

.res-total-box {
    padding: 20px 30px;
    background: #f0fdf4;
    /* Fondo verde muy suave */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.label-total {
    font-weight: 600;
    color: #166534;
    font-size: 0.9rem;
}

.amount-total {
    font-size: 1.5rem;
    font-weight: 800;
    color: #16a34a;
}

.history-section {
    padding: 30px;
}

.history-title {
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 10px;
}

.table-public {
    width: 100%;
    border-collapse: collapse;
}

.table-public th {
    font-size: 0.75rem;
    color: var(--muted);
    padding: 10px 0;
    font-weight: 600;
}

.table-public td {
    padding: 15px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.95rem;
}

.table-public tr:last-child td {
    border-bottom: none;
}

.res-footer {
    background: #f9fafb;
    padding: 15px;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--muted);
}

/* =========================================
   ESTILOS ADMIN (ADMIN.PHP)
   ========================================= */

.navbar-admin {
    background: var(--verde);
    min-height: 80px;
    /* Changed from fixed height */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    /* Asegurar que cubra todo el ancho */
    flex-wrap: wrap;
    /* Allow wrapping */
}

@media (max-width: 768px) {
    .navbar-admin {
        padding: 15px;
        gap: 15px;
        flex-direction: column;
        height: auto;
    }

    .navbar-brand span {
        font-size: 1rem;
        /* Smaller text */
    }

    .tabs-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 5px;
        /* Scrollbar space */
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        flex: 0 0 auto;
        /* Prevent shrinking */
        font-size: 0.85rem;
        padding: 10px 15px;
    }
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: white;
}

.navbar-brand img {
    height: 50px;
    width: auto;
    background: white;
    border-radius: 50%;
    border: 2px solid var(--dorado);
    padding: 2px;
}

.navbar-brand span {
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.admin-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    width: 100%;
    flex: 1;
}

.tabs-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
    flex-wrap: wrap;
    /* Default wrap for desktop is fine, mobile overrides to scroll */
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 12px 20px;
    font-family: 'Poppins';
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    position: relative;
    transition: 0.3s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--verde);
    background: rgba(18, 80, 58, 0.03);
}

.tab-btn.active {
    color: var(--verde);
    border-bottom-color: var(--dorado);
}

.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    padding: 25px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.card-title {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--verde);
    font-weight: 700;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Poppins';
    font-size: 0.95rem;
    outline: none;
    transition: 0.3s;
    background: #fff;
}

.form-control:focus {
    border-color: var(--verde);
    box-shadow: 0 0 0 3px rgba(18, 80, 58, 0.1);
}

/* UTILIDADES */
.btn-primary {
    background: var(--verde);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.btn-primary:hover {
    background: #0a2e21;
}

.btn-outline-light {
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-outline-light:hover {
    background: white;
    color: var(--verde);
}

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    font-size: 0.9rem;
}

.table th {
    text-align: left;
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    padding: 12px 15px;
}

.table td {
    background: #fdfdfd;
    padding: 15px;
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.table td:first-child {
    border-left: 1px solid #f3f4f6;
    border-radius: 10px 0 0 10px;
}

.table td:last-child {
    border-right: 1px solid #f3f4f6;
    border-radius: 0 10px 10px 0;
}

.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    vertical-align: middle;
}

.bg-success {
    background: #d1fae5;
    color: #065f46;
}

.bg-danger {
    background: #fee2e2;
    color: #991b1b;
}

.bg-info {
    background: #e0f2fe;
    color: #0369a1;
}

/* Azul Asistió */

.hidden {
    display: none !important;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}

@media(max-width:768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

footer {
    text-align: center;
    padding: 20px;
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: auto;
}

/* --- BOTONES DE ACCIÓN CAJ (Panel Admin) --- */
.btn-group-caj {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.btn-action-caj {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.btn-action-caj:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Colores Botones */
.btn-pagar {
    background-color: #12503a;
}

.btn-pagar:hover {
    background-color: #0a2e21;
}

.btn-exonerar {
    background-color: #d9a23e;
}

.btn-exonerar:hover {
    background-color: #b7862f;
}

.btn-deshacer {
    background-color: #64748b;
}

.btn-deshacer:hover {
    background-color: #475569;
}

/* Utilidades Texto */
.text-decoration-line-through {
    text-decoration: line-through;
}

/* --- RESPONSIVIDAD DE TABLAS (ADMIN) --- */
@media (max-width: 768px) {

    /* Ocultar columnas menos importantes en móvil */
    .hide-mobile {
        display: none !important;
    }

    /* Ajustar padding para ganar espacio */
    .table th,
    .table td {
        padding: 12px 8px;
        font-size: 0.85rem;
    }

    /* Nombre del evento más pequeño si es necesario */
    .asm-name-cell {
        max-width: 120px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* --- PAGINACIÓN AVANZADA --- */
.pagination-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 0;
    font-size: 0.9rem;
    color: #4b5563;
    flex-wrap: wrap;
}

/* Botón Ver Todos (Verde Outline) */
.btn-view-all {
    background: #ffffff;
    border: 1px solid #12503a;
    color: #12503a;
    padding: 6px 15px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-view-all:hover {
    background: #f0fdf4;
}

/* Separador Vertical */
.pag-separator {
    width: 1px;
    height: 24px;
    background-color: #e5e7eb;
    margin: 0 10px;
}

/* Botones de Navegación (< >) */
.btn-pag-nav {
    background: #ffffff;
    border: 1px solid #d1d5db;
    color: #374151;
    min-width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    font-size: 0.8rem;
}

.btn-pag-nav:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-pag-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f3f4f6;
}

/* Input de Página */
.pag-input {
    width: 50px;
    height: 32px;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    margin: 0 5px;
    font-weight: 600;
    color: #1f2937;
}

.pag-input:focus {
    outline: none;
    border-color: #12503a;
    box-shadow: 0 0 0 2px rgba(18, 80, 58, 0.1);
}

/* Texto Total */
.pag-total-text {
    margin-left: 10px;
    color: #6b7280;
}

/* --- FOOTER EKU BYTE (Portado desde formulario.php) --- */
.hero-footer {
    text-align: center;
    padding: 20px 20px 30px 20px;
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: auto;
    /* Empujar al fondo */
}

.eku-logo-container {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.eku-logo {
    height: 28px;
    /* Más pequeño */
    width: auto;
    opacity: 0.6;
    filter: grayscale(100%);
    transition: all 0.3s ease;
}

.eku-logo:hover {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* --- LOADER MODERNO (Glassmorphism + Pulse) --- */
.modern-loader-container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    padding: 20px 40px;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    animation: fadeIn 0.3s ease;
}

.modern-loader-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(18, 80, 58, 0.1);
    border-top: 3px solid var(--verde);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.modern-loader-text {
    color: var(--verde);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    animation: pulseText 1.5s ease-in-out infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulseText {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- DASHBOARD STYLES --- */
.dash-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dash-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s;
}

.dash-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.dash-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.dash-info h3 {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.dash-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    margin: 5px 0;
}

.dash-info small {
    font-size: 0.75rem;
    color: #94a3b8;
}

.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}


@media (max-width: 768px) {
    .dash-grid-cards {
        grid-template-columns: 1fr;
    }

    .dash-grid-cards>div {
        min-width: 0;
        /* Prevent grid blowout */
    }

    /* Stack Tabs vertically on mobile */
    .tabs-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
        overflow-x: hidden;
    }

    .tab-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 10px;
    }

    /* Grid 2 Column stacking */
    .grid-2 {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .grid-2>div {
        min-width: 0;
        /* Prevent grid blowout */
        width: 100%;
    }

    /* Charts on mobile */
    .chart-container {
        height: 250px !important;
    }

    /* Modal responsiveness */
    .modal-content {
        width: 95%;
        margin: 10px auto;
        padding: 15px;
    }

    /* Admin Container Padding */
    .admin-container {
        padding: 15px;
    }

    /* Table Font Size */
    .table th,
    .table td {
        font-size: 0.85rem;
        padding: 8px 10px;
    }

    /* Header Adjustments */
    h2 {
        font-size: 1.25rem;
    }

    /* Stack Dashboard Header Filters */
    #tab-dashboard>div:first-child {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    #tab-dashboard>div:first-child>div {
        width: 100%;
        justify-content: space-between;
    }

    /* Quick Widget Mobile */
    #quick-att-form button {
        padding: 15px !important;
    }

    /* Responsive Badges */
    .badge {
        font-size: 0.65rem;
        padding: 3px 6px;
    }
}


/* --- MODAL BACKDROP --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-backdrop.hidden {
    opacity: 0;
    pointer-events: none;
    /* display: none is handled by global .hidden but we want transition */
}

.modal-futuristic {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    border: none;
    overflow: hidden;
    max-width: 500px;
    width: 90%;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header-modern {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #bae6fd;
}

.modal-header-modern h3 {
    margin: 0;
    color: #0369a1;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-close-modern {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.2s;
}

.btn-close-modern:hover {
    color: #ef4444;
    transform: rotate(90deg);
}

.modal-body-modern {
    padding: 25px;
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.6;
}

.detail-row {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 1rem;
    font-weight: 500;
    color: #0f172a;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid #cbd5e1;
    word-break: break-word;
}

.modal-footer-modern {
    padding: 15px 25px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    text-align: right;
}

.btn-shine {
    position: relative;
    overflow: hidden;
}

.btn-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
    transform: rotate(30deg);
    transition: 0.5s;
    opacity: 0;
}

.btn-shine:hover::after {
    opacity: 1;
    left: 100%;
    transition: 0.5s;
}

/* --- FIX: INTRANET BUTTON OVERLAP --- */
.intranet-wrapper {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 50;
}

/* On mobile, remove absolute positioning to prevent overlap */
@media (max-width: 480px) {
    .intranet-wrapper {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        text-align: right;
        padding: 5px 20px 0 0;
        margin-bottom: -15px;
        /* Pull closer */
    }
}

/* --- FIX: DISPENSA BUTTON ANIMATION --- */
.btn-dispensa {
    background: var(--dorado) !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 10px 25px !important;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
    font-size: 0.95rem !important;
    box-shadow: 0 4px 10px rgba(217, 162, 62, 0.3) !important;

    /* Animation: Slide Up + Fade In (Delayed) */
    animation: slideUpFade 0.8s ease-out 0.8s backwards;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-dispensa:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(217, 162, 62, 0.5) !important;
    background: var(--dorado-hover) !important;
}