.create-doc-shell .form-container,
.create-doc-shell .table-container {
    background: rgba(255, 255, 255, 0.30);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    margin-bottom: 12px;
    padding: 12px;
    color: var(--nr-dark, #282B2D);
}

.create-doc-shell .form-container .row,
.create-doc-shell .table-container .row {
    margin: 0;
    padding-left: 15px;
    padding-right: 15px;
    text-align: center;
}

.create-doc-shell .form-label{
    text-align: center;
}

.create-doc-shell .form-control-date {
    text-align: center;
    max-height: 40px;
}

/* Selects principales del formulario (compactos y premium) */
.create-doc-shell .nr-doc-select,
.create-doc-shell #tipoCobro,
.create-doc-shell #tipoDescuento {
    min-height: 36px;
    height: 36px;
    padding: 4px 34px 4px 10px;
    border: 1px solid rgba(166, 8, 37, 0.28);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.90);
    color: var(--nr-dark, #282B2D);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.create-doc-shell .nr-doc-select:focus,
.create-doc-shell #tipoCobro:focus,
.create-doc-shell #tipoDescuento:focus {
    border-color: var(--nr-primary, #A60825);
    background-color: #fff;
    box-shadow: 0 0 0 0.18rem rgba(166, 8, 37, 0.16);
}

.create-doc-shell .nr-doc-select:hover,
.create-doc-shell #tipoCobro:hover,
.create-doc-shell #tipoDescuento:hover {
    border-color: rgba(166, 8, 37, 0.45);
}

.create-doc-shell .nr-doc-select--compact {
    min-height: 34px;
    height: 34px;
    padding-top: 3px;
    padding-bottom: 3px;
}

.accionColumn{
    max-width: 150px;
    background-color: wheat;
}

.create-doc-shell .table-container table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: #282b2d14;
    text-align: center;
}

.create-doc-shell .card-section {
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #dee2e6;
    text-align: center;
    background: #282b2d14;
}

