* {
    box-sizing: border-box;
}

:root {
    --primary: #0056b3; /* Azul Corporativo */
    --primary-dark: #004494;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --light: #f8f9fa;
    --dark: #343a40;
    --dark-card: #ffffff; /* Tarjetas blancas */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    background-color: transparent; /* Transparente para ver el video */
    color: #333;
    line-height: 1.6;
}

/* Video Background - Visible */
#video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover; /* Cubre toda la pantalla sin deformar */
    z-index: -100;
    opacity: 1;
    transition: opacity 1s ease-in-out;
}

/* Image Background */
#image-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: -100;
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.85); /* Blanco semitransparente (Milk Glass) */
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    padding: 2rem;
    margin-bottom: 2rem;
    color: #333; /* Texto oscuro para contraste */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    width: 100%;
    animation: heartbeat-red 3s infinite ease-in-out;
}

.dashboard-card h2, .dashboard-card h3, .dashboard-card p, .dashboard-card label, .dashboard-card span {
    color: #333 !important;
    text-shadow: none;
}

/* Dashboard Inputs */
.dashboard-card input, 
.dashboard-card select {
    background: #ffffff !important;
    border: 1px solid #ced4da !important;
    color: #333 !important;
    border-radius: 25px !important;
    padding: 8px 15px !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.dashboard-card input::placeholder {
    color: #888 !important;
}

.dashboard-card input:focus, 
.dashboard-card select:focus {
    background: #fff !important;
    border-color: #80bdff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
    outline: none;
}

.dashboard-card select option {
    background: #fff;
    color: #333;
}

.dashboard-card input[readonly] {
    background: rgba(233, 236, 239, 0.5) !important; /* Gris claro transparente */
    color: #6c757d !important;
    cursor: not-allowed;
    border-color: rgba(0,0,0,0.1) !important;
}

/* Dashboard Table */
.dashboard-card table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px; /* Spacing between rows */
    margin-top: 1rem;
}

.dashboard-card th {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    border: none;
    padding: 15px;
    font-weight: 700;
}

.dashboard-card th:first-child { border-radius: 10px 0 0 10px; }
.dashboard-card th:last-child { border-radius: 0 10px 10px 0; }

.dashboard-card td {
    background: rgba(255, 255, 255, 0.6);
    color: #333;
    border: none;
    padding: 15px;
    transition: background 0.2s;
    vertical-align: middle;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.dashboard-card tr:hover td {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.005);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.dashboard-card tr td:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    font-weight: bold;
}

.dashboard-card tr td:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

/* Row Colors by Status */
.dashboard-card tr.row-status-NUEVA td,
.dashboard-card tr.row-status-PENDIENTE td {
    background: rgba(13, 71, 161, 0.4) !important;
}
.dashboard-card tr.row-status-NUEVA td:first-child,
.dashboard-card tr.row-status-PENDIENTE td:first-child {
    box-shadow: inset 5px 0 0 #0d47a1;
}

.dashboard-card tr.row-status-EN_VALIDACION td {
    background: rgba(255, 152, 0, 0.4) !important;
}
.dashboard-card tr.row-status-EN_VALIDACION td:first-child {
    box-shadow: inset 5px 0 0 #ff9800;
}

.dashboard-card tr.row-status-REQUIERE_AJUSTE td {
    background: rgba(255, 152, 0, 0.4) !important;
}
.dashboard-card tr.row-status-REQUIERE_AJUSTE td:first-child {
    box-shadow: inset 5px 0 0 #ff9800;
}

.dashboard-card tr.row-status-NO_APROBADA td {
    background: rgba(244, 67, 54, 0.4) !important;
}
.dashboard-card tr.row-status-NO_APROBADA td:first-child {
    box-shadow: inset 5px 0 0 #f44336;
}

.dashboard-card tr.row-status-APROBADA td {
    background: rgba(76, 175, 80, 0.4) !important;
}
.dashboard-card tr.row-status-APROBADA td:first-child {
    box-shadow: inset 5px 0 0 #4caf50;
}

.dashboard-card tr.row-status-RECHAZADA td {
    background: rgba(244, 67, 54, 0.4) !important;
}
.dashboard-card tr.row-status-RECHAZADA td:first-child {
    box-shadow: inset 5px 0 0 #f44336;
}

