/* DONAAPPLE · capa visual común. No cambia la lógica ni los estados de visibilidad. */
body.dona-panel {
 --panel-accent:#246f76; --panel-accent-hover:#1b5960; --panel-soft:#eaf5f4;
 --panel-border:#d7e4e7; --panel-ink:#19343c; --panel-muted:#5c727b;
 background:#f3f7f8;color:var(--panel-ink);
}
body.dona-panel *,body.dona-panel *::before,body.dona-panel *::after{box-sizing:border-box}
body.dona-panel .admin-shell>main,body.dona-panel .employee-page{min-width:0!important;background:radial-gradient(ellipse at 95% 0,#e1f1f1,transparent 45%),#f3f7f8!important;color:var(--panel-ink)}
body.dona-panel .dona-unified-side{background:linear-gradient(165deg,#182e34,#111e24 75%)!important;border-right:1px solid #294047}
body.dona-panel .dona-unified-side .admin-brand-sub{color:#8faeb4!important}
body.dona-panel .dona-unified-side .admin-nav a{color:#b6c6ca!important}
body.dona-panel .dona-unified-side .admin-nav a.active{background:#1b454b!important;color:#e4ffff!important;box-shadow:inset 3px 0 #4fd3d3!important}
body.dona-panel .dona-unified-side .admin-nav a.active .nav-icon{background:#5de0d01a!important;color:#6ee1d8!important}
body.dona-panel .dona-unified-side .admin-logout{background:#20353c!important;color:#e7f0f2!important;border:1px solid #40555b!important}
body.dona-panel :is(.primary,.btn-new,.btn.dark,.static-btn.dark,.submit-btn){background:var(--panel-accent)!important;border-color:var(--panel-accent)!important;color:white!important;box-shadow:none!important;border-radius:12px}
body.dona-panel :is(.primary,.btn-new,.btn.dark,.static-btn.dark,.submit-btn):hover:not(:disabled){background:var(--panel-accent-hover)!important}
body.dona-panel :is(.card,.panel,.stat,.stock-card,.stock-kpi,.users-card,.gestion-stat,.gestion-card,.employee-card,.dashboard-panel,.filters,.account-panel,.account-box){border-color:var(--panel-border)!important;box-shadow:0 4px 15px #263d4505!important;border-radius:18px!important;min-width:0}
body.dona-panel :is(.eyebrow,.stock-tab.active,.tab.active){color:var(--panel-accent)!important}
body.dona-panel :is(.stock-tab.active,.tab.active){border-bottom-color:var(--panel-accent)!important}
body.dona-panel :is(.stock-kpi.blue strong,.stock-kpi.teal strong){color:var(--panel-accent)!important}
body.dona-panel :is(.user-role.admin,.metric-icon.blue,.metric-icon.purple,.metric-icon.pink){background:var(--panel-soft)!important;color:var(--panel-accent)!important}
body.dona-panel .gestion-stat:after{background:radial-gradient(circle,#246f7618,transparent 70%)}
body.dona-panel :is(input,select,textarea){accent-color:var(--panel-accent);max-width:100%;min-width:0}
body.dona-panel :is(input,select,textarea):not([type=checkbox]):not([type=radio]){border-color:var(--panel-border)}
body.dona-panel :is(button,a,input,select,textarea):focus-visible{outline:3px solid #208c91!important;outline-offset:3px}
body.dona-panel :is(button,a){touch-action:manipulation}
body.dona-panel button:disabled{cursor:not-allowed}
body.dona-panel :is(.table-wrap,.stock-table-wrap,.import-preview){max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
body.dona-panel table thead th{background:#eef5f6!important;color:#496770!important;border-color:var(--panel-border)!important}
body.dona-panel table td{border-color:#e5edef!important}
body.dona-panel :is(.top,.head,.admin-topbar,.stock-head,.ventas-head,.employee-top,.panel-head,.panel-title-row,.toolbar,.stock-actions,.top-actions,.form-actions,.modal-actions,.import-footer,.payment-head){gap:12px;flex-wrap:wrap}
body.dona-panel :is(.stock-tabs,.tabs){max-width:100%;overflow-x:auto;flex-wrap:nowrap;overscroll-behavior-x:contain}
body.dona-panel :is(.stock-tabs,.tabs)>button{flex-shrink:0;white-space:nowrap}
body.dona-panel :is(.stat b,.metric b,.stock-kpi strong,.account-box b,.account-kpis strong,.gestion-stat strong){overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
body.dona-panel :is(.user-email,.device-name,.inventory-item-main,.history-row>div){overflow-wrap:anywhere;min-width:0}
/* Ventanas por encima de la navegación; no se fuerza display. */
body.dona-panel :is(.modal-back,.modal-backdrop,.stock-modal){z-index:2100!important;padding:20px;max-width:100%;}
body.dona-panel .modal:has(>.modal-card),body.dona-panel #modal.modal:has(>.box){z-index:2100!important}
body.dona-panel #paymentModal.modal-backdrop{z-index:2120!important}
body.dona-panel :is(.modal-back,.modal-backdrop)>.modal,
body.dona-panel :is(.stock-dialog,.modal-card),body.dona-panel #modal>.box{
 max-width:100%!important;max-height:calc(100vh - 40px)!important;max-height:calc(100dvh - 40px)!important;overflow-y:auto;overscroll-behavior-y:contain;min-width:0;border-radius:22px;
}
body.dona-panel :is(.form-grid,.stock-form,.gestion-form,.payment-grid,.tradein-fields,.warranty-grid)>*{min-width:0}
body.dona-panel :is(.stock-close,.close,.x){flex-shrink:0;min-width:38px;min-height:38px}
body.dona-panel [hidden]{display:none!important}
@media(max-width:1200px){
 body.dona-panel :is(.gestion-layout,.users-layout,.account-grid,.sale-bottom-grid){grid-template-columns:minmax(0,1fr)!important}
 body.dona-panel :is(.stock-kpis,.gestion-grid,.metric-grid,.stats){grid-template-columns:repeat(2,minmax(0,1fr))!important}
 body.dona-panel :is(.filters,.stock-toolbar){grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
/* Celular y tablet: menú horizontal, sin columnas residuales de 270/86px. */
@media(max-width:1000px){
 body.dona-panel.admin-body{overflow:auto!important;height:auto!important}
 body.dona-panel .admin-shell{display:block!important;height:auto!important;min-height:100dvh!important;grid-template-columns:minmax(0,1fr)!important}
 body.dona-panel .admin-shell>.dona-unified-side,body.dona-panel .dona-unified-side{position:relative!important;inset:auto!important;width:100%!important;min-width:0!important;max-width:none!important;height:auto!important;min-height:0!important;padding:14px 16px!important}
 body.dona-panel .dona-unified-side .admin-brand{padding:0 4px 12px!important;text-align:left!important}
 body.dona-panel .dona-unified-side .admin-brand-name{font-size:22px!important}
 body.dona-panel .dona-unified-side .admin-brand-sub{display:block!important}
 body.dona-panel .dona-unified-side .admin-nav{flex-direction:row!important;flex:0 0 auto!important;gap:6px!important;overflow-x:auto!important;overflow-y:hidden!important;padding-bottom:8px!important;width:100%!important}
 body.dona-panel .dona-unified-side .admin-nav a{display:flex!important;flex:0 0 auto!important;width:auto!important;min-height:44px!important;gap:7px!important;padding:7px 10px!important;transform:none!important}
 body.dona-panel .dona-unified-side .admin-nav a span:not(.nav-icon){display:inline!important;font-size:13px!important}
 body.dona-panel .dona-unified-side .admin-nav a small{display:none!important}
 body.dona-panel .dona-unified-side .admin-logout{align-self:flex-end!important;width:auto!important;margin:8px 0 0!important;font-size:12px!important;padding:8px 12px!important;min-height:40px!important}
 body.dona-panel .dona-unified-side .admin-logout:after{content:none!important}
 body.dona-panel .admin-shell>main,body.dona-panel .employee-page{margin-left:0!important;width:100%!important;max-width:none!important;height:auto!important;max-height:none!important;overflow:visible!important;padding:26px 20px 50px!important}
 body.dona-panel :is(.admin-topbar,.stock-head,.ventas-head,.employee-top,.top,.head){align-items:flex-start}
 body.dona-panel :is(.employee-form,.sale-top-grid){grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:650px){
 body.dona-panel .admin-shell>main,body.dona-panel .employee-page{padding:24px 14px 40px!important}
 body.dona-panel :is(.form-grid,.stock-form,.gestion-form,.filters,.stock-toolbar,.detail-grid,.account-summary,.account-kpis,.payment-summary,.payment-grid,.tradein-fields,.warranty-grid,.stock-summary,.sale-top-grid,.sale-bottom-grid,.sale-row,.employee-form,.info,.gestion-grid){grid-template-columns:minmax(0,1fr)!important}
 body.dona-panel :is(.form-grid,.stock-form,.employee-form,.tradein-fields)>.full{grid-column:1/-1!important}
 body.dona-panel :is(.toolbar,.top-actions,.stock-actions,.form-actions,.modal-actions,.import-footer,.payment-head,.user-row,.user-row-actions){flex-wrap:wrap!important;max-width:100%;min-width:0}
 body.dona-panel :is(.toolbar input,.toolbar select,.toolbar .search,.toolbar .select){min-width:0!important;width:100%!important;flex:1 1 100%}
 body.dona-panel :is(.stock-actions,.top-actions){width:100%}
 body.dona-panel :is(.stock-actions,.top-actions)>*{flex:1 1 auto;justify-content:center}
 body.dona-panel :is(.card,.panel,.users-card,.employee-card,.dashboard-panel){max-width:100%}
 body.dona-panel :is(.users-card,.employee-card,.dashboard-panel){padding:18px!important}
 body.dona-panel :is(.modal-back,.modal-backdrop,.stock-modal),body.dona-panel .modal:has(>.modal-card),body.dona-panel #modal.modal:has(>.box){padding:10px!important}
 body.dona-panel :is(.modal-back,.modal-backdrop)>.modal,body.dona-panel :is(.stock-dialog,.modal-card),body.dona-panel #modal>.box{padding:20px 16px!important;max-height:calc(100vh - 20px)!important;max-height:calc(100dvh - 20px)!important;border-radius:18px!important}
 body.dona-panel :is(.stock-dialog h2,.modal-head h2,.modal h2){font-size:25px;line-height:1.2;padding-right:32px;overflow-wrap:break-word}
 body.dona-panel :is(input,select,textarea){font-size:16px!important}
 body.dona-panel :is(.stock-tab,.tab,.btn,.static-btn,.primary,.secondary){min-height:42px}
 body.dona-panel .sale-wizard-steps{max-width:100%;overflow-x:auto}
 body.dona-panel #employee-sale-form :is(.sale-mode,.tradein-categories){grid-template-columns:minmax(0,1fr)!important}
 body.dona-panel #employee-sale-form #stock-picker #stock-category-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 body.dona-panel #employee-sale-form .stock-category-filter{grid-template-columns:minmax(0,1fr)!important}
}
@media(max-width:390px){body.dona-panel :is(.stock-kpis,.metric-grid,.stats){grid-template-columns:minmax(0,1fr)!important}}
@media(prefers-reduced-motion:reduce){body.dona-panel *,body.dona-panel *::before,body.dona-panel *::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
/* Botones secundarios, formularios auxiliares y modal anidado de pagos. */
body.dona-panel .static-btn:not(.dark):not(.danger){background:#fff!important;color:var(--panel-ink)!important;border:1px solid var(--panel-border)!important;box-shadow:none!important;border-radius:12px}
body.dona-panel :is(.gestion-modal,.stock-link-modal){z-index:2100!important;padding:20px;}
body.dona-panel :is(.gestion-dialog,.stock-link-dialog){max-width:100%!important;max-height:calc(100dvh - 40px)!important;overflow:auto;min-width:0}
body.dona-panel #editPaymentModal{z-index:2120!important}
body.dona-panel :is(.gestion-table-wrap,.stock-link-results){min-width:0;max-width:100%;overflow-x:auto}
body.dona-panel .chartline{stroke:var(--panel-accent)!important}
body.dona-panel .dot{fill:var(--panel-accent)!important}
body.dona-panel .sale-mode :is(button.active,button.selected){background:var(--panel-soft)!important;border-color:var(--panel-accent)!important;color:var(--panel-accent)!important}
body.dona-panel .sale-mode button.active small{color:var(--panel-muted)!important}
body.dona-panel .tradein-box{background:var(--panel-soft)!important;border-color:var(--panel-border)!important}
@media(max-width:650px){
 body.dona-panel :is(.gestion-modal,.stock-link-modal){padding:10px!important}
 body.dona-panel :is(.gestion-dialog,.stock-link-dialog){padding:20px 16px!important;max-height:calc(100dvh - 20px)!important;border-radius:18px!important}
 body.dona-panel :is(.sale-wizard-step-inner,.sale-section-title){padding:18px!important}
 body.dona-panel :is(.sale-wizard-controls,.stock-quantity-control,.imei-lookup-row,.tradein-head){flex-wrap:wrap!important;gap:10px!important}
 body.dona-panel .sale-wizard-controls .static-btn{min-width:0!important;flex:1 1 auto}
 body.dona-panel .sale-wizard-title{font-size:32px!important}
}
body.dona-panel{--sale-blue:var(--panel-accent)}
body.dona-panel .sale-mode button.active span{color:var(--panel-muted)!important}
/* Catálogo y variantes: responder al espacio del editor, no a anchos fijos. */
body.dona-panel :is(.product-admin-layout,.product-editor-wrap,.product-list-card,.product-editor){min-width:0;max-width:100%}
body.dona-panel .variant-add-grid{grid-template-columns:repeat(auto-fit,minmax(min(160px,100%),1fr))!important}
body.dona-panel :is(.admin-page-head,.editor-title,.editor-actions,.stock-link-row,.image-upload-row){flex-wrap:wrap;gap:12px}
body.dona-panel .product-row{grid-template-columns:42px minmax(0,1fr) auto;gap:8px}
body.dona-panel .product-row.selected{background:var(--panel-soft)!important}
body.dona-panel .upc-launch{background:var(--panel-accent)!important;color:white!important}
body.dona-panel :is(.sale-top-prev,.sale-wizard-back){border:1px solid var(--panel-border);border-radius:10px;background:#fff;color:var(--panel-accent);min-height:40px;min-width:40px}
@media(max-width:1350px){body.dona-panel .product-admin-layout{grid-template-columns:minmax(0,1fr)!important}body.dona-panel .product-list{max-height:280px;overflow:auto}}
@media(max-width:650px){
 body.dona-panel :is(.editor-grid,.variant-row,.variant-add-grid){grid-template-columns:minmax(0,1fr)!important}
 body.dona-panel .editor-grid>.wide{grid-column:1/-1}
 body.dona-panel .variant-stock-display{grid-column:auto!important;grid-row:auto!important}
 body.dona-panel .sale-wizard-steps{display:flex!important;gap:4px!important;justify-content:space-between}
 body.dona-panel .sale-wizard-steps .sale-step-dot{flex:1 1 0!important;min-width:0!important;width:auto!important;font-size:10px!important}
 body.dona-panel .sale-wizard-steps .sale-step-line{display:none!important}
}
