/* Custom CSS - Sistema de Gestión Documental y Poderes */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #1d4ed8;       /* Azul Rey */
    --primary-hover: #1e40af;
    --primary-gradient: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
    
    --bg-body: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-content: #f8fafc;
    
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(226, 232, 240, 0.8);
    
    --text-primary: #0f172a;       /* Gris Oscuro / Negro Slate */
    --text-muted: #64748b;         /* Gris Slate */
    --border-color: #e2e8f0;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    background-size: 100% 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Glassmorphism Card (Login) */
.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.06);
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.1);
    border-color: rgba(29, 78, 216, 0.25);
}

/* Custom Form Styling */
.form-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-control {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    color: var(--text-primary) !important;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    background: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12);
}

/* Buttons */
.btn-primary-custom {
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: white !important;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(29, 78, 216, 0.2);
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 78, 216, 0.3);
    filter: brightness(1.05);
}

.btn-primary-custom:active {
    transform: translateY(0);
}

/* Decorative elements */
.logo-container {
    width: 65px;
    height: 65px;
    border-radius: 16px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    box-shadow: 0 10px 20px rgba(29, 78, 216, 0.2);
}

.logo-container i {
    font-size: 1.8rem;
    color: white;
}

.login-logo-img {
    max-height: 80px;
    max-width: 220px;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.05));
    transition: transform 0.3s ease;
}

.login-logo-img:hover {
    transform: scale(1.03);
}

.sidebar-logo-wrapper {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 3.5px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
    padding: 6px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sidebar-logo-wrapper:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.45);
}

.sidebar-logo-img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    border-radius: 50%;
}

/* Estilos de Estructura de Dashboard (Light Theme) */
body.dashboard-body {
    background: var(--bg-body);
    color: var(--text-primary);
    animation: none;
    overflow-y: auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.dashboard-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    align-items: stretch;
}

/* Sidebar styling - Corporate Navy & Royal Blue Theme */
.sidebar {
    min-width: 260px;
    max-width: 260px;
    background: linear-gradient(180deg, #0b1f44 0%, #081735 100%);
    border-right: 1px solid #142a50;
    color: #f1f5f9;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 25px rgba(8, 21, 43, 0.15);
}

.sidebar .sidebar-header {
    padding: 1.75rem 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.sidebar .sidebar-header span,
.sidebar .sidebar-header .text-dark {
    color: #ffffff !important;
}

.sidebar ul.components {
    padding: 1.25rem 0;
    list-style: none;
    margin: 0;
    flex-grow: 1;
}

.sidebar ul li {
    padding: 0 0.85rem;
    margin-bottom: 0.35rem;
}

.sidebar ul li a {
    padding: 0.7rem 1rem;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.25s ease;
    font-weight: 500;
}

.sidebar ul li a i {
    font-size: 1.05rem;
    color: #64748b;
    transition: color 0.25s ease;
}

.sidebar ul li a:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.07);
}

.sidebar ul li a:hover i {
    color: #60a5fa !important;
}

.sidebar ul li.active a {
    color: #ffffff !important;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    box-shadow: 0 4px 15px rgba(29, 78, 216, 0.45);
    font-weight: 600;
}

.sidebar ul li.active a i {
    color: #ffffff !important;
}

.sidebar .text-muted {
    color: #60a5fa !important; /* Azul celeste nítido para categorías */
    opacity: 0.9;
}

.sidebar .p-3.border-top {
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(0, 0, 0, 0.15);
}

.sidebar .p-3.border-top .text-dark {
    color: #ffffff !important;
}

.sidebar .p-3.border-top .text-muted {
    color: #94a3b8 !important;
}

.sidebar .p-3.border-top .bg-primary.bg-opacity-10 {
    background-color: rgba(37, 99, 235, 0.25) !important;
    color: #93c5fd !important;
}

.sidebar .p-3.border-top .btn-outline-danger {
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.4);
}

