/* ===== RESET Y BASE ===== */
#smart-recibo-form * {
    box-sizing: border-box;
    margin: 0;
    padding: 4;
}

.smart-rc-container {
    max-width: 1400px;
    margin: 30px auto;
    font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
}

#smart-recibo-form {
    background: #f8fafc;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(74, 90, 157, 0.15);
    border: 1px solid #a2accc;
}


/* ===== GRIDS ===== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

/* ===== SECCIONES ===== */
.seccion {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(74, 90, 157, 0.08);
    border: 2px solid #a2accc;
}

.seccion h3 {
    margin: 0 0 20px 0;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 10px;
    border-bottom: 3px solid #3db5b6;
}

/* ===== CAMPOS ===== */
.campo {
    margin-bottom: 15px;
}

.campo label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #4a5a9d;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

#smart-recibo-form input[type="text"],
#smart-recibo-form input[type="number"],
#smart-recibo-form input[type="date"],
#smart-recibo-form select,
#smart-recibo-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #a2accc;
    border-radius: 10px;
    font-size: 14px;
    background: white;
    transition: all 0.2s;
    color: #333;
}

#smart-recibo-form input:focus,
#smart-recibo-form select:focus,
#smart-recibo-form textarea:focus {
    border-color: #3db5b6;
    box-shadow: 0 0 0 3px rgba(61, 181, 182, 0.15);
    outline: none;
}

#smart-recibo-form input[readonly] {
    background: #f0f3fa;
    border-color: #a2accc;
    color: #4a5a9d;
    font-weight: 600;
}

/* ===== TABLA DE DOCUMENTOS ===== */
.tabla-documentos {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #a2accc;
}

.tabla-documentos th {
    background: #4a5a9d;
    color: white;
    padding: 12px 8px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tabla-documentos td {
    border: 1px solid #a2accc;
    padding: 8px;
    vertical-align: middle;
}

.tabla-documentos td.centrado {
    text-align: center;
}

.tabla-documentos input {
    width: 100%;
    padding: 6px;
    border: 2px solid #a2accc;
    border-radius: 6px;
    font-size: 12px;
}

.tabla-documentos input:focus {
    border-color: #3db5b6;
}

.tabla-documentos input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0 auto;
    cursor: pointer;
    accent-color: #3db5b6;
}

.accion-col {
    text-align: center;
    width: 50px;
}

/* ===== PAGO GRID 5 COLUMNAS ===== */
.pago-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.columna-pago {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px 15px;
    border: 2px solid #a2accc;
    box-shadow: 0 2px 8px rgba(74, 90, 157, 0.05);
}