/* Hover effects for colored rows */
.dashboard-card tr.row-status-NUEVA:hover td,
.dashboard-card tr.row-status-PENDIENTE:hover td {
    background: rgba(13, 71, 161, 0.6) !important;
}

.dashboard-card tr.row-status-EN_VALIDACION:hover td {
    background: rgba(255, 152, 0, 0.6) !important;
}

.dashboard-card tr.row-status-REQUIERE_AJUSTE:hover td {
    background: rgba(255, 152, 0, 0.6) !important;
}

.dashboard-card tr.row-status-NO_APROBADA:hover td {
    background: rgba(244, 67, 54, 0.6) !important;
}

.dashboard-card tr.row-status-APROBADA:hover td {
    background: rgba(76, 175, 80, 0.6) !important;
}

.dashboard-card tr.row-status-RECHAZADA:hover td {
    background: rgba(244, 67, 54, 0.6) !important;
}

.dashboard-card .btn-secondary {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.7) 0%, rgba(84, 91, 98, 0.7) 100%);
    border-color: rgba(108, 117, 125, 0.5);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 120px; /* Ajustado: un poco más abajo que 90px */
    position: relative;
    z-index: 1;
}

header {
    background-color: rgba(0, 0, 0, 0.9); /* Negro elegante */
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    padding: 1rem 0;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.header-transparent {
    background-color: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    position: absolute;
    width: 100%;
    top: 0;
    z-index: 10;
}

.brand {
    font-size: 1.8rem; /* Más grande */
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Navbar Logo specific class */
.navbar-logo {
    height: 70px; /* Logo más grande en la barra */
    vertical-align: middle;
    margin-right: 15px;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
}

.navbar-logo:hover {
    transform: scale(1.05);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px; /* Menos padding para pegar más a la izquierda */
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 50px; /* Pill shape */
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.btn-primary { 
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff; 
    border: none;
}

.btn-primary:hover { 
    filter: brightness(1.1);
}

.btn-secondary { 
    background: linear-gradient(135deg, var(--secondary) 0%, #545b62 100%);
    color: #fff; 
    border: none;
}
.btn-secondary:hover {
    filter: brightness(1.1);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #1e7e34 100%);
    color: #fff;
    border: none;
}
.btn-success:hover {
    filter: brightness(1.1);
}

.btn-sm {
    padding: 5px 15px;
    font-size: 0.85rem;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card {
    background: rgba(255, 255, 255, 0.92); /* Semitransparente para legibilidad */
    border: 1px solid rgba(222, 226, 230, 0.8);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
    color: #333;
    backdrop-filter: blur(5px);
}

@keyframes heartbeat-red {
    0% {
        box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37), 0 0 15px 0 rgba(220, 53, 69, 0);
    }
    50% {
        box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37), 0 0 40px 10px rgba(220, 53, 69, 0.5);
    }
    100% {
        box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37), 0 0 15px 0 rgba(220, 53, 69, 0);
    }
}

/* Estilo específico para la tarjeta de login - Glassmorphism */
.login-card {
    background: rgba(255, 255, 255, 0.2); /* Transparente */
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    padding: 1.5rem; /* Menos padding (menos largo) */
    margin-bottom: 2rem;
    color: #fff; /* Texto blanco por defecto */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 100%;
    max-width: 320px; /* Más angosto */
    text-align: center;
    animation: heartbeat-red 3s infinite ease-in-out;
}

.login-card h2 {
    color: #fff !important; /* Forzar blanco */
    margin-bottom: 1.5rem !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.login-card label {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.login-card input {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
}

.hero {
    text-align: center;
    padding: 2.5rem 2rem; /* Reduced padding */
    background: rgba(255, 255, 255, 0.2); /* Transparent */
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-width: 700px; /* Narrower */
    margin-left: auto;
    margin-right: auto;
    color: #fff;
    animation: heartbeat-red 3s infinite ease-in-out;
}

.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: #fff !important; /* Force white */
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.hero p {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    font-size: 1.1rem;
}

/* Glass info card for index */
.glass-info {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 2rem;
    color: #fff;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-width: 700px;
    margin: 0 auto 2rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.glass-info h3 {
    margin-top: 0;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.3);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.glass-info ol {
    padding-left: 1.5rem;
}

.glass-info ol li {
    margin-bottom: 0.8rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    color: #495057;
    box-sizing: border-box;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Login Logo Style */
.login-logo {
    display: block;
    max-width: 300px; /* Logo más grande */
    margin: 0 auto 1rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Navbar Brand Logo */
.navbar-brand-logo {
    height: 100px; /* Logo más pequeño (ajustado de 150px) */
    vertical-align: middle;
    margin-right: 10px;
}

.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    counter-reset: step;
    background: transparent;
    padding: 20px;
    border-radius: 8px;
    box-shadow: none;
    backdrop-filter: none;
    border: 1px solid rgba(0,0,0,0.05); /* Sutil borde para separar */
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
    color: var(--secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.step.active {
    color: var(--primary);
    font-weight: 700;
}

.step::before {
    counter-increment: step;
    content: counter(step);
    width: 32px;
    height: 32px;
    line-height: 32px;
    border-radius: 50%;
    background: #e9ecef;
    color: #495057;
    display: block;
    margin: 0 auto 10px;
    font-weight: 600;
}

.step.active::before {
    background: var(--primary);
    color: #fff;
}

.file-upload-area {
    border: 2px dashed #ddd;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.5);
}

.file-list-item {
    display: flex;
    justify-content: space-between;
    background: rgba(249, 249, 249, 0.9);
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 4px;
}

.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.status-NUEVA { background: #e3f2fd; color: #0d47a1; }
.status-EN_VALIDACION { background: #fff3e0; color: #e65100; }
.status-REQUIERE_AJUSTE { background: #fff3e0; color: #ef6c00; } /* Naranja */
.status-APROBADA { background: #e8f5e9; color: #1b5e20; }
.status-NO_APROBADA { background: #ffebee; color: #c62828; } /* Rojo */
.status-RECHAZADA { background: #ffebee; color: #b71c1c; }

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

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    background: rgba(255, 255, 255, 0.8);
}

.form-grid {
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 10px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .navbar { 
        flex-direction: column; 
        gap: 0.5rem; 
        padding: 10px;
    }
    
    .navbar > div {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        text-align: center;
    }

    .card-header-flex {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start; /* Or center? Center looks better usually */
        text-align: center;
    }
    
    .card-header-flex h2 {
        margin-bottom: 10px !important;
    }
    
    .card-header-flex .btn,
    .card-header-flex > div {
        width: 100%;
        justify-content: center;
    }

    .brand {
        margin-bottom: 5px;
    }

    .container {
        padding-top: 180px; /* Más espacio para navbar apilado */
        padding-left: 15px;
        padding-right: 15px;
    }

    .dashboard-card {
        padding: 1rem;
    }

    .dashboard-card table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .filter-toolbar {
        flex-direction: column;
        align-items: stretch !important;
    }

    .filter-toolbar > div,
    .filter-actions {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
    }

    .filter-toolbar input, 
    .filter-toolbar select, 
    .filter-toolbar button {
        width: 100% !important;
        margin-bottom: 10px;
    }

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

    .info-grid {
        grid-template-columns: 1fr !important;
    }

    .form-grid,
    .form-grid-3 {
        grid-template-columns: 1fr !important;
    }

    .navbar-brand-logo {
        height: 60px;
    }
    
    .login-logo {
        max-width: 200px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }
    
    .modal-content {
        width: 95%;
        padding: 1rem;
    }
    
    #preRequestForm .form-grid,
    #preRequestForm .checkbox-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Modal Personalizado */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.25);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: modalPop 0.3s ease-out;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Estilos para detail.php y layout responsivo */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Simétrico: 50% / 50% */
    gap: 30px; /* Mayor separación para evitar que se vean montados */
    align-items: start; /* Alineación superior */
}

@media (max-width: 992px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

.info-group {
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 5px;
}

.info-label {
    font-weight: bold;
    color: #444;
    font-size: 0.9rem;
}

.doc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(255,255,255,0.6);
    margin-bottom: 5px;
    border-radius: 4px;
}

.timeline-item {
    border-left: 2px solid #ddd;
    padding-left: 15px;
    margin-bottom: 15px;
    position: relative;
}

.timeline-item::before {
    content: '';
    width: 10px;
    height: 10px;
    background: #ccc;
    border-radius: 50%;
    position: absolute;
    left: -6px;
    top: 0;
}

.timeline-date {
    font-size: 0.8rem;
    color: #666;
}
