/* Shared layout rules, loaded after module styles. */
html{color-scheme:dark;scroll-padding-top:16px}
body{min-height:100dvh}
body.modal-open{overflow:hidden}
button,input,select,textarea{touch-action:manipulation}
input,select,textarea{max-width:100%}
button:focus-visible,a:focus-visible,textarea:focus-visible{outline:2px solid #8fa4ff;outline-offset:3px}
.dashboard-layout>*,.users-heading>*,.product-filters>*,.product-form>*,.dashboard-header>*{min-width:0}
.dashboard-content h1{font-size:clamp(1.5rem,3vw,2rem);overflow-wrap:anywhere}
.dashboard-header strong,.management-dialog h2,.product-dialog-heading h2{overflow-wrap:anywhere}
.users-table{max-width:100%;overscroll-behavior-inline:contain;scrollbar-color:#52678f #111c2f}
dialog{max-height:calc(100dvh - 24px);overscroll-behavior:contain}
.management-dialog{max-width:calc(100vw - 24px)}
.management-dialog [role=alert]{color:#ffabb6}
.mobile-menu-toggle{display:none}
.daily-sheet-dialog:not(.physical-stock-dialog){max-height:calc(100dvh - 24px)}
.daily-sheet-dialog:not(.physical-stock-dialog) .daily-sheet-table{max-height:calc(100dvh - 360px)}
@media(max-width:1024px){
 .dashboard-page{padding:20px}
 .dashboard-layout{grid-template-columns:180px minmax(0,1fr);gap:24px;padding-top:28px}
 .module-sidebar{padding:16px 10px}
 .user-button,.module-link,.logout-button{min-height:44px}
 .product-row-actions button{min-height:44px}
 .platform-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
 .product-filters{grid-template-columns:repeat(2,minmax(0,1fr))}
 .daily-sheet-table input{min-height:44px}
}
@media(max-width:850px){
 .dashboard-layout{grid-template-columns:minmax(0,1fr);gap:20px;padding-top:18px}
 .module-sidebar{padding:10px}
 .mobile-menu-toggle{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:44px;padding:10px 12px;border:1px solid var(--line);border-radius:9px;color:var(--text);background:var(--panel);font:inherit;font-weight:600;cursor:pointer}
 .mobile-menu-toggle::after{content:'☰';font-size:1.2rem}
 .mobile-menu-toggle[aria-expanded=true]::after{content:'×'}
 .module-sidebar .sidebar-heading{display:none}
 .module-sidebar .mobile-menu-toggle[aria-expanded=false]~.module-nav{display:none}
 .module-sidebar .module-nav{grid-template-columns:repeat(2,minmax(0,1fr));margin-top:10px}
 .module-link,.module-pending{overflow-wrap:anywhere}
 .header-status{display:none}
 .product-filters input,.product-filters select,.management-dialog input,.management-dialog select,.management-dialog textarea,.account-form input,.sheet-search input,.daily-sheet-table input,.transfer-destination,.sheet-observation,.product-form input,.product-form select{font-size:16px;min-height:44px}
 .empty-review input,.management-dialog input[type=checkbox]{min-height:20px;width:20px}
}
@media(max-width:600px){
 .dashboard-page{padding:12px}
 .dashboard-header{gap:10px;padding-bottom:14px;flex-wrap:wrap}
 .dashboard-brand{font-size:.9rem}
 .dashboard-header>div:not(.profile-area){font-size:.85rem}
 .dashboard-content{padding-bottom:24px}
 .users-heading{gap:10px}
 .users-heading h1{flex-basis:100%}
 .users-heading>.user-button{flex:1 1 auto}
 .product-filters{grid-template-columns:minmax(0,1fr);gap:12px;margin-top:18px}
 .product-filters label:first-child{grid-column:auto}
 .products-toolbar{align-items:stretch;gap:14px}
 .product-actions{width:100%}
 .product-actions button{flex:1 1 120px}
 .product-form,.product-detail,.product-detail dl{grid-template-columns:minmax(0,1fr)}
 .product-dialog-heading{flex-wrap:wrap;margin-bottom:18px}
 .product-footer,.user-actions{flex-wrap:wrap}
 .product-footer button,.user-actions button{flex:1 1 auto}
 #productDialog,#productImportDialog,.management-dialog{width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:16px;border-radius:12px}
 .platform-stat{padding:16px}
 .platform-stat strong{font-size:26px}
 .empty-dashboard{margin-top:16px;padding:24px 16px}
 .daily-sheet-dialog,.daily-sheet-dialog.physical-stock-dialog,.daily-sheet-dialog:not(.physical-stock-dialog){width:calc(100vw - 12px);max-width:calc(100vw - 12px);max-height:calc(100dvh - 12px)}
 .daily-sheet-dialog .daily-sheet,.daily-sheet-dialog:not(.physical-stock-dialog) .daily-sheet{padding:12px}
 .daily-sheet-dialog .users-heading{display:grid;grid-template-columns:minmax(0,1fr) 44px}
 .daily-sheet-dialog .users-heading h2{grid-column:1/-1;font-size:1.15rem}
 .daily-sheet-dialog .users-heading button{min-height:44px}
 .daily-sheet-dialog .daily-sheet-table,.daily-sheet-dialog:not(.physical-stock-dialog) .daily-sheet-table{max-height:none;min-height:0;overflow:visible;border:0;background:transparent;scrollbar-gutter:auto}
 .daily-sheet-dialog .daily-sheet-table table,.daily-sheet-dialog:not(.physical-stock-dialog) .daily-sheet-table table{display:block;min-width:0;width:100%}
 .daily-sheet-dialog .daily-sheet-table thead{display:none}
 .daily-sheet-dialog .daily-sheet-table tbody{display:block}
 .daily-sheet-dialog .daily-sheet-table tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;margin-bottom:16px;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:var(--line)}
 .daily-sheet-dialog .daily-sheet-table tbody td,.daily-sheet-dialog .daily-sheet-table tbody th,.daily-sheet-dialog:not(.physical-stock-dialog) .daily-sheet-table th:first-child{display:block;position:static;min-width:0;max-width:none;padding:10px;border:0;background:#111c2f;text-align:left}
 .daily-sheet-dialog .daily-sheet-table tbody th{grid-column:1/-1}
 .daily-sheet-dialog .daily-sheet-table tbody td::before{content:attr(data-label);display:block;margin-bottom:8px;color:#afc0df;font-size:.78rem;font-weight:500}
 .daily-sheet-dialog .daily-sheet-table tbody td[data-label=Observación]{grid-column:1/-1}
 .daily-sheet-dialog .daily-sheet-table input,.daily-sheet-dialog:not(.physical-stock-dialog) .daily-sheet-table input,.daily-sheet-dialog .transfer-destination,.daily-sheet-dialog .sheet-observation{width:100%;max-width:100%;min-height:44px;font-size:16px}
 .daily-sheet-dialog .sheet-observation{min-height:80px}
 .daily-sheet-dialog .daily-sheet-table .sheet-final{background:#173b38}
 .daily-sheet-dialog .daily-sheet-table td.sheet-exit{background:#392c17}
 .daily-sheet-dialog .daily-sheet-table .sheet-state,.daily-sheet-dialog .daily-sheet-table .sheet-adjustment{min-width:0}
 .movement-pagination{justify-content:center;gap:8px}
 .movement-pagination button{min-height:44px}
 .login-page{padding:16px;min-height:100dvh}
 .login-card{width:100%;min-width:0;padding:26px 18px}
 .login-card input{font-size:16px}
}
@media(max-width:360px){.platform-stats{grid-template-columns:minmax(0,1fr)}.module-sidebar .module-nav{grid-template-columns:minmax(0,1fr)}}
@media(max-height:500px) and (min-width:601px){
 .daily-sheet-dialog:not(.physical-stock-dialog) .daily-sheet-table{max-height:none}
 .login-page{align-items:flex-start}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
