:root {
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --sidebar-bg: #1b3d33;
  --sidebar-bg-hover: #234a3e;
  --sidebar-active: #2d8f5b;
  --sidebar-text: #e8f5ef;
  --sidebar-muted: #9ccfb8;
  --gerig-primary: #1b3d33;
  --gerig-accent: #2d8f5b;
  --topbar-height: 56px;
  --content-bg: #f4f7f5;
  --card-radius: 12px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --gerig-ink: #16352c;
  --gerig-soft: #e8f3ed;
  --gerig-line: #d7e5dd;
  --gerig-muted: #6b7f76;
}

body {
  background-color: var(--content-bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---- App shell ---- */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.25s ease;
}

.app-content {
  flex: 1;
  padding: 1.25rem 1.5rem 2rem;
}

.app-content > .container,
.app-content > .container-fluid {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.app-content > .container.mt-4,
.app-content > .container-fluid.mt-4 {
  margin-top: 0 !important;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  box-shadow: var(--shadow-sm);
}

.app-topbar-toggle {
  color: #333;
  padding: 0.25rem 0.5rem;
  text-decoration: none;
}

.app-topbar-toggle:hover {
  color: var(--sidebar-active);
}

.app-user-badge {
  font-size: 0.9rem;
  color: #495057;
  background: #f1f3f5;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
}

.app-user-avatar {
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  color: #1b3d33;
  background: #eef3f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(27, 61, 51, 0.08);
}

.app-user-avatar::after {
  display: none; /* esconde seta do dropdown Bootstrap */
}

.app-user-avatar:hover,
.app-user-avatar:focus,
.app-user-avatar[aria-expanded="true"] {
  color: #fff;
  background: var(--sidebar-active);
  box-shadow: none;
}

.app-user-avatar .bi {
  font-size: 1.45rem;
  line-height: 1;
}

.app-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.app-user-menu {
  min-width: 12.5rem;
  border: 0;
  border-radius: 0.75rem;
  padding: 0.4rem;
  margin-top: 0.35rem !important;
}

.app-user-menu .dropdown-header {
  font-weight: 600;
  color: #1b3d33;
  padding: 0.45rem 0.75rem;
}

.app-user-menu .dropdown-item {
  border-radius: 0.5rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.92rem;
}

.app-user-menu .dropdown-item .bi {
  opacity: 0.85;
}

.app-user-menu .dropdown-divider {
  margin: 0.3rem 0.35rem;
}

.app-footer {
  padding: 0.75rem 1.5rem;
  font-size: 0.8rem;
  color: #868e96;
  border-top: 1px solid #e9ecef;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-footer a {
  color: #495057;
  text-decoration: none;
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: 1030;
  transition: width 0.25s ease, transform 0.25s ease;
  overflow: hidden;
}

.sidebar-brand {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
}

.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar-active);
  border-radius: 10px;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.sidebar-brand-logo {
  display: block;
  max-width: 100%;
  max-height: 52px;
  margin: 0 auto;
}

.sidebar-brand-tagline {
  margin-top: 0.45rem;
  font-size: 0.62rem;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--sidebar-muted);
  text-align: center;
  white-space: normal;
}

.sidebar-brand-link:has(.sidebar-brand-logo) {
  display: block;
  text-align: center;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 0.65rem;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.sidebar-section {
  margin-bottom: 0.5rem;
}

.sidebar-section-title {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sidebar-muted);
  padding: 0.5rem 0.75rem 0.35rem;
  white-space: nowrap;
}

.sidebar-link,
.sidebar-sublink,
.sidebar-group-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  margin: 2px 0;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.sidebar-link i,
.sidebar-sublink i,
.sidebar-group-toggle i:first-child {
  font-size: 1.15rem;
  width: 1.35rem;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link:hover,
.sidebar-sublink:hover,
.sidebar-group-toggle:hover {
  background: var(--sidebar-bg-hover);
  color: #fff;
}

.sidebar-link.active,
.sidebar-sublink.active,
.sidebar-group-toggle.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
}

.sidebar-link-danger {
  color: #ffb4b4;
}

.sidebar-link-danger:hover {
  background: rgba(220, 53, 69, 0.25);
  color: #fff;
}

.sidebar-group-toggle .sidebar-chevron {
  margin-left: auto;
  font-size: 0.75rem;
  transition: transform 0.2s;
}

.sidebar-group-toggle[aria-expanded="true"] .sidebar-chevron {
  transform: rotate(180deg);
}

.sidebar-submenu {
  padding-left: 0.35rem;
}

.sidebar-sublink {
  padding-left: 2.35rem;
  font-size: 0.85rem;
}

.sidebar-footer {
  padding: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1025;
}

/* Collapsed (desktop) */
body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed);
}

body.sidebar-collapsed .app-main {
  margin-left: var(--sidebar-collapsed);
}

body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-brand-tagline {
  display: none;
}

body.sidebar-collapsed .sidebar-brand-logo {
  max-height: 36px;
}
body.sidebar-collapsed .sidebar-link span,
body.sidebar-collapsed .sidebar-sublink span,
body.sidebar-collapsed .sidebar-group-toggle span,
body.sidebar-collapsed .sidebar-section-title,
body.sidebar-collapsed .sidebar-chevron {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

body.sidebar-collapsed .sidebar-group-toggle {
  justify-content: center;
}

body.sidebar-collapsed .sidebar-submenu {
  display: none !important;
}

body.sidebar-collapsed .sidebar-link,
body.sidebar-collapsed .sidebar-sublink,
body.sidebar-collapsed .sidebar-group-toggle {
  justify-content: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

/* Mobile */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    width: min(var(--sidebar-width), 88vw);
    transition: transform 0.25s ease;
  }

  .app-main {
    margin-left: 0;
  }

  .app-content {
    padding: 0.85rem 0.85rem 1.5rem;
  }

  .app-topbar {
    padding: 0 0.75rem;
    height: 52px;
  }

  .app-topbar-toggle {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .app-user-avatar {
    width: 42px;
    height: 42px;
  }

  .sidebar-link,
  .sidebar-sublink,
  .sidebar-group-toggle {
    min-height: 44px;
    padding: 0.65rem 0.85rem;
  }

  .sidebar-overlay {
    background: rgba(15, 23, 20, 0.5);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
  }

  body.sidebar-mobile-open {
    overflow: hidden;
  }

  body.sidebar-mobile-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-mobile-open .sidebar-overlay {
    display: block;
  }

  body.sidebar-collapsed .sidebar {
    width: min(var(--sidebar-width), 88vw);
    transform: translateX(-100%);
  }

  body.sidebar-collapsed.sidebar-mobile-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-collapsed .app-main {
    margin-left: 0;
  }

  /* Menos “flutuar” de card no toque */
  .card:hover {
    box-shadow: var(--shadow-sm);
  }
}

/* ---- Cards & dashboard ---- */
.card {
  border: none;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.container .card.shadow-sm {
  box-shadow: var(--shadow-sm) !important;
}

h1, h2, h3, .h2 {
  font-weight: 700;
  color: #212529;
}

.page-header {
  margin-bottom: 1.25rem;
}

.page-header h2 {
  margin-bottom: 0.25rem;
}

/* ---- GERIG login (SaaS) ---- */
.gerig-login-body {
  background: linear-gradient(135deg, #f4f7f5 0%, #e8f0ec 100%);
  min-height: 100vh;
}

.gerig-login-wrap {
  display: flex;
  min-height: 100vh;
}

.gerig-login-brand {
  flex: 1;
  display: none;
  background: linear-gradient(160deg, var(--gerig-primary) 0%, #0f2922 100%);
  color: #fff;
  padding: 3rem;
}

.gerig-login-brand-inner {
  max-width: 420px;
  margin: auto;
}

.gerig-login-logo {
  max-width: 280px;
  width: 100%;
  margin-bottom: 1.5rem;
}

.gerig-login-name {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.gerig-login-tagline {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.9;
  margin-bottom: 1rem;
}

.gerig-login-desc {
  opacity: 0.85;
  line-height: 1.5;
  margin-bottom: 2rem;
}

.gerig-modules-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.gerig-modules-preview span {
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
}

.gerig-login-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1.5rem;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.gerig-login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 2rem 1.75rem;
}

.gerig-login-igreja {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e9ecef;
  font-weight: 600;
  color: var(--gerig-primary);
}

.gerig-login-igreja-logo {
  max-height: 40px;
}

.btn-gerig {
  background: var(--gerig-primary);
  border-color: var(--gerig-primary);
  color: #fff;
}

.btn-gerig:hover {
  background: var(--gerig-accent);
  border-color: var(--gerig-accent);
  color: #fff;
}

@media (min-width: 992px) {
  .gerig-login-brand {
    display: flex;
    align-items: center;
  }

  .gerig-login-panel {
    max-width: none;
    margin: 0;
    padding: 3rem;
  }
}

/* ---- GERIG home (layout alinhado aos screenshots) ---- */
.gerig-home {
  max-width: 1180px;
}

.gerig-home-hero {
  background: transparent;
  border-radius: 0;
  padding: 0.35rem 0 0.5rem;
  box-shadow: none;
  border: none;
  color: inherit;
}

.gerig-home-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gerig-accent);
}

.gerig-home-title {
  font-size: clamp(1.75rem, 2.5vw, 2.35rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--gerig-primary);
  line-height: 1.15;
}

.gerig-home-subtitle {
  color: var(--gerig-muted);
  font-size: 1.05rem;
  max-width: 36rem;
}

.gerig-home-igreja-logo {
  max-height: 56px;
  border-radius: 10px;
}

.gerig-home-igreja-name {
  font-weight: 700;
  color: var(--gerig-primary);
  font-size: 0.95rem;
}

.gerig-module-grid {
  margin-top: 0.25rem;
}

.gerig-module-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
  background: #fff;
  border-radius: 18px;
  padding: 1.35rem 1.35rem 1.25rem;
  box-shadow: 0 10px 28px rgba(7, 67, 54, 0.06);
  border: 1px solid var(--gerig-line);
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  min-height: 100%;
  overflow: hidden;
}

.gerig-module-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(7, 67, 54, 0.1);
  border-color: #b9ddd4;
}

