/* Escala proporcional à referência de 1672 × 941, com limites legíveis. */
@media(min-width:1181px){
 #appScreen{--dashboard-unit:clamp(.72px,min(.0598086124vw,.1062699256svh),1.15px);}
 #appScreen .header{flex-wrap:nowrap;}
 #appScreen .header-right{flex-wrap:nowrap;min-width:0;}
 #appScreen .header-left{min-width:0;flex-shrink:0;}
 #appScreen .comp-chip{min-width:0;}
 #appScreen .comp-chip select{overflow:hidden;text-overflow:ellipsis;}
 #appScreen .table-header{flex-wrap:nowrap;}
 #appScreen .table-header h2{flex-shrink:0;white-space:nowrap;}
 #appScreen .table-filters{min-width:0;flex-wrap:nowrap;}
 #appScreen .search-box{min-width:calc(160 * var(--dashboard-unit));}
 #appScreen .filter-select-wrap{min-width:calc(200 * var(--dashboard-unit));}
 #appScreen .stat-card .st-icon .ui-icon{width:calc(36 * var(--dashboard-unit));height:calc(36 * var(--dashboard-unit));}
}
@media(min-width:761px) and (max-height:740px){
 .app-sidebar{padding-top:14px;padding-bottom:14px;}
 .side-nav{gap:6px;}
 .sidebar-brand{padding-bottom:16px;}
 .side-action{min-height:58px;}
 .side-placeholder{padding-top:12px;padding-bottom:12px;}
 .sidebar-bottom{padding-top:12px;}
}

@media(max-width:760px){
 .sidebar-brand strong{font-size:17px;}
 .sidebar-logo{width:42px;}
 .app-sidebar .side-overview,.app-sidebar .side-action,.app-sidebar .side-placeholder,.app-sidebar .sidebar-bottom button{font-size:12px;}
 .app-sidebar .side-action small{font-size:10px;}
 .app-sidebar .side-icon .ui-icon{width:22px;height:22px;}
}

