/* Max Corretora — mobile-first overrides (Fase 1+) */

/* ── Rolagem horizontal sem barra visível (mobile) ─────────── */
@media (max-width: 1023px) {
  .mc-hscroll,
  #viewbar,
  #tabs,
  #kanban,
  .parc-kanban,
  .rsl-hero,
  .prod-funnel-row,
  .cal-m-strip,
  .kb-m-tabs,
  .admin-tabbar,
  .pcal-m-strip,
  .tscroll {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .mc-hscroll::-webkit-scrollbar,
  #viewbar::-webkit-scrollbar,
  #tabs::-webkit-scrollbar,
  #kanban::-webkit-scrollbar,
  .parc-kanban::-webkit-scrollbar,
  .rsl-hero::-webkit-scrollbar,
  .prod-funnel-row::-webkit-scrollbar,
  .cal-m-strip::-webkit-scrollbar,
  .kb-m-tabs::-webkit-scrollbar,
  .admin-tabbar::-webkit-scrollbar,
  .pcal-m-strip::-webkit-scrollbar,
  .tscroll::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
    background: transparent;
  }
}

/* ── Admin: aviso + bloqueio só Admin/Config ──────────────── */
.admin-mobile-hint {
  display: none;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
  background: var(--warning-soft);
  border-bottom: 1px solid var(--badge-amber-border);
}
body.is-admin.mc-mobile .admin-mobile-hint {
  display: block;
  position: static;
}

@media (max-width: 767px) {
  body.is-admin.mc-mobile.admin-section-open .admin-mobile-hint {
    display: none;
  }
  body.is-admin.mc-mobile #section-admin {
    overflow: visible;
    padding-top: 0;
  }
  body.is-admin.mc-mobile #section-admin .admin-tabbar {
    overflow-x: auto;
    padding: 0 8px;
    -webkit-overflow-scrolling: touch;
    position: static !important;
    top: auto !important;
    z-index: auto;
    background: var(--bg-muted);
    flex-shrink: 0;
    width: 100%;
    order: -1;
  }
  body.is-admin.mc-mobile .admin-tab {
    flex-shrink: 0;
    padding: 12px 14px;
    font-size: 12px;
    min-height: 44px;
  }
  body.is-admin.mc-mobile #section-admin .admin-pane {
    padding: 16px 12px 28px;
    position: relative;
    z-index: 1;
  }
  body.is-admin.mc-mobile #section-admin .admin-pane.active {
    display: block;
  }
  body.is-admin.mc-mobile #section-admin .admin-kpis {
    margin-top: 0;
    margin-bottom: 16px;
  }
  body.is-admin.mc-mobile #section-admin .admin-tbl { display: none; }
}

.admin-desktop-only {
  display: none;
  padding: 32px 20px;
  text-align: center;
  max-width: 420px;
  margin: 24px auto;
}
.admin-desktop-only .ado-ic {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.85;
}
.admin-desktop-only h2 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.admin-desktop-only p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

