/* ============================================ */
/* ESTILOS GLOBALES - DISEÑO PROFESIONAL */
/* ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    color: #333;
    min-height: 100vh;
    line-height: 1.6;
}

/* ============================================ */
/* NAVEGACIÓN PROFESIONAL */
/* ============================================ */
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 15px 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 3px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container img {
    height: 90px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s;
}

.nav-container img:hover {
    transform: scale(1.05);
}

nav {
    margin-left: auto;
    display: flex;
    gap: 25px;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: white;
    font-weight: 600;
    font-size: 18px;
    padding: 12px 24px;
    border-radius: 30px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.3s;
}

nav a:hover::before {
    left: 100%;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.user-badge {
    background: #17a2b8;
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    margin-right: 15px;
    margin-left: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.4);
}

.admin-badge {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    margin-right: 15px;
    margin-left: 30px;
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(17, 153, 142, 0.6);
    }
}

.tiempo-restante {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 12px;
    white-space: nowrap;
}

.logout-btn {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%) !important;
    box-shadow: 0 4px 15px rgba(235, 51, 73, 0.4) !important;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #f45c43 0%, #eb3349 100%) !important;
    box-shadow: 0 6px 20px rgba(235, 51, 73, 0.6) !important;
}

.login-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4) !important;
}

.login-btn:hover {
    background: linear-gradient(135deg, #20c997 0%, #28a745 100%) !important;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.6) !important;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: white;
    border-radius: 3px;
    transition: all 0.3s;
}

/* ============================================ */
/* CONTENEDORES Y TARJETAS */
/* ============================================ */
.container {
    max-width: 1200px;
    margin: 50px auto;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.admin-header h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    color: white;
}

.admin-header p {
    font-size: 16px;
    opacity: 0.95;
}

/* ============================================ */
/* SECCIONES Y GRID */
/* ============================================ */
.sections, .grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.section-card, .grid-item {
    background: white;
    color: #333;
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    text-decoration: none;
    display: block;
    text-align: center;
}

.section-card:hover, .grid-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.section-card i, .grid-item i {
    font-size: 60px;
    margin-bottom: 20px;
    color: #007bff;
}

.section-card h2, .grid-item h2 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #333;
}

.section-card p, .grid-item p {
    color: #666;
    font-size: 15px;
    margin: 0;
}

.section-card.admin-card, .grid-item.admin-only {
    border: 3px solid #28a745;
    background: linear-gradient(135deg, #f8fff9, #e8f5e8);
}

.section-card.admin-card i, .grid-item.admin-only i {
    color: #28a745;
}

.section-card.admin-card h2, .grid-item.admin-only h2 {
    color: #28a745;
}

.admin-label {
    background: #28a745;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 10px;
}

.grid-item a {
    text-decoration: none;
    color: #0056b3;
}

/* ============================================ */
/* ESTADÍSTICAS */
/* ============================================ */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 35px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transition: all 0.5s;
}

.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

.stat-card:hover::before {
    top: -100%;
    right: -100%;
}

