/* A.M. Imóveis — camada mobile (V8). Carregada por último. */
.bottom-nav{display:none}

@media (max-width:760px){
  html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
  html,body{overflow-x:hidden;max-width:100%}
  main,.content{min-width:0;max-width:100vw}
  .content>*{max-width:100%}
  .kpi-row,.stats,.finance-overview,.attention,.mini-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .kpi,.stat,.finance-kpi{min-width:0}
  .page-head>div{min-width:0}
  .menu-toggle .ico{display:block}
  body{padding-bottom:calc(64px + env(safe-area-inset-bottom))}
  .content{padding:14px 12px 24px!important}
  input,select,textarea{font-size:16px!important}   /* evita zoom automático no iPhone */
  .btn,.v5-btn,button{min-height:42px}
  .link-danger{min-height:auto}

  /* topo */
  .topbar{padding:0 10px!important;gap:8px;height:60px!important}
  .search{padding:8px 10px!important}

  /* barra inferior de atalhos — rosa da marca */
  .bottom-nav{display:flex;flex-direction:row!important;gap:2px!important;position:fixed;left:0;right:0;bottom:0;z-index:40;
    background:linear-gradient(180deg,#b0236a,#8f1752);border-top:0;box-shadow:0 -8px 24px #86124430;
    padding:6px 6px calc(6px + env(safe-area-inset-bottom));border-radius:18px 18px 0 0}
  .bottom-nav a,.bottom-nav button{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;position:relative;
    text-decoration:none;color:#fbd9e8!important;font-size:11px;font-weight:600;background:none!important;border:0!important;min-height:54px;
    border-radius:14px;padding:4px 0;font-family:inherit;letter-spacing:.01em;-webkit-tap-highlight-color:transparent}
  .bottom-nav a span,.bottom-nav button span{display:block!important;flex:none!important;line-height:1.1}
  .bottom-nav a b{display:block!important}
  .bottom-nav a .ico,.bottom-nav button .ico{width:23px;height:23px;stroke-width:1.9}
  .bottom-nav a:hover{color:#fff!important;background:none!important;border-left:0!important}
  .bottom-nav a.active{color:#fff!important;background:#ffffff26!important;font-weight:700}
  .bottom-nav a.active .ico{stroke-width:2.3}
  .bottom-nav a.active:before{content:"";position:absolute;top:-6px;left:50%;transform:translateX(-50%);width:26px;height:3px;border-radius:0 0 4px 4px;background:#fff}
  .bottom-nav b{position:absolute;top:3px;left:calc(50% + 7px);background:#fff;color:#a41f61;font-size:9.5px;font-weight:800;border-radius:10px;padding:1px 5px;min-width:16px;text-align:center}
  .liviz-footer{padding-bottom:8px}

  /* cabeçalhos de página */
  .page-head{margin-bottom:14px!important}
  .page-head h1{font-size:23px!important;line-height:1.2}
  .page-head p{font-size:12.5px!important}
  .head-actions{width:100%;gap:6px}
  .head-actions .btn,.head-actions .v5-btn{flex:1 1 auto;font-size:12.5px!important;padding:9px 10px!important}
  .head-actions .inline-select{width:100%}.head-actions .inline-select select{flex:1;min-width:0}
  .panel-head{flex-wrap:wrap;gap:8px}
  .panel h2,.v5-panel h2{font-size:16px}

  /* cartões de indicadores */
  .kpi-row{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px}
  .kpi{padding:12px!important}
  .kpi strong{font-size:17px!important;word-break:break-word}
  .kpi small{font-size:11px}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px}
  .stat{padding:12px!important}
  .stat strong{font-size:20px!important;word-break:break-word}
  .stat i{display:none}
  .finance-overview{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px}
  .finance-kpi,a.finance-kpi{display:block!important;padding:12px!important}
  .finance-kpi strong{font-size:16px!important;word-break:break-word}
  .finance-kpi small,.finance-kpi span{font-size:10.5px!important}
  .finance-kpi.hero-kpi{grid-column:1/-1}
  .attention{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px}
  .mini-stats{grid-template-columns:repeat(2,1fr)!important}

  /* tabelas viram cartões (classe rt aplicada por script) */
  .table-wrap{overflow:visible}
  table.rt thead{display:none}
  table.rt,table.rt tbody{display:block;width:100%}
  table.rt tr{display:block;background:#fff;border:1px solid #ecdde4;border-radius:12px;padding:10px 12px;margin-bottom:10px}
  table.rt td{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:5px 0!important;border:0!important;
    text-align:right;font-size:13px;min-height:0}
  table.rt td::before{content:attr(data-label);flex:none;max-width:45%;text-align:left;font-size:10.5px;font-weight:700;color:#8a95a5;
    text-transform:uppercase;letter-spacing:.03em;padding-top:2px}
  table.rt td[data-label=""]::before{display:none}
  table.rt td[data-label=""]{justify-content:flex-end}
  table.rt td:first-child{display:block;text-align:left;font-size:14.5px;border-bottom:1px solid #f3e7ed!important;padding-bottom:8px!important;margin-bottom:4px}
  table.rt td:first-child::before{display:none}
  table.rt td[colspan]{display:block;text-align:center;border:0!important;margin:0}
  table.rt td .block,table.rt td small.block{text-align:inherit}
  table.rt tr.clickable-row{cursor:pointer}
  table.rt td.nowrap{white-space:normal;flex-wrap:wrap;justify-content:flex-end}
  table.rt td form{display:inline-flex}

  /* CRM e Loft: colunas deslizando para o lado */
  .kanban,.kanban.kanban-two-rows,.loft-kanban{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;
    scroll-snap-type:x mandatory;gap:10px!important;padding-bottom:10px!important;margin:0 -12px;padding-left:12px!important;padding-right:12px!important}
  .kanban .column,.kanban.kanban-two-rows .column,.loft-kanban .column{flex:0 0 84vw!important;width:84vw!important;min-width:84vw!important;
    min-height:auto!important;scroll-snap-align:start}
  .crm-summary{flex-wrap:wrap;gap:8px}
  .swipe-hint{display:block!important}

  /* agenda */
  .week-strip{gap:4px}
  .week-strip a{padding:8px 0 6px}
  .week-strip i{top:-6px!important;right:-3px!important}
  .agenda-date{width:100%}
  .agenda-date .date-br{flex:1;min-width:0}
  .timeline>div{grid-template-columns:44px 12px 1fr!important}
  .agenda-actions{flex-wrap:wrap;gap:6px}
  .agenda-actions .btn{flex:1}

  /* leads */
  .lead-grid{grid-template-columns:1fr!important}
  .lead-card .assign{display:flex;gap:6px}
  .lead-card .assign select{flex:1;min-width:0}
  .filter-stats .filter-card{padding:10px!important}

  /* filtros, formulários e modais */
  .filters,.property-filter{flex-direction:column}
  .filters input,.filters select{width:100%;flex:none!important;height:auto!important;min-height:44px}
  .detail-status{flex-direction:column;align-items:stretch!important}
  .detail-status .btn{width:100%}
  .detail-list{grid-template-columns:1fr 1fr!important}
  .modal{align-items:flex-end!important}
  .modal-card,.modal-card.wide-card,.property-modal-card{width:100vw!important;max-width:100vw!important;max-height:92dvh;border-radius:18px 18px 0 0!important;
    padding:18px 14px calc(18px + env(safe-area-inset-bottom))!important}
  .v5-form,.form.two-col,.property-admin-form{grid-template-columns:1fr!important}
  .upload-line{flex-direction:column;align-items:stretch}
  .upload-line input,.upload-line select,.upload-line button{width:100%}
  .percent-form{grid-template-columns:1fr 1fr!important}
  .percent-form .btn{grid-column:1/-1}

  /* imóvel */
  .property-grid{grid-template-columns:1fr!important}
  .gallery-thumbs{grid-template-columns:repeat(3,1fr)!important;max-height:none}
  .gallery-thumbs img{height:80px}
  .property-specs{grid-template-columns:repeat(3,1fr)!important}
  .property-actions .btn{width:100%}

  /* financeiro, metas e etapas */
  .fin-tabs{flex-wrap:nowrap!important;overflow-x:auto;margin:0 -12px 14px;padding:0 12px 10px!important}
  .fin-tabs a{white-space:nowrap;flex:none}
  .commission-grid{grid-template-columns:1fr 1fr!important}
  .finance-chart-layout{grid-template-columns:1fr!important}
  .meta-nums{grid-template-columns:1fr 1fr!important}
  .meta-nums strong{font-size:16px!important}
  .stepper form{min-width:96px}
  .stage-bar{flex-wrap:nowrap;overflow-x:auto;margin:0 -12px 12px;padding:0 12px 6px}
  .stage-bar a{white-space:nowrap;flex:none}
  .loc-right{align-items:stretch;width:100%}
  .loc-right .v5-btn,.loc-right select{width:100%}
  .v5-item{padding:12px!important}
  .agent-grid{grid-template-columns:1fr!important}
  .perfis-info{grid-template-columns:1fr 1fr!important}
  .doc-editor{min-height:60vh}
  .alert-grid{grid-template-columns:1fr!important}
  .ind-row>div{gap:8px}
  .cred-box b{font-size:14px}
}
@media (max-width:360px){
  .kpi-row,.stats,.finance-overview,.attention{grid-template-columns:1fr!important}
  .bottom-nav a,.bottom-nav button{font-size:9.5px}
}
