/* =========================================================================
   Community Members — Main Stylesheet
   ========================================================================= */

:root {
  /* ═══════════════════════════════════════════════════════════════
     Cores da Identidade Visual ALA Angola
     ═══════════════════════════════════════════════════════════════ */
  
  /* Primárias: Laranja Vibrante */
  --cm-brand:       #FF6B00;    /* Laranja Principal */
  --cm-brand-light: #FF8533;    /* Laranja Claro (hover) */
  --cm-brand-dark:  #CC5500;    /* Laranja Escuro (active) */
  
  /* Acentos: Azul Teal */
  --cm-accent:      #17A2B8;    /* Azul Teal Principal */
  --cm-accent-light:#5BC0DE;    /* Azul Teal Claro */
  --cm-accent-dark: #138496;    /* Azul Teal Escuro */
  
  /* Profundidade: Azul Escuro */
  --cm-dark:        #003D5C;    /* Azul Escuro Principal */
  --cm-dark-light:  #005F7F;    /* Azul Escuro Claro */
  
  /* Backgrounds e Superfícies */
  --cm-bg:          #F5F7FA;    /* Fundo Cinza Claro */
  --cm-surface:     #FFFFFF;    /* Superfícies em Branco */
  --cm-border:      #E8EEF5;    /* Bordas em Cinza */
  
  /* Tipografia */
  --cm-text:        #2C3E50;    /* Texto Principal Escuro */
  --cm-text-2:      #5A6C7D;    /* Texto Secundário */
  --cm-text-3:      #9BA3AF;    /* Texto Terciário Claro */
  
  /* Status e Estados Funcionais */
  --cm-success:     #28A745;    /* Verde - Sucesso */
  --cm-warning:     #FFC107;    /* Amarelo - Aviso */
  --cm-danger:      #DC3545;    /* Vermelho - Erro */
  
  /* Design Tokens */
  --cm-radius:      14px;
  --cm-radius-sm:   8px;
  --cm-shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --cm-shadow-md:   0 4px 16px rgba(0,0,0,.10);
  --cm-shadow-lg:   0 12px 40px rgba(0,0,0,.14);
  --cm-font:        'Inter', system-ui, -apple-system, sans-serif;
  --cm-transition:  .18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Global utils ─────────────────────────────────────────────────────────── */
.cm-btn-primary {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--cm-brand); color: #fff;
  border: none; border-radius: var(--cm-radius-sm);
  padding: 10px 20px; font-size: 14px; font-weight: 600;
  font-family: var(--cm-font); cursor: pointer;
  transition: background var(--cm-transition), transform .1s;
  text-decoration: none; white-space: nowrap;
}
.cm-btn-primary:hover { background: var(--cm-brand-light); color: #fff; }
.cm-btn-primary:active { transform: scale(.97); }
.cm-btn-primary.cm-btn-sm { padding: 7px 14px; font-size: 13px; }
.cm-btn-primary.cm-btn-block { width: 100%; justify-content: center; }
.cm-btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--cm-text-2);
  border: 1.5px solid var(--cm-border); border-radius: var(--cm-radius-sm);
  padding: 8px 16px; font-size: 14px; font-weight: 500;
  font-family: var(--cm-font); cursor: pointer;
  transition: all var(--cm-transition); text-decoration: none;
}
.cm-btn-ghost:hover { border-color: var(--cm-brand); color: var(--cm-brand); }
.cm-btn-outline {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--cm-brand);
  border: 2px solid var(--cm-brand); border-radius: var(--cm-radius-sm);
  padding: 10px 20px; font-size: 14px; font-weight: 600;
  font-family: var(--cm-font); cursor: pointer; text-decoration: none;
  transition: all var(--cm-transition);
}
.cm-btn-outline:hover { background: var(--cm-brand); color: #fff; }
.cm-plan-badge {
  display: inline-flex; align-items: center;
  background: linear-gradient(135deg, var(--cm-brand), var(--cm-brand-light));
  color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px; text-transform: uppercase;
  letter-spacing: .5px;
}
.cm-plan-badge-lg { font-size: 10px; padding: 5px 10px; }
.cm-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--cm-danger); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 18px; height: 18px;
  border-radius: 9px; padding: 0 4px; line-height: 1;
}
.cm-auth-msg {
  padding: 12px 16px; border-radius: var(--cm-radius-sm);
  font-size: 14px; font-weight: 500; margin-bottom: 16px;
}
.cm-auth-msg.cm-msg-success { background: #dcfce7; color: #16a34a; }
.cm-auth-msg.cm-msg-error   { background: #fee2e2; color: #dc2626; }

/* ── Notice bar ───────────────────────────────────────────────────────────── */
.cm-notice {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; border-radius: var(--cm-radius-sm);
  font-size: 14px; margin-bottom: 20px;
}
.cm-notice-warn { background: #fef3c7; color: #92400e; }
.cm-notice-link { color: inherit; font-weight: 700; margin-left: 8px; }

/* ═══════════════════════════════════════════════════════════════════════════
   TOP NAV
   ═══════════════════════════════════════════════════════════════════════════ */
.cm-top-nav {
  position: sticky; top: 0; z-index: 1000;
  background: #fff; border-bottom: 1px solid var(--cm-border);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.cm-nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  justify-content: space-between;
  padding: 12px 20px;
}
.cm-nav-logo { text-decoration: none; flex-shrink: 0; }
.cm-nav-logo-img { height: 36px; }
.cm-nav-logo-text { font-size: 20px; font-weight: 800; color: var(--cm-brand); }
.cm-nav-search {
  flex: 1; max-width: 380px; position: relative;
  display: flex; align-items: center;
  background: var(--cm-bg); border-radius: 30px; padding: 8px 16px; gap: 8px;
}
.cm-nav-search i { color: var(--cm-text-3); flex-shrink: 0; }
.cm-nav-search input {
  border: none; background: transparent; outline: none;
  font-size: 14px; width: 100%; color: var(--cm-text);
  font-family: var(--cm-font);
}
.cm-search-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--cm-border); border-radius: var(--cm-radius);
  box-shadow: var(--cm-shadow-md); max-height: 280px; overflow-y: auto; z-index: 500;
}
.cm-search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; cursor: pointer; text-decoration: none; color: var(--cm-text);
  transition: background var(--cm-transition);
}
.cm-search-result-item:hover { background: var(--cm-bg); }
.cm-search-result-item img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.cm-search-result-item .name { font-weight: 600; font-size: 14px; }
.cm-search-result-item .username { font-size: 12px; color: var(--cm-text-3); }
.cm-nav-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.cm-nav-icon-btn {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--cm-bg); color: var(--cm-text-2);
  text-decoration: none; font-size: 16px; transition: all var(--cm-transition);
  border: none; cursor: pointer;
}
.cm-nav-icon-btn:hover { background: var(--cm-border); color: var(--cm-brand); }
.cm-nav-icon-btn .cm-badge { position: absolute; top: -2px; right: -2px; }
.cm-nav-user-menu { position: relative; }
.cm-nav-avatar-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; padding: 4px;
  border-radius: 30px; transition: background var(--cm-transition);
}
.cm-nav-avatar-btn:hover { background: var(--cm-bg); }
.cm-nav-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.cm-nav-chevron { font-size: 11px; color: var(--cm-text-3); }
.cm-nav-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: #fff; border: 1px solid var(--cm-border); border-radius: var(--cm-radius);
  box-shadow: var(--cm-shadow-md); min-width: 200px; padding: 8px 0; z-index: 500;
  display: none;
}
.cm-nav-dropdown.open { display: block; }
.cm-dd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 14px; color: var(--cm-text);
  text-decoration: none; cursor: pointer; background: none; border: none;
  width: 100%; text-align: left; font-family: var(--cm-font);
  transition: background var(--cm-transition);
}
.cm-dd-item:hover { background: var(--cm-bg); color: var(--cm-brand); }
.cm-dd-item i { width: 16px; color: var(--cm-text-3); }
.cm-dd-sep { height: 1px; background: var(--cm-border); margin: 4px 0; }
.cm-dd-plan { padding: 10px 16px; }
.cm-dd-plan small { display: block; color: var(--cm-text-3); font-size: 11px; margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════════════════
   FEED LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */
.cm-feed-page { background: var(--cm-bg); min-height: 100vh; font-family: var(--cm-font); }
.cm-feed-layout {
  max-width: 1200px; margin: 0 auto; padding: 24px 20px;
  display: grid; grid-template-columns: 260px 1fr 280px; gap: 24px;
}
.cm-sidebar-left, .cm-sidebar-right { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cm-feed-main { min-width: 0; }
.cm-sidebar-card {
  background: #fff; border-radius: var(--cm-radius); border: 1px solid var(--cm-border);
  box-shadow: var(--cm-shadow); padding: 20px; overflow: hidden;
}
.cm-sidebar-title {
  font-size: 14px; font-weight: 700; color: var(--cm-text); margin-bottom: 14px;
}
.cm-sidebar-title-link {
  text-decoration: none; color: inherit; transition: color var(--cm-transition);
}
.cm-sidebar-title-link:hover { color: var(--cm-brand); }
.cm-sidebar-ver-todos {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 12px; padding: 8px 12px; border-radius: var(--cm-radius-sm);
  font-size: 12px; font-weight: 600; color: var(--cm-brand);
  text-decoration: none; background: color-mix(in srgb, var(--cm-brand) 8%, transparent);
  transition: background var(--cm-transition);
}
.cm-sidebar-ver-todos:hover { background: color-mix(in srgb, var(--cm-brand) 16%, transparent); }
.cm-profile-mini { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.cm-profile-mini--stacked { flex-direction: column; text-align: center; gap: 8px; }
.cm-profile-mini-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--cm-border); }
.cm-profile-mini-avatar--lg { width: 72px; height: 72px; }
.cm-profile-mini-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cm-profile-mini-info--center { align-items: center; }
.cm-profile-mini-followers {
  font-size: 12px; color: var(--cm-text-3); text-decoration: none;
}
.cm-profile-mini-followers strong { color: var(--cm-text); font-weight: 700; }
.cm-profile-mini-followers:hover { color: var(--cm-brand); }
.cm-profile-mini-followers:hover strong { color: var(--cm-brand); }
.cm-profile-mini-name { font-weight: 700; font-size: 15px; color: var(--cm-text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-profile-mini-area { font-size: 12px; color: var(--cm-text-3); }
.cm-profile-mini-company { font-size: 12px; color: var(--cm-text-3); }
.cm-sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.cm-snav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--cm-radius-sm);
  font-size: 14px; font-weight: 500; color: var(--cm-text-2);
  text-decoration: none; transition: all var(--cm-transition); position: relative;
}
.cm-snav-item:hover, .cm-snav-item.active { background: #eef2ff; color: var(--cm-brand); }
.cm-snav-item i { width: 18px; text-align: center; }
.cm-snav-badge { margin-left: auto; }
.cm-sidebar-cta { text-align: center; }
.cm-sidebar-cta h3 { font-size: 15px; color: var(--cm-text); margin-bottom: 8px; }
.cm-sidebar-cta p { font-size: 13px; color: var(--cm-text-2); margin-bottom: 16px; line-height: 1.5; }
.cm-sidebar-cta-warn h3 { color: var(--cm-warning); }
.cm-profile-progress { margin-bottom: 10px; }
.cm-profile-progress-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600; color: var(--cm-text-2); margin-bottom: 6px;
}
.cm-profile-progress-pct { color: var(--cm-brand); }
.cm-profile-progress-bar {
  width: 100%; height: 8px; border-radius: 999px; background: var(--cm-border);
  overflow: hidden;
}
.cm-profile-progress-fill {
  height: 100%; border-radius: 999px; background: var(--cm-brand);
  transition: width .3s ease;
}
.cm-snav-item--complete-profile { color: var(--cm-brand); font-weight: 600; }
.cm-profile-complete-banner {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--cm-radius-sm); text-align: center;
  font-size: 13px; font-weight: 600; color: #15803d;
  background: color-mix(in srgb, #15803d 10%, transparent);
}
.cm-profile-complete-banner i { color: #15803d; }
.cm-member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--cm-border); transition: background .15s;
  cursor: pointer; border-radius: 4px;
}
.cm-member-row:hover {
  background: var(--cm-bg); color: var(--cm-brand);
}
.cm-member-row:last-child { border: none; }
.cm-member-row-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.cm-member-row-info { display: flex; flex-direction: column; }
.cm-member-row-name { font-size: 13px; font-weight: 600; color: var(--cm-text); }
.cm-member-row-username { font-size: 12px; color: var(--cm-text-3); }

/* ── Widget "Membros Online Agora" (barra lateral do feed) ── */
.cm-online-title-dot {
  color: #22c55e; font-size: 10px; vertical-align: middle;
  animation: cm-online-pulse 1.8s infinite;
}
@keyframes cm-online-pulse {
  0%   { opacity: 1; }
  50%  { opacity: .35; }
  100% { opacity: 1; }
}
.cm-member-row-avatar-wrap { position: relative; flex-shrink: 0; }
.cm-member-row-avatar-wrap .cm-member-row-avatar { display: block; }
.cm-member-row-avatar-wrap .cm-online-dot { position: absolute; bottom: 0; right: 0; }
.cm-plan-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border: 1.5px solid var(--cm-border); border-radius: var(--cm-radius-sm);
  margin-bottom: 8px; text-decoration: none; transition: all var(--cm-transition);
}
.cm-plan-item:hover { border-color: var(--cm-brand); }
.cm-plan-item-name { font-size: 13px; font-weight: 600; color: var(--cm-text); }
.cm-plan-item-price { font-size: 13px; color: var(--cm-brand); font-weight: 700; }