.gerig-module-icon {
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--gerig-soft);
  color: var(--gerig-accent);
  font-size: 1.35rem;
  line-height: 1;
}

.gerig-module-body {
  flex: 1;
  padding-right: 1.5rem;
}

.gerig-module-title {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
  font-weight: 750;
  color: var(--gerig-primary);
  letter-spacing: -0.01em;
}

.gerig-module-desc {
  margin: 0;
  color: var(--gerig-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.gerig-module-arrow {
  position: absolute;
  right: 1.15rem;
  bottom: 1.15rem;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--gerig-accent);
  background: var(--gerig-soft);
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.gerig-module-card:hover .gerig-module-arrow {
  background: var(--gerig-accent);
  color: #fff;
}

/* Login legado */
.painel {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  padding: 36px 28px;
  max-width: 460px;
  margin: 64px auto;
}

.logo-igreja {
  max-height: 85px;
  margin-bottom: 8px;
}

.painel h2 {
  font-size: 1.5rem;
  color: #18612b;
  margin-bottom: 12px;
}

.btn-painel {
  margin-bottom: 15px;
  font-size: 1.12rem;
}

.creditos {
  color: #888;
  font-size: 0.95em;
  margin-top: 18px;
}

.titulo-grafico {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #495057;
}

.gerig-chart-card {
  min-height: 300px;
  position: relative;
}

.gerig-chart-card canvas {
  max-height: 240px;
}

.ui-autocomplete {
  z-index: 3000 !important;
}

/* Tables */
.table {
  font-size: 0.9rem;
}

/* Tabulator (ex-DataTables) */
.gerig-tabulator-toolbar {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid #e4ece8;
  background: #fff;
}

.gerig-tabulator-search {
  max-width: 280px;
  flex: 1 1 200px;
}

.gerig-tabulator-search .form-control {
  min-height: 40px;
  border-color: var(--gerig-line);
  border-radius: 0 0.65rem 0.65rem 0;
}

.gerig-tabulator-search .input-group-text {
  border-color: var(--gerig-line);
  border-radius: 0.65rem 0 0 0.65rem;
  background: var(--gerig-soft);
  color: var(--gerig-accent);
}

.listagem-table-wrap .gerig-tabulator,
.listagem-card .gerig-tabulator {
  font-size: 0.9rem;
  border: none;
  background: #fff;
}

.gerig-tabulator .tabulator-header {
  min-height: 44px;
  background: #f3f8f5;
  border-bottom: 1px solid var(--gerig-line);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  color: #496158;
}

.gerig-tabulator .tabulator-col {
  background: transparent !important;
  border-right: none !important;
}

.gerig-tabulator .tabulator-row {
  min-height: 48px;
  border-bottom: 1px solid #edf2ef;
  background: #fff;
  transition: background-color 0.15s ease;
}

.gerig-tabulator .tabulator-row.tabulator-row-even {
  background: #fcfdfc;
}

.gerig-tabulator .tabulator-row:hover {
  background-color: #f0f7f3 !important;
}

.gerig-tabulator .tabulator-loader,
.gerig-tabulator .tabulator-alert {
  background: rgba(255, 255, 255, 0.58) !important;
}

.gerig-tabulator .tabulator-loader .tabulator-loader-msg,
.gerig-tabulator .tabulator-alert .tabulator-alert-msg,
.gerig-tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-msg,
.gerig-tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-error {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0.75rem !important;
  background: transparent !important;
  color: var(--gerig-primary) !important;
  font-size: 0.9rem;
  box-shadow: none !important;
}

.gerig-table-loader {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--gerig-line);
  border-radius: 0.75rem;
  background: #fff;
  color: var(--gerig-primary);
  font-weight: 650;
  box-shadow: 0 8px 22px rgba(22, 53, 44, 0.1);
}

.gerig-table-loader .gerig-loader-icon {
  color: var(--gerig-accent);
  font-size: 1.15rem;
  animation: gerig-loader-spin 0.8s linear infinite;
}

.gerig-table-loader-error {
  border-color: #efd0d4;
  background: #fff7f8;
  color: #b02a37;
}

.gerig-table-loader-error i {
  font-size: 1.1rem;
}

@keyframes gerig-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gerig-table-loader .gerig-loader-icon {
    animation: none;
  }
}

.gerig-tabulator .tabulator-cell {
  padding: 0.66rem 0.85rem;
  border-right: none !important;
  color: #354b43;
  vertical-align: middle;
}

.gerig-tabulator .tabulator-footer {
  background: #f9fbfa;
  border-top: 1px solid var(--gerig-line);
  padding: 0.65rem 0.85rem;
}

.gerig-tabulator .tabulator-footer .tabulator-footer-contents {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  width: 100%;
}

.gerig-tabulator .tabulator-paginator {
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-start;
  margin-left: auto;
}

.gerig-tabulator .tabulator-page {
  min-width: 2.15rem;
  min-height: 2.15rem;
  border: 1px solid #cbdad3 !important;
  border-radius: 0.55rem !important;
  background: #fff !important;
  color: #4c645b !important;
}

.gerig-tabulator .tabulator-page:hover:not(:disabled),
.gerig-tabulator .tabulator-page.active {
  border-color: var(--gerig-accent) !important;
  background: var(--gerig-accent) !important;
  color: #fff !important;
}

.gerig-drawer .gerig-tabulator .tabulator-footer .tabulator-page-counter,
.gerig-drawer .gerig-tabulator .tabulator-footer label {
  font-size: 0.8rem;
  white-space: normal;
}

/* Documentos do membro — lista em cards (drawer/mobile) */
.gerig-doc-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.gerig-doc-empty {
  padding: 0.85rem 1rem;
  background: #f8f9fa;
  border-radius: 10px;
  font-size: 0.9rem;
}

.gerig-doc-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(7, 67, 54, 0.03);
}

.gerig-doc-item-icon {
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  background: #e8f5e9;
  color: #2e7d32;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.gerig-doc-item-body {
  flex: 1 1 auto;
  min-width: 0;
}

.gerig-doc-item-tipo {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6c757d;
}

.gerig-doc-item-nome {
  font-weight: 600;
  color: #1b4332;
  word-break: break-word;
  margin-top: 0.1rem;
}

.gerig-doc-item-desc {
  font-size: 0.85rem;
  color: #6c757d;
  margin-top: 0.15rem;
}

.gerig-doc-item-meta {
  font-size: 0.8rem;
  color: #868e96;
  margin-top: 0.35rem;
}

.gerig-doc-item-acoes {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.gerig-doc-item-acoes .btn span {
  margin-left: 0.2rem;
}

.gerig-doc-upload {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px dashed #dee2e6;
}

@media (max-width: 576px) {
  .gerig-doc-item {
    flex-wrap: wrap;
  }

  .gerig-doc-item-acoes {
    width: 100%;
    justify-content: stretch;
  }

  .gerig-doc-item-acoes .btn {
    flex: 1 1 auto;
  }

  .gerig-dizimos-table-wrap {
    margin: 0 -0.15rem;
  }
}

.gerig-tabulator .tabulator-responsive-collapse {
  background: #f8faf9;
  border-top: 1px dashed #dee2e6;
}

.gerig-tabulator .tabulator-responsive-collapse td {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.gerig-tabulator .tabulator-responsive-collapse strong {
  display: inline-block;
  min-width: 7rem;
  color: #6c757d;
  font-weight: 600;
}

.gerig-collapse-panel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.15rem 0;
}

.gerig-collapse-fields {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.gerig-collapse-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  align-items: baseline;
}

.gerig-collapse-row strong {
  min-width: 6.5rem;
  color: #6c757d;
  font-weight: 600;
  font-size: 0.8rem;
}

.gerig-collapse-value {
  flex: 1 1 8rem;
  color: #212529;
}

.gerig-collapse-acoes {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.5rem;
  margin-top: 0.25rem;
  border-top: 1px solid #e9ecef;
}

.gerig-collapse-acoes > strong {
  min-width: 0;
  font-size: 0.8rem;
  color: #6c757d;
}

.gerig-collapse-acoes-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.gerig-collapse-acoes-btns .btn-group,
.gerig-collapse-acoes-btns .gerig-acoes-btns {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.gerig-collapse-acoes-btns .btn {
  margin: 0;
  min-width: 2.25rem;
  min-height: 2.25rem;
}

/* Toggle de expandir colunas ocultas — chevron em vez de +/- */
.gerig-tabulator .gerig-col-collapse .tabulator-responsive-collapse-toggle,
.gerig-tabulator .tabulator-responsive-collapse-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 1.75rem !important;
  height: 1.75rem !important;
  margin: 0 auto;
  border-radius: 8px !important;
  background: #2e7d32 !important;
  color: #fff;
  cursor: pointer;
  opacity: 1 !important;
  visibility: visible !important;
  font-size: 1rem !important;
  position: relative;
}

.gerig-tabulator .tabulator-responsive-collapse-toggle svg {
  display: none !important;
}

.gerig-tabulator .tabulator-responsive-collapse-toggle::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
  margin-left: -1px;
  transition: transform 0.15s ease;
}

