/* inicio-v3.css
 * Tela inicial (/index.html) no visual V3
 * (08-11-2026): mesmos tokens, fontes (Poppins nos titulos, Nunito no texto),
 * cartoes, botoes em pilula com icone de 18px e abas do Prontuario V3
 * (/css/prontuario-v3.css, /css/usuarios-v3.css, /css/chat-v3.css).
 *
 * Inicio: tudo sob html.pr-v3 body.inicio-v3 (08-11-2026, decisao "Duas
 * versoes"): so vale para quem escolheu a Experiencia nova (ou ?exp=v3);
 * protocolo-v3-modo.js marca html.pr-v3. Sem a classe (Experiencia antiga,
 * ?exp=antiga) a tela inicial fica exatamente como era. So visual: mesmos elementos, ids,
 * data-componente e handlers do cabecalho, do menu lateral, da agenda, dos
 * aniversariantes e da Central de mensagens (comunicados.js) e da janela
 * Comunicados as familias (conecta-comunicados.js, .cc-modal).
 * Carregar DEPOIS de css.css, agenda.css, style.css e do <style> da propria
 * pagina. Nao altera CSS global (outras telas dependem dele).
 *
 * Meu Perfil V3 (/profile-v3.html): o bloco proprio dele foi para
 * /css/perfil-v3.css (a pagina V3 e separada da antiga /profile.html).
 *
 * Com o "modo V3" ligado (protocolo-v3-modo.css, html.pr-v3[data-pr-v3-pagina="home"])
 * as regras de la usam os mesmos valores; aqui ficam o resto da tela e o celular.
 */

html.pr-v3 body.inicio-v3 {
  --pr-navy: #1E2A78;
  --pr-blue: #2B4FC7;
  --pr-blue-soft: #E6ECFF;
  --pr-orange: #F28C28;
  --pr-ink: #141A3A;
  --pr-ink-2: #3D4566;
  --pr-muted: #5A6385;
  --pr-bg: #F4F6FB;
  --pr-surface: #FFFFFF;
  --pr-surface-2: #F7F9FD;
  --pr-border: #E3E8F3;
  --pr-border-soft: #EEF1F8;
  --pr-border-strong: #C9D2EA;
  --pr-ok-bg: #E8F7EE;   --pr-ok-fg: #1D6B3D;
  --pr-warn-bg: #FFF4E6; --pr-warn-fg: #8A4B0B;
  --pr-danger: #D9480F;
  --pr-radius: 16px;
  --pr-font-display: 'Poppins', system-ui, sans-serif;
  --pr-font-body: 'Nunito', system-ui, sans-serif;

  background: var(--pr-bg);
  font-family: var(--pr-font-body);
  color: var(--pr-ink);
  /* clip (e nao hidden): hidden cria contexto de rolagem e anula sticky */
  overflow-x: clip;
}
html.pr-v3 body.inicio-v3 h1, html.pr-v3 body.inicio-v3 h2, html.pr-v3 body.inicio-v3 h3 { font-family: var(--pr-font-display); }
html.pr-v3 body.inicio-v3 button:focus-visible,
html.pr-v3 body.inicio-v3 a:focus-visible,
html.pr-v3 body.inicio-v3 select:focus-visible,
html.pr-v3 body.inicio-v3 input:focus-visible { outline: 3px solid #8FB0FF; outline-offset: 2px; }

/* ------------------------------------------------------------ Cabecalho */
html.pr-v3 body.inicio-v3 #header {
  background: var(--pr-surface);
  border-bottom: 1px solid var(--pr-border);
  box-shadow: 0 2px 12px rgba(20, 26, 58, .06);
  height: 60px;
  padding: 0 20px;
  justify-content: space-between;
  flex-wrap: nowrap;
}
html.pr-v3 body.inicio-v3 #header .logo img { max-height: 30px; }
html.pr-v3 body.inicio-v3 #header .logo span {
  font-family: var(--pr-font-display); font-size: 22px; font-weight: 700; color: var(--pr-navy);
}
html.pr-v3 body.inicio-v3 #header .toggle-sidebar-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-left: 8px; padding: 0; border-radius: 10px;
  font-size: 26px; color: var(--pr-navy);
}
html.pr-v3 body.inicio-v3 #header .toggle-sidebar-btn:hover { background: var(--pr-blue-soft); }
html.pr-v3 body.inicio-v3 #header .header-nav { padding-right: 4px; }
html.pr-v3 body.inicio-v3 #header .header-nav > ul { gap: 10px; margin: 0; padding: 0; }
/* css.css da .nav-item { flex: 1 }: no cabecalho cada item fica do tamanho dele */
html.pr-v3 body.inicio-v3 #header .header-nav > ul > li.nav-item { flex: 0 0 auto; }

