:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #c7d2fe 0%, #e9d5ff 100%);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

.layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Sidebar Styling */
aside.sidebar {
    background-color: #1e293b;
    color: white;
    padding: 1rem 1rem; /* Reducido de 2rem a 1rem */
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0.5rem 1rem 0.5rem; /* Reducido el padding superior significativamente */
    margin-bottom: 1rem;
    border-bottom: 1px solid #334155;
}

.sidebar-logo {
    width: 100%;
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.sidebar h2 {
    display: none; /* Eliminamos el texto ya que el logotipo lo incluye */
}

.nav-links {
    list-style: none;
}

.nav-links li {
    margin-bottom: 0.5rem;
}

.nav-links a {
    color: #cbd5e1;
    text-decoration: none;
    display: block;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.nav-links a:hover {
    background-color: #334155;
    color: white;
}

.nav-links a.active {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
}

/* Main Content Styling */
main.content {
    padding: 3rem 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

.container {
    background: var(--surface);
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.75rem;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #334155;
}

p {
    margin-bottom: 1.25rem;
    color: #475569;
}

/* Feature Boxes */
.alert {
    padding: 1.25rem;
    border-radius: 0.75rem;
    margin: 1.5rem 0;
    display: flex;
    gap: 1rem;
    border: 1px solid transparent;
}

.alert-info {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: #fef3c7;
    color: #92400e;
}

.alert-danger {
    background-color: #fef2f2;
    border-color: #fee2e2;
    color: #991b1b;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: #dcfce7;
    color: #166534;
}

/* Image Placeholders */
.img-placeholder {
    background-color: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 0.75rem;
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
    color: #94a3b8;
    text-align: center;
    padding: 2rem;
}

.img-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.doc-image {
    width: 100%;
    border-radius: 1rem;
    margin: 2rem 0;
    display: block;
    border: 8px solid #ffffff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    outline: 1px solid var(--border);
}

.img-caption {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: -1.5rem;
    margin-bottom: 2rem;
    font-style: italic;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th {
    background-color: #f8fafc;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    color: #64748b;
}

/* Navigation Buttons */
.nav-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-outline {
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

/* Custom Badges */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-paid { background: #dcfce7; color: #166534; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-overdue { background: #fef2f2; color: #991b1b; }

/* Grid Layout for Features */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.feature-card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
}

.feature-card h3, .feature-card h4 {
    margin-top: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.feature-card p {
    font-size: 0.9rem;
    margin-bottom: 0;
    color: var(--text-muted);
}

/* Step Process Styling */
.step-process {
    margin: 2rem 0;
}

.step {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 1.25rem;
    top: 2.5rem;
    bottom: -1rem;
    width: 2px;
    background-color: var(--border);
}

.step-number {
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
    z-index: 1;
}

.step-content h4 {
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

/* Elementos móviles ocultos en escritorio */
.mobile-header {
    display: none;
}
.menu-toggle {
    display: none;
}

/* Overlay para cerrar el menú al tocar fuera */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.is-open {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .layout {
        grid-template-columns: 1fr;
    }
    
    .mobile-header {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 4rem;
        background-color: #ffffff;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        z-index: 990;
        align-items: center;
        justify-content: space-between;
        padding: 0 1.25rem;
    }

    .mobile-logo {
        height: 2.25rem;
        width: auto;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
        border: none;
        border-radius: 0.375rem;
        background-color: transparent;
        color: var(--text-main);
        font-size: 1.25rem;
        cursor: pointer;
    }
    
    .menu-toggle:active {
        background-color: #f1f5f9;
    }

    aside.sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        max-width: 80vw;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding-top: 1rem;
        background-color: #1e293b;
        box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    aside.sidebar.is-open {
        transform: translateX(0);
    }
    
    main.content {
        padding: 5rem 1rem 2rem 1rem; /* Espacio para header */
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .container {
        padding: 1.5rem 1.25rem;
        border-radius: 1rem;
    }
    
    h1 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }
    
    h2 {
        font-size: 1.35rem;
        margin-top: 1.75rem;
    }
    
    h3 {
        font-size: 1.15rem;
    }
    
    p {
        font-size: 0.95rem;
    }

    .doc-image {
        border-width: 4px;
        margin: 1.5rem 0 1rem 0;
        border-radius: 0.75rem;
    }
    
    .img-caption {
        margin-bottom: 1.5rem;
        font-size: 0.8rem;
    }

    .nav-footer {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 2.5rem;
        padding-top: 1.5rem;
    }
    
    .nav-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    .nav-footer span:empty {
        display: none;
    }

    .alert {
        padding: 1rem;
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1.5rem 0;
    }
    
    .step {
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .step:not(:last-child)::after {
        left: 1rem;
        top: 2rem;
    }
    
    .step-number {
        width: 2rem;
        height: 2rem;
        font-size: 0.85rem;
    }
    
    .table-container {
        margin: 1.5rem -1.25rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
        width: calc(100% + 2.5rem);
        overflow-x: auto;
    }
    
    table {
        min-width: 500px;
    }
    
    th, td {
        padding: 0.75rem 1rem;
    }
}
