/* Cachear: identidade partilhada; adapta as regras antigas sem mudar o layout. */
:root {
  --cachear-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --cachear-font-heading: Georgia, "Times New Roman", serif;
  --cachear-action: #b91d71;
  --ic-pink: #f13998;
  --ic-pink-dark: var(--cachear-action);
  --ic-ink: #1f1d1b;
  --ic-body: #5e5953;
  --ic-muted: #7a746c;
  --dash-font-sans: var(--cachear-font-body);
}
html body, html body.csi-app, html body.csi-auth-bg {
  font-family: var(--cachear-font-body) !important;
  -webkit-font-smoothing: antialiased;
}
html body button, html body input, html body select, html body textarea,
html body table, html body .nav-link, html body .dropdown-item,
html body .fc, html body .dash-kpi-value {
  font-family: var(--cachear-font-body) !important;
}
html body h1, html body h2, html body h3, html body h4,
html body .card-title, html body .public-brand-title {
  font-family: var(--cachear-font-heading) !important;
  letter-spacing: normal;
}
html body h5, html body h6, html body .navbar-heading {
  font-family: var(--cachear-font-body) !important;
}
html body input, html body select, html body textarea { font-size: 1rem; }
html body table, html body .fc { font-variant-numeric: tabular-nums; }
html[data-csi-theme="light"] { --csi-bg: #fbf8f4; --csi-bg-2: #f5efe9; --csi-text: #1f1d1b; --csi-muted: #7a746c; }
html[data-csi-theme="dark"] {
  --csi-bg: #211d1b; --csi-bg-2: #181513;
  --csi-surface: #2d2724; --csi-surface-2: #211d1b;
  --csi-border: #514741; --csi-input: #211d1b;
  --csi-input-text: #f6f1eb; --csi-text: #f6f1eb; --csi-muted: #b6aaa0;
}
html body .btn-primary, html body .login-submit {
  background: var(--cachear-action) !important;
  border-color: var(--cachear-action) !important;
  color: white !important;
}
html body .btn-primary:hover, html body .login-submit:hover { filter: brightness(.92); }
html body :focus-visible { outline: 2px solid var(--cachear-action); outline-offset: 3px; }
/* Adaptação do tema escuro para cartões com estilos antigos no template. */
html[data-csi-theme="dark"] body.csi-app .main-content .csi-card,
html[data-csi-theme="dark"] body.csi-app .main-content .card,
html[data-csi-theme="dark"] body.csi-app .dash-container .dash-kpi,
html[data-csi-theme="dark"] body.csi-app .dash-filterbar {
  background: #2d2724 !important;
  border-color: #514741 !important;
  color: #f6f1eb !important;
}
html[data-csi-theme="dark"] body.csi-app .dash-container,
html[data-csi-theme="dark"] body.csi-app .dash-container h1,
html[data-csi-theme="dark"] body.csi-app .dash-container h2,
html[data-csi-theme="dark"] body.csi-app .dash-container h3,
html[data-csi-theme="dark"] body.csi-app .dash-container h4,
html[data-csi-theme="dark"] body.csi-app .dash-container .dash-kpi__label,
html[data-csi-theme="dark"] body.csi-app .dash-container .csi-filter-card label {
  color: #f6f1eb !important; -webkit-text-fill-color: #f6f1eb !important;
}
html[data-csi-theme="dark"] body.csi-app .dash-container p,
html[data-csi-theme="dark"] body.csi-app .dash-container .dash-kpi__meta,
html[data-csi-theme="dark"] body.csi-app .dash-container .dash-kpi__meta span {
  color: #cfc5bc !important; -webkit-text-fill-color: #cfc5bc !important;
}
html[data-csi-theme="dark"] body.csi-app .dash-container :is(#statNewPatients,#statPeriodAppointments,#statTotalTeam,#statActiveServices) {
  color: #f6f1eb !important; -webkit-text-fill-color: #f6f1eb !important;
}
html[data-csi-theme="dark"] body.csi-app .main-content input,
html[data-csi-theme="dark"] body.csi-app .main-content select,
html[data-csi-theme="dark"] body.csi-app .main-content textarea {
  background: #211d1b !important; color: #f6f1eb !important;
  border-color: #514741 !important; color-scheme: dark;
}
html[data-csi-theme="dark"] body.csi-app .dash-container table {
  background: #2d2724 !important; color: #f6f1eb !important;
}
html body.csi-app .navbar-brand-img.cachear-logo-dark { display: none !important; }
html[data-csi-theme="dark"] body.csi-app .navbar-brand-img.cachear-logo-light { display: none !important; }
html[data-csi-theme="dark"] body.csi-app .navbar-brand-img.cachear-logo-dark { display: block !important; }
html[data-csi-theme="dark"] body.csi-app .dash-container {
  -webkit-text-fill-color: currentColor !important;
}
html[data-csi-theme="dark"] body.csi-app .dash-container .dash-kpi__icon i {
  color: #b91d71 !important; -webkit-text-fill-color: #b91d71 !important;
}
html[data-csi-theme="dark"] body.csi-app .dash-container .btn:not(.btn-primary),
html[data-csi-theme="dark"] body.csi-app .dash-container button:not(.btn-primary),
html[data-csi-theme="dark"] body.csi-app .dash-container select {
  background: #211d1b !important; color: #f6f1eb !important;
  -webkit-text-fill-color: #f6f1eb !important; border-color: #514741 !important;
}
html[data-csi-theme="dark"] body.csi-app .dash-container .dash-filterbar button.active {
  background: #6c2547 !important; color: #ffffff !important;
}
html[data-csi-theme="dark"] body.csi-app .dash-container .text-muted,
html[data-csi-theme="dark"] body.csi-app .dash-container .csi-chip {
  color: #cfc5bc !important; -webkit-text-fill-color: #cfc5bc !important;
}
html[data-csi-theme="light"] body.csi-app .dash-container .csi-chip {
  color: #5e5953 !important; -webkit-text-fill-color: #5e5953 !important;
}
html[data-csi-theme="dark"] body.csi-app .dash-container .select2-selection,
html[data-csi-theme="dark"] body.csi-app .dash-container .select2-selection__rendered {
  background: #211d1b !important; color: #f6f1eb !important;
  -webkit-text-fill-color: #f6f1eb !important; border-color: #514741 !important;
}
html[data-csi-theme="dark"] body.csi-app .dash-container .dash-period-button.is-active {
  background: #6c2547 !important; color: #ffffff !important;
}
html body .csi-page-title { font-family: var(--cachear-font-heading) !important; }
html body .fc .fc-toolbar-title { font-family: var(--cachear-font-body) !important; }
html body.csi-app #sidenav-main .cachear-menu-pending-text {
  display:block; font-size:11px; font-weight:500; margin-top:3px;
  color:#99601d !important; -webkit-text-fill-color:#99601d !important;
  line-height:1.3;
}
html[data-csi-theme="dark"] body.csi-app #sidenav-main .cachear-menu-pending-text {
  color:#f2ca87 !important; -webkit-text-fill-color:#f2ca87 !important;
}
html body .cachear-notification-section { background:#fbf8f4; color:#70685f; font-size:11px; font-weight:600; }
html[data-csi-theme="dark"] body .cachear-notification-section { background:#211d1b; color:#cfc5bc; }
html body.csi-app #sidenav-main .nav-link-text:has(.cachear-menu-pending-text) {
  display:flex !important; flex-direction:column !important; align-items:flex-start !important;
}
html body.csi-app #sidenav-main #cachearMenuPendingBadge {
  display:block !important; font-size:11px !important; margin-top:3px !important;
}

