/* ============================================================ */
/* VENTAS REGISTRO — FormTab: Ventas / Pestaña Registro         */
/* ============================================================ */

.ventas-reg-container {
    padding: 2rem 3rem;
    background-color: #f0f2f5;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* ---- Título + botón importar ---- */
.page-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-title {
    font-weight: 800;
    color: #1e2a38;
    letter-spacing: -0.5px;
    margin: 0;
    font-size: 1.6rem;
}

.btn-import-api {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1.5px dashed #94a3b8;
    border-radius: 10px;
    padding: 6px 16px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.btn-import-api:hover {
    background: #f0f2f5;
    border-color: #3B82F6;
    color: #3B82F6;
}

/* ============================================================ */
/* FORMULARIO                                                   */
/* ============================================================ */
.reg-form-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 16px;
    padding: 2rem;
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.reg-row {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

.reg-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.reg-field-wide {
    flex: 2;
}

.reg-field-narrow {
    flex: 0.6;
}

.field-label {
    display: flex;
    align-items: center;
    padding: 0 14px;
    height: 36px;
    font-size: 0.78rem;
    font-weight: 700;
    background: #f8fafc;
    border: 1px solid #e8edf2;
    border-bottom: none;
    color: #64748b;
    border-radius: 8px 8px 0 0;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.dark-label {
    background: #1e2a38;
    color: rgba(255, 255, 255, 0.9);
    border-color: #1e2a38;
}

.field-input {
    border: 1px solid #e8edf2;
    border-radius: 0 0 8px 8px;
    padding: 0 12px;
    height: 40px;
    font-size: 0.88rem;
    color: #1e2a38;
    background: #f8fafc;
    outline: none;
    width: 100%;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
}

.field-input:focus {
    background: #fff;
    border-color: #3B82F6;
}

/* ============================================================ */
/* SELECTOR DE MÉTODO DE ASIGNACIÓN                            */
/* ============================================================ */
.assignment-section {
    background: #f8fafc;
    border: 1px solid #e8edf2;
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.assignment-section-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.75rem;
}

.assignment-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.assign-opt {
    flex: 1;
    min-width: 180px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fff;
    border: 1.5px solid #e8edf2;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    text-align: left;
}

.assign-opt:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.assign-opt-active {
    border-color: #1e2a38 !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(30, 42, 56, 0.08);
}

.assign-opt-defer.assign-opt-active {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.assign-opt-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.icon-green {
    background: #dcfce7;
    color: #16a34a;
}

.icon-blue {
    background: #eff6ff;
    color: #3B82F6;
}

.icon-orange {
    background: #fffbeb;
    color: #d97706;
}

.assign-opt-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    flex: 1;
}

.assign-opt-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e2a38;
}

.assign-opt-sub {
    font-size: 0.7rem;
    color: #94a3b8;
}

.assign-check {
    font-size: 0.9rem;
}

/* ============================================================ */
/* PANELES DE INSTANCIA                                         */
/* ============================================================ */
.instance-panel {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    border-radius: 10px;
    padding: 14px 18px;
    flex-wrap: wrap;
}

.panel-fifo {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #16a34a;
}

.panel-manual {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid #3B82F6;
}

.panel-defer {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
}

.panel-badge {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    margin-top: 2px;
    flex-shrink: 0;
}

.badge-green {
    background: #16a34a;
    color: #fff;
}

.badge-blue {
    background: #3B82F6;
    color: #fff;
}

.badge-orange {
    background: #f59e0b;
    color: #fff;
}

/* ---- Fifo/Manual: grilla de datos ---- */
.instance-info-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    flex: 1;
}

.iinfo-row {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 0.82rem;
}

.iinfo-row-full {
    flex-basis: 100%;
}

.iinfo-label {
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
}

.iinfo-val {
    color: #1e2a38;
    font-weight: 700;
}

/* ---- Desglose de utilidad ---- */
.utilidad-desglose {
    flex-basis: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 4px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.desglose-item {
    font-size: 0.76rem;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.desglose-sep {
    font-size: 0.8rem;
    font-weight: 700;
    color: #94a3b8;
}

.desglose-total {
    font-size: 0.82rem;
    font-weight: 800;
}

/* ---- Manual: área de búsqueda ---- */
.manual-search-area {
    flex: 1;
}

.manual-search-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.scan-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    height: 40px;
    background-color: #ffffff;
    flex: 1;
}

.scan-input-box {
    border: none;
    outline: none;
    flex: 1;
    padding: 0 0.5rem;
    font-size: 0.85rem;
    font-family: inherit;
    background: transparent;
    color: #1e2a38;
}

.btn-buscar-inst {
    background: #3B82F6;
    border: none;
    border-radius: 8px;
    color: #fff;
    padding: 0 18px;
    height: 40px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.13s;
    white-space: nowrap;
}

.btn-buscar-inst:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.manual-hint {
    font-size: 0.78rem;
    color: #64748b;
    margin: 8px 0 0 0;
}

/* ---- Diferir: cuerpo ---- */
.defer-body {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1;
}

.defer-icon-wrap {
    flex-shrink: 0;
}

.defer-icon {
    width: 42px;
    height: 42px;
    background: #fde68a;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #92400e;
}

.defer-text {
    flex: 1;
}

.defer-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #92400e;
    margin: 0 0 4px 0;
}

.defer-sub {
    font-size: 0.78rem;
    color: #78350f;
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.defer-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.defer-tag {
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid #fde68a;
    border-radius: 20px;
    padding: 3px 10px;
    color: #78350f;
    white-space: nowrap;
}

/* ============================================================ */
/* ACCIONES                                                     */
/* ============================================================ */
.reg-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 0.75rem;
    border-top: 1px solid #e8edf2;
    margin-top: 0.25rem;
}

.btn-cancel {
    background: transparent;
    border: 1.5px solid #e8edf2;
    border-radius: 10px;
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

.btn-cancel:hover {
    background: #f0f2f5;
}

.btn-save {
    background: #1e2a38;
    border: none;
    border-radius: 10px;
    padding: 8px 24px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(30, 42, 56, 0.25);
}

.btn-save:hover {
    background: #0f1a24;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(30, 42, 56, 0.32);
}

/* ============================================================ */
/* MODULE NAV + FORMTAB TABS                                   */
/* ============================================================ */
.module-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.btn-back-dash {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #1e2a38;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.btn-back-dash:hover {
    background: #f0f2f5;
    border-color: #94a3b8;
}

.module-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
}

.module-tag {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.tag-sells {
    background: #dcfce7;
    color: #15803d;
}

.breadcrumb-current {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1e2a38;
}

.flow-hint {
    margin-left: auto;
    font-size: 0.72rem;
    color: #64748b;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px 12px;
    white-space: nowrap;
    transition: color 0.2s;
}

.formtab-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e2e8f0;
}

.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 8px 18px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    border-radius: 6px 6px 0 0;
    font-family: inherit;
}

.tab-btn:hover {
    color: #1e2a38;
    background: #f8fafc;
}

.tab-btn.active {
    color: #1e2a38;
    border-bottom-color: #1e2a38;
}