/* ═══════════════════════════════════════════════════════════════════════════
   mobile.css — WeChurch PWA
   Bottom navigation, mobile drawer, full-screen modals, touch-friendly UX
   Applies exclusively on screens ≤ 767px
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Bottom nav: hidden by default (shown only in mobile media query) ──────── */
.mobile-bottom-nav { display: none; }

/* ── Drawer: hidden by default, shown via JS class ────────────────────────── */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  visibility: hidden;
  pointer-events: none;
}

.mobile-drawer.mobile-drawer--open {
  visibility: visible;
  pointer-events: all;
}

.mobile-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background .28s ease;
}

.mobile-drawer.mobile-drawer--open .mobile-drawer-backdrop {
  background: rgba(0, 0, 0, .44);
}

.mobile-drawer-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 24px 24px 0 0;
  max-height: 88dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.32, .72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom, 0);
  -webkit-overflow-scrolling: touch;
}

.mobile-drawer.mobile-drawer--open .mobile-drawer-sheet {
  transform: translateY(0);
}

/* Handle bar */
.mobile-drawer-handle {
  width: 40px;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  margin: 14px auto 10px;
  flex-shrink: 0;
}

/* Profile card inside drawer */
.mobile-drawer-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.mobile-drawer-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--brand-primary, #4f46e5);
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mobile-drawer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.mobile-drawer-profile-info { flex: 1; min-width: 0; }

.mobile-drawer-profile-name {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-drawer-profile-role {
  font-size: 12px;
  color: #64748b;
  margin-top: 1px;
}

.mobile-drawer-profile-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.mobile-drawer-profile-actions a,
.mobile-drawer-profile-actions button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background .15s;
}

.mobile-drawer-profile-actions .btn-perfil {
  background: #f1f5f9;
  color: #374151;
}

.mobile-drawer-profile-actions .btn-sair {
  background: #fee2e2;
  color: #dc2626;
}

/* Drawer sections */
.mobile-drawer-section {
  padding: 10px 0 4px;
  border-bottom: 1px solid #f1f5f9;
}

.mobile-drawer-section:last-child { border-bottom: none; }

.mobile-drawer-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 4px 20px 6px;
}

.mobile-drawer-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 20px;
  text-decoration: none !important;
  color: #1e293b;
  font-size: 15px;
  font-weight: 500;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .1s;
}

.mobile-drawer-item:active { background: #f8fafc; }
.mobile-drawer-item i {
  font-size: 20px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.mobile-filter-trigger,
.mobile-tabs-select-wrap,
.mobile-filter-sheet {
  display: none;
}

/* ── Mobile scrollable tabs (global, visible on mobile only via media query) ── */
.mobile-scroll-tabs {
  display: none;
}

.mobile-filter-sheet {
  position: fixed;
  inset: 0;
  z-index: 1190;
  visibility: hidden;
  pointer-events: none;
}

.mobile-filter-sheet.is-open {
  visibility: visible;
  pointer-events: all;
}

.mobile-filter-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0);
  transition: background .24s ease;
}

.mobile-filter-sheet.is-open .mobile-filter-backdrop {
  background: rgba(15, 23, 42, .46);
}

.mobile-filter-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: 86dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -18px 48px rgba(15, 23, 42, .20);
  transform: translateY(105%);
  transition: transform .30s cubic-bezier(.32, .72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-filter-sheet.is-open .mobile-filter-panel {
  transform: translateY(0);
}

.mobile-filter-handle {
  width: 42px;
  height: 4px;
  margin: 12px auto 8px;
  border-radius: 999px;
  background: #d1d5db;
  flex: 0 0 auto;
}

.mobile-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 18px 14px;
  border-bottom: 1px solid #eef2f7;
}

.mobile-filter-eyebrow {
  display: block;
  margin-bottom: 2px;
  color: #64748b;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.mobile-filter-header h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1.12rem;
  font-weight: 850;
}

.mobile-filter-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: #334155;
}

.mobile-filter-sheet-body {
  overflow-y: auto;
  padding: 16px 18px 8px;
  -webkit-overflow-scrolling: touch;
}

