:root { 
    --primary: #2c3e50; 
    --accent: #3498db; 
    --success: #27ae60; 
    --dark: #121212; 
}

body { 
    font-family: 'Segoe UI', sans-serif; 
    margin: 0; 
    display: flex; 
    height: 100vh; 
    background: var(--dark); 
    color: #333; 
    overflow: hidden; 
}

#login-screen {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: #1a1a1a; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 20000;
}

.login-box {
    background: white; 
    padding: 40px; 
    border-radius: 15px; 
    width: 350px; 
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

#main-app { 
    display: none; 
    height: 100vh; 
    width: 100%; 
}

.sidebar { 
    width: 380px; 
    min-width: 380px; 
    padding: 20px; 
    background: #fdfdfd; 
    overflow-y: auto; 
    box-shadow: 5px 0 15px rgba(0,0,0,0.5); 
    z-index: 10; 
    border-right: 1px solid #ddd; 
    box-sizing: border-box;
}

.header-container {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    border-bottom: 2px solid var(--accent); 
    padding-bottom: 15px; 
    margin-bottom: 25px;
}

.logo-sidebar { 
    max-width: 120px; 
    height: auto; 
    display: block; 
}

.field { 
    margin-bottom: 15px; 
}

label { 
    display: block; 
    font-weight: 700; 
    font-size: 0.85em; 
    margin-bottom: 4px; 
    color: #555; 
}

input { 
    width: 100%; 
    padding: 10px; 
    border: 1px solid #ccc; 
    border-radius: 6px; 
    box-sizing: border-box; 
    transition: 0.2s; 
}

input:focus { 
    border-color: var(--accent); 
    outline: none; 
}

.grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 10px; 
}

.helper { 
    font-size: 0.75em; 
    color: #7f8c8d; 
    margin-top: 3px; 
    line-height: 1.2; 
}

.btn { 
    border: none; 
    padding: 14px; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: bold; 
    width: 100%; 
    margin-top: 10px; 
    transition: 0.3s; 
}

.btn-preview { 
    background: var(--accent); 
    color: white; 
}

.btn-download { 
    background: var(--success); 
    color: white; 
    display: none; 
}

.preview-area { 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
    background: #1e1e1e; 
    padding: 20px; 
    overflow: hidden; 
}

iframe { 
    width: 100%; 
    height: 100%; 
    border-radius: 10px; 
    border: none; 
    background: #fff; 
}

#placeholder { 
    margin: auto; 
    color: #666; 
    font-size: 1.2em; 
    text-align: center; 
}

#modalAutorizacion, #modalCambioPass {
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.9); 
    z-index: 9999; 
    justify-content: center; 
    align-items: center;
    backdrop-filter: blur(8px);
}

.modal-box { 
    background: #fff; 
    padding: 30px; 
    border-radius: 12px; 
    width: 320px; 
    text-align: center; 
}

.input-codigo { 
    font-size: 30px; 
    width: 100%; 
    text-align: center; 
    letter-spacing: 8px; 
    margin: 20px 0; 
    border: 2px solid var(--accent); 
    border-radius: 8px; 
    padding: 5px; 
}

#contenedor-bitacora {
    display: none; 
    background: white; 
    border-radius: 10px; 
    height: 100%;
    position: relative;
    overflow: hidden;
}

.tabla-scroll {
    height: calc(100% - 80px);
    overflow-y: auto;
    position: relative;
}

#tabla-bitacora {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
    text-align: left;
}

#tabla-bitacora thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #2c3e50;
    color: white;
}

#tabla-bitacora thead th {
    padding: 15px 10px;
    font-weight: 600;
    border-right: 1px solid rgba(255,255,255,0.1);
    white-space: nowrap;
}

#tabla-bitacora thead th:last-child {
    border-right: none;
}

#tabla-bitacora tbody td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
}

.header-superior {
    padding: 20px 20px 15px 20px;
    border-bottom: 2px solid var(--accent);
    background: white;
}

/* ============================================
   MODAL DE PROGRESO
   ============================================ */
#modalProgreso {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}

#modalProgreso .modal-box {
    background: white;
    padding: 35px;
    border-radius: 16px;
    width: 420px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#barra-progreso {
    transition: width 0.5s ease;
    border-radius: 10px;
}

#modalProgreso .modal-box button:hover {
    background: #c0392b;
    transform: scale(1.02);
}

/* ============================================
   MODAL DE PROGRESO
   ============================================ */
#modalProgreso {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}

#modalProgreso .modal-box {
    background: white;
    padding: 35px;
    border-radius: 16px;
    width: 420px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#barra-progreso {
    transition: width 0.5s ease;
    border-radius: 10px;
}

#modalProgreso .modal-box button:hover {
    background: #c0392b;
    transform: scale(1.02);
}