/* =========================
   GESTIÓN DOCUMENTAL - FULL SCREEN
========================= */

.gestion-documental {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: none;
    flex-direction: column;
    background: var(--bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    transition: opacity var(--transition);
}

.gestion-documental.active {
    display: flex;
    opacity: 1;
}

body.light .gestion-documental {
    background: var(--bg-gradient);
}

/* HEADER */
.gestion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    background: var(--card);
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}

body.light .gestion-header {
    background: rgba(255, 255, 255, 0.95);
}

.gestion-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.gestion-brand img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.gestion-brand h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gestion-header button {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.gestion-header button:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow);
}

/* NAVIGATION */
.gestion-nav {
    display: flex;
    gap: 8px;
    padding: 20px 32px 0;
    background: var(--card);
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}

body.light .gestion-nav {
    background: rgba(255, 255, 255, 0.95);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.nav-btn::before {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    transition: width var(--transition);
}

.nav-btn:hover {
    background: var(--card-soft);
    color: var(--text);
}

.nav-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.nav-btn.active::before {
    width: 60%;
}

.nav-icon {
    font-size: 18px;
}

.nav-text {
    font-size: 14px;
}

/* CONTENT */
.gestion-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    box-sizing: border-box;
}

.gestion-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.gestion-section.active {
    display: block;
}

.section-header {
    margin-bottom: 28px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px;
}

.section-header p {
    font-size: 15px;
    color: var(--text-muted);
    margin: 0;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .gestion-header {
        padding: 16px 20px;
    }

    .gestion-brand h1 {
        font-size: 20px;
    }

    .gestion-nav {
        padding: 16px 20px 0;
        flex-wrap: wrap;
    }

    .nav-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
        padding: 12px 16px;
    }

    .nav-text {
        display: none;
    }

    .gestion-content {
        padding: 20px;
    }

    .section-header h2 {
        font-size: 22px;
    }

    .upload-card,
    .files-card {
        padding: 20px;
    }

    .files-list {
        grid-template-columns: 1fr;
    }

    .files-actions {
        flex-direction: column;
        width: 100%;
    }

    .files-actions input {
        width: 100%;
    }
}
