.finance-kpis,.report-kpis{margin-bottom:18px}.finance-kpis{grid-template-columns:repeat(3,1fr)}.danger-kpi{border-color:#7d362e;background:#2d1916}.report-filter{margin-bottom:18px}.report-filter-hint{margin:10px 2px 0;color:var(--muted);font-size:12px;grid-column:1/-1}.report-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.report-grid .table-wrap{margin-top:0}.report-grid section:last-child{grid-column:1/-1}@media(max-width:850px){.report-grid{grid-template-columns:1fr}.report-grid section:last-child{grid-column:auto}.report-kpis{grid-template-columns:repeat(2,1fr)}}@media(max-width:550px){.finance-kpis,.report-kpis{grid-template-columns:1fr}}
@media print{.report-filter,.page-heading button{display:none!important}body{background:white;color:black}.card,.kpi{background:white;color:black;border-color:#bbb}.kpi span,th{color:#444}
/* Grids não paginam bem na impressão: o navegador corta o conteúdo que ultrapassa a folha em vez de continuar na próxima página.
   Por isso, em impressão trocamos os grids por blocos empilhados, que fluem e quebram de página normalmente. */
.report-kpis{display:flex;flex-wrap:wrap;gap:10px}.report-kpis .kpi{flex:1 1 200px;min-height:0;break-inside:avoid}
.report-grid{display:block}.report-grid section{margin-bottom:16px}
.card{break-inside:avoid}
.table-wrap table{break-inside:auto}
.table-wrap tr{break-inside:avoid;break-after:auto}
.table-wrap thead{display:table-header-group}
}
.install-app{padding:8px 12px;font-size:12px}.alert-board{display:grid;gap:12px}.alert-card{display:flex;align-items:center;gap:15px;background:var(--panel);border:1px solid var(--line);border-left:5px solid #638fee;border-radius:10px;padding:16px;text-decoration:none}.alert-card.urgent{border-left-color:#ff5c4d}.alert-card.warning-card{border-left-color:var(--yellow)}.alert-card i{display:grid;place-items:center;width:42px;height:42px;border-radius:9px;background:#292b2c;font-style:normal}.alert-card div{flex:1}.alert-card b{font-size:16px}.alert-card p{margin:4px 0 0;color:var(--muted)}.alert-card em{font-style:normal;color:var(--yellow);font-size:25px}.empty-alerts{text-align:center}.empty-alerts span{display:inline-grid;place-items:center;width:55px;height:55px;border-radius:50%;background:#173d25;color:#8ee5a9;font-size:28px}
.replenishment-report,.stock-closing-report{margin-top:18px}.report-section-title{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:14px}.report-section-title h2,.report-section-title p{margin:0}.report-section-title>div>p:last-child{color:var(--muted);margin-top:4px}.report-section-title>strong{padding:8px 11px;border-radius:20px;background:var(--yellow);color:#151515}.report-ok{padding:25px;text-align:center;color:#8ee5a9}.replenishment-report .low-stock td:last-child strong{display:inline-block;padding:5px 9px;border-radius:7px;background:#4a3910;color:#ffe075}@media print{.services-report,.replenishment-report,.stock-closing-report{break-before:page}.report-section-title>strong{border:1px solid #555;background:#fff}.stock-closing-report table,.replenishment-report table,.services-report table{font-size:10px}}
.import-export-row{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-top:12px}.import-export-row .button{width:auto}.import-inline-form{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:0}.import-inline-form input[type=file]{max-width:220px;font-size:12px;color:var(--muted)}.import-inline-form button{width:auto;padding:9px 14px}.import-errors{margin:12px 0 0;padding-left:18px;color:#ff8a7a;font-size:13px;max-height:220px;overflow-y:auto}.import-errors li{margin-bottom:4px}.import-help{margin:0;padding-left:18px;color:var(--muted);font-size:13px;line-height:1.6}.import-help li{margin-bottom:6px}@media(max-width:600px){.import-export-row{flex-direction:column;align-items:stretch}.import-inline-form{flex-direction:column;align-items:stretch}.import-inline-form input[type=file]{max-width:none}}
.staff-form [hidden]{display:none!important}
.usuario-capacidades[hidden]{display:none!important}
.usuario-capacidades{grid-column:1/-1;border:1px solid var(--line);border-radius:10px;padding:14px 16px;margin:4px 0}
.usuario-capacidades .capacidades-titulo{display:block;color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:1.2px;margin-bottom:10px}
.usuario-capacidades .capacidades-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 18px}
.usuario-capacidades .capacidades-grid label.check{padding:2px 0;text-transform:none;font-weight:500;letter-spacing:normal;font-size:14px}
@media(max-width:650px){.usuario-capacidades .capacidades-grid{grid-template-columns:1fr}}
.confirma-senha-admin{border-top:1px dashed var(--line);padding-top:16px;margin-top:6px}
.confirma-senha-admin small{display:block;text-transform:none;font-size:11px;letter-spacing:normal;font-weight:400;color:var(--muted);margin-top:5px}
.license-card{width:min(480px,100%);text-align:left}
.license-status{list-style:none;margin:0 0 18px;padding:14px 16px;border:1px solid var(--line);border-radius:10px;display:grid;gap:8px;font-size:14px}
.license-hint{margin-top:16px;color:var(--muted)}
.license-hint small{color:var(--muted)}

/* V4.2.1 FINAL — contadores dos relatórios no mobile.
   O contador fica abaixo do título/descrição, compacto e alinhado à esquerda,
   sem quebrar palavras ou ocupar uma coluna estreita. */
@media (max-width: 780px){
  .services-report .report-section-title,
  .replenishment-report .report-section-title,
  .stock-closing-report .report-section-title{
    display:grid;
    grid-template-columns:minmax(0,1fr);
    align-items:start;
    justify-items:start;
    gap:10px;
  }
  .services-report .report-section-title>div,
  .replenishment-report .report-section-title>div,
  .stock-closing-report .report-section-title>div{
    min-width:0;
    width:100%;
  }
  .services-report .report-section-title>strong,
  .replenishment-report .report-section-title>strong{
    display:inline-flex;
    align-items:center;
    justify-content:flex-start;
    width:auto;
    min-width:0;
    max-width:100%;
    padding:6px 10px;
    border-radius:9px;
    font-size:12px;
    line-height:1.15;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .services-report .report-section-title>strong::before{content:'👥';margin-right:6px;}
  .replenishment-report .report-section-title>strong::before{content:'📦';margin-right:6px;}
}
@media (max-width: 390px){
  .services-report .report-section-title>strong,
  .replenishment-report .report-section-title>strong{
    padding:5px 9px;
    font-size:11px;
  }
}

/* V4.2.3 — RELATÓRIO MOBILE
   Correção estrutural da apresentação no celular:
   - conteúdo do relatório respeita a área do cabeçalho fixo;
   - contador compacto e legível;
   - tabela de atendimentos vira cartões verticais;
   - desktop permanece com a tabela original.
*/
@media (max-width: 780px){
  /* Reserva de espaço para cabeçalhos fixos sem deslocar o layout desktop.
     Os seletores cobrem as estruturas usuais do DGestor sem alterar o HTML. */
  main{
    scroll-margin-top:72px;
  }

  /* Se o conteúdo principal estiver sob um header fixo, cria somente no mobile
     a folga necessária. */
  body:has(header){
    --mobile-header-offset:72px;
  }

  body:has(header) main{
    padding-top:var(--mobile-header-offset);
  }

  .services-report,
  .replenishment-report,
  .stock-closing-report{
    width:100%;
    max-width:100%;
    min-width:0;
    box-sizing:border-box;
    overflow:visible;
  }

  .services-report .report-section-title,
  .replenishment-report .report-section-title,
  .stock-closing-report .report-section-title{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    justify-content:flex-start;
    gap:9px;
    width:100%;
    box-sizing:border-box;
    margin-bottom:14px;
  }

  .services-report .report-section-title>div,
  .replenishment-report .report-section-title>div,
  .stock-closing-report .report-section-title>div{
    width:100%;
    min-width:0;
  }

  .services-report .report-section-title h2,
  .replenishment-report .report-section-title h2,
  .stock-closing-report .report-section-title h2{
    max-width:100%;
    overflow-wrap:normal;
    word-break:normal;
  }

  .services-report .report-section-title>strong,
  .replenishment-report .report-section-title>strong{
    display:inline-flex;
    align-items:center;
    justify-content:flex-start;
    align-self:flex-start;
    width:auto;
    max-width:100%;
    min-height:32px;
    box-sizing:border-box;
    padding:6px 10px;
    border-radius:10px;
    font-size:12px;
    line-height:1.2;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .services-report .report-section-title>strong::before{
    content:'👥';
    flex:0 0 auto;
    margin-right:6px;
  }

  .replenishment-report .report-section-title>strong::before{
    content:'📦';
    flex:0 0 auto;
    margin-right:6px;
  }

  /* Atendimento: tabela -> cartões */
  .services-report .table-wrap{
    width:100%;
    max-width:100%;
    margin-top:14px;
    overflow:visible;
    box-sizing:border-box;
  }

  .services-report .table-wrap table{
    display:block;
    width:100%;
    max-width:100%;
    min-width:0 !important;
    border-collapse:separate;
    box-sizing:border-box;
  }

  .services-report .table-wrap thead{
    display:none;
  }

  .services-report .table-wrap tbody{
    display:block;
    width:100%;
    max-width:100%;
    box-sizing:border-box;
  }

  .services-report .table-wrap tbody tr{
    display:block;
    width:100%;
    max-width:100%;
    min-width:0;
    margin:0 0 10px;
    padding:11px 12px;
    box-sizing:border-box;
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:10px;
    overflow:hidden;
  }

  .services-report .table-wrap tbody td{
    display:grid;
    grid-template-columns:minmax(92px,34%) minmax(0,1fr);
    align-items:start;
    width:100%;
    min-width:0 !important;
    max-width:100%;
    box-sizing:border-box;
    gap:9px;
    padding:7px 0;
    border-bottom:1px solid #242729;
    white-space:normal !important;
    overflow:visible;
    overflow-wrap:anywhere;
    word-break:normal;
    font-size:12px;
    line-height:1.35;
  }

  .services-report .table-wrap tbody td:last-child{
    border-bottom:0;
  }

  .services-report .table-wrap tbody td::before{
    color:var(--muted);
    font-size:10px;
    line-height:1.3;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.45px;
  }

  .services-report .table-wrap tbody td:nth-child(1)::before{content:'Nº';}
  .services-report .table-wrap tbody td:nth-child(2)::before{content:'Mesa/Balcão';}
  .services-report .table-wrap tbody td:nth-child(3)::before{content:'Atendente';}
  .services-report .table-wrap tbody td:nth-child(4)::before{content:'Horário inicial';}
  .services-report .table-wrap tbody td:nth-child(5)::before{content:'Horário final';}

  .services-report .table-wrap tbody td:first-child{
    color:var(--ink);
    font-weight:800;
  }

  /* Evita que elementos internos com largura mínima recriem overflow. */
  .services-report .table-wrap td > *,
  .services-report .table-wrap td > a,
  .services-report .table-wrap td > span,
  .services-report .table-wrap td > strong{
    min-width:0;
    max-width:100%;
    overflow-wrap:anywhere;
  }
}

@media (max-width:390px){
  body:has(header) main{
    padding-top:68px;
  }

  .services-report .report-section-title>strong,
  .replenishment-report .report-section-title>strong{
    min-height:30px;
    padding:5px 9px;
    font-size:11px;
  }

  .services-report .table-wrap tbody tr{
    padding:10px;
  }

  .services-report .table-wrap tbody td{
    grid-template-columns:88px minmax(0,1fr);
    gap:7px;
    font-size:11.5px;
  }
}

/* V4.2.4 — TABELA DE ATENDIMENTOS COM ROLAGEM HORIZONTAL NO MOBILE
   Mantém a tabela original; somente o bloco da tabela rola horizontalmente.
*/
@media (max-width: 780px){
  html, body{
    max-width:100%;
    overflow-x:hidden;
  }

  /* Container da tabela: rolagem horizontal isolada */
  .services-report .table-wrap{
    display:block;
    width:100%;
    max-width:100%;
    min-width:0;
    overflow-x:auto !important;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-x:contain;
    box-sizing:border-box;
    scrollbar-width:thin;
    padding-bottom:6px;
  }

  /* Restaura a tabela como tabela; não transforma linhas em cards. */
  .services-report .table-wrap table{
    display:table !important;
    width:max-content !important;
    min-width:720px !important;
    max-width:none !important;
    table-layout:auto !important;
    border-collapse:collapse;
    box-sizing:border-box;
  }

  .services-report .table-wrap thead{
    display:table-header-group !important;
  }

  .services-report .table-wrap tbody{
    display:table-row-group !important;
    width:auto !important;
    max-width:none !important;
  }

  .services-report .table-wrap tbody tr{
    display:table-row !important;
    width:auto !important;
    max-width:none !important;
    min-width:0 !important;
    margin:0 !important;
    padding:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    overflow:visible !important;
  }

  .services-report .table-wrap th,
  .services-report .table-wrap td{
    display:table-cell !important;
    width:auto !important;
    min-width:0 !important;
    max-width:none !important;
    white-space:nowrap !important;
    overflow:visible !important;
    overflow-wrap:normal !important;
    word-break:normal !important;
    padding:8px 10px !important;
    box-sizing:border-box;
  }

  .services-report .table-wrap tbody td::before{
    content:none !important;
    display:none !important;
  }

  /* Indicação discreta de que a tabela pode ser deslizada */
  .services-report .table-wrap::before{
    content:'Deslize para o lado →';
    display:block;
    width:max-content;
    margin:0 0 6px auto;
    padding:3px 7px;
    border-radius:6px;
    font-size:10px;
    line-height:1.2;
    color:var(--muted);
    background:rgba(255,255,255,.04);
  }
}

@media (max-width:390px){
  .services-report .table-wrap table{
    min-width:700px !important;
  }

  .services-report .table-wrap th,
  .services-report .table-wrap td{
    padding:7px 9px !important;
    font-size:11.5px;
  }
}

/* V4.2.5 — FIX REAL DO SCROLL DA TABELA MOBILE
   A V4.2.4 dependia de .table-wrap. Esta versão também cobre a situação
   em que a tabela está diretamente dentro de .services-report.
*/
@media (max-width:780px){

  /* Nunca permitir que o documento inteiro role horizontalmente. */
  html, body{
    width:100%;
    max-width:100%;
    overflow-x:hidden !important;
  }

  /* Caminho 1: estrutura com .table-wrap */
  .services-report .table-wrap{
    display:block !important;
    position:relative;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    -webkit-overflow-scrolling:touch !important;
    overscroll-behavior-x:contain;
    touch-action:pan-x pan-y;
    box-sizing:border-box;
  }

  .services-report .table-wrap > table{
    display:table !important;
    width:max-content !important;
    min-width:760px !important;
    max-width:none !important;
    table-layout:auto !important;
    box-sizing:border-box;
  }

  /* Caminho 2: caso a tabela seja filha direta do relatório.
     O próprio bloco do relatório vira o viewport horizontal. */
  .services-report:has(> table){
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    overflow-x:auto !important;
    overflow-y:visible !important;
    -webkit-overflow-scrolling:touch !important;
    overscroll-behavior-x:contain;
    touch-action:pan-x pan-y;
    box-sizing:border-box;
  }

  .services-report:has(> table) > table{
    display:table !important;
    width:max-content !important;
    min-width:760px !important;
    max-width:none !important;
    table-layout:auto !important;
    box-sizing:border-box;
  }

  /* Caminho 3: tabela em qualquer descendente quando não há .table-wrap.
     Mantém largura real da tabela e deixa o relatório ser o viewport. */
  .services-report:has(table:not(.table-wrap table)){
    overflow-x:auto;
  }

  .services-report:has(table:not(.table-wrap table)) table{
    min-width:760px !important;
    width:max-content !important;
    max-width:none !important;
    table-layout:auto !important;
  }

  /* A tabela continua sendo uma tabela; nada de cards/empilhamento. */
  .services-report table thead{
    display:table-header-group !important;
  }

  .services-report table tbody{
    display:table-row-group !important;
  }

  .services-report table tr{
    display:table-row !important;
  }

  .services-report table th,
  .services-report table td{
    display:table-cell !important;
    white-space:nowrap !important;
    word-break:normal !important;
    overflow:visible !important;
    min-width:0 !important;
    max-width:none !important;
  }

  .services-report table td::before{
    content:none !important;
    display:none !important;
  }

  /* Indicador fixo dentro do viewport do relatório. */
  .services-report .table-wrap::after,
  .services-report:has(> table)::after{
    content:'← deslize a tabela →';
    display:block;
    position:sticky;
    right:8px;
    width:max-content;
    margin:5px 8px 0 auto;
    padding:4px 8px;
    border-radius:7px;
    background:rgba(255,193,7,.12);
    color:var(--yellow);
    font-size:10px;
    line-height:1.2;
    pointer-events:none;
    z-index:2;
  }
}

@media (max-width:390px){
  .services-report .table-wrap > table,
  .services-report:has(> table) > table,
  .services-report:has(table:not(.table-wrap table)) table{
    min-width:720px !important;
  }
}