.gerig-tabulator .tabulator-responsive-collapse-toggle.open::after {
  transform: rotate(45deg);
  margin-top: -2px;
  margin-left: 0;
}

.gerig-tabulator .tabulator-responsive-collapse-toggle:hover {
  background: #1b5e20 !important;
  opacity: 1 !important;
}

.gerig-tabulator .gerig-col-primary {
  font-weight: 600;
  color: #1b4332;
}

.gerig-tabulator .tabulator-col.gerig-col-acoes,
.gerig-tabulator .tabulator-cell.gerig-col-acoes {
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.gerig-tabulator .tabulator-cell.gerig-col-acoes .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.45rem;
  margin: 0;
  flex-shrink: 0;
  vertical-align: middle;
}

.gerig-acoes-btns {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
}

.gerig-tabulator .gerig-action-btn,
.gerig-collapse-acoes-btns .gerig-action-btn {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0 !important;
  padding: 0.38rem 0.55rem !important;
  border-width: 1px !important;
  border-radius: 0.55rem !important;
  font-weight: 600;
  line-height: 1;
  box-shadow: none !important;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.gerig-tabulator .gerig-action-btn:hover,
.gerig-collapse-acoes-btns .gerig-action-btn:hover {
  transform: translateY(-1px);
}

.gerig-tabulator .gerig-action-icon-only,
.gerig-collapse-acoes-btns .gerig-action-icon-only {
  width: 34px;
  padding: 0 !important;
}

.gerig-tabulator .gerig-action-edit,
.gerig-collapse-acoes-btns .gerig-action-edit {
  border-color: var(--gerig-accent) !important;
  background: var(--gerig-accent) !important;
  color: #fff !important;
}

.gerig-tabulator .gerig-action-view,
.gerig-collapse-acoes-btns .gerig-action-view,
.gerig-tabulator .gerig-action-neutral,
.gerig-collapse-acoes-btns .gerig-action-neutral {
  border-color: #bfd1c8 !important;
  background: #fff !important;
  color: #466158 !important;
}

.gerig-tabulator .gerig-action-pdf,
.gerig-collapse-acoes-btns .gerig-action-pdf {
  border-color: #e5aab0 !important;
  background: #fff5f6 !important;
  color: #bf3442 !important;
}

.gerig-tabulator .gerig-action-danger,
.gerig-collapse-acoes-btns .gerig-action-danger {
  border-color: #dc3545 !important;
  background: #dc3545 !important;
  color: #fff !important;
}

.gerig-tabulator .gerig-action-success,
.gerig-collapse-acoes-btns .gerig-action-success {
  border-color: #7fba98 !important;
  background: #edf8f1 !important;
  color: #237a49 !important;
}

.gerig-tabulator .gerig-action-warning,
.gerig-collapse-acoes-btns .gerig-action-warning {
  border-color: #dfbd68 !important;
  background: #fff8e6 !important;
  color: #8a6410 !important;
}

.gerig-collapse-acoes-btns .gerig-acoes-btns {
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .gerig-tabulator .gerig-col-primary {
    min-width: 0 !important;
  }

  .listagem-table-wrap .gerig-tabulator .tabulator-cell {
    padding: 0.5rem 0.45rem;
  }

  /* Mobile: ações nunca na linha — só no painel após expandir */
  .gerig-tabulator .tabulator-col.gerig-col-acoes,
  .gerig-tabulator .tabulator-cell.gerig-col-acoes {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    border: none !important;
    overflow: hidden !important;
    visibility: hidden !important;
  }

  .gerig-tabulator .tabulator-cell.gerig-col-primary {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
}

/* Preview de anexo sobre o drawer */
#gerigPreviewModal {
  z-index: 2100;
}
.modal-backdrop.gerig-anexo-preview-backdrop {
  z-index: 2090;
}

/* ---- Listagens padronizadas ---- */
.page-listagem .page-subtitle {
  font-size: 0.9rem;
  color: var(--gerig-muted) !important;
}

.listagem-card {
  border: 1px solid var(--gerig-line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(7, 67, 54, 0.05);
  background: #fff;
}

.listagem-card:hover {
  box-shadow: 0 14px 32px rgba(7, 67, 54, 0.08);
}

.listagem-table-wrap {
  padding: 0;
}

.listagem-table {
  margin-bottom: 0 !important;
}

.listagem-table thead th {
  background: #f8fbf9;
  border-bottom: 1px solid var(--gerig-line);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gerig-muted);
  white-space: nowrap;
  padding: 0.75rem 1rem;
}

.listagem-table tbody td {
  padding: 0.65rem 1rem;
  vertical-align: middle;
}

.listagem-table tbody tr:hover {
  background-color: #f8faf9;
}

.listagem-table-wrap > .gerig-tabulator,
.card-body > .gerig-tabulator {
  padding: 0 0 0.75rem;
}

.listagem-filters {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: var(--card-radius);
  padding: 1rem 1.25rem;
}

.listagem-extra .alert:last-child {
  margin-bottom: 0;
}

/* ---- Modal segmentada ---- */
.modal-form-nav {
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  padding-top: 0.5rem;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.modal-form-nav .nav-link {
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: #6c757d;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.65rem 1rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.modal-form-nav .nav-link:hover {
  color: var(--sidebar-active);
  background: transparent;
}

.modal-form-nav .nav-link.active {
  color: var(--sidebar-active);
  background: transparent;
  border-bottom-color: var(--sidebar-active);
  font-weight: 600;
}

.modal-form-content {
  min-height: 200px;
}

@media (max-width: 575.98px) {
  .page-header-bar {
    gap: 0.65rem !important;
    margin-bottom: 0.85rem !important;
  }

  .page-listagem .page-title {
    font-size: 1.2rem;
    line-height: 1.25;
  }

  .page-listagem .page-subtitle {
    font-size: 0.85rem;
  }

  .listagem-toolbar {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.45rem !important;
    padding-bottom: 0.15rem;
    scrollbar-width: none;
  }

  .listagem-toolbar::-webkit-scrollbar {
    display: none;
  }

  .listagem-toolbar .btn {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 40px;
  }

  .listagem-extra {
    margin-bottom: 0.75rem !important;
  }

  /* KPIs / filtros extras: menos peso na primeira dobra */
  .listagem-extra .row.g-3 > [class*="col-"] .card,
  .listagem-extra .row.g-2 > [class*="col-"] .card {
    margin-bottom: 0;
  }

  .gerig-tabulator-toolbar {
    padding: 0.55rem 0.65rem 0;
    gap: 0.45rem;
  }

  .gerig-tabulator-search {
    max-width: none;
    width: 100%;
  }

  .gerig-tabulator .tabulator-header {
    font-size: 0.72rem;
  }

  .gerig-tabulator .tabulator-cell {
    padding: 0.45rem 0.55rem;
  }

  .gerig-tabulator .tabulator-footer {
    font-size: 0.8rem;
  }

  .listagem-card {
    border-radius: 10px;
  }

  .btn:not(.btn-sm):not(.btn-lg) {
    min-height: 40px;
  }
}

/* ---- Wizard coleta culto ---- */
.wizard-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.wizard-step-item {
  flex: 1 1 auto;
  min-width: 100px;
  text-align: center;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: #f1f3f5;
  color: #6c757d;
  font-size: 0.85rem;
  font-weight: 500;
}

.wizard-step-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #dee2e6;
  color: #495057;
  font-size: 0.75rem;
  margin-right: 0.35rem;
}

.wizard-step-item.active {
  background: #e8f5e9;
  color: var(--sidebar-active);
  font-weight: 600;
}

.wizard-step-item.active span {
  background: var(--sidebar-active);
  color: #fff;
}

.wizard-step-item.done {
  background: #f8f9fa;
  color: #198754;
}

.wizard-step-item.done span {
  background: #198754;
  color: #fff;
}

.wizard-pane {
  display: none;
}

.wizard-pane.active {
  display: block;
}

.recibo-preview .recibo-card,
.recibo-print-area .recibo-card {
  border: 2px solid #333;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  background: #fff;
  max-width: 800px;
  margin: 0 auto;
}

.recibo-card-titulo {
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.recibo-card-igreja {
  text-align: center;
  font-weight: 700;
  color: var(--sidebar-active);
}

.recibo-texto-preview {
  font-size: 0.95rem;
  text-align: justify;
}

.resumo-box {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
}

.resumo-box span {
  display: block;
  font-size: 0.8rem;
  color: #6c757d;
}

.resumo-box strong {
  font-size: 1.1rem;
}

.resumo-box.resumo-total {
  background: #e8f5e9;
  border-color: #c8e6c9;
}

.linha-ass-preview {
  border-top: 1px solid #333;
  margin: 2.5rem 1rem 0.35rem;
}

.coleta-page-tabs .nav-link {
  font-weight: 500;
  color: #6c757d;
}

.coleta-page-tabs .nav-link.active {
  color: var(--sidebar-active);
  font-weight: 600;
}

@media (max-width: 767.98px) {
  .page-listagem .wizard-coleta .card-body {
    padding: 1rem !important;
  }

  .wizard-steps {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
    margin-bottom: 1rem !important;
  }

  .wizard-step-item {
    flex: 0 0 auto;
    min-width: 88px;
    font-size: 0.75rem;
    padding: 0.45rem 0.5rem;
  }

  .wizard-step-item span {
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
  }

  .wizard-coleta .wizard-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.96);
    padding: 0.75rem 0;
    margin: 0 -0.25rem;
    border-top: 1px solid #e9ecef;
  }

  .wizard-coleta .wizard-actions .btn {
    min-height: 44px;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .wizard-coleta #btnAddDizimo {
    min-height: 44px;
    margin-top: 0.25rem;
  }

  .wizard-coleta .table-responsive {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
  }

  .coleta-page-tabs .nav-link {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
  }

  #w_resultados_membro {
    max-height: 40vh !important;
  }
}

