:root {
    /* Sophisticated Color Palette */
    --brand-primary: #ea580c;
    --brand-primary-hover: #c2410c;
    --brand-secondary: #0f172a;
    
    /* Backgrounds */
    --bg-main: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.85);
    --bg-card: #ffffff;
    
    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    /* UI Accents */
    --accent: var(--brand-primary);
    --accent-soft: rgba(234, 88, 12, 0.08);
    --accent-glass: rgba(234, 88, 12, 0.04);
    
    /* Borders & Shadows */
    --border-light: rgba(226, 232, 240, 0.8);
    --border-strong: #e2e8f0;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    --shadow-active: 0 25px 50px -12px rgba(234, 88, 12, 0.15);
    
    /* Spacing & Radius */
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-pill: 9999px;
    --spacing-xs: 0.15rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 0.85rem;
    --spacing-lg: 1.25rem;
    --spacing-xl: 1.75rem;
}

[data-theme="dark"] {
    --bg-main: #020617;
    --bg-surface: rgba(15, 23, 42, 0.85);
    --bg-card: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-light: rgba(30, 41, 59, 0.8);
    --border-strong: #1e293b;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --accent-soft: rgba(234, 88, 12, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg-main);
    color: var(--text-secondary);
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.4s ease;
}

h1, h2, h3, h4 {
    font-family: 'Outfit', 'Inter', sans-serif;
    color: var(--text-primary);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.container {
    margin: 0 auto;
    padding: 0 2rem;
}

.container-fluid {
    width: 100%;
    max-width: 98%;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Dashboard Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-light);
    padding: var(--spacing-sm) var(--spacing-xs);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: var(--shadow-soft);
    z-index: 100;
}

.sidebar-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--accent);
    margin-bottom: var(--spacing-sm);
    letter-spacing: 1px;
    padding-left: 0.5rem;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.15rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    font-weight: 600;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--accent-soft);
    color: var(--accent);
    transform: translateX(2px);
}

.sidebar-nav .icon {
    margin-right: 1rem;
    font-size: 1.25rem;
}

.nav-divider {
    height: 1px;
    background: var(--border-light);
    margin: var(--spacing-md) 0;
}

/* Nav Group / Accordion */
.nav-group {
    margin-bottom: 0.5rem;
}

.nav-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.85rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.nav-group-header:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.nav-group-header i.toggle-icon {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.nav-group.expanded .nav-group-header i.toggle-icon {
    transform: rotate(180deg);
}

.nav-group-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding-left: 0.5rem;
}

.nav-group.expanded .nav-group-content {
    max-height: 500px; /* Large enough for many items */
}

.nav-group-content a {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 0.1rem;
}

.nav-group-content a:hover,
.nav-group-content a.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.main-content {
    flex: 1;
    padding: var(--spacing-md);
    background: var(--bg-main);
}

/* Institutional Card Style */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-premium);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: var(--shadow-active);
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

/* Elite Dashboard Components */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: scale(1.02);
}

.stat-icon {
    width: 42px;
    height: 42px;
    background: var(--accent-soft);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--accent);
}

/* Table Refinement */
.premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
}

.premium-table th {
    background: #f8fafc;
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 700;
    border-bottom: 2px solid var(--border-light);
}

.premium-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 0.85rem;
    vertical-align: middle;
}

.premium-table tr:last-child td {
    border-bottom: none;
}

.premium-table tr:hover {
    background: var(--accent-glass);
}

/* Premium Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: 1px solid transparent;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--bg-card);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-primary:hover {
    background: var(--accent);
    color: #ffffff;
    box-shadow: var(--shadow-premium);
}

.btn-solid {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 14px 0 rgba(234, 88, 12, 0.25);
}

.btn-solid:hover {
    background: var(--brand-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-active);
}

/* Form Styles */
.form-group {
    margin-bottom: var(--spacing-md);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input,
select,
textarea {
    padding: 0.8rem 1.1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

/* Badges */
.badge {
    padding: 0.4rem 1rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-danger { background: #fee2e2; color: #991b1b; }

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Responsive Mobile Layouts */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 1rem;
        position: relative;
    }

    .grid,
    .grid-form {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }

    .card {
        padding: 1.5rem;
    }

    .main-content {
        padding: 1.5rem;
    }

    .premium-table th,
    .premium-table td {
        padding: 1rem;
        font-size: 0.85rem;
    }

    .premium-table {
        min-width: 800px;
        /* Forces horizontal scroll on mobile */
    }
}

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

.animate-fade {
    animation: fadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.text-accent {
    color: var(--accent);
}

.text-premium {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, var(--accent), #c2410c);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Timeline Pulse Animation */
@keyframes pulse-accent {
    0% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(234, 88, 12, 0); }
    100% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0); }
}

.timeline-dot-active {
    animation: pulse-accent 2s infinite;
    position: relative;
    z-index: 2;
}

/* Progress Shimmer Effect */
.progress-fill {
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

/* Interactive 3D Card - Hyper-Realistic */
.brevete-3d-wrapper {
    perspective: 1200px;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    position: relative;
}

.brevete-3d-card {
    width: 100%;
    aspect-ratio: 1.58 / 1;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    border-radius: 14px;
}

.brevete-3d-card::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255,255,255,0.4), rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.4));
    z-index: -1;
    opacity: 0.5;
}

