/* Solo inventario gastronómico, sin alterar estilos globales ni otros rubros. */
.rest-integral{max-width:1140px;margin:0 auto;padding:12px 0 28px}
.rest-integral .rest-integral-tabs{display:flex;gap:4px;flex-wrap:wrap;margin:0 0 12px}
.rest-integral .rest-integral-tabs button{white-space:normal}
.rest-integral-panel{min-width:0}
.rest-integral .rest-integral-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:14px 0;flex-wrap:wrap}
.rest-integral .rest-integral-toolbar .rest-hint{margin:0;flex:1;min-width:200px}
.rest-integral .rest-integral-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px}
.rest-integral .rest-integral-form{border:1px solid #dde7ee;border-radius:12px;padding:14px;margin:12px 0 20px}
.rest-integral .rest-integral-line{display:grid;grid-template-columns:minmax(180px,2fr) minmax(100px,1fr) minmax(120px,1fr) auto;align-items:end;gap:10px;margin:8px 0}
.rest-integral .rest-integral-line label{min-width:0}
.rest-integral .rest-integral-prep-line{display:grid;grid-template-columns:minmax(130px,2fr) minmax(100px,1fr) auto;gap:8px;align-items:end;margin:8px 0}
.rest-integral .rest-integral-box{border:1px solid #dde7ee;border-radius:12px;padding:14px}
.rest-integral .rest-integral-empty{padding:20px;color:#536879}
.rest-integral .rest-stock-table{width:100%}
.rest-integral .rest-stock-table input[type=number]{max-width:105px}
.rest-integral .rest-stock-table td small{display:block;color:#65788b}
.rest-integral .rest-stock-history{margin-top:16px}
@media(max-width:780px){.rest-integral .rest-integral-line,.rest-integral .rest-integral-prep-line{grid-template-columns:1fr 1fr}.rest-integral .rest-integral-line label:first-child,.rest-integral .rest-integral-prep-line label:first-child{grid-column:1/-1}.rest-integral .rest-integral-line button{align-self:end}.rest-integral .rest-stock-table-wrap{overflow-x:auto}}
.rest-integral .rest-stock-two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.rest-integral .rest-stock-two>section{min-width:0}
.rest-integral .rest-stock-two .rest-form input,.rest-integral .rest-stock-two .rest-form select{width:100%;min-width:0}
@media(max-width:780px){.rest-integral .rest-stock-two{grid-template-columns:minmax(0,1fr)}.rest-integral .rest-integral-prep-line{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.rest-integral .rest-integral-prep-line select,.rest-integral .rest-integral-line select{width:100%;min-width:0}}
/* V20.500 — Compras gastronómicas: separación visual sin duplicar registros. */
.rest-integral [hidden]{display:none!important}
.rest-purchase-kind{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0 12px}
.rest-purchase-kind button{border:1px solid #d4e3ee;background:#fff;color:#25445e;border-radius:8px;padding:10px 12px;font-weight:700;cursor:pointer}
.rest-purchase-kind button.active{background:#168ce0;color:#fff;border-color:#168ce0}
.rest-integral .rest-purchase-item{background:#fbfdff;border:1px solid #e0eaf2;border-radius:10px;padding:12px;margin:12px 0}
.rest-integral .rest-purchase-item .rest-integral-line{grid-template-columns:minmax(130px,1fr) minmax(180px,2fr) minmax(100px,1fr) minmax(125px,1fr);margin:0}
.rest-integral .rest-purchase-new{padding:12px;margin-top:8px;background:#edf6fd;border-radius:8px}
.rest-purchase-line-actions{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:8px;flex-wrap:wrap}
.rest-purchase-line-actions small{color:#607387;font-size:12px}
.rest-purchase-footer{display:flex;justify-content:flex-end;border-top:1px solid #dfebf3;margin:14px 0;padding:14px 0}
.rest-purchase-footer>div{display:flex;align-items:center;gap:20px;flex-wrap:wrap}
.rest-purchase-footer strong{font-size:24px;color:#082c51}
.rest-purchase-confirm{display:flex;align-items:center;gap:8px;margin:12px 0}
.rest-purchase-confirm input{width:auto!important;min-width:0!important}
@media(max-width:850px){.rest-integral .rest-purchase-item .rest-integral-line{grid-template-columns:repeat(2,minmax(0,1fr))}.rest-purchase-footer{justify-content:flex-start}}
@media(max-width:520px){.rest-integral .rest-purchase-item .rest-integral-line{grid-template-columns:minmax(0,1fr)}.rest-purchase-kind button{flex:1;min-width:170px}}

/* V20.501: Ajuste inmediato y navegación financiera exclusiva de Restaurante. */
.rest-integral .rest-integral-stock-cell{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.rest-integral .rest-integral-stock-cell strong{white-space:nowrap}
.rest-integral .rest-adjust-small{font-size:12px;padding:5px 8px;min-height:30px;white-space:nowrap}
.rest-inventory-adjust-dialog{border:1px solid #d4e2ed;border-radius:14px;box-shadow:0 20px 60px #18345033;width:min(440px,calc(100vw - 28px));max-width:100%;padding:20px;background:white;color:#123}
.rest-inventory-adjust-dialog::backdrop{background:#0c244b80}
.rest-inventory-adjust-dialog .rest-adjust-title{display:flex;gap:12px;align-items:start;justify-content:space-between}
.rest-inventory-adjust-dialog .rest-adjust-title h3{margin:0}
.rest-inventory-adjust-dialog .rest-adjust-title p{margin:5px 0 0;font-size:13px}
.rest-inventory-adjust-dialog label{display:block;margin:12px 0}
.rest-inventory-adjust-dialog input,.rest-inventory-adjust-dialog select{width:100%}
.rest-inventory-adjust-dialog .rest-adjust-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
.rest-integral-prepare-details{margin-top:16px;border:1px solid #dce6ef;border-radius:12px;padding:12px}
.rest-integral-prepare-details>summary{font-weight:650;cursor:pointer;padding:2px}
.rest-integral-prepare-details>.rest-integral-box{border:0;padding:12px 2px 0}
.rest-finance-page .rest-finance-tabs{display:flex;gap:6px;border-bottom:1px solid #d5e3ed;padding:8px 0;margin:0 auto 12px;max-width:1140px;flex-wrap:wrap}
.rest-finance-page .rest-finance-tabs button{padding:10px 16px;background:transparent;color:#31516d;border:0;border-bottom:3px solid transparent;font-weight:700;cursor:pointer}
.rest-finance-page .rest-finance-tabs button.active{border-bottom-color:#188eea;color:#147dcc}
.rest-finance-page .rest-finance-tabs button:focus-visible{outline:2px solid #188eea;outline-offset:2px}
.rest-finance-page .rest-integral{padding-top:0}
.rest-finance-page .exp-shell{margin-top:0}
@media(max-width:540px){.rest-integral .rest-integral-stock-cell{align-items:flex-start;flex-direction:column}.rest-finance-page .rest-finance-tabs button{flex:1}}

/* V20.502 — Centro unificado de compras y gastos, exclusivamente Restaurante/Snack. */
.rest-unified-shell{max-width:1280px}
.rest-unified-shell .exp-header{align-items:center}
.rest-unified-create{position:relative;flex:none;z-index:3}
.rest-unified-create>summary{cursor:pointer;list-style:none;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center}
.rest-unified-create>summary::-webkit-details-marker{display:none}
.rest-unified-create>summary:focus-visible{outline:3px solid #168ce0;outline-offset:3px}
.rest-unified-create-menu{position:absolute;right:0;top:calc(100% + 8px);width:min(320px,85vw);background:#fff;border:1px solid #cddfed;border-radius:12px;padding:5px;box-shadow:0 12px 38px #1534572b}
.rest-unified-create-menu button{display:flex;flex-direction:column;align-items:start;gap:4px;width:100%;background:transparent;border:0;border-radius:8px;padding:12px;text-align:left;color:#15314d;cursor:pointer}
.rest-unified-create-menu button:hover,.rest-unified-create-menu button:focus-visible{background:#ecf6ff;outline:none}
.rest-unified-create-menu button span{font-size:14px;font-weight:750}
.rest-unified-create-menu button small{font-size:11px;color:#637b91}
.rest-unified-history-head{align-items:end}
.rest-unified-history-head h3{margin:0 0 6px}
.rest-unified-hint{margin:0;color:#73859b;font-size:11px;max-width:440px}
.rest-unified-filter{display:flex;gap:8px;align-items:end;flex-wrap:wrap}
.rest-unified-filter label{font-size:11px;font-weight:700;color:#51677c;display:flex;flex-direction:column;gap:4px}
.rest-unified-filter select,.rest-unified-filter input{height:38px;border:1px solid #cbd9e6;background:#fff;border-radius:8px;padding:6px 10px;font:inherit;color:#18324b;max-width:240px}
.rest-unified-filter input{width:240px}
.rest-unified-branch select{max-width:185px}
.rest-unified-table{min-width:820px}
.rest-unified-table tr[hidden]{display:none!important}
.rest-unified-type{display:inline-block;border-radius:15px;padding:5px 9px;font-weight:750;font-size:11px;white-space:nowrap}
.rest-unified-type.purchase{background:#e5f2ff;color:#145e9e}
.rest-unified-type.expense{background:#f3eaff;color:#70509a}
.rest-unified-layout{grid-template-columns:minmax(0,2.05fr) minmax(280px,.8fr)}
.rest-unified-purchase-lines p{margin:0;padding:10px 0;border-bottom:1px solid #e3e9f1}
.rest-unified-purchase-lines p strong,.rest-unified-purchase-lines p small{display:block}
.rest-unified-purchase-lines p small{font-size:11px;color:#637b91;margin-top:5px}
.rest-unified-editor{max-width:1050px;margin:auto}
.rest-unified-expense-editor{max-width:1050px}
.rest-unified-expense-editor [hidden]{display:none!important}
.rest-unified-expense-editor .exp-panel{max-width:none}
.rest-unified-expense-editor .rest-unified-form-layout{display:block}
.rest-unified-editor .rest-integral{padding-top:0}
.rest-unified-editor .rest-integral-panel{max-width:none}
.rest-unified-editor .rest-stock-history[hidden]{display:none!important}
@media(max-width:1050px){.rest-unified-layout{grid-template-columns:minmax(0,1fr)}.rest-unified-history-head{align-items:start}}
@media(max-width:650px){
 .rest-unified-header{align-items:stretch}.rest-unified-create,.rest-unified-create>summary{width:100%}
 .rest-unified-create-menu{left:0;right:auto;width:100%}
 .rest-unified-filter,.rest-unified-filter label{width:100%}
 .rest-unified-filter select,.rest-unified-filter input{max-width:none;width:100%}
 .rest-unified-table{display:block;min-width:0;width:100%}
 .rest-unified-table thead{display:none}
 .rest-unified-table tbody{display:block}
 .rest-unified-table tr[data-unified-row]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:5px 10px;padding:12px 0;border-bottom:1px solid #e5edf4}
 .rest-unified-table tr[data-unified-row] td{padding:2px 0;border:0;min-width:0;overflow-wrap:anywhere}
 .rest-unified-table tr[data-unified-row] td:nth-child(1),
 .rest-unified-table tr[data-unified-row] td:nth-child(2),
 .rest-unified-table tr[data-unified-row] td:nth-child(4){grid-column:1/-1}
 .rest-unified-table tr[data-unified-row] td:nth-child(3){grid-column:1/-1;color:#69798b}
 .rest-unified-table tr[data-unified-row] td:nth-child(8){display:flex;justify-content:end}
 .rest-unified-table tr[data-unified-row] td:nth-child(5):before{content:'Importe';display:block;color:#728399;font-size:10px}
 .rest-unified-table tr[data-unified-row] td:nth-child(6):before{content:'Saldo';display:block;color:#728399;font-size:10px}
 .rest-unified-table tr[data-unified-row] td:nth-child(7){display:flex;align-items:center}
}

/* V20.536 — Formulario único de compras gastronómicas. */
.rest-purchase-workspace .rest-integral-panel{padding:20px}
.rest-purchase-workspace #rest-integral-purchase{border:0;padding:0;margin:0;gap:12px}
.rest-purchase-workspace .rest-stock-branch{margin-bottom:12px}
.rest-purchase-section-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;border-top:1px solid #e0e9ef;padding-top:12px}
.rest-purchase-section-head h3,.rest-purchase-workspace #rest-integral-purchase h3{margin:0;font-size:15px}
.rest-purchase-section-head .rest-purchase-kind{margin:0}
.rest-purchase-workspace #rest-purchase-kind-hint,.rest-purchase-workspace [data-purchase-payment-info]{margin:0}
.rest-purchase-workspace .rest-purchase-item{margin:0;padding:12px;display:grid;gap:9px}
.rest-purchase-workspace .rest-integral-lines{display:grid;gap:8px}
.rest-purchase-item-head{display:flex;align-items:center;justify-content:space-between;gap:8px;color:#34536b;font-size:12px}
.rest-purchase-item-head button{min-height:30px;padding:4px 9px;font-size:12px}
.rest-integral .rest-purchase-item .rest-integral-line{grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1.1fr);gap:8px}
.rest-integral .rest-purchase-item[data-origin=material] .rest-integral-line{grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1.1fr)}
.rest-integral .rest-purchase-item.rest-purchase-pack .rest-integral-line{grid-template-columns:minmax(0,1.8fr) repeat(4,minmax(0,1fr))}
.rest-purchase-workspace .rest-integral-line label{display:flex;flex-direction:column;gap:4px;min-width:0;font-size:12px}
.rest-purchase-workspace .rest-integral-line input,.rest-purchase-workspace .rest-integral-line select{width:100%;min-width:0;box-sizing:border-box}
.rest-purchase-workspace [data-pack-summary]{margin:0;background:#eaf5ef;padding:7px 9px;border-radius:6px;color:#23634f}
.rest-purchase-workspace .rest-purchase-line-actions{justify-content:flex-end;margin-top:0}
.rest-purchase-workspace .rest-purchase-line-actions small{margin-right:auto}
.rest-purchase-workspace [data-line-total]{font-size:13px;color:#163b57}
.rest-purchase-workspace .rest-purchase-footer{margin:0;padding:12px 0 4px}
.rest-purchase-workspace .rest-purchase-footer strong{font-size:23px}
.rest-purchase-workspace .rest-purchase-new{margin:0}
.rest-purchase-workspace .rest-integral-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:850px){.rest-integral .rest-purchase-item .rest-integral-line,.rest-integral .rest-purchase-item[data-origin=material] .rest-integral-line,.rest-integral .rest-purchase-item.rest-purchase-pack .rest-integral-line{grid-template-columns:repeat(2,minmax(0,1fr))}.rest-integral .rest-purchase-item .rest-integral-line label:first-child{grid-column:1/-1}}
@media(max-width:520px){.rest-purchase-workspace .rest-integral-panel{padding:12px}.rest-purchase-workspace .rest-integral-fields{grid-template-columns:minmax(0,1fr)}.rest-purchase-section-head .rest-purchase-kind{width:100%}.rest-purchase-section-head .rest-purchase-kind button{min-width:0;flex:1;font-size:12px}.rest-purchase-workspace .rest-purchase-line-actions{align-items:flex-end}}
/* V20.539: un editor activo y resumen de artículos confirmados. */
.rest-purchase-count{font-size:13px;color:#34536b;margin:0;font-weight:600}
.rest-purchase-row-tools{display:flex;gap:6px;align-items:center}
.rest-purchase-item.rest-purchase-added{background:#f3faf6;border-color:#c7e2d1}
.rest-purchase-added [data-line-status]{color:#23634f}
.rest-purchase-summary{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;align-items:center;font-size:13px}
.rest-purchase-summary>div{display:flex;flex-direction:column;gap:4px;overflow-wrap:anywhere}
.rest-purchase-summary>div:last-child{text-align:right}
.rest-purchase-summary small{color:#607387}
.rest-purchase-line-actions [data-line-confirm]{min-height:34px;padding:7px 14px}
.rest-purchase-success{padding:18px;border:1px solid #b8dccb;background:#eff9f3;border-radius:10px;color:#24543f}
.rest-purchase-success h3{color:#17634c;font-size:19px!important}
.rest-purchase-success .rest-actions{margin-top:16px}
.rest-purchase-workspace [hidden]{display:none!important}
@media(max-width:520px){.rest-purchase-summary{grid-template-columns:1fr}.rest-purchase-summary>div:last-child{text-align:left}.rest-purchase-line-actions [data-line-confirm]{width:100%}}