/* ---- Carteirinha de membro (prévia na tela) ---- */
.carteirinha-preview-shell {
  width: 260px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  background: #fff;
}

.carteirinha-preview-shell .card {
  width: 100%;
  min-height: 410px;
}

.carteirinha-preview-shell .faixa-titulo {
  font-size: 11px;
  padding: 7px 8px;
}

.carteirinha-preview-shell .card-corpo {
  padding: 14px 14px 16px;
}

.carteirinha-preview-shell .logo-wrap img {
  max-height: 42px;
  max-width: 180px;
}

.carteirinha-preview-shell .foto-wrap,
.carteirinha-preview-shell .foto-membro,
.carteirinha-preview-shell .foto-placeholder {
  width: 88px;
  height: 88px;
}

.carteirinha-preview-shell .foto-placeholder {
  padding-top: 34px;
  font-size: 9px;
}

.carteirinha-preview-shell .nome-membro {
  font-size: 15px !important;
}

.carteirinha-preview-shell .oficio-membro {
  font-size: 11px;
  padding: 3px 10px;
}

.carteirinha-preview-shell .campo-lbl {
  font-size: 9px;
}

.carteirinha-preview-shell .campo-val {
  font-size: 11px;
}

.carteirinha-preview-shell .rodape-linha {
  font-size: 10px;
}

/* ---- GERIG UI moderna (padrão sistema) ---- */
.gerig-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, #1b3d33 0%, #245a47 55%, #2d8f5b 100%);
  border-radius: 1rem;
  color: #fff;
  padding: 1.2rem 1.35rem;
  box-shadow: var(--shadow-sm);
}

.gerig-banner-title,
.gerig-banner h1,
.gerig-banner h2,
.gerig-banner h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 650;
  color: #fff !important;
  line-height: 1.25;
}

.gerig-banner-title .bi,
.gerig-banner h1 .bi,
.gerig-banner h2 .bi,
.gerig-banner h3 .bi {
  color: #fff !important;
  margin-right: 0.35rem;
}

.gerig-banner-subtitle,
.gerig-banner p {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.88) !important;
  font-size: 0.9rem;
}

.gerig-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.gerig-banner-actions .btn-light {
  border: none;
}

.gerig-banner-actions .btn-outline-light:hover {
  color: var(--gerig-primary);
}

/* Home: layout claro (como nos screenshots do site) */
.gerig-home-hero {
  background: transparent;
  border-radius: 0;
  padding: 0.35rem 0 0.5rem;
  box-shadow: none;
  border: none;
  color: inherit;
}

.gerig-home-kicker {
  color: var(--gerig-accent);
}

.gerig-home-title,
.gerig-home-title.h3,
.gerig-home-hero h1,
.gerig-home-hero .h3 {
  color: var(--gerig-primary) !important;
}

.gerig-home-title .bi,
.gerig-home-hero .bi {
  color: var(--gerig-accent) !important;
}

.gerig-home-subtitle,
.gerig-home-hero p {
  color: var(--gerig-muted) !important;
}

.gerig-home-igreja-name {
  color: var(--gerig-primary);
}

.gerig-toolbar {
  background: #fff;
  border: 1px solid var(--gerig-line);
  border-radius: 0.9rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.gerig-toolbar .form-label {
  color: var(--gerig-muted);
  font-weight: 600;
}

.gerig-metric {
  background: #fff;
  border: 1px solid var(--gerig-line);
  border-radius: 18px;
  padding: 1.05rem 1.15rem;
  height: 100%;
  display: flex;
  gap: 0.9rem;
  align-items: center;
  box-shadow: 0 10px 28px rgba(7, 67, 54, 0.05);
}

.gerig-metric-icon {
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  background: var(--gerig-soft);
  color: var(--gerig-accent);
}

.gerig-metric-icon.is-ok { background: #e7f7ee; color: #1f7a4d; }
.gerig-metric-icon.is-warn { background: #fff4df; color: #a56a00; }
.gerig-metric-icon.is-info { background: #e8f4ff; color: #1d6fa5; }
.gerig-metric-icon.is-muted { background: #eef1f0; color: #5f6d68; }
.gerig-metric-icon.is-danger { background: #fdecec; color: #b42318; }
.gerig-metric-icon.is-accent { background: var(--gerig-soft); color: #1b3d33; }

.gerig-metric .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gerig-muted);
}

.gerig-metric .value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gerig-ink);
  line-height: 1.1;
}

.gerig-panel {
  background: #fff;
  border: 1px solid var(--gerig-line);
  border-radius: 18px;
  overflow: hidden;
  height: 100%;
  box-shadow: 0 10px 28px rgba(7, 67, 54, 0.05);
}

.gerig-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--gerig-line);
  background: #fbfdfc;
}

.gerig-panel-head h4,
.gerig-panel-head h5,
.gerig-panel-head .titulo-grafico {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--gerig-ink);
}

.gerig-panel-head .bi {
  color: var(--gerig-accent);
  margin-right: 0.25rem;
}

.gerig-panel-head .hint {
  font-size: 0.78rem;
  color: var(--gerig-muted);
}

.gerig-panel-body {
  padding: 1rem 1.1rem;
}

.gerig-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gerig-muted);
  border-bottom-color: var(--gerig-line);
  background: #f8fbf9;
  white-space: nowrap;
}

.gerig-table td {
  vertical-align: middle;
  border-color: #eef3f0;
}

.gerig-assid {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 7.5rem;
}

.gerig-assid .track {
  flex: 1;
  height: 0.4rem;
  border-radius: 999px;
  background: #e8eeea;
  overflow: hidden;
}

.gerig-assid .fill {
  height: 100%;
  border-radius: inherit;
}

.gerig-assid .pct {
  font-size: 0.8rem;
  font-weight: 650;
  min-width: 2.6rem;
  text-align: right;
}

.page-header-bar {
  background: #fff;
  border: 1px solid var(--gerig-line);
  border-radius: 18px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 10px 28px rgba(7, 67, 54, 0.05);
}

.page-listagem .page-title {
  font-size: 1.4rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  color: var(--gerig-ink);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.2rem;
}

.page-listagem .page-title .bi {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  background: var(--gerig-soft);
  color: var(--gerig-accent);
  margin-right: 0;
  font-size: 1.1rem;
}

.page-header-bar .text-muted {
  color: var(--gerig-muted) !important;
}

.page-listagem .card.border-0.shadow-sm > .card-body.py-2 {
  border: 1px solid var(--gerig-line);
  border-radius: 0.9rem;
  background: #fff;
}

.page-listagem .nav-tabs {
  border-bottom-color: var(--gerig-line);
  gap: 0.15rem;
}

.page-listagem .nav-tabs .nav-link {
  border-radius: 0.65rem 0.65rem 0 0;
  color: var(--gerig-muted);
  font-weight: 600;
}

.page-listagem .nav-tabs .nav-link.active {
  color: var(--gerig-primary);
  border-color: var(--gerig-line) var(--gerig-line) #fff;
  background: #fff;
}

.gerig-panel .table {
  margin-bottom: 0;
}