.mobile-filter-footer {
  padding: 12px 18px 16px;
  border-top: 1px solid #eef2f7;
  background: #fff;
}

/* ════════════════════════════════════════════════════════════════════════════
   MOBILE MEDIA QUERY — only phones (≤ 767px)
   ════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

  /* ── Kill existing top-bar sidebar ──────────────────────────────────────── */
  .sidebar-icons,
  .sidebar-expandido { display: none !important; }

  /* ── Content: full width, padding bottom for bottom nav ─────────────────── */
  .content,
  .sidebar-expandido:not(.d-none) ~ .content {
    margin-left: 0 !important;
    padding: 14px 14px calc(70px + env(safe-area-inset-bottom, 0)) !important;
  }

  /* ── Show bottom navigation ──────────────────────────────────────────────── */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid rgba(0, 0, 0, .07);
    box-shadow: 0 -1px 0 rgba(0, 0, 0, .05);
    justify-content: space-around;
    align-items: flex-end;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0));
    z-index: 1050;
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none !important;
    color: #94a3b8;
    font-size: 10.5px;
    font-weight: 600;
    padding: 6px 2px 5px;
    border: none;
    background: transparent;
    cursor: pointer;
    min-width: 0;
    max-width: 80px;
    flex: 1;
    height: 56px;
    box-shadow: none;
    transform: none;
    transition: color .15s ease, opacity .15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-item:hover,
  .mobile-nav-item:active {
    background: transparent;
    box-shadow: none;
    transform: none;
    text-decoration: none !important;
  }

  .mobile-nav-item:focus-visible {
    outline: 2px solid rgba(37, 99, 235, .35);
    outline-offset: -2px;
    border-radius: 10px;
  }

  .mobile-nav-item i {
    font-size: 23px;
    line-height: 1;
    display: block;
    margin: 0;
  }

  .mobile-nav-item span {
    font-size: 10.5px;
    line-height: 1.1;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .mobile-nav-item.active {
    color: #111827;
  }

  .mobile-nav-item.active span {
    color: #111827;
    font-weight: 700;
  }

  .mobile-nav-item.active i {
    filter: none;
  }

  /* ── Scrollable tabs: SHOW tabs, hide old select ──────────────────────────── */
  .mobile-tabs-select-wrap { display: none; }
  [data-mobile-tabs] { display: flex !important; }

  /* ── Tab scroll containers ──────────────────────────────────────────────── */
  .finance-tabs,
  .ev-tabs-bar {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
  }

  .finance-tabs::-webkit-scrollbar,
  .ev-tabs-bar::-webkit-scrollbar { display: none; }

  /* ── Individual tab buttons: icon on top, text below ──────────────────────── */
  .finance-tab,
  .ev-tab {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 58px;
    padding: 7px 6px 6px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .finance-tab i,
  .ev-tab i {
    font-size: 20px;
    display: block;
    line-height: 1;
  }

  /* ── Active state: filled blue / purple ────────────────────────────────── */
  .finance-tab.active {
    background: #2563eb !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .3);
  }

  .finance-tab.active i { color: #fff !important; filter: none !important; }

  .ev-tab.active {
    background: var(--brand-primary, #4f46e5) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--brand-primary) 30%, transparent);
  }

  .ev-tab.active i { color: #fff !important; filter: none !important; }


  .mobile-filter-trigger {
    position: fixed !important;
    right: 18px;
    bottom: calc(92px + env(safe-area-inset-bottom, 0));
    z-index: 1060;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    width: auto;
    min-width: 112px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .28);
    font-weight: 800;
  }

  .mobile-filter-trigger i {
    color: #93c5fd;
    font-size: 1.05rem;
  }

  .mobile-filter-trigger:active {
    transform: translateY(1px);
  }

  .mobile-filter-sheet.is-open ~ .mobile-filter-trigger,
  body.mobile-filter-open .mobile-filter-trigger {
    display: none !important;
  }

  #panelInscricoes {
    padding-bottom: 96px;
  }

  #inscricoesMobileCards {
    padding-bottom: 96px;
  }

  .inscricoes-mobile-cards {
    padding-bottom: 96px;
  }


  .mobile-filter-trigger i {
    color: #93c5fd;
    font-size: 1.05rem;
  }

  .mobile-filter-trigger:active {
    transform: translateY(1px);
  }




  .mobile-filter-trigger i {
    color: #93c5fd;
    font-size: 1.05rem;
  }

  .mobile-filter-trigger:active {
    transform: translateY(1px);
  }

  .mobile-filter-sheet {
    display: block;
  }

  .mobile-filter-sheet-body [data-mobile-filter-sheet] {
    display: block !important;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  .mobile-filter-sheet-body .row,
  .mobile-filter-sheet-body .d-flex,
  .mobile-filter-sheet-body .finance-filter-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .mobile-filter-sheet-body .col,
  .mobile-filter-sheet-body [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
  }

  .mobile-filter-sheet-body .btn-group {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100%;
  }

  .mobile-filter-sheet-body .btn-group .btn,
  .mobile-filter-sheet-body .ev-filter {
    width: 100%;
    justify-content: flex-start;
    border-radius: 12px !important;
  }

  .mobile-filter-sheet-body .ev-sidebar {
    display: block !important;
    width: 100%;
    position: static;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  .mobile-filter-sheet-body .ev-sidebar-nav,
  .mobile-filter-sheet-body .ev-sidebar-cats {
    display: grid;
    gap: 8px;
  }

  .mobile-filter-sheet-body .form-control,
  .mobile-filter-sheet-body .form-select,
  .mobile-filter-sheet-body .btn {
    width: 100%;
    min-height: 48px;
  }

  /* ── Modais: bottom sheet de tela cheia ─────────────────────────────────── */
  .modal-dialog {
    margin: 0 !important;
    max-width: 100% !important;
    min-height: 60dvh;
    align-items: flex-end;
  }

  .modal.fade .modal-dialog {
    transform: translateY(40px);
    opacity: 0;
  }

  .modal.show .modal-dialog {
    transform: translateY(0);
    opacity: 1;
  }

  .modal-content {
    border-radius: 24px 24px 0 0 !important;
    border: none !important;
    max-height: 95dvh;
    overflow-y: auto;
  }

  .modal-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: 24px 24px 0 0;
  }

  /* ── Touch-friendly inputs and buttons ──────────────────────────────────── */
  .form-control,
  .form-select,
  .form-control-sm,
  .form-select-sm {
    min-height: 44px;
    font-size: 16px !important; /* Prevent iOS zoom-on-focus */
    border-radius: 10px;
  }

  .btn { min-height: 40px; }
  .btn-sm { min-height: 36px; }
  .btn-lg { min-height: 50px; }

  /* ── Typography adjustments ─────────────────────────────────────────────── */
  h1, .h1 { font-size: 1.45rem !important; }
  h2, .h2 { font-size: 1.25rem !important; }
  h3, .h3 { font-size: 1.1rem !important; }

  /* ── Card Membros header stacks vertically on mobile ────────────────────── */
  .card-membros-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px;
  }

  .card-membros-header h1 {
    font-size: 1.3rem !important;
    margin-bottom: 0;
  }

  .card-membros-header .d-flex {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  /* ── Event/member cards spacing ─────────────────────────────────────────── */
  .card-membros { border-radius: 16px; }

  /* ── Table → card list conversion helpers ───────────────────────────────── */
  .table-mobile-hide { display: none !important; }
  .cards-mobile-show { display: block !important; }

  .mobile-card-list { padding: 0; }

  .mobile-card {
    background: #fff;
    border-radius: 14px;
    padding: 15px 16px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .04);
  }

  .mobile-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 11px;
    padding-bottom: 11px;
    border-bottom: 1px solid #f1f5f9;
  }

  .mobile-card-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
  }

  .mobile-card-avatar-placeholder {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--brand-primary, #4f46e5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 17px;
    flex-shrink: 0;
  }

  .mobile-card-header-info { flex: 1; min-width: 0; }

  .mobile-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-card-sub {
    font-size: 12px;
    color: #64748b;
  }

  .mobile-card-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .mobile-card-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    gap: 8px;
  }

  .mobile-card-field label {
    color: #6b7280;
    font-weight: 500;
    margin: 0;
    flex-shrink: 0;
  }

  .mobile-card-field span {
    text-align: right;
    color: #1e293b;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
  }

  .mobile-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
  }

  .mobile-card-actions .btn {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    padding: 6px 10px;
    min-height: 36px;
  }

  /* ── Fix dropdowns in bottom nav ────────────────────────────────────────── */
  .dropdown-menu {
    position: fixed !important;
    bottom: calc(70px + env(safe-area-inset-bottom)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    top: auto !important;
    width: min(360px, 94vw);
    max-height: 60vh;
    overflow-y: auto;
    border-radius: 16px !important;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .18) !important;
  }

  /* ── Eventos grid: single column on mobile ──────────────────────────────── */
  .ev-grid { grid-template-columns: 1fr !important; }

  /* ── Eventos layout: sidebar hidden, full width ─────────────────────────── */
  .ev-layout { grid-template-columns: 1fr !important; }
  .ev-sidebar { display: none !important; }

  /* ── Remove padding from containers on small phones ─────────────────────── */
  .container-fluid { padding-left: 12px !important; padding-right: 12px !important; }


    /* Eventos > Inscrições: filtro fora do card, igual financeiro */
  #panelInscricoes {
    position: relative;
  }

  #panelInscricoes > .ev-inscricoes-filters {
    display: block;
    margin: 0 0 12px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  #panelInscricoes > .ev-inscricoes-filters .ev-inline-filters {
    display: none !important;
  }

  #panelInscricoes > .ev-panel-box {
    position: static;
  }

  #panelInscricoes .mobile-filter-trigger {
    position: fixed !important;
    right: 18px !important;
    bottom: calc(92px + env(safe-area-inset-bottom, 0)) !important;
    z-index: 1060 !important;
    width: auto !important;
    min-width: 112px;
  }

  #panelInscricoes .inscricoes-mobile-cards,
  #panelInscricoes #inscricoesMobileCards {
    padding-bottom: 96px;
  }

}

