:root {
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-200: #bfdbfe;
    --blue-300: #93c5fd;
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-800: #1e40af;
    --blue-900: #1e3a8a;
    --sky-50: #f0f9ff;
    --sky-100: #e0f2fe;
    --sky-200: #bae6fd;
    --sky-300: #7dd3fc;
    --sky-400: #38bdf8;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --danger-50: #fef2f2;
    --danger-500: #ef4444;
    --success-50: #ecfdf5;
    --success-500: #10b981;
    --success-600: #059669;
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.75rem;
    --spacing-4: 1rem;
    --spacing-5: 1.25rem;
    --spacing-6: 1.5rem;
    --border-radius: 0.375rem;
    --border-radius-lg: 0.75rem;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition-all: all 0.2s ease-in-out;
}
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: linear-gradient(135deg, var(--blue-50), var(--sky-100));
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}
h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--blue-800);
}

h2.titulo-truncado {
    max-width: 500px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: help;
}

a {
    color: var(--blue-600);
    text-decoration: none;
    transition: var(--transition-all);
}

a:hover {
    color: var(--blue-700);
    text-decoration: underline;
}

p {
    margin-bottom: var(--spacing-4);
}
.error {
    color: var(--danger-500);
    padding: var(--spacing-4);
    background-color: var(--danger-50);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-4);
    border-left: 4px solid var(--danger-500);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.button {
    display: inline-block;
    background: linear-gradient(to bottom, var(--blue-500), var(--blue-600));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: var(--spacing-2) var(--spacing-4);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-all);
    text-align: center;
    box-shadow: var(--shadow-md);
    text-decoration: none;
}
.button:hover {
    background: linear-gradient(to bottom, var(--blue-600), var(--blue-700));
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    color: white;
}
.viewer-container {
    display: flex;
    flex-direction: column;
    height: 95vh;
    background-color: white;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--blue-200);
    max-width: 1200px;
    margin: 0 auto;
}
.toolbar {
    background: linear-gradient(to right, var(--blue-100), var(--sky-200));
    padding: var(--spacing-3) var(--spacing-5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--blue-300);
}
.pdf-container {
    flex-grow: 1;
    border: 1px solid var(--blue-200);
    background-color: var(--gray-100);
}
iframe {
    width: 100%;
    height: 100%;
    border: none;
    background-color: var(--blue-50);
}
.estado {
    display: inline-block;
    padding: var(--spacing-1) var(--spacing-2);
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: var(--spacing-2);
    vertical-align: middle;
}

.estado-vigente {
    background-color: var(--success-50);
    color: var(--success-600);
    border: 1px solid var(--success-500);
}

.estado-vigente-parcial {
    background-color: #fff7ed;
    color: #c2410c;
    border: 1px solid #f97316;
}

.estado-no-vigente {
    background-color: var(--danger-50);
    color: var(--danger-500);
    border: 1px solid var(--danger-500);
}
.etiqueta {
    display: inline-block;
    padding: var(--spacing-1) var(--spacing-2);
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: var(--spacing-2);
    vertical-align: middle;
    background-color: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .viewer-container {
        height: 98vh;
    }
    
    .toolbar {
        padding: var(--spacing-2) var(--spacing-3);
    }
    
    h2 {
        font-size: 1rem;
        max-width: 60%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .button {
        padding: var(--spacing-1) var(--spacing-3);
        font-size: 0.75rem;
    }
    
    .estado {
        font-size: 0.7rem;
        padding: var(--spacing-1);
    }
}

@keyframes highlight-animation {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5); }
    70% { box-shadow: 0 0 0 15px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.highlight-document {
    animation: highlight-animation 2s ease-in-out 3;
    border: 2px solid var(--blue-500);
}