/* ==========================================================================
   CONFIGURACIÓN BASE - COOTRANSLABOYANA INTERACTIVO
   ========================================================================== */
:root {
    --bg-paper: #ffffff;
    --input-bg: transparent;
    --check-bg: #fff;
    --border-color: #0f5132;
    --text-main: #0f5132;
    --ink-pen: #1a237e;
}

body {
    font-family: 'Arial Narrow', Arial, sans-serif;
    font-size: 8.5px;
    text-transform: uppercase;
    background-color: #555;
    margin: 0;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* PANEL DE ACCIONES (PANTALLA) */
.control-panel {
    background: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    display: flex;
    gap: 15px;
    align-items: center;
    font-family: system-ui, sans-serif;
    text-transform: none;
    font-weight: bold;
}
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}
.btn-white { background: #e0e0e0; color: #333; border: 1px solid #ccc; }
.btn-pink { background: #f8bbd0; color: #880e4f; }
.btn-print { background: #2e7d32; color: #fff; }
.btn-secondary { background: #e0e0e0; color: #333; }
.btn-primary { background: #2e7d32; color: #fff; }
.btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* HOJA DE TRABAJO */
.hoja-talonario {
    width: 800px;
    background-color: var(--bg-paper);
    padding: 20px;
    border: 2px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    box-sizing: border-box;
    position: relative;
}

/* CONTROLES DE ESCRITURA INVISIBLE (SE ADAPTAN AL DISEÑO) */
.hoja-talonario input[type="text"], .hoja-talonario input[type="date"] {
    background: var(--input-bg);
}
input[type="text"], input[type="date"] {
    border: none;
    background: var(--input-bg);
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    color: var(--ink-pen);
    font-weight: bold;
    width: 100%;
    box-sizing: border-box;
    padding: 0 2px;
    text-transform: uppercase;
}
input[type="text"]:focus, input[type="date"]:focus {
    background-color: rgba(26, 35, 126, 0.05);
    outline: none;
}

input[type="date"] {
    font-size: 10px;
    text-align: center;
}

/* CASILLAS DE VERIFICACIÓN ESTILO INTERACTIVO MANUAL */
.check-container {
    position: relative;
    width: 100%;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.check-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}
.checkmark {
    width: 18px;
    height: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--check-bg);
    display: inline-block;
    position: relative;
}
.check-container input[type="checkbox"]:checked ~ .checkmark::after {
    content: "X";
    position: absolute;
    color: var(--ink-pen);
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    font-weight: bold;
    top: -2px;
    left: 4px;
}

/* TEXTOS FIJOS LITOGRAFÍA */
.font-litografia-header {
    font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text-main);
    line-height: 1;
    
    display: inline-block;
    transform: scaleX(1.15);
    transform-origin: left center;
}
.text-header-small {
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    color: var(--text-main);
    line-height: 12px;
}
.numero-rojo {
    color: #d32f2f;
    font-size: 24px;
    font-weight: bold;
    font-family: Arial, sans-serif;
    text-align: center;
}

/* TABLAS */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 3px;
}
th, td {
    border: 1px solid var(--border-color);
    padding: 2px 4px;
    vertical-align: middle;
    box-sizing: border-box;
}
.label-litografia {
    color: var(--text-main);
    font-weight: bold;
    font-size: 10px;
    letter-spacing: -0.1px;
    white-space: nowrap;
}
.flex-field {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
}
.linea-relleno {
    border-bottom: 1px solid var(--text-main);
    flex-grow: 1;
    margin-left: 4px;
    display: flex;
    align-items: center;
}
.centrado { text-align: center; }

/* REVISIÓN DE DISEÑO */
.area-revision-grid { display: flex; gap: 5px; width: 100%; }
.columna-izq, .columna-der { flex: 1; display: flex; flex-direction: column; }

.texto-vertical {
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    text-align: center;
    font-weight: bold;
    color: var(--text-main);
    font-size: 9px;
    background-color: rgba(15, 81, 50, 0.04);
    width: 15px;
}

.modulo-observaciones-fechas {
    margin-top: auto;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}
.bloque-lineas-observacion { padding: 4px; border-bottom: 1px solid var(--border-color); }
.linea-pautada {
    border-bottom: 1px dotted var(--border-color);
    height: 15px;
    margin-top: 2px;
    display: flex;
    align-items: center;
}

/* FIRMAS */
.footer-firmas { display: flex; justify-content: space-between; margin-top: 100px; padding: 0 30px; }
.contenedor-firma { width: 40%; text-align: center; }
.raya-firma { border-top: 1px solid var(--border-color); margin-bottom: 4px; }
.canvas-firma {
    background: transparent;
    cursor: crosshair;
    display: block;
    margin: 0 auto;
    touch-action: none;
}
.btn-limpiar-firma {
    margin-top: 3px;
    padding: 2px 8px;
    font-size: 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    text-transform: uppercase;
    font-family: inherit;
    font-weight: bold;
    border-radius: 2px;
}
.btn-limpiar-firma:hover {
    background: rgba(15, 81, 50, 0.1);
}
.texto-imprenta-vertical {
    position: absolute; right: 2px; bottom: 60px;
    writing-mode: vertical-lr; transform: rotate(180deg);
    font-size: 6px; color: var(--text-main); font-family: Arial, sans-serif; opacity: 0.8;
}
.login-overlay {
    display: flex;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #555;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    width: 350px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.login-box h3 { margin-top: 0; color: var(--text-main); text-align: center; }
.login-box p { font-size: 13px; text-align: center; }
.login-box input {
    width: 100%; padding: 12px; margin: 20px 0;
    font-size: 16px; border: 2px solid var(--border-color);
    border-radius: 4px; text-transform: none;
}
.error-msg {
    text-align: center; color: #d32f2f;
    font-size: 12px; height: 20px; margin-bottom: 10px;
}
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-box {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.placa-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-top: none;
    max-height: 150px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: none;
}

.placa-dropdown-item {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 10px;
    text-transform: uppercase;
}

.placa-dropdown-item:hover {
    background: rgba(15, 81, 50, 0.1);
}

.placa-dropdown-item small {
    display: block;
    color: #666;
    font-size: 9px;
    text-transform: none;
}

input[type="text"]#placaInput {
    flex-grow: 1;
    margin-left: 4px;
}
.contenedor-firma1 {
    position: relative;
    top: -80px;
}
.canvas-firma.fija {
    background: transparent;
}
.canvas-firma.fija + .btn-limpiar-firma {
    display: none;
}

/* ==========================================================================
    REGLAS DE RECTIFICACIÓN PARA IMPRESIÓN LIMPIA (CERO CONTROLES VISIBLES)
    ========================================================================== */
@media print {
    body { background: #fff; padding: 0; margin: 0; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    .control-panel { display: none; }
    #loginOverlay { display: none !important; }
    .hoja-talonario { width: 100%; border: 2px solid #0f5132 !important; box-shadow: none; padding: 10px; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    th, td, .modulo-observaciones-fechas { border-color: #0f5132 !important; }
    .linea-pautada { border-bottom-color: #0f5132 !important; }
    .label-litografia, .texto-vertical, .font-litografia-header { color: #0f5132 !important; }
    input[type="text"], input[type="date"] { color: #1a237e !important; background: var(--input-bg) !important; }
    .check-container input[type="checkbox"]:checked ~ .checkmark::after { color: #1a237e !important; }
    .checkmark { background-color: var(--check-bg) !important; }
    input[type="date"]::-webkit-calendar-picker-indicator { display: none; -webkit-appearance: none; }
    .canvas-firma { border-color: transparent !important; background: transparent !important; }
    .btn-limpiar-firma { display: none; }
}