﻿.erp-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, .72);
    backdrop-filter: blur(4px);
    z-index: 2000;
}

.erp-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    width: min(680px, calc(100vw - 2rem));
    max-height: 90vh;
    overflow: auto;
    transform: translate(-50%, -50%);
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,.08);
    background: linear-gradient(180deg, rgba(15,23,42,.98), rgba(8,15,30,.98));
    box-shadow: 0 28px 80px rgba(0,0,0,.45);
    z-index: 2001;
}

.erp-modal--xl {
    width: min(1080px, calc(100vw - 2rem));
}

.erp-modal__header,
.erp-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem 1.1rem;
}

.erp-modal__header {
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.erp-modal__footer {
    border-top: 1px solid rgba(255,255,255,.08);
    justify-content: flex-end;
    flex-wrap: wrap;
}

.erp-modal__header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #F8FAFC;
}

.erp-modal__body {
    padding: 1rem 1.1rem 1.15rem;
}

.erp-modal__close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 0;
    cursor: pointer;
    color: #CBD5E1;
    background: rgba(255,255,255,.05);
}

.erp-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.erp-form-grid--product {
    margin-bottom: 1rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

    .field label {
        font-size: .92rem;
        font-weight: 700;
        color: #CBD5E1;
    }

.erp-input {
    width: 100%;
    min-height: 46px;
    padding: .82rem .95rem;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.09);
    outline: none;
    background: rgba(15,23,42,.7);
    color: #F8FAFC;
    font-size: .96rem;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

    .erp-input:focus {
        border-color: rgba(96,165,250,.6);
        box-shadow: 0 0 0 4px rgba(59,130,246,.12);
        background: rgba(15,23,42,.92);
    }

.erp-btn {
    min-height: 46px;
    border: 0;
    border-radius: 14px;
    padding: .82rem 1rem;
    font-size: .95rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

    .erp-btn:hover {
        transform: translateY(-1px);
    }

.erp-btn--primary {
    color: #fff;
    background: linear-gradient(135deg, #8B5CF6, #3B82F6);
    box-shadow: 0 14px 28px rgba(59,130,246,.18);
}

.erp-btn--ghost {
    color: #E2E8F0;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
}

.erp-btn--sm {
    min-height: 36px;
    padding: .45rem .75rem;
    font-size: .84rem;
    border-radius: 10px;
}

.erp-table-wrap {
    overflow: auto;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.08);
}

.erp-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
    background: rgba(2,6,23,.45);
}

    .erp-table thead th {
        padding: .85rem .8rem;
        text-align: left;
        font-size: .84rem;
        font-weight: 800;
        color: #CBD5E1;
        background: rgba(255,255,255,.04);
        border-bottom: 1px solid rgba(255,255,255,.08);
    }

    .erp-table tbody td {
        padding: .85rem .8rem;
        border-bottom: 1px solid rgba(255,255,255,.06);
        color: #E2E8F0;
        vertical-align: middle;
    }

    .erp-table tbody tr:hover {
        background: rgba(255,255,255,.03);
    }

.empty-cell {
    text-align: center;
    color: #94A3B8;
    padding: 1.25rem !important;
}

.selected-product-box {
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    margin-bottom: 1rem;
}

.selected-product-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #F8FAFC;
    margin-bottom: .5rem;
}

.selected-product-meta {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    color: #94A3B8;
    font-size: .88rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.option-tile {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    min-height: 92px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    color: #F8FAFC;
    font-weight: 800;
    cursor: pointer;
    padding: 1rem;
    text-align: left;
}

.option-tile__title {
    font-size: .95rem;
    font-weight: 800;
}

.option-tile__desc {
    font-size: .8rem;
    color: #94A3B8;
    font-weight: 500;
}

.help-list {
    display: flex;
    flex-direction: column;
    gap: .8rem;
    color: #CBD5E1;
}

.help-item {
    padding: .8rem .9rem;
    border-radius: 14px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
}

.modal-table {
    max-height: 380px;
}

@media (max-width: 768px) {
    .erp-modal {
        width: calc(100vw - 1rem);
        max-height: 88vh;
    }

    .erp-form-grid,
    .options-grid {
        grid-template-columns: 1fr;
    }
}


/*ICONO DEL BOTON*/

.erp-btn--icon {
    width: 46px;
    height: 46px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .erp-btn--icon i {
        font-size: 1.2rem;
    }


    .erp-btn--icon:hover i {
        transform: scale(1.1);
        transition: transform 0.15s ease;
    }



/*CSS PARA LA TABLA DE PRODUCTOS*/

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0 .7rem;
}

.table-count {
    font-size: 1rem;
    color: #CBD5E1;
}

.product-name {
    font-weight: 700;
    color: #F8FAFC;
}

.product-tag {
    display: inline-block;
    margin-top: .35rem;
    font-size: .72rem;
    font-weight: 800;
    color: #A7F3D0;
    background: rgba(16,185,129,.12);
    border: 1px solid rgba(16,185,129,.24);
    padding: .2rem .45rem;
    border-radius: 999px;
}

.table-delete-btn {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    color: #FECACA;
    background: rgba(239,68,68,.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .15s ease;
}

    .table-delete-btn:hover {
        background: rgba(239,68,68,.18);
        transform: translateY(-1px);
    }

    .table-delete-btn i {
        font-size: .95rem;
    }



/*ESTILO PARA EL CARD DE SUMMARY (DONDE SE VE EL TOTAL DE LO QUE SE VA A COBRAR*/

.summary-card {
    padding: 1.1rem 1.1rem 1.2rem;
}

.summary-list {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 1rem;
    color: #CBD5E1;
}

    .summary-row strong {
        font-size: 1.05rem;
        color: #F8FAFC;
    }

.summary-divider {
    height: 1px;
    background: rgba(255,255,255,.08);
    margin: .2rem 0;
}

.summary-row--total span,
.summary-row--total strong {
    font-size: 1.15rem;
    font-weight: 900;
}

.text-success {
    color: #4ADE80 !important;
}

.text-warning {
    color: #FB923C !important;
}

.summary-actions {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-top: 1rem;
}

.erp-btn--block {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
}