/* ════════════════════════════════════════════════════════════════════════════
   Extra-small phones (≤ 479px)
   ════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 479px) {
  .content,
  .sidebar-expandido:not(.d-none) ~ .content {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .modal-body { padding: 16px 14px; }
  .modal-footer { padding: 12px 14px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mobile drawer FULLSCREEN — central de módulos em tela cheia (mobile only)
   Visível apenas em telas ≤ 767px. Desktop continua usando a sidebar normal.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Suprime preview de link / menu contextual / seleção em long-press SOMENTE
   dentro do menu mobile fullscreen. Não toca em links da aplicação inteira.
   Vale tanto no navegador mobile quanto no PWA instalado. */
.mobile-drawer.mobile-drawer--fullscreen a,
.mobile-drawer.mobile-drawer--fullscreen button,
.mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-item,
.mobile-drawer.mobile-drawer--fullscreen .mobile-menu-close {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
/* Liberar seleção/leitura em conteúdo "informativo" do drawer (nome do usuário,
   subtítulo do header) para acessibilidade. */
.mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-profile-name,
.mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-profile-role,
.mobile-drawer.mobile-drawer--fullscreen .mobile-menu-brand-name,
.mobile-drawer.mobile-drawer--fullscreen .mobile-menu-empty {
  -webkit-user-select: auto;
  user-select: auto;
}

@media (max-width: 991.98px) {
  /* Sheet ocupa a tela inteira, sem cantos arredondados. */
  .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-sheet {
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    transform: translateY(8%);
    opacity: 0;
    transition: transform .25s ease, opacity .22s ease;
    padding-top: env(safe-area-inset-top, 0);
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 110px);
    display: flex;
    flex-direction: column;
  }
  .mobile-drawer.mobile-drawer--fullscreen.mobile-drawer--open .mobile-drawer-sheet {
    transform: translateY(0);
    opacity: 1;
  }
  /* Backdrop opaco — efeito tela cheia, sem ver o conteúdo de baixo. */
  .mobile-drawer.mobile-drawer--fullscreen.mobile-drawer--open .mobile-drawer-backdrop {
    background: rgba(15, 23, 42, .92);
  }
  /* Esconde o "handle" do bottom-sheet quando fullscreen. */
  .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-handle {
    display: none;
  }

  /* Header: logo/nome da igreja + botão fechar */
  .mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #eef2f7;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 2;
  }
  .mobile-menu-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }
  .mobile-menu-brand-logo,
  .mobile-menu-brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--brand-primary, #4f46e5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
  }
  .mobile-menu-brand-text { min-width: 0; }
  .mobile-menu-brand-name {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60vw;
  }
  .mobile-menu-brand-sub {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
  }
  .mobile-menu-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #334155;
    border: none;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-menu-close:focus-visible {
    outline: 2px solid var(--brand-primary, #4f46e5);
    outline-offset: 2px;
  }

  /* Perfil compacto reaproveitando .mobile-drawer-profile, ajustado ao fullscreen */
  .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-profile {
    margin: 12px 16px 4px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  }

  /* Seções: viram blocos de cards em grid */
  .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-section {
    padding: 18px 14px 6px;
    border-bottom: none;
  }
  .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 0 6px 10px;
  }

  /* Container dos itens (grid 4 colunas; 3 em telas muito pequenas) */
  .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-section {
    display: flex;
    flex-wrap: wrap;
  }
  .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-section-title {
    width: 100%;
  }
  .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-section > a.mobile-drawer-item {
    /* Reset do estilo "linha" e vira card de grid */
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: calc(25% - 8px);
    min-height: 96px;
    margin: 4px;
    padding: 12px 4px 10px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #eef2f7;
    color: #1e293b;
    text-align: center;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
    /* permite quebra de palavras longas como "Configurações", "Aniversariantes" */
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
    white-space: normal;
  }
  .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-section > a.mobile-drawer-item:active {
    transform: scale(.96);
    background: #f8fafc;
    box-shadow: 0 1px 1px rgba(15, 23, 42, .04);
  }
  .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-section > a.mobile-drawer-item i {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f1f5f9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin: 0;
    flex-shrink: 0;
  }
  /* Badge de notificações continua funcionando */
  .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-section > a.mobile-drawer-item .mobile-notification-count {
    position: absolute;
    top: 6px;
    right: 8px;
  }
  .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-section > a.mobile-drawer-item {
    position: relative;
  }

  /* 3 colunas em telas estreitas */
  @media (max-width: 380px) {
    .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-section > a.mobile-drawer-item {
      width: calc(33.333% - 8px);
    }
  }

  /* Tema escuro — segue data-bs-theme no <html> (mesmo seletor do resto do app). */
  html[data-bs-theme="dark"] .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-sheet {
    background: linear-gradient(180deg, #0f172a 0%, #111827 110px);
  }
  html[data-bs-theme="dark"] .mobile-drawer.mobile-drawer--fullscreen .mobile-menu-header {
    background: #0f172a;
    border-bottom-color: #1f2937;
  }
  html[data-bs-theme="dark"] .mobile-drawer.mobile-drawer--fullscreen .mobile-menu-brand-name { color: #f1f5f9; }
  html[data-bs-theme="dark"] .mobile-drawer.mobile-drawer--fullscreen .mobile-menu-brand-sub { color: #94a3b8; }
  html[data-bs-theme="dark"] .mobile-drawer.mobile-drawer--fullscreen .mobile-menu-close {
    background: #1f2937;
    color: #e5e7eb;
  }
  html[data-bs-theme="dark"] .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-profile {
    background: #111827;
    border-color: #1f2937;
  }
  html[data-bs-theme="dark"] .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-section-title { color: #94a3b8; }
  html[data-bs-theme="dark"] .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-section > a.mobile-drawer-item {
    background: #111827;
    border-color: #1f2937;
    color: #e5e7eb;
  }
  html[data-bs-theme="dark"] .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-section > a.mobile-drawer-item i {
    background: #1f2937;
    color: #e5e7eb;
  }

  /* ── Item ATIVO (página atual) ───────────────────────────────── */
  .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-section > a.mobile-drawer-item.is-active {
    border-color: var(--brand-primary, #4f46e5);
    background: #eef2ff;
    color: #4338ca;
    box-shadow: 0 1px 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
  }
  .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-section > a.mobile-drawer-item.is-active i {
    background: var(--brand-primary, #4f46e5);
    color: #fff;
  }
  html[data-bs-theme="dark"] .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-section > a.mobile-drawer-item.is-active {
    background: #1e1b4b;
    border-color: #6366f1;
    color: #c7d2fe;
  }

  /* ── Estrela de favorito (canto superior esquerdo) ───────────── */
  .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-section > a.mobile-drawer-item.is-favorite::before {
    content: "★";
    position: absolute;
    top: 5px;
    left: 8px;
    font-size: 11px;
    line-height: 1;
    color: #f59e0b;
    pointer-events: none;
  }

  /* ── Feedback visual de long-press ───────────────────────────── */
  .mobile-drawer.mobile-drawer--fullscreen .mobile-drawer-section > a.mobile-drawer-item.is-long-pressing {
    transform: scale(.94);
    background: #f1f5f9;
  }

  /* ── Badge de pendências ─────────────────────────────────────── */
  .mobile-menu-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #f59e0b;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
  }
  .mobile-menu-badge--info { background: #0ea5e9; }
  .mobile-menu-badge--warning { background: #f59e0b; }
  .mobile-menu-badge--critical { background: #ef4444; }
  html[data-bs-theme="dark"] .mobile-menu-badge { box-shadow: 0 0 0 2px #111827; }

  /* ── Empty state educativo (Favoritos sem itens) ─────────────── */
  .mobile-menu-empty {
    flex: 1 1 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 6px 6px;
    padding: 12px 14px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: #475569;
    font-size: 12.5px;
    line-height: 1.35;
  }
  .mobile-menu-empty i {
    font-size: 18px;
    color: #f59e0b;
    flex-shrink: 0;
  }
  html[data-bs-theme="dark"] .mobile-menu-empty {
    background: #111827;
    border-color: #334155;
    color: #94a3b8;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   FAIXA TABLET / NOTEBOOK ESTREITO (768–991.98px)
   ----------------------------------------------------------------------------
   Nesta faixa a antiga barra de ícones horizontal no topo ficava apertada
   (em contas com muitos módulos os ícones e o perfil transbordavam e exigiam
   scroll lateral). Aqui reaproveitamos a navegação mobile já testada:
   bottom-nav fixa + drawer fullscreen ("Mais"). O conteúdo da página mantém
   o layout de tablet (multi-coluna) — só a navegação (chrome) muda.
   Desktop (≥992px) e celular (≤767px) permanecem como estavam.
   ════════════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 991.98px) {
  /* Esconde a barra de ícones e o menu expandido lateral nesta faixa */
  .sidebar-icons,
  .sidebar-expandido { display: none !important; }

  /* Conteúdo ocupa toda a largura; respiro inferior para a bottom-nav */
  .content,
  .sidebar-expandido:not(.d-none) ~ .content {
    margin-left: 0 !important;
    padding: 18px 20px calc(76px + env(safe-area-inset-bottom, 0)) !important;
  }

  /* Bottom-nav: mesma navegação do mobile, centralizada (são poucos itens) */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    justify-content: center;
    align-items: flex-end;
    gap: 18px;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid rgba(0, 0, 0, .07);
    box-shadow: 0 -1px 0 rgba(0, 0, 0, .05);
    z-index: 1050;
  }

  .mobile-bottom-nav .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 96px;
    height: 56px;
    padding: 6px 4px 5px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s ease;
  }

  .mobile-bottom-nav .mobile-nav-item i {
    font-size: 23px;
    line-height: 1;
    display: block;
  }

  .mobile-bottom-nav .mobile-nav-item span {
    font-size: 11px;
    line-height: 1.1;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .mobile-bottom-nav .mobile-nav-item.active,
  .mobile-bottom-nav .mobile-nav-item.active span { color: #111827; }
  .mobile-bottom-nav .mobile-nav-item.active span { font-weight: 700; }

  /* Tema escuro coerente com o resto do app */
  html[data-bs-theme="dark"] .mobile-bottom-nav {
    background: rgba(17, 24, 39, 0.96);
    border-top-color: rgba(255, 255, 255, .08);
  }
}
