/**
 * cmp.css - Estilos del modulo Compras
 * @version 1.1.0
 * @author Equipo ERP
 * @date 2026-06-09
 */

.cmp-page {
    --cmp-border: #d7e3f0;
    --cmp-muted: #6c7785;
    --cmp-soft: #f6f9fc;
    --cmp-head: #eef6f0;
    --cmp-success: #1f7a3d;
    --cmp-cpe-key: #28a745;
    --cmp-info: #0c6b8f;
    --cmp-danger: #b42318;
    --cmp-warning: #9a6200;
}

.cmp-page .content-header h1 {
    font-weight: 700;
}

.cmp-page .breadcrumb {
    font-size: 0.86rem;
}

.cmp-page .cmp-card {
    border: 1px solid var(--cmp-border);
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
    margin-bottom: 1rem;
    overflow: hidden;
}

.cmp-page .cmp-card .card-header {
    background: var(--cmp-soft);
    border-bottom: 1px solid var(--cmp-border);
    padding: 0.75rem 1rem;
}

.cmp-page .cmp-card .card-header strong {
    color: #243447;
    font-size: 0.98rem;
}

.cmp-page .cmp-card .card-body {
    padding: 1rem;
}

.cmp-page .cmp-card .card-footer {
    background: #fff;
    border-top: 1px solid var(--cmp-border);
    padding: 0.75rem 1rem;
}

.cmp-page .small-box {
    border-radius: 6px;
    min-height: 105px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.cmp-page .small-box .inner {
    padding: 14px 16px;
}

.cmp-page .small-box h3 {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.35rem;
}

.cmp-page .small-box p {
    font-size: 0.86rem;
    margin-bottom: 0;
}

.cmp-page .small-box .icon {
    top: 10px;
    right: 14px;
    opacity: 0.28;
}

.cmp-page .small-box .icon > i {
    font-size: 58px;
}

.cmp-page label {
    font-size: 0.84rem;
    font-weight: 600;
    color: #263445;
}

.cmp-page .form-control,
.cmp-page .custom-select {
    border-color: #ced6df;
    border-radius: 5px;
}

.cmp-page .form-control:focus,
.cmp-page .custom-select:focus {
    border-color: #55a66a;
    box-shadow: 0 0 0 0.12rem rgba(40, 167, 69, 0.18);
}

.cmp-page .form-control[readonly] {
    background-color: #f8fafc;
}

.cmp-page .cmp-cpe-key-field {
    background-color: rgba(40, 167, 69, 0.04);
    border: 1px solid var(--cmp-cpe-key);
    border-radius: 5px;
    padding-bottom: 0.55rem;
    padding-top: 0.45rem;
}

.cmp-page .cmp-cpe-key-field label {
    color: var(--cmp-cpe-key);
}

.cmp-page .btn {
    border-radius: 5px;
}

.cmp-page .btn-sm {
    font-weight: 600;
}

.cmp-page .select2-container--default .select2-selection--single {
    min-height: 31px;
    border-color: #ced4da;
    border-radius: 5px;
}

.cmp-page .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 29px;
    color: #263445;
}

.cmp-page .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 29px;
}

.cmp-page .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #55a66a;
    box-shadow: 0 0 0 0.12rem rgba(40, 167, 69, 0.18);
}

.cmp-page .badge {
    border-radius: 4px;
    font-size: 0.73rem;
    font-weight: 700;
    padding: 0.34rem 0.48rem;
}

.cmp-page #cmpSunatBadge {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cmp-page #cmpStatus {
    border-radius: 5px;
    color: #334155;
    font-size: 0.9rem;
    line-height: 1.45;
    min-height: 42px;
}

.cmp-total-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.42rem 0;
    border-bottom: 1px solid #edf1f5;
    font-size: 0.95rem;
    color: #334155;
}

.cmp-total-line:last-child {
    border-bottom: 0;
}

.cmp-total-line strong {
    color: #111827;
    font-variant-numeric: tabular-nums;
}

.cmp-total-line label {
    color: inherit;
    font-size: inherit;
    font-weight: 600;
    margin-bottom: 0;
}

.cmp-total-input {
    width: 130px;
}

.cmp-total-input .form-control {
    color: #111827;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.cmp-total-main {
    font-size: 1.15rem;
    color: #155724;
}

.cmp-total-main strong {
    color: var(--cmp-success);
    font-size: 1.35rem;
}

.cmp-total-grand {
    border-top: 1px solid rgba(40, 167, 69, 0.22);
    margin-top: 0.1rem;
}

.cmp-page .table {
    color: #263445;
}

