:root {
    --primary: #0B0083; /* Azul Institucional UPEL */
    --primary-hover: #007A35; /* Verde Institucional UPEL (Al pasar ratón) */
    --secondary: #007A35; /* Verde Institucional UPEL */
    --bg-gradient-1: #e0f2fe; /* Azul suave */
    --bg-gradient-2: #d1fae5; /* Verde suave */
    --text-main: #1F2937;
    --text-muted: #4B5563;
    --border: rgba(255, 255, 255, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 100%);
    background-size: 200% 200%;
    min-height: 100vh;

    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    position: relative;
    overflow-x: hidden;
}



/* Glassmorphism Container */
.container.glass-panel {
    background: #ffffff; /* Fondo sólido moderno (Flat Design) especial para PCs bajo rendimiento UPEL */
    /* Se eliminan por completo los filtros de cristal para soporte perfecto de Windows 7 / 2GB RAM */
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    border-left: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 1000px;
    padding: 40px;
    position: relative;
    z-index: 10;
}

/* Watermark Background for all Glass Panels */
.container.glass-panel::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: url('../assets/logo.png') no-repeat center center;
    background-size: contain;
    opacity: 0.15;
    z-index: -1; 
    pointer-events: none;
    filter: grayscale(50%);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.logo-image {
    max-height: 80px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s;
}
.logo-image:hover {
    transform: scale(1.05);
}

.header h1 {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.header h2 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 5px;
}

.header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    margin-top: 5px;
}

.form-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-top: 25px;
    text-transform: uppercase;
    color: #111827;
}

/* Forms general */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

