.cdm-shell,
.cdm-wrap {
  color: #14213d;
  width: 100%;
}

.cdm-shell-frame-wrap {
  width: 100%;
  min-height: 100vh;
  max-width: 100%;
}

.cdm-shell-frame {
  display: block;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  height: 100vh;
  min-height: 100vh;
  border: 0;
  background: #f5f7fa;
}

.cdm-shell-frame-wrap.cdm-shell-frame-wrap-shortcode {
  position: fixed;
  inset: 0;
  width: auto;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  z-index: 2147483000;
}

.cdm-shell-frame-wrap.cdm-shell-frame-wrap-shortcode .cdm-shell-frame {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 100vh;
  height: 100dvh;
}

.cdm-shell-frame-wrap-admin {
  margin-top: 12px;
  min-height: 0;
  height: calc(100vh - 110px);
  width: 100%;
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.cdm-shell-frame-admin {
  height: calc(100vh - 110px);
  min-height: 0;
  width: max(100%, 1280px);
  min-width: 1280px;
  max-width: none;
}

.toplevel_page_church-data-manager #wpbody-content {
  padding-bottom: 0;
  min-height: 0;
}

.toplevel_page_church-data-manager .wrap.cdm-wrap {
  max-width: none;
  margin: 0;
  min-height: 0;
  width: 100%;
}

.toplevel_page_church-data-manager .cdm-shell-frame-wrap-admin {
  width: 100%;
  max-width: none;
  overflow-x: auto;
  overflow-y: hidden;
}

.toplevel_page_church-data-manager #wpcontent,
.toplevel_page_church-data-manager #wpbody,
.toplevel_page_church-data-manager #wpbody-content {
  width: 100%;
  max-width: none;
}

.toplevel_page_church-data-manager #wpfooter {
  display: none;
}

.toplevel_page_church-data-manager .cdm-admin-tabs {
  margin: 12px 0 20px;
}

.cdm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.cdm-card,
.cdm-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
  border: 1px solid #d6deea;
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(20, 33, 61, 0.08);
  padding: 18px;
}

.cdm-card-label {
  color: #5c677d;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cdm-card-value {
  font-size: 28px;
  font-weight: 700;
  margin-top: 10px;
}

.cdm-panel h2 {
  margin-top: 0;
}

.cdm-loading {
  padding: 24px 0;
  font-size: 15px;
}

.cdm-panel-error {
  border-color: #d64545;
}

/* App shell visual fit overrides loaded inside the iframe. */
.cdm-app-shell-body,
.cdm-app-shell-body #root {
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.cdm-app-shell-body .container {
  width: 100%;
  max-width: none;
  min-width: 0;
  height: 100%;
  min-height: 0;
}

.cdm-app-shell-body .sidebar {
  left: 0;
  top: 0;
  bottom: 0;
  transform: none;
}

.cdm-app-shell-body .main-content {
  min-width: 0;
  max-width: none;
}

.cdm-app-shell-body.cdm-app-shell-admin .sidebar,
.cdm-app-shell-body.cdm-app-shell-admin .mobile-menu-toggle,
.cdm-app-shell-body.cdm-app-shell-admin .sidebar-overlay {
  display: none !important;
}

.cdm-app-shell-body.cdm-app-shell-admin .main-content,
.cdm-app-shell-body.cdm-app-shell-admin .main-content-backend {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  padding: 12px 14px 20px !important;
  height: auto !important;
  min-height: 0 !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
}

.cdm-app-shell-body.cdm-app-shell-admin,
.cdm-app-shell-body.cdm-app-shell-admin #root,
.cdm-app-shell-body.cdm-app-shell-admin #cdm-app-root {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

.cdm-app-shell-body.cdm-app-shell-admin .app-global-header,
.cdm-app-shell-body.cdm-app-shell-admin .page-header.app-global-header {
  display: none !important;
}