.gerig-chart-card .titulo-grafico {
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--gerig-ink);
  margin-bottom: 0.85rem;
}

/* ---- Listagem estilo mockup (Membros) ---- */
.gerig-list-page {
  max-width: 1180px;
}

.gerig-list-title {
  margin: 0;
  font-size: clamp(1.55rem, 2.2vw, 1.9rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--gerig-primary);
}

.gerig-list-subtitle {
  color: var(--gerig-muted);
  font-size: 0.98rem;
}

.gerig-kpi-card {
  display: flex;
  align-items: flex-start;
  gap: 0.95rem;
  background: #fff;
  border: 1px solid var(--gerig-line);
  border-radius: 18px;
  padding: 1.15rem 1.25rem;
  box-shadow: 0 10px 28px rgba(7, 67, 54, 0.05);
  height: 100%;
}

.gerig-kpi-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--gerig-soft);
  color: var(--gerig-accent);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.gerig-kpi-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--gerig-muted);
}

.gerig-kpi-value {
  font-size: 1.85rem;
  font-weight: 750;
  line-height: 1.1;
  color: var(--gerig-primary);
}

.gerig-kpi-suffix {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gerig-muted);
}

.gerig-kpi-bar {
  height: 8px;
  border-radius: 999px;
  background: #e8eeeb;
  overflow: hidden;
}

.gerig-kpi-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2d8f5b, #3aa86c);
}

.gerig-kpi-hint {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--gerig-muted);
}

.gerig-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

[id$="MobileWrap"] > .gerig-list-toolbar {
  margin-bottom: 0.75rem;
}

[id$="MobileWrap"] > .gerig-list-toolbar .gerig-list-search {
  flex: 1 1 100%;
  min-width: 100%;
}

.gerig-list-search {
  position: relative;
  min-width: min(100%, 280px);
  flex: 0 1 280px;
}

.gerig-list-search > .bi {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gerig-muted);
  pointer-events: none;
}

.gerig-list-search .form-control {
  padding-left: 2.35rem;
  border-radius: 12px;
  border-color: var(--gerig-line);
  min-height: 42px;
}

.gerig-list-search .form-control:focus {
  border-color: #8fc5ab;
  box-shadow: 0 0 0 0.2rem rgba(45, 143, 91, 0.12);
}

.gerig-person {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.gerig-avatar {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--gerig-soft);
  color: var(--gerig-primary);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.gerig-person-text {
  min-width: 0;
}

.gerig-person-name {
  font-weight: 700;
  color: var(--gerig-ink);
  line-height: 1.25;
}

.gerig-person-meta {
  font-size: 0.78rem;
  color: var(--gerig-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.gerig-oficio {
  color: var(--gerig-ink);
  font-weight: 600;
  font-size: 0.92rem;
}

.gerig-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.gerig-pill.is-ok {
  background: #e7f7ee;
  color: #1f7a4d;
}

.gerig-pill.is-warn {
  background: #fff4df;
  color: #a56a00;
}

.gerig-pill.is-info {
  background: #e8f4ff;
  color: #1d6fa5;
}

.gerig-pill.is-muted {
  background: #eef1f0;
  color: #5f6d68;
}

.gerig-pill.is-danger {
  background: #fdecec;
  color: #b42318;
}

.gerig-more-btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--gerig-line);
  color: var(--gerig-muted);
}

/* Desktop: linha clicável abre edição */
.gerig-membros-desktop-table .tabulator-row {
  cursor: pointer;
}

.gerig-membros-desktop-table .tabulator-row:hover {
  background: #f4faf7;
}

/* KPIs compactos (dízimos no drawer) */
.gerig-kpi-card-sm {
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 0.75rem;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(7, 67, 54, 0.04);
  text-align: center;
  align-items: center;
}

.gerig-kpi-card-sm .gerig-kpi-label {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.gerig-kpi-card-sm .gerig-kpi-value {
  font-size: clamp(0.95rem, 3.2vw, 1.25rem);
  word-break: break-word;
}

.gerig-dizimo-kpis .gerig-kpi-card-sm {
  border-left: 3px solid var(--gerig-accent);
}

.gerig-dizimo-kpis .col-4:nth-child(2) .gerig-kpi-card-sm {
  border-left-color: #3b82f6;
}

.gerig-dizimo-kpis .col-4:nth-child(3) .gerig-kpi-card-sm {
  border-left-color: #6b7280;
}

/* Cards de listagem (mobile dual list) */
.gerig-list-cards,
.gerig-member-cards {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.gerig-list-card,
.gerig-member-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.95rem 1rem;
  background: #fff;
  border: 1px solid var(--gerig-line);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(7, 67, 54, 0.04);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.gerig-list-card:active,
.gerig-member-card:active {
  transform: scale(0.985);
}

.gerig-list-card:focus-visible,
.gerig-member-card:focus-visible {
  outline: 2px solid #8fc5ab;
  outline-offset: 2px;
}

.gerig-list-card-main,
.gerig-member-card-main {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 auto;
}

.gerig-list-card-body,
.gerig-member-card-body {
  min-width: 0;
  flex: 1 1 auto;
}

.gerig-list-card-name,
.gerig-member-card-name {
  font-weight: 700;
  color: var(--gerig-ink);
  font-size: 1rem;
  line-height: 1.3;
  margin-bottom: 0.45rem;
}

.gerig-list-card-meta {
  font-size: 0.82rem;
  color: var(--gerig-muted);
  margin-bottom: 0.4rem;
}

.gerig-list-card-tags,
.gerig-member-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  align-items: center;
}

.gerig-list-chip,
.gerig-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gerig-muted);
  background: #f4f7f5;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  max-width: 100%;
}

.gerig-list-chip i,
.gerig-member-chip i {
  font-size: 0.8rem;
  opacity: 0.85;
}

.gerig-list-card-chevron,
.gerig-member-card-chevron {
  flex: 0 0 auto;
  color: var(--gerig-muted);
  font-size: 1.1rem;
  opacity: 0.7;
}

.gerig-list-empty,
.gerig-member-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--gerig-muted);
  background: #fff;
  border: 1px dashed var(--gerig-line);
  border-radius: 14px;
}

.gerig-list-pagination,
.gerig-member-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 0.85rem;
  padding: 0.25rem 0.15rem 0.5rem;
}

.gerig-list-pageinfo,
.gerig-member-pageinfo {
  font-size: 0.82rem;
  color: var(--gerig-muted);
}

.gerig-list-pager,
.gerig-member-pager {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.gerig-list-page-label,
.gerig-member-page-label {
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--gerig-ink);
  min-width: 3.5rem;
  text-align: center;
}

.gerig-dual-desktop-table .tabulator-row,
.gerig-membros-desktop-table .tabulator-row {
  cursor: pointer;
}

.gerig-dual-desktop-table .tabulator-row:hover,
.gerig-membros-desktop-table .tabulator-row:hover {
  background: #f4faf7;
}

/* Bottom sheet */
body.gerig-sheet-open {
  overflow: hidden;
}

.gerig-sheet {
  position: fixed;
  inset: 0;
  z-index: 1090;
  pointer-events: none;
  visibility: hidden;
}

.gerig-sheet.is-open {
  pointer-events: auto;
  visibility: visible;
}

.gerig-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 35, 28, 0.45);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.gerig-sheet.is-open .gerig-sheet-backdrop {
  opacity: 1;
}

.gerig-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(88vh, 640px);
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 40px rgba(7, 67, 54, 0.18);
  transform: translateY(110%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.gerig-sheet.is-open .gerig-sheet-panel {
  transform: translateY(0);
}

.gerig-sheet-handle {
  width: 2.5rem;
  height: 0.28rem;
  border-radius: 999px;
  background: #d5ddd9;
  margin: 0.55rem auto 0.15rem;
  touch-action: none;
}

.gerig-sheet-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.65rem 1rem 0.95rem;
  border-bottom: 1px solid var(--gerig-line);
  touch-action: none;
}

.gerig-sheet-avatar,
.gerig-sheet-header .gerig-avatar.gerig-sheet-avatar {
  width: 64px;
  height: 64px;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.gerig-sheet-heading {
  min-width: 0;
  flex: 1 1 auto;
}

.gerig-sheet-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--gerig-ink);
  line-height: 1.25;
}

.gerig-sheet-subtitle {
  font-size: 0.82rem;
  color: var(--gerig-muted);
  margin-top: 0.1rem;
}

.gerig-sheet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.gerig-sheet-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: #f3f6f4;
  color: var(--gerig-muted);
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.2;
}

.gerig-sheet-chip i {
  font-size: 0.78rem;
}

.gerig-sheet-chip.is-ok {
  background: #e7f7ee;
  color: #1f7a4d;
}

.gerig-sheet-chip.is-warn {
  background: #fff4df;
  color: #a56a00;
}

.gerig-sheet-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: currentColor;
  flex-shrink: 0;
}

