/**
 * NEBCO app. Font: Poppins, sans-serif. UI: white (off-white) with dark blue.
 */
:root {
  --nebco-primary: #1e3a5f;
  --nebco-primary-dark: #152a47;
  --nebco-accent: #2563eb;
  --nebco-white: #ffffff;
  --nebco-bg: #f5f7fa;
  --nebco-sidebar: #1e3a5f;
  --nebco-sidebar-hover: #2a4a7a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background-color: var(--nebco-bg);
}
.nebco-admin { background-color: var(--nebco-bg); }
.nebco-admin .app-header { background: var(--nebco-white); border-color: #e5e7eb; }
.nebco-admin .app-content-header { background: var(--nebco-white); border-color: #e5e7eb; }
.nebco-admin .app-content { background: var(--nebco-bg); }
.nebco-admin .app-footer { background: var(--nebco-white); border-color: #e5e7eb; color: #6b7280; }
.nebco-sidebar {
  background: var(--nebco-sidebar) !important;
  color: #e5e7eb;
}
.nebco-sidebar .brand-link, .nebco-sidebar .brand-text { color: #fff !important; }
.nebco-sidebar .nav-link { color: rgba(255,255,255,.85); }
.nebco-sidebar .nav-link:hover { color: #fff; background: var(--nebco-sidebar-hover); }
.nebco-sidebar .nav-link.active { background: var(--nebco-accent) !important; color: #fff !important; }
.nebco-sidebar .nav-link.active .nav-icon { color: #fff !important; }
.nebco-sidebar .nav-treeview { padding-left: 1rem; list-style: none; display: none; }
.nebco-sidebar .nav-treeview .nav-link { padding: 0.35rem 0.75rem; font-size: 0.9rem; }
.nebco-sidebar .nav-item.menu-open .nav-treeview { display: block; }
.nebco-sidebar .nav-item .nav-arrow { margin-left: auto; transition: transform 0.2s; }
.nebco-sidebar .nav-item.menu-open .nav-arrow { transform: rotate(90deg); }
.nebco-admin .card { background: var(--nebco-white); border: 1px solid #e5e7eb; }
.nebco-admin .card-header { background: var(--nebco-white); border-color: #e5e7eb; color: #1e3a5f; }
.wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.wrapper .content-wrapper { display: flex; flex-direction: column; flex: 1; }
.wrapper .main-sidebar { flex-shrink: 0; }
.wrapper > .content-wrapper { flex: 1; display: flex; flex-direction: column; }
.layout-has-sidebar { display: flex; flex: 1; min-height: 0; }
.layout-has-sidebar .main-sidebar { flex-shrink: 0; min-height: calc(100vh - 56px); }
.layout-has-sidebar .content-wrapper { flex: 1; min-width: 0; }
.main-header { background: var(--nebco-white); border-bottom: 1px solid #dee2e6; padding: 0.5rem 1rem; display: flex; align-items: center; justify-content: space-between; }
.main-sidebar { width: 250px; background: #343a40; color: #fff; min-height: calc(100vh - 56px); padding: 1rem; }
.main-sidebar a { color: rgba(255,255,255,.8); text-decoration: none; display: block; padding: 0.5rem 0; }
.main-sidebar a:hover, .main-sidebar a.active { color: #fff; }
.content-wrapper { flex: 1; display: flex; flex-direction: column; }
.content-header { padding: 1rem; background: var(--nebco-white); border-bottom: 1px solid #dee2e6; }
.content { padding: 1rem; flex: 1; }
.container-fluid { max-width: 100%; padding-left: 1rem; padding-right: 1rem; }
.row { display: flex; flex-wrap: wrap; margin-left: -0.5rem; margin-right: -0.5rem; }
.col-1, .col-2, .col-3, .col-4, .col-6, .col-12 { padding: 0 0.5rem; }
.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
@media (max-width: 768px) { .col-4, .col-6 { flex: 0 0 100%; max-width: 100%; } .main-sidebar { width: 100%; } }
.card { background: #fff; border-radius: 0.25rem; box-shadow: 0 0 1px rgba(0,0,0,.1); margin-bottom: 1rem; overflow: hidden; }
.card-body { padding: 1rem; }
.card-header { padding: 0.75rem 1rem; background: #f8f9fa; border-bottom: 1px solid #dee2e6; font-weight: 600; }
.btn { display: inline-block; padding: 0.375rem 0.75rem; border-radius: 0.25rem; border: 1px solid transparent; cursor: pointer; font-size: 1rem; }
.btn-primary { background: var(--nebco-primary); color: #fff; border-color: var(--nebco-primary); font-family: "Poppins", sans-serif; }
.btn-primary:hover { background: var(--nebco-primary-dark); color: #fff; border-color: var(--nebco-primary-dark); }
.alert { padding: 0.75rem 1rem; margin-bottom: 1rem; border-radius: 0.25rem; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert .close { float: right; background: none; border: none; font-size: 1.25rem; cursor: pointer; }
.main-footer { padding: 0.5rem 1rem; text-align: center; background: #fff; border-top: 1px solid #dee2e6; }
.sidebar-menu .nav-link.active { background: var(--nebco-accent) !important; color: #fff !important; }
.btn-primary { background-color: var(--nebco-primary); border-color: var(--nebco-primary); }
.btn-primary:hover { background-color: var(--nebco-primary-dark); border-color: var(--nebco-primary-dark); }
.card.bg-success, .small-box.text-bg-success { background: var(--nebco-primary) !important; }
.navbar-nav { display: flex; list-style: none; margin: 0; padding: 0; gap: 1rem; }
.nav-link { color: #333; }
.dropdown-menu { position: absolute; right: 0; background: #fff; border: 1px solid #dee2e6; border-radius: 0.25rem; box-shadow: 0 2px 8px rgba(0,0,0,.15); padding: 0.25rem 0; min-width: 10rem; }
.dropdown-item { display: block; padding: 0.25rem 1rem; color: #333; text-decoration: none; }
.dropdown-item:hover { background: #f8f9fa; }
.m-0 { margin: 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }
.h1, h1 { font-size: 1.5rem; }
.text-success { color: var(--nebco-primary) !important; }
.font-weight-bold { font-weight: 700; }
.text-center { text-align: center; }
.border-bottom { border-bottom: 1px solid #dee2e6; }
.brand-link { display: block; padding: 0.5rem; }
.sidebar { overflow-y: auto; }
.nav { list-style: none; padding: 0; margin: 0; }
.nav-item { margin-bottom: 0.25rem; }
.nav-link { padding: 0.5rem 1rem; border-radius: 0.25rem; }
.nav-link.active { background: var(--nebco-primary); color: #fff !important; }
.nav-link i { margin-right: 0.5rem; width: 1.25rem; text-align: center; }
.small { font-size: 0.875rem; }
.text-muted { color: #6c757d; }
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.spinner-border { display: inline-block; width: 1rem; height: 1rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: nebco-spin .75s linear infinite; }
@keyframes nebco-spin { to { transform: rotate(360deg); } }
.spinner-border-sm { width: 0.875rem; height: 0.875rem; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid #dee2e6; text-align: left; }
.table th { font-weight: 600; background: #f8f9fa; }
.form-control { display: block; width: 100%; padding: 0.375rem 0.75rem; border: 1px solid #ced4da; border-radius: 0.25rem; font-size: 1rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.25rem; font-weight: 500; }
.form-row { display: flex; flex-wrap: wrap; margin-left: -0.5rem; margin-right: -0.5rem; }
.form-row .col { padding: 0 0.5rem; flex: 1; min-width: 0; }
.badge { padding: 0.25rem 0.5rem; border-radius: 0.25rem; }
.badge-warning { background: #ffc107; color: #000; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.w-auto { width: auto; }
.form-inline { display: flex; flex-wrap: wrap; align-items: center; }
.form-inline .form-control { width: auto; }
.form-inline .mr-1 { margin-right: 0.25rem; }
.mr-1 { margin-right: 0.25rem; }

.small-box .icon { font-size: 3rem; }
.small-box .icon i { opacity: 0.8; }
.toast-top-end { top: 70px; right: 12px; }
.nebco-admin .small-box.text-bg-primary { background: var(--nebco-primary) !important; }
.nebco-admin .small-box.text-bg-info { background: var(--nebco-accent) !important; }

/* ========== Micro-finance layout (dark blue sidebar + white content) ========== */
.nebco-layout { font-family: "Poppins", sans-serif; }
.nebco-wrapper { display: flex; min-height: 100vh; background: #fff; }
.nebco-sidebar {
  width: 260px; min-width: 260px; background: #1e3a5f; color: #e5e7eb; display: flex; flex-direction: column; flex-shrink: 0;
}
.nebco-sidebar-brand { padding: 1rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.nebco-brand-link { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: #fff !important; }
.nebco-brand-icon {
  width: 36px; height: 36px; background: linear-gradient(135deg, #dc3545 0%, #1e3a5f 100%); color: #fff;
  border-radius: 6px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem;
}
.nebco-brand-text { font-weight: 700; font-size: 1.1rem; letter-spacing: 0.02em; }
.nebco-sidebar-user {
  padding: 1rem; display: flex; align-items: center; gap: 0.75rem; border-bottom: 1px solid rgba(255,255,255,.1);
}
.nebco-user-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: #2563eb; color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600;
}
.nebco-user-info { display: flex; flex-direction: column; }
.nebco-user-name { font-weight: 600; color: #fff; font-size: 0.9rem; }
.nebco-user-status { font-size: 0.75rem; color: rgba(255,255,255,.7); }
.nebco-user-status .text-success { color: #22c55e !important; }
.nebco-sidebar-nav { flex: 1; overflow-y: auto; padding: 0.5rem 0; }
.nebco-nav-list { list-style: none; padding: 0; margin: 0; }
.nebco-nav-item { margin-bottom: 0.125rem; }
.nebco-nav-link {
  display: flex; align-items: center; padding: 0.6rem 1rem; color: rgba(255,255,255,.88); text-decoration: none;
  transition: background .15s, color .15s;
}
.nebco-nav-link .nav-icon { width: 22px; margin-right: 0.6rem; text-align: center; opacity: .9; }
.nebco-nav-link .arrow { margin-left: auto; font-size: 0.7rem; transition: transform .2s; }
.nebco-nav-item.open .arrow { transform: rotate(90deg); }
.nebco-nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nebco-nav-link.active { background: #2563eb !important; color: #fff !important; }
.nebco-nav-sub { list-style: none; padding: 0 0 0 2.25rem; margin: 0 0 0.25rem 0; display: none; }
.nebco-nav-item.open .nebco-nav-sub { display: block; }
.nebco-nav-sub a {
  display: block; padding: 0.35rem 0.5rem; font-size: 0.85rem; color: rgba(255,255,255,.75); text-decoration: none;
  border-left: 2px solid transparent; padding-left: 0.75rem; margin-left: -0.25rem;
}
.nebco-nav-sub a:hover, .nebco-nav-sub a.active { color: #fff; border-left-color: #2563eb; }
.nebco-sidebar-search { padding: 0.75rem 1rem; border-top: 1px solid rgba(255,255,255,.1); }
.nebco-sidebar-search .form-control { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
.nebco-sidebar-search .form-control::placeholder { color: rgba(255,255,255,.5); }

.nebco-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #f8fafc; }
.nebco-topbar {
  background: #fff; border-bottom: 1px solid #e5e7eb; padding: 0.5rem 1.25rem; display: flex; align-items: center; justify-content: space-between;
}
.nebco-topbar-left { display: flex; align-items: center; gap: 1rem; }
.nebco-toggle { color: #374151; font-size: 1.25rem; padding: 0.25rem; }
.nebco-topnav { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.nebco-topnav a {
  color: #4b5563; text-decoration: none; font-size: 0.9rem; padding: 0.35rem 0.6rem; border-radius: 4px;
}
.nebco-topnav a:hover { color: #1e3a5f; background: #f3f4f6; }
.nebco-topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.nebco-toplink { color: #4b5563; text-decoration: none; font-size: 0.875rem; display: inline-flex; align-items: center; gap: 0.35rem; }
.nebco-toplink:hover { color: #1e3a5f; }
.nebco-topbar-toolbar {
  background: #fff; border-bottom: 1px solid #e5e7eb; padding: 0.4rem 1.25rem; display: flex; align-items: center; gap: 0.5rem;
}
.nebco-search { max-width: 280px; }
.nebco-content { flex: 1; display: flex; flex-direction: column; padding: 1.25rem; }
.nebco-content-header { margin-bottom: 1rem; }
.nebco-page-title { font-size: 1.5rem; font-weight: 600; color: #111827; margin: 0; }
.nebco-content-body { flex: 1; }
.nebco-footer { padding-top: 1rem; margin-top: 1rem; border-top: 1px solid #e5e7eb; font-size: 0.8rem; color: #6b7280; }
.nebco-card-purple { background: #6f42c1 !important; }

/* Dashboard summary cards (Active Members, Total Savings, Loans, Arrears) – match Total Balance row */
.nebco-dash-card .card-body { border-radius: 0.5rem; min-height: 120px; }
.nebco-dash-card .card-title { font-size: 1.5rem; }
.nebco-dash-card .link-light:hover { opacity: 0.9; }

@media (max-width: 991px) {
  .nebco-sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 1030; transform: translateX(-100%); transition: transform .2s; }
  .nebco-sidebar.show { transform: translateX(0); }
  .nebco-topnav { display: none; }
}