@media (max-width: 767px) {
  body.is-admin.mc-mobile #topbar-apresent-btn { display: none !important; }

  body.is-admin.mc-mobile #section-campanhas.mc-blocked .admin-desktop-only,
  body.is-admin.mc-mobile #section-config.mc-blocked .admin-desktop-only {
    display: block;
  }
  body.is-admin.mc-mobile #section-campanhas.mc-blocked .secao-header,
  body.is-admin.mc-mobile #section-campanhas.mc-blocked #campanhas-content,
  body.is-admin.mc-mobile #section-config.mc-blocked .secao-header,
  body.is-admin.mc-mobile #section-config.mc-blocked #config-content {
    display: none !important;
  }

  /* Admin mobile cards */
  .adm-m-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
  }
  .adm-m-list { display: flex; flex-direction: column; gap: 10px; }
  .adm-m-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    padding: 12px;
    box-shadow: var(--shadow-sm);
  }
  .adm-m-card-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
  }
  .adm-m-logo { width: 40px; height: 40px; object-fit: contain; border-radius: var(--radius-sm); flex-shrink: 0; }
  .adm-m-logo-fb {
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 12px; font-weight: 800; flex-shrink: 0;
  }
  .adm-m-card-info { flex: 1; min-width: 0; }
  .adm-m-card-title { font-size: 14px; font-weight: 800; color: var(--text); line-height: 1.25; }
  .adm-m-card-email { font-size: 11px; color: var(--text-muted); margin-top: 2px; word-break: break-all; }
  .adm-m-card-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.4; }
  .adm-m-card-acts { display: flex; gap: 6px; flex-wrap: wrap; }
  .adm-m-card-acts .admin-btn { flex: 1; min-height: 40px; justify-content: center; }
  .adm-m-kpis { grid-template-columns: repeat(2, 1fr) !important; }
  .adm-m-rows { display: flex; flex-direction: column; gap: 0; padding: 0 14px 14px; }
  .adm-m-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px;
  }
  .adm-m-row:last-child { border-bottom: none; }
  .adm-m-card-block .admin-card-hdr { padding: 12px 14px; }
  .adm-m-dashboard {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }
  .adm-m-kpis .admin-kpi { min-width: 0; }
  .adm-m-kpis .admin-kpi-val { font-size: 22px; word-break: break-word; }

  /* Atendimento / catálogo no celular */
  body.is-admin.mc-mobile #section-atendimento .secao-header,
  body.is-admin.mc-mobile #section-catalogo .secao-header {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 8px;
  }
  body.is-admin.mc-mobile .atd-wrap,
  body.is-admin.mc-mobile #catalogo-content {
    padding: 0 0 12px;
    overflow-x: hidden;
  }
}

/* ── Clientes: sticky só no topo (hdr + views) ───────────── */
#clientes-sticky { position: static; z-index: auto; background: transparent; box-shadow: none; }
#clientes-sticky-top {
  position: sticky;
  top: var(--header-stack);
  z-index: 200;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.clientes-mobile-bar { display: none; }

.hdr-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hdr-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