/* Perfil (Administrador/Secretaria/Usuario): selo da V3 */
html.pr-v3 body.inicio-v3 .top-profile-role-badge {
  height: 28px; padding: 0 12px; border-radius: 999px;
  font-family: var(--pr-font-body); font-size: 11px; font-weight: 800; letter-spacing: .05em; line-height: 1.2;
}
html.pr-v3 body.inicio-v3 .top-profile-role-badge.role-admin { color: var(--pr-warn-fg); background: var(--pr-warn-bg); border-color: #F6D3A8; }
html.pr-v3 body.inicio-v3 .top-profile-role-badge.role-secretaria { color: #0F5E66; background: #E3F6F7; border-color: #B5E3E7; }
html.pr-v3 body.inicio-v3 .top-profile-role-badge.role-usuario { color: var(--pr-navy); background: var(--pr-blue-soft); border-color: #C7D4FF; }

/* Resumo do usuario logado (leva a Meu Perfil) */
/* Cabe no cabecalho de 60px com respiro: no maximo 48px, cada linha com reticencias */
html.pr-v3 body.inicio-v3 .top-user-badge {
  gap: 10px; min-width: 260px; max-width: 420px; max-height: 48px; padding: 4px 12px 4px 4px; overflow: hidden;
  border: 1px solid var(--pr-border); border-radius: 12px; background: var(--pr-surface); box-shadow: none;
}
html.pr-v3 body.inicio-v3 .top-user-badge .badge-clinica,
html.pr-v3 body.inicio-v3 .top-user-badge .badge-perfil,
html.pr-v3 body.inicio-v3 .top-user-badge .badge-meta {
  line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html.pr-v3 body.inicio-v3 .top-user-badge-link:hover .top-user-badge {
  background: var(--pr-surface-2); border-color: var(--pr-border-strong); box-shadow: none; transform: none;
}
html.pr-v3 body.inicio-v3 .top-user-badge .badge-icon {
  width: 38px; height: 38px; border-radius: 10px; background: var(--pr-navy); font-size: 1rem;
}
/* css.css da .nav-item { text-align: center }: o resumo fica alinhado a esquerda */
html.pr-v3 body.inicio-v3 .top-user-badge .badge-text { text-align: left; }
html.pr-v3 body.inicio-v3 .top-user-badge .badge-clinica { font-size: 11px; color: var(--pr-muted); letter-spacing: .05em; }
html.pr-v3 body.inicio-v3 .top-user-badge .badge-perfil { font-size: 14px; color: var(--pr-ink); font-weight: 700; line-height: 1.25; }
html.pr-v3 body.inicio-v3 .top-user-badge .badge-meta { font-size: 12px; color: var(--pr-muted); }

/* Botao da Central de mensagens */
html.pr-v3 body.inicio-v3 .message-center-toggle {
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--pr-border-strong); background: var(--pr-surface); color: var(--pr-navy); box-shadow: none;
}
html.pr-v3 body.inicio-v3 .message-center-toggle:hover { background: var(--pr-blue-soft); box-shadow: none; transform: none; }
html.pr-v3 body.inicio-v3 .message-center-toggle[aria-expanded="true"] { background: var(--pr-blue-soft); border-color: var(--pr-blue); }
html.pr-v3 body.inicio-v3 .message-center-toggle i { font-size: 1.1rem; }
html.pr-v3 body.inicio-v3 .message-center-alert { background: var(--pr-danger); }
html.pr-v3 body.inicio-v3 .message-center-toast {
  border-color: #C7D4FF; background: var(--pr-surface); color: var(--pr-navy);
  font-family: var(--pr-font-body); font-size: .9rem; border-radius: 12px; box-shadow: 0 16px 32px rgba(20, 26, 58, .18);
}

/* ------------------------------------------------- Central de mensagens */
html.pr-v3 body.inicio-v3 .message-center-panel {
  border: 1px solid var(--pr-border); border-radius: var(--pr-radius);
  box-shadow: 0 20px 48px rgba(20, 26, 58, .18);
  font-family: var(--pr-font-body); color: var(--pr-ink);
}
html.pr-v3 body.inicio-v3 .message-center-header {
  flex-wrap: wrap; gap: 8px 12px; padding: 12px 14px;
  background: var(--pr-surface); border-bottom: 1px solid var(--pr-border-soft);
  font-family: var(--pr-font-display); font-size: 15px; font-weight: 600; color: var(--pr-ink);
}
html.pr-v3 body.inicio-v3 .message-center-actions { flex-wrap: wrap; gap: 6px; }

/* Botoes da Central (e o "Familias" de conecta-comunicados.js): regulamento do AGENTS.md */
html.pr-v3 body.inicio-v3 .message-center-mini-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 38px; padding: 0 .8rem; border: 1px solid var(--pr-border-strong); border-radius: 999px;
  background: var(--pr-surface); color: var(--pr-navy);
  font-family: var(--pr-font-body); font-size: .8rem; font-weight: 700; line-height: 1.2; white-space: nowrap; cursor: pointer;
}
html.pr-v3 body.inicio-v3 .message-center-mini-btn img { width: 18px; height: 18px; object-fit: contain; flex: none; }
html.pr-v3 body.inicio-v3 .message-center-mini-btn:hover:not(:disabled) { background: var(--pr-surface-2); border-color: var(--pr-blue); }
html.pr-v3 body.inicio-v3 .message-center-mini-btn.btn-primary-soft { background: var(--pr-navy); border-color: var(--pr-navy); color: #FFFFFF; }
html.pr-v3 body.inicio-v3 .message-center-mini-btn.btn-primary-soft:hover:not(:disabled) { background: var(--pr-blue); border-color: var(--pr-blue); }
/* icone colorido sobre o azul-marinho: fica num fundo branco (mesmo padrao das abas da janela das familias) */
html.pr-v3 body.inicio-v3 .message-center-mini-btn.btn-primary-soft img { background: #FFFFFF; border-radius: 4px; padding: 1px; }
html.pr-v3 body.inicio-v3 .message-center-mini-btn.btn-danger-soft { background: #FFF1EA; border-color: #F1B9A0; color: #8A2D09; }
html.pr-v3 body.inicio-v3 .message-center-mini-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Abas Novas msgs / Enviadas: pilulas da V3, ativa em azul-marinho */
html.pr-v3 body.inicio-v3 .message-center-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px;
  background: var(--pr-surface-2); border-bottom: 1px solid var(--pr-border-soft);
}
html.pr-v3 body.inicio-v3 .message-center-tab {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 38px; padding: 0 .9rem;
  border: 1px solid var(--pr-border-strong); border-radius: 999px; background: var(--pr-surface); color: var(--pr-navy);
  font-family: var(--pr-font-body); font-size: .82rem; font-weight: 700; line-height: 1.2;
}
html.pr-v3 body.inicio-v3 .message-center-tab img { width: 18px; height: 18px; object-fit: contain; flex: none; }
html.pr-v3 body.inicio-v3 .message-center-tab:hover { background: var(--pr-blue-soft); }
html.pr-v3 body.inicio-v3 .message-center-tab.is-active { background: var(--pr-navy); border-color: var(--pr-navy); color: #FFFFFF; }
html.pr-v3 body.inicio-v3 .message-center-tab.is-active img { background: #FFFFFF; border-radius: 4px; }

/* Lista (caixa de entrada / enviadas) */
html.pr-v3 body.inicio-v3 .message-center-list { background: var(--pr-surface); border-right: 1px solid var(--pr-border-soft); }
html.pr-v3 body.inicio-v3 .message-center-item { border-bottom: 1px solid var(--pr-border-soft); }
html.pr-v3 body.inicio-v3 .message-center-item:hover { background: var(--pr-surface-2); }
html.pr-v3 body.inicio-v3 .message-center-item.is-selected { background: var(--pr-blue-soft); box-shadow: inset 4px 0 0 var(--pr-blue); }
html.pr-v3 body.inicio-v3 .mc-row { padding: 10px 12px 10px 24px; }
html.pr-v3 body.inicio-v3 .mc-row--sent { padding-left: 14px; }
html.pr-v3 body.inicio-v3 .mc-row__dot { top: 16px; }
html.pr-v3 body.inicio-v3 .mc-row.is-unread .mc-row__dot { background: var(--pr-blue); }
html.pr-v3 body.inicio-v3 .mc-row__who { font-size: 13px; color: var(--pr-ink-2); }
html.pr-v3 body.inicio-v3 .mc-row.is-unread .mc-row__who { color: var(--pr-ink); }
html.pr-v3 body.inicio-v3 .mc-row__date { font-size: 12px; color: var(--pr-muted); }
html.pr-v3 body.inicio-v3 .mc-row.is-unread .mc-row__date { color: var(--pr-blue); }
html.pr-v3 body.inicio-v3 .message-center-item-title { font-size: 13.5px; color: var(--pr-ink); line-height: 1.3; }
html.pr-v3 body.inicio-v3 .message-center-item.is-unread .message-center-item-title { color: var(--pr-navy); }
html.pr-v3 body.inicio-v3 .mc-row__preview { font-size: 12.5px; color: var(--pr-muted); }
html.pr-v3 body.inicio-v3 .message-center-item-delete {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid #F1B9A0; background: #FFF1EA; color: #8A2D09;
}
html.pr-v3 body.inicio-v3 .message-center-item-delete img { width: 18px; height: 18px; object-fit: contain; }
/* A lixeira traz os dois icones (bi-trash da Experiencia antiga e bin.png): no V3 so o bin.png */
html.pr-v3 body.inicio-v3 .message-center-item-delete > i.bi { display: none; }
html.pr-v3 body.inicio-v3 .message-center-item-delete:hover { background: #FFE2D3; border-color: #E89B7A; }
html.pr-v3 body.inicio-v3 .message-center-empty { font-size: 13.5px; color: var(--pr-muted); padding: 16px 14px; }
html.pr-v3 body.inicio-v3 .mc-canal { font-size: 11px; }

/* Painel de leitura */
html.pr-v3 body.inicio-v3 .message-center-detail { padding: 16px 18px; }
html.pr-v3 body.inicio-v3 .mc-read__title { font-family: var(--pr-font-display); font-size: 18px; font-weight: 600; color: var(--pr-ink); }
html.pr-v3 body.inicio-v3 .mc-read__head { border-bottom-color: var(--pr-border-soft); }
html.pr-v3 body.inicio-v3 .mc-read__avatar {
  width: 38px; height: 38px; border-radius: 12px; background: var(--pr-navy); font-family: var(--pr-font-display); font-weight: 600; font-size: 13px;
}
html.pr-v3 body.inicio-v3 .mc-read__avatar--img { background: var(--pr-surface); border-color: var(--pr-border); }
html.pr-v3 body.inicio-v3 .mc-read__who { font-size: 13.5px; color: var(--pr-ink-2); }
html.pr-v3 body.inicio-v3 .mc-read__label { color: var(--pr-navy); }
html.pr-v3 body.inicio-v3 .mc-read__date { font-size: 12.5px; color: var(--pr-muted); }
html.pr-v3 body.inicio-v3 .mc-read__canal { font-size: 12.5px; color: var(--pr-ink-2); }
html.pr-v3 body.inicio-v3 .message-center-detail-body { font-size: 14px; line-height: 1.55; color: var(--pr-ink); }
html.pr-v3 body.inicio-v3 .message-center-sent-head { padding: 10px 14px; border-bottom-color: var(--pr-border-soft); }
html.pr-v3 body.inicio-v3 .message-center-sent-title { font-family: var(--pr-font-display); font-size: 15px; font-weight: 600; color: var(--pr-ink); }

/* Escrever comunicado */
html.pr-v3 body.inicio-v3 .message-center-compose {
  inset: 8px; padding: 14px 16px; gap: 10px;
  border: 1px solid var(--pr-border); border-radius: 12px; box-shadow: 0 14px 32px rgba(20, 26, 58, .16);
}
html.pr-v3 body.inicio-v3 .message-center-compose-title { font-family: var(--pr-font-display); font-size: 16px; font-weight: 600; color: var(--pr-ink); }
html.pr-v3 body.inicio-v3 .message-center-compose-grid { gap: 12px; }
html.pr-v3 body.inicio-v3 .message-center-compose-label { font-size: 13px; font-weight: 700; color: var(--pr-ink-2); margin-bottom: 4px; }
html.pr-v3 body.inicio-v3 .message-center-compose-check label { font-size: 13px; color: var(--pr-ink-2); }
html.pr-v3 body.inicio-v3 .message-center-compose-check input[type="checkbox"] { width: 18px; height: 18px; }
html.pr-v3 body.inicio-v3 .message-center-compose-input,
html.pr-v3 body.inicio-v3 .message-center-compose-select,
html.pr-v3 body.inicio-v3 .message-center-compose-textarea,
html.pr-v3 body.inicio-v3 .message-center-compose-editor {
  border: 1px solid var(--pr-border-strong); border-radius: 10px; padding: 8px 12px;
  font-family: var(--pr-font-body); font-size: 14px; color: var(--pr-ink); background: var(--pr-surface);
}
html.pr-v3 body.inicio-v3 .message-center-compose-input,
html.pr-v3 body.inicio-v3 select.message-center-compose-select:not([multiple]) {
  min-height: 40px; height: 40px; line-height: 1.45; padding-top: .35rem; padding-bottom: .35rem;
}
html.pr-v3 body.inicio-v3 .message-center-compose-select option { line-height: 1.45; }
html.pr-v3 body.inicio-v3 .message-center-compose-multi { min-height: 120px; max-height: 160px; }
html.pr-v3 body.inicio-v3 .message-center-compose-editor { min-height: 120px; max-height: 260px; }
html.pr-v3 body.inicio-v3 .message-center-compose-editor:focus,
html.pr-v3 body.inicio-v3 .message-center-compose-input:focus,
html.pr-v3 body.inicio-v3 .message-center-compose-select:focus { border-color: var(--pr-blue); box-shadow: 0 0 0 3px rgba(43, 79, 199, .15); outline: none; }
html.pr-v3 body.inicio-v3 .message-center-compose-editor:empty::before { color: #8C93AE; }
/* Barra de formatacao: ferramentas e selects lado a lado com a mesma altura */
html.pr-v3 body.inicio-v3 .message-center-compose-toolbar { gap: 6px; align-items: center; }
html.pr-v3 body.inicio-v3 .message-center-compose-tool,
html.pr-v3 body.inicio-v3 .message-center-compose-tool-color { width: 38px; height: 38px; border-radius: 10px; border-color: var(--pr-border-strong); background: var(--pr-surface); color: var(--pr-navy); }
html.pr-v3 body.inicio-v3 .message-center-compose-tool:hover { background: var(--pr-blue-soft); border-color: var(--pr-blue); }
html.pr-v3 body.inicio-v3 .message-center-compose-tool-select {
  min-height: 38px; height: 38px; line-height: 1.45; padding: 0 8px; border-radius: 10px; border-color: var(--pr-border-strong);
  font-family: var(--pr-font-body); font-size: 13px; color: var(--pr-ink);
}
html.pr-v3 body.inicio-v3 .message-center-compose-status { font-size: 13px; color: var(--pr-blue); }
html.pr-v3 body.inicio-v3 .message-center-compose-actions { gap: 8px; padding-top: 10px; border-top-color: var(--pr-border-soft); }

/* ----------------------------- Janela "Comunicados as familias" (.cc-modal) */
html.pr-v3 body.inicio-v3 .cc-modal { font-family: var(--pr-font-body); color: var(--pr-ink); }
html.pr-v3 body.inicio-v3 .cc-modal .cc-backdrop { background: rgba(20, 26, 58, .45); }
html.pr-v3 body.inicio-v3 .cc-modal .cc-content { border-radius: var(--pr-radius); padding: 16px 18px; box-shadow: 0 24px 56px rgba(20, 26, 58, .25); }
html.pr-v3 body.inicio-v3 .cc-modal .cc-head h5 { font-family: var(--pr-font-display); font-size: 18px; font-weight: 600; color: var(--pr-ink); }
html.pr-v3 body.inicio-v3 .cc-modal .message-center-tabs { border-radius: 12px; border: 1px solid var(--pr-border-soft); }
html.pr-v3 body.inicio-v3 .cc-modal .message-center-body { border-color: var(--pr-border); border-radius: 12px; }
html.pr-v3 body.inicio-v3 .cc-modal .cc-btn { font-family: var(--pr-font-body); }
html.pr-v3 body.inicio-v3 .cc-modal .cc-btn.btn-primary { background: var(--pr-navy); border-color: var(--pr-navy); }
html.pr-v3 body.inicio-v3 .cc-modal .cc-btn.btn-primary:hover:not(:disabled) { background: var(--pr-blue); border-color: var(--pr-blue); }
html.pr-v3 body.inicio-v3 .cc-modal .form-control { border-color: var(--pr-border-strong); border-radius: 10px; color: var(--pr-ink); font-family: inherit; }
html.pr-v3 body.inicio-v3 .cc-modal .form-control:focus { border-color: var(--pr-blue); box-shadow: 0 0 0 3px rgba(43, 79, 199, .15); }
html.pr-v3 body.inicio-v3 .cc-modal label { color: var(--pr-ink-2); }
html.pr-v3 body.inicio-v3 .cc-modal .cc-section h6 { font-family: var(--pr-font-display); font-weight: 600; color: var(--pr-ink); }
html.pr-v3 body.inicio-v3 .cc-modal .cc-hint { color: var(--pr-muted); }
html.pr-v3 body.inicio-v3 .cc-modal .cc-grupo__nome, html.pr-v3 body.inicio-v3 .cc-modal .cc-fam { color: var(--pr-ink); }

/* -------------------------------------------------------- Menu lateral */
html.pr-v3 body.inicio-v3 #sidebar {
  background: var(--pr-surface); border-right: 1px solid var(--pr-border);
  box-shadow: 0 6px 20px rgba(20, 26, 58, .06); padding: 16px 12px;
}
html.pr-v3 body.inicio-v3 #sidebar .sidebar-nav .nav-item { margin: 0 0 4px; padding: 0; width: 100%; text-align: left; }
html.pr-v3 body.inicio-v3 #sidebar .sidebar-nav .btn.btn-accessible {
  display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px;
  width: 100%; max-width: none; height: auto; min-height: 44px; margin: 0; padding: 8px 12px;
  border: 0; border-radius: 10px; background: transparent; box-shadow: none;
  text-align: left; color: var(--pr-ink); text-decoration: none;
}
html.pr-v3 body.inicio-v3 #sidebar .sidebar-nav .btn.btn-accessible:hover,
html.pr-v3 body.inicio-v3 #sidebar .sidebar-nav .btn.btn-accessible:focus-visible {
  background: var(--pr-blue-soft); box-shadow: inset 3px 0 0 var(--pr-blue);
}
html.pr-v3 body.inicio-v3 #sidebar .sidebar-nav .btn.btn-accessible img { width: 26px; height: 26px; object-fit: contain; margin: 0; flex: none; }
html.pr-v3 body.inicio-v3 #sidebar .sidebar-nav .nav-text,
html.pr-v3 body.inicio-v3 #sidebar .sidebar-nav .nav-text b {
  display: block; font-family: var(--pr-font-body); font-weight: 700; font-size: 14.5px; line-height: 1.25;
  color: var(--pr-ink); text-align: left; white-space: normal; margin: 0;
}
html.pr-v3 body.inicio-v3 #sidebar .sidebar-nav hr { border: 0; border-top: 1px solid var(--pr-border-soft); opacity: 1; margin: 10px 4px; }

/* ------------------------------------------------------------ Conteudo */
html.pr-v3 body.inicio-v3 #main { background: var(--pr-bg); padding: 24px; }
html.pr-v3 body.inicio-v3 #main .agenda-shell {
  background: transparent; padding: 0; min-height: 0; gap: 16px;
}
html.pr-v3 body.inicio-v3 #main .agenda-topbar {
  background: var(--pr-surface); border: 1px solid var(--pr-border); border-radius: var(--pr-radius);
  box-shadow: 0 6px 20px rgba(20, 26, 58, .06); padding: 18px 24px;
}
html.pr-v3 body.inicio-v3 #main .topbar-left { gap: 16px; min-width: 0; }
html.pr-v3 body.inicio-v3 #main .topbar-left .menu-icon { width: 54px; height: 54px; object-fit: contain; flex: none; }
html.pr-v3 body.inicio-v3 #main .topbar-left h2 {
  font-family: var(--pr-font-display); font-size: 22px; font-weight: 500; line-height: 1.25; color: #2A2F45;
}
html.pr-v3 body.inicio-v3 #main .topbar-left .subtitle { font-size: 14.5px; color: var(--pr-muted); margin-top: 4px; }
html.pr-v3 body.inicio-v3 #main .topbar-actions:empty { display: none; }

/* Filtros: cada bloco e um cartao; controles com 38-40px alinhados pelo centro */
html.pr-v3 body.inicio-v3 #main .agenda-filters { gap: 12px; }
html.pr-v3 body.inicio-v3 #main .date-nav,
html.pr-v3 body.inicio-v3 #main .period-select,
html.pr-v3 body.inicio-v3 #main .view-modes,
html.pr-v3 body.inicio-v3 #main .patient-select {
  background: var(--pr-surface); border: 1px solid var(--pr-border); border-radius: 14px; box-shadow: none;
  padding: 12px 14px; min-height: 66px; align-items: center;
}
/* Mes e Ano: rotulos na linha 1, selects de 40px na linha 2, colunas iguais */
html.pr-v3 body.inicio-v3 #main .period-select {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 8px; row-gap: 4px; align-content: center;
}
html.pr-v3 body.inicio-v3 #main .period-select > label[for="monthSelect"] { grid-column: 1; grid-row: 1; }
html.pr-v3 body.inicio-v3 #main .period-select > label[for="yearSelect"] { grid-column: 2; grid-row: 1; }
html.pr-v3 body.inicio-v3 #main .period-select > #monthSelect { grid-column: 1; grid-row: 2; width: 100%; }
html.pr-v3 body.inicio-v3 #main .period-select > #yearSelect { grid-column: 2; grid-row: 2; width: 100%; }
html.pr-v3 body.inicio-v3 #main .date-nav > div { flex: 1 1 auto; min-width: 0; text-align: center; }
html.pr-v3 body.inicio-v3 #main .current-period { font-family: var(--pr-font-display); font-size: 17px; font-weight: 600; color: var(--pr-ink); }
html.pr-v3 body.inicio-v3 #main .agenda-filters .muted { font-size: 12px; color: var(--pr-muted); }
html.pr-v3 body.inicio-v3 #main .date-nav .nav-btn {
  flex: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--pr-border-strong);
  background: var(--pr-surface); color: var(--pr-navy); font-size: 1.4rem; font-weight: 700; line-height: 1;
}
html.pr-v3 body.inicio-v3 #main .date-nav .nav-btn:hover { background: var(--pr-blue-soft); border-color: var(--pr-blue); }
html.pr-v3 body.inicio-v3 #main .period-select label,
html.pr-v3 body.inicio-v3 #main .patient-select label { font-size: 13px; font-weight: 700; color: var(--pr-ink-2); margin: 0; }
html.pr-v3 body.inicio-v3 #main .period-select select,
html.pr-v3 body.inicio-v3 #main .patient-select select {
  min-height: 40px; height: 40px; line-height: 1.45; padding: .35rem .6rem; min-width: 0;
  border: 1px solid var(--pr-border-strong); border-radius: 10px; background-color: var(--pr-surface);
  font-family: var(--pr-font-body); font-size: 14px; font-weight: 600; color: var(--pr-ink);
}
html.pr-v3 body.inicio-v3 #main .period-select select option,
html.pr-v3 body.inicio-v3 #main .patient-select select option { line-height: 1.45; }
html.pr-v3 body.inicio-v3 #main .period-select select:focus,
html.pr-v3 body.inicio-v3 #main .patient-select select:focus { border-color: var(--pr-blue); box-shadow: 0 0 0 3px rgba(43, 79, 199, .15); outline: none; }
html.pr-v3 body.inicio-v3 #main .view-modes .view-btn {
  min-height: 40px; padding: 0 .9rem; border: 1px solid var(--pr-border-strong); border-radius: 999px;
  background: var(--pr-surface); color: var(--pr-navy);
  font-family: var(--pr-font-body); font-size: .85rem; font-weight: 700; line-height: 1.2;
}
html.pr-v3 body.inicio-v3 #main .view-modes .view-btn:hover { background: var(--pr-blue-soft); color: var(--pr-navy); }
html.pr-v3 body.inicio-v3 #main .view-modes .view-btn.active { background: var(--pr-navy); border-color: var(--pr-navy); color: #FFFFFF; }

