/* All layout overrides are restricted to phones. Desktop keeps app.css. */
.mobile-bottom-nav,#mobile-navigation,.mobile-network-status { display:none; }
@media(max-width:700px){
  :root { --mobile-bar-height:calc(72px + env(safe-area-inset-bottom,0px)); }
  html,body { max-width:100%; }
  .main,.content,.panel,.dashboard-grid>* ,.field-grid>*,.finance-workspace,.finance-page-body,.filters { min-width:0; }
  .main { padding-bottom:calc(var(--mobile-bar-height) + 24px); }
  .topbar { padding-top:env(safe-area-inset-top,0px); height:calc(62px + env(safe-area-inset-top,0px)); }
  .topbar .mobile-menu,.sidebar,.sidebar.open,.overlay.visible { display:none!important; }
  .breadcrumb-text { min-width:0; overflow-wrap:anywhere; }
  .top-actions { flex-shrink:0; }
  .content { padding:22px 14px; }
  .page-heading h1,.finance-document-head h3,.project-info h3,.profile-summary h3 { overflow-wrap:anywhere; }
  .page-heading p { line-height:1.7; }
  .heading-actions { display:flex; gap:8px; width:100%; }
  .heading-actions .btn { flex:1 1 130px; }
  .btn,.text-button,.nav-item { min-height:44px; }
  .form-control,.form-select,.hub-select-trigger { font-size:16px; max-width:100%; }
  .field-grid { min-width:0; }.field-grid>* { max-width:100%; }
  .filters { width:100%; flex-wrap:wrap; }.toolbar { flex-wrap:wrap; }
  .filters>* { min-width:0; flex:1 1 130px; max-width:100%; }
  .search-input { flex-basis:100%; }
  .stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .stat-top,.stat-foot { overflow-wrap:anywhere; }
  .project-row,.task-line { gap:10px; padding:14px; min-width:0; }
  .project-info,.task-line>div { min-width:0; }.project-row .progress-group { max-width:80px; }
  .task-line h3 { white-space:normal; overflow-wrap:anywhere; }.task-line .date { flex-shrink:0; }
  .project-card { padding:18px; }.project-card-footer { flex-wrap:wrap; gap:10px; }
  .board { max-width:100%; grid-auto-columns:min(84vw,300px); grid-template-columns:none; grid-auto-flow:column; scroll-snap-type:x proximity; padding-bottom:12px; }
  .board .kanban-column { width:auto; min-width:0; scroll-snap-align:start; }
  .calendar-head { gap:12px; flex-wrap:wrap; }.calendar-controls { gap:5px; }
  .table-responsive { max-width:100%; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; }
  .table-responsive .table td,.table-responsive .table th { white-space:normal; min-width:110px; padding:12px; overflow-wrap:anywhere; }
  .table-responsive .table td small { white-space:normal; overflow-wrap:anywhere; }
  .table-responsive .table td:last-child { min-width:120px; }
  .table-responsive .table td .d-flex { flex-wrap:wrap; }
  .billing-days-table { min-width:950px; }.billing-days-table td { vertical-align:middle; }
  .finance-page-body { padding:18px 12px; }.finance-page-body .time-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .finance-page-body .time-fields>* { min-width:0; }.time-day-heading { gap:8px; flex-wrap:wrap; }
  .time-day-heading .day-hours { margin-left:auto; }.finance-page-body .time-fields input { width:100%; }
  .finance-page-body .billing-week { flex-wrap:wrap; gap:10px; padding:14px 0; }.billing-week>span { min-width:0; flex:1 1 160px; }
  .billing-sheet-option { gap:10px; flex-wrap:wrap; }.billing-sheet-option>span { min-width:0; flex:1; }.billing-sheet-option strong { white-space:nowrap; }
  .finance-page-actions { bottom:var(--mobile-bar-height); padding:12px; }.finance-page-actions .btn { white-space:normal; }
  .finance-page-primary { flex-wrap:wrap; }.finance-page-primary .btn { flex:1 1 120px; }
  .signature-panel code { display:block; overflow-wrap:anywhere; word-break:break-all; }.signature-panel a { overflow-wrap:anywhere; }
  .finance-total { gap:12px; flex-wrap:wrap; }.finance-page-feedback { padding:0 12px; }
  .notice-card,.notice-body,.notice-content { min-width:0; overflow-wrap:anywhere; }.notice-mention { max-width:100%; white-space:normal; text-align:left; }
  .notice-toolbar { flex-wrap:wrap; }.notice-editor { min-width:0; max-width:100%; }
  dialog:not(#mobile-navigation) { width:calc(100vw - 20px); max-width:calc(100vw - 20px); max-height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); margin:auto; }
  dialog .dialog-body { min-width:0; overflow-wrap:anywhere; }dialog header h2 { overflow-wrap:anywhere; }
  dialog footer { flex-wrap:wrap; gap:8px; }dialog footer .btn { flex:1 1 120px; }
  dialog .d-flex:has(#f-cnpj),.finance-page-body .d-flex:has(#issuer-cnpj) { flex-wrap:wrap; }
  .profile-summary { flex-wrap:wrap; }.profile-summary>div { min-width:0; overflow-wrap:anywhere; }
  .company-details summary { white-space:normal; }.company-details .field-grid { padding:14px; }
  .checklist-item { min-width:0; }.checklist-item input[type=text] { min-width:0; }.checklist-item label { overflow-wrap:anywhere; }
  .photo-crop-stage,.photo-cropper,.crop-stage { max-width:100%; }
  .notification { bottom:calc(var(--mobile-bar-height) + 14px); }.hub-notification { max-width:calc(100vw - 24px); }
  .page-footer { flex-wrap:wrap; gap:6px; }
  .mobile-bottom-nav { position:fixed; z-index:40; left:0; right:0; bottom:0; display:grid; grid-template-columns:1fr 1fr 54px 1fr 1fr; height:var(--mobile-bar-height); padding:8px 8px calc(8px + env(safe-area-inset-bottom,0px)); background:#fff; border-top:1px solid #dce5eb; box-shadow:0 -5px 20px #002b4606; }
  .mobile-bottom-nav::before { content:''; position:absolute; width:132px; height:33px; left:calc(50% - 66px); top:-32px; background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='33' viewBox='0 0 132 33'%3E%3Cpath d='M0 32C22 32 27 30 34 18C40 7 51 1 66 1C81 1 92 7 98 18C105 30 110 32 132 32V33H0Z' fill='white'/%3E%3Cpath d='M0 32C22 32 27 30 34 18C40 7 51 1 66 1C81 1 92 7 98 18C105 30 110 32 132 32' fill='none' stroke='%23dce5eb'/%3E%3C/svg%3E") center/contain no-repeat; pointer-events:none; }
  .mobile-bottom-nav>button:not(.mobile-menu-lift) { border:0; background:transparent; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; font-size:10px; color:#6b7e8b; min-width:0; }
  .mobile-bottom-nav>button[aria-current=page] { color:#002b46; font-weight:700; }.mobile-bottom-nav .icon { width:21px; height:21px; }
  .mobile-bottom-nav .mobile-menu-lift { position:absolute; top:-25px; left:calc(50% - 25px); width:50px; height:50px; border:0; border-radius:50%; background:white; color:#002b46; display:grid; place-items:center; }.mobile-menu-lift .icon { transform:rotate(-90deg); }
  #mobile-navigation[open] { display:flex; flex-direction:column; position:fixed; inset:0; margin:0; width:100%; max-width:none; height:100dvh; max-height:none; border:0; border-radius:0; padding:calc(20px + env(safe-area-inset-top,0px)) 20px calc(20px + env(safe-area-inset-bottom,0px)); background:#f7f9fb; color:#002b46; }
  #mobile-navigation::backdrop { background:#f7f9fb; }.mobile-navigation-open { overflow:hidden; }
  .mobile-navigation-head { display:flex; justify-content:space-between; align-items:center; padding:0 0 16px; border:0; gap:18px; }.mobile-navigation-head img { width:190px; max-width:70%; }.mobile-navigation-head button { border:1px solid #dce5eb; background:#fff; border-radius:50%; width:44px; height:44px; flex-shrink:0; padding:0; display:grid; place-items:center; line-height:1; }
  .mobile-navigation-head button svg { display:block; width:18px; height:18px; }
  .mobile-menu-caption { font-size:12px; color:#7b8c99; margin:4px 0 20px; }
  #mobile-navigation>nav { overflow:auto; flex:1; min-height:0; overscroll-behavior:contain; }
  #mobile-navigation .nav-scope { margin:0 0 22px; }#mobile-navigation .nav-scope summary { padding:10px 8px; }
  #mobile-navigation .nav-item { background:white; border:1px solid #e6ecf0; margin:6px 0; padding:14px; font-size:14px; }#mobile-navigation .nav-item.active { background:#edf3f7; border-color:#d2e1ec; }
  .mobile-navigation-foot { display:flex; flex-wrap:wrap; gap:10px; padding:16px 0 0; border-top:1px solid #dce5eb; }.mobile-navigation-foot button { flex:1 1 130px; padding:12px; display:flex; align-items:center; justify-content:center; gap:8px; background:#fff; border:1px solid #dce5eb; border-radius:3px; font-size:12px; }
  .mobile-network-status { display:block; padding:10px 14px; position:fixed; top:0; left:0; right:0; background:#faf4e6; color:#80652e; z-index:1200; font-size:12px; }
}
@media(max-width:700px){.finance-page-actions{bottom:calc(var(--mobile-bar-height) + 24px)}.main{padding-bottom:calc(var(--mobile-bar-height) + 48px)}}

@media(max-width:700px){
 .login-form-area{min-height:100dvh;padding-top:calc(28px + env(safe-area-inset-top,0px));padding-bottom:calc(28px + env(safe-area-inset-bottom,0px))}
 .table-responsive::after{content:'Deslize para ver todas as colunas ↔';display:block;position:sticky;left:0;padding:9px 12px;font-size:10px;color:#6d8393;background:#f7f9fb;width:100%;box-sizing:border-box}
 .hub-calendar-menu{max-width:calc(100vw - 20px)}
}

@media(max-width:700px){
 #mobile-navigation .mobile-menu-group{margin:0 0 22px}
 #mobile-navigation .mobile-menu-group h2{font-size:10px;letter-spacing:1.3px;text-transform:uppercase;font-weight:650;color:#6d8393;margin:0 0 10px;padding:0 3px}
 #mobile-navigation .mobile-menu-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
 #mobile-navigation .mobile-menu-tile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;min-width:0;min-height:92px;padding:12px 6px;border:1px solid #e3eaef;border-radius:4px;background:#fff;color:#536c7e;font-size:11px;line-height:1.45;text-align:center;overflow-wrap:anywhere}
 #mobile-navigation .mobile-menu-tile .icon{width:23px;height:23px;color:#31566f;flex-shrink:0}
 #mobile-navigation .mobile-menu-tile.active{background:#edf3f7;border-color:#bcd0df;color:#002b46;font-weight:650}
 #mobile-navigation .mobile-menu-tile:focus-visible{outline:2px solid #7797af;outline-offset:2px}
 #mobile-navigation .mobile-menu-tile:active{background:#e8eff4}
}

@media(max-width:700px){.mobile-bottom-nav .mobile-menu-center{color:#31566f}.mobile-bottom-nav .mobile-menu-center .icon{width:20px;height:20px;stroke-width:1.4}}

@media(max-width:700px){
 .mobile-bottom-nav>button.mobile-menu-center{position:relative;z-index:1;align-self:stretch;justify-content:center;padding:0;margin:0;gap:0;line-height:1}
 .mobile-bottom-nav>button.mobile-menu-center .icon{display:block;width:22px;height:22px;flex-shrink:0;overflow:visible}
 .mobile-bottom-nav .mobile-menu-lift{height:40px;top:-25px}
}

/* Mobile records use the available width, including empty and filtered states. */
@media(max-width:700px){
 .table-responsive{overflow:visible;min-width:0;width:100%;border-radius:4px}
 .table-responsive::after{display:none}
 .table-responsive .table{display:block;min-width:0!important;width:100%;margin:0;table-layout:auto}
 .table-responsive .table thead{display:none}
 .table-responsive .table tbody{display:block;width:100%}
 .table-responsive .table tbody tr{display:block;min-width:0;width:100%;padding:12px;border-bottom:1px solid #dce5eb;background:white}
 .table-responsive .table tbody tr:last-child{border-bottom:0}
 .table-responsive .table tbody td{display:grid;grid-template-columns:minmax(75px,28%) minmax(0,1fr);gap:12px;align-items:start;min-width:0!important;max-width:100%;width:100%!important;padding:9px 0;border:0;white-space:normal!important;text-align:left;overflow-wrap:anywhere;box-shadow:none}
 .table-responsive .table tbody td[data-mobile-label]::before{content:attr(data-mobile-label);font-size:10px;font-weight:600;letter-spacing:.3px;color:#6d8393;line-height:1.7}
 .table-responsive .table tbody td>*{min-width:0;max-width:100%}
 .table-responsive .table tbody td small{grid-column:2;line-height:1.6;margin:0}
 .table-responsive .table tbody td>b,.table-responsive .table tbody td>strong{grid-column:2}
 .table-responsive .table tbody td[colspan]{display:block;padding:0}
 .table-responsive .table tbody td[colspan] .empty{width:100%;min-width:0;padding:30px 14px;text-align:center}
 .table-responsive .table tbody td[colspan] .empty h3,.table-responsive .table tbody td[colspan] .empty p{max-width:100%;white-space:normal;overflow-wrap:anywhere}
 .table-responsive .table tbody td .btn,.table-responsive .table tbody td .text-button{white-space:normal;max-width:100%;min-height:44px}
 .table-responsive .table tbody td .tag{justify-self:start;white-space:normal}
 .table-responsive .table tbody:empty::after{content:'Nenhum registro disponível.';display:block;padding:28px 14px;text-align:center;color:#6d8393;font-size:13px}
 .billing-days-table .billing-day-action{width:100%}
 .billing-days-table .billing-day-periods,.billing-days-table .billing-day-night,.billing-days-table .billing-day-project{max-width:none;min-width:0}
 .table-responsive .table tbody td:not([data-mobile-label]):not([colspan]){display:block}
 .panel-head{flex-wrap:wrap;gap:12px;align-items:flex-start}
 .panel-head>div{min-width:0;flex:1 1 160px}
 .panel-head h2,.panel-head p,.panel-head .text-button{overflow-wrap:anywhere;white-space:normal}
 .panel-head>.btn{flex:0 1 auto}
 .page-heading>div,.finance-document-head,.review-controls,.signature-panel,.finance-company-summary>div{min-width:0;max-width:100%}
 .review-controls label,.signature-panel p,.finance-company-summary b{overflow-wrap:anywhere;white-space:normal}
 .finance-company-summary{flex-wrap:wrap;gap:12px}
 .finance-page-body .time-fields input{min-inline-size:0;max-inline-size:100%;box-sizing:border-box}
 .finance-page-body .sheet-read-entries article header{flex-wrap:wrap}
 .billing-selection-group header{flex-wrap:wrap;gap:10px}
 .project-row{flex-wrap:wrap}.project-row .project-info{flex:1 1 140px}
 .project-row .progress-group{max-width:100%;margin-left:auto}
 .task-line .date{font-size:10px}
 .page-footer span{max-width:100%;overflow-wrap:anywhere}
 .mobile-bottom-nav{padding-left:4px;padding-right:4px;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 48px minmax(0,1fr) minmax(0,1fr)}
 .mobile-bottom-nav>button:not(.mobile-menu-lift){padding-left:2px;padding-right:2px;font-size:9px}
}
@media(max-width:700px){.table-responsive .table tbody td>*{grid-column:2}.table-responsive .table tbody td[colspan]>*{grid-column:auto}}
@media(max-width:700px){.hub-select-trigger .hub-select-value{white-space:normal;text-overflow:clip;overflow:visible;overflow-wrap:anywhere;text-align:left}.hub-select-trigger{height:auto;min-height:44px}.empty h3{font-size:15px}.empty p{font-size:13px;line-height:1.7}} @media(max-width:380px){.filters>*{flex-basis:100%}}

@media(max-width:700px){.time-day-heading .day-hours{white-space:normal;margin-left:0;text-align:left}.finance-page-body .time-fields input[type=checkbox]{width:15px;flex:0 0 15px}.finance-page-body .lunch-toggle{justify-content:flex-start}}
