:root {
    --bg-page: #7B8FDE;
    --bg-card: #ffffff;
    --bg-index-item: #EEF1F8;
    --primary-dark: #2C4A7C;
    --primary-medium: #4A6FA5;
    --primary-light: #6B83C4;
    --accent: #3B5998;
    --text-dark: #1a1a1a;
    --text-main: #333333;
    --text-muted: #666666;
    --border: #d0d7e5;
    --danger-bg: #f8d7da;
    --danger-text: #842029;
    --code-bg: #1e2a4a;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.6;
    padding: 20px;
}

.page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header institucional */
.institutional-header {
    background: var(--bg-card);
    border-radius: 8px 8px 0 0;
    padding: 25px 40px;
    border-bottom: 3px solid var(--primary-dark);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 25px;
}

.header-logo {
    width: 85px;
    height: 85px;
    object-fit: contain;
    flex-shrink: 0;
}

.header-text {
    flex: 1;
    text-align: center;
}

.header-text h1 {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.25rem;
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.header-text h2 {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.1rem;
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: 6px;
}

.header-text h3 {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1rem;
    color: var(--text-main);
    font-style: italic;
    font-weight: 400;
    margin-bottom: 4px;
}

.header-text h4 {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.95rem;
    color: var(--text-main);
    font-style: italic;
    font-weight: 400;
}

/* Banner título */
.title-banner {
    background: var(--primary-dark);
    color: white;
    padding: 45px 40px;
    text-align: center;
    border-radius: 0 0 8px 8px;
    margin-bottom: 25px;
}

.title-banner h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
}

.title-banner .subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 8px;
}

.title-banner .subtitle-small {
    font-size: 0.95rem;
    opacity: 0.85;
}

/* Índice de contenidos */
.index-section {
    margin-bottom: 25px;
}

.index-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 30px 35px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.index-title {
    font-size: 1.6rem;
    color: var(--primary-dark);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-light);
}

.index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.index-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-index-item);
    padding: 15px 18px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-medium);
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.index-item:hover {
    background: #e4eaf5;
    border-left-color: var(--primary-dark);
    transform: translateX(3px);
}

.index-number {
    width: 38px;
    height: 38px;
    background: var(--primary-medium);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.index-item div {
    display: flex;
    flex-direction: column;
}

.index-item strong {
    font-size: 1rem;
    color: var(--primary-dark);
    font-weight: 700;
}

.index-item span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Contenido principal */
.content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.content-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 35px 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.content-card h2 {
    color: var(--primary-dark);
    font-size: 1.7rem;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
}

.content-card h3 {
    color: var(--primary-medium);
    font-size: 1.25rem;
    margin: 25px 0 12px;
}

.content-card p {
    margin-bottom: 15px;
}

.content-card ul, 
.content-card ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.content-card li {
    margin-bottom: 8px;
}

.content-card strong {
    color: var(--primary-dark);
}

/* Alerts */
.alert {
    padding: 18px 22px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 5px solid;
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-left-color: #dc3545;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    margin: 15px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--primary-dark);
    color: white;
    font-weight: 600;
}

tr:nth-child(even) {
    background: #f7f9fc;
}

tr:hover {
    background: #eef2fa;
}

/* Code Blocks */
pre {
    background: var(--code-bg);
    color: #e8ecf5;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
    font-size: 0.9rem;
    line-height: 1.6;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

code {
    font-family: 'Fira Code', 'Consolas', monospace;
}

p code {
    background: #eef2fa;
    color: var(--primary-dark);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Copy Button */
.code-block {
    position: relative;
    margin: 15px 0;
}

.code-block pre {
    margin: 0;
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #e8ecf5;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    z-index: 2;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-light);
}

.copy-btn.copied {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.copy-btn svg {
    width: 16px;
    height: 16px;
}

/* Footer */
.page-footer {
    background: var(--primary-dark);
    color: white;
    text-align: center;
    padding: 18px;
    border-radius: 8px;
    margin-top: 25px;
    font-size: 0.9rem;
    opacity: 0.95;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .institutional-header {
        padding: 20px;
    }

    .header-inner {
        flex-direction: column;
        text-align: center;
    }

    .header-logo {
        width: 70px;
        height: 70px;
    }

    .header-text h1 {
        font-size: 1rem;
    }

    .header-text h2 {
        font-size: 0.95rem;
    }

    .title-banner {
        padding: 30px 20px;
    }

    .title-banner h1 {
        font-size: 1.4rem;
    }

    .title-banner .subtitle {
        font-size: 0.95rem;
    }

    .index-card,
    .content-card {
        padding: 25px 20px;
    }

    .index-grid {
        grid-template-columns: 1fr;
    }

    .content-card h2 {
        font-size: 1.4rem;
    }
}