.stat-card:nth-child(1) {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-card:nth-child(2) {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

.stat-card:nth-child(3) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card:nth-child(4) {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-card h3 {
    margin: 0;
    font-size: 42px;
    font-weight: 700;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    color: white;
}

.stat-card p {
    margin: 10px 0 0 0;
    font-size: 16px;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    font-weight: 600;
    color: white;
}

/* ============================================ */
/* TABLAS */
/* ============================================ */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    background: white;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
}

tr {
    transition: all 0.3s;
}

tr:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transform: scale(1.01);
}

/* ============================================ */
/* BADGES */
/* ============================================ */
.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.badge-pendiente { 
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #000;
}

.badge-activo { 
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.badge-inactivo { 
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.badge-admin { 
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
    color: white;
}

.badge-usuario { 
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

/* ============================================ */
/* BOTONES */
/* ============================================ */
.btn, button {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    margin: 5px;
    transition: all 0.3s;
    font-weight: 600;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    font-family: 'Poppins', sans-serif;
}

.btn:hover, button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.btn-aprobar { 
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.btn-rechazar { 
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.btn-desactivar { 
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
}

.btn-activar { 
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.btn-resetear { 
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.btn-renovar { 
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

/* ============================================ */
/* FORMULARIOS */
/* ============================================ */
form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 5px;
}

input, select, textarea {
    padding: 12px 15px;
    font-size: 14px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* ============================================ */
/* FOOTER PROFESIONAL */
/* ============================================ */
footer {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    font-size: 16px;
    margin-top: 50px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
}

footer p {
    margin: 10px 0;
}

footer a {
    color: #38ef7d;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

footer a:hover {
    color: #20c997;
    text-decoration: underline;
}

.footer-contact {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-contact i {
    margin-right: 8px;
}

/* ============================================ */
/* ALERTAS Y MENSAJES */
/* ============================================ */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border: 2px solid #17a2b8;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe8a1 100%);
    color: #856404;
    border: 2px solid #ffc107;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 2px solid #dc3545;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border: 2px solid #17a2b8;
}

/* ============================================ */
/* AVISO DE EXPIRACIÓN */
/* ============================================ */
.expiration-warning {
    position: fixed;
    top: 100px;
    right: 20px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4);
    z-index: 9999;
    animation: slideInRight 0.5s ease-out, pulse 2s infinite;
    max-width: 350px;
}

.expiration-warning i {
    font-size: 24px;
    margin-right: 10px;
}

.expiration-warning strong {
    display: block;
    font-size: 18px;
    margin-bottom: 5px;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* ============================================ */
/* RESPONSIVE DESIGN */
/* ============================================ */
@media (max-width: 1200px) {
    .container {
        padding: 30px 20px;
        margin: 30px 15px;
    }
    
    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .nav-container {
        padding: 12px 25px;
    }
    
    .nav-container img {
        height: 80px;
    }
    
    nav {
        gap: 20px;
    }
    
    nav a {
        font-size: 16px;
        padding: 10px 15px;
    }
}

@media (max-width: 950px) {
    body {
        padding-top: 100px;
    }

    .nav-container {
        padding: 10px 15px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 250;
    }

    .nav-container img {
        height: 70px;
    }

    .menu-toggle {
        display: flex;
        z-index: 300;
        position: relative;
    }

    nav {
        position: fixed;
        top: 90px;
        left: 0;
        background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
        width: 100%;
        height: 0;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 0;
        overflow: hidden;
        transition: height 0.3s ease-out;
        z-index: 200;
    }

    nav.active {
        height: calc(100vh - 90px);
        overflow-y: auto;
    }

    nav a {
        width: 90%;
        text-align: center;
        padding: 15px;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .user-badge, .admin-badge {
        width: 90%;
        text-align: center;
        margin: 0;
        padding: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 0;
    }

    .tiempo-restante {
        display: inline-block;
        margin-top: 5px;
        border-left: none;
        padding-left: 0;
    }

    .logout-btn, .login-btn {
        width: 90% !important;
        text-align: center !important;
        padding: 15px !important;
        margin: 10px 0 !important;
        border-radius: 25px !important;
    }

    .container {
        padding: 20px 10px;
        margin: 10px;
    }

    .admin-header h2 {
        font-size: 24px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-card h3 {
        font-size: 28px;
    }

    .sections, .grid-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .expiration-warning {
        top: 95px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .nav-container img {
        height: 60px;
    }

    body {
        padding-top: 85px;
    }

    nav {
        top: 85px;
    }

    nav.active {
        height: calc(100vh - 85px);
    }

    .stat-card h3 {
        font-size: 24px;
    }

    .stat-card p {
        font-size: 11px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 10px 5px;
    }

    .btn, button {
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* ============================================ */
/* UTILIDADES */
/* ============================================ */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
