/**
 * Pedidos por procesar / modal emitir comprobante electrónico
 */

@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap");

.xoey-emit-modal .modal-body {
    background: var(--bs-body-bg);
}

.xoey-emit-mono {
    font-family:
        "JetBrains Mono", "SF Mono", Monaco, "Cascadia Code", "Roboto Mono",
        Consolas, monospace;
    font-size: 0.8125rem;
}

/* Cabecera compacta */
.xoey-emit-summary-compact {
    font-size: 0.8125rem;
    line-height: 1.3;
}

.xoey-emit-summary-line .badge {
    font-size: 0.6875rem;
}

.xoey-emit-kv {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    white-space: nowrap;
}

.xoey-emit-kv-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--bs-secondary-color);
}

.xoey-emit-summary-client {
    border-color: var(--bs-border-color-translucent) !important;
}

.xoey-emit-client-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
    width: 100%;
}

.xoey-emit-client-name {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.xoey-emit-client-doc {
    flex: 0 0 auto;
    font-size: 0.75rem;
    white-space: nowrap;
}

.xoey-emit-street {
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(100%, 22rem);
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.xoey-emit-ubigeo {
    flex: 0 1 auto;
    min-width: 0;
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tabla ítems */
.xoey-emit-items-table {
    table-layout: fixed;
    width: 100%;
    font-family:
        "JetBrains Mono", "SF Mono", Monaco, "Cascadia Code", "Roboto Mono",
        Consolas, monospace;
    font-size: 0.8125rem;
}

.xoey-emit-col-num { width: 1.75rem; }
.xoey-emit-col-model { width: 4.25rem; }
.xoey-emit-col-name { width: 26%; }
.xoey-emit-col-color { width: 17%; }
.xoey-emit-col-size { width: 2.35rem; }
.xoey-emit-col-qty { width: 2.75rem; }
.xoey-emit-col-unit { width: 4.75rem; }
.xoey-emit-col-total { width: 4.75rem; }

.xoey-emit-items-table thead th {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.3rem 0.4rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.xoey-emit-items-table tbody td {
    padding: 0.3rem 0.4rem !important;
    vertical-align: middle;
}

.xoey-emit-items-table tbody td.xoey-emit-item-name {
    font-family: var(--bs-body-font-family);
    font-size: 0.75rem;
}

.xoey-emit-items-table tbody td.xoey-emit-item-color {
    font-size: 0.6875rem;
    font-weight: 500;
}

.xoey-emit-cell-clamp {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.xoey-emit-cell-clamp.xoey-emit-cell-name,
.xoey-emit-cell-clamp.xoey-emit-cell-color {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.xoey-emit-cell-clamp.xoey-emit-cell-name {
    font-family: var(--bs-body-font-family);
    font-size: 0.75rem;
}

.xoey-emit-cell-clamp.xoey-emit-cell-color {
    font-size: 0.6875rem;
    font-weight: 500;
}

.xoey-emit-items-table tbody td.xoey-emit-item-size {
    font-size: 0.6875rem;
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
    text-align: center;
}

.xoey-emit-items-table thead th.xoey-emit-th-size {
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
    text-align: center;
}

.xoey-emit-items-table tbody td.xoey-emit-item-model code {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.xoey-emit-items-table .xoey-emit-row-num {
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
}

.xoey-emit-items-table td:last-child,
.xoey-emit-items-table th:last-child {
    font-weight: 700;
}

.xoey-emit-items-table tr.xoey-emit-pack-header td {
    background: rgba(var(--bs-primary-rgb), 0.06);
    border-top-width: 2px;
}

.xoey-emit-items-table tr.xoey-emit-pack-detail td {
    background: rgba(var(--bs-secondary-rgb), 0.04);
    font-size: 0.6875rem;
}

.xoey-emit-items-table tr.xoey-emit-pack-detail td:first-child {
    padding-left: 0.75rem !important;
}

.xoey-emit-items-table tr.xoey-emit-pack-detail td.xoey-emit-item-name::before {
    content: "↳ ";
    color: var(--bs-secondary-color);
}

.xoey-emit-pack-badge {
    font-family: var(--bs-body-font-family);
    font-size: 0.625rem;
    vertical-align: middle;
}

.xoey-emit-items-head {
    background: rgba(var(--bs-secondary-rgb), 0.06);
}

.xoey-emit-totals {
    font-size: 0.8125rem;
}

/* Vista previa emisión */
.xoey-emit-modal.xoey-emit-modal-preview .modal-body,
.xoey-emit-modal.xoey-emit-modal-result .modal-body {
    padding-top: 0.5rem;
}

.xoey-emit-preview-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--bs-border-radius);
    border: 1px solid var(--bs-border-color-translucent);
    background: rgba(var(--bs-primary-rgb), 0.06);
    border-color: rgba(var(--bs-primary-rgb), 0.2);
}

.xoey-emit-preview-banner.is-ready {
    background: rgba(var(--bs-success-rgb), 0.08);
    border-color: rgba(var(--bs-success-rgb), 0.25);
}

.xoey-emit-preview-banner.is-warning {
    background: rgba(var(--bs-warning-rgb), 0.1);
    border-color: rgba(var(--bs-warning-rgb), 0.35);
}

.xoey-emit-preview-banner.is-error {
    background: rgba(var(--bs-danger-rgb), 0.08);
    border-color: rgba(var(--bs-danger-rgb), 0.25);
}

.xoey-emit-preview-banner-icon {
    flex: 0 0 auto;
    line-height: 1;
    font-size: 1.75rem;
}

.xoey-emit-preview-banner-body {
    flex: 1 1 auto;
    min-width: 0;
}

.xoey-emit-client-extra {
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.xoey-emit-items-scroll {
    max-height: min(42vh, 320px);
    overflow: auto;
}

.xoey-emit-footer-total {
    min-width: 8rem;
}

.xoey-emit-footer-total strong {
    font-size: 1.05rem;
}

.xoey-emit-result-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--bs-border-radius);
    border: 1px solid var(--bs-border-color-translucent);
}

.xoey-emit-result-banner.is-success {
    background: rgba(var(--bs-success-rgb), 0.08);
    border-color: rgba(var(--bs-success-rgb), 0.25);
}

.xoey-emit-result-banner.is-error {
    background: rgba(var(--bs-danger-rgb), 0.08);
    border-color: rgba(var(--bs-danger-rgb), 0.25);
}

.xoey-emit-result-banner-icon {
    flex: 0 0 auto;
    line-height: 1;
    font-size: 1.75rem;
}

.xoey-emit-result-banner-body {
    flex: 1 1 auto;
    min-width: 0;
}

.xoey-emit-result-doc {
    background: rgba(var(--bs-secondary-rgb), 0.04);
}

.xoey-emit-result-total {
    background: rgba(var(--bs-success-rgb), 0.05);
    font-size: 0.8125rem;
}

.xoey-emit-totals-stack {
    max-width: 18rem;
    margin-left: auto;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.xoey-emit-result-files .btn {
    min-width: 7.5rem;
}

.xoey-emit-result-files .btn.is-unavailable {
    opacity: 0.55;
    pointer-events: none;
}