/* ── Áreas de Atuação sidebar widget ─────────────────────────────────── */
.cm-areas-card .cm-sidebar-title { margin-bottom: 10px; }
.cm-area-stats-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.cm-area-stat-item { border-radius: 8px; overflow: hidden; }
.cm-area-stat-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; text-decoration: none; border-radius: 8px;
  transition: background var(--cm-transition);
}
.cm-area-stat-link:hover { background: var(--cm-bg); }
.cm-area-stat-name { font-size: 13px; color: var(--cm-text); font-weight: 500; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-area-stat-count {
  font-size: 12px; font-weight: 700; color: #fff;
  background: var(--cm-brand); border-radius: 20px;
  padding: 1px 9px; flex-shrink: 0; margin-left: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MEMBER TABS & COMPACT FILTERING
   ═══════════════════════════════════════════════════════════════════════════ */
.cm-members-tabs-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: hidden;   /* só horizontal */
    overflow-y: hidden; /* remove scroll vertical */
    align-items: center;
    width: 100%;
}

.cm-members-tab-btn {
    flex-shrink: 0;
    white-space: nowrap;
}



.cm-members-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--cm-text-3);
    cursor: pointer;
    transition: all var(--cm-transition);
    border-bottom: 3px solid transparent;
    position: relative;
    bottom: -2px;
    white-space: nowrap;
}

.cm-members-tab-btn:hover {
  color: var(--cm-text-2);
}
.cm-members-tab-btn.active {
  color: var(--cm-brand);
  border-bottom-color: var(--cm-brand);
}

/* ── FIX: painéis de conteúdo dos tabs (Activos/Populares/Recentes) ─────────
   Faltava esta regra — sem ela, os 3 painéis ficam visíveis ao mesmo tempo
   (display:block é o default de uma <div>), por isso os tabs pareciam não
   filtrar nada. O JS (MemberTabs.init) já alterna a classe .active
   corretamente; aqui só precisamos de escondê-los/mostrá-los. ─────────────── */
.cm-members-tab-pane {
  display: none;
}
.cm-members-tab-pane.active {
  display: block;
}