.gerig-sheet-header .btn-close {
  margin-left: auto;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.gerig-sheet-actions {
  display: flex;
  flex-direction: column;
  padding: 0.25rem 0.5rem 0.85rem;
  overflow-y: auto;
}

.gerig-sheet-divider {
  height: 1px;
  background: var(--gerig-line);
  margin: 0.35rem 0.65rem;
}

.gerig-sheet-action {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.85rem 0.85rem;
  border-radius: 12px;
  color: var(--gerig-ink);
  font-weight: 600;
  font-size: 0.98rem;
}

.gerig-sheet-action i {
  width: 1.35rem;
  text-align: center;
  color: var(--gerig-primary);
  font-size: 1.15rem;
}

.gerig-sheet-action.is-primary {
  background: #eef8f2;
  font-weight: 750;
  font-size: 1.02rem;
  padding: 1rem 0.95rem;
}

.gerig-sheet-action.is-primary i {
  font-size: 1.25rem;
}

.gerig-sheet-action:active {
  background: #f3f8f5;
}

.gerig-sheet-action.is-primary:active {
  background: #e2f3ea;
}

.gerig-sheet-action.is-danger {
  color: #b42318;
}

.gerig-sheet-action.is-danger i {
  color: #b42318;
}

.gerig-sheet-badge {
  margin-left: auto;
  min-width: 1.6rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #eef1f0;
  color: var(--gerig-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.gerig-family-cards {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.gerig-family-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  background: #fff;
  border: 1px solid var(--gerig-line);
  border-radius: 12px;
}

.gerig-family-card-body {
  min-width: 0;
  flex: 1 1 auto;
}

.gerig-family-grau {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gerig-muted);
}

.gerig-family-nome {
  font-weight: 700;
  color: var(--gerig-ink);
}

.gerig-family-meta {
  font-size: 0.82rem;
  color: var(--gerig-muted);
  margin-top: 0.15rem;
}

.gerig-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.gerig-timeline-item {
  position: relative;
  padding: 0.85rem 0.95rem 0.85rem 1.1rem;
  background: #fff;
  border: 1px solid var(--gerig-line);
  border-radius: 12px;
  border-left: 3px solid var(--gerig-accent);
}

.gerig-timeline-item.is-demissao {
  border-left-color: #b42318;
}

.gerig-timeline-date {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gerig-muted);
  margin-bottom: 0.2rem;
}

.gerig-timeline-title {
  font-weight: 700;
  color: var(--gerig-ink);
}

.gerig-timeline-obs {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--gerig-muted);
}

@media (min-width: 769px) {
  .gerig-sheet {
    display: none !important;
  }
}

.gerig-more-btn:hover,
.gerig-more-btn:focus {
  color: var(--gerig-primary);
  background: var(--gerig-soft);
  border-color: #b9ddd4;
}

/* Evita que o menu ⋯ (com Excluir) seja cortado pelo card/tabela */
.listagem-card:has(.gerig-row-actions .dropdown-menu.show),
.listagem-table-wrap:has(.gerig-row-actions .dropdown-menu.show),
.gerig-tabulator:has(.gerig-row-actions .dropdown-menu.show),
.gerig-tabulator .tabulator-tableholder:has(.gerig-row-actions .dropdown-menu.show),
.gerig-tabulator .tabulator-row:has(.gerig-row-actions .dropdown-menu.show),
.gerig-tabulator .tabulator-cell:has(.gerig-row-actions .dropdown-menu.show) {
  overflow: visible !important;
}

.gerig-row-actions-menu {
  z-index: 1080;
  min-width: 11.5rem;
}

.gerig-row-actions-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.gerig-row-actions-menu .dropdown-item.text-danger,
.gerig-row-actions-menu .dropdown-item.text-danger:focus,
.gerig-row-actions-menu .dropdown-item.text-danger:hover {
  color: #b42318 !important;
}

.gerig-dot-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.35rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #eef1f0;
  color: #44554e;
  font-size: 0.68rem;
  font-weight: 700;
}

.gerig-list-page .listagem-card {
  border-radius: 18px;
}

.gerig-list-page .gerig-tabulator .tabulator-header {
  background: #f7fbf9;
}

.gerig-list-page .gerig-tabulator .tabulator-row {
  min-height: 3.4rem;
}

.gerig-list-page .btn-success {
  border-radius: 12px;
  min-height: 42px;
  padding-inline: 1rem;
  font-weight: 700;
}

/* ---- Revista digital EBD ---- */
.ebd-quill-host {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0 0 0.5rem 0.5rem;
  min-height: 360px;
}

.ebd-quill-host .ql-editor {
  min-height: 340px;
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #243029;
}

.ebd-quill-host .ql-editor img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 0.75rem 0;
}

.ql-toolbar.ql-snow {
  border-radius: 0.5rem 0.5rem 0 0;
  border-color: #dee2e6;
  background: #f8faf9;
}

.ql-container.ql-snow {
  border-color: #dee2e6;
  border-radius: 0 0 0.5rem 0.5rem;
}

.ebd-revista-shell {
  background: linear-gradient(180deg, #f3f6f4 0%, #eef2ef 40%, #f7f8f7 100%);
}

.ebd-revista-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5f746a;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.ebd-revista-layout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.ebd-revista-sumario {
  position: sticky;
  top: 0.5rem;
  background: #fff;
  border: 1px solid #e2e8e4;
  border-radius: 0.85rem;
  padding: 1rem 1.1rem;
  box-shadow: 0 8px 24px rgba(27, 61, 51, 0.06);
}

.ebd-revista-sumario .titulo {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7f74;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.ebd-revista-sumario ol {
  margin: 0;
  padding-left: 1.1rem;
}

.ebd-revista-sumario li {
  margin-bottom: 0.45rem;
  line-height: 1.35;
}

.ebd-revista-sumario a {
  color: #1b3d33;
  text-decoration: none;
  font-size: 0.9rem;
}

.ebd-revista-sumario a:hover {
  color: #2d8f5b;
  text-decoration: underline;
}

.ebd-artigo {
  background: #fff;
  border: 1px solid #e2e8e4;
  border-radius: 1rem;
  padding: 1.5rem 1.6rem 1.85rem;
  margin-bottom: 1.35rem;
  box-shadow: 0 10px 28px rgba(27, 61, 51, 0.06);
}

.ebd-artigo-meta {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7f74;
  font-weight: 650;
  margin-bottom: 0.45rem;
}

.ebd-artigo-titulo {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  color: #162820;
  margin: 0 0 0.65rem;
}

.ebd-artigo-lead {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.15rem;
  line-height: 1.55;
  color: #44574e;
  margin-bottom: 1.1rem;
}

.ebd-artigo-capa {
  margin: 0 0 1.25rem;
}

.ebd-artigo-capa img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: 0.75rem;
  display: block;
}

.ebd-conteudo-aula {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  line-height: 1.8;
  color: #243029;
  max-width: 46rem;
}

.ebd-conteudo-aula > *:first-child {
  margin-top: 0;
}

.ebd-conteudo-aula p {
  margin-bottom: 1.05rem;
}

.ebd-conteudo-aula h1,
.ebd-conteudo-aula h2,
.ebd-conteudo-aula h3,
.ebd-conteudo-aula h4 {
  font-family: "Source Serif 4", Georgia, serif;
  color: #162820;
  font-weight: 700;
  line-height: 1.25;
  margin: 1.6rem 0 0.7rem;
}

.ebd-conteudo-aula h2 { font-size: 1.55rem; }
.ebd-conteudo-aula h3 { font-size: 1.28rem; }
.ebd-conteudo-aula h4 { font-size: 1.12rem; }

.ebd-conteudo-aula ul,
.ebd-conteudo-aula ol {
  margin: 0 0 1.1rem;
  padding-left: 1.35rem;
}

.ebd-conteudo-aula li {
  margin-bottom: 0.35rem;
}

.ebd-conteudo-aula blockquote {
  margin: 1.25rem 0;
  padding: 0.85rem 1rem 0.85rem 1.15rem;
  border-left: 4px solid #2d8f5b;
  background: #f3f8f5;
  color: #355045;
  font-style: italic;
  border-radius: 0 0.5rem 0.5rem 0;
}

.ebd-conteudo-aula img {
  max-width: 100%;
  height: auto;
  border-radius: 0.65rem;
  margin: 1rem 0;
  display: block;
}

.ebd-conteudo-aula a {
  color: #1b6b45;
}

.ebd-conteudo-aula .ql-align-center { text-align: center; }
.ebd-conteudo-aula .ql-align-right { text-align: right; }
.ebd-conteudo-aula .ql-align-justify { text-align: justify; }

@media (max-width: 991.98px) {
  .ebd-revista-layout {
    grid-template-columns: 1fr;
  }

  .ebd-revista-sumario {
    position: static;
  }

  .ebd-artigo {
    padding: 1.15rem 1rem 1.35rem;
  }
}

@media print {
  body * { visibility: hidden; }
  .recibo-print-area, .recibo-print-area * { visibility: visible; }
  .recibo-print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
  .no-print { display: none !important; }
  .sidebar, .app-topbar, .app-footer, .page-header-bar, .gerig-banner, .gerig-home-hero, .wizard-steps, .listagem-card > .card-body > .wizard-coleta > :not(.wizard-pane[data-pane="5"]), .gerig-drawer { display: none !important; }

  body.gerig-print-coleta #drawerNovaColeta {
    display: block !important;
    position: static !important;
    visibility: visible !important;
  }

  body.gerig-print-coleta #drawerNovaColeta .gerig-drawer-panel,
  body.gerig-print-coleta #drawerNovaColeta .gerig-drawer-body {
    display: block !important;
    position: static !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    transform: none !important;
  }

  body.gerig-print-coleta #drawerNovaColeta .gerig-drawer-header,
  body.gerig-print-coleta #drawerNovaColeta .gerig-drawer-footer,
  body.gerig-print-coleta #drawerNovaColeta .gerig-drawer-backdrop {
    display: none !important;
  }

  body.gerig-print-preview #gerigPreviewModal,
  body.gerig-print-preview #gerigPreviewModal *,
  body.gerig-print-preview #gerigPreviewModalBody,
  body.gerig-print-preview #gerigPreviewModalBody * {
    visibility: visible !important;
  }

  body.gerig-print-preview #gerigPreviewModal {
    display: block !important;
    position: static !important;
    background: #fff !important;
  }

  body.gerig-print-preview #gerigPreviewModal .modal-dialog,
  body.gerig-print-preview #gerigPreviewModal .modal-content,
  body.gerig-print-preview #gerigPreviewModalBody {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    border: 0 !important;
  }

  body.gerig-print-preview #gerigPreviewModal .modal-header,
  body.gerig-print-preview #gerigPreviewModal .modal-footer {
    display: none !important;
  }
}