@media (max-width: 767px) {
  .clientes-mobile-bar {
    display: flex;
    gap: 6px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-muted);
  }
  .cmob-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 40px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .cmob-btn span[data-icon] { display: inline-flex; line-height: 0; }
  .cmob-btn.active {
    background: var(--accent-soft);
    color: var(--accent-on-soft);
    border-color: var(--border-strong);
  }

  .clientes-collapsible #tabs,
  .clientes-collapsible #tags-cloud,
  .clientes-collapsible #fbar,
  .clientes-collapsible #bulk-bar { display: none; }

  .clientes-collapsible.tabs-open #tabs,
  .clientes-collapsible.tabs-open #tags-cloud { display: flex; }
  .clientes-collapsible.filtros-open #fbar { display: flex; }
  .clientes-collapsible.bulk-visible #bulk-bar { display: flex; }

  #hdr {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  #hdr h1 { font-size: 15px; }
  #hdr-actions {
    margin-left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 6px;
  }
  #hdr-actions .btn-target {
    grid-column: 1 / -1;
    justify-content: center;
    min-height: 44px;
    font-size: 13px;
  }
  #viewbar {
    padding: 0 8px;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .vbtn { padding: 10px 12px; font-size: 12px; min-height: 44px; flex-shrink: 0; }
  #tabs {
    padding: 0 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tab { padding: 10px 12px; min-height: 44px; font-size: 12px; flex-shrink: 0; }
  #cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px 12px;
  }
  .card-stat { padding: 10px 12px; min-height: 64px; }
  .card-stat-val { font-size: 18px; }
  .card { padding: 8px 10px; }
  .cval { font-size: 18px; }
  #fbar {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
    gap: 8px;
  }
  #fbar .input,
  #fbar .select {
    width: 100% !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    min-height: 44px;
    font-size: 16px;
  }
  .fq { min-width: 0; }
  #bulk-bar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    font-size: 12px;
  }
  #bulk-bar button { min-height: 36px; }

  #area,
  #mapa-view {
    padding-left: 0;
    padding-right: 0;
    overflow-x: hidden;
  }
  #rinfo { padding: 8px 12px; font-size: 11px; }
  .tbox { margin: 0 8px 12px; border-radius: var(--radius-sm); }
  .tscroll { -webkit-overflow-scrolling: touch; }

  /* Kanban: swipe horizontal */
  #kanban {
    display: flex !important;
    grid-template-columns: unset !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    padding: 10px 12px 16px;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }
  #kanban .col-kb {
    flex: 0 0 min(82vw, 300px);
    scroll-snap-align: start;
    max-height: calc(100dvh - var(--header-stack) - 200px);
    min-height: 240px;
  }
  #kanban::after {
    content: 'Deslize →';
    position: sticky;
    right: 0;
    align-self: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-subtle);
    padding: 4px 8px;
    pointer-events: none;
    flex-shrink: 0;
  }

  /* Kanban mobile — abas + mover estágio */
  .kb-mobile { padding: 0 0 12px; overflow-x: hidden; }
  .kb-m-tabs {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: calc(var(--header-stack) + 0px);
    z-index: 120;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
  }
  .kb-m-tab {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-muted);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
  }
  .kb-m-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
  }
  .kb-m-tab-n {
    display: inline-block;
    min-width: 16px;
    padding: 0 5px;
    border-radius: 8px;
    background: rgba(0,0,0,.12);
    font-size: 10px;
    margin-left: 4px;
  }
  .kb-m-tab.active .kb-m-tab-n { background: rgba(255,255,255,.25); }
  .kb-m-hint {
    margin: 0;
    padding: 6px 12px;
    font-size: 11px;
    color: var(--text-subtle);
    line-height: 1.35;
  }
  .kb-m-board { padding-top: 4px; }
  .kb-m-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 !important;
    overflow: hidden;
  }
  .kb-m-card-main {
    display: block;
    width: 100%;
    padding: 10px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: inherit;
  }
  .kb-m-loc { font-size: 10px; color: var(--text-muted); margin-top: 4px; }
  .kb-m-tag { font-size: 10px !important; }
  .kb-m-move-lbl {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-top: 1px solid var(--border);
    background: var(--bg-muted);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
  }
  .kb-m-move {
    flex: 1;
    min-height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text);
    font-size: 12px;
    padding: 0 8px;
  }
  .kb-m-board .col-kb,
  .parc-kanban.kb-m-board .col-kb {
    max-height: calc(100dvh - var(--header-stack) - 220px);
  }

  /* ── Calendário card (mobile — estilo mockup) ───────────── */
  .cal-card-wrap {
    padding: 12px;
    overflow-x: hidden;
  }
  .cal-card {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px 16px 14px;
    margin-bottom: 12px;
  }
  .cal-card-hdr { margin-bottom: 16px; }
  .cal-card-dow {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: lowercase;
    margin-bottom: 2px;
  }
  .cal-card-date {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    text-transform: lowercase;
  }
  .cal-card-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 14px;
    position: relative;
  }
  .cal-card-month {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-transform: lowercase;
    min-width: 72px;
    text-align: center;
  }
  .cal-card-arrow {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
  }
  .cal-card-today {
    position: absolute;
    right: 0;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-surface);
    color: var(--accent-on-soft);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
  }
  .cal-card-dows {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 6px;
  }
  .cal-card-dows span {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 4px 0;
  }
  .cal-card-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px 0;
    text-align: center;
  }
  .cal-card-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    min-height: 44px;
    padding: 4px 0 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    position: relative;
  }
  .cal-card-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1;
  }
  .cal-card-day.other .cal-card-num { color: var(--text-subtle); }
  .cal-card-day.hoje:not(.sel) .cal-card-num {
    color: var(--accent);
    font-weight: 800;
  }
  .cal-card-day.sel .cal-card-num {
    background: var(--accent);
    color: #fff;
    font-weight: 800;
  }
  .cal-card-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-subtle);
  }
  .cal-card-day.sel .cal-card-dot { background: rgba(255,255,255,.85); }
  .cal-card-panel {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
  }
  .cal-card-panel-lbl {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    text-transform: capitalize;
  }
  .cal-card-empty {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    margin: 0;
  }
  .cal-card-evts { display: flex; flex-direction: column; gap: 6px; }
  .cal-card-evt {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    text-align: left;
    cursor: pointer;
    color: inherit;
  }
  .cal-card-evt.evt-venc { border-left: 3px solid #f59e0b; }
  .cal-card-evt.evt-log { border-left: 3px solid var(--accent); }
  .cal-card-evt-time {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 48px;
  }
  .cal-card-evt-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .cal-card-nota {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-muted);
  }
  .cal-card-nota summary {
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
  }
  .cal-card-nota summary::-webkit-details-marker { display: none; }
  .cal-card-nota textarea {
    width: 100%;
    min-height: 72px;
    padding: 10px 12px;
    border: none;
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text);
    font-size: 14px;
    resize: vertical;
  }
  .cal-m-add-btn {
    display: flex;
    width: 100%;
    margin: 10px 0 0;
    min-height: 44px;
    justify-content: center;
  }

  .prod-mobile {
    padding: 12px 12px 20px;
    overflow-x: hidden;
    max-width: 100%;
  }
  .prod-title { font-size: 17px; margin-bottom: 4px; color: var(--text); font-weight: 800; }
  .prod-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.45; }

  .prod-m-hero {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 14px;
  }
  .prod-m-stat {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .prod-m-stat.alta {
    background: var(--accent-soft);
    border-color: var(--border-strong);
  }
  .prod-m-stat-l { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
  .prod-m-stat-v { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1; }

  .prod-m-details {
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    overflow: hidden;
  }
  .prod-m-details > summary {
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .prod-m-details > summary::-webkit-details-marker { display: none; }
  .prod-m-details > summary::after {
    content: '▾';
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.15s;
  }
  .prod-m-details[open] > summary::after { transform: rotate(180deg); }
  .prod-m-details > summary + * { padding: 0 14px 14px; }

  .prod-m-rows { display: flex; flex-direction: column; gap: 8px; }
  .prod-m-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
  }
  .prod-m-row:last-child { border-bottom: none; }
  .prod-m-row-l { color: var(--text-muted); }
  .prod-m-row-v { font-weight: 800; color: var(--text); }
  .prod-m-row-s { font-size: 11px; color: var(--accent-on-soft); font-weight: 600; }

  .prod-m-chart {
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    overflow: hidden;
  }
  .prod-m-chart .prod-section-h { font-size: 13px; margin-bottom: 10px; }
  .prod-chart-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }
  .prod-chart-wrap canvas {
    display: block;
    max-width: 100% !important;
    height: auto !important;
  }

  .prod-funnel-m { display: flex; flex-direction: column; gap: 10px; }
  .prod-fm-row {
    display: grid;
    grid-template-columns: 88px 1fr 28px;
    gap: 8px;
    align-items: center;
    font-size: 12px;
  }
  .prod-fm-l { color: var(--text-muted); font-weight: 600; }
  .prod-fm-track {
    height: 8px;
    border-radius: 4px;
    background: var(--bg-muted);
    overflow: hidden;
  }
  .prod-fm-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--accent);
    min-width: 2px;
  }
  .prod-fm-n { font-weight: 800; color: var(--text); text-align: right; }

  .prod-m-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Desktop prod compact fallback */
  #prod { padding: 10px 12px; overflow-x: hidden; }
  .prod-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px; }
  .prod-card { padding: 12px; }
  .prod-card .pv { font-size: 22px; }
  #heatmap { padding: 12px; overflow: hidden; }
  #heatmap canvas { max-width: 100% !important; height: auto !important; }
  .prod-funnel-row {
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .prod-funnel-col { min-width: 56px; flex-shrink: 0; }
  .prod-funnel-n { font-size: 14px; }
  .prod-revenue-grid { grid-template-columns: repeat(2, 1fr); }

  #mapa-view { padding: 10px 8px !important; }
  .mapa-container { min-height: 280px; }
}