/* Compact filter bar */
.cm-members-filters-compact {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 16px;
  background: #f9f9f9;
  border-radius: var(--cm-radius-sm);
  margin-bottom: 24px;
}
.cm-filter-search {
  position: relative;
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
}
.cm-filter-search .fa {
  position: absolute;
  left: 12px;
  color: #94a3b8;
  font-size: 14px;
  pointer-events: none;
}
.cm-filter-search input {
  padding: 9px 12px 9px 34px;
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--cm-radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  outline: none;
}
.cm-filter-search input:focus {
  border-color: var(--cm-brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.cm-filter-select {
  padding: 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--cm-radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  cursor: pointer;
  outline: none;
  color: #374151;
  min-width: 140px;
}
.cm-filter-select:focus {
  border-color: var(--cm-brand);
}
.cm-mf-search-btn {
  padding: 9px 14px;
  font-size: 14px;
  white-space: nowrap;
}
.cm-mf-clear-btn {
  padding: 8px 12px;
}
.cm-search-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  transition: color var(--cm-transition);
}
.cm-search-clear:hover {
  color: var(--cm-text);
}

/* ═══════════════════════════════════════════════════════════════════════════
   POST CREATOR
   ═══════════════════════════════════════════════════════════════════════════ */
.cm-post-creator {
  background: #fff; border-radius: var(--cm-radius); border: 1px solid var(--cm-border);
  box-shadow: var(--cm-shadow); padding: 20px; margin-bottom: 20px;
}
.cm-creator-top { display: flex; align-items: center; gap: 12px; }
.cm-creator-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.cm-creator-trigger {
  flex: 1; background: var(--cm-bg); border: 1.5px solid var(--cm-border);
  border-radius: 30px; padding: 10px 20px; text-align: left; font-size: 14px;
  color: var(--cm-text-3); cursor: pointer; font-family: var(--cm-font);
  transition: all var(--cm-transition);
}
.cm-creator-trigger:hover { border-color: var(--cm-brand); color: var(--cm-text); }
.cm-creator-textarea {
  width: 100%; border: 1.5px solid var(--cm-border); border-radius: var(--cm-radius-sm);
  padding: 12px; font-size: 15px; font-family: var(--cm-font); color: var(--cm-text);
  resize: vertical; outline: none; margin-top: 14px; line-height: 1.6;
  transition: border var(--cm-transition);
}
.cm-creator-textarea:focus { border-color: var(--cm-brand); }
.cm-creator-footer {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-top: 14px;
}
.cm-creator-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cm-tool-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 1.5px solid var(--cm-border); border-radius: 20px;
  padding: 7px 14px; font-size: 13px; color: var(--cm-text-2); cursor: pointer;
  font-family: var(--cm-font); transition: all var(--cm-transition);
}
.cm-tool-btn:hover { border-color: var(--cm-brand); color: var(--cm-brand); }
.cm-select-sm {
  background: var(--cm-bg); border: 1.5px solid var(--cm-border); border-radius: 20px;
  padding: 7px 12px; font-size: 13px; color: var(--cm-text); cursor: pointer;
  outline: none; font-family: var(--cm-font);
}
.cm-creator-actions { display: flex; gap: 8px; }
.cm-media-previews { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* Link preview card */
.cm-link-preview { margin-top: 12px; }
.cm-link-loading { padding: 10px 14px; font-size: 13px; color: var(--cm-text-3); }
.cm-link-card {
  display: flex; align-items: flex-start; gap: 12px;
  border: 1px solid var(--cm-border); border-radius: 10px;
  overflow: hidden; background: var(--cm-surface); position: relative;
}
.cm-link-card-img { flex-shrink: 0; width: 120px; min-height: 80px; }
.cm-link-card-img img { width: 100%; height: 90px; object-fit: cover; display: block; }
.cm-link-card-info { flex: 1; padding: 10px 10px 10px 0; min-width: 0; }
.cm-link-card-domain { font-size: 11px; color: var(--cm-text-3); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.cm-link-card-title { font-size: 14px; font-weight: 600; color: var(--cm-text); line-height: 1.3; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-link-card-desc { font-size: 12px; color: var(--cm-text-2); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cm-link-card-remove {
  position: absolute; top: 6px; right: 8px;
  background: rgba(0,0,0,.45); color: #fff; border: none; border-radius: 50%;
  width: 22px; height: 22px; font-size: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.cm-link-card-remove:hover { background: rgba(0,0,0,.7); }
.cm-media-preview-item {
  position: relative; width: 100px; height: 100px; border-radius: var(--cm-radius-sm);
  overflow: hidden; border: 1px solid var(--cm-border);
}
.cm-media-preview-item img,
.cm-media-preview-item video { width: 100%; height: 100%; object-fit: cover; }
.cm-media-preview-remove {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px;
  background: rgba(0,0,0,.7); color: #fff; border: none; border-radius: 50%;
  cursor: pointer; font-size: 11px; display: flex; align-items: center; justify-content: center;
}
.cm-media-preview-audio { display: flex; align-items: center; justify-content: center; background: #f8fafc; }
.cm-media-preview-audio i { font-size: 28px; color: var(--cm-brand); }

/* ═══════════════════════════════════════════════════════════════════════════
   FEED POSTS
   ═══════════════════════════════════════════════════════════════════════════ */
.cm-post-card {
  background: #fff; border-radius: var(--cm-radius); border: 1px solid var(--cm-border);
  box-shadow: var(--cm-shadow); margin-bottom: 20px; overflow: hidden;
  animation: cm-fadeInUp .3s ease forwards;
}
@keyframes cm-fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cm-post-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px 0; }
.cm-post-avatar {
  width: 46px; height: 46px; border-radius: 50%; object-fit: cover;
  text-decoration: none; flex-shrink: 0;
}
.cm-post-author-info { flex: 1; min-width: 0; }
.cm-post-author-name {
  font-weight: 700; font-size: 15px; color: var(--cm-text);
  text-decoration: none; display: flex; align-items: center; gap: 8px;
}
.cm-post-author-name:hover { color: var(--cm-brand); }
.cm-post-author-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.cm-post-time { font-size: 12px; color: var(--cm-text-3); }
.cm-post-area { font-size: 12px; color: var(--cm-text-3); }
.cm-post-menu { position: relative; }
.cm-post-menu-btn {
  background: none; border: none; cursor: pointer; padding: 8px;
  color: var(--cm-text-3); border-radius: 50%; transition: all var(--cm-transition); font-size: 16px;
}
.cm-post-menu-btn:hover { background: var(--cm-bg); color: var(--cm-text); }
.cm-post-dropdown {
  position: absolute; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid var(--cm-border); border-radius: var(--cm-radius-sm);
  box-shadow: var(--cm-shadow-md); min-width: 140px; z-index: 100;
}
.cm-post-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; font-size: 14px; color: var(--cm-text); cursor: pointer;
  border: none; background: none; width: 100%; font-family: var(--cm-font);
  transition: background var(--cm-transition);
}
.cm-post-dropdown-item:hover { background: var(--cm-bg); }
.cm-post-dropdown-item.danger { color: var(--cm-danger); }
.cm-post-body { padding: 14px 20px; }
.cm-post-text { font-size: 15px; line-height: 1.65; color: var(--cm-text); word-break: break-word; position: relative; }
.cm-post-text .cm-mention { color: var(--cm-brand); font-weight: 600; text-decoration: none; }
.cm-post-text .cm-mention:hover { text-decoration: underline; }

/* "Ver mais" truncation — long post text is clamped to a few lines until
   expanded. The button sits inline right after the last visible word via
   a small fade so it reads as a natural continuation of the text. */
.cm-post-text.cm-clamped,
.cm-post-text-card.cm-clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}
.cm-post-readmore-btn {
  display: inline-block;
  margin-top: 4px;
  border: none;
  background: none;
  padding: 0;
  color: var(--cm-text-2);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.cm-post-readmore-btn:hover { color: var(--cm-brand); text-decoration: underline; }
.cm-post-text-card .cm-post-readmore-btn { color: rgba(255,255,255,.85); }
.cm-post-text-card .cm-post-readmore-btn:hover { color: #fff; }

/* Textarea wrapper needs relative positioning so #cm-mention-dropdown anchors correctly */
.cm-creator-textarea-wrap { position: relative; }

/* Text-only post styled card */
.cm-post-text-card {
  min-height: 180px; padding: 28px 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; line-height: 1.5;
  color: #fff; text-align: center; word-break: break-word;
}

/* YouTube embed in feed post */
.cm-post-yt-embed {
  position: relative; width: 100%; padding-top: 56.25%;
  background: #000; overflow: hidden;
}
.cm-post-yt-embed iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  border: 0;
}

/* Link card inside post (clickable, no remove button) */
.cm-link-card--post {
  display: flex; align-items: flex-start; gap: 0;
  border-top: 1px solid var(--cm-border); text-decoration: none;
  overflow: hidden; margin: 0; background: var(--cm-bg);
  transition: background var(--cm-transition);
}
.cm-link-card--post:hover { background: var(--cm-surface); }
.cm-link-card--post .cm-link-card-img { width: 100px; flex-shrink: 0; }
.cm-link-card--post .cm-link-card-img img { width: 100%; height: 72px; object-fit: cover; display: block; }
.cm-link-card--post .cm-link-card-info { padding: 10px 14px; flex: 1; min-width: 0; }

/* YouTube preview in creator area */
.cm-link-preview-yt {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--cm-border); border-radius: 10px; overflow: hidden;
  background: var(--cm-surface); position: relative;
}
.cm-link-yt-player { position: relative; width: 130px; flex-shrink: 0; cursor: pointer; }
.cm-link-yt-player img { width: 100%; height: 80px; object-fit: cover; display: block; }
.cm-link-yt-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.6);
}
.cm-link-preview-yt .cm-link-card-info { flex: 1; padding: 10px 36px 10px 0; min-width: 0; }
.cm-link-preview-yt .cm-link-card-remove {
  position: absolute; top: 6px; right: 8px;
  background: rgba(0,0,0,.45); color: #fff; border: none; border-radius: 50%;
  width: 22px; height: 22px; font-size: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.cm-link-preview-yt .cm-link-card-remove:hover { background: rgba(0,0,0,.7); }
.cm-post-media { margin: 0; }
.cm-post-media-single img {
  width: 100%; max-height: 500px; object-fit: cover; display: block;
}
.cm-post-media-grid { display: grid; gap: 3px; }
.cm-post-media-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.cm-post-media-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.cm-post-media-grid img { width: 100%; height: 200px; object-fit: cover; cursor: pointer; display: block; }
.cm-post-media-cell { position: relative; overflow: hidden; }

/* Featured layout (3+ images): first image large on the left, the rest
   stacked in a column on the right, filling the whole block exactly. */
.cm-post-media-grid--featured {
  grid-template-columns: 2fr 1fr;
  height: 360px;
}
.cm-post-media-grid--featured img { height: 100%; }
.cm-post-media-grid--right-2 { grid-template-rows: 1fr 1fr; }
.cm-post-media-grid--right-3 { grid-template-rows: 1fr 1fr 1fr; }
.cm-post-media-grid--featured .cm-post-media-cell--featured {
  grid-column: 1;
  grid-row: 1 / -1;
}
.cm-post-media-more {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.5); color: #fff;
  font-size: 22px; font-weight: 700;
  pointer-events: none;
}
.cm-post-video video { width: 100%; max-height: 400px; background: #000; display: block; }
.cm-post-audio { padding: 12px 20px; background: #f8fafc; }
.cm-post-audio audio { width: 100%; }
.cm-post-gated {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 20px; text-align: center;
  background: linear-gradient(to bottom, transparent, var(--cm-bg));
}
.cm-post-gated i { font-size: 32px; color: var(--cm-text-3); margin-bottom: 12px; }
.cm-post-gated p { color: var(--cm-text-2); font-size: 14px; margin-bottom: 16px; }
.cm-post-footer { padding: 8px 16px; border-top: 1px solid var(--cm-border); }
.cm-post-actions { display: flex; align-items: center; gap: 4px; }
.cm-action-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 20px; border: none; background: none;
  font-size: 14px; font-weight: 500; color: var(--cm-text-2); cursor: pointer;
  font-family: var(--cm-font); transition: all var(--cm-transition);
}
.cm-action-btn:hover { background: var(--cm-bg); color: var(--cm-brand); }
.cm-action-btn.liked { color: var(--cm-danger); }
.cm-action-btn.liked i { animation: cm-heartPop .3s ease; }
@keyframes cm-heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* Comments */
.cm-comments-section { padding: 0 16px 12px; border-top: 1px solid var(--cm-border); }
.cm-comments-list { display: flex; flex-direction: column; gap: 2px; padding-top: 12px; }
.cm-comment-item { display: flex; gap: 10px; padding: 8px 0; }
.cm-comment-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.cm-comment-body { flex: 1; min-width: 0; }
.cm-comment-bubble {
  background: var(--cm-bg); border-radius: 0 var(--cm-radius) var(--cm-radius) var(--cm-radius);
  padding: 10px 14px; display: inline-block; max-width: 100%;
}
.cm-comment-author { font-weight: 700; font-size: 13px; color: var(--cm-text); text-decoration: none; }
.cm-comment-author:hover { color: var(--cm-brand); }
.cm-comment-text { font-size: 14px; color: var(--cm-text); line-height: 1.5; margin-top: 3px; word-break: break-word; }
.cm-comment-text .cm-mention { color: var(--cm-brand); font-weight: 600; text-decoration: none; }
.cm-comment-meta { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.cm-comment-time { font-size: 11px; color: var(--cm-text-3); }
.cm-comment-like-btn, .cm-comment-reply-btn {
  background: none; border: none; font-size: 12px; cursor: pointer;
  color: var(--cm-text-3); font-family: var(--cm-font); padding: 0;
  transition: color var(--cm-transition);
}
.cm-comment-like-btn:hover { color: var(--cm-danger); }
.cm-comment-reply-btn:hover { color: var(--cm-brand); }
.cm-comment-like-btn.liked { color: var(--cm-danger); font-weight: 700; }
.cm-comment-replies { padding-left: 24px; margin-top: 4px; }
.cm-comment-add {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 0 4px; border-top: 1px solid var(--cm-border); margin-top: 8px;
}
.cm-comment-add-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.cm-comment-add-input {
  flex: 1; background: var(--cm-bg); border: 1.5px solid transparent;
  border-radius: 20px; padding: 8px 40px 8px 14px; font-size: 14px;
  font-family: var(--cm-font); resize: none; outline: none; color: var(--cm-text);
  transition: border var(--cm-transition); min-height: 38px; max-height: 100px;
}
.cm-comment-add-input:focus { border-color: var(--cm-brand); background: #fff; }
.cm-comment-add-send {
  background: none; border: none; color: var(--cm-text-3); cursor: pointer;
  font-size: 18px; transition: color var(--cm-transition); padding: 8px;
}
.cm-comment-add-send:hover { color: var(--cm-brand); }
.cm-comments-load-btn {
  background: none; border: none; color: var(--cm-brand); cursor: pointer;
  font-size: 13px; font-weight: 600; font-family: var(--cm-font); padding: 8px 0;
}
.cm-reply-form-wrap { margin-top: 6px; padding-left: 46px; }
.cm-reply-input {
  width: 100%; background: var(--cm-bg); border: 1.5px solid transparent;
  border-radius: 20px; padding: 8px 14px; font-size: 13px;
  font-family: var(--cm-font); resize: none; outline: none; color: var(--cm-text);
  transition: border var(--cm-transition);
}
.cm-reply-input:focus { border-color: var(--cm-brand); background: #fff; }
.cm-reply-actions { display: flex; gap: 8px; margin-top: 6px; padding-left: 46px; }

/* Mention autocomplete */
.cm-mention-dropdown {
  background: #fff; border: 1px solid var(--cm-border); border-radius: var(--cm-radius);
  box-shadow: var(--cm-shadow-md); max-height: 220px; overflow-y: auto;
  margin-top: 4px; z-index: 500; position: absolute;
  left: 0; right: 0; top: 100%;
}
.cm-mention-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer; transition: background var(--cm-transition);
}
.cm-mention-item:hover, .cm-mention-item.active { background: var(--cm-bg); }
.cm-mention-item img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.cm-mention-item .name { font-weight: 600; font-size: 14px; }
.cm-mention-item .username { font-size: 12px; color: var(--cm-text-3); }

/* Skeleton loader */
.cm-skeleton-post {
  background: #fff; border-radius: var(--cm-radius); border: 1px solid var(--cm-border);
  padding: 20px; margin-bottom: 20px;
}
.cm-skeleton-post::after {
  content: ''; display: block; height: 200px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%; animation: cm-skeleton 1.5s infinite; border-radius: 8px;
}
@keyframes cm-skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.cm-feed-loader { display: none; }
.cm-feed-loader.active { display: block; }
.cm-feed-end { text-align: center; padding: 32px; color: var(--cm-text-3); font-size: 14px; }

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.cm-login-body { margin: 0; padding: 0; font-family: var(--cm-font); background: #0f172a; }
.cm-login-root { display: flex; min-height: 100vh; }
.cm-login-left {
  flex: 1; background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  background-size: cover; background-position: center; position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 60px 48px;
}
.cm-login-left-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(15,23,42,.8), rgba(30,27,75,.6));
}
.cm-login-left-content { position: relative; color: #fff; max-width: 440px; }
.cm-login-logo-img { height: 52px; margin-bottom: 40px; }
.cm-login-logo-text { font-size: 28px; font-weight: 900; margin-bottom: 40px; display: block; }
.cm-login-tagline { font-size: 42px; font-weight: 800; line-height: 1.15; margin-bottom: 16px; }
.cm-login-subtitle { font-size: 18px; color: rgba(255,255,255,.75); margin-bottom: 48px; line-height: 1.5; }
.cm-login-features { display: flex; flex-direction: column; gap: 14px; }
.cm-lf-item { display: flex; align-items: center; gap: 12px; font-size: 16px; color: rgba(255,255,255,.9); }
.cm-lf-item span { font-size: 20px; }
.cm-login-right {
  width: 480px; background: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 60px 48px; overflow-y: auto;
}
.cm-login-card { width: 100%; max-width: 380px; }
.cm-login-card-logo { height: 44px; margin-bottom: 28px; }
.cm-login-brand { font-size: 24px; font-weight: 900; color: var(--cm-brand); margin-bottom: 28px; }
.cm-auth-tabs { display: flex; background: var(--cm-bg); border-radius: 10px; padding: 4px; margin-bottom: 28px; }
.cm-auth-tab {
  flex: 1; padding: 8px; font-size: 14px; font-weight: 600; border: none;
  background: none; border-radius: 8px; cursor: pointer; color: var(--cm-text-2);
  font-family: var(--cm-font); transition: all var(--cm-transition);
}
.cm-auth-tab.active { background: #fff; color: var(--cm-brand); box-shadow: var(--cm-shadow); }
.cm-login-title { font-size: 24px; font-weight: 800; color: var(--cm-text); margin-bottom: 8px; }
.cm-login-desc { font-size: 14px; color: var(--cm-text-2); margin-bottom: 28px; line-height: 1.5; }
.cm-form { display: flex; flex-direction: column; gap: 18px; }
.cm-field-group { display: flex; flex-direction: column; gap: 6px; }
.cm-field-group label { font-size: 13px; font-weight: 600; color: var(--cm-text); }
.cm-required-mark { color: var(--cm-danger, #e11d48); }
.cm-input-wrap { position: relative; display: flex; align-items: center; }
.cm-input-icon {
  position: absolute; left: 14px; color: var(--cm-text-3); pointer-events: none; z-index: 1;
}
.cm-input-wrap input {
  width: 100%; border: 1.5px solid var(--cm-border); border-radius: var(--cm-radius-sm);
  padding: 11px 44px 11px 40px; font-size: 15px; font-family: var(--cm-font);
  color: var(--cm-text); outline: none; transition: border var(--cm-transition);
}
.cm-input-wrap input:focus { border-color: var(--cm-brand); }
.cm-toggle-pass {
  position: absolute; right: 12px; background: none; border: none;
  cursor: pointer; color: var(--cm-text-3); padding: 4px;
  transition: color var(--cm-transition);
}
.cm-toggle-pass:hover { color: var(--cm-brand); }
.cm-form-row { display: flex; align-items: center; justify-content: space-between; }
.cm-checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--cm-text-2); cursor: pointer; }
.cm-link-btn { background: none; border: none; color: var(--cm-brand); font-size: 14px; cursor: pointer; font-family: var(--cm-font); padding: 0; }
.cm-btn-auth {
  width: 100%; padding: 13px; background: var(--cm-brand); color: #fff;
  border: none; border-radius: var(--cm-radius-sm); font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: var(--cm-font); transition: all var(--cm-transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.cm-btn-auth:hover { background: var(--cm-brand-light); }
.cm-btn-auth.cm-btn-outline { background: transparent; color: var(--cm-brand); border: 2px solid var(--cm-brand); }
.cm-btn-auth.cm-btn-outline:hover { background: var(--cm-brand); color: #fff; }
.cm-login-divider {
  text-align: center; position: relative; margin: 24px 0;
  color: var(--cm-text-3); font-size: 13px;
}
.cm-login-divider::before, .cm-login-divider::after {
  content: ''; position: absolute; top: 50%; width: calc(50% - 70px);
  height: 1px; background: var(--cm-border);
}
.cm-login-divider::before { left: 0; }
.cm-login-divider::after { right: 0; }
.cm-plans-preview { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.cm-plan-link-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border: 1.5px solid var(--cm-border); border-radius: var(--cm-radius-sm);
  text-decoration: none; transition: all var(--cm-transition);
}
.cm-plan-link-card:hover { border-color: var(--cm-brand); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.cm-plan-name { font-weight: 700; color: var(--cm-text); font-size: 14px; }
.cm-plan-price { color: var(--cm-brand); font-weight: 700; font-size: 14px; }
.cm-plan-cta { color: var(--cm-brand); font-size: 13px; }
.cm-back-login { display: block; text-align: center; margin-top: 12px; }
.cm-login-footer { color: var(--cm-text-3); font-size: 12px; text-align: center; margin-top: 32px; }

/* ═══════════════════════════════════════════════════════════════════════════
   PROFILE PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.cm-profile-page { background: var(--cm-bg); min-height: 100vh; font-family: var(--cm-font); }
.cm-profile-cover {
  height: 280px; background: linear-gradient(135deg, #667eea, #764ba2);
  background-size: cover; background-position: center; position: relative;
}
.cm-cover-edit-btn {
  position: absolute; bottom: 16px; right: 16px;
  background: rgba(0,0,0,.6); color: #fff; padding: 8px 14px;
  border-radius: 20px; cursor: pointer; font-size: 14px; display: flex; align-items: center; gap: 6px;
}
.cm-profile-main { max-width: 960px; margin: 0 auto; padding: 0 20px 40px; }
.cm-profile-header {
  background: #fff; border-radius: var(--cm-radius); border: 1px solid var(--cm-border);
  box-shadow: var(--cm-shadow); padding: 24px; margin-top: -60px; position: relative;
  display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap;
}
.cm-profile-avatar-wrap { position: relative; flex-shrink: 0; }
.cm-profile-avatar {
  width: 120px; height: 120px; border-radius: 50%; object-fit: cover;
  border: 4px solid #fff; box-shadow: var(--cm-shadow-md);
}
.cm-avatar-edit-btn {
  position: absolute; bottom: 4px; right: 4px;
  background: var(--cm-brand); color: #fff; width: 32px; height: 32px;
  border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 12px; border: 2px solid #fff;
}
.cm-profile-info { flex: 1; min-width: 200px; }
.cm-profile-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.cm-profile-name { font-size: 26px; font-weight: 800; color: var(--cm-text); }
.cm-status-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.cm-status-suspended { background: #fef3c7; color: #92400e; }
.cm-profile-username { color: var(--cm-text-3); font-size: 15px; margin-bottom: 8px; }
.cm-profile-area { color: var(--cm-text-2); font-size: 14px; display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.cm-profile-bio { font-size: 15px; color: var(--cm-text); line-height: 1.6; margin-bottom: 10px; }
.cm-profile-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--cm-text-2); margin-bottom: 10px; }
.cm-profile-meta a { color: var(--cm-text-2); text-decoration: none; }
.cm-profile-meta a:hover { color: var(--cm-brand); }
.cm-profile-socials { display: flex; gap: 10px; }
.cm-social-link {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 16px; transition: all var(--cm-transition); text-decoration: none;
}
.cm-social-ig { background: #f9a825; color: #fff; }
.cm-social-ig:hover { background: #e91e63; }
.cm-social-li { background: #0077b5; color: #fff; }
.cm-social-li:hover { background: #005582; }
.cm-social-wa { background: #25d366; color: #fff; }
.cm-social-wa:hover { background: #128c7e; }
.cm-profile-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; margin-left: auto; }
.cm-profile-stat { text-align: center; }
.cm-stat-num { display: block; font-size: 22px; font-weight: 800; color: var(--cm-brand); }
.cm-stat-lbl { font-size: 12px; color: var(--cm-text-3); }
.cm-profile-tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--cm-border); margin: 24px 0 20px;
}
.cm-ptab {
  padding: 12px 24px; font-size: 14px; font-weight: 600; border: none; background: none;
  cursor: pointer; color: var(--cm-text-2); font-family: var(--cm-font);
  border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all var(--cm-transition);
}
.cm-ptab.active { color: var(--cm-brand); border-bottom-color: var(--cm-brand); }
.cm-profile-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
}
.cm-grid-item {
  position: relative; aspect-ratio: 1; overflow: hidden; cursor: pointer;
  background: var(--cm-bg); border-radius: 4px;
}
.cm-grid-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.cm-grid-item:hover img { transform: scale(1.05); }
.cm-grid-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.4);
  display: none; align-items: center; justify-content: center; gap: 20px;
  color: #fff; font-size: 14px; font-weight: 600;
}
.cm-grid-item:hover .cm-grid-overlay { display: flex; }
.cm-grid-video-thumb, .cm-grid-audio-thumb, .cm-grid-text-thumb, .cm-grid-link-thumb {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: #f8fafc; color: var(--cm-text-3);
}
.cm-grid-text-thumb { padding: 12px; font-size: 12px; text-align: center; align-items: flex-start; overflow: hidden; }
.cm-grid-link-thumb { background: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 100%); color: var(--cm-brand); }
.cm-no-posts { grid-column: 1/-1; text-align: center; padding: 60px 20px; color: var(--cm-text-3); }
.cm-no-posts i { margin-bottom: 16px; }
.cm-settings-form-wrap { background: #fff; border-radius: var(--cm-radius); border: 1px solid var(--cm-border); padding: 32px; }
.cm-settings-form-wrap h3 { font-size: 18px; font-weight: 700; color: var(--cm-text); margin-bottom: 20px; }
.cm-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cm-field-full { grid-column: 1/-1; }
.cm-form textarea, .cm-settings-form-wrap input[type=text], .cm-settings-form-wrap input[type=url], .cm-settings-form-wrap input[type=password], .cm-settings-form-wrap input[type=email], .cm-settings-form-wrap input[type=tel], .cm-settings-form-wrap input[type=date], .cm-settings-form-wrap select, .cm-settings-form-wrap textarea {
  width: 100%; border: 1.5px solid var(--cm-border); border-radius: var(--cm-radius-sm);
  padding: 10px 14px; font-size: 14px; font-family: var(--cm-font); color: var(--cm-text);
  outline: none; transition: border var(--cm-transition); background: #fff;
}
.cm-settings-form-wrap input:focus, .cm-settings-form-wrap select:focus, .cm-settings-form-wrap textarea:focus { border-color: var(--cm-brand); }
.cm-form-sep { border: none; border-top: 1px solid var(--cm-border); margin: 24px 0; }
.cm-membership-info { padding: 24px 0; }
.cm-membership-card {
  background: linear-gradient(135deg, var(--cm-brand), var(--cm-brand-light));
  border-radius: var(--cm-radius); padding: 28px; color: #fff; max-width: 400px;
}
.cm-mc-status { font-size: 14px; font-weight: 700; margin-bottom: 8px; opacity: .9; }
.cm-mc-plan { font-size: 28px; font-weight: 900; margin-bottom: 20px; }
.cm-mc-dates { display: flex; gap: 32px; margin-bottom: 24px; }
.cm-mc-dates div { display: flex; flex-direction: column; gap: 4px; }
.cm-mc-dates label { font-size: 11px; opacity: .7; text-transform: uppercase; letter-spacing: .5px; }
.cm-mc-dates span { font-weight: 700; font-size: 16px; }
.cm-suspended-notice { text-align: center; padding: 60px 20px; color: var(--cm-text-3); }
.cm-suspended-notice i { margin-bottom: 16px; }
.cm-suspended-notice h3 { font-size: 20px; font-weight: 700; color: var(--cm-text); margin-bottom: 8px; }

/* ═══════════════════════════════════════════════════════════════════════════
   MESSAGES
   ═══════════════════════════════════════════════════════════════════════════ */
.cm-messages-page { font-family: var(--cm-font); padding: 20px; max-width: 1100px; margin: 0 auto; }
.cm-messages-wrap {
  background: #fff; border-radius: var(--cm-radius); border: 1px solid var(--cm-border);
  box-shadow: var(--cm-shadow-md); display: flex; overflow: hidden;
  height: 650px; /* substituído abaixo em browsers com suporte a min() */
  height: min(650px, calc(100vh - 120px));
}
.cm-conv-panel { width: 320px; border-right: 1px solid var(--cm-border); display: flex; flex-direction: column; flex-shrink: 0; min-height: 0; }
.cm-conv-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 16px 12px; border-bottom: 1px solid var(--cm-border); }
.cm-conv-header h2 { font-size: 18px; font-weight: 800; }
.cm-new-conv-btn { background: none; border: none; cursor: pointer; color: var(--cm-brand); font-size: 18px; padding: 6px; border-radius: 8px; transition: background var(--cm-transition); }
.cm-new-conv-btn:hover { background: var(--cm-bg); }
.cm-conv-search { padding: 12px 16px; border-bottom: 1px solid var(--cm-border); }
.cm-conv-search { display: flex; align-items: center; gap: 8px; background: var(--cm-bg); border-radius: 20px; padding: 8px 14px; }
.cm-conv-search i { color: var(--cm-text-3); }
.cm-conv-search input { border: none; background: none; outline: none; font-size: 14px; width: 100%; font-family: var(--cm-font); }
.cm-conv-list { flex: 1; min-height: 0; overflow-y: auto; }
.cm-conv-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer;
  border-bottom: 1px solid var(--cm-border); transition: background var(--cm-transition);
}
.cm-conv-item:hover, .cm-conv-item.active { background: #eef2ff; }
.cm-conv-avatar-wrap { position: relative; flex-shrink: 0; }
.cm-conv-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; position: relative; }
.cm-online-dot {
  position: absolute; bottom: 1px; right: 1px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #22c55e; border: 2px solid #fff;
}
.cm-conv-info { flex: 1; min-width: 0; }
.cm-conv-name { font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; }
.cm-conv-time { font-size: 11px; color: var(--cm-text-3); font-weight: 400; }
.cm-conv-preview { font-size: 13px; color: var(--cm-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-conv-unread { min-width: 20px; height: 20px; background: var(--cm-brand); color: #fff; border-radius: 10px; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.cm-thread-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#cm-thread-content {
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}
#cm-thread-content.is-visible { display: flex; }
.cm-thread-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--cm-text-3); padding: 40px; text-align: center; }
.cm-thread-empty h3 { font-size: 18px; font-weight: 700; color: var(--cm-text); }
.cm-thread-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--cm-border); }
.cm-back-btn { background: none; border: none; cursor: pointer; color: var(--cm-text-2); font-size: 18px; display: none; padding: 4px 8px; }
.cm-thread-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.cm-thread-info { flex: 1; }
.cm-thread-name { font-weight: 700; font-size: 15px; display: block; }
.cm-thread-username { font-size: 13px; color: var(--cm-text-3); text-decoration: none; }
.cm-thread-online-status { font-size: 12px; color: var(--cm-text-3); display: block; }
.cm-thread-online-status.cm-online { color: #22c55e; font-weight: 600; }
.cm-thread-online-status.cm-online::before {
  content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e; margin-right: 5px;
}
.cm-thread-profile-link { color: var(--cm-text-3); font-size: 18px; transition: color var(--cm-transition); }
.cm-thread-profile-link:hover { color: var(--cm-brand); }
.cm-thread-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.cm-msg-bubble-wrap { display: flex; flex-direction: column; }
.cm-msg-bubble-wrap.own { align-items: flex-end; }
.cm-msg-bubble {
  max-width: 70%; padding: 10px 14px; border-radius: 16px 16px 16px 4px;
  font-size: 14px; line-height: 1.5; word-break: break-word;
  background: var(--cm-bg); color: var(--cm-text);
}
.cm-msg-bubble-wrap.own .cm-msg-bubble { background: var(--cm-brand); color: #fff; border-radius: 16px 16px 4px 16px; }
.cm-msg-time { font-size: 11px; color: var(--cm-text-3); margin-top: 4px; padding: 0 4px; }
.cm-msg-bubble-wrap.cm-msg-failed .cm-msg-bubble { background: #fee2e2 !important; color: #b91c1c !important; }
.cm-msg-bubble-wrap.cm-msg-failed .cm-msg-time { color: #dc2626; display: flex; align-items: center; gap: 6px; }
.cm-msg-bubble-wrap.cm-msg-failed .cm-msg-time i { font-size: 12px; }
.cm-msg-retry { text-decoration: underline; cursor: pointer; font-weight: 600; }
.cm-msg-retry:hover { color: #991b1b; }
.cm-thread-input { display: flex; align-items: flex-end; gap: 12px; padding: 16px; border-top: 1px solid var(--cm-border); }
.cm-thread-input textarea {
  flex: 1; border: 1.5px solid var(--cm-border); border-radius: var(--cm-radius);
  padding: 10px 16px; font-size: 14px; font-family: var(--cm-font); resize: none; outline: none;
  max-height: 120px; transition: border var(--cm-transition); color: var(--cm-text);
}
.cm-thread-input textarea:focus { border-color: var(--cm-brand); }
.cm-msg-loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--cm-text-3); }

/* ═══════════════════════════════════════════════════════════════════════════
   NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════════ */
.cm-notifications-page { max-width: 680px; margin: 0 auto; padding: 24px 20px; font-family: var(--cm-font); }
.cm-notif-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.cm-notif-header h2 { font-size: 22px; font-weight: 800; }
.cm-notif-list { display: flex; flex-direction: column; gap: 2px; }
.cm-notif-item {
  display: flex; align-items: flex-start; gap: 14px; padding: 16px;
  background: #fff; border-radius: var(--cm-radius-sm); border: 1px solid var(--cm-border);
  cursor: pointer; transition: all var(--cm-transition); text-decoration: none; color: inherit;
}
.cm-notif-item:hover { background: #f8faff; border-color: var(--cm-brand); }
.cm-notif-item.unread { background: #eef2ff; border-color: rgba(79,70,229,.2); }
.cm-notif-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex-shrink: 0; position: relative; }
.cm-notif-icon { position: absolute; bottom: -2px; right: -2px; width: 20px; height: 20px; background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; border: 1px solid var(--cm-border); }
.cm-notif-body { flex: 1; }
.cm-notif-text { font-size: 14px; color: var(--cm-text); line-height: 1.5; }
.cm-notif-text strong { font-weight: 700; }
.cm-notif-time { font-size: 12px; color: var(--cm-text-3); margin-top: 4px; }
.cm-notif-unread-dot { width: 10px; height: 10px; background: var(--cm-brand); border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
.cm-no-notifs { text-align: center; padding: 60px 20px; color: var(--cm-text-3); font-size: 15px; }

/* ═══════════════════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════════════════ */
.cm-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 10000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: cm-fadeIn .2s ease;
}
@keyframes cm-fadeIn { from { opacity: 0; } to { opacity: 1; } }
.cm-modal-inner {
  background: #fff; border-radius: var(--cm-radius); box-shadow: var(--cm-shadow-lg);
  padding: 32px; width: 100%; max-width: 480px; position: relative;
  animation: cm-slideUp .25s ease;
}
@keyframes cm-slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.cm-modal-inner h3 { font-size: 20px; font-weight: 800; margin-bottom: 20px; }
.cm-modal-close {
  position: absolute; top: 16px; right: 16px; background: none; border: none;
  font-size: 18px; cursor: pointer; color: var(--cm-text-3); padding: 6px;
  border-radius: 8px; transition: all var(--cm-transition);
}
.cm-modal-close:hover { background: var(--cm-bg); color: var(--cm-text); }
.cm-new-msg-selected { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--cm-bg); border-radius: var(--cm-radius-sm); margin: 12px 0; }
.cm-new-msg-selected img { width: 36px; height: 36px; border-radius: 50%; }

/* ═══════════════════════════════════════════════════════════════════════════
   VISIBILITY SELECTOR (admin)
   ═══════════════════════════════════════════════════════════════════════════ */
.cm-visibility-selector { display: flex; align-items: center; gap: 6px; }

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN STYLES
   ═══════════════════════════════════════════════════════════════════════════ */
.cm-admin-wrap { font-family: var(--cm-font); }
.cm-admin-stats { display: flex; gap: 16px; flex-wrap: wrap; margin: 24px 0; }
.cm-stat-card {
  flex: 1; min-width: 130px; background: #fff; border-radius: var(--cm-radius);
  border: 1px solid var(--cm-border); padding: 20px; text-align: center;
  box-shadow: var(--cm-shadow);
}
.cm-stat-value { font-size: 32px; font-weight: 900; }
.cm-stat-label { font-size: 12px; color: var(--cm-text-2); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }
.cm-stat-blue .cm-stat-value   { color: #3b82f6; }
.cm-stat-green .cm-stat-value  { color: #22c55e; }
.cm-stat-orange .cm-stat-value { color: #f59e0b; }
.cm-stat-purple .cm-stat-value { color: #8b5cf6; }
.cm-stat-teal .cm-stat-value   { color: #14b8a6; }
.cm-stat-pink .cm-stat-value   { color: #ec4899; }
.cm-admin-card { background: #fff; border-radius: var(--cm-radius); border: 1px solid var(--cm-border); padding: 24px; margin-bottom: 24px; }
.cm-admin-card h2 { font-size: 18px; margin-bottom: 16px; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .cm-feed-layout { grid-template-columns: 240px 1fr; }
  .cm-sidebar-right { display: none; }
}
@media (max-width: 768px) {
  .cm-feed-layout { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
  .cm-sidebar-left { display: none; }
  .cm-nav-search { display: none; }

  /* Feed posts: the desktop card used the same fixed 20px side padding and
     small type on phones too, so on a narrow screen the padding dominated
     and the text read as tiny. Tighten the card chrome and size text up a
     touch so more of the width goes to actual content. */
  .cm-post-card { margin-bottom: 10px; border-radius: 12px; }
  .cm-post-header { padding: 12px 14px 0; gap: 10px; }
  .cm-post-avatar { width: 42px; height: 42px; }
  .cm-post-author-name { font-size: 14.5px; }
  .cm-post-time, .cm-post-area { font-size: 12.5px; }
  .cm-post-menu-btn { padding: 6px; }
  .cm-post-body { padding: 10px 14px; }
  .cm-post-text { font-size: 15.5px; line-height: 1.55; }
  .cm-post-media-grid img { height: 150px; }
  .cm-post-media-grid--featured { height: 260px; }
  .cm-post-media-grid--featured img { height: 100%; }
  .cm-post-footer { padding: 6px 10px; }
  .cm-action-btn { padding: 8px 10px; font-size: 13.5px; gap: 5px; }
  .cm-post-creator { padding: 14px; }
  .cm-post-gated { padding: 24px 14px; }

  .cm-profile-cover { height: 180px; }
  .cm-profile-header { flex-direction: column; align-items: flex-start; margin-top: -40px; }
  .cm-profile-avatar { width: 80px; height: 80px; }
  .cm-profile-name { font-size: 20px; }
  .cm-profile-actions { margin-left: 0; width: 100%; flex-direction: column; align-items: flex-start; gap: 14px; }
  .cm-profile-grid { grid-template-columns: repeat(2, 1fr); }
  .cm-form-grid { grid-template-columns: 1fr; }
  .cm-login-left { display: none; }
  .cm-login-right { width: 100%; padding: 40px 24px; }
  .cm-messages-wrap { height: calc(100vh - 120px); }
  .cm-conv-panel { display: none; }
  .cm-conv-panel.mobile-open { display: flex; width: 100%; }
  .cm-back-btn { display: block !important; }
  .cm-thread-panel { display: none; width: 100%; }
  .cm-thread-panel.mobile-active { display: flex; }
  .cm-settings-form-wrap { padding: 20px; }
}
@media (max-width: 480px) {
  .cm-post-creator { padding: 14px; }
  .cm-creator-tools { gap: 4px; }
  .cm-tool-btn { padding: 6px 10px; font-size: 12px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   v1.2.0 ADDITIONS — Login redesign · Canvas nav · Hamburger · Popup notifs
                    · Plan news · Popular/Recent members · Members page
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Reset/base for community body ─────────────────────────────────── */
.cm-community-body,
.cm-login-body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: #f1f5f9;
  min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════════════════
   LOGIN PAGE v2
   ══════════════════════════════════════════════════════════════════════ */
.cm-login-root {
  display: flex;
  min-height: 100vh;
}

/* Left branding panel */
.cm-login-left {
  flex: 0 0 52%;
  position: relative;
  background: linear-gradient(135deg, #0a2540 0%, #0d4f5c 50%, #0a7c6e 100%);
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cm-login-left-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,rgba(10,37,64,.82) 0%,rgba(13,79,92,.75) 100%);
}
/* + dot grid pattern */
.cm-login-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.15) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
.cm-login-left-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px 40px 24px;
}
.cm-login-left-logo {
  margin-bottom: 24px;
}
.cm-login-left-logo img {
  height: 52px;
  width: auto;
}
.cm-login-logo-brand {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.5px;
}
.cm-login-tagline {
  color: #fff;
  font-size: clamp(26px, 3.5vw, 40px);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 14px;
}
.cm-login-subtitle {
  color: rgba(255,255,255,.8);
  font-size: 15px;
  line-height: 1.65;
  max-width: 440px;
  margin: 0 0 22px;
}
.cm-login-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cm-login-features li {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255,255,255,.9);
  font-size: 14.5px;
}
.cm-lf-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  color: #fff;
}
.cm-login-back {
  position: relative;
  z-index: 1;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: 13px;
  padding: 14px 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color .2s;
}
.cm-login-back:hover { color: #fff; }

/* Right form panel */
.cm-login-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #fff;
}
.cm-login-card {
  width: 100%;
  max-width: 420px;
  animation: cm-login-card-in .5s cubic-bezier(.16,1,.3,1);
}
@keyframes cm-login-card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Lock icon */
.cm-login-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.cm-login-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--brand, #009688);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,150,136,.35);
}

.cm-login-panel {}
.cm-login-heading {
  font-size: 24px;
  font-weight: 800;
  color: #1a202c;
  text-align: center;
  margin: 0 0 4px;
}
.cm-login-subheading {
  color: #718096;
  text-align: center;
  font-size: 14px;
  margin: 0 0 20px;
}

/* Fields */
.cm-login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cm-login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cm-login-field label {
  font-size: 13.5px;
  font-weight: 600;
  color: #374151;
}
.cm-login-field input {
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14.5px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
  color: #1a202c;
  background: #fff;
}
.cm-login-field input:focus {
  border-color: var(--brand, #009688);
  box-shadow: 0 0 0 3px rgba(0,150,136,.12);
}
.cm-login-field input::placeholder { color: #a0aec0; }

.cm-pw-wrap { position: relative; }
.cm-pw-wrap input { padding-right: 44px; width: 100%; }
.cm-pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 15px;
  padding: 4px;
  line-height: 1;
}
.cm-pw-toggle:hover { color: var(--brand, #009688); }

.cm-login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.cm-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #4a5568;
}
.cm-link-btn {
  background: none;
  border: none;
  color: var(--brand, #009688);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.cm-link-btn:hover { text-decoration: underline; }
.cm-back-login { display: block; text-align: center; }

/* Login button (orange gradient like screenshot) */
.cm-btn-login {
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: filter .2s, transform .1s;
  margin-top: 4px;
}
.cm-btn-login:hover { filter: brightness(1.08); }
.cm-btn-login:active { transform: scale(.99); }
.cm-btn-login:disabled { opacity: .6; cursor: not-allowed; }

/* Divider */
.cm-login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: #94a3b8;
  font-size: 13px;
}
.cm-login-divider::before,
.cm-login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* Register / Tornar-se Associado button */
.cm-btn-register {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  border: 2px solid var(--brand, #009688);
  color: var(--brand, #009688);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s, color .2s;
  font-family: inherit;
}
.cm-btn-register:hover {
  background: var(--brand, #009688);
  color: #fff;
}

.cm-login-footer {
  color: #a0aec0;
  font-size: 12px;
  text-align: center;
  margin-top: 20px;
}

/* Auth message */
.cm-auth-msg {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 4px;
}
.cm-auth-msg.cm-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.cm-auth-msg.cm-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* ── Login responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .cm-login-root { flex-direction: column; }
  .cm-login-left { flex: none; min-height: 220px; }
  .cm-login-left-content { padding: 24px 24px 18px; }
  .cm-login-tagline { font-size: 24px; }
  .cm-login-back { padding: 12px 24px; }
  .cm-login-right { padding: 24px 20px; }
}

/* ══════════════════════════════════════════════════════════════════════
   CANVAS TOP NAV v2
   ══════════════════════════════════════════════════════════════════════ */
.cm-community-body { padding-top: 60px; }

.cm-top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  height: 60px;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.cm-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
}
.cm-nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}

/* Centre nav: Feed + Membros */
.cm-nav-center {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: center;
}

/* Logo */
.cm-nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.cm-nav-logo-img { height: 34px; width: auto; }
.cm-nav-logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--cm-brand, #009688);
  white-space: nowrap;
}

/* Nav links (desktop) */
.cm-nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
}
.cm-nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #4a5568;
  text-decoration: none;
  transition: background .15s, color .15s;
  position: relative;
  white-space: nowrap;
}
.cm-nav-link:hover { background: #f1f5f9; color: #1a202c; }
.cm-nav-link--active {
  color: var(--cm-brand, #009688);
  background: rgba(0,150,136,.08);
}
.cm-nav-link .fa { font-size: 13px; }
.cm-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

/* Search (inside cm-nav-left on desktop) */
.cm-nav-search {
  max-width: 280px;
  width: 200px;
  position: relative;
  display: flex;
  align-items: center;
}
.cm-nav-search .fa {
  position: absolute;
  left: 12px;
  color: #94a3b8;
  font-size: 13px;
  pointer-events: none;
}
.cm-nav-search input {
  width: 100%;
  padding: 7px 12px 7px 34px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  background: #f8fafc;
  outline: none;
  transition: border-color .2s;
}
.cm-nav-search input:focus {
  border-color: var(--cm-brand, #009688);
  background: #fff;
}

/* Right section */
.cm-nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Icon buttons */
.cm-nav-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  color: #4a5568;
  font-size: 16px;
  position: relative;
  transition: background .15s;
}
.cm-nav-icon-btn:hover { background: #f1f5f9; }
.cm-nav-icon-btn .cm-nav-badge {
  position: absolute;
  top: 2px;
  right: 2px;
}

/* Avatar button */
.cm-nav-avatar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px 4px 4px;
  border-radius: 24px;
  transition: background .15s;
}
.cm-nav-avatar-btn:hover { background: #f1f5f9; }
.cm-nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
}
.cm-nav-chevron { font-size: 10px; color: #94a3b8; }

/* Dropdown */
.cm-nav-user-menu { position: relative; }
.cm-nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 200px;
  padding: 6px;
  z-index: 1100;
}
.cm-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: #374151;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
  transition: background .1s;
}
.cm-dd-item:hover { background: #f8fafc; }
.cm-dd-sep { height: 1px; background: #f1f5f9; margin: 4px 0; }
.cm-dd-plan {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cm-dd-plan small { color: #94a3b8; font-size: 11.5px; }

/* ══ HAMBURGER ══════════════════════════════════════════════════════ */
.cm-hamburger-btn {
  width: 38px;
  height: 38px;
  display: none;             /* shown only on mobile */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: background .15s;
  flex-shrink: 0;
}
.cm-hamburger-btn:hover { background: #f1f5f9; }
.cm-hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: #4a5568;
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
.cm-hamburger-btn.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cm-hamburger-btn.is-open span:nth-child(2) { opacity: 0; }
.cm-hamburger-btn.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile overlay */
.cm-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1050;
  backdrop-filter: blur(2px);
}
.cm-mobile-overlay.is-open { display: block; }

/* Mobile drawer */
.cm-mobile-drawer {
  position: fixed;
  top: 0; left: 0;
  width: 280px;
  height: 100dvh;
  background: #fff;
  z-index: 1060;
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.cm-mobile-drawer.is-open { transform: translateX(0); }
.cm-mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
}
.cm-mobile-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #f1f5f9;
  cursor: pointer;
  font-size: 14px;
  color: #64748b;
}
.cm-mobile-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}
.cm-mobile-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.cm-mobile-nav { flex: 1; padding: 8px 0; }
.cm-mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  font-size: 15px;
  color: #374151;
  text-decoration: none;
  transition: background .1s;
  font-weight: 500;
}
.cm-mobile-nav-item:hover,
.cm-mobile-nav-item.active { background: #f1f5f9; color: var(--cm-brand, #009688); }
.cm-mobile-nav-item .fa { width: 18px; text-align: center; }
.cm-mobile-drawer-footer {
  border-top: 1px solid #f1f5f9;
  padding: 8px 0;
}

/* ══ NOTIFICATIONS POPUP ═════════════════════════════════════════════ */
.cm-notif-wrap { position: relative; }
.cm-notif-popup {
  position: absolute;
  top: calc(100% + 10px);
  right: -8px;
  width: 360px;
  max-height: 480px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.14);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cm-notif-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  font-weight: 600;
  color: #1a202c;
  flex-shrink: 0;
}
.cm-notif-popup-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
.cm-notif-popup-footer {
  padding: 10px 16px;
  border-top: 1px solid #f1f5f9;
  text-align: center;
  flex-shrink: 0;
}
.cm-btn-xs {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
}

/* ══ PLAN NEWS SIDEBAR ══════════════════════════════════════════════ */
.cm-news-card .cm-sidebar-title { margin-bottom: 12px; }
.cm-plan-news-list { display: flex; flex-direction: column; gap: 12px; }
.cm-news-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  padding: 8px;
  border-radius: 10px;
  transition: background .15s;
}
.cm-news-item:hover { background: #f8fafc; }
.cm-news-thumb {
  width: 60px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.cm-news-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cm-news-title {
  font-size: 13px;
  font-weight: 600;
  color: #1a202c;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cm-news-excerpt {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cm-news-meta { font-size: 11px; color: #94a3b8; }

/* ══ POPULAR / RECENT MEMBERS SIDEBAR ══════════════════════════════ */
.cm-member-row-meta {
  font-size: 11.5px;
  color: #94a3b8;
}

/* ══ PLAN NEWS PAGE ══════════════════════════════════════════════════ */
.cm-news-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}
.cm-news-layout { width: 100%; }
.cm-news-listing-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.cm-news-listing-header h1 { font-size: 24px; font-weight: 800; color: #1a202c; margin: 0; }
.cm-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.cm-news-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.cm-news-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.cm-news-card-img { aspect-ratio: 16/9; overflow: hidden; }
.cm-news-card-img img { width: 100%; height: 100%; object-fit: cover; }
.cm-news-card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.cm-news-card-body h3 { font-size: 15px; font-weight: 700; color: #1a202c; margin: 0; line-height: 1.35; }
.cm-news-card-body p { font-size: 13px; color: #64748b; margin: 0; line-height: 1.5; }
.cm-news-date { font-size: 12px; color: #94a3b8; }

/* Single article */
.cm-news-article {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  padding: 28px 32px 40px;
  max-width: 760px;
  margin: 0 auto;
}
.cm-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cm-brand,#009688);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 20px;
}
.cm-back-link:hover { text-decoration: underline; }
.cm-news-article-img { border-radius: 12px; overflow: hidden; margin-bottom: 24px; }
.cm-news-article-img img { width: 100%; max-height: 360px; object-fit: cover; }
.cm-news-article-header { margin-bottom: 24px; }
.cm-news-article-header h1 { font-size: 26px; font-weight: 800; color: #1a202c; margin: 8px 0; }
.cm-news-article-meta { font-size: 13px; color: #64748b; }
.cm-news-article-content { font-size: 15px; line-height: 1.75; color: #374151; }
.cm-news-article-content p { margin: 0 0 16px; }
.cm-news-article-content img { max-width: 100%; border-radius: 8px; }

/* ══ MEMBERS PAGE ═══════════════════════════════════════════════════ */
.cm-members-page {
  max-width: 1140px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}
.cm-members-layout { width: 100%; }
.cm-members-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.cm-members-header h1 {
  font-size: 28px;
  font-weight: 800;
  color: #1a202c;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cm-members-count-badge {
  font-size: 18px;
  font-weight: 600;
  color: var(--cm-text-3);
}

/* Member card area tag */
.cm-member-card-area {
  font-size: 12px;
  color: #64748b;
  display: inline-block;
}

/* Member cards grid */
.cm-members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.cm-member-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--cm-radius);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}
.cm-member-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.cm-member-card-header {
  width: 100%;
  display: flex;
  justify-content: center;
  text-decoration: none;
}
.cm-member-card-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #f1f5f9;
}
.cm-member-card-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: center;
}
.cm-member-card-name {
  font-size: 16px;
  font-weight: 700;
  color: #1a202c;
  text-decoration: none;
  transition: color var(--cm-transition);
}
.cm-member-card-name:hover {
  color: var(--cm-brand);
}
.cm-member-card-stats {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
}
.cm-stat {
  font-weight: 500;
}
.cm-stat-separator {
  color: #cbd5e1;
}
/*.cm-member-card-follow-btn {
  width: 100%;
  margin-top: 8px;
  justify-content: center;
  font-size: 13px;
  padding: 8px 12px;
}
  gap: 4px;
  text-align: center;
}*/
.cm-member-card-name {
  font-size: 14px;
  font-weight: 700;
  color: #1a202c;
  line-height: 1.3;
}
.cm-member-card-user { font-size: 12px; color: #94a3b8; }

/* ══ PAGINATION ══════════════════════════════════════════════════════ */
.cm-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
}
.cm-page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, border-color .15s;
}
.cm-page-btn:hover { background: #f1f5f9; }
.cm-page-btn.active {
  background: var(--cm-brand,#009688);
  border-color: var(--cm-brand,#009688);
  color: #fff;
}

/* ══ COMMON UTILITY ══════════════════════════════════════════════════ */
.cm-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--cm-brand,#009688);
  color: var(--cm-brand,#009688);
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, color .15s;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
.cm-btn-outline:hover { background: var(--cm-brand,#009688); color: #fff; }
.cm-btn-block { width: 100%; }

.cm-plan-badge-sm { font-size: 9px; padding: 2px 8px; }

.cm-empty-state {
  text-align: center;
  padding: 64px 24px;
  color: #94a3b8;
}
.cm-empty-state h3 { font-size: 18px; color: #64748b; margin: 16px 0 8px; }
.cm-empty-state p { font-size: 14px; }

/* ── Nav responsive ──────────────────────────────────────────────── */
/* Mensagens label: text hidden on smaller screens, only icon shown */
.cm-nav-link--icon-only .cm-nav-link-label { display: none; }
@media (min-width: 1024px) {
  .cm-nav-link--icon-only .cm-nav-link-label { display: inline; }
}

@media (max-width: 900px) {
  .cm-nav-center { display: none; }   /* Centre links collapse to mobile drawer */
  .cm-hamburger-btn { display: flex; }
  .cm-nav-search { max-width: 200px; width: 180px; }
}
@media (max-width: 640px) {
  .cm-nav-search { display: none; }   /* Search hidden; accessible via drawer */
  .cm-nav-link--messages { display: none; } /* Mensagens in mobile drawer only */
  .cm-notif-popup { width: 320px; right: -60px; }
}

/* ── Feed layout keeps working ──────────────────────────────────── */
.cm-feed-page { max-width: 1140px; margin: 0 auto; padding: 24px 16px 64px; }
@media (max-width: 768px) {
  .cm-feed-page { padding: 10px 6px 40px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   v1.3.0 ADDITIONS — Material de Apoio · Members Filter Redesign
                    · Profile Mobile Fixes · Responsive Polish
   ═══════════════════════════════════════════════════════════════════════════ */

/* ══ MATERIAL DE APOIO PAGE ══════════════════════════════════════════ */
.cm-materials-page {
  font-family: var(--cm-font);
  padding: 20px 16px 64px;
  max-width: 1100px;
  margin: 0 auto;
}
.cm-materials-layout { width: 100%; }

.cm-materials-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.cm-materials-header-left h1 {
  font-size: 24px;
  font-weight: 800;
  color: #1a202c;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cm-materials-subtitle {
  font-size: 13.5px;
  color: #64748b;
  margin: 0;
}
.cm-materials-plan-tag {
  align-self: center;
  white-space: nowrap;
}

/* Filter pills */
.cm-mat-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}
.cm-mat-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  text-decoration: none;
  transition: background .15s, color .15s;
  border: 1.5px solid transparent;
}
.cm-mat-pill:hover { background: #e2e8f0; color: #1e293b; }
.cm-mat-pill.active {
  background: var(--cm-brand, #009688);
  color: #fff;
  border-color: var(--cm-brand, #009688);
}

/* Materials grid */
.cm-mat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.cm-mat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.cm-mat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,.1);
}
.cm-mat-card-icon {
  background: color-mix(in srgb, var(--ft-color, #64748b) 12%, #fff);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.cm-mat-card-icon .fa-regular {
  font-size: 32px;
  color: var(--ft-color, #64748b);
}
.cm-mat-type-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--ft-color, #64748b);
}
/* Curso banner (16:9) */
.cm-mat-card-banner {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #f1f5f9;
  overflow: hidden;
  border-bottom: 1px solid #f1f5f9;
}
.cm-mat-card-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cm-mat-card-banner-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: #94a3b8;
}
.cm-mat-curso-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  background: var(--cm-brand, #009688);
  color: #fff;
}
.cm-mat-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cm-mat-cat-badge {
  background: #eef2ff;
  color: #4338ca;
}
.cm-mat-card-body {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cm-mat-plan-badge { align-self: flex-start; }
.cm-mat-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a202c;
  margin: 0;
  line-height: 1.4;
}
.cm-mat-desc {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  line-height: 1.55;
  flex: 1;
}
.cm-mat-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}
.cm-mat-meta .fa { font-size: 11px; }
.cm-mat-card-footer {
  padding: 12px 16px;
  border-top: 1px solid #f1f5f9;
}
.cm-mat-card-footer .cm-btn-primary {
  width: 100%;
  justify-content: center;
}

/* Download toast */
.cm-mat-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.cm-mat-toast--success { background: #10b981; color: #fff; }
.cm-mat-toast--error   { background: #ef4444; color: #fff; }
.cm-mat-toast--info    { background: #3b82f6; color: #fff; }

/* ══ MEMBERS FILTER REDESIGN ══════════════════════════════════════════ */
.cm-members-search-wrap {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.cm-members-filters { display: flex; flex-direction: column; gap: 14px; }

/* Search row */
.cm-mf-search-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.cm-filter-search {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.cm-filter-search-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  font-size: 14px;
  pointer-events: none;
  z-index: 1;
}
.cm-input-search {
  width: 100%;
  padding: 11px 40px 11px 40px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: #1a202c;
  outline: none;
  transition: border .15s, box-shadow .15s;
  background: #f8fafc;
}
.cm-input-search:focus {
  border-color: var(--cm-brand, #009688);
  background: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cm-brand, #009688) 15%, transparent);
}
.cm-search-clear {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 14px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cm-search-clear:hover { color: #475569; }
.cm-mf-search-btn {
  padding: 11px 20px;
  white-space: nowrap;
  border-radius: 10px;
  flex-shrink: 0;
}

/* Chips row */
.cm-mf-chips-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cm-mf-chip-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cm-mf-chip-label {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}
.cm-mf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cm-mf-chips-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cm-mf-chips-scroll::-webkit-scrollbar { display: none; }

.cm-mf-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  background: #f1f5f9;
  color: #475569;
  text-decoration: none;
  white-space: nowrap;
  transition: background .12s, color .12s;
  border: 1.5px solid transparent;
}
.cm-mf-chip:hover { background: #e2e8f0; color: #1e293b; }
.cm-mf-chip.active {
  background: var(--cm-brand, #009688);
  color: #fff;
  border-color: var(--cm-brand, #009688);
}

/* Active filter tags */
.cm-mf-active-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
}
.cm-mf-active-label {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}
.cm-mf-active-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
}
.cm-mf-tag-remove {
  color: #92400e;
  opacity: .6;
  text-decoration: none;
  display: flex;
  align-items: center;
}
.cm-mf-tag-remove:hover { opacity: 1; }
.cm-mf-clear-all { font-size: 12.5px; margin-left: auto; }

/* ══ PROFILE — MOBILE IMPROVEMENTS ═══════════════════════════════════ */

/* Plan badge: show in name row on desktop, hide on mobile (shown separately below) */
.cm-profile-plan-badge { display: inline-flex; }
.cm-profile-plan-mobile { display: none; }   /* shown only on mobile */

/* Profile tabs — horizontal scroll on any screen if needed */
.cm-profile-tabs-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 24px 0 0;
  border-bottom: 2px solid var(--cm-border, #e2e8f0);
}
.cm-profile-tabs-wrap::-webkit-scrollbar { display: none; }

/* Override previous margin/border on .cm-profile-tabs since wrapper now handles those */
.cm-profile-tabs {
  display: flex;
  gap: 0;
  border-bottom: none;
  margin: 0;
  min-width: max-content; /* prevents tabs from shrinking on mobile */
}

/* Text posts in profile grid — feed-card style */
.cm-grid-text-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 0;
  overflow: hidden;
}
.cm-grid-text-card {
  width: 100%;
  height: 100%;
  padding: 12px;
  font-size: 11.5px;
  color: #374151;
  line-height: 1.55;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  font-family: var(--cm-font);
}

/* Members header responsive count */
.cm-members-header h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
}

/* ══ RESPONSIVE ══════════════════════════════════════════════════════ */

/* -- Materials responsive -- */
@media (max-width: 768px) {
  .cm-materials-page { padding: 12px 12px 48px; }
  .cm-mat-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
  .cm-materials-header { flex-direction: column; }
  .cm-materials-plan-tag { align-self: flex-start; }
}
@media (max-width: 480px) {
  .cm-mat-grid { grid-template-columns: 1fr; }
  .cm-mat-card-icon { padding: 18px; }
}

/* -- Members filter responsive -- */
@media (max-width: 600px) {
  .cm-mf-search-btn .cm-btn-label { display: none; }
  .cm-mf-search-btn { padding: 11px 14px; }
  .cm-mf-chip-group { flex-wrap: nowrap; overflow-x: auto; }
  .cm-mf-area-group { flex-direction: column; align-items: flex-start; }
  .cm-members-search-wrap { padding: 14px; }
}

/* -- Profile responsive -- */
@media (max-width: 768px) {
  /* Hide inline plan badge; show mobile one (below username) */
  .cm-profile-plan-badge { display: none; }
  .cm-profile-plan-mobile {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
  }
  /* Profile header stacks cleanly */
  .cm-profile-header {
    flex-direction: column;
    align-items: flex-start;
    margin-top: -40px;
  }
  .cm-profile-avatar { width: 80px; height: 80px; }
  .cm-profile-name { font-size: 20px; }
  .cm-profile-name-row { flex-wrap: nowrap; }   /* name + suspended badge only */
  .cm-profile-actions {
    margin-left: 0;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  /* Tabs: scroll enabled via .cm-profile-tabs-wrap above */
  .cm-ptab { padding: 12px 18px; white-space: nowrap; }
  /* Profile posts grid: 2 cols on tablet */
  .cm-profile-grid { grid-template-columns: repeat(2, 1fr); }
  /* Settings form: single col */
  .cm-form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  /* Profile posts grid: 2 cols still fine on phone, 3 is too small */
  .cm-profile-grid { grid-template-columns: repeat(2, 1fr); gap: 3px; }
  .cm-profile-cover { height: 140px; }
  .cm-profile-main { padding: 0 12px 32px; }
  .cm-settings-form-wrap { padding: 16px; }
}

/* ── Specificity patch: new search input overrides old `.cm-filter-search input` rule ── */
.cm-filter-search .cm-input-search {
  padding: 11px 40px 11px 40px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  background: #f8fafc;
}
.cm-filter-search .cm-input-search:focus {
  border-color: var(--cm-brand, #009688);
  background: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cm-brand, #009688) 15%, transparent);
}
/* Old .cm-filter-select hidden – new chips replace it */
.cm-members-search-wrap .cm-filter-select { display: none; }

/* ── Sidebar: Material de Apoio items ───────────────────────────────── */
.cm-mat-sidebar-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none;
  color: inherit;
}
.cm-mat-sidebar-item:last-child { border-bottom: none; }
.cm-mat-sidebar-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}
.cm-mat-sidebar-banner {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}
.cm-mat-sidebar-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}



/* ═══════════════════════════════════════════════════════════════════════════
   PATCHES — adicionar no fim do community.css
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. REMOVE a regra que escondia os selects de filtro ────────────────────
   A regra original era:
       .cm-members-search-wrap .cm-filter-select { display: none; }
   Substitua-a pela regra abaixo (ou apague a original).
   ─────────────────────────────────────────────────────────────────────────── */

/* ── 2. Barra de filtros dos membros ────────────────────────────────────── */
.cm-members-filters-bar{
    display:flex !important;
    flex-direction:row !important;
    align-items:center !important;
    gap:10px !important;
}

.cm-members-filters-bar > *{
    width:auto !important;
}

/* Campo de pesquisa */
.cm-members-filters-bar .cm-filter-search {
    position:   relative;
    flex:        1;
    min-width:  180px;
    display:    flex;
    align-items: center;
}
.cm-members-filters-bar .cm-filter-search-icon {
    position:       absolute;
    left:           12px;
    color:          #94a3b8;
    font-size:      13px;
    pointer-events: none;
}
.cm-members-filters-bar .cm-input-search {
    width:          100%;
    padding:        10px 36px 10px 36px;
    border:         1.5px solid #e2e8f0;
    border-radius:  10px;
    font-size:      14px;
    font-family:    inherit;
    background:     #f8fafc;
    color:          #1a202c;
    outline:        none;
    transition:     border .15s, box-shadow .15s;
}
.cm-members-filters-bar .cm-input-search:focus {
    border-color: var(--cm-brand);
    background:   #fff;
    box-shadow:   0 0 0 3px color-mix(in srgb, var(--cm-brand) 12%, transparent);
}
.cm-members-filters-bar .cm-search-clear {
    position:   absolute;
    right:      10px;
    background: none;
    border:     none;
    cursor:     pointer;
    color:      #94a3b8;
    font-size:  13px;
    padding:    4px;
}
.cm-members-filters-bar .cm-search-clear:hover { color: #475569; }

/* Selects de área e plano — VISÍVEIS */
.cm-filter-dropdown {
    padding:       10px 14px;
    border:        1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size:     13.5px;
    font-family:   inherit;
    background:    #f8fafc;
    color:         #374151;
    cursor:        pointer;
    outline:       none;
    min-width:     150px;
    transition:    border .15s;
    /* NUNCA display:none */
    display:       block;
}
.cm-filter-dropdown:focus { border-color: var(--cm-brand); background: #fff; }

/* Botões de pesquisa e limpar */
.cm-filter-btn {
    padding:    10px 16px;
    flex-shrink: 0;
}

/* Garantir que selects antigos com .cm-filter-select NÃO ficam escondidos */
.cm-members-search-wrap .cm-filter-select {
    display: block !important;
    padding:       10px 14px;
    border:        1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size:     13.5px;
    font-family:   inherit;
    background:    #f8fafc;
    color:         #374151;
    cursor:        pointer;
    outline:       none;
    min-width:     150px;
}

/* ── 3. Stats do perfil em linha ─────────────────────────────────────────── */
.cm-profile-stats-row {
    display:     flex;
    flex-direction: row;    /* ← linha, não coluna */
    align-items: center;
    gap:         24px;
    margin-top:  8px;
}

.cm-profile-stats-row .cm-profile-stat {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    text-align:     center;
    min-width:      56px;
}

.cm-profile-stats-row .cm-stat-num {
    display:     block;
    font-size:   20px;
    font-weight: 800;
    color:       var(--cm-brand);
    line-height: 1.1;
}

.cm-profile-stats-row .cm-stat-lbl {
    font-size:  11px;
    color:      #94a3b8;
    margin-top: 2px;
    white-space: nowrap;
}

/* Separadores visuais entre os stats */
.cm-profile-stats-row .cm-profile-stat + .cm-profile-stat {
    border-left: 1px solid #e2e8f0;
    padding-left: 24px;
}

/* Mobile: stats ficam mais compactos */
@media (max-width: 768px) {
    .cm-profile-stats-row {
        gap:      16px;
        width:    100%;
        justify-content: flex-start;
    }
    .cm-profile-stats-row .cm-profile-stat + .cm-profile-stat {
        padding-left: 16px;
    }
    .cm-members-filters-bar {
        gap: 8px;
    }
    .cm-filter-dropdown {
        min-width: 120px;
        font-size: 13px;
    }
    /* The base rule forces flex-direction:row !important at every screen
       size (search box + 2 selects side by side), which overflows on
       phones. Stack everything vertically on small screens instead. */
    .cm-members-filters-bar {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .cm-members-filters-bar > * {
        width: 100% !important;
    }
    .cm-filter-dropdown {
        min-width: 0;
    }
}
/* ══════════════════════════════════════════════════════════════════════════
   FOLLOW / UNFOLLOW BUTTONS (Consolidated v1.7.0)
   ══════════════════════════════════════════════════════════════════════════ */

.cm-follow-btn,
.cm-unfollow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 140px;
    padding: 10px 18px;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cm-follow-btn {
    background-color: var(--cm-accent, #17A2B8);
    color: #fff;
}

.cm-follow-btn:hover:not(.cm-follow-loading) {
    background-color: var(--cm-accent-dark, #138496);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.cm-follow-btn:active:not(.cm-follow-loading) {
    transform: translateY(0);
}

.cm-unfollow-btn {
    background-color: transparent;
    color: var(--cm-accent, #17A2B8);
    border-color: var(--cm-accent, #17A2B8);
}

.cm-unfollow-btn:hover:not(.cm-follow-loading) {
    background-color: rgba(23, 162, 184, 0.08);
    border-color: var(--cm-accent-dark, #138496);
    color: var(--cm-accent-dark, #138496);
}

.cm-follow-btn.cm-follow-loading,
.cm-unfollow-btn.cm-follow-loading {
    opacity: 0.6;
    pointer-events: none;
}

.cm-follow-btn i,
.cm-unfollow-btn i {
    font-size: 16px;
}

/* Mobile responsivo */
@media (max-width: 768px) {
    .cm-follow-btn,
    .cm-unfollow-btn {
        min-width: auto;
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .cm-follow-btn i,
    .cm-unfollow-btn i {
        font-size: 14px;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   SOCIAL NETWORKS GRID (New in v1.7.0)
   ══════════════════════════════════════════════════════════════════════════ */

.cm-socials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.cm-social-input {
    display: flex;
    flex-direction: column;
}

.cm-social-input label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.cm-social-input label i {
    width: 18px;
    text-align: center;
    color: var(--cm-accent, #17A2B8);
}

.cm-social-input input {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    transition: border-color 0.2s;
}

.cm-social-input input:focus {
    border-color: var(--cm-accent, #17A2B8);
    outline: none;
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.1);
}

.cm-social-input input:invalid {
    border-color: #ff6b6b;
}

/* ══════════════════════════════════════════════════════════════════════════
   COMPANY SECTION (New in v1.7.0)
   ══════════════════════════════════════════════════════════════════════════ */

.cm-company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.cm-form-group {
    display: flex;
    flex-direction: column;
}

.cm-form-group.cm-form-full {
    grid-column: 1 / -1;
}

.cm-form-group label {
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.cm-form-group input,
.cm-form-group select,
.cm-form-group textarea {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s;
    width: 100%;
    background: #fff;
    box-sizing: border-box;
}

.cm-form-group input:focus,
.cm-form-group select:focus,
.cm-form-group textarea:focus {
    border-color: var(--cm-accent, #17A2B8);
    outline: none;
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.1);
}

.cm-form-group small {
    margin-top: 4px;
    font-size: 12px;
    color: #999;
}

.cm-input-error {
    border-color: #ff6b6b !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   GALLERY LIGHTBOX — 2 colunas no desktop (imagem | informações), estilo
   Facebook. Em ecrãs pequenos as colunas empilham (imagem em cima).
   ══════════════════════════════════════════════════════════════════════════ */
#cm-gallery-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

#cm-gallery-lightbox {
    position: relative;
    width: 100%;
    max-width: 1080px;
    height: 90vh;
    max-height: 800px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: row;
}

.cm-lightbox-close {
    position: absolute;
    top: 16px; right: 16px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: #fff;
    width: 40px; height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.cm-lightbox-close:hover { background: rgba(0, 0, 0, 0.95); }

/* Coluna esquerda — media */
#cm-lightbox-media {
    flex: 1 1 65%;
    min-width: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.cm-lightbox-img,
.cm-lightbox-video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}
.cm-lightbox-media-loading { color: #fff; font-size: 28px; }
.cm-lightbox-audio {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 40px; box-sizing: border-box;
}
.cm-lightbox-audio i { color: #fff; font-size: 56px; margin-bottom: 20px; }
.cm-lightbox-audio audio { width: 90%; max-width: 360px; }
.cm-lightbox-error { padding: 40px; text-align: center; color: #ef4444; }
.cm-lightbox-error i { font-size: 40px; margin-bottom: 12px; display: block; }

/* Link externo / YouTube dentro do lightbox */
.cm-lightbox-yt-embed {
    width: 100%; height: 100%;
    position: relative;
    background: #000;
}
.cm-lightbox-yt-embed iframe {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}
.cm-lightbox-link-card {
    display: flex; flex-direction: column;
    width: 100%; height: 100%;
    background: #0f172a;
    text-decoration: none;
    overflow: hidden;
}
.cm-lightbox-link-card .cm-link-card-img { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.cm-lightbox-link-card .cm-link-card-img img { width: 100%; height: 100%; object-fit: cover; }
.cm-lightbox-link-card .cm-link-card-info { padding: 16px 20px; background: rgba(0,0,0,.4); }
.cm-lightbox-link-card .cm-link-card-domain { color: #94a3b8; font-size: 12px; margin-bottom: 6px; }
.cm-lightbox-link-card .cm-link-card-title { color: #fff; font-size: 15px; font-weight: 600; }

/* Carousel (múltiplas imagens) */
.cm-lightbox-carousel-wrap { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.cm-lightbox-carousel { display: flex; width: 100%; height: 100%; }
.cm-carousel-slide { min-width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.cm-carousel-slide img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cm-lightbox-prev, .cm-lightbox-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6); border: none; color: #fff;
    width: 40px; height: 40px; border-radius: 50%;
    font-size: 16px; cursor: pointer; z-index: 2;
}
.cm-lightbox-prev { left: 12px; }
.cm-lightbox-next { right: 12px; }
.cm-carousel-counter-wrap {
    position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7); color: #fff;
    padding: 6px 14px; border-radius: 20px; font-size: 12px; z-index: 2;
}

/* Coluna direita — informações (autor, texto, stats) */
#cm-lightbox-info {
    flex: 0 0 360px;
    max-width: 360px;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.cm-lightbox-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    flex: 0 0 auto;
}
.cm-lightbox-info-header img {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.cm-lightbox-author-meta { display: flex; flex-direction: column; min-width: 0; }
#cm-lightbox-author-name {
    color: #1a202c;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}
#cm-lightbox-author-name:hover { color: var(--cm-brand, #009688); }
#cm-lightbox-author-time { color: #94a3b8; font-size: 12px; }
.cm-lightbox-info-body {
    flex: 0 0 auto;
    padding: 16px 16px 4px;
}
#cm-lightbox-content {
    color: #1a202c;
    line-height: 1.5;
    font-size: 14px;
    word-break: break-word;
    margin: 0;
}
#cm-lightbox-content.cm-lb-clamped {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    overflow: hidden;
}
#cm-lightbox-content-toggle {
    display: none;
    background: none;
    border: none;
    padding: 6px 0 8px;
    margin: 0;
    color: var(--cm-brand, #009688);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
#cm-lightbox-content-toggle:hover { text-decoration: underline; }
.cm-lightbox-actions-bar {
    flex: 0 0 auto;
    padding: 10px 16px;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}
#cm-lightbox-comments-wrap {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}
#cm-lightbox-comments-wrap .cm-comments-section {
    border-top: none;
    padding: 0 16px 12px;
}
#cm-lightbox-comments-wrap .cm-comment-add {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-top: 8px;
}

/* Mobile: empilhar em vez de colunas lado a lado */
@media (max-width: 768px) {
    #cm-gallery-backdrop { padding: 0; }
    #cm-gallery-lightbox {
        flex-direction: column;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    #cm-lightbox-media { flex: 1 1 60%; }
    #cm-lightbox-info {
        flex: 1 1 40%;
        max-width: 100%;
        border-left: none;
        border-top: 1px solid #e2e8f0;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   PROFILE — Aba "Sobre" (visível para todos os visitantes do perfil)
   ══════════════════════════════════════════════════════════════════════════ */
.cm-about-wrap {
    max-width: 640px;
    padding: 8px 0 32px;
}
.cm-about-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 16px;
}
.cm-about-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 12px;
}
.cm-about-section h3 i { color: var(--cm-brand, #009688); }
.cm-about-section p {
    color: #475569;
    line-height: 1.6;
    font-size: 14px;
    margin: 0 0 8px;
}
.cm-about-section p:last-child { margin-bottom: 0; }
.cm-about-company-name {
    font-weight: 700;
    color: #1a202c !important;
    font-size: 15px;
}
.cm-about-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cm-about-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}
.cm-about-list li i {
    color: var(--cm-brand, #009688);
    width: 16px;
    margin-top: 2px;
    flex-shrink: 0;
    text-align: center;
}
.cm-about-list li strong { color: #1a202c; font-weight: 600; }
.cm-about-list li a { color: var(--cm-brand, #009688); word-break: break-word; }
.cm-about-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.cm-about-social-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #334155;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.cm-about-social-link:hover { background: var(--cm-brand, #009688); color: #fff; }
.cm-about-empty {
    text-align: center;
    padding: 48px 20px;
    color: #94a3b8;
}
.cm-about-empty i { font-size: 32px; margin-bottom: 12px; display: block; }

@media (max-width: 768px) {
    .cm-about-wrap { padding: 8px 4px 32px; }
    .cm-about-section { padding: 14px 16px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   FLOATING CHAT WIDGET (bottom-right popup)
   ═══════════════════════════════════════════════════════════════════════════ */
#cm-chat-widget {
  position: fixed; right: 20px; bottom: 20px; z-index: 9000;
  font-family: var(--cm-font);
}
.cm-chat-widget-toggle {
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: var(--cm-brand); color: #fff; font-size: 22px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  position: relative; margin-left: auto;
  transition: transform var(--cm-transition), background var(--cm-transition);
}
.cm-chat-widget-toggle:hover { background: var(--cm-brand-dark, var(--cm-brand)); transform: scale(1.05); }
.cm-chat-widget-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--cm-danger); color: #fff; border-radius: 10px;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.cm-chat-widget-panel {
  position: absolute; right: 0; bottom: 72px;
  width: 320px; max-width: calc(100vw - 40px);
  height: 0; opacity: 0; pointer-events: none;
  background: #fff; border-radius: var(--cm-radius); box-shadow: var(--cm-shadow-md);
  overflow: hidden; display: flex; flex-direction: column;
  transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease, height .18s ease;
}
.cm-chat-widget-panel.cm-open {
  height: 420px; max-height: calc(100vh - 120px);
  opacity: 1; pointer-events: auto; transform: translateY(0);
}
.cm-chat-widget-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--cm-border);
  background: var(--cm-brand); color: #fff; flex-shrink: 0;
}
.cm-chat-widget-title { font-weight: 700; font-size: 14px; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-chat-widget-header-actions { display: flex; align-items: center; gap: 4px; }
.cm-chat-widget-icon-btn {
  background: none; border: none; color: #fff; opacity: .9; cursor: pointer;
  width: 26px; height: 26px; border-radius: 50%; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; transition: background var(--cm-transition);
}
.cm-chat-widget-icon-btn:hover { opacity: 1; background: rgba(255,255,255,.15); }
.cm-chat-widget-list { flex: 1; overflow-y: auto; min-height: 0; }
.cm-chat-widget-empty { padding: 30px 16px; text-align: center; font-size: 13px; color: var(--cm-text-3); }
.cm-chat-widget-thread { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cm-chat-widget-messages {
  flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px;
}
.cm-chat-widget-msg {
  max-width: 80%; padding: 8px 12px; border-radius: 14px; font-size: 13px; line-height: 1.4;
  background: var(--cm-bg); color: var(--cm-text); align-self: flex-start; word-break: break-word;
}
.cm-chat-widget-msg.own {
  background: var(--cm-brand); color: #fff; align-self: flex-end;
}
.cm-chat-widget-input-row {
  display: flex; align-items: center; gap: 8px; padding: 10px; border-top: 1px solid var(--cm-border); flex-shrink: 0;
}
.cm-chat-widget-input-row input {
  flex: 1; min-width: 0; border: 1px solid var(--cm-border); border-radius: 20px;
  padding: 8px 14px; font-size: 13px; font-family: var(--cm-font); outline: none;
}
.cm-chat-widget-input-row input:focus { border-color: var(--cm-brand); }
.cm-chat-widget-send-btn {
  width: 34px; height: 34px; border-radius: 50%; border: none; flex-shrink: 0;
  background: var(--cm-brand); color: #fff; cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.cm-chat-widget-send-btn:hover { background: var(--cm-brand-dark, var(--cm-brand)); }
/* Conversation items reused from the full messages page render fine at this
   narrower width; just trim the padding a little for the popup context. */
#cm-chat-widget-list .cm-conv-item { padding: 10px 14px; }

@media (max-width: 480px) {
  #cm-chat-widget { right: 12px; bottom: 12px; }
  .cm-chat-widget-panel { width: calc(100vw - 24px); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   GRUPOS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Modal (overlay + box), namespaced to avoid clashing with the legacy .cm-modal */
.cm-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 10000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.cm-modal-box {
  background: #fff; border-radius: var(--cm-radius); box-shadow: var(--cm-shadow-lg);
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
}
.cm-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--cm-border); }
.cm-modal-header h3 { font-size: 18px; font-weight: 800; margin: 0; }
.cm-modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--cm-text-3); line-height: 1; }
.cm-modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.cm-modal-body textarea, .cm-modal-body select,
.cm-modal-body input[type="text"], .cm-modal-body input[type="email"],
.cm-modal-body input[type="url"], .cm-modal-body input[type="number"],
.cm-modal-body input[type="date"], .cm-modal-body input[type="datetime-local"] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--cm-border); border-radius: var(--cm-radius-sm); font-family: inherit; font-size: 14px;
}
.cm-modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--cm-border); }

/* Groups directory */
.cm-groups-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin-top: 20px; }
.cm-group-card { background: #fff; border: 1px solid var(--cm-border); border-radius: var(--cm-radius); overflow: hidden; display: flex; flex-direction: column; }
.cm-group-card-cover {
  display: block; height: 120px; background-size: cover; background-position: center; position: relative;
}
.cm-group-visibility-badge {
  position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.6); color: #fff;
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.cm-group-card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.cm-group-card-name { font-size: 16px; font-weight: 800; color: var(--cm-text); text-decoration: none; }
.cm-group-card-name:hover { color: var(--cm-brand); }
.cm-group-card-desc { font-size: 13px; color: var(--cm-text-2); line-height: 1.5; flex: 1; }
.cm-group-card-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--cm-text-3); align-items: center; }
.cm-plan-badge-sm { background: var(--cm-bg); border: 1px solid var(--cm-border); border-radius: 999px; padding: 2px 10px; font-size: 11px; font-weight: 700; color: var(--cm-text-2); }
.cm-group-card-btn { width: 100%; justify-content: center; margin-top: 4px; }
.cm-group-invites-banner {
  background: #eef2ff; border: 1px solid rgba(79,70,229,.2); border-radius: var(--cm-radius-sm);
  padding: 12px 16px; margin-bottom: 16px; font-size: 14px; display: flex; flex-direction: column; gap: 6px;
}

/* Single group page */
.cm-group-single-layout { max-width: 900px; margin: 0 auto; }
.cm-group-hero {
  height: 220px; background-size: cover; background-position: center; border-radius: var(--cm-radius);
  position: relative; overflow: hidden; margin-bottom: 20px;
}
.cm-group-hero-overlay {
  position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.65));
  display: flex; flex-direction: column; justify-content: flex-end; padding: 24px; color: #fff;
}
.cm-group-back-link { color: #fff; text-decoration: none; font-size: 13px; opacity: .85; margin-bottom: 8px; display: inline-block; }
.cm-group-hero-overlay h1 { font-size: 28px; font-weight: 800; margin: 0 0 8px; color: #fff; }
.cm-group-hero-meta { display: flex; gap: 16px; font-size: 13px; opacity: .9; }
.cm-group-locked { text-align: center; padding: 60px 20px; color: var(--cm-text-2); }
.cm-group-not-eligible { color: var(--cm-warning); font-size: 13px; }
.cm-group-body { background: #fff; border: 1px solid var(--cm-border); border-radius: var(--cm-radius); padding: 24px; }
.cm-group-description { color: var(--cm-text-2); line-height: 1.6; margin-bottom: 16px; }
.cm-group-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }

/* Discussions layout */
.cm-group-discussions-layout { display: grid; grid-template-columns: 200px 1fr; gap: 24px; margin-top: 16px; }
.cm-group-topics-sidebar { display: flex; flex-direction: column; gap: 4px; }
.cm-group-topics-sidebar h4 { font-size: 13px; text-transform: uppercase; color: var(--cm-text-3); margin-bottom: 8px; }
.cm-group-topic-link { padding: 8px 10px; border-radius: var(--cm-radius-sm); color: var(--cm-text-2); text-decoration: none; font-size: 14px; }
.cm-group-topic-link.active, .cm-group-topic-link:hover { background: var(--cm-bg); color: var(--cm-brand); font-weight: 600; }
.cm-group-topic-link span { color: var(--cm-text-3); font-size: 12px; }
.cm-group-discussions-main { display: flex; flex-direction: column; gap: 10px; }
.cm-group-empty-note { color: var(--cm-text-3); text-align: center; padding: 30px 0; }
.cm-group-discussion-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--cm-border); border-radius: var(--cm-radius-sm);
  text-decoration: none; color: var(--cm-text);
}
.cm-group-discussion-row:hover { border-color: var(--cm-brand); background: var(--cm-bg); }
.cm-group-discussion-row-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cm-group-discussion-row-meta { font-size: 12px; color: var(--cm-text-3); }
.cm-group-discussion-row-stats { font-size: 13px; color: var(--cm-text-3); white-space: nowrap; }

/* Discussion thread */
.cm-group-discussion-thread h2 { font-size: 22px; font-weight: 800; margin: 12px 0 4px; }
.cm-group-discussion-author { font-size: 13px; color: var(--cm-text-3); margin-bottom: 16px; }
.cm-group-discussion-content { line-height: 1.7; margin-bottom: 16px; }
.cm-group-discussion-mod-actions { display: flex; gap: 8px; margin-bottom: 20px; }
.cm-group-replies-heading { font-size: 15px; font-weight: 700; margin: 20px 0 12px; }
.cm-group-replies-list { display: flex; flex-direction: column; gap: 14px; }
.cm-group-reply { display: flex; gap: 10px; }
.cm-group-reply-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.cm-group-reply-author { font-size: 13px; font-weight: 700; }
.cm-group-reply-author span { font-weight: 400; color: var(--cm-text-3); margin-left: 6px; }
.cm-group-reply-content { font-size: 14px; line-height: 1.6; color: var(--cm-text-2); }
.cm-group-reply-form { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.cm-group-reply-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--cm-border); border-radius: var(--cm-radius-sm); font-family: inherit; }
.cm-group-locked-note { color: var(--cm-text-3); font-size: 13px; margin-top: 16px; }

/* Members list */
.cm-group-members-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.cm-group-member-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--cm-border); border-radius: var(--cm-radius-sm); }
.cm-group-member-row span:first-of-type { font-weight: 600; flex: 1; }
.cm-group-member-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.cm-group-role-select { padding: 4px 8px; border: 1px solid var(--cm-border); border-radius: 6px; font-size: 12px; }

@media (max-width: 768px) {
  .cm-group-discussions-layout { grid-template-columns: 1fr; }
  .cm-group-hero { height: 160px; }
  .cm-group-hero-overlay h1 { font-size: 22px; }
}

/* Group cover pickers */
.cm-group-cover-picker { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.cm-group-cover-preview {
  width: 100%; height: 120px; border-radius: var(--cm-radius-sm); background-size: cover; background-position: center;
  border: 1px solid var(--cm-border);
}
.cm-group-cover-fallback {
  background-image: linear-gradient(135deg, var(--cm-brand), var(--cm-brand-light, #6366f1)) !important;
}
.cm-group-hero { position: relative; }
.cm-group-change-cover-btn {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: rgba(0,0,0,.55); color: #fff; border-color: transparent;
}
.cm-group-change-cover-btn:hover { background: rgba(0,0,0,.75); color: #fff; border-color: transparent; }

/* ═══════════════════════════════════════════════════════════════════════════
   EVENTOS
   ═══════════════════════════════════════════════════════════════════════════ */

.cm-events-month-heading { font-size: 15px; text-transform: uppercase; color: var(--cm-text-3); margin: 24px 0 10px; }
.cm-events-list { display: flex; flex-direction: column; gap: 10px; }
.cm-event-row {
  display: flex; align-items: center; gap: 16px; padding: 14px 16px;
  border: 1px solid var(--cm-border); border-radius: var(--cm-radius-sm);
  text-decoration: none; color: var(--cm-text); background: #fff;
}
.cm-event-row:hover { border-color: var(--cm-brand); }
.cm-event-row-date { display: flex; flex-direction: column; align-items: center; width: 48px; flex-shrink: 0; }
.cm-event-row-day { font-size: 20px; font-weight: 800; line-height: 1; color: var(--cm-brand); }
.cm-event-row-dow { font-size: 11px; text-transform: uppercase; color: var(--cm-text-3); }
.cm-event-row-main { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.cm-event-row-meta { font-size: 13px; color: var(--cm-text-2); }
.cm-event-rsvp-badge-going { background: #dcfce7; color: #15803d; border-color: transparent; }

/* Calendar */
.cm-calendar-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 16px 0; font-size: 16px; }
.cm-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cm-calendar-dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--cm-text-3); padding-bottom: 6px; }
.cm-calendar-cell {
  min-height: 80px; border: 1px solid var(--cm-border); border-radius: 8px; padding: 6px;
  display: flex; flex-direction: column; gap: 3px; background: #fff;
}
.cm-calendar-cell--empty { background: transparent; border: none; }
.cm-calendar-cell-num { font-size: 12px; color: var(--cm-text-3); font-weight: 600; }
.cm-calendar-event-chip {
  font-size: 11px; background: var(--cm-brand); color: #fff; border-radius: 4px; padding: 2px 5px;
  text-decoration: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

/* Single event */
.cm-event-details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin: 20px 0; }
.cm-event-details-grid strong { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--cm-text-3); margin-bottom: 6px; }
.cm-event-details-grid p { font-size: 14px; color: var(--cm-text); margin: 0; }
.cm-event-rsvp-block { padding: 16px; background: var(--cm-bg); border-radius: var(--cm-radius-sm); margin-bottom: 20px; }
.cm-event-rsvp-label { font-size: 13px; font-weight: 700; display: block; margin-bottom: 10px; }
.cm-event-rsvp-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.cm-event-attendees { display: flex; gap: -4px; flex-wrap: wrap; }
.cm-event-attendees img { margin-right: -8px; border: 2px solid #fff; }

@media (max-width: 768px) {
  .cm-calendar-grid { grid-template-columns: repeat(7, minmax(32px, 1fr)); gap: 3px; }
  .cm-calendar-cell { min-height: 56px; padding: 3px; font-size: 10px; }
  .cm-calendar-event-chip { display: none; } /* too tight on mobile - tap the day instead in a future pass */
}

/* ═══════════════════════════════════════════════════════════════════════════
   CURSOS: VÍDEOS, WEBINARS, PREMIUM, CERTIFICADOS
   ═══════════════════════════════════════════════════════════════════════════ */

.cm-mat-video-embed iframe, .cm-mat-video-embed video {
  width: 100%; height: 100%; display: block; border: none; background: #000;
}
.cm-mat-premium-tag {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: #1e293b; color: #fbbf24; font-size: 11px; font-weight: 800;
  padding: 4px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px;
}
.cm-mat-card { position: relative; }
.cm-mat-webinar-pending { font-size: 13px; color: var(--cm-text-3); display: inline-flex; align-items: center; gap: 6px; }

.cm-my-certificates { margin: 20px 0; padding: 16px; background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--cm-radius-sm); }
.cm-my-certificates h3 { font-size: 15px; font-weight: 700; margin: 0 0 10px; color: #92400e; }
.cm-my-certificates-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cm-my-certificate-chip {
  display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #fde68a;
  color: #92400e; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; text-decoration: none;
}
.cm-my-certificate-chip:hover { background: #fef3c7; }

/* ═══════════════════════════════════════════════════════════════════════════
   PERFIL: DOCUMENTOS / ANEXOS (Secção 6)
   ═══════════════════════════════════════════════════════════════════════════ */
.cm-field-hint { font-size: 13px; color: var(--cm-text-3); margin: 4px 0 16px; }
.cm-documents-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.cm-document-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border: 1px solid var(--cm-border); border-radius: var(--cm-radius-sm); background: #fff;
}
.cm-document-row i.fa-file-lines { color: var(--cm-brand); font-size: 18px; }
.cm-document-row-main { flex: 1; display: flex; flex-direction: column; }
.cm-document-row-main strong { font-size: 12px; text-transform: uppercase; color: var(--cm-text-3); }
.cm-document-row-main a { font-size: 14px; color: var(--cm-text); text-decoration: none; }
.cm-document-row-main a:hover { color: var(--cm-brand); text-decoration: underline; }
.cm-document-remove-btn { background: none; border: none; color: var(--cm-text-3); cursor: pointer; padding: 6px; }
.cm-document-remove-btn:hover { color: #ef4444; }
.cm-document-uploader { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.cm-document-uploader .cm-field-group { flex: 1; min-width: 200px; margin-bottom: 0; }