.brevete-3d-card.flipped {
    transform: rotateY(180deg);
}

.brevete-flip-front, 
.brevete-flip-back {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.2);
}

.brevete-flip-front {
    background: #ffffff;
    z-index: 2;
}

.brevete-flip-back {
    background: #f1f5f9;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
}

/* Enhanced Holographic Rainbow Layer */
.brevete-holographic-rainbow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    mix-blend-mode: color-dodge;
    opacity: 0;
    background: linear-gradient(
        var(--rainbow-deg, 135deg),
        rgba(255, 0, 0, 0.1) 0%,
        rgba(255, 255, 0, 0.1) 15%,
        rgba(0, 255, 0, 0.1) 30%,
        rgba(0, 255, 255, 0.1) 50%,
        rgba(0, 0, 255, 0.1) 65%,
        rgba(255, 0, 255, 0.1) 80%,
        rgba(255, 0, 0, 0.1) 100%
    );
    background-size: 200% 200%;
    background-position: var(--rainbow-x, 50%) var(--rainbow-y, 50%);
    transition: opacity 0.4s ease;
}

.brevete-holographic-shine {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 11;
    mix-blend-mode: overlay;
    opacity: 0;
    background: radial-gradient(
        circle at var(--shine-x, 50%) var(--shine-y, 50%),
        rgba(255, 255, 255, 0.9) 0%,
        rgba(255, 255, 255, 0) 50%
    );
    transition: opacity 0.3s;
}

.brevete-3d-card:hover .brevete-holographic-rainbow,
.brevete-3d-card:hover .brevete-holographic-shine {
    opacity: 1;
}

.brevete-3d-shimmer {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.6) 45%,
        rgba(255,255,255,0.8) 50%,
        rgba(255,255,255,0.6) 55%,
        rgba(255,255,255,0) 100%
    );
    background-size: 200% 200%;
    pointer-events: none;
    z-index: 5;
}

.brevete-3d-content {
    padding: 12px 16px;
    color: #1f2937;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}

.brevete-3d-content *, 
.brevete-3d-content *::before, 
.brevete-3d-content *::after {
    box-sizing: border-box;
}

/* Header Oficial */
.brevete-official-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #374151;
    padding-bottom: 4px;
    margin-bottom: 8px;
    width: 100%;
}

