/* kwetuwelfare.org color scheme */
:root {
  --kwetu-red:    #A52020;
  --kwetu-dark:   #141416;
  --kwetu-green:  #3F7652;
  --kwetu-lime:   #83C12F;
  --kwetu-light:  #F5F5F5;
  --kwetu-grey:   #8F8F8F;
  --kwetu-border: #E2E2E2;
}

body {
  background-color: var(--kwetu-light);
  font-family: 'Work Sans', 'Open Sans', sans-serif;
  color: #141416;
}

/* ── Navbar ── */
.navbar {
  background: var(--kwetu-red) !important;
}

.navbar-brand, .nav-link {
  color: #fff !important;
}

.nav-link:hover {
  color: var(--kwetu-red) !important;
}

/* ── Sidebar ── */
.sidebar {
  min-height: calc(100vh - 56px);
  background: #fff;
  border-right: 1px solid var(--kwetu-border);
  padding-top: 1.5rem;
}

.sidebar .nav-link {
  color: #333 !important;
  border-radius: 6px;
  margin: 2px 8px;
  padding: 8px 12px;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background: var(--kwetu-red);
  color: #fff !important;
}

.sidebar .nav-link i {
  width: 22px;
}

/* ── Collapsible nav section toggle ── */
.sidebar .nav-section-toggle {
  display: flex !important;
  align-items: center;
  width: calc(100% - 16px);
  margin: 6px 8px 0;
  background: #fff !important;
  border: none;
  border-bottom: 1px solid var(--kwetu-border);
  border-radius: 0;
  font-size: .85rem;
  font-weight: 700 !important;
  letter-spacing: .02em;
  color: #111 !important;
  padding: 10px 8px 8px 20px;
  cursor: pointer;
  text-decoration: none !important;
}

.sidebar .nav-section-toggle:hover,
.sidebar .nav-section-toggle:focus,
.sidebar .nav-section-toggle:visited {
  background: #fff !important;
  color: var(--kwetu-red) !important;
  text-decoration: none !important;
}

.sidebar .nav-section-toggle .nav-chevron {
  margin-left: auto;
  font-size: .72rem;
  color: #999;
  transition: transform .22s ease;
  flex-shrink: 0;
}

.sidebar .nav-section-toggle.collapsed .nav-chevron {
  transform: rotate(-90deg);
}

.sidebar .nav-section-body {
  padding-bottom: 4px;
}

.sidebar .nav-section-body .nav-link {
  font-size: .875rem;
  padding: 6px 12px 6px 24px;
  display: flex !important;
  align-items: center;
}

.sidebar .nav-section-body .nav-link i {
  width: 18px;
  font-size: .85rem;
  flex-shrink: 0;
}