/* Legendas como selos */
html.pr-v3 body.inicio-v3 #main .agenda-legends { justify-content: center; gap: 8px; }
html.pr-v3 body.inicio-v3 #main .legend-item {
  gap: 6px; padding: 4px 12px; border: 1px solid var(--pr-border); border-radius: 999px; background: var(--pr-surface);
  font-size: 12.5px; font-weight: 700; color: var(--pr-ink-2); line-height: 1.4;
}
html.pr-v3 body.inicio-v3 #main .legend-item span { width: 12px; height: 12px; border-radius: 4px; }

/* Calendario: cartao da V3 (o miolo continua com o desenho de agenda.css) */
html.pr-v3 body.inicio-v3 #main .agenda-calendar {
  background: var(--pr-surface); border: 1px solid var(--pr-border); border-radius: var(--pr-radius);
  box-shadow: 0 6px 20px rgba(20, 26, 58, .06);
}
html.pr-v3 body.inicio-v3 #main .upgrade-overlay { border-radius: var(--pr-radius); }

/* Separador entre agenda e aniversariantes: o espaco entre cartoes ja separa */
html.pr-v3 body.inicio-v3 #main .col-lg-12 > hr { display: none; }

/* Proximos aniversariantes: cartao com o titulo em cima e a tabela embaixo */
html.pr-v3 body.inicio-v3 #main .col-lg-12 > .agenda-topbar {
  flex-direction: column; align-items: stretch; gap: 14px;
}
html.pr-v3 body.inicio-v3 #main .agenda-birthdays-body {
  max-height: 560px; overflow: auto; border: 1px solid var(--pr-border); border-radius: 12px;
}
html.pr-v3 body.inicio-v3 #main .agenda-birthdays-body .agenda-table { margin: 0; border: 0; background: var(--pr-surface); }
/* Bootstrap 5 poe 2px escuros entre o thead e o tbody (.table > :not(:first-child)) */
html.pr-v3 body.inicio-v3 #main .agenda-birthdays-body .agenda-table > :not(:first-child) { border-top: 0; }
html.pr-v3 body.inicio-v3 #main .agenda-birthdays-body .table-custom-header,
html.pr-v3 body.inicio-v3 #main .agenda-birthdays-body .table-custom-header tr { background: transparent; border: 0; }
html.pr-v3 body.inicio-v3 #main .agenda-birthdays-body .table-custom-header th {
  position: sticky; top: 0; z-index: 1;
  background: var(--pr-surface-2); color: var(--pr-muted); border: 0; border-bottom: 1px solid var(--pr-border);
  font-family: var(--pr-font-body); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 10px 14px;
}
html.pr-v3 body.inicio-v3 #main .agenda-birthdays-body .agenda-table td {
  border: 0; border-bottom: 1px solid var(--pr-border-soft); padding: 10px 14px; vertical-align: middle;
  font-size: 14px; color: var(--pr-ink); background: transparent;
}
html.pr-v3 body.inicio-v3 #main .agenda-birthdays-body .table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-accent-bg: transparent; background: transparent; }
html.pr-v3 body.inicio-v3 #main #birthdayData tr:hover > td { background: var(--pr-surface-2); }
/* Botao DudiConecta da linha (paciente-dashboard.js): pilula com icone de 18px */
html.pr-v3 body.inicio-v3 #main #birthdayData .dudiconecta-inline-btn {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 38px; margin: 0 8px 0 0; padding: 0 .8rem;
  border: 1px solid var(--pr-border-strong); border-radius: 999px; background: var(--pr-surface); color: var(--pr-navy);
  font-family: var(--pr-font-body); font-size: .8rem; font-weight: 700; line-height: 1.2; vertical-align: middle; cursor: pointer;
}
html.pr-v3 body.inicio-v3 #main #birthdayData .dudiconecta-inline-btn:hover { background: var(--pr-blue-soft); border-color: var(--pr-blue); }
html.pr-v3 body.inicio-v3 #main #birthdayData .dudiconecta-inline-btn img { width: 18px !important; height: 18px !important; object-fit: contain; flex: none; }
html.pr-v3 body.inicio-v3 #main #birthdayData .dudiconecta-inline-btn .button-text { margin: 0; font-size: inherit; font-weight: inherit; }

