.ped-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.ped-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ped-section-title i {
    color: #6366f1;
}
.ped-count {
    font-weight: 400;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-left: auto;
}
.ped-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}
.ped-grid .prov-field {
    margin: 0;
}
.ped-detalle-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    font-size: 0.84rem;
}
.ped-detalle-table th {
    padding: 8px 10px;
    background: #1A4480;
    color: #fff;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky !important;
    top: 0;
    z-index: 1;
}
.ped-detalle-table th:first-child,
.ped-detalle-table td:first-child {
    text-align: left;
}
.ped-detalle-table th:nth-child(2),
.ped-detalle-table td:nth-child(2) {
    text-align: left;
}
.ped-detalle-table th:nth-child(3),
.ped-detalle-table td:nth-child(3) {
    text-align: right;
}
.ped-detalle-table th:nth-child(4),
.ped-detalle-table td:nth-child(4) {
    text-align: center;
}
.ped-detalle-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    font-size: 0.7rem;
    color: #334155;
}
.ped-detalle-table thead tr th:first-child { border-radius: 6px 0 0 0; }
.ped-detalle-table thead tr th:last-child { border-radius: 0 6px 0 0; }
.ped-detalle-table tbody tr:hover {
    background: #f8fafc;
}
.ped-detalle-print-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: auto;
    padding: 4px 8px;
    border-radius: 4px;
}
.ped-detalle-print-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}
.ped-section-title .ped-detalle-print-btn,
.oc-section-title .ped-detalle-print-btn {
    color: #1A4480;
}
.ped-section-title .ped-detalle-print-btn:hover,
.oc-section-title .ped-detalle-print-btn:hover {
    background: #eef2ff;
}
.ped-section-title .ped-detalle-print-btn.oc-excel-btn,
.oc-section-title .ped-detalle-print-btn.oc-excel-btn {
    color: #059669 !important;
}
.ped-section-title .ped-detalle-print-btn.oc-excel-btn:hover,
.oc-section-title .ped-detalle-print-btn.oc-excel-btn:hover {
    background: #ecfdf5;
    color: #047857 !important;
}
.ped-section-title .ped-detalle-print-btn,
.oc-section-title .ped-detalle-print-btn {
    margin-left: 4px;
}
.ped-section-title .ped-detalle-print-btn.oc-excel-btn,
.oc-section-title .ped-detalle-print-btn.oc-excel-btn {
    margin-left: auto;
}
.ped-section-title .ped-detalle-print-btn:last-of-type,
.oc-section-title .ped-detalle-print-btn:last-of-type {
    margin-left: 4px;
}
.ped-det-cant {
    font-weight: 400;
}
.ped-add-bar {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px dashed #d1d5db;
}
.ped-add-bar .prov-field {
    flex: 1;
}
.ped-add-bar .prov-field label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
}

#pagePedidosForm {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    gap: 16px;
}
#pagePedidosForm > .ped-section {
    margin-bottom: 0;
}
.ped-section-detalle {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.ped-detalle-wrap {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}
.ped-detalle-wrap .ped-detalle-table {
    margin-bottom: 0;
}

.ped-detalle-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ped-detalle-view .ped-section {
    margin: 0;
}

.ped-detalle-row {
    display: flex;
    padding: 4px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.7rem;
}
.ped-detalle-label {
    font-weight: 600;
    color: #475569;
    min-width: 120px;
}
.ped-detalle-valor {
    color: #1e293b;
}
.ped-detalle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

#pagePedidos input:focus,
#pagePedidos select:focus,
#pagePedidos textarea:focus {
    border-color: var(--azul-400);
    box-shadow: 0 0 0 3px rgba(37,99,160,0.12);
    outline: none;
}
#pagePedidos *:focus:not(input):not(select):not(textarea):not(button),
#pagePedidos *:focus-visible:not(input):not(select):not(textarea):not(button) {
    outline: none !important;
}

.prov-badge-pendiente {
    background: rgba(245,158,11,0.1);
    color: #D97706;
    border: 1px solid rgba(245,158,11,0.18);
    min-width: 90px;
    text-align: center;
}
.prov-badge-anulado {
    background: rgba(239,68,68,0.06);
    color: #DC2626;
    border: 1px solid rgba(239,68,68,0.12);
    min-width: 90px;
    text-align: center;
}
.prov-badge-cerrado {
    background: rgba(71,85,105,0.08);
    color: #475569;
    border: 1px solid rgba(71,85,105,0.15);
    min-width: 90px;
    text-align: center;
}

#pagePedidosTablaWrap .prov-tabla {
    table-layout: fixed;
}
#pagePedidosTablaWrap .prov-tabla th {
    text-align: center;
}
#pagePedidosTablaWrap .prov-tabla th .prov-th-content { display: flex; align-items: center; justify-content: normal; }
#pagePedidosTablaWrap .prov-tabla th .prov-th-content > span:first-child { flex: 1; text-align: center; }
#pagePedidosTablaWrap .prov-tabla th .prov-th-controls { margin-left: auto; }
#pagePedidosTablaWrap .prov-tabla td:nth-child(1),
#pagePedidosTablaWrap .prov-tabla td:nth-child(2) {
    text-align: center;
}

#pagePedidos .prov-badge-activo {
    min-width: 90px;
    text-align: center;
}

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

.ped-add-bar label {
    text-align: center;
    width: 100%;
}