.official-shield-left {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.official-shield-right {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.official-titles {
    text-align: center;
    flex: 1;
    overflow: hidden;
    padding: 0 5px;
}

.title-main { font-size: 13px; font-weight: 900; margin: 0; color: #111827; letter-spacing: 0.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-sub { font-size: 10px; font-weight: 700; margin: 0; color: #374151; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-inst { font-size: 11px; font-weight: 800; margin: 0; color: #1e40af; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-unit { font-size: 8px; font-weight: 600; margin: 0; color: #6b7280; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Body Area */
.brevete-official-body {
    display: grid;
    grid-template-columns: 100px 1fr 40px;
    gap: 12px;
    flex: 1;
    overflow: hidden;
}

.brevete-photo-area {
    position: relative;
    width: 100px;
    height: 125px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    overflow: hidden;
    border-radius: 4px;
}

.card-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-security-lines {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: repeating-linear-gradient(45deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.2) 2px, transparent 2px, transparent 4px);
    pointer-events: none;
}

.brevete-data-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    overflow: hidden;
}

.licencia-number-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.label-large { font-size: 11px; font-weight: 900; color: #111827; margin: 0; }
.value-number { font-size: 13px; font-weight: 900; color: #111827; font-family: 'Courier New', monospace; margin: 0; }

.field-item { display: flex; flex-direction: column; line-height: 1.1; }
.field-label { font-size: 8px; font-weight: 800; color: #1e40af; text-transform: uppercase; margin-bottom: 1px; }
.field-value { font-size: 11px; font-weight: 700; color: #111827; text-transform: uppercase; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field-value-small { font-size: 10px; font-weight: 700; color: #111827; }

/* Sidebar Logos */
.brevete-sidebar-logos {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.side-logo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
}
.logo-1 { background: linear-gradient(45deg, #1e40af, #3b82f6); }
.logo-2 { background: linear-gradient(45deg, #b91c1c, #ef4444); }
.logo-3 { background: linear-gradient(45deg, #15803d, #22c55e); }

/* Footer Area */
.brevete-official-footer {
    display: flex;
    justify-content: center;
    margin-top: 0.4rem;
}

.signature-area {
    text-align: center;
    border-top: 1px solid #9ca3af;
    padding-top: 0.1rem;
    min-width: 140px;
}

.signature-img {
    height: 20px;
    background: url('https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Firma_de_Javier_Rodolfo_Arana_Palomino.svg/1200px-Firma_de_Javier_Rodolfo_Arana_Palomino.svg.png') no-repeat center;
    background-size: contain;
    opacity: 0.7;
}

.signature-name { font-size: 0.4rem; font-weight: 800; margin: 0; color: #374151; }

.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: var(--spacing-sm);
    }
    
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .main-content {
        padding: var(--spacing-md);
    }
}

/* Action Icons for Table */
.btn-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-icon:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn-icon:active {
    transform: translateY(-1px);
}

/* DataTables Premium UI Overrides */
.dataTables_wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: #ffffff;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border: 1px solid var(--border-light);
    border-bottom: none;
    margin-top: 1rem;
}

.dt-buttons {
    display: flex !important;
    gap: 0.5rem !important;
    margin: 0 !important;
}

.dt-button {
    margin: 0 !important;
    padding: 0.5rem 1.2rem !important;
    font-weight: 800 !important;
    font-size: 0.75rem !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    border: none !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

.dataTables_filter {
    margin: 0 !important;
}

.dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 900;
    color: var(--text-primary);
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.dataTables_filter input {
    width: 280px !important;
    margin: 0 !important;
    padding: 0.6rem 1.1rem !important;
    border: 1px solid var(--border-strong) !important;
    background: #f8fafc !important;
    border-radius: 8px !important;
    font-size: 0.9rem !important;
}

.dataTables_filter input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-soft) !important;
    background: #fff !important;
}

/* Ensure table is below the header wrapper */
.premium-table.dataTable {
    margin: 0 !important;
    border-radius: 0 !important;
    border-top: 1px solid var(--border-light) !important;
}

/* Pagination/Info Area */
.dataTables_info {
    padding: 1.25rem 1.5rem !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    color: var(--text-secondary) !important;
}

.dataTables_paginate {
    padding: 1.25rem 1.5rem !important;
}

.dataTables_paginate .paginate_button {
    padding: 0.4rem 0.9rem !important;
    border-radius: 8px !important;
    border: 1px solid var(--border-light) !important;
    margin-left: 5px !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    transition: all 0.2s ease !important;
}

.dataTables_paginate .paginate_button.current,
.dataTables_paginate .paginate_button.current:hover {
    background: var(--accent) !important;
    color: white !important;
    border-color: var(--accent) !important;
}

.dataTables_paginate .paginate_button:hover {
    background: var(--accent-soft) !important;
    color: var(--accent) !important;
    border-color: var(--accent) !important;
}

/* Compact Admin Filter Bar */
.filter-bar { background: var(--bg-card); padding: 1.5rem 1rem; border-radius: 12px; margin-bottom: 0.75rem; box-shadow: var(--shadow-soft); border: 1px solid var(--border-light); }
.filter-form-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.filter-group { display: flex; align-items: center; gap: 0.5rem; }
.filter-group label { font-size: 0.75rem; font-weight: 800; color: var(--text-secondary); text-transform: uppercase; white-space: nowrap; margin: 0; }
.premium-select, .premium-input { padding: 0.4rem 0.75rem; border-radius: 8px; border: 1.5px solid var(--border-strong); background: var(--bg-main); font-weight: 600; font-size: 0.8rem; min-width: 140px; color: var(--text-primary); }
.filter-actions { display: flex; gap: 0.5rem; margin-left: auto; }
.btn-action-premium { padding: 0.4rem 1.25rem; border-radius: 8px; border: none; font-weight: 800; color: white; cursor: pointer; display: flex; align-items: center; gap: 0.4rem; transition: all 0.3s; font-size: 0.8rem; }
.btn-action-premium.search { background: #10b981; }
.btn-action-premium.export { background: #3b82f6; }
.btn-action-premium:hover { transform: translateY(-1px); opacity: 0.9; }
/* Pulse Animation for Rejected Documents */
.pulse-border-red { position: relative; border-color: #ef4444 !important; }
.pulse-border-red::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 10px; border: 2px solid #ef4444; animation: pulseRed 2s infinite; pointer-events: none; }
@keyframes pulseRed { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(1.03); opacity: 0; } }

/* --- Advanced Security Layers --- */

.guilloche-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.08;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 100 100'%3E%3Cpath d='M0 50 Q 25 0, 50 50 T 100 50 M0 50 Q 25 100, 50 50 T 100 50' fill='none' stroke='black' stroke-width='0.2'/%3E%3Cpath d='M50 0 Q 0 25, 50 50 T 50 100 M50 0 Q 100 25, 50 50 T 50 100' fill='none' stroke='black' stroke-width='0.2'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

.micro-text-border {
    width: 100%;
    height: 3px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='3'%3E%3Ctext x='0' y='2.5' font-family='Arial' font-size='2' font-weight='bold' fill='%231e40af'%3EREPUBLICA DEL PERU - DGR - EJERCITO DEL PERU - %3C/text%3E%3C/svg%3E");
    background-repeat: repeat-x;
    margin: 5px 0;
    opacity: 0.4;
    z-index: 5;
}

.micro-data-watermark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background-repeat: repeat;
    background-size: 100px 40px;
    opacity: 0.2;
}

.ghost-image {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 65px;
    opacity: 0.12;
    filter: grayscale(100%) contrast(1.1);
    border-radius: 4px;
    pointer-events: none;
    z-index: 5;
    mix-blend-mode: multiply;
}

.photo-armor {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: url('../img/shields/ep.png') no-repeat center;
    background-size: contain;
    opacity: 0.38;
    z-index: 5;
    pointer-events: none;
    mix-blend-mode: overlay;
    transition: all 0.5s ease;
}

.brevete-3d-card:hover .photo-armor {
    opacity: 0.4;
    filter: hue-rotate(90deg) brightness(2);
    transform: translate(-50%, -50%) scale(1.2);
}

.holographic-shield {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 80px;
    height: 80px;
    background: url('../img/shields/ep.png') no-repeat center;
    background-size: contain;
    opacity: 0.45;
    z-index: 10;
    pointer-events: none;
    mix-blend-mode: color-dodge;
    transition: all 0.3s ease;
}

.brevete-3d-card:hover .holographic-shield {
    opacity: 0.95;
    filter: brightness(1.5) contrast(1.2) drop-shadow(0 0 10px rgba(255,215,0,0.5));
    animation: ovi-shift 3s infinite alternate ease-in-out;
}

@keyframes ovi-shift {
    0% { filter: hue-rotate(-15deg) brightness(1.2); transform: translateY(-5px) rotate(-5deg); }
    100% { filter: hue-rotate(15deg) brightness(1.6); transform: translateY(5px) rotate(5deg); }
}

.dashboard-header {
    background: #fff;
    border-radius: 20px;
    padding: 1rem;
}

.modal {
    align-items: center;
    display: none;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
}

.modal.is-active {
    display: flex;
}

.modal-background {
    background-color: rgba(10,10,10,.86);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.modal-card,.modal-content {
    margin: 0 20px;
    max-height: calc(100vh - 160px);
    overflow: auto;
    position: relative;
    width: 100%
}

@media screen and (min-width: 769px) {
    .modal-card,.modal-content {
        margin:0 auto;
        max-height: calc(100vh - 40px);
        width: 640px
    }
}

.modal-close {
    background: 0 0;
    height: 40px;
    position: fixed;
    right: 20px;
    top: 20px;
    width: 40px
}

.modal-card {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    -ms-overflow-y: visible
}

.modal-card-foot,.modal-card-head {
    align-items: center;
    background-color: #f5f5f5;
    display: flex;
    flex-shrink: 0;
    justify-content: flex-start;
    padding: 20px;
    position: relative
}

.modal-card-head {
    border-bottom: 1px solid #dbdbdb;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px
}

.modal-card-title {
    color: #363636;
    flex-grow: 1;
    flex-shrink: 0;
    font-size: 1.5rem;
    line-height: 1
}

.modal-card-foot {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    border-top: 1px solid #dbdbdb
}

.modal-card-foot .button:not(:last-child) {
    margin-right: .5em
}

.modal-card-body {
    -webkit-overflow-scrolling: touch;
    background-color: #fff;
    flex-grow: 1;
    flex-shrink: 1;
    overflow: auto;
    padding: 20px
}