.sidebar .p-3.border-top .btn-outline-danger:hover {
    background-color: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

/* Main Content Container */
.content-area {
    width: 100%;
    padding: 2.5rem;
    background: var(--bg-content);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar-top {
    background: #ffffff !important;
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.02);
}

.navbar-top .navbar-brand {
    color: var(--text-primary) !important;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.02);
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(29, 78, 216, 0.25);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
}

.stat-card h3 {
    color: var(--text-primary) !important;
}

.stat-card .bg-primary.bg-opacity-10 {
    background-color: rgba(29, 78, 216, 0.1) !important;
    color: var(--primary-color) !important;
}

.stat-card .bg-info.bg-opacity-10 {
    background-color: rgba(14, 116, 144, 0.1) !important;
    color: #0e7490 !important;
}

.stat-card .bg-success.bg-opacity-10 {
    background-color: rgba(21, 128, 61, 0.1) !important;
    color: #15803d !important;
}

.stat-card .bg-warning.bg-opacity-10 {
    background-color: rgba(180, 83, 9, 0.1) !important;
    color: #b45309 !important;
}

/* Tablas */
.table {
    color: var(--text-primary) !important;
}

.table th {
    color: var(--text-muted) !important;
    border-bottom: 2px solid var(--border-color) !important;
}

.table td {
    border-bottom: 1px solid var(--border-color) !important;
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsividad para Laptops y Pantallas Medianas (1200px) */
@media (max-width: 1200px) {
    .sidebar {
        min-width: 230px;
        max-width: 230px;
    }
    .content-area {
        padding: 1.75rem;
    }
}

/* Responsividad para Laptops Pequeñas (1024px) */
@media (max-width: 1024px) {
    .sidebar {
        min-width: 210px;
        max-width: 210px;
    }
    .sidebar .sidebar-header h4 {
        font-size: 1.1rem !important;
    }
    .sidebar ul li a {
        font-size: 0.9rem;
        padding: 0.65rem 0.8rem;
        gap: 8px;
    }
    .content-area {
        padding: 1.25rem;
    }
    .navbar-top {
        padding: 0.6rem 1.25rem;
        margin-bottom: 1.5rem;
        border-radius: 12px;
    }
    .stat-card {
        padding: 1.1rem;
    }
    .stat-card h3 {
        font-size: 1.5rem !important;
    }
    .stat-card p {
        font-size: 0.85rem;
        margin-bottom: 0;
    }
    .table th, .table td {
        font-size: 0.85rem;
        padding: 0.75rem 0.5rem !important;
    }
}

/* Responsividad para Tablets y Móviles (768px o menor) */
@media (max-width: 768px) {
    .dashboard-wrapper {
        flex-direction: column;
    }
    .sidebar {
        min-width: 100%;
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid #142a50;
    }
    .sidebar .sidebar-header {
        padding: 1.25rem 1rem;
    }
    .sidebar ul.components {
        padding: 0.5rem 1rem;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px;
    }
    .sidebar ul li {
        padding: 0;
        margin-bottom: 0;
    }
    .sidebar ul li a {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    .sidebar .mt-4 {
        display: none !important; /* Ocultar títulos de sección */
    }
    .sidebar .p-3.border-top.mt-auto {
        margin-top: 0 !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
        padding: 1rem 1.5rem !important;
    }
    .content-area {
        padding: 1rem;
    }
}

/* Responsividad para Tablets y Móviles (991.98px o menor) */
@media (max-width: 991.98px) {
    .navbar-top {
        margin-bottom: 1.5rem;
    }
    .navbar-top .container-fluid {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .navbar-top .ms-auto {
        margin-left: 0 !important;
        width: 100%;
        display: flex;
        justify-content: flex-start;
    }
}

/* Responsividad para Móviles Pequeños (576px o menor) */
@media (max-width: 575.98px) {
    .navbar-top .ms-auto .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Indicador Chevron de Filtros Colapsables */
.filter-chevron {
    transition: transform 0.3s ease;
}
button:not(.collapsed) .filter-chevron,
button[aria-expanded="true"] .filter-chevron {
    transform: rotate(180deg);
}