/* ── Escritório mobile (bottom nav) ───────────────────────── */
@media (max-width: 1023px) {
  body.is-escritorio .parc-shell-sticky {
    position: sticky;
    top: var(--header-stack);
    z-index: 150;
    background: var(--bg-surface);
  }
  body.is-escritorio .parc-viewbar {
    position: sticky;
    top: calc(var(--header-stack) + 52px);
    z-index: 149;
  }
  body.is-escritorio .secao-header {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 8px;
    position: sticky;
    top: var(--header-stack);
    z-index: 150;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
  }
  body.is-escritorio .secao-title { font-size: 15px; }
  body.is-escritorio .secao-sub { font-size: 11px; }
  body.is-escritorio .secao-badge { font-size: 10px; }
  body.is-escritorio .hdr-acts {
    width: 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  body.is-escritorio .hdr-acts .pvbtn-add-big {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 12px;
  }
  body.is-escritorio .sec-ic { display: none; }

  .parc-kanban {
    display: flex !important;
    grid-template-columns: unset !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    padding: 10px 12px 16px;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }
  .parc-kanban .col-kb {
    flex: 0 0 min(82vw, 300px);
    scroll-snap-align: start;
    max-height: calc(100dvh - var(--header-stack) - var(--bottom-nav-height) - 120px);
  }
  .parc-kanban::after {
    content: 'Deslize →';
    position: sticky;
    right: 0;
    align-self: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-subtle);
    padding: 4px 8px;
    pointer-events: none;
    flex-shrink: 0;
  }

  .rsl-wrapper { padding: 0 0 12px; overflow-x: hidden; }
  .rsl-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }
  .rsl-header-title { font-size: 15px; line-height: 1.25; }
  .rsl-meta-btn { width: 100%; text-align: center; min-height: 44px; }

  .parc-resumo.is-visible {
    padding: 10px 12px calc(var(--bottom-nav-height, 56px) + 8px);
    overflow-x: hidden;
  }
  .parc-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
    width: 100%;
  }

  .rsl-charts,
  .rsl-bottom { grid-template-columns: 1fr !important; padding: 0 12px; }
  .rsl-card { margin-bottom: 12px; }

  /* Roteiro — 2 dias por linha no mobile */
  body.is-escritorio .rot-wrapper,
  .rot-wrapper {
    min-height: 0;
    padding: 10px 12px calc(var(--bottom-nav-height, 64px) + 12px);
    overflow-x: hidden;
    max-width: 100%;
  }
  body.is-escritorio .rot-grid,
  .rot-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
  }
  body.is-escritorio .rot-dia,
  .rot-dia {
    min-height: auto;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
  }
  body.is-escritorio .rot-dia-scroll,
  .rot-dia-scroll {
    max-height: 200px;
    overflow-y: auto;
  }
  body.is-escritorio .rot-cli,
  .rot-cli {
    min-height: 36px;
    padding: 6px 8px;
    font-size: 11px;
  }
  body.is-escritorio .rot-cli-nome,
  .rot-cli-nome {
    max-width: none;
    white-space: normal;
    line-height: 1.25;
  }
  body.is-escritorio .rot-btn-mini,
  .rot-btn-mini {
    min-height: 32px;
    min-width: 32px;
    padding: 4px 8px;
  }
  body.is-escritorio .rot-add-btn,
  .rot-add-btn {
    min-height: 40px;
    font-size: 12px;
    padding: 8px;
  }

  .parc-cal { padding: 0 0 12px; overflow-x: hidden; }
}