/* Shared portal page-header actions, matching the agenda reference. */
html body.csi-app :is(#cachear-header-actions,.header,.cachear-booking-page-header) .btn,
html body.csi-app .header .cachear-list-more>summary{
 display:inline-flex!important;align-items:center;justify-content:center;gap:6px;
 height:40px!important;min-height:40px;padding:0 16px!important;
 border-radius:999px!important;border:1px solid #ffc3df!important;
 background:#fff!important;color:#292b31!important;-webkit-text-fill-color:#292b31!important;
 font:600 14px -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif!important;
 letter-spacing:.02em!important;line-height:1!important;white-space:nowrap;
 box-shadow:none!important;vertical-align:middle;
}
html body.csi-app :is(#cachear-header-actions,.header,.cachear-booking-page-header) .btn-primary{
 background:#f13998!important;border-color:#f13998!important;color:#fff!important;-webkit-text-fill-color:#fff!important;
}
html body.csi-app .header .cachear-list-tools{gap:10px;align-items:center}
html body.csi-app .header .cachear-list-more>summary::marker{content:""}
html body.csi-app .header .cachear-list-more>summary::-webkit-details-marker{display:none}
html body.csi-app .header .cachear-list-more>summary::after{content:"▾";margin-left:6px}
html[data-csi-theme="dark"] body.csi-app :is(#cachear-header-actions,.header,.cachear-booking-page-header) .btn:not(.btn-primary),
html[data-csi-theme="dark"] body.csi-app .header .cachear-list-more>summary{
 background:#2d2724!important;color:#f6f1eb!important;-webkit-text-fill-color:#f6f1eb!important;border-color:#85516b!important;
}
html body.csi-app #cachear-agenda-list .header .cachear-list-more>summary{height:40px!important;padding:0 16px!important;border-radius:999px!important;border:1px solid #ffc3df!important;background:#fff!important;color:#292b31!important;-webkit-text-fill-color:#292b31!important;font:600 14px -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif!important;letter-spacing:.02em!important;box-shadow:none!important}
html[data-csi-theme="dark"] body.csi-app #cachear-agenda-list .header .cachear-list-more>summary{background:#2d2724!important;color:#f6f1eb!important;-webkit-text-fill-color:#f6f1eb!important;border-color:#85516b!important}
