:root {
  --brand: #2f6f5e;
  --brand-dark: #1f4d41;
  --brand-soft: #e7f1ee;
  --accent: #d08c3c;
  --ink: #1d2a26;
  --bg: #f4f6f5;
  --sidebar-w: 256px;
  --bs-primary: #2f6f5e;
  --bs-primary-rgb: 47, 111, 94;
  --bs-link-color: #2f6f5e;
  --bs-link-color-rgb: 47, 111, 94;
  --bs-link-hover-color: #1f4d41;
}
body { background: var(--bg); color: var(--ink); font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); --bs-btn-active-bg: var(--brand-dark); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); }
.progress-bar { background-color: var(--brand); }
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); }
.page-link { color: var(--brand); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.card { border: 1px solid #e3e8e6; border-radius: 12px; }
.card-header { border-bottom: 1px solid #edf0ef; border-radius: 12px 12px 0 0 !important; }
.table > :not(caption) > * > * { padding-top: .55rem; padding-bottom: .55rem; }

/* shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--brand-dark); color: #dfece8; flex-shrink: 0; }
@media (min-width: 992px) { .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; } }
.sidebar.offcanvas-lg { --bs-offcanvas-bg: #1f4d41; --bs-offcanvas-width: var(--sidebar-w); background-color: #1f4d41 !important; }
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.08); color: #fff; }
.sidebar-brand > i { font-size: 1.6rem; color: #f3c58a; }
.sidebar-brand small { color: #a9c7bf; }
.sidebar-nav { padding: .5rem .6rem 2rem; }
.sidebar-nav a { display: flex; gap: .65rem; align-items: center; color: #d3e4df; text-decoration: none; padding: .45rem .7rem; border-radius: 8px; font-size: .92rem; }
.sidebar-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-nav a.active { background: rgba(243,197,138,.16); color: #fff; box-shadow: inset 3px 0 0 #f3c58a; }
.nav-group { text-transform: uppercase; font-size: .7rem; letter-spacing: .08em; color: #8fb3a9; padding: 1rem .7rem .3rem; }
.main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; gap: .75rem; padding: .8rem 1.5rem; background: #fff; border-bottom: 1px solid #e3e8e6; position: sticky; top: 0; z-index: 10; }
.content { padding: 1.5rem; }
@media (max-width: 575px) { .content { padding: 1rem; } .topbar { padding: .6rem 1rem; } }

/* stats */
.stat-card { color: inherit; transition: transform .12s, box-shadow .12s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(31,77,65,.08); }
.stat-icon { font-size: 1.3rem; color: var(--brand); background: var(--brand-soft); border-radius: 8px; padding: .15rem .45rem; }
.stat-value { white-space: nowrap; font-size: 1.35rem; font-weight: 650; letter-spacing: -.01em; margin: .25rem 0 .1rem; }
.stat-pill { background: #fff; border: 1px solid #e3e8e6; border-radius: 10px; padding: .45rem .8rem; display: flex; flex-direction: column; line-height: 1.2; }
.stat-pill span { font-size: .75rem; color: #6b7c77; }
.pastor-card { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; border: 0; }
.date-chip { width: 46px; text-align: center; border-radius: 8px; background: var(--brand-soft); color: var(--brand-dark); line-height: 1.1; padding: .3rem 0; flex-shrink: 0; }
.date-chip span { display: block; font-size: .68rem; text-transform: uppercase; }
.date-chip strong { font-size: 1.15rem; }
.date-chip-lg { width: 58px; padding: .5rem 0; }
.date-chip-lg strong { font-size: 1.5rem; }

/* auth */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: radial-gradient(circle at 20% 10%, #e3efe9, transparent 50%), radial-gradient(circle at 90% 90%, #f6e7d4, transparent 45%), var(--bg); }
.auth-card { width: 100%; max-width: 440px; border-radius: 16px; }
.auth-logo { width: 64px; height: 64px; margin: auto; border-radius: 16px; background: var(--brand); color: #f3c58a; display: grid; place-items: center; font-size: 2rem; }

/* portal */
.portal-nav { background: var(--brand-dark); }
.portal-nav .navbar-brand, .portal-nav .nav-link { color: #e6f0ed; }
.portal-nav .nav-link.active, .portal-nav .nav-link:hover { color: #f3c58a; }
.portal-nav .navbar-toggler { border-color: rgba(255,255,255,.3); filter: invert(1); }
.portal-hero { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; border-radius: 16px; padding: 1.6rem 1.8rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.give-types { display: flex; flex-wrap: wrap; gap: .5rem; }

/* searchable select */
.select-filter { margin-bottom: .35rem; }

@media print {
  .sidebar, .topbar, form .btn, .btn, .pagination, .portal-nav { display: none !important; }
  .content { padding: 0; }
  .card { border: 0; }
}

/* tables placed directly inside cards */
.card > .table > :not(caption) > * > *:first-child, .card > .table-responsive > .table > :not(caption) > * > *:first-child { padding-left: 1rem; }
.card > .table > :not(caption) > * > *:last-child, .card > .table-responsive > .table > :not(caption) > * > *:last-child { padding-right: 1rem; }

/* church logo */
.sidebar-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; background: #fff; padding: 3px; flex-shrink: 0; }
.portal-logo { height: 32px; width: auto; max-width: 48px; object-fit: contain; border-radius: 6px; background: #fff; padding: 2px; }
.auth-logo-img { width: 88px; height: 88px; object-fit: contain; display: block; margin: 0 auto; }
.logo-preview { width: 96px; height: 96px; border: 1px dashed #c8d3cf; border-radius: 12px; display: grid; place-items: center; background: #f8faf9; font-size: 2rem; color: var(--brand); flex-shrink: 0; overflow: hidden; }
.logo-preview-img { max-width: 88px; max-height: 88px; object-fit: contain; }