/* ── Fase 8 — auditoria mobile (correções pontuais) ───────── */
@media (max-width: 767px) {
  .cmob-btn { min-height: 44px; }
  .kb-m-tab { min-height: 44px; padding: 8px 14px; }
  #bulk-bar button { min-height: 44px; padding: 8px 12px; }

  .map-dist,
  .parc-alert-wrap { padding: 12px; }
  .map-dist-grid { grid-template-columns: 1fr; }

  .alert-row {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: stretch;
  }
  .alert-msg { white-space: normal; }
  .alert-acts { justify-content: flex-start; }

  .atd-reply button { min-height: 44px; min-width: 44px; }
  .atd-reply textarea { font-size: 16px; }
}

@media (max-width: 767px) and (orientation: landscape) {
  .modal > .tc-box,
  .modal > .tar-modal-box,
  .modal > .mv-box,
  .modal > .tl-box,
  .modal > .mnl-box,
  .modal > .mbe-box,
  .modal > .adm-box {
    max-height: 94vh;
  }
  #kanban .col-kb,
  .parc-kanban .col-kb,
  .kb-m-board .col-kb {
    max-height: calc(100dvh - var(--header-stack) - 72px);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  #cards { grid-template-columns: repeat(3, 1fr); }
  .adm-m-kpis { grid-template-columns: repeat(3, 1fr) !important; }
  .parc-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .lead-cards { padding: 0 16px 16px; }
}