.cdm-app-shell-body.cdm-app-shell-admin .app-content-shell,
.cdm-app-shell-body.cdm-app-shell-admin .app-page-body,
.cdm-app-shell-body.cdm-app-shell-admin .app-page-body > * {
  box-sizing: border-box !important;
  width: min(1200px, 100%) !important;
  max-width: 1200px !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  align-self: stretch !important;
}

.cdm-app-shell-body.cdm-app-shell-admin .table-container {
  box-sizing: border-box !important;
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
}

.cdm-app-shell-body.cdm-app-shell-admin table.mobile-grid-table {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  table-layout: auto !important;
}

.cdm-app-shell-body.cdm-app-shell-admin .sessions-page {
  max-height: calc(100vh - 190px) !important;
  max-height: calc(100dvh - 190px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 6px !important;
}

.cdm-app-shell-body.cdm-app-shell-admin .sessions-page .sessions-actions {
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}

.cdm-app-shell-body.cdm-app-shell-admin .sessions-page .search-box {
  flex: 0 0 220px !important;
  width: 220px !important;
  min-width: 160px !important;
  max-width: 220px !important;
  padding: 7px 11px !important;
}

.cdm-app-shell-body.cdm-app-shell-admin .sessions-page .search-box input {
  font-size: 12px !important;
}

.cdm-app-shell-body.cdm-app-shell-admin .sessions-page .sessions-filter {
  flex: 0 0 118px !important;
  width: 118px !important;
  min-width: 118px !important;
  max-width: 118px !important;
  height: 34px !important;
  padding: 6px 8px !important;
  font-size: 12px !important;
}

.cdm-app-shell-body.cdm-app-shell-admin .sessions-page .sessions-actions .btn {
  min-height: 34px !important;
  padding: 7px 10px !important;
  font-size: 12px !important;
  line-height: 1.15 !important;
}

.cdm-app-shell-body.cdm-app-shell-admin .sessions-page .table-container {
  width: 100% !important;
  max-width: 100% !important;
  margin-top: 18px !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
}

.cdm-app-shell-body.cdm-app-shell-admin .sessions-page table.mobile-grid-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: auto !important;
  table-layout: fixed !important;
  font-size: 10.5px !important;
}

.cdm-app-shell-body.cdm-app-shell-admin .sessions-page table.mobile-grid-table th,
.cdm-app-shell-body.cdm-app-shell-admin .sessions-page table.mobile-grid-table td {
  min-width: 0 !important;
  padding: 6px 5px !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  line-height: 1.25 !important;
}