/* Rodape e voltar ao topo */
html.pr-v3 body.inicio-v3 #footer { border-top: 1px solid var(--pr-border); background: var(--pr-bg); }
html.pr-v3 body.inicio-v3 #footer .credits { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 0 16px; color: var(--pr-muted); }
html.pr-v3 body.inicio-v3 #footer .credits img { width: auto; height: 32px; object-fit: contain; }
html.pr-v3 body.inicio-v3 #footer .credits b { font-family: var(--pr-font-body); font-size: 14px !important; font-weight: 700; color: var(--pr-ink-2); }
html.pr-v3 body.inicio-v3 .back-to-top { background: var(--pr-navy); border-radius: 12px; }
html.pr-v3 body.inicio-v3 .back-to-top:hover { background: var(--pr-blue); }

/* ------------------------------------------------------------- Celular */
@media (max-width: 991.98px) {
  /* Central como folha fixa na largura da tela (sem rolagem horizontal em 390px).
     Em tela compacta comunicados.js limpa a largura/altura inline do redimensionar. */
  html.pr-v3 body.inicio-v3 .message-center-panel {
    position: fixed; top: 68px; left: 8px; right: 8px; width: auto; min-width: 0; max-width: none;
    height: calc(100vh - 80px); height: calc(100dvh - 80px); max-height: none;
  }
}
@media (max-width: 768px) {
  html.pr-v3 body.inicio-v3 #main { padding: 16px 12px; }
  html.pr-v3 body.inicio-v3 #main .agenda-topbar { padding: 14px 16px; }
  html.pr-v3 body.inicio-v3 #main .topbar-left .menu-icon { width: 44px; height: 44px; }
  html.pr-v3 body.inicio-v3 #main .topbar-left h2 { font-size: 19px; }
  html.pr-v3 body.inicio-v3 #main .agenda-filters { padding-inline: 0; }
  html.pr-v3 body.inicio-v3 #main .patient-select label { width: 100%; }
  html.pr-v3 body.inicio-v3 #main .agenda-birthdays-body { max-height: 480px; }
}
@media (max-width: 576px) {
  html.pr-v3 body.inicio-v3 #header { padding: 0 12px; }
  html.pr-v3 body.inicio-v3 .message-center-header { padding: 10px 12px; }
  html.pr-v3 body.inicio-v3 .message-center-actions { width: 100%; }
  html.pr-v3 body.inicio-v3 .message-center-actions .message-center-mini-btn { flex: 1 1 auto; padding: 0 .6rem; }
  html.pr-v3 body.inicio-v3 .message-center-detail { padding: 12px 14px; }
  html.pr-v3 body.inicio-v3 #main .agenda-birthdays-body .table-custom-header th,
  html.pr-v3 body.inicio-v3 #main .agenda-birthdays-body .agenda-table td { padding: 8px 10px; }
  /* agenda.css (~1279) esconde Dia/Semana/Mes no celular: aqui voltam, lado a lado */
  html.pr-v3 body.inicio-v3 #main .view-modes { display: flex; flex-wrap: nowrap; gap: 6px; }
  html.pr-v3 body.inicio-v3 #main .view-modes .view-btn { flex: 1 1 0; min-width: 0; padding: 0 .5rem; font-size: .82rem; }
}

/* Busca de paciente da agenda (agenda-paciente-busca.js) no Início V3 */
html.pr-v3 body.inicio-v3 #main .patient-select .paciente-busca { flex: 1 1 0; }
html.pr-v3 body.inicio-v3 #main .paciente-busca__input {
  height: 40px; min-height: 40px; border: 1px solid var(--pr-border-strong); border-radius: 10px;
  font-family: var(--pr-font-body); font-size: 14px; font-weight: 600; color: var(--pr-ink);
}
html.pr-v3 body.inicio-v3 #main .paciente-busca__input:focus { border-color: var(--pr-blue); box-shadow: 0 0 0 3px rgba(43, 79, 199, .15); }
html.pr-v3 body.inicio-v3 #main .paciente-busca__item { font-family: var(--pr-font-body); }
html.pr-v3 body.inicio-v3 #main .paciente-busca__item:hover,
html.pr-v3 body.inicio-v3 #main .paciente-busca__item.is-ativo { background: var(--pr-blue-soft); }