/* Progress Rings (Estadisticas Circulares) */
.progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.progress-ring {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(var(--primary) 0%, #e5e7eb 0%);
}
.progress-ring::before {
    content: '';
    position: absolute;
    width: 56px;
    height: 56px;
    background: white;
    border-radius: 50%;
}
.progress-ring-val {
    position: relative;
    font-size: 18px;
    font-weight: 800;
    z-index: 10;
}
.progress-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}
.progress-ring.soporte { background: conic-gradient(#3B82F6 0%, #e0f2fe 0%); color: #3B82F6; }
.progress-ring.sistemas { background: conic-gradient(#10B981 0%, #d1fae5 0%); color: #10B981; }
.progress-ring.redes { background: conic-gradient(#F59E0B 0%, #fef3c7 0%); color: #F59E0B; }

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.section-label {
    font-size: 16px;
    color: var(--primary);
    border-bottom: 2px solid rgba(79, 70, 229, 0.2);
    padding-bottom: 5px;
    display: inline-block;
    margin-bottom: 10px;
}
.text-center { text-align: center; }
.d-block { display: block; }
.mt-3 { margin-top: 20px; }

input[type="text"],
input[type="date"],
input[type="datetime-local"],
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    transition: all 0.3s ease;
    color: var(--text-main);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.line-input {
    border: none !important;
    border-bottom: 1px dashed var(--text-muted) !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 5px 0 !important;
    box-shadow: none !important;
}
.line-input:focus {
    border-bottom: 2px solid var(--primary) !important;
}

/* Checkboxes & Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.category-card {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-title {
    text-align: center;
    font-weight: 700;
    color: white;
    background: var(--primary);
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    letter-spacing: 0.5px;
}

/* Custom Checkbox */
.checkbox-container {
    display: block;
    position: relative;
    padding-left: 30px;
    margin-bottom: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    user-select: none;
    transition: color 0.2s;
}

.checkbox-container:hover {
    color: var(--primary);
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: #eee;
    border-radius: 4px;
    border: 1px solid #ccc;
    transition: all 0.2s;
}

.checkbox-container:hover input ~ .checkmark {
    background-color: #e0e0e0;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--secondary); /* Verde al seleccionar */
    border-color: var(--secondary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.other-input {
    flex-direction: row;
    align-items: center;
    margin-top: 10px;
}
.mt-auto { margin-top: auto; }

/* Details & Signatures */
.details-section {
    margin-bottom: 30px;
}

.signatures-row {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.signature-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 250px;
}
.signature-box.right {
    align-items: flex-end;
}
.signature-box.right label {
    margin-right: 40px;
}

.signature-box input {
    border: none;
    border-bottom: 1px solid #000;
    border-radius: 0;
    background: transparent;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    padding: 5px;
    width: 100%;
    margin-bottom: 5px;
    box-shadow: none;
}
.signature-box input:focus {
    box-shadow: none;
    border-bottom: 2px solid var(--primary);
}
.stamp-area {
    width: 200px;
    height: 80px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 12px;
}
.stamp-area::before {
    content: "Espacio para sello";
}

/* Admin Section (Solo Informatica) */
.admin-section {
    background: rgba(243, 244, 246, 0.7);
    border: 1px dashed var(--primary);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    position: relative;
}

.admin-header {
    background: var(--primary);
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    position: absolute;
    top: -15px;
    left: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.align-items-end { align-items: flex-end; }

/* Actions */
.actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    position: relative;
    overflow: hidden;
}
.btn-primary::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transform: skewX(-20deg);
    transition: all 0.6s ease;
}
.btn-primary:hover::after {
    left: 150%;
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 122, 53, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid #d1d5db;
}
.btn-secondary:hover {
    background: #f9fafb;
    transform: translateY(-2px);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #10B981;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}
.toast.error {
    background: #EF4444;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
}

/* Print Styles */
@media print {
    @page {
        size: letter portrait;
        margin: 5mm; 
    }
    
    body {
        -webkit-print-color-adjust: exact !important; 
        print-color-adjust: exact !important;
        background: white;
        padding: 0;
        margin: 0;
        /* Soporte Chrome/Edge */
        zoom: 0.70; 
        /* Soporte Firefox (que ignora el zoom) */
        transform: scale(0.85);
        transform-origin: top center;
    }

    /* Ocultar elementos que no van al papel */
    .actions, .toast, .tech-toolbar, .blob { 
        display: none !important; 
    }
    
    .container.glass-panel {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important; 
        max-width: 100% !important;
        margin: 0 auto !important;
    }

    /* Comprimir masivamente las cajas de texto y de selección nativamente (Crucial para Firefox) */
    input[type="text"], input[type="date"], input[type="datetime-local"], textarea, select {
        padding: 4px 6px !important;
        font-size: 12px !important;
        border-radius: 4px !important;
        margin: 0 !important;
    }

    textarea {
        height: 40px !important;
        min-height: 40px !important;
    }

    label, .section-label {
        font-size: 12px !important;
        margin-bottom: 0 !important;
    }

    .form-group {
        gap: 2px !important;
    }

    .categories-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 8px !important;
    }
    .category-card {
        padding: 8px !important;
        gap: 2px !important;
    }
    
    .checkbox-container {
        font-size: 12px !important; 
        margin-bottom: 2px !important;
        padding-left: 18px !important;
    }

    .header {
        margin-bottom: 6px !important;
        padding-bottom: 4px !important;
    }
    .logo-image {
        max-height: 55px !important; 
    }
    .form-title {
        margin-top: 4px !important;
        font-size: 20px !important;
    }
    
    .form-row {
        gap: 10px !important;
        margin-bottom: 8px !important;
    }
    .details-section {
        margin-bottom: 8px !important;
    }
    
    .admin-section {
        padding: 10px !important;
        margin-bottom: 0 !important;
        page-break-inside: avoid;
    }
    
    .signatures-row {
        margin: 10px 0 0 0 !important;
        page-break-inside: avoid;
    }
}
/* Responsive */
@media (max-width: 768px) {
    body { padding: 20px 10px; }
    .container.glass-panel { padding: 25px 15px; }
    
    .logo-container { flex-direction: column; text-align: center; gap: 10px; }
    .logo-image { height: 60px; }
    .header h1 { font-size: 16px; }
    .header h2 { font-size: 14px; }
    .header h3 { font-size: 13px; }
    .form-title { font-size: 18px; margin-top: 15px; }

    .form-row { flex-direction: column; gap: 15px; }
    .flex-1, .flex-2 { width: 100%; }
    
    .categories-grid { grid-template-columns: 1fr; gap: 15px; }
    
    .signatures-row { flex-direction: column; gap: 30px; margin: 20px 0; }
    .signature-box { min-width: 100%; }
    .signature-box.right { align-items: center; }
    .signature-box.right label { margin-right: 0; }
    
    .admin-header { position: relative; top: 0; left: 0; display: flex; width: 100%; justify-content: center; box-sizing: border-box; margin-bottom: 20px; text-align: center; }
    .admin-section { padding: 15px; }
    
    .actions { flex-direction: column; gap: 10px; }
    .btn { width: 100%; justify-content: center; margin-right: 0 !important; }

    /* Admin specific fixes */
    #statsPanel { grid-template-columns: 1fr !important; }
    #statsPanel > div { padding: 15px !important; }
    #statsPanel > div > div { flex-direction: column; }
    
    .filters-bar { flex-direction: column; padding: 15px !important; gap: 15px !important; }
    .dashboard-grid { grid-template-columns: 1fr !important; }
    
    .modal-content { padding: 20px; width: 95%; }
    .request-summary > div { grid-template-columns: 1fr !important; gap: 8px !important; }
    .close-btn { top: 10px; right: 15px; }
}

/* Tech Toolbar (Nivel Informático) */
.tech-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    align-items: center;
    background: rgba(11, 0, 131, 0.04);
    border: 1px solid rgba(11, 0, 131, 0.1);
    padding: 12px 20px;
    border-radius: 16px;
    margin-top: 10px;
    flex-wrap: wrap;
    box-shadow: inset 0 2px 10px rgba(255,255,255,0.5);
}
.tech-tool-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: var(--text-main);
    border: 1px solid #e5e7eb;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}
.tech-tool-btn svg {
    width: 16px; height: 16px;
    stroke: var(--primary);
}
.tech-tool-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(11, 0, 131, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}
.tech-tool-btn.primary,
.tech-tool-btn.accent,
.tech-tool-btn.success {
    background: linear-gradient(135deg, var(--primary), #1a108a);
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(11, 0, 131, 0.2);
}
.tech-tool-btn.primary svg,
.tech-tool-btn.accent svg,
.tech-tool-btn.success svg {
    stroke: white;
}
.tech-tool-btn.primary:hover,
.tech-tool-btn.accent:hover,
.tech-tool-btn.success:hover {
    box-shadow: 0 8px 15px rgba(11, 0, 131, 0.4);
    background: linear-gradient(135deg, #1a108a, var(--primary));
    transform: translateY(-2px);
    color: white;
}
.tech-tool-btn.danger {
    color: var(--text-main);
    border-color: #e5e7eb;
    background: white;
}
.tech-tool-btn.danger svg { stroke: #DC2626; }
.tech-tool-btn.danger:hover {
    color: #DC2626;
    background: #FEF2F2;
    border-color: #FECACA;
    transform: translateY(-2px);
}
/* End Tech Toolbar */

/* Sidebar Offcanvas (Notificaciones) */
.sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Cortina oscura sólida */
    z-index: 2000; opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

.sidebar-offcanvas {
    position: fixed; top: 0; right: -420px; width: 400px; max-width: 100%; height: 100%;
    background: #f8fafc; z-index: 2001; transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    box-shadow: -10px 0 40px rgba(0,0,0,0.15); display: flex; flex-direction: column;
}
.sidebar-offcanvas.active { right: 0; }

.sidebar-header {
    padding: 20px 25px; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; background: white;
}
.sidebar-header h4 { margin: 0; color: var(--primary); display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; }
.close-sidebar {
    background: #f1f5f9; border: none; width: 32px; height: 32px; border-radius: 50%; font-size: 20px; cursor: pointer; color: #64748b; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center;
}
.close-sidebar:hover { background: #fee2e2; color: #DC2626; transform: rotate(90deg); }

.sidebar-body { padding: 20px 25px; overflow-y: auto; flex-grow: 1; display: flex; flex-direction: column; gap: 15px; }

.notif-card {
    position: relative;
    background: white; border: 1px solid #e2e8f0; border-left: 4px solid var(--primary); padding: 16px; border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); cursor: pointer; transition: all 0.2s ease;
}
.notif-card:hover { transform: translateY(-3px); box-shadow: 0 10px 15px -3px rgba(11, 0, 131, 0.1); border-color: var(--primary); }

.unread-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 14px;
    height: 14px;
    background-color: #3b82f6;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.8), inset 0 0 2px rgba(255,255,255,0.8);
    border: 2px solid white;
    z-index: 10;
}