.columna-pago h5 {
    color: #4a5a9d;
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #3db5b6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.columna-pago select,
.columna-pago input {
    width: 100%;
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 2px solid #a2accc;
    border-radius: 8px;
    font-size: 13px;
    background: white;
}

.columna-pago select:focus,
.columna-pago input:focus {
    border-color: #3db5b6;
}

.columna-pago label {
    display: block;
    font-size: 12px;
    color: #4a5a9d;
    margin-bottom: 3px;
    font-weight: 500;
}

.valor-pago label {
    font-weight: 700;
    color: #4a5a9d;
    margin-top: 10px;
}

/* ===== BOTONES ===== */
.btn-agregar-fila {
    background: linear-gradient(135deg, #3db5b6, #2a9b9c);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    margin: 15px 0;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(61, 181, 182, 0.3);
    border: 1px solid #4a5a9d;
}

.btn-agregar-fila:hover {
    background: linear-gradient(135deg, #4ac5c6, #3db5b6);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(61, 181, 182, 0.4);
}

.btn-eliminar-fila {
    background: #4a5a9d;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-eliminar-fila:hover {
    background: #3b4a8a;
    transform: scale(1.1);
}

.btn-guardar {
    background: linear-gradient(135deg, #4a5a9d, #3b4a8a);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    flex: 1;
    transition: all 0.2s;
    box-shadow: 0 8px 20px rgba(74, 90, 157, 0.3);
    border: 1px solid #3db5b6;
}

.btn-guardar:hover {
    background: linear-gradient(135deg, #5a6aad, #4a5a9d);
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(74, 90, 157, 0.4);
}

.btn-limpiar {
    background: #a2accc;
    color: #4a5a9d;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    flex: 1;
    transition: all 0.2s;
    border: 1px solid #4a5a9d;
}

.btn-limpiar:hover {
    background: #b2bcdc;
    color: #3b4a8a;
    transform: translateY(-2px);
}

.acciones {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* ===== SUBTOTALES Y TOTALES ===== */
.subtotal-documento,
.total-pago {
    text-align: right;
    margin-top: 20px;
    padding: 15px 20px;
    background: #f0f3fa;
    border-radius: 12px;
    border: 2px dashed #a2accc;
}

.subtotal-documento strong,
.total-pago strong {
    font-size: 16px;
    color: #4a5a9d;
    margin-right: 15px;
}

.total-documentos,
.total-pago-input {
    width: 200px;
    padding: 10px;
    font-weight: 700;
    font-size: 18px;
    border: 2px solid #3db5b6;
    border-radius: 10px;
    background: white;
    color: #4a5a9d;
}

.total-pago-input {
    border-color: #4a5a9d;
}

.totales {
    background: linear-gradient(135deg, #4a5a9d, #3b4a8a);
    color: white;
    border: 2px solid #3db5b6;
}

.totales label {
    color: #a2accc;
}

.totales input {
    background: rgba(255,255,255,0.1);
    border-color: #a2accc;
    color: white;
    font-weight: 700;
}

.totales input:focus {
    border-color: #3db5b6;
}

/* ===== NOTAS Y DETALLES ===== */
.nota {
    background: #e8ebf5;
    border-left: 6px solid #3db5b6;
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 10px;
    color: #4a5a9d;
    font-size: 14px;
    border: 1px solid #a2accc;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #4a5a9d;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3db5b6;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .pago-grid-5,
    .grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .recibo-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .recibo-detalle {
        width: 100%;
    }
    .pago-grid-5,
    .grid-5,
    .grid-4,
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .acciones {
        flex-direction: column;
    }
    .tabla-documentos {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* ===== UTILIDADES ===== */
.text-primary { color: #4a5a9d; }
.text-secondary { color: #3db5b6; }
.bg-primary { background-color: #4a5a9d; }
.bg-secondary { background-color: #3db5b6; }
.border-primary { border-color: #4a5a9d; }
.border-secondary { border-color: #3db5b6; }

/* ===== MÚLTIPLES PAGOS ===== */
.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-agregar-pago {
    background: linear-gradient(135deg, #3db5b6, #2a9b9c);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(61, 181, 182, 0.3);
    border: 1px solid #4a5a9d;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-agregar-pago:hover {
    background: linear-gradient(135deg, #4ac5c6, #3db5b6);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(61, 181, 182, 0.4);
}

.bloque-pago {
    background: #ffffff;
    border: 2px solid #a2accc;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(74, 90, 157, 0.05);
    position: relative;
}

.pago-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3db5b6;
}

.pago-header h4 {
    color: #4a5a9d;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.btn-eliminar-pago {
    background: #4a5a9d;
    color: white;
    border: none;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-eliminar-pago:hover {
    background: #3b4a8a;
    transform: scale(1.02);
}

.total-pagos {
    text-align: right;
    margin-top: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f0f3fa, #ffffff);
    border-radius: 12px;
    border: 2px solid #3db5b6;
}

.total-pagos strong {
    font-size: 16px;
    color: #4a5a9d;
    margin-right: 15px;
}

.total-pagos-input {
    width: 200px;
    padding: 10px;
    font-weight: 700;
    font-size: 18px;
    border: 2px solid #4a5a9d;
    border-radius: 10px;
    background: white;
    color: #4a5a9d;
}
/* ===== HEADER PROFESIONAL ===== */
.recibo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #4a5a9d 0%, #3b4a8a 100%);
    color: white;
    padding: 25px 30px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(74, 90, 157, 0.3);
    border: 1px solid #a2accc;
    flex-wrap: wrap;
    gap: 20px;
}

.empresa-info h2 {
    font-size: 32px;
    margin: 0 0 5px 0;
    color: white;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.empresa-info p {
    color: #a2accc;
    margin: 0;
    font-size: 14px;
    font-weight: 300;
}

.recibo-detalle {
    display: flex;
    gap: 20px;
    background: rgba(255,255,255,0.1);
    padding: 15px 25px;
    border-radius: 12px;
    border: 1px solid #a2accc;
    flex-wrap: wrap;
}

.recibo-detalle .campo {
    margin: 0;
    min-width: 120px;
}

.recibo-detalle label {
    color: #a2accc;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

.recibo-detalle input {
    background: rgba(255,255,255,0.15);
    border: 2px solid #a2accc;
    color: white;
    font-weight: 600;
    font-size: 16px;
    padding: 8px 12px;
    border-radius: 8px;
    width: 100%;
}

.recibo-detalle input:focus {
    border-color: white;
    background: rgba(255,255,255,0.2);
    outline: none;
}

/* Campo RV especial */
#codigo_rv {
    background: #fff3e0 !important;
    border-color: #ff9800 !important;
    color: #4a5a9d !important;
    font-weight: bold;
    text-align: center;
}

.recibo-detalle .campo:has(#codigo_rv) label {
    color: #ff9800 !important;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
    .recibo-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .recibo-detalle {
        flex-direction: column;
        width: 100%;
    }
    
    .recibo-detalle .campo {
        width: 100%;
    }
}

/* Estilo para el selector de tipo de documento */
.tipo-documento {
    width: 100%;
    padding: 8px;
    border: 2px solid #a2accc;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background-color: white;
    cursor: pointer;
}

.tipo-documento option {
    font-weight: 500;
}

/* Estilo para campos deshabilitados */
.tabla-documentos input:disabled,
.tabla-documentos select:disabled {
    background-color: #f0f0f0;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Mejorar visualización de checkboxes deshabilitados */
.tabla-documentos input[type="checkbox"]:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
/* ===== RADIO BUTTONS GLOBALES ===== */
.tipo-documento-global {
    background: #f0f3fa;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    border: 2px solid #4a5a9d;
}

.tipo-documento-global h3 {
    margin: 0 0 15px 0;
    color: #4a5a9d;
    font-size: 16px;
}

.radio-group {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 15px;
    background: white;
    border-radius: 30px;
    border: 2px solid #a2accc;
    transition: all 0.2s;
}

.radio-option:hover {
    border-color: #3db5b6;
    background: #e8ebf5;
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #3db5b6;
    margin: 0;
}

.radio-label {
    font-size: 14px;
    color: #4a5a9d;
    font-weight: 500;
}

.radio-label strong {
    font-size: 16px;
    color: #3db5b6;
}

/* Responsive */
@media (max-width: 768px) {
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
}

/* ===== BLOQUES DE DOCUMENTOS ===== */
.bloques-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.botones-agregar-bloque {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-bloque {
    padding: 10px 20px;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-bloque.factura {
    background: #4a5a9d;
    color: white;
}

.btn-bloque.nota {
    background: #ff9800;
    color: white;
}

.btn-bloque.nd {
    background: #3db5b6;
    color: white;
}

.btn-bloque:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* ===== BLOQUE INDIVIDUAL ===== */
.bloque-documento {
    background: white;
    border: 2px solid #a2accc;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(74, 90, 157, 0.08);
}

.bloque-documento.factura {
    border-left: 6px solid #4a5a9d;
}

.bloque-documento.nota {
    border-left: 6px solid #ff9800;
}

.bloque-documento.nd {
    border-left: 6px solid #3db5b6;
}

.bloque-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e4f0;
}

.bloque-header h4 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bloque-icono {
    font-size: 20px;
}

.bloque-titulo {
    color: #4a5a9d;
    font-weight: 700;
}

.btn-eliminar-bloque {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-eliminar-bloque:hover {
    background: #c82333;
}

.btn-agregar-fila-bloque {
    background: #f0f3fa;
    color: #4a5a9d;
    border: 2px dashed #a2accc;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    width: 100%;
    text-align: center;
    transition: all 0.2s;
}

.btn-agregar-fila-bloque:hover {
    background: #e0e4f0;
    border-color: #4a5a9d;
}

.totales-documentos {
    margin-top: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #4a5a9d, #3b4a8a);
    border-radius: 12px;
    color: white;
}

.total-general {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
}

.total-general strong {
    font-size: 18px;
}

.total-documentos {
    width: 200px;
    padding: 10px;
    font-size: 18px;
    font-weight: 700;
    border: 2px solid #3db5b6;
    border-radius: 10px;
    background: white;
    color: #4a5a9d;
    text-align: right;
}
/* ===== CAMPOS AUTOCOMPLETADOS ===== */
.campo-autocompletado {
    background-color: #f8f8f8 !important;
    border-color: #ddd !important;
    color: #555 !important;
    font-size: 12px !important;
    cursor: default;
}

.campo-autocompletado:focus {
    background-color: #fff !important;
    border-color: #3db5b6 !important;
    color: #333 !important;
}

/* Grid de 1 columna */
.grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Ajuste para campos de solo lectura */
input[readonly] {
    background-color: #f5f5f5;
    border-color: #ddd;
    color: #666;
}

/* Mejora visual para la nota */
.seccion p em {
    color: #4a5a9d;
    font-style: normal;
    font-weight: 500;
}