/* ---- GERIG Drawer / Toast / Form sections (UX Linear-like) ---- */
body.gerig-drawer-open {
  overflow: hidden;
}

.gerig-drawer {
  position: fixed;
  inset: 0;
  z-index: 1080;
  pointer-events: none;
  visibility: hidden;
}

.gerig-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}

/* Confirmações devem permanecer acima de drawers e autocompletes. */
.swal2-container {
  z-index: 4000 !important;
}

.gerig-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 20, 0.42);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.gerig-drawer.is-open .gerig-drawer-backdrop {
  opacity: 1;
}

.gerig-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(720px, 100%);
  background: #fff;
  box-shadow: -12px 0 40px rgba(15, 23, 20, 0.18);
  display: flex;
  flex-direction: column;
  transform: translateX(104%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.gerig-drawer-panel.gerig-drawer-wide {
  width: min(960px, 100%);
}

.gerig-drawer.is-open .gerig-drawer-panel {
  transform: translateX(0);
}

.gerig-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid #e8ece9;
  background: #fff;
  flex-shrink: 0;
}

.gerig-drawer-header .modal-title,
.gerig-drawer-header h5 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 650;
  color: #1b3d33;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.gerig-drawer-header .modal-title > i.bi:first-child,
.gerig-drawer-header h5 > i.bi:first-child {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  background: var(--gerig-soft, #e8f3ed);
  color: var(--gerig-accent, #2d8f5b) !important;
  font-size: 1rem;
}

.gerig-drawer-header .btn-close {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0.65rem;
  border-radius: 50%;
  background-color: #f2f6f4;
  opacity: 0.72;
  transition: background-color 0.16s ease, opacity 0.16s ease, transform 0.16s ease;
}

.gerig-drawer-header .btn-close:hover {
  background-color: #e6efea;
  opacity: 1;
  transform: rotate(4deg);
}

.gerig-drawer-body {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0;
  padding: 1.25rem;
  background: #fbfcfb;
  -webkit-overflow-scrolling: touch;
}

.gerig-drawer-body.row {
  width: auto;
  margin: 0;
  align-content: flex-start;
}

.gerig-drawer-body.p-0,
.gerig-drawer-body[class*="p-0"] {
  background: #fff;
}

.gerig-drawer-body .row {
  --bs-gutter-x: 1rem;
  --bs-gutter-y: 1rem;
}

.gerig-drawer-body .mb-2 {
  margin-bottom: 1rem !important;
}

.gerig-drawer-body .mb-3 {
  margin-bottom: 1.25rem !important;
}

.gerig-drawer-body label:not(.form-check-label),
.gerig-drawer-body .form-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.42rem;
  color: #365149;
  font-size: 0.83rem;
  font-weight: 650;
  line-height: 1.25;
}

.gerig-drawer-body .form-control,
.gerig-drawer-body .form-select {
  min-height: 43px;
  padding: 0.6rem 0.78rem;
  border: 1px solid var(--gerig-line, #d7e5dd);
  border-radius: 0.65rem;
  background-color: #fff;
  color: #203b33;
  box-shadow: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.gerig-drawer-body textarea.form-control {
  min-height: 104px;
  resize: vertical;
}

.gerig-drawer-body .form-control::placeholder {
  color: #91a099;
  opacity: 1;
}

.gerig-drawer-body .form-control:hover:not(:disabled):not([readonly]),
.gerig-drawer-body .form-select:hover:not(:disabled) {
  border-color: #a9c5b7;
}

.gerig-drawer-body .form-control:focus,
.gerig-drawer-body .form-select:focus {
  border-color: var(--gerig-primary, #198754);
  box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.12);
  outline: 0;
}

.gerig-drawer-body .form-control[readonly],
.gerig-drawer-body .form-control:disabled,
.gerig-drawer-body .form-select:disabled {
  background-color: #f1f5f3;
  color: #61746d;
  cursor: not-allowed;
}

.gerig-drawer-body .input-group > .form-control,
.gerig-drawer-body .input-group > .form-select,
.gerig-drawer-body .input-group > .input-group-text,
.gerig-drawer-body .input-group > .btn {
  min-height: 43px;
}

.gerig-drawer-body .input-group-text {
  border-color: var(--gerig-line, #d7e5dd);
  background: #f2f7f4;
  color: #587068;
}

.gerig-drawer-body .form-check {
  min-height: 1.5rem;
  padding-top: 0.25rem;
}

.gerig-drawer-body .form-check-input {
  width: 1.08rem;
  height: 1.08rem;
  margin-top: 0.16rem;
  border-color: #adc3b8;
}

.gerig-drawer-body .form-check-input:focus {
  border-color: var(--gerig-primary, #198754);
  box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.12);
}

.gerig-drawer-body .form-text,
.gerig-drawer-body small.text-muted {
  display: block;
  margin-top: 0.38rem;
  color: #71837b !important;
  font-size: 0.78rem;
  line-height: 1.4;
}

.gerig-drawer-body fieldset,
.gerig-drawer-body .gerig-form-card {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid #e3ece7;
  border-radius: 0.8rem;
  background: #fff;
}

.gerig-drawer-body .modal-form-content {
  background: #fbfcfb;
}

.gerig-drawer-body h6,
.gerig-drawer-body .form-section-title {
  margin: 0 0 0.85rem;
  color: var(--gerig-ink, #16352c);
  font-size: 0.92rem;
  font-weight: 700;
}

.gerig-drawer-body hr {
  margin: 1.25rem 0;
  border-color: #dfe9e4;
  opacity: 1;
}

.gerig-drawer-body .dropdown-menu {
  padding: 0.4rem;
  border: 1px solid var(--gerig-line, #d7e5dd);
  border-radius: 0.65rem;
}

.gerig-drawer-footer {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid #e8ece9;
  background: #f8faf9;
  flex-shrink: 0;
}

.gerig-drawer-footer .btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.58rem 1rem;
  border-radius: 0.62rem;
  font-weight: 600;
}

.gerig-drawer-footer .btn > i.bi {
  font-size: 0.95rem;
  line-height: 1;
}

.gerig-drawer-footer .gerig-drawer-action-primary {
  border-color: var(--gerig-accent, #2d8f5b);
  background: var(--gerig-accent, #2d8f5b);
  color: #fff;
}

.gerig-drawer-footer .gerig-drawer-action-primary:hover,
.gerig-drawer-footer .gerig-drawer-action-primary:focus {
  border-color: var(--gerig-primary, #1b3d33);
  background: var(--gerig-primary, #1b3d33);
  color: #fff;
}

.gerig-drawer-footer .gerig-drawer-action-secondary {
  border-color: #c7d6cf;
  background: #fff;
  color: #50675f;
}

.gerig-drawer-footer .gerig-drawer-action-secondary:hover,
.gerig-drawer-footer .gerig-drawer-action-secondary:focus {
  border-color: #a9beb4;
  background: #eef4f1;
  color: var(--gerig-primary, #1b3d33);
}

.gerig-drawer-footer .gerig-drawer-action-danger {
  border-color: #dc3545;
  background: #fff;
  color: #c52d3c;
}

.gerig-drawer-footer .gerig-drawer-action-danger:hover,
.gerig-drawer-footer .gerig-drawer-action-danger:focus {
  background: #dc3545;
  color: #fff;
}

#drawerNovaColeta .coleta-wizard-body {
  background: #fff;
}

#drawerNovaColeta #wizardActions {
  justify-content: space-between;
}

.gerig-form-sections .gerig-section-trigger {
  display: none;
}

.gerig-form-sections.is-tabs .modal-form-nav,
.gerig-form-sections.is-tabs .gerig-form-nav {
  display: flex;
}

.gerig-form-sections .gerig-section-item {
  display: contents;
}

/*
 * Após o enhance do acordeão, os panes deixam de ser filhos diretos de .tab-content
 * e o seletor do Bootstrap (.tab-content > .tab-pane) deixa de escondê-los.
 * Sem isto, cada aba inativa continua ocupando altura (opacity:0) e empurra a seguinte.
 */
.gerig-form-sections.is-tabs .tab-content .tab-pane {
  display: none !important;
  opacity: 1 !important;
}

.gerig-form-sections.is-tabs .tab-content .tab-pane.active.show,
.gerig-form-sections.is-tabs .tab-content .tab-pane.active {
  display: block !important;
}

.gerig-toast.swal2-popup {
  font-size: 0.92rem !important;
  border-radius: 0.65rem !important;
  box-shadow: 0 10px 30px rgba(15, 23, 20, 0.14) !important;
}

@media (max-width: 767.98px) {
  .gerig-drawer-panel,
  .gerig-drawer-panel.gerig-drawer-wide {
    width: 100%;
    border-radius: 0;
  }

  .gerig-drawer-header {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 0.85rem 1rem;
    padding-top: calc(0.85rem + env(safe-area-inset-top, 0px));
  }

  .gerig-drawer-header .btn-close {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0.65rem;
    opacity: 0.75;
  }

  .gerig-drawer-body {
    padding: 1rem;
    padding-bottom: 0.5rem;
  }

  .gerig-drawer-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -6px 18px rgba(15, 23, 20, 0.06);
  }

  .gerig-drawer-footer .btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-height: 44px;
  }

  .gerig-form-sections.is-accordion .modal-form-nav,
  .gerig-form-sections.is-accordion .gerig-form-nav {
    display: none !important;
  }

  .gerig-form-sections.is-accordion .gerig-section-item {
    display: block;
    border-bottom: 1px solid #dfe9e4;
  }

  .gerig-form-sections.is-accordion .gerig-section-trigger {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    min-height: 58px;
    border: 0;
    border-left: 4px solid transparent;
    background: #f7faf8;
    color: #1b3d33;
    font-weight: 650;
    font-size: 0.95rem;
    text-align: left;
    transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
  }

  .gerig-form-sections.is-accordion .gerig-section-trigger-label {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
  }

  .gerig-form-sections.is-accordion .gerig-section-icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    border-radius: 0.65rem;
    background: #e9f1ed;
    color: #60766c !important;
    font-size: 1rem;
  }

  .gerig-form-sections.is-accordion .gerig-section-chevron {
    transition: transform 0.2s ease;
    color: #6b7f74;
  }

  .gerig-form-sections.is-accordion .gerig-section-trigger.is-open {
    border-left-color: var(--gerig-accent);
    background: var(--gerig-soft);
    color: var(--gerig-primary);
  }

  .gerig-form-sections.is-accordion .gerig-section-trigger.is-open .gerig-section-icon {
    background: var(--gerig-accent);
    color: #fff !important;
  }

  .gerig-form-sections.is-accordion .gerig-section-trigger.is-open .gerig-section-chevron {
    transform: rotate(180deg);
    color: var(--gerig-accent);
  }

  .gerig-form-sections.is-accordion .tab-pane {
    display: none !important;
    padding: 1rem !important;
    border-left: 4px solid var(--gerig-accent);
    background: #fff;
    opacity: 1 !important;
  }

  .gerig-form-sections.is-accordion .gerig-section-trigger.is-open + .tab-pane {
    display: block !important;
  }

  .gerig-form-sections.is-accordion .tab-content {
    padding: 0 !important;
  }

  /* Abas de página (fora de drawer): scroll horizontal em vez de quebra feia */
  .page-listagem .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .page-listagem .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .page-listagem .nav-tabs .nav-link {
    white-space: nowrap;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
  }

  .page-listagem {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }

  .page-listagem .page-header-bar {
    padding: 0.9rem;
    border-radius: 0.85rem;
  }

  .page-listagem .page-header-bar > div:first-child {
    width: 100%;
    min-width: 0;
  }

  .page-listagem .page-title {
    font-size: 1.15rem;
    line-height: 1.3;
  }

  .page-listagem .page-header-bar > .d-flex:last-child,
  .page-listagem .page-header-bar > .listagem-toolbar {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
  }

  .page-listagem .page-header-bar > .d-flex:last-child .btn,
  .page-listagem .page-header-bar > .listagem-toolbar .btn {
    flex: 1 1 140px;
    min-height: 42px;
  }

  .page-listagem > .row.align-items-end .btn,
  .page-listagem .listagem-filters .btn {
    width: 100%;
    min-height: 42px;
  }

  .page-listagem .card-header.d-flex {
    align-items: stretch !important;
    flex-direction: column;
  }

  .page-listagem .card-header.d-flex > .d-flex {
    width: 100%;
    flex-wrap: wrap;
  }

  .page-listagem .card-header .form-select,
  .page-listagem .d-flex .form-select[style*="width:auto"],
  .page-listagem .d-flex .form-select[style*="min-width"] {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  .page-listagem .table-responsive {
    overflow-x: auto;
    border-radius: 0.75rem;
    -webkit-overflow-scrolling: touch;
  }

  .page-listagem .table-responsive > table:not(.tabulator-print-table) {
    min-width: 680px;
  }

  .page-listagem .table-responsive .table th,
  .page-listagem .table-responsive .table td {
    padding: 0.65rem 0.7rem;
    vertical-align: middle;
  }

  #sociedadeAtual {
    width: 100% !important;
    max-width: none !important;
  }

  #finResumoPeriodo + .d-flex,
  #tabTaxas > .d-flex,
  #tabContribuicoes > .d-flex {
    align-items: stretch !important;
  }

  #finResumoPeriodo + .d-flex > *,
  #tabTaxas > .d-flex > *,
  #tabContribuicoes > .d-flex > * {
    flex: 1 1 100%;
  }

  #gerigPreviewModal .modal-dialog {
    margin: 0.5rem;
  }

  #gerigPreviewModal .modal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  #gerigPreviewModal .modal-footer .btn {
    min-height: 42px;
    margin: 0;
  }

  #gerigPreviewModal .modal-footer .btn:last-child {
    grid-column: 1 / -1;
  }
}