.cdm-app-shell-body .app-content-shell,
.cdm-app-shell-body .app-page-body {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.cdm-app-shell-body .app-page-body > * {
  width: 100%;
  min-width: 0;
  max-width: 1200px;
  margin-inline: auto;
}

.cdm-app-shell-body .app-content-shell {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 0 !important;
}

.cdm-app-shell-body .app-page-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

@media (min-width: 1025px) {
  .cdm-app-shell-body:not(.cdm-app-shell-admin) .sidebar {
    width: var(--sidebar-width, 260px);
  }

  .cdm-app-shell-body:not(.cdm-app-shell-admin) .main-content {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: var(--sidebar-width, 260px);
    width: auto;
    height: auto;
    margin-left: 0;
    padding: 18px 22px 26px;
    display: flex;
    overflow: hidden;
    background: #f5f7fa;
  }

  .cdm-app-shell-body:not(.cdm-app-shell-admin) .app-content-shell {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .cdm-app-shell-body:not(.cdm-app-shell-admin) .app-page-body {
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 4px;
  }
}

.dashboard-page {
  gap: 14px;
  max-width: 1200px;
  margin-inline: auto;
}

.dashboard-page .dashboard-kpis {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.dashboard-page .kpi-card {
  min-height: 112px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 16px;
  row-gap: 4px;
  padding: 16px 18px;
}

.dashboard-page .kpi-card .stat-icon {
  grid-row: 1 / span 2;
  margin: 0;
}

.dashboard-page .kpi-card .stat-title,
.dashboard-page .kpi-card .stat-value {
  text-align: left;
}

.dashboard-page .kpi-card .stat-title {
  align-self: end;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.3;
}

.dashboard-page .kpi-card .stat-value {
  align-self: start;
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.1;
}

.dashboard-page .dashboard-section {
  padding: 14px 16px;
  border-radius: 16px;
  margin: 0;
}

.dashboard-page .dashboard-charts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-page .chart-card {
  min-height: 232px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 16px;
}

.dashboard-page .chart-card canvas {
  width: 100% !important;
  height: 170px !important;
  max-height: 170px !important;
}

.dashboard-page .birthday-section,
.dashboard-page .birthday-calendar {
  margin: 0;
}

.dashboard-page .birthday-calendar {
  max-width: 1180px;
  margin-inline: auto;
  padding: 8px 10px 2px;
  box-shadow: none;
}

.dashboard-page .calendar-header {
  margin-bottom: 10px;
}

.dashboard-page .calendar-grid {
  gap: 7px;
}

.dashboard-page .calendar-cell {
  min-height: 46px;
  padding: 8px 0;
}

.dashboard-page .calendar-day {
  line-height: 1;
}

.dashboard-page .section-header {
  margin: 6px 0 10px;
}

.dashboard-page .section-header h2 {
  font-size: 1.25rem;
  line-height: 1.2;
}

.cdm-app-shell-body [id*="chaty"],
.cdm-app-shell-body [class*="chaty"],
.cdm-app-shell-body [id^="cht"],
.cdm-app-shell-body [class^="cht"],
.cdm-app-shell-body [class*=" cht"],
.cdm-app-shell-body .chaty-widget,
.cdm-app-shell-body .chaty-widget-container,
.cdm-app-shell-body #chaty-widget,
.cdm-app-shell-body #cht-chaty-widget,
.cdm-app-shell-body .cht-widget,
.cdm-app-shell-body .cht-floating-chat,
.cdm-app-shell-body .cht-floating-chat-wrap,
body.cdm-app-standalone-page [id*="chaty"],
body.cdm-app-standalone-page [class*="chaty"],
body.cdm-app-standalone-page [id^="cht"],
body.cdm-app-standalone-page [class^="cht"],
body.cdm-app-standalone-page [class*=" cht"],
body.cdm-app-standalone-page .chaty-widget,
body.cdm-app-standalone-page .chaty-widget-container,
body.cdm-app-standalone-page #chaty-widget,
body.cdm-app-standalone-page #cht-chaty-widget,
body.cdm-app-standalone-page .cht-widget,
body.cdm-app-standalone-page .cht-floating-chat,
body.cdm-app-standalone-page .cht-floating-chat-wrap {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 1280px) {
  .dashboard-page .dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dashboard-page .dashboard-kpis,
  .dashboard-page .dashboard-charts {
    grid-template-columns: 1fr;
  }
}

/* Targeted restorations: sidebar color, click-only dropdowns, flat header, avatar fallback. */
.cdm-app-shell-body .sidebar {
  background: #07345f !important;
  background-color: #07345f !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 18px 40px rgba(7, 52, 95, 0.24) !important;
}

.cdm-app-shell-body .accordion-section:hover .accordion-content {
  display: none !important;
}

.cdm-app-shell-body .accordion-content.open,
.cdm-app-shell-body .accordion-section.open .accordion-content {
  display: block !important;
}

.cdm-app-shell-body .app-global-header,
.cdm-app-shell-body .page-header.app-global-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 90 !important;
  margin: 0 -22px 12px !important;
  padding: 18px 22px !important;
  border-radius: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-top: 0 !important;
  box-shadow: none !important;
  background: #f5f7fa !important;
}

.first-timer-photo-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.first-timer-avatar {
  background: #e2e8f0 !important;
  color: var(--primary-color, #07345f) !important;
}

.first-timer-avatar i {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  color: var(--primary-color, #07345f) !important;
  font-size: 1.1rem;
}

.first-timer-avatar-large i {
  font-size: 2.25rem !important;
}