.cmp-page .table thead th {
    background: var(--cmp-head);
    border-bottom: 1px solid var(--cmp-border);
    color: #1f2937;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    vertical-align: middle;
}

.cmp-page .table td {
    font-size: 0.86rem;
}

.cmp-page .table-hover tbody tr:hover {
    background-color: #f3fbf5;
}

#tblCml,
#tblCmpDetalle {
    border-collapse: collapse;
}

#tblCml td {
    vertical-align: middle;
}

#tblCml td strong,
#tblCmpDetalle td strong {
    color: #1f2937;
}

#tblCml .text-primary {
    font-weight: 700;
}

#tblCmpDetalle td {
    vertical-align: middle;
}

#tblCmpDetalle {
    min-width: 860px;
}

#tblCmpDetalle .select2-container {
    min-width: 100%;
}

#tblCmpDetalle input[type="number"] {
    font-variant-numeric: tabular-nums;
}

#tblCmpDetalle .cmp-del-row {
    height: 30px;
    min-width: 32px;
}

#tblCml .btn-xs {
    padding: 0.15rem 0.35rem;
    font-size: 0.75rem;
    line-height: 1.25;
    min-width: 27px;
}

#tblCml .badge-light {
    background-color: #f8fafc;
    color: #64748b;
}

.cmp-json-alert .swal2-html-container,
.swal2-popup.cmp-json-alert .swal2-html-container {
    margin: 0;
    max-height: 70vh;
    overflow-y: auto;
}

.cmp-json-preview {
    background: #0f172a;
    border-radius: 6px;
    color: #e5edf6;
    font-size: 0.82rem;
    line-height: 1.45;
    margin: 0;
    max-height: 68vh;
    overflow: auto;
    padding: 1rem;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-word;
}

.cmp-page .dataTables_wrapper .dataTables_length,
.cmp-page .dataTables_wrapper .dataTables_filter,
.cmp-page .dataTables_wrapper .dataTables_info,
.cmp-page .dataTables_wrapper .dataTables_paginate {
    color: var(--cmp-muted);
    font-size: 0.84rem;
}

.cmp-page .dataTables_wrapper .dataTables_filter input {
    border: 1px solid #ced6df;
    border-radius: 5px;
    height: 31px;
    margin-left: 0.35rem;
    padding: 0.25rem 0.5rem;
}

.cmp-page .dataTables_wrapper .page-link {
    color: var(--cmp-success);
}

.cmp-page .dataTables_wrapper .page-item.active .page-link {
    background-color: var(--cmp-success);
    border-color: var(--cmp-success);
    color: #fff;
}

.cmp-page .dataTables_wrapper .page-item.disabled .page-link {
    color: #94a3b8;
}

.cmp-page .table-responsive {
    border-radius: 5px;
}

.cmp-page .input-group-sm > .form-control,
.cmp-page .input-group-sm > .input-group-append > .btn {
    height: 31px;
}

.cmp-page .alert-light {
    background-color: #f8fafc;
}

.cmp-page .text-success {
    color: var(--cmp-success) !important;
}

.cmp-page .text-info {
    color: var(--cmp-info) !important;
}

.cmp-page .text-danger {
    color: var(--cmp-danger) !important;
}

.cmp-page .text-warning {
    color: var(--cmp-warning) !important;
}

@media (max-width: 991.98px) {
    .cmp-page .cmp-kpi-row .small-box {
        min-height: 92px;
    }

    .cmp-page .small-box h3 {
        font-size: 1.45rem;
    }

    .cmp-page .small-box .icon > i {
        font-size: 48px;
    }
}

@media (max-width: 767.98px) {
    .cmp-page .content-header h1 {
        font-size: 1.45rem;
    }

    .cmp-page .breadcrumb {
        float: none !important;
        margin-top: 0.35rem;
    }

    .cmp-page .cmp-card .card-body {
        padding: 0.8rem;
    }

    .cmp-page .cmp-card .card-header,
    .cmp-page .cmp-card .card-footer {
        padding: 0.7rem 0.8rem;
    }

    .cmp-page .form-control-sm,
    .cmp-page .btn-sm {
        font-size: 0.86rem;
    }

    .cmp-total-line {
        font-size: 0.9rem;
    }

    .cmp-total-main strong {
        font-size: 1.2rem;
    }

    #tblCml {
        min-width: 920px;
    }
}

@media print {
    .cmp-page .btn,
    .cmp-page .dataTables_filter,
    .cmp-page .dataTables_length,
    .cmp-page .dataTables_paginate,
    #tblCml th:last-child,
    #tblCml td:last-child {
        display: none !important;
    }

    .cmp-page .cmp-card,
    .cmp-page .small-box {
        box-shadow: none;
    }
}