.sidebar .nav-section-body .nav-link .badge {
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Stat cards ── */
.stat-card {
  border: none;
  border-radius: 12px;
  transition: transform 0.15s;
}

.stat-card:hover {
  transform: translateY(-3px);
}

.stat-card .card-body {
  padding: 1.5rem;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}

/* ── Badges / avatars ── */
.badge-male   { background: none; color: #444; border: none; box-shadow: none; }
.badge-female { background: none; color: #444; border: none; box-shadow: none; }

.member-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.avatar-male   { background: none; color: #444; }
.avatar-female { background: none; color: #444; }

/* ── Search bar ── */
.search-bar input {
  border-radius: 25px 0 0 25px;
  border-right: none;
}

.search-bar button {
  border-radius: 0 25px 25px 0;
  background: var(--kwetu-red);
  color: #fff;
  border: 1px solid var(--kwetu-red);
}

/* ── Table ── */
.table th {
  background: var(--kwetu-dark);
  color: #fff;
  font-weight: 600;
  border: none;
  white-space: nowrap;
}

.sort-link {
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sort-link:hover {
  color: #ffd0d0;
}

.sort-idle {
  opacity: 0.4;
}

/* Accordion — strip all Bootstrap default styling */
.accordion-button::after { display: none; }
.accordion-button { box-shadow: none !important; font-weight: normal !important; }
.accordion-button,
.accordion-button:not(.collapsed),
.accordion-button:focus,
.accordion-button:hover,
.accordion-button:active {
  background-color: transparent !important;
  background: transparent !important;
  color: #141416 !important;
  box-shadow: none !important;
  font-weight: normal !important;
}
#maritalAccordion {
  --bs-accordion-active-bg: transparent;
  --bs-accordion-active-color: #141416;
  --bs-accordion-btn-focus-box-shadow: none;
  --bs-accordion-btn-active-icon: none;
}
.accordion-button:not(.collapsed) .chevron-icon {
  transform: rotate(180deg);
}
.chevron-icon {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.table tbody tr:hover {
  background: #fdf0f0;
}

/* ── Primary button ── */
.btn-kwetu {
  background: var(--kwetu-red);
  color: #fff;
  border: none;
}

.btn-kwetu:hover {
  background: #b82828;
  color: #fff;
}

/* ── Page header ── */
.page-header {
  border-bottom: 3px solid var(--kwetu-red);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

/* ── Login card ── */
.login-card {
  max-width: 420px;
  margin: 80px auto;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.login-header {
  background: var(--kwetu-dark);
  color: #fff;
  border-radius: 16px 16px 0 0;
  padding: 0.6rem 2rem 1.25rem;
  text-align: center;
}
.login-header h4 { margin-bottom: 1.5rem; }
.login-header p  { font-size: 0.95rem; }

/* OTP input */
.ls-4 { letter-spacing: 0.5rem; font-size: 1.5rem; }

/* ── Attachments ── */
.attachment-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: .5rem;
  border: 1px solid var(--kwetu-border);
  cursor: pointer;
  transition: opacity .15s;
}
.attachment-thumb:hover { opacity: .85; }

/* ── Detail tabs ── */
.nav-tabs .nav-link         { color: #444 !important; border-color: transparent; }
.nav-tabs .nav-link.active  { color: var(--kwetu-red) !important; border-bottom-color: var(--kwetu-red); font-weight: 600; }
.nav-tabs .nav-link:hover   { color: var(--kwetu-dark) !important; border-color: transparent; }


/* ── Mobile bottom navigation ── */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--kwetu-border);
  justify-content: space-around;
  align-items: center;
  padding: 6px 0 10px;
  z-index: 1030;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #888;
  text-decoration: none;
  font-size: 0.68rem;
  flex: 1;
  padding: 2px 4px;
}

.mobile-nav-item i {
  font-size: 1.35rem;
  line-height: 1;
}

.mobile-nav-item.active {
  color: var(--kwetu-red);
}

.mobile-nav-item:hover {
  color: var(--kwetu-red);
}

/* ── Mobile typography & layout ── */
@media (max-width: 767.98px) {
  /* Push content above bottom nav */
  .container-fluid > .row > div.p-4 {
    padding-bottom: 80px !important;
  }

  /* Body / table data: 16px → 14px */
  body {
    font-size: 14px;
  }

  /* Table headers: 16px → 13px bold caps */
  .table th {
    font-size: 13px;
    letter-spacing: .3px;
  }

  /* Table data cells: inherit 14px body */
  .table td {
    font-size: 14px;
  }

  /* Stat card labels: 14px → 12px */
  .stat-card .small {
    font-size: 12px !important;
  }

  /* Stat numbers: 40px → 26px */
  .stat-number {
    font-size: 1.625rem;
  }

  /* Dashboard icons: 32px → 24px */
  .stat-card .fs-2 {
    font-size: 1.5rem !important;
  }

  /* Bottom nav labels: 10.9px → 11px (WCAG floor) */
  .mobile-nav-item {
    font-size: 0.6875rem;
  }

  /* Avatar: slightly smaller */
  .member-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.8rem;
  }

  /* Secondary / muted text: 12px */
  .text-muted.small, .small.text-muted {
    font-size: 12px !important;
  }

  /* Page header h4: scale down */
  .page-header h4 {
    font-size: 1.1rem;
  }

  /* Card headers */
  .card-header {
    font-size: 14px;
  }
}
