.oc-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 14px;
    margin-bottom: 16px;
}
.oc-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.oc-section-title i {
    font-size: 0.9rem;
    color: #1A4480;
}

.modal-body:has(.oc-modal-form) {
    padding: 12px 22px 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.oc-modal-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.oc-modal-form > .oc-section {
    margin-bottom: 0;
}

.oc-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px 12px;
}
.oc-grid-3 .prov-field {
    margin: 0;
}
.oc-grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 6px 12px;
}
.oc-grid-4 .prov-field {
    margin: 0;
}
.oc-field-full {
    grid-column: 1 / -1;
}
.oc-field-span-3 {
    grid-column: span 3;
}


.oc-section-detalle {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.oc-section-detalle > * {
    flex-shrink: 0;
}
.oc-section-detalle > .oc-detalle-table-wrap {
    flex-shrink: 1;
}
.oc-detalle-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 6px 10px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px dashed #d1d5db;
    margin-top: 6px;
    margin-bottom: 0;
    flex-wrap: wrap;
}
.oc-detalle-toolbar .prov-field {
    margin: 0;
}
.oc-detalle-toolbar .prov-field label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
    text-align: center;
    width: 100%;
}
.oc-field-art {
    flex: 1;
    min-width: 200px;
}
.oc-field-qty {
    width: 110px;
}
.oc-field-price {
    width: 130px;
}
.oc-btn-add-item {
    padding: 7px 18px !important;
    font-size: 0.82rem !important;
    height: 36px;
}

.oc-detalle-table-wrap {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}
.oc-detalle-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}
.oc-detalle-table thead th {
    padding: 6px 8px;
    background: #1A4480;
    color: #fff;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    position: sticky !important;
    top: 0;
    z-index: 1;
}
.oc-detalle-table thead tr th:first-child { border-radius: 6px 0 0 0; }
.oc-detalle-table thead tr th:last-child { border-radius: 0 6px 0 0; }
.oc-detalle-table thead th { text-align: center; }
.oc-detalle-table tbody td {
    padding: 6px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    font-size: 0.7rem;
    color: #334155;
}
.oc-detalle-table tbody td:nth-child(4),
.oc-detalle-table tbody td:nth-child(5),
.oc-detalle-table tbody td:nth-child(6) { text-align: right; }
.oc-detalle-table tbody td:last-child { text-align: center; }
.oc-detalle-table tbody tr:hover {
    background: #f8fafc;
}
.oc-count {
    font-weight: 400;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-left: auto;
}

.oc-totales {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-top: 6px;
    gap: 3px;
    padding-right: 2px;
}
.oc-total-row {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
}
.oc-total-row span {
    min-width: 135px;
    text-align: right;
}
.oc-total-row-final {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1A4480;
    padding-top: 4px;
}
.oc-total-input {
    width: 140px;
    padding: 6px 12px;
    border: none !important;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: right;
    background: transparent !important;
    color: #1e293b;
    outline: none !important;
    box-shadow: none !important;
}
.oc-desc-input {
    border: none !important;
    background: #fff !important;
    cursor: text;
    border-radius: 4px;
    outline: none !important;
    box-shadow: none !important;
}
.oc-desc-toggle {
    transition: background 0.15s;
}
.oc-desc-toggle:hover {
    opacity: 0.9;
}
.oc-desc-input:focus {
    border-color: var(--azul-400) !important;
    box-shadow: 0 0 0 3px rgba(37,99,160,0.12) !important;
    outline: none !important;
}
.oc-detalle-grid .ped-detalle-row {
    font-size: 0.7rem;
}
.oc-detalle-grid .ped-detalle-label {
    min-width: 90px;
    font-size: 0.7rem;
}
.oc-detalle-grid .ped-detalle-valor {
    font-size: 0.7rem;
}
.prov-autocomplete-item {
    font-size: 0.7rem !important;
    padding: 5px 12px !important;
    line-height: 1.2 !important;
}
#pageOrdenesCompra .prov-badge-activo,
#pageOrdenesCompra .prov-badge-pendiente,
#pageOrdenesCompra .prov-badge-cerrado,
#pageOrdenesCompra .prov-badge-anulado {
    min-width: 90px;
    text-align: center;
}

#pageOrdenesCompra .prov-tabla thead tr th:first-child { border-radius: 6px 0 0 0; }
#pageOrdenesCompra .prov-tabla thead tr th:last-child { border-radius: 0 6px 0 0; }
#pageConsOC .prov-tabla thead tr th:first-child { border-radius: 6px 0 0 0; }
#pageConsOC .prov-tabla thead tr th:last-child { border-radius: 0 6px 0 0; }

#pageOrdenesCompra .col-total {
    text-align: right;
}
#pageOrdenesCompraTablaWrap .prov-tabla {
    table-layout: fixed;
}
#pageOrdenesCompraTablaWrap .prov-tabla th { text-align: center; }
#pageOrdenesCompraTablaWrap .prov-tabla th .prov-th-content { display: flex; align-items: center; justify-content: normal; }
#pageOrdenesCompraTablaWrap .prov-tabla th .prov-th-content > span:first-child { flex: 1; text-align: center; }
#pageOrdenesCompraTablaWrap .prov-tabla th .prov-th-content > .prov-th-controls { margin-left: auto; }
#pageOrdenesCompraTablaWrap .prov-tabla th:last-child {
    width: 8px !important;
}
#pageOrdenesCompra *:focus:not(input):not(select):not(textarea):not(button),
#pageOrdenesCompra *:focus-visible:not(input):not(select):not(textarea):not(button) {
    outline: none !important;
}

.oc-det-cant:focus,
.oc-det-precio:focus {
    border-color: var(--azul-400) !important;
    box-shadow: 0 0 0 3px rgba(37,99,160,0.12) !important;
}

.oc-det-total {
    font-weight: 600;
    text-align: right;
    color: #334155;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 4px;
    font-size: 0.7rem;
}
