/* Shared by the admin shell and its standalone business frames. */
.mobile-nav-backdrop,.mobile-nav-close{display:none}
@media screen and (max-width:768px){
  html,body,#app{min-width:0!important;width:100%;box-sizing:border-box}
  body{padding:0!important}
  .layout-container{height:100vh!important;height:100dvh!important;min-width:0}
  .layout-container>.el-container{min-width:0;width:100%}
  .layout-container .layout-aside{position:fixed!important;inset:0 auto 0 0;height:100vh!important;height:100dvh!important;width:min(300px,85vw)!important;z-index:1999;transform:translateX(-100%);visibility:hidden;transition:transform .2s,visibility .2s;overflow:auto;overscroll-behavior:contain;box-sizing:border-box;padding-bottom:env(safe-area-inset-bottom)}
  .layout-container .layout-aside{z-index:1999!important}
  .layout-container.mobile-nav-open .layout-aside{transform:translateX(0);visibility:visible}
  .layout-aside .logo-area{padding:12px 48px 12px 12px;height:68px;box-sizing:border-box}
  .layout-aside .logo-text{white-space:normal!important;line-height:1.5;font-size:13px!important}
  .layout-aside .brand-mark{flex-shrink:0}
  .layout-aside .sidebar-menu{width:100%!important}
  .mobile-nav-close{display:block;position:absolute;top:15px;right:8px;width:40px;height:40px;border:0;border-radius:6px;background:transparent;color:white;font-size:28px;cursor:pointer}
  .mobile-nav-backdrop{position:fixed;inset:0;z-index:1998;border:0;background:rgba(15,30,45,.42);padding:0}
  .mobile-nav-open>.mobile-nav-backdrop{display:block}
  .layout-container .layout-header{height:56px!important;flex-shrink:0;padding:0 12px!important;gap:8px}
  .layout-header .header-left{min-width:0;gap:8px;flex:1}
  .layout-header .collapse-btn{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:40px;height:40px;font-size:22px;border-radius:6px}
  .layout-header .el-breadcrumb{min-width:0;line-height:1.5}
  .layout-header .el-breadcrumb__item:first-child{display:none}
  .layout-header .el-breadcrumb__item:last-child{max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .layout-header .user-entry{gap:6px;max-width:110px}
  .layout-header .user-entry>span:last-child{max-width:65px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
  .layout-container .layout-main{padding:12px!important;min-width:0;width:100%;box-sizing:border-box;overscroll-behavior-y:contain}
  .layout-main>iframe{height:calc(100vh - 80px)!important;height:calc(100dvh - 80px)!important;min-height:0!important;max-width:100%;display:block}
  .layout-main>section,.layout-main>div{min-width:0;max-width:100%;box-sizing:border-box}
  #app>.daily-report,#app>.patrol-calendar,#app>.registration{padding:12px;box-sizing:border-box;min-width:0}
  .heading,.heading-actions,.header-actions,.scope-toolbar,.issue-toolbar,.plan-toolbar,.card-title,.filter-actions,.summary-line,.section-heading,.dashboard-intro,.table-tools,.export-heading,.export-actions,.toolbar,.registration header,.registration footer{flex-wrap:wrap!important;min-width:0;gap:10px}
  .heading>div,.header-actions,.filters,.table-tools{min-width:0;max-width:100%;box-sizing:border-box}
  .heading h2{font-size:20px!important;line-height:1.5;overflow-wrap:anywhere}
  .filters{flex-wrap:wrap!important;gap:10px!important}
  .records-page .filters{grid-template-columns:minmax(0,1fr)!important}
  .filters>.el-select,.filters>.el-input,.filters>.el-date-editor,.table-tools>.el-input,.toolbar>input,.toolbar>select{max-width:100%!important;box-sizing:border-box}
  .heading .filters{width:100%;justify-content:flex-start}
  .el-form--inline .el-form-item{max-width:100%;margin-right:0}
  .el-form-item__content{min-width:0}
  .el-input,.el-select,.el-textarea,.el-date-editor{max-width:100%}
  .el-date-editor--daterange,.el-date-editor--datetimerange{box-sizing:border-box;max-width:100%!important;min-width:0!important}
  .el-range-editor .el-range-input{min-width:0}
  .el-button{min-height:36px;white-space:normal;line-height:1.4}
  .el-button+ .el-button{margin-left:0}
  .el-card__body{padding:14px}
  .page-card{padding:14px}
  .el-row{row-gap:12px}
  .el-row>.el-col{max-width:100%;flex-basis:100%}
  .cards,.metric-grid,.summary-row,.coverage-kpis,.counts{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  .cards>*,.metric-grid>*,.counts>*{min-width:0;padding:12px!important;overflow-wrap:anywhere}
  .metric strong,.metric-card strong,.counts strong{font-size:26px!important}
  .coverage-grid,.module-grid,.drawer-grid,.registration .fields{grid-template-columns:minmax(0,1fr)!important}
  .registration .modules{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .registration .toolbar label{min-width:0;max-width:100%}
  .registration .item-card{padding:14px}
  .registration footer{padding:12px;padding-bottom:max(12px,env(safe-area-inset-bottom))}
  .el-table{width:100%!important;max-width:100%;min-width:0}
  .el-table.el-table .el-table-fixed-column--left,.el-table.el-table .el-table-fixed-column--right{position:static!important}
  .el-table .el-table-fixed-column--left::before,.el-table .el-table-fixed-column--right::before{display:none!important}
  .scroll,.table-wrap,.calendar-scroll,.el-scrollbar__wrap,.mobile-table-scroll{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
  .mobile-table-scroll{width:100%;min-width:0}
  .daily-report .scroll>table:not(.calendar){min-width:640px}
  /* Frozen identity columns otherwise occupy virtually the whole phone. Keep vertical headers only. */
  .daily-report .calendar tr>:first-child,.daily-report .calendar tr>:nth-child(2),.calendar-table .unit-column,.calendar-table .project-column,.manager-calendar tr>:first-child{position:static!important;left:auto!important;box-shadow:none!important}
  .daily-report .calendar thead th,.calendar-table thead th,.manager-calendar thead th{position:sticky!important;top:0;left:auto!important}
  .daily-report .calendar tr>:first-child{width:100px!important;min-width:100px!important;max-width:100px!important}
  .daily-report .calendar tr>:nth-child(2){width:150px!important;min-width:150px!important;max-width:150px!important}
  .pager,.pagination-wrap,.el-pagination{justify-content:flex-start!important;flex-wrap:wrap;gap:8px;max-width:100%}
  .el-pagination .el-pager{display:flex;flex-wrap:wrap}
  .el-dialog{width:calc(100% - 24px)!important;max-width:calc(100vw - 24px);margin:12px auto!important;box-sizing:border-box;padding:14px}
  .el-dialog__body{overflow-x:auto;min-width:0}
  .el-dialog__header,.el-drawer__header{padding-right:32px;overflow-wrap:anywhere}
  .el-dialog__footer{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px}
  .el-drawer{max-width:100vw!important;width:100%!important;box-sizing:border-box}
  .el-drawer__body{padding:14px;min-width:0;overflow:auto}
  .el-drawer__header{margin-bottom:12px;padding:16px 48px 0 14px}
  .el-message-box{width:calc(100vw - 32px)!important;max-width:420px;box-sizing:border-box}
  .el-popper{max-width:calc(100vw - 16px)!important;box-sizing:border-box}
  .el-picker-panel{max-width:calc(100vw - 16px);overflow:auto}
  .el-date-range-picker{width:min(646px,calc(100vw - 16px))!important}
  .el-date-range-picker__body{display:flex;flex-wrap:wrap}
  .el-date-range-picker__content{float:none;width:100%!important;box-sizing:border-box}
  .el-date-range-picker__content.is-left{border-right:0;border-bottom:1px solid #e4e7ed}
  .el-descriptions__body{max-width:100%;overflow:auto}
  .el-descriptions__table{min-width:0;width:100%}
  .el-descriptions__table:has(.el-descriptions__row>:nth-child(3)){min-width:480px}
  .el-descriptions__cell{overflow-wrap:anywhere}
  .energy-page{height:calc(100dvh - 80px)!important;min-height:480px}
  .energy-page .module-frame{min-height:320px!important;box-sizing:border-box}
  .coverage{padding:12px!important;min-width:0}
  .branch-nav{max-width:100%;flex-wrap:wrap}
}
@media(prefers-reduced-motion:reduce){.layout-container .layout-aside{transition:none!important}}
