/* ============================================================
   HOROS — VERSÃO PARA CELULAR (2026-10-05, pedido do usuário: "tem que fazer as telas pro celular também")
   Carregado por último nas telas do app (depois do horos-ds.css). Tudo dentro de @media (max-width: 760px),
   a mesma quebra do useHorosMobile() do shell.jsx. Desktop não muda nada.
   - Barra lateral vira menu que desliza da esquerda (body.mnav-open) — botão ☰ no topo ou "Menu" embaixo
   - Barra de atalhos fixa embaixo (.mtab): Início · CRM · Mensagens · Agenda · Menu
   - Grades de várias colunas viram 1 coluna; tabelas rolam para o lado; janelas ocupam a tela
   ============================================================ */

/* Peças só do celular — escondidas no computador */
.mnav-scrim, .mnav-close, .mtab, .topbar-burger, .topbar-title-m, .mc-chat-back, .mc-rp-mclose { display: none; }

@media (max-width: 760px) {
  :root { --topbar-h: 56px; --mtab-h: 62px; --m-safe-b: env(safe-area-inset-bottom, 0px); }
  html, body { overflow-x: hidden; max-width: 100vw; }
  body { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
  /* iOS não dá zoom ao focar campo com fonte ≥ 16px */
  input, select, textarea { font-size: 16px !important; }

  /* ── Estrutura ─────────────────────────────────────────────── */
  .app, .app.density-compact { grid-template-columns: minmax(0, 1fr) !important; height: 100dvh; background-attachment: scroll; }
  .main { height: 100dvh; min-width: 0; }
  .content, .crm-content, .app.density-compact .content, .app.density-compact .crm-content {
    padding: 14px 12px calc(var(--mtab-h) + var(--m-safe-b) + 18px) !important;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar-toggle { display: none !important; }

  /* ── Menu lateral deslizante ───────────────────────────────── */
  .sidebar, .sidebar.collapsed {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 9300;
    width: min(296px, 86vw) !important; min-width: 0 !important; max-width: none !important; height: 100dvh;
    transform: translateX(calc(-100% - 64px)); transition: transform .28s cubic-bezier(.32,.72,0,1);
    box-shadow: 16px 0 40px -12px rgba(0,0,0,.55);
    padding-bottom: var(--m-safe-b);
  }
  body.mnav-open .sidebar { transform: none; }
  .mnav-scrim {
    display: block; position: fixed; inset: 0; z-index: 9250; background: rgba(0,0,0,.5);
    opacity: 0; pointer-events: none; transition: opacity .22s ease;
  }
  body.mnav-open .mnav-scrim { opacity: 1; pointer-events: auto; }
  body.mnav-open { overflow: hidden; }
  .mnav-close {
    display: grid; place-items: center; position: absolute; top: 14px; right: 12px; z-index: 2;
    width: 36px; height: 36px; border-radius: 10px; border: 0; background: rgba(255,255,255,.08); color: #fff; cursor: pointer;
  }
  .sidebar .nav-item, .sidebar a.nav-item { padding: 12px 14px; }
  .sidebar .brand { padding-right: 52px; }

  /* ── Topo ───────────────────────────────────────────────────── */
  .topbar { padding: 0 8px 0 4px; gap: 4px; padding-top: env(safe-area-inset-top, 0px); height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); }
  .topbar-burger {
    display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 10px;
    background: transparent; color: var(--fg); cursor: pointer; flex-shrink: 0;
  }
  .topbar-burger:active { background: var(--bg-2); }
  .topbar-title, .topbar-title-m { display: block; font-size: 16px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 1; }
  .topbar-actions { gap: 2px; flex-shrink: 0; }
  .topbar-actions .icon-btn { width: 40px; height: 40px; }
  .topbar-actions > div[style*="width: 6"] { display: none; }
  .topbar .btn-primary { width: 40px; height: 40px; padding: 0 !important; justify-content: center; border-radius: 10px; }
  .topbar-newlead-lbl { display: none; }

  /* Sino: painel ocupa a largura da tela */
  .hn-nc, [data-theme="light"] .hn-nc {
    position: fixed !important; top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px) + 6px) !important;
    left: 8px !important; right: 8px !important; width: auto !important; max-height: calc(100dvh - var(--topbar-h) - var(--mtab-h) - 30px) !important;
  }
  .hn-toast-stack { top: calc(var(--topbar-h) + 8px); left: 8px; right: 8px; align-items: stretch; }
  .hn-toast, [data-theme="light"] .hn-toast { width: auto; max-width: none; }

  /* ── Barra de atalhos embaixo ──────────────────────────────── */
  .mtab {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: calc(var(--mtab-h) + var(--m-safe-b)); padding-bottom: var(--m-safe-b);
    background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }
  .mtab-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: transparent; color: var(--fg-3); text-decoration: none; font: inherit; cursor: pointer;
    min-width: 0;
  }
  .mtab-item.active { color: var(--accent); }
  .mtab-item:active .mtab-ico { transform: scale(.9); }
  .mtab-ico { position: relative; display: grid; place-items: center; transition: transform .12s ease; }
  .mtab-lbl { font-size: 10.5px; font-weight: 500; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .mtab-badge {
    position: absolute; top: -5px; left: 13px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
    background: #ff3b30; color: #fff; font-size: 10px; font-weight: 600; line-height: 17px; text-align: center;
  }
  html.embed-mode .mtab, html.embed-mode .topbar-burger { display: none !important; }
  /* Some quando o teclado/uma conversa ocupa a tela */
  body:has(.mc-shell.has-conv) .mtab,
  body:has(.fl-editor) .mtab { display: none; }

  /* Guia de início: acima da barra de baixo */
  .tour-fab { bottom: calc(var(--mtab-h) + var(--m-safe-b) + 14px) !important; right: 14px !important; width: 44px !important; height: 44px !important; z-index: 61 !important; }
  .tour-panel { left: 8px !important; right: 8px !important; width: auto !important; bottom: calc(var(--mtab-h) + var(--m-safe-b) + 8px) !important; max-height: calc(100dvh - 160px); overflow-y: auto; }
  body:has(.mc-shell.has-conv) .tour-fab, body:has(.fl-editor) .tour-fab, body:has(.ia-shell) .tour-fab { display: none !important; }

  /* ── Cabeçalhos de página ──────────────────────────────────── */
  .page-head { flex-direction: column; align-items: stretch !important; gap: 12px; padding: 14px 16px !important; margin-bottom: 14px !important; }
  .page-head > * { min-width: 0; }
  .page-title { font-size: 18px !important; flex-wrap: wrap; gap: 4px 8px; line-height: 1.25; }
  .page-title .date { font-size: 12.5px; width: 100%; }
  .page-sub { font-size: 12.5px; }
  .page-head .btn-primary, .page-head .ghost-btn { flex-shrink: 0; }
  .page-head > div:last-child:not(:first-child) { display: flex; flex-wrap: wrap; gap: 8px; }
  .crm-head-top { flex-direction: column; align-items: stretch; gap: 12px; }
  .crm-title { font-size: 20px; }
  .crm-head-actions { flex-wrap: wrap; gap: 6px; }
  .crm-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .crm-search, .crm-toolbar .search { max-width: none; width: 100%; flex: 0 0 auto !important; }
  .crm-toolbar > * { flex: 0 0 auto; }
  .filter-pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin: 0 -2px; }
  .filter-pills::-webkit-scrollbar { display: none; }
  .filter-pill { flex-shrink: 0; }
  .segment-tabs { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  .segment-tabs::-webkit-scrollbar { display: none; }

  /* ── Cartões / painéis ─────────────────────────────────────── */
  .panel-head { padding: 14px 14px 8px !important; flex-wrap: wrap; gap: 8px; }
  .panel-actions { flex-wrap: wrap; gap: 6px; }
  .kpi { padding: 14px !important; }
  .kpi-value { font-size: 22px !important; }

  /* Grades → 1 ou 2 colunas */
  .kpi-grid, .rq-kpis, .fl-stats, .cli-summary, .ha-grid-4, .hsky-stats-inner, .ws-prof-kpis, .cred-stats, .bc-grid, .bc-summary,
  .cfg-plan-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; margin-bottom: 14px !important; }
  .main-grid, .crm-main, .mv-grid, .rep-grid, .rq-grid, .cli-detail-grid, .ced-layout, .ced-grid, .ced-sidebar-panel,
  .info-grid, .credit-breakdown, .bc-two, .ws-brand-grid, .ws-prof-edit, .pf-grid, .pf-grid-2, .pf-grid-3, .pf-recovery,
  .pf-bill-plans, .pf-bill-tax, .pf-up-grid, .pf-bill-reasons, .pf-ai-fields, .agx-when, .agx-row2, .agx-dialog.wide .agx-card,
  .ia-shortcuts, .ia-opp-grid, .ia-day-grid, .rep-forecast-stats, .rep-quick-grid, .cfg-grid, .cfg-grid-shell, .cfg-theme-grid,
  .int-wa-opts, .bcw-sources, .bcw-frow, .bcw-review, .bcw-msg-grid, .bcw-feats, .fl-tpl-grid, .ha-grid-2, .cred-summary,
  .mc-qrp-body, .ced-cred-analysis-result, .fl-cond, .bc-pace {
    grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important;
  }
  .main-grid, .mv-grid, .rep-grid { margin-bottom: 14px !important; }
  .cli-fields-grid, .cred-docs-grid, .prop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .int-strip, .int-grid, .int-goals { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  .agx-addr-grid { grid-template-columns: 1fr 1fr !important; }
  .agx-addr-grid > :nth-child(2) { grid-column: 1 / -1; }
  .pf-ai-segs { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .ws-prof-months { gap: 4px; }
  .ws-prof-stage { grid-template-columns: 96px 1fr 30px; }

  /* Tabelas: rolam para o lado dentro do cartão */
  .table { min-width: 640px; }
  .cli-table { min-width: 960px !important; }
  .panel:has(> .table), .cli-table-wrap, .ia-table-wrap, .fl-exec-table, .rep-section:has(table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .panel > .table { display: block; overflow-x: auto; min-width: 0; }
  .panel > .table > thead, .panel > .table > tbody { display: table; width: max(640px, 100%); table-layout: auto; }

  /* ── Janelas e gavetas: tela cheia ─────────────────────────── */
  .drawer { width: 100vw !important; max-width: 100vw !important; }
  .ws-drawer { width: 100vw; padding: 18px 14px calc(24px + var(--m-safe-b)); }
  .mc-client-drawer { width: 100vw !important; min-width: 0 !important; }
  .cli-sheet { width: 100vw; min-width: 0; }
  .kem-box, .rep-mbox, .rq-modal, .fl-modal, .agx-dialog, .int-modal, .logo-ed, .bc-modal, .bcw-modal {
    width: 100vw !important; max-width: 100vw !important; max-height: 100dvh !important;
    border-radius: 14px 14px 0 0 !important;
  }
  .int-modal { height: calc(100dvh - 24px) !important; }
  .rep-ov, .rq-overlay, .fl-overlay, .agx-overlay, .int-modal-ov, .logo-ed-overlay { align-items: flex-end !important; padding: 0 !important; }
  /* Modais brancos com estilo inline (Novo Lead, Editar lead etc.) */
  [role="dialog"] { max-width: 100vw; }
  .modal-overlay > div, .nlm-box, .new-lead-modal { max-width: calc(100vw - 16px) !important; }

  /* ── Kanban (Dashboard e CRM): uma coluna por vez, desliza para o lado ── */
  .kanban { padding: 8px 0 12px; scroll-snap-type: x mandatory; scroll-padding: 0 12px; overscroll-behavior-x: contain; }
  .kanban-cols { padding: 0 12px; gap: 10px; }
  /* a barrinha de rolagem de cima "puxava de volta" a rolagem durante o deslizar */
  .kb-topscroll { display: none !important; }
  .kb-mstages { display: flex; align-items: center; gap: 6px; padding: 8px 8px 0; }
  .kb-mstages-arrow { flex-shrink: 0; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--fg-2); display: grid; place-items: center; }
  .kb-mstages-arrow:disabled { opacity: .35; }
  .kb-mstages-strip { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .kb-mstages-strip::-webkit-scrollbar { display: none; }
  .kb-mstage { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--fg-2); font-size: 13px; white-space: nowrap; }
  .kb-mstage.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); color: var(--fg); font-weight: 600; }
  .kb-mstage-dot { width: 8px; height: 8px; border-radius: 50%; }
  .kb-mstage-n { font-size: 11.5px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
  .crm-kcol, .kcol, .app.density-compact .crm-kcol { width: calc(100vw - 48px) !important; max-width: 360px; scroll-snap-align: start; }
  .kbx-card .kbx-actions, .crm-lead .kbx-actions { opacity: 1; }
  .kbx-pager { flex-wrap: wrap; }
  body.kb-selecting .kanban { padding-bottom: 150px; }
  .kb-bulkbar, .kbb { left: 8px !important; right: 8px !important; bottom: calc(var(--mtab-h) + var(--m-safe-b) + 8px) !important; transform: none !important; max-width: none !important; flex-wrap: wrap; }

  /* ── Dashboard: metas e ranking ────────────────────────────── */
  .mv-card { padding: 16px !important; }
  .mv-self-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .mv-self-row > :nth-child(4) { display: none; }
  .lb-podium { max-width: 100%; }

  /* ── Mensagens: lista ↔ conversa (como no WhatsApp do celular) ── */
  .msg-content { padding: 0 !important; }
  .mc-shell {
    grid-template-columns: minmax(0, 1fr) !important; column-gap: 0;
    height: calc(100dvh - var(--topbar-h) - env(safe-area-inset-top, 0px) - var(--mtab-h) - var(--m-safe-b)) !important;
    border-radius: 0; box-shadow: none;
  }
  .mc-shell.has-conv { height: calc(100dvh - var(--topbar-h) - env(safe-area-inset-top, 0px)) !important; }
  .msg-content .mc-list, .msg-content .mc-list-wrap { display: flex !important; }
  .msg-content .mc-list-wrap { border-radius: 0; border: 0; min-height: 0; }
  .mc-shell.has-conv > .mc-list-wrap { display: none !important; }
  .mc-shell:not(.has-conv) > .mc-chat { display: none !important; }
  .mc-chat { min-width: 0; padding-bottom: var(--m-safe-b); }
  .mc-chat-back {
    display: grid; place-items: center; width: 38px; height: 38px; margin-left: -6px; flex-shrink: 0;
    border: 0; border-radius: 50%; background: transparent; color: var(--fg); cursor: pointer;
  }
  .mc-chat-back:active { background: var(--bg-3, var(--bg-2)); }
  .mc-chat-head-main { padding: 6px 8px !important; gap: 4px !important; }
  .mc-chat-head-left { min-width: 0; flex: 1; }
  .mc-chat-head-name h2 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mc-chat-head-name .mc-tag { display: none; }
  .mc-msg { max-width: 86% !important; }
  .msg-content .mc-input-wrap { padding: 6px 6px 8px !important; }
  .mc-compose-bar { min-width: 0; padding-left: 4px !important; padding-right: 4px !important; }
  .mc-compose-ta { min-width: 0; flex: 1 1 auto; }
  .mc-compose-icon-btn { width: 32px; height: 32px; flex-shrink: 0; }
  .mc-compose-ass-label { display: none; }
  .mc-compose-ass-wrap { padding: 0 2px; }
  .mc-input-row { gap: 4px; }
  /* Painel do contato: por cima da conversa */
  .mc-shell.panel-open { z-index: 9100; }
  .mc-shell > .mc-right, .msg-content .mc-right {
    display: flex !important; position: fixed; inset: 0; z-index: 9100; width: 100vw; max-width: none;
    padding-top: calc(env(safe-area-inset-top, 0px) + 52px); padding-bottom: var(--m-safe-b);
    overflow-y: auto; background: var(--bg-1); border: 0; border-radius: 0;
    animation: hxMSlideUp .24s cubic-bezier(.32,.72,0,1);
  }
  .mc-rp-mclose {
    display: grid; place-items: center; position: fixed; z-index: 9110;
    top: calc(env(safe-area-inset-top, 0px) + 8px); right: 10px; width: 38px; height: 38px;
    border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer;
  }
  .mc-shell > .mc-panel-pill, .mc-pill, .mc-shell > :nth-child(3):not(.mc-right):not(.mc-chat):not(.mc-list-wrap):not(.mc-rp-mclose) { display: none !important; }
  .mc-callout { width: auto; left: 12px; right: 12px; }
  .mc-new-conv, ._NewConvModal { width: 100% !important; }

  /* ── IA ─────────────────────────────────────────────────────── */
  .ia-shell { grid-template-columns: minmax(0, 1fr) !important; height: calc(100dvh - var(--topbar-h) - env(safe-area-inset-top, 0px) - var(--mtab-h) - var(--m-safe-b)) !important; }
  .ia-content { padding: 0 !important; }
  .ia-left { display: none !important; }
  .ia-right { position: fixed; inset: 0; z-index: 9100; width: 100vw; padding-top: calc(14px + env(safe-area-inset-top, 0px)); padding-bottom: calc(14px + var(--m-safe-b)); }
  .ia-chat-body { padding-left: 12px !important; padding-right: 12px !important; }
  .ia-input-wrap { padding: 8px 10px 10px !important; }
  .ia-msg { max-width: 100% !important; }

  /* ── Agenda ─────────────────────────────────────────────────── */
  .agx-toolbar { padding: 12px !important; gap: 10px; }
  .agx-toolbar > * { flex-wrap: wrap; }
  .agx-search { width: 100% !important; max-width: none !important; }
  .agx-month-grid { grid-auto-rows: minmax(64px, 1fr) !important; }
  .agx-month .agx-chip span, .agx-month-grid .agx-chip { font-size: 10px; }
  .agx-month-dow > * { font-size: 10.5px; }
  .agx-tbody { max-height: calc(100dvh - 300px); min-height: 360px; }
  .agx-thead > *, .agx-tbody > * { min-width: 0; }
  .agx-slots { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); max-height: none; }
  .agx-dlg-body { padding: 14px !important; }

  /* ── Automações ─────────────────────────────────────────────── */
  .fl-editor, .app.density-compact .fl-editor { height: calc(100dvh - var(--topbar-h) - env(safe-area-inset-top, 0px) - 28px) !important; min-height: 0; }
  .fl-topbar { flex-wrap: wrap; height: auto; padding: 8px; gap: 8px; }
  .fl-name { width: auto; max-width: none; flex: 1; }
  .fl-tabs { position: static; transform: none; order: 3; }
  .fl-topbar-r { gap: 6px; flex-wrap: wrap; }
  .fl-row { flex-wrap: wrap; }
  .fl-ndv, .fl-picker { width: 100vw !important; max-width: 100vw !important; left: 0 !important; right: 0 !important; }
  .fl-ndv-body, .fl-ndv-body.no-input { grid-template-columns: 1fr !important; overflow: auto; }

  /* ── Relatórios ─────────────────────────────────────────────── */
  .rep-funnel-row, .rep-funnel-row2 { grid-template-columns: 92px 1fr 64px !important; gap: 8px !important; }
  .rep-right { position: static !important; }
  .rep-mini-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .rep-scope-select { max-width: 100%; }
  .rep-timeline, .rep-timeline-svg { max-width: 100%; }

  /* ── Clientes e ficha ───────────────────────────────────────── */
  .cli-detail-left { min-width: 0 !important; }
  .cli-fx-panel { position: fixed !important; left: 8px !important; right: 8px !important; width: auto !important; top: 70px !important; max-height: calc(100dvh - 160px) !important; overflow: auto; }
  .ced-tab-content { padding: 16px 12px !important; }
  .ced-grid > *, .cli-fields-grid > * { grid-column: auto !important; }
  .ced-tab-wrap { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .ced-tab-wrap::-webkit-scrollbar { display: none; }
  .ced-tab { flex-shrink: 0; }
  .ced-page-header { flex-direction: column; align-items: stretch !important; gap: 10px; }
  .ced-header-actions { width: 100%; flex-wrap: wrap; justify-content: stretch !important; }
  .ced-header-actions > button { flex: 1 1 auto; }
  .ced-pipe-bar { overflow-x: auto; scrollbar-width: none; }
  .ced-pipe-item { flex-shrink: 0; }

  /* ── Perfil / configurações ─────────────────────────────────── */
  .pf-tabs-nav { margin-left: -12px; margin-right: -12px; padding: 0 8px; }
  .pf-tab-btn { flex-shrink: 0; }
  .pf-card { padding: 16px !important; }
  .pf-up-grid { margin-top: 18px; }
  .pf-ditem { flex-wrap: wrap; gap: 10px; }

  /* ── Integrações ────────────────────────────────────────────── */
  .int-search { flex-direction: column; align-items: stretch !important; }
  .int-modal-body { padding: 14px !important; }
  .int-modal-app { flex-wrap: wrap; }

  /* ── Disparos em massa ──────────────────────────────────────── */
  .bcw { grid-template-columns: minmax(0, 1fr) !important; }
  .bcw-steps { flex-direction: row !important; overflow-x: auto; gap: 8px; padding: 10px !important; }
  .bcw-res, .bcw-add-all { grid-template-columns: minmax(0, 1fr) auto 26px !important; }
  .bcw-res > :nth-child(2), .bcw-add-all > :nth-child(2) { display: none; }
  .bc-tr { grid-template-columns: 1fr 1fr !important; }

  /* ── Horos 360 (gaveta do lead) ─────────────────────────────── */
  .drawer-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .drawer-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .drawer-tabs::-webkit-scrollbar { display: none; }

  /* ── Equipe ─────────────────────────────────────────────────── */
  .content.ws-page { flex-direction: column !important; align-items: stretch !important; gap: 16px !important; padding: 16px 12px calc(var(--mtab-h) + var(--m-safe-b) + 18px) !important; }
  .ws-page > * { width: 100%; min-width: 0; }
  .ws-head { flex-direction: column; gap: 12px; margin-bottom: 20px !important; }
  .ws-head > div:last-child { flex-wrap: wrap; }
  .ws-right { position: static !important; width: auto !important; align-self: stretch !important; }
  .ws-page .hx-sk-card { width: 100% !important; }

  /* ── Admin da plataforma ────────────────────────────────────── */
  .ha-shell, .ha-layout { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (max-width: 380px) {
  .kpi-grid, .fl-stats, .cli-summary { grid-template-columns: minmax(0, 1fr) !important; }
  .mtab-lbl { font-size: 9.5px; }
}

@keyframes hxMSlideUp { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sidebar, .mnav-scrim { transition: none !important; } }

/* Imóveis (properties.html) */
@media (max-width: 760px) {
  .pr-head-a { width: 100%; }
  .pr-head-a > * { flex: 1; justify-content: center; }
  .pr-search { min-width: 0; width: 100%; }
  .pr-toolbar .pr-search.grow { flex: 1 1 100%; order: -1; }
  .pr-ftoggle { display: inline-flex; margin-left: auto; }
  .pr-filters:not(.open) > :not(.pr-count) { display: none; }
  .pr-search.pr-max { width: 100%; }
  .pr-filters select { flex: 1 1 140px; max-width: none; height: 40px; font-size: 16px; }
  .pr-count { margin-left: 0; width: 100%; }
  .pr-grid { grid-template-columns: 1fr; }
  .pr-drawer { width: 100vw; border-left: 0; }
  .pr-dr-body { padding: 14px 16px 28px; }
  .pr-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pr-actions > * { flex: 1 1 100%; justify-content: center; }
  .pr-ov { padding: 0; align-items: stretch; }
  .pr-modal, .pr-modal.wide { width: 100%; max-height: 100vh; border-radius: 0; }
  .pr-row, .pr-row.six { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pr-fld.grow { grid-column: 1 / -1; }
  .pr-fld.xs { max-width: none; }
  .pr-fld input, .pr-fld select, .pr-fld textarea, .pr-search input, .pr-ta { font-size: 16px; }
  .pr-photo-tools { opacity: 1; }
}

/* Financeiro (finance.html) */
@media (max-width: 760px) {
  .fn-head-a { width: 100%; }
  .fn-head-a .btn-primary { flex: 1; justify-content: center; }
  .fn-search { min-width: 0; max-width: none; flex: 1 1 100%; }
  .fn-toolbar select { flex: 1 1 140px; max-width: none; height: 40px; font-size: 16px; }
  .fn-search input { font-size: 16px; }
  .fn-count { margin-left: 0; }
  .fn-head { display: none; }
  .fn-grid-r, .fn-grid-c, .fn-grid-c.mgr, .fn-grid-s, .fn-grid-s.mgr { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .fn-row .fn-cell-main { grid-column: 1 / -1; }
  .fn-row .fn-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .fn-sched-i { grid-template-columns: minmax(0, 1fr) auto; padding-left: 16px; }
  .fn-sched-h { grid-template-columns: minmax(0, 1fr) auto 20px; }
  .fn-sched-h > .fn-muted { display: none; }
  .fn-dre-t tbody th { min-width: 150px; }
  .fn-st-sum, .fn-st-cols { grid-template-columns: minmax(0, 1fr); }
  .fn-st-sum b { font-size: 20px; }
  .fn-st-in input, .fn-st-add input, .fn-st-tax input { font-size: 16px; }
  .fn-st-x { opacity: 1; }
  .fn-st-month { min-width: 0; font-size: 15px; }
  .fn-bars { gap: 6px; height: 120px; }
  .fn-bar-v { display: none; }
  .fn-ov { padding: 0; align-items: stretch; }
  .fn-modal, .fn-modal.wide { width: 100%; max-height: 100vh; border-radius: 0; }
  .fn-grid-m, .fn-grid-m.mgr, .fn-sale-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .fn-sale-row > .fn-muted { grid-column: 1 / -1; }
  .fn-sale-row > .btn-primary { grid-column: 1 / -1; justify-content: center; }
  .fn-frow { grid-auto-flow: row; grid-template-columns: 1fr; }
  .fn-fld.grow { grid-column: auto; }
  .fn-fld input, .fn-fld select { font-size: 16px; height: 40px; }
  .fn-calc { grid-template-columns: 1fr; }
  .fn-hbar { grid-template-columns: minmax(0, 1fr) 90px; }
  .fn-hbar-t, .fn-hbar > .fn-muted { display: none; }
}

/* Relatórios → Ligações */
@media (max-width: 760px) {
  .rcl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rcl-row { grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)); }
  .rcl-row > :nth-child(4), .rcl-row > :nth-child(5) { display: none; }
  .rcl-call { grid-template-columns: 10px minmax(0, 1fr) auto; }
  .rcl-meta { grid-column: 2 / -1; grid-row: 2; white-space: normal; }
}

/* Distribuição de leads: cada pessoa da fila vira um cartão */
@media (max-width: 760px) {
  .dq-grid, .dq-bottom { grid-template-columns: minmax(0, 1fr); }
  .dq-teams { position: static; }
  .dq-queue-h .filter-pills { width: 100%; }
  .dq-th { display: none; }
  .dq-tr { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px 14px; }
  .dq-tr[draggable="true"] { cursor: default; }
  .dq-pos { display: none; }
  .dq-who { grid-column: 1 / 4; grid-row: 1; }
  .dq-sw-c { grid-column: 4; grid-row: 1; justify-self: end; }
  .dq-tr .n { display: flex; flex-direction: column-reverse; text-align: left; font-size: 15px; font-weight: 600; }
  .dq-tr .n::before { content: attr(data-l); font-size: 11px; font-weight: 400; color: var(--fg-4); }
  .dq-tr .dq-act { grid-column: 1 / -1; }
  .dq-ic { width: 40px; height: 40px; }
  .dq-sw { width: 44px; height: 26px; }
  .dq-sw i { width: 22px; height: 22px; }
  .dq-sw.on i { transform: translateX(18px); }
  .dq-rule-form select, .dq-rule-form input, .dq-team-new input { height: 42px; font-size: 16px; }
  .dq-rule-form label { flex: 1 1 100%; }
  .dq-rule { flex-wrap: wrap; }
}

/* Vários funis (crm-pipelines.jsx): abas rolam para o lado, ⋯ sempre visível, campos 16px */
@media (max-width: 760px) {
  .pl-tabs { padding: 0 8px; }
  .pl-tab-more { opacity: 1; }
  .pl-modal, .pl-modal-wide { width: 100%; }
  .pl-input, .pl-rule .kem-input, .pl-select { font-size: 16px; }
  .pl-select { flex: 1 1 100%; }
}
