.orders-page{max-width:1500px}.orders-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:25px}.orders-heading h1{margin-top:9px;font-size:27px}.orders-heading p{margin-top:7px;color:var(--muted);font-size:13px}.orders-button{border:0;border-radius:8px;padding:11px 15px;font-weight:700;cursor:pointer}.orders-button.secondary{background:#f7edf1;color:#85445c;border:1px solid #ead6de}.orders-button:disabled{opacity:.55;cursor:wait}.orders-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:25px}.orders-metrics article{background:#fff;border:1px solid var(--border);border-radius:12px;padding:18px}.orders-metrics span{display:block;color:var(--muted);font-size:12px}.orders-metrics strong{display:block;margin-top:12px;font-size:27px}.orders-notifications,.orders-panel{background:#fff;border:1px solid var(--border);border-radius:12px;margin-bottom:22px;overflow:hidden}.orders-notifications>div:first-child{display:flex;justify-content:space-between;align-items:center;gap:15px;padding:18px 20px;border-bottom:1px solid var(--border)}.orders-notifications h2{font-size:16px}.orders-notifications p{margin-top:5px;color:var(--muted);font-size:11px}.notification-list{padding:0 20px}.notification-item{display:flex;justify-content:space-between;gap:14px;padding:13px 0;border-bottom:1px solid var(--border);font-size:12px}.notification-item:last-child{border-bottom:0}.notification-item.unread strong:before{content:'●';color:#c47b95;margin-right:8px}.notification-item time{color:var(--muted);white-space:nowrap;font-size:10px}.orders-filters{display:grid;grid-template-columns:2fr 1fr 1fr;gap:12px;padding:18px;border-bottom:1px solid var(--border)}.orders-filters input,.orders-filters select{min-width:0;width:100%;padding:11px 12px;border:1px solid var(--border);border-radius:8px;background:#fff;color:var(--text)}.orders-table{width:100%;border-collapse:collapse}.orders-table th,.orders-table td{padding:14px 13px;text-align:left;border-bottom:1px solid #f1ecee;font-size:12px}.orders-table th{color:var(--muted);font-weight:600;background:#fdfbfc}.orders-table tbody tr:hover{background:#fffafb}.order-number{font-weight:700;color:var(--primary-dark)}.order-client strong,.order-client small{display:block}.order-client small{margin-top:4px;color:var(--muted)}.order-status{display:inline-block;padding:5px 9px;border-radius:99px;background:#f5edf0;color:#805064;font-size:10px;font-weight:700;white-space:nowrap}.order-status.pending_confirmation{background:#fff4df;color:#956c22}.order-status.confirmed{background:#eaf3ff;color:#416b9c}.order-status.preparing{background:#f1eaff;color:#7652a0}.order-status.delivered{background:#e8f6ef;color:#2f805b}.order-status.cancelled_by_store,.order-status.cancelled_by_customer,.order-status.rejected{background:#fcebed;color:#a44d58}.order-open{border:1px solid #ead6de;background:#fff;color:#85445c;padding:7px 10px;border-radius:7px;cursor:pointer;font-weight:700}.orders-empty{padding:22px!important;text-align:center!important;color:var(--muted)}.orders-message{padding:0 18px 15px;color:var(--muted);font-size:12px}.nav-badge{margin-left:auto;background:#f4dfe6;color:#8b465f;border-radius:99px;padding:2px 7px;font-size:10px}.order-detail-modal{position:fixed;inset:0;z-index:300;background:#24171c99;display:none;align-items:center;justify-content:center;padding:20px}.order-detail-modal.open{display:flex}.order-detail-dialog{position:relative;background:#fff;border-radius:15px;width:min(760px,100%);max-height:90vh;overflow:auto;padding:30px;box-shadow:0 18px 55px #0003}.order-close{position:absolute;right:16px;top:12px;border:0;background:none;font-size:28px;cursor:pointer;color:#8b7580}.order-detail-dialog h2{font-size:22px;margin-bottom:6px}.order-subtitle{color:var(--muted);font-size:12px;margin-bottom:20px}.order-info-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:18px 0}.order-info-card{background:#fff8fa;border:1px solid var(--border);border-radius:9px;padding:12px}.order-info-card small{display:block;color:var(--muted);margin-bottom:5px}.order-lines{width:100%;border-collapse:collapse;margin:16px 0}.order-lines td{padding:10px 5px;border-bottom:1px solid var(--border);font-size:12px}.order-lines td:last-child{text-align:right;white-space:nowrap}.order-total{text-align:right;font-size:19px;font-weight:800;margin:15px 0}.order-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:20px 0}.order-actions select,.order-actions input{padding:11px;border:1px solid var(--border);border-radius:8px;min-width:0}.order-actions button{grid-column:1/-1}.order-history{margin-top:20px}.order-history h3{font-size:14px;margin-bottom:10px}.history-row{display:flex;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid #f1ecee;font-size:11px}.history-row small{color:var(--muted)}@media(max-width:900px){.orders-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.orders-filters{grid-template-columns:1fr}.orders-table-wrap{overflow-x:auto}.orders-table{min-width:760px}}@media(max-width:600px){.orders-page{padding:20px 14px}.orders-heading{align-items:flex-start}.orders-heading h1{font-size:23px}.orders-metrics article{padding:14px}.orders-metrics strong{font-size:23px}.orders-notifications>div:first-child{align-items:flex-start;flex-direction:column}.order-detail-modal{padding:8px;align-items:flex-end}.order-detail-dialog{padding:24px 17px;max-height:94vh;border-radius:16px 16px 8px 8px}.order-info-grid{grid-template-columns:1fr}.order-actions{grid-template-columns:1fr}}
/* Mobile order cards: avoid forcing a wide desktop table into a phone viewport. */
.orders-cards{display:none}
@media(max-width:700px){
 .orders-page{padding:18px 12px;min-width:0}
 .orders-heading{align-items:flex-start;flex-wrap:wrap;margin-bottom:18px}
 .orders-heading>div{min-width:0;flex:1 1 100%}
 .orders-heading .orders-button{width:100%}
 .orders-heading p{line-height:1.45}
 .orders-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-bottom:16px}
 .orders-metrics article{padding:13px;min-width:0}
 .orders-metrics span{font-size:11px;line-height:1.35}
 .orders-metrics strong{font-size:23px;margin-top:7px}
 .orders-notifications,.orders-panel{margin-bottom:15px;border-radius:13px}
 .orders-notifications>div:first-child{padding:15px;gap:10px}
 .orders-notifications>div:first-child .orders-button{width:100%}
 .notification-list{padding:0 15px}
 .notification-item{align-items:flex-start;gap:9px;padding:12px 0;font-size:12px;line-height:1.4}
 .notification-item>div{min-width:0;overflow-wrap:anywhere}
 .notification-item time{font-size:10px;white-space:normal;text-align:right;flex:0 0 104px}
 .orders-filters{padding:13px;gap:9px}
 .orders-filters input,.orders-filters select{min-height:46px;font-size:14px}
 .orders-table-wrap{display:none}
 .orders-cards{display:grid;gap:10px;padding:12px}
 .order-mobile-card{border:1px solid var(--border);border-radius:11px;padding:13px;background:#fff;min-width:0}
 .order-mobile-top{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:10px}
 .order-mobile-top .order-number{font-size:15px}
 .order-mobile-date{font-size:10px;color:var(--muted);text-align:right}
 .order-mobile-client{font-size:14px;font-weight:700;overflow-wrap:anywhere}
 .order-mobile-phone{font-size:12px;color:var(--muted);margin-top:3px}
 .order-mobile-meta{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin:12px 0;align-items:end}
 .order-mobile-store{font-size:11px;color:var(--muted);overflow-wrap:anywhere}
 .order-mobile-total{text-align:right;font-weight:800;font-size:15px;white-space:nowrap}
 .order-mobile-bottom{display:flex;justify-content:space-between;align-items:center;gap:8px;border-top:1px solid #f1ecee;padding-top:10px}
 .order-mobile-bottom .order-open{min-height:38px;padding:8px 13px}
 .order-status{white-space:normal;text-align:center;line-height:1.25}
 .orders-message{padding:0 13px 13px;overflow-wrap:anywhere}
}
@media(max-width:380px){
 .orders-page{padding-left:9px;padding-right:9px}
 .notification-item time{flex-basis:88px}
 .order-mobile-meta{grid-template-columns:1fr}
 .order-mobile-total{text-align:left}
 .order-mobile-bottom{align-items:flex-start;flex-direction:column}
 .order-mobile-bottom .order-open{width:100%}
}

/* Cierre del detalle fijo al viewport, independiente del scroll interno. */
.order-detail-modal.open .order-close{position:fixed;top:calc(env(safe-area-inset-top,0px) + 12px);right:calc(env(safe-area-inset-right,0px) + 12px);z-index:400;width:42px;height:42px;display:grid;place-items:center;border-radius:50%;background:#fff;box-shadow:0 3px 14px #0003;font-size:27px;line-height:1}

/* Acciones guiadas del flujo de pedidos */
.order-workflow{margin:22px 0;padding:18px;border:1px solid #f0e3e7;border-radius:14px;background:#fffafb}
.order-workflow h3{margin:0 0 8px}
.workflow-current{margin:0 0 14px;color:#74636a}
.workflow-actions{display:flex;flex-wrap:wrap;gap:9px;margin-bottom:14px}
.workflow-button{border:1px solid #ead7dd;border-radius:9px;padding:10px 15px;font:inherit;font-weight:650;cursor:pointer;background:#fff;color:#8f5265}
.workflow-button.primary{background:#b8788c;border-color:#b8788c;color:#fff}
.workflow-button.danger{background:#fff5f5;border-color:#e8c5c8;color:#a33f4b}
.workflow-button:disabled{opacity:.55;cursor:wait}
.workflow-field{display:block;margin-top:10px;font-size:.88rem;color:#765f68}
.workflow-field input{display:block;width:100%;margin-top:6px;box-sizing:border-box;border:1px solid #eadde1;border-radius:8px;padding:11px;font:inherit;background:#fff}
.workflow-finished{color:#777;margin:0}
@media(max-width:600px){.workflow-actions{display:grid;grid-template-columns:1fr}.workflow-button{width:100%;min-height:44px}}

/* Módulo de devoluciones e inspección post-entrega */
.returns-panel{margin:22px 0;padding:18px;border:1px solid #eadce1;border-radius:14px;background:#fff}
.returns-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:15px}
.returns-heading h3{margin:0 0 5px}.returns-heading p{margin:0;color:var(--muted);font-size:12px;line-height:1.45}
.returns-tag{white-space:nowrap;padding:5px 9px;border-radius:99px;background:#f7edf1;color:#85445c;font-size:10px;font-weight:700}
.return-create{padding:14px;border:1px solid #f0e3e7;border-radius:11px;background:#fffafb}
.return-create h4{margin:0 0 8px;font-size:14px}
.return-create select,.return-create input[type=text]{width:100%;box-sizing:border-box;border:1px solid #eadde1;border-radius:8px;padding:10px;background:#fff;font:inherit}
.return-select-items{display:grid;gap:8px;margin:14px 0}
.return-select-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px;border:1px solid #eee4e7;border-radius:9px;background:#fff}
.return-select-row>label{display:flex;align-items:flex-start;gap:9px;min-width:0}
.return-select-row>label input{margin-top:3px;accent-color:#b8788c}
.return-select-row>label span{display:grid;gap:4px;min-width:0}
.return-select-row>label strong{font-size:12px}
.return-select-row small{font-size:10px;color:var(--muted);line-height:1.4}
.return-select-row>input{width:76px;flex:0 0 76px;padding:9px;border:1px solid #eadde1;border-radius:7px}
.return-select-row>input:disabled{opacity:.4;background:#f5f2f3}
.returns-history{display:grid;gap:11px;margin-top:16px}
.return-record{padding:13px;border:1px solid #eee4e7;border-radius:10px}
.return-record>header{display:flex;justify-content:space-between;gap:10px;align-items:center}
.return-record>header strong{font-size:13px}.return-record>header span{font-size:10px;font-weight:700;color:#805064;background:#f7edf1;border-radius:99px;padding:5px 8px}
.return-record>p{font-size:12px;margin:8px 0 4px}.return-record>small{font-size:10px;color:var(--muted)}
.return-line{padding:12px 0;border-top:1px solid #f0e9eb;margin-top:10px}
.return-line>div:first-child strong,.return-line>div:first-child small{display:block}
.return-line>div:first-child strong{font-size:12px}.return-line>div:first-child small{font-size:10px;color:var(--muted);margin-top:4px;line-height:1.4}
.return-inspection{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:10px}
.return-inspection label{font-size:10px;color:var(--muted)}
.return-inspection input,.return-inspection select{display:block;box-sizing:border-box;width:100%;min-width:0;margin-top:4px;padding:8px;border:1px solid #eadde1;border-radius:7px;background:#fff;font:inherit;color:var(--text)}
.return-inspection>input,.return-inspection>small{grid-column:1/-1}
.return-inspection>small{font-size:10px;color:var(--muted)}
.returns-complete{display:inline-block;margin-top:8px;font-size:10px;font-weight:700;color:#2f805b}
.returns-empty,.returns-error{padding:12px;color:var(--muted);font-size:12px}
.returns-error{color:#a44d58}
.inspect-return-button{margin-top:10px}
@media(max-width:600px){.returns-panel{padding:13px;margin:17px 0}.returns-heading{flex-direction:column}.return-inspection{grid-template-columns:1fr 1fr}.return-inspection label:nth-child(4){grid-column:1/-1}.return-select-row{align-items:flex-start}.return-select-row>input{width:66px;flex-basis:66px}.return-record>header{align-items:flex-start;flex-direction:column}}


/* Edición auditada de datos operativos del pedido */
.order-edit-area{margin:12px 0 20px;display:flex;flex-direction:column;align-items:flex-start;gap:10px}
.order-edit-toggle{display:inline-flex;align-items:center;gap:8px;border:1px solid #ead7dd;border-radius:9px;padding:9px 13px;background:#fff;color:#8f5265;font:inherit;font-size:12px;font-weight:700;cursor:pointer}
.order-edit-toggle span{font-size:17px;line-height:1}
.order-edit-form{width:100%;box-sizing:border-box;padding:16px;border:1px solid #f0e3e7;border-radius:12px;background:#fffafb}
.order-edit-form[hidden]{display:none}
.order-edit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.order-edit-grid label{display:flex;flex-direction:column;gap:6px;color:#765f68;font-size:12px;font-weight:600;min-width:0}
.order-edit-grid input,.order-edit-grid select,.order-edit-grid textarea{width:100%;min-width:0;box-sizing:border-box;border:1px solid #eadde1;border-radius:8px;padding:10px;background:#fff;color:var(--text);font:inherit;font-size:13px}
.order-edit-grid textarea{resize:vertical}
.order-edit-wide{grid-column:1/-1}
.order-edit-warning{margin:12px 0;color:var(--muted);font-size:11px;line-height:1.45}
.order-edit-actions{display:flex;justify-content:flex-end;gap:9px;flex-wrap:wrap}
.order-edit-history{margin-top:18px}
.order-edit-history h3{font-size:14px;margin-bottom:10px}
.order-edit-history-entry{padding:11px 0;border-bottom:1px solid #f1ecee}
.order-edit-history-entry header{display:flex;justify-content:space-between;gap:10px;align-items:center}
.order-edit-history-entry header strong{font-size:11px}
.order-edit-history-entry time{font-size:10px;color:var(--muted)}
.order-edit-history-entry ul{margin:8px 0 0;padding-left:17px}
.order-edit-history-entry li{font-size:11px;line-height:1.6;color:var(--muted);overflow-wrap:anywhere}
.order-edit-history-entry li strong{color:var(--text)}
@media(max-width:600px){.order-edit-form{padding:12px}.order-edit-grid{grid-template-columns:1fr}.order-edit-wide{grid-column:auto}.order-edit-actions{display:grid;grid-template-columns:1fr}.order-edit-actions button{width:100%}.order-edit-history-entry header{align-items:flex-start;flex-direction:column}}


/* Editor de factura con auditoría y ajustes de inventario */
.invoice-adjust-panel{margin:22px 0;padding:18px;border:1px solid #eadce1;border-radius:14px;background:#fff}
.invoice-adjust-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:0}
.invoice-adjust-toggle{display:flex;align-items:center;gap:12px;min-width:0;padding:0;border:0;background:transparent;color:var(--text);text-align:left;cursor:pointer;font:inherit}
.invoice-adjust-toggle>span:last-child{display:grid;gap:4px}
.invoice-adjust-toggle strong{font-size:16px}
.invoice-adjust-toggle small{color:var(--muted);font-size:12px;line-height:1.4}
.invoice-adjust-toggle-icon{display:grid;place-items:center;flex:0 0 30px;width:30px;height:30px;border:1px solid #eadce1;border-radius:50%;color:#a9657c;font-size:22px;font-weight:500;line-height:1}
.invoice-adjust-toggle:hover .invoice-adjust-toggle-icon{background:#fbf1f4}
.invoice-adjust-body{padding-top:16px}
.invoice-adjust-body[hidden]{display:none}
.invoice-adjust-heading h3{margin:0 0 5px}.invoice-adjust-heading p{margin:0;color:var(--muted);font-size:12px;line-height:1.45}
.invoice-adjust-tag{padding:5px 9px;border-radius:99px;background:#eaf3ff;color:#416b9c;font-size:10px;font-weight:700;white-space:nowrap}
.invoice-adjust-lines{display:grid;gap:8px}
.invoice-adjust-line{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(80px,.55fr) minmax(90px,.65fr) minmax(75px,.55fr);gap:10px;align-items:center;padding:11px;border:1px solid #eee4e7;border-radius:9px;background:#fff}
.invoice-line-name{display:grid;gap:4px;min-width:0}.invoice-line-name strong{font-size:12px;overflow-wrap:anywhere}.invoice-line-name small{font-size:10px;color:var(--muted);line-height:1.4}
.invoice-adjust-line label,.invoice-add-product label,.invoice-discount-grid label{display:grid;gap:5px;color:#765f68;font-size:11px}
.invoice-adjust-line input[type=number],.invoice-add-product input,.invoice-add-product select,.invoice-discount-grid input,.invoice-discount-grid select,.invoice-reason input{width:100%;min-width:0;box-sizing:border-box;padding:9px;border:1px solid #eadde1;border-radius:8px;background:#fff;color:var(--text);font:inherit}
.invoice-gift-check,.invoice-remove-check{display:flex!important;align-items:center;gap:6px;white-space:nowrap}
.invoice-gift-check input,.invoice-remove-check input{accent-color:#b8788c}
.invoice-add-product{display:grid;grid-template-columns:minmax(0,2fr) minmax(75px,.5fr) minmax(130px,.8fr) auto;gap:9px;align-items:end;margin-top:14px;padding:13px;border:1px dashed #e5cbd4;border-radius:10px;background:#fffafb}
.invoice-add-product button{white-space:nowrap}
.invoice-discount-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:13px}
.invoice-reason{display:grid;gap:6px;margin-top:12px;color:#765f68;font-size:11px}
.invoice-adjust-note{margin:11px 0;color:var(--muted);font-size:10px;line-height:1.5}
.invoice-history{margin-top:20px}.invoice-history h3{font-size:14px;margin-bottom:10px}
.invoice-history-entry{padding:11px 0;border-bottom:1px solid #f1ecee}
.invoice-history-entry header{display:flex;justify-content:space-between;gap:10px}
.invoice-history-entry header strong{font-size:11px}.invoice-history-entry time,.invoice-history-entry small{font-size:10px;color:var(--muted)}
.invoice-history-entry p{margin:7px 0;font-size:12px}.invoice-history-entry div{font-size:11px;color:var(--muted)}
@media(max-width:700px){
 .invoice-adjust-panel{padding:13px;margin:17px 0}
 .invoice-adjust-heading{flex-direction:column}
 .invoice-adjust-line{grid-template-columns:minmax(0,1fr) minmax(78px,.5fr);gap:8px}
 .invoice-line-name{grid-column:1/-1}
 .invoice-add-product{grid-template-columns:1fr 80px}
 .invoice-add-product label:first-child{grid-column:1/-1}
 .invoice-add-product button{grid-column:1/-1;width:100%;min-height:43px}
 .invoice-discount-grid{grid-template-columns:1fr}
 .invoice-history-entry header{flex-direction:column}
}

.invoice-gift-label{display:inline-block;margin-top:4px;color:#2f805b;font-size:10px;font-weight:750}
.invoice-adjust-line:has([data-invoice-remove]:checked){opacity:.48;background:#f8f4f5}

/* Descuentos por unidades: controles alineados y sin columnas comprimidas */
.invoice-adjust-line{
 display:grid;
 grid-template-columns:repeat(4,minmax(0,1fr));
 gap:12px;
 align-items:end;
 padding:15px;
 border:1px solid #eee4e7;
 border-radius:11px;
 background:#fff;
}
.invoice-line-name{
 grid-column:1/-1;
 display:flex;
 flex-direction:column;
 gap:4px;
 padding-bottom:10px;
 border-bottom:1px solid #f3ecee;
}
.invoice-line-name strong{font-size:14px;line-height:1.35}
.invoice-line-name small{font-size:11px;line-height:1.4;color:var(--muted)}
.invoice-adjust-line label{
 display:flex!important;
 flex-direction:column;
 align-items:stretch;
 justify-content:flex-end;
 gap:6px;
 min-width:0;
 color:#765f68;
 font-size:11px;
 line-height:1.35;
 white-space:normal;
}
.invoice-adjust-line input[type=number],.invoice-adjust-line select{
 display:block;
 width:100%;
 min-width:0;
 min-height:42px;
 box-sizing:border-box;
 padding:9px 10px;
 border:1px solid #e8dce0;
 border-radius:8px;
 background:#fff;
 color:var(--text);
 font:inherit;
 font-size:13px;
}
.invoice-adjust-line .invoice-gift-check,
.invoice-adjust-line .invoice-remove-check{
 grid-column:span 2;
 display:flex!important;
 flex-direction:row;
 align-items:center;
 justify-content:flex-start;
 gap:8px;
 min-height:34px;
 padding:8px 10px;
 border:1px solid #f0e8eb;
 border-radius:8px;
 background:#fffafb;
 color:#65545b;
 font-size:11px;
 line-height:1.35;
}
.invoice-adjust-line .invoice-gift-check input,
.invoice-adjust-line .invoice-remove-check input{
 flex:0 0 auto;
 width:16px;
 height:16px;
 margin:0;
}
.invoice-adjust-line [data-invoice-discount-qty]:disabled,
.invoice-adjust-line [data-invoice-discount-type]:disabled,
.invoice-adjust-line [data-invoice-discount-value]:disabled{opacity:.45;background:#f5f2f3}
@media(max-width:850px){
 .invoice-adjust-line{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .invoice-line-name{grid-column:1/-1}
 .invoice-adjust-line .invoice-gift-check,
 .invoice-adjust-line .invoice-remove-check{grid-column:span 1}
}
@media(max-width:480px){
 .invoice-adjust-line{grid-template-columns:1fr;padding:12px}
 .invoice-adjust-line .invoice-gift-check,
 .invoice-adjust-line .invoice-remove-check{grid-column:1/-1}
}


/* Identificador discreto para líneas con descuento individual */
.invoice-line-title,.order-product-title{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0}
.invoice-line-title>strong,.order-product-title>strong{min-width:0}
.invoice-discount-badge{
 display:inline-flex;
 align-items:center;
 width:max-content;
 max-width:100%;
 padding:4px 8px;
 border:1px solid #dcecdf;
 border-radius:999px;
 background:#f0f8f1;
 color:#34734c;
 font-size:10px;
 font-weight:750;
 line-height:1.25;
 white-space:nowrap;
}
.invoice-discount-badge:hover{background:#e7f3e9}


/* Campos adicionales libres y generación de factura PDF */
.additional-fields-editor{margin-top:15px;padding:13px;border:1px solid #eee1e6;border-radius:10px;background:#fff}
.additional-fields-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px}
.additional-fields-heading>div{display:grid;gap:4px}
.additional-fields-heading strong{font-size:12px;color:var(--text)}
.additional-fields-heading small{font-size:10px;color:var(--muted);line-height:1.4}
.additional-fields-heading button{white-space:nowrap}
.additional-field-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.5fr) 34px;gap:9px;align-items:end;padding:10px 0;border-top:1px solid #f1e8eb}
.additional-field-row label{display:grid;gap:5px;min-width:0;color:#765f68;font-size:11px}
.additional-field-row input{width:100%;min-width:0;box-sizing:border-box;padding:9px 10px;border:1px solid #eadde1;border-radius:8px;background:#fff;color:var(--text);font:inherit;font-size:12px}
.additional-field-remove{width:34px;height:36px;border:1px solid #f0d8dd;border-radius:8px;background:#fff7f8;color:#a84d60;font-size:20px;cursor:pointer}
.additional-fields-summary{margin:12px 0}
.additional-fields-summary p{margin:5px 0;font-size:12px;overflow-wrap:anywhere}
.invoice-pdf-actions{display:flex;justify-content:flex-end;margin:14px 0}
.invoice-pdf-actions button{min-height:40px}
@media(max-width:600px){
 .additional-fields-heading{align-items:stretch;flex-direction:column}
 .additional-fields-heading button{width:100%;min-height:40px}
 .additional-field-row{grid-template-columns:minmax(0,1fr) 34px;gap:8px}
 .additional-field-row label:first-of-type{grid-column:1/-1}
 .additional-field-remove{grid-column:2;grid-row:1/3}
 .invoice-pdf-actions{justify-content:stretch}
 .invoice-pdf-actions button{width:100%}
}

/* Validación preventiva de existencias al agregar productos a una factura */
.invoice-stock-feedback{grid-column:1/-1;margin:0;color:var(--muted);font-size:11px;line-height:1.4}
.invoice-stock-feedback.is-error{color:#a33f4b;font-weight:650}
.invoice-add-product button:disabled{opacity:.45;cursor:not-allowed}


/* Panel de previsualización y emisión definitiva de documentos comerciales */
.invoice-issuance-panel{
 display:flex;
 justify-content:space-between;
 align-items:flex-start;
 gap:18px;
 padding:16px;
 border:1px solid #eadde2;
 border-radius:12px;
 background:#fffafb;
}
.invoice-issuance-copy{display:grid;gap:6px;min-width:0}
.invoice-issuance-copy>strong{font-size:14px;color:var(--text)}
.invoice-issuance-copy>p{margin:0;color:var(--muted);font-size:12px;line-height:1.5}
.invoice-issuance-info{display:grid;gap:4px;color:var(--muted);font-size:11px;line-height:1.5}
.invoice-issuance-info strong{color:#8b4e64;font-size:12px}
.invoice-issuance-info small{font-size:11px;color:var(--muted)}
.invoice-issuance-buttons{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;min-width:220px}
.invoice-issuance-buttons button{min-height:40px}
.invoice-issuance-buttons button[hidden]{display:none}
.invoice-reprint-history{display:grid;gap:3px;margin-top:5px;padding-top:6px;border-top:1px solid #eee3e7}
.invoice-reprint-history small{font-size:10px;color:var(--muted)}
@media(max-width:650px){
 .invoice-issuance-panel{flex-direction:column;align-items:stretch}
 .invoice-issuance-buttons{display:grid;grid-template-columns:1fr;min-width:0;width:100%}
 .invoice-issuance-buttons button{width:100%;min-height:44px}
}

/* Contacto directo con el cliente desde el detalle del pedido */
.order-customer-card{display:flex;flex-direction:column;align-items:flex-start;gap:5px}
.order-customer-card p{margin:0}
.order-contact-whatsapp{display:inline-flex;align-items:center;justify-content:center;gap:7px;margin-top:7px;padding:9px 13px;border-radius:8px;background:#e8f5ed;color:#176b3a;border:1px solid #c9e8d4;font-size:12px;font-weight:700;text-decoration:none;transition:background .15s ease,border-color .15s ease}
.order-contact-whatsapp:hover{background:#d9efdf;border-color:#a9d8b9}
.order-contact-unavailable{margin-top:7px;color:var(--muted);font-size:11px}
@media(max-width:650px){.order-contact-whatsapp{width:100%;min-height:42px}}

.invoice-product-picker{display:grid;gap:8px;min-width:0}.invoice-product-picker label{display:grid;gap:5px}.invoice-product-picker input{width:100%;min-width:0;box-sizing:border-box;padding:9px;border:1px solid #eadde1;border-radius:8px;background:#fff;color:var(--text);font:inherit}

@media(max-width:760px){.invoice-product-picker{grid-column:1/-1}}