/* Adaptação dos novos formulários sem alterar o layout da tela principal. */
@media(max-width:1024px){
 .lancamento-form-row{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;}
 .lancamento-form-row>.field:nth-child(2){grid-column:auto;}
 .lancamento-form-row>.btn-save{grid-column:1/-1;justify-self:end;}
 #appScreen #configScreen .config-table{min-width:850px;}
 #configScreen .config-header{flex-wrap:wrap;}
}
@media(max-width:640px){
 :root{--dialog-unit:1px;}
 #modalCasa,#modalLancamento,.config-modal-overlay{padding:10px;}
 .ref-modal,#modalCasa .modal,#modalLancamento .modal,#modalLancamento[data-view="deducao"] .modal,#modalNovoUsuario .config-modal,#modalNovaAdmin .config-modal{width:100%;max-width:100%;max-height:calc(100svh - 20px);border-radius:14px;}
 .ref-modal .modal-header,.ref-modal .config-modal-header,#modalCasa .modal-header,#modalNovoUsuario .config-modal-header{padding:18px 16px;gap:10px;}
 .ref-heading{gap:12px;}
 .ref-title-icon,#modalCasa .ref-title-icon{width:44px;height:44px;border-radius:10px;}
 .ref-title-icon .ui-icon{width:25px;height:25px;}
 .ref-modal h3,#modalCasa h3,#modalNovoUsuario h3,#modalLancamento[data-view="deducao"] h3{font-size:19px;}
 .ref-modal .modal-header p{font-size:13px;line-height:1.4;}
 .ref-modal .modal-body,.ref-modal .config-modal-body,#modalCasa .modal-body,#modalLancamento[data-view="deducao"] .modal-body,#modalNovoUsuario .config-modal-body{padding:20px 16px 0;}
 .ref-modal .field,#modalCasa .field{margin-bottom:18px;}
 .ref-modal .field label,#modalCasa .field label,#modalLancamento .field label,#modalLancamento[data-view="deducao"] .field label{font-size:15px;margin-bottom:8px;}
 .ref-modal .field input,.ref-modal .field select,#modalCasa .field input,#modalLancamento .field input,#modalLancamento .field select,#modalLancamento[data-view="deducao"] .field input,#modalLancamento[data-view="deducao"] .field select{height:48px;font-size:16px;border-radius:8px;}
 .ref-input-icon>.ui-icon{left:16px;width:22px;height:22px;}
 .ref-modal .ref-input-icon input,#modalLancamento .ref-input-icon input{padding-left:50px;}
 #modalLancamento .ref-money input{padding-left:60px;}
 .lancamento-form-row{grid-template-columns:1fr;gap:0;}
 .lancamento-form-row>.btn-save{width:100%;height:48px;font-size:16px;grid-column:auto;}
 #modalLancamento[data-view="deducao"] .lancamento-form-row .btn-save{height:48px;font-size:16px;}
 .ref-summary-title,#deducoesView .ref-summary-title{font-size:14px;margin-top:24px;gap:10px;}
 .ref-modal .resumo-table{min-width:540px;}
 .ref-modal .resumo-table thead th,.ref-modal .resumo-table tbody td,.ref-modal .resumo-table tfoot td,#deducoesView .resumo-table thead th{font-size:14px;padding:14px;}
 .ref-modal .modal-footer,.ref-modal .config-modal-footer,#modalCasa .modal-footer,#modalNovoUsuario .config-modal-footer,#modalLancamento[data-view="deducao"] .modal-footer{padding:20px 16px;gap:10px;}
 .ref-modal .btn-save,.ref-modal .btn-secondary,#modalCasa .modal-footer button{height:48px;font-size:16px;padding:12px 18px;}
 #modalNovoUsuario .config-admin-checkboxes{gap:10px;}
 #modalNovoUsuario .config-checkbox,#modalNovoUsuario .config-checkbox-perm{font-size:14px;padding:12px 10px;gap:8px;min-height:48px;overflow-wrap:anywhere;}
 #modalNovoUsuario .config-checkbox input,#modalNovoUsuario .config-checkbox-perm input{width:22px;height:22px;}
 #modalNovoUsuario .config-checkbox-perm{margin:0 0 20px;}
 #appScreen:has(#configScreen:not(.hidden)){padding:22px 12px;}
 #configScreen .config-header{gap:16px;}
 #configScreen .config-header-left{gap:12px;}
 #configScreen .config-logo-icon{width:52px;height:52px;border-radius:12px;}
 #configScreen .config-logo-icon .ui-icon{width:30px;height:30px;}
 #configScreen .config-title{font-size:23px;}
 .config-subtitle{font-size:14px;line-height:1.4;}
 #configScreen .config-btn-back{font-size:14px;height:44px;padding:10px 14px;gap:10px;}
 #configScreen .config-section{padding:0 12px 16px;}
 #configScreen .config-section-header{padding:16px 0;gap:14px;flex-wrap:wrap;}
 #configScreen .config-section-header h2{font-size:22px;gap:10px;}
 #configScreen .config-section-header h2 .ui-icon{width:28px;height:28px;}
 #configScreen .config-btn-add{font-size:15px;height:44px;padding:10px 16px;gap:10px;}
 #configScreen .config-admin-list{padding:16px 0 0;gap:10px;}
 #configScreen .config-admin-chip{font-size:15px;padding:12px 14px;gap:14px;}
}
@media(max-width:360px){#modalNovoUsuario .config-admin-checkboxes{grid-template-columns:1fr;}}
@media(max-width:1024px){#modalLancamento[data-view="deducao"] .lancamento-form-row{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:640px){#modalLancamento[data-view="deducao"] .lancamento-form-row{grid-template-columns:1fr;}}

@media(max-width:760px){.app-sidebar .sidebar-image-icon,.app-sidebar .side-icon .sidebar-image-icon{width:24px;height:24px;}}

@media(max-width:1200px){
 .rep-reference-panels{grid-template-columns:1fr;}
 .rep-reference>*{--ru:clamp(.63px,.108cqw,.9px);}
 .rep-reference-destinations{padding-left:10%;padding-right:10%;}
}
@media(max-width:640px){
 .rep-reference>*{--ru:.9px;}
 .rep-reference-header{padding:24px 12px;margin-bottom:16px;gap:16px;}
 .rep-reference-header>.ui-icon{width:38px;height:38px;}
 .rep-reference-header>div{padding-left:16px;}
 .rep-reference-header h1{font-size:23px;letter-spacing:-.5px;}
 .rep-reference-header p{font-size:16px;}
 .rep-reference-panel{padding:20px 14px 24px;border-radius:15px;}
 .rep-reference-panel h2{font-size:24px;margin-bottom:20px;}
 .rep-reference-equation{grid-template-columns:1fr;gap:10px;}
 .rep-ref-card,.rep-reference-destinations .rep-ref-card{min-height:135px;padding:20px;}
 .rep-ref-top .ui-icon{width:36px;height:36px;}
 .rep-ref-label,.rep-reference-destinations .rep-ref-label{font-size:15px;}
 .rep-ref-value,.rep-reference-destinations .rep-ref-value{font-size:28px;margin-top:20px;}
 .rep-ref-operator{font-size:25px;min-height:24px;}
 .rep-ref-connector{height:65px;}
 .rep-reference-destinations{grid-template-columns:1fr;gap:14px;padding:0;}
 .rep-reference-destinations .rep-ref-top{gap:18px;}
 .rep-ref-detail{font-size:13px;}
}

@media(max-width:760px){
 #appScreen:has(#configScreen:not(.hidden)){padding:16px 12px;}
 .rep-reference{max-width:100%!important;}
}

@media(max-width:1250px){.sector-grid{grid-template-columns:minmax(220px,.8fr) minmax(0,1.6fr);}.sector-detail-heading{flex-wrap:wrap;gap:16px;}.sector-actions{justify-content:flex-start;}}
@media(max-width:950px){.sector-grid{grid-template-columns:1fr;}.sector-list-card{min-height:0;}#setoresLista{max-height:300px;overflow:auto;}.sector-detail-card{min-height:380px;}}
@media(max-width:760px){
 #appScreen:has(#setoresScreen:not(.hidden))>.header,#appScreen:has(#importacaoScreen:not(.hidden))>.header{min-height:0;padding:0 0 16px;margin:0 0 18px;}
 #appScreen:has(#setoresScreen:not(.hidden))>.header .header-right,#appScreen:has(#importacaoScreen:not(.hidden))>.header .header-right{grid-template-columns:1fr;}
 .module-screen{--mu:1px;}.module-heading{margin:16px 2px 22px;align-items:flex-start;flex-wrap:wrap;gap:16px;}
 .module-heading-left{gap:14px;}.module-heading-left>.ui-icon{width:32px;height:32px;}.module-heading h1{font-size:26px;}.module-heading p{font-size:15px;}
 .module-primary,.module-secondary{font-size:14px;padding:12px 16px;gap:10px;}.module-primary .ui-icon,.module-secondary .ui-icon{width:20px;height:20px;}
 .sector-search-card{padding:12px;}.sector-search{gap:12px;padding:12px;}.sector-search input{font-size:16px;}
 .sector-grid{gap:14px;}.sector-list-card>h2{font-size:19px;}.sector-list-item{padding:16px;gap:16px;}.sector-list-item strong{font-size:17px;}.sector-list-item small{font-size:13px;}
 .sector-detail-heading{padding:20px 16px;}.sector-detail-title{gap:16px;}.sector-detail-title h2{font-size:25px;}.sector-detail-title p{font-size:15px;}.sector-detail-title>.ui-icon{width:30px;height:30px;}
 #appScreen #setoresScreen .sector-table td,#appScreen #setoresScreen .sector-table th{font-size:15px;padding:18px 14px;}.sector-detail-card>footer{font-size:14px;padding:16px;}
 .import-card{padding:16px;}.import-card>h2{font-size:20px;}.import-drop-area{padding:24px 16px;}.import-drop-area h3{font-size:19px;}.import-drop-area p{font-size:15px;}.import-drop-area small{font-size:12px;}
 .import-footer{flex-direction:column;align-items:stretch;gap:14px;}.import-footer p{font-size:13px;}
 #modalSetor .ref-modal,#modalVinculoSetor .ref-modal{width:100%;max-width:100%;}
}