.create-doc-shell .section-header {
    background: linear-gradient(135deg, var(--nr-primary-dark, #73020C), var(--nr-primary, #A60825));
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    text-align: left;
    color: var(--nr-accent, #F2E6D8);
    font-size: 0.875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.create-doc-shell h2.section-header {
    font-size: 0.95rem;
}

.create-doc-shell .search-select-container {
    position: relative;
    margin-bottom: 5px;
}

.create-doc-shell .search-input {
    width: 100%;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem 1rem;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.622);
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
    max-height: 40px;
}

.create-doc-shell .select-dropdown {
    position: absolute;
    top: 100%;
    color: #000;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.622);
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.create-doc-shell .select-option,
.create-doc-shell .select-option-proveedor,
.create-doc-shell .select-option-producto {
    padding: 9px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    background: rgba(255,255,255,0.80);
    color: var(--nr-dark, #282B2D);
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s;
}

.create-doc-shell .select-option:hover,
.create-doc-shell .select-option.selected {
    background: var(--nr-primary-alpha, rgba(166,8,37,0.14));
    color: var(--nr-primary-dark, #73020C);
    font-weight: 600;
}

.create-doc-shell #productosDropdown .select-option:hover,
.create-doc-shell #productosDropdown .select-option.selected {
    background: rgba(166, 8, 37, 0.24);
}

.create-doc-shell .select-option-producto:hover,
.create-doc-shell .select-option-producto.selected {
    background: var(--nr-primary-alpha, rgba(166,8,37,0.14));
    color: var(--nr-primary-dark, #73020C);
    font-weight: 600;
}

.create-doc-shell .select-option-proveedor:hover,
.create-doc-shell .select-option-proveedor.selected {
    background: var(--nr-primary-alpha, rgba(166,8,37,0.14));
    color: var(--nr-primary-dark, #73020C);
    font-weight: 600;
}

.create-doc-shell .btn-add {
    background: linear-gradient(135deg, var(--nr-primary), var(--nr-primary-dark, #73020C));
    color: var(--nr-accent, #F2E6D8);
    border: none;
    padding: 9px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.22s ease;
    width: 100%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.create-doc-shell .btn-add:hover {
    background: linear-gradient(135deg, var(--nr-primary-light, #C9394E), var(--nr-primary));
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(115,2,12,0.35);
    color: var(--nr-white, #fff);
}


.quantity-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    text-align: center;
}

.create-doc-shell .form__field {
    margin-bottom: 5px;
}


.text-danger {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    color: #dc3545;
    display: block;
}






/* Contenedor para la vista previa de imagen */
.imagen-preview-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 15px;
    margin-bottom: 10px;
}

#imagen-preview, #imagen-preview-update {
    display: flex;
    justify-content: center;
    margin: 0 auto;
    max-width: 300px;
    max-height: 300px;
    border-radius: 8px;
    overflow: hidden;
}

#file {
    display: none;
}

/* Mejorar el diseño responsivo para dispositivos móviles */
@media (max-width: 768px) {
    .form-check {
        gap: 5px;
    }
    
    .form-check .percent {
        width: 14px;
        height: 14px;
    }
    
    .form-check-label {
        font-size: 0.9rem;
    }
    
    /* Ajustar el padding del modal para móviles */
    .create-doc-shell {
        padding: 1rem;
    }
    
    /* Dar más espacio a los campos en móvil */
    .create-doc-shell .form__group {
        margin-bottom: 0.8rem;
    }
}

/* Mejora para pantallas muy pequeñas */
@media (max-width: 576px) {
    .ganancia-options {
        margin-right: 2px;
    }
    
    .form-check-label {
        font-size: 0.8rem;
    }
}



/* Upload de imagen */
.custum-file-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    border: 2px dashed #007bff;
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    width: 100%;
    transition: all 0.3s ease;
}


.custum-file-upload:hover {
    border-color: #0056b3;
    background-color: #e9f2fb;
}


#modalCrearProducto .modal-content {
    margin: 1.75rem auto;
    background: #51515180;
}

#btn-eliminar .btn-eliminar {
    color: rgb(0, 0, 0);
    border: none;
    padding: 2px;
    font-weight: bold;
    max-width: 50px;
    transition: transform 0.2s;
}

#tablaProductos td, #tablaProductos th {
    vertical-align: middle;
    padding: 6px 10px;
    background: linear-gradient(135deg, rgba(40,43,45,0.85), rgba(40,43,45,0.70));
    color: var(--nr-accent, #F2E6D8);
    font-size: 0.85rem;
}

#tablaProductosUpdate td,
#tablaProductosUpdate th {
    vertical-align: middle;
    padding: 6px 10px;
    background: linear-gradient(135deg, rgba(40,43,45,0.80), rgba(40,43,45,0.60));
    color: var(--nr-accent, #F2E6D8);
    font-size: 0.85rem;
}

.table-secondary td {
    background: linear-gradient(135deg, rgba(40,43,45,0.75), rgba(40,43,45,0.55));
    color: var(--nr-accent, #F2E6D8);
    font-size: 0.9rem;
    font-weight: 600;
}

/* crear producto */
#modalCrearProducto .modal-content {
    background: rgba(42,44,46,0.90) !important;
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.12) !important;
    color: var(--nr-accent, #F2E6D8);
}

.imagen-field{
    display: inline-flex;
    width: 100%;
    gap: 10px;
    height: 300px;
}

/* Contenedor para la vista previa de imagen */
.imagen-preview-container {
    display: flex;
    justify-content: center;
     width: 50%;
}

#imagen-preview, #imagen-preview-update {
    display: flex;
    justify-content: center;
    margin: 0 auto;
    max-width: 400px;
    min-width: 100px;
    max-height: 300px;
    border-radius: 8px;
    overflow: hidden;
    border: 3px dashed #282b2d6d;
}

.custum-file-upload {
    border: 3px dashed #282b2d6d;
    background-color: #f8f9fa;
    color: #000;
    border-radius: 10px;
    margin: auto;
    padding: 2rem;
    transition: all 0.3s ease;
    text-align: center;
    height: 300px;
    width: 40%;
    display: flex;
    align-content: center;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.custum-file-upload:hover {
    border-color: #0056b3;
    background-color: #e9f2fb;
    cursor: alias;
}


.create-doc-shell .form-check{
    display: flex;
    /* min-height: 1.5rem; */
    /* padding-left: 1.5em; */
    /* margin-bottom: .125rem; */
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.622);
    margin-top: 5px;
    gap: 20px;
    border-radius: 30px;
}


.create-doc-shell .percent:hover {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.create-doc-shell .form-check-label {
    color: #000;
    width: 20px;
    height: 20px;
}

/* ── Estilos específicos de _CreateProducto (el layout es el estándar
      nr-modal-form + nr-form-grid de modals.css) ───────────────────────── */
#createProductoForm .form-check {
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 10px;
    border-radius: 12px;
}

#createProductoForm .ganancia-options {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ── Compactación vertical específica para _CreateDoc ───────────────── */
.create-doc-shell {
    max-height: min(80vh, calc(100vh - 170px));
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
}

.create-doc-shell {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.create-doc-shell .form-container,
.create-doc-shell .table-container {
    margin-bottom: 8px;
    padding: 10px;
}

.create-doc-shell .section-header {
    padding: 6px 12px;
    margin-bottom: 8px;
}

.create-doc-shell .card-section {
    padding: 10px;
}

.create-doc-shell .form__field,
.create-doc-shell .search-input {
    margin-bottom: 4px;
    width: 100%;
}

.create-doc-shell .btn-add {
    padding: 7px 14px;
}

.create-doc-shell .form-buttons {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-top: 2px;
    padding: 10px 0 2px;
    background: linear-gradient(to top, rgba(210, 210, 210, 0.95), rgba(210, 210, 210, 0.25));
    backdrop-filter: blur(4px);
}

@media (max-width: 992px) {
    .create-doc-shell {
        max-height: calc(100vh - 135px);
        padding-right: 2px;
    }
}

/* Modificadores de modal para _CreateDoc.cshtml en todo el sistema */
.modal-dialog:has(.create-doc-shell) {
    max-width: 95vw !important;
    height: 90vh !important;
}

.modal-dialog:has(.create-doc-shell) .modal-content {
    height: 100% !important;
    display: flex;
    flex-direction: column;
}

.modal-dialog:has(.create-doc-shell) .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
}

/* ═══════════════════════════════════════════════════════════════════════
   _EditPresupuesto — estados según Model.RequiereFechaVencimiento
   (antes eran <style> inline con Razor; ahora se togglea la clase
   .nr-sin-vencimiento en el container desde la vista)
   ═══════════════════════════════════════════════════════════════════════ */
.nr-sin-vencimiento .fecha-vencimiento-containerUpdate {
    display: none;
}

.nr-sin-vencimiento .tipo-pago-center {
    margin-left: auto;
    margin-right: auto;
    float: none;
}

.nr-sin-vencimiento .control-label {
    display: block;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════
   COMPACTACIÓN FUERTE — el formulario de documentos debe entrar en
   pantalla sin scroll excesivo. Scoped a .create-doc-shell
   (_CreateDoc, _CreateCompra y _EditPresupuesto).
   ═══════════════════════════════════════════════════════════════════════ */

/* Toggle del Create (el del Update ya existe más arriba) */
.nr-sin-vencimiento .fecha-vencimiento-container {
    display: none;
}

.create-doc-shell {
    gap: 6px;
}

.create-doc-shell .form-container,
.create-doc-shell .table-container {
    margin-bottom: 4px;
    padding: 8px 10px;
}

.create-doc-shell .section-header,
.create-doc-shell h2.section-header {
    font-size: 0.85rem;
    padding: 4px 10px;
    margin: 0 0 6px;
}

.create-doc-shell .card-section {
    padding: 8px 10px;
    margin-bottom: 0;
}

.create-doc-shell .card-section h5 {
    font-size: 0.78rem;
    margin-bottom: 6px;
}

/* Inputs levemente más bajos SOLO en el form de documentos (densidad) */
.create-doc-shell .form__field,
.create-doc-shell .search-input {
    height: 38px;
    padding: 7px 12px !important;
    margin-bottom: 4px;
}

.create-doc-shell .btn-add {
    padding: 6px 12px;
    font-size: 0.8rem;
    margin-bottom: 4px !important;
}

/* Tabla de detalle densa */
.create-doc-shell .table th,
.create-doc-shell .table td {
    padding: 5px 8px;
    font-size: 0.8rem;
}

.create-doc-shell .table tfoot .form-select {
    padding: 4px 8px;
    font-size: 0.8rem;
}

/* Filas con menos aire */
.create-doc-shell .row {
    --bs-gutter-y: 0.25rem;
}

.create-doc-shell .mb-3 { margin-bottom: 0.4rem !important; }
.create-doc-shell .mb-2 { margin-bottom: 0.3rem !important; }

/* Botonera compacta */
.create-doc-shell .form-buttons {
    padding: 6px 0 2px;
}

/* ═══════════════════════════════════════════════════════════════════════
   REFINACIÓN UI — CreateDocs (_CreateDoc, _CreateCompra, _EditPresupuesto)
   ═══════════════════════════════════════════════════════════════════════ */

/* (1) Botones SIEMPRE al fondo del modal.
   Primero el shell llena toda la altura del modal-body (antes su max-height
   80vh dejaba un hueco debajo). Luego el form se vuelve columna flex que
   llena el shell y la botonera baja con margin-top:auto cuando el contenido
   es corto, quedando sticky al scrollear cuando es largo. */
.modal-dialog:has(.create-doc-shell) .create-doc-shell {
    height: 100%;
    max-height: none;
}
.create-doc-shell > form,
.create-doc-shell > #documentoForm {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    min-height: 0;
}
.create-doc-shell .form-buttons {
    margin-top: auto;
}

/* (2) Transición entre bloques más suave: entrada escalonada de cada sección
   al abrir el modal. */
.create-doc-shell > form > h2,
.create-doc-shell > form > .form-container,
.create-doc-shell > form > .table-container {
    animation: nr-fade-in-up 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.create-doc-shell > form > *:nth-child(2) { animation-delay: 0.05s; }
.create-doc-shell > form > *:nth-child(3) { animation-delay: 0.10s; }
.create-doc-shell > form > *:nth-child(4) { animation-delay: 0.15s; }
.create-doc-shell > form > *:nth-child(5) { animation-delay: 0.20s; }
.create-doc-shell .card-section,
.create-doc-shell .form-container {
    transition: box-shadow 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

/* (3) Primer título del documento: más grande y centrado. */
.create-doc-shell h2.create-doc-title {
    font-size: 1.2rem !important;
    text-align: center !important;
    justify-content: center;
    letter-spacing: 0.07em;
    padding: 10px 16px !important;
    margin-bottom: 10px !important;
}

/* (4) Select de productos/clientes: más opaco y dinámico. */
.create-doc-shell .search-input {
    background: rgba(255, 255, 255, 0.96);
}
.create-doc-shell .select-dropdown {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(166, 8, 37, 0.22);
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    /* Se re-dispara cada vez que el JS pasa el dropdown a display:block */
    animation: nr-fade-in-up 0.16s ease both;
}
.create-doc-shell .select-option,
.create-doc-shell .select-option-proveedor,
.create-doc-shell .select-option-producto {
    background: rgba(255, 255, 255, 0.97);
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, padding-left 0.15s ease;
}
.create-doc-shell .select-option:hover,
.create-doc-shell .select-option.selected,
.create-doc-shell .select-option-producto:hover,
.create-doc-shell .select-option-producto.selected,
.create-doc-shell .select-option-proveedor:hover,
.create-doc-shell .select-option-proveedor.selected {
    transform: translateX(4px);
    padding-left: 18px;
}