.gerig-table-matrix .table {
  min-width: 980px;
  font-size: 0.76rem;
}

.gerig-table-matrix .table th,
.gerig-table-matrix .table td {
  padding: 0.4rem 0.35rem;
  white-space: nowrap;
}

.gerig-table-matrix .table th:first-child,
.gerig-table-matrix .table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
}

.gerig-table-matrix .table thead th:first-child {
  z-index: 2;
  background: #f8f9fa;
}

.gerig-detail-panel {
  scroll-margin-top: 4.5rem;
}

.gerig-access-denied {
  display: grid;
  min-height: calc(100vh - 84px);
  padding: clamp(1.25rem, 5vw, 4rem) 1rem;
  place-items: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(30, 143, 90, 0.1), transparent 42%),
    #f7faf8;
}

.gerig-access-denied-card {
  width: min(100%, 660px);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  border: 1px solid #dce7e1;
  border-radius: 1.25rem;
  background: #fff;
  box-shadow: 0 18px 55px rgba(16, 55, 43, 0.12);
  text-align: center;
}

.gerig-access-denied-icon {
  display: inline-flex;
  width: 76px;
  height: 76px;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: #fff0f0;
  color: #c33c48;
  font-size: 2rem;
}

.gerig-access-denied-code {
  display: block;
  margin-bottom: 0.65rem;
  color: #60766c;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gerig-access-denied-card h1 {
  margin-bottom: 0.75rem;
  color: #173c31;
  font-size: clamp(1.45rem, 4vw, 2rem);
  font-weight: 750;
}

.gerig-access-denied-message {
  max-width: 520px;
  margin: 0 auto 1.25rem;
  color: #5b6d64;
  font-size: 1rem;
  line-height: 1.6;
}

.gerig-access-denied-help {
  display: flex;
  max-width: 540px;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0 auto 1.5rem;
  padding: 0.85rem 1rem;
  border-radius: 0.8rem;
  background: #f1f7f4;
  color: #456258;
  font-size: 0.88rem;
  text-align: left;
}

.gerig-access-denied-help i {
  flex: 0 0 auto;
  color: var(--gerig-accent);
}

.gerig-access-denied-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}

.gerig-access-denied-actions .btn {
  min-width: 150px;
  min-height: 44px;
}

@media (max-width: 420px) {
  .page-listagem .row:has(.gerig-metric) > [class*="col-6"] {
    width: 100%;
  }

  .gerig-access-denied {
    align-items: start;
    min-height: calc(100vh - 64px);
    padding: 1rem 0.75rem;
  }

  .gerig-access-denied-card {
    padding: 1.5rem 1rem;
    border-radius: 1rem;
  }

  .gerig-access-denied-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .gerig-access-denied-actions .btn {
    width: 100%;
  }
}

