:root { --sidebar-width: 200px; }

body { background-color: #f4f7f6; font-family: 'Segoe UI', sans-serif; font-size: 0.82rem; overflow-x: hidden; }

#sidebar {
  width: var(--sidebar-width);
  position: fixed;
  height: 100vh;
  background: #212529;
  color: white;
  left: 0;
  top: 0;
  z-index: 1000;

  /* allow bottom item (About) */
  display: flex;
  flex-direction: column;

  /* flush top for logo */
  padding: 0;
}

.main-wrapper { margin-left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); padding: 15px; }

.nav-item { padding: 12px 20px; cursor: pointer; border-bottom: 1px solid #343a40; transition: 0.2s; color: white !important; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-item:hover { background: #343a40; color: #0d6efd !important; }

.stats-card { height: 115px; display: flex; flex-direction: column; justify-content: center; background: white; border-radius: 6px; text-align: center; }
.stats-card h3 { margin-bottom: 0; font-weight: bold; color: inherit; line-height: 1.1; }
.stats-card h6 { font-size: 0.65rem; color: #6c757d; font-weight: bold; text-transform: uppercase; margin-bottom: 8px; }

/* All KPI cards share one brand accent - uniform, not varied per card */
.card-total, .card-closed-count, .card-maturity, .card-pending, .card-total-amt, .card-closed-amt, .card-referral, .card-lender {
    border-top: 4px solid #0d6efd !important;
    color: #212529 !important;
}

.section-header { color: white; font-weight: bold; padding: 4px 12px; font-size: 0.85rem; border-radius: 4px 4px 0 0; }
.header-primary { background: #0d6efd; }
.header-success { background: #198754; }
.header-danger { background: #dc3545; }
.header-warning { background: #ffc107; color: #212529; }

.form-control-sm, .form-select-sm { font-size: 0.8rem; height: 31px; border: 1px solid #ced4da; }

.menu-btn { cursor: pointer; transition: 0.2s; border-left: 5px solid #0d6efd; background: white; }
.menu-btn:hover { transform: translateY(-3px); box-shadow: 0 6px 15px rgba(0,0,0,0.1); }

#statusOverlay { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 9999; padding: 10px 30px; border-radius: 4px; display: none; color: white; font-weight: bold; box-shadow: 0 4px 12px rgba(0,0,0,0.2); text-align: center; white-space: pre-line; max-width: 90vw; }

/* The amber invalid-field styling (instead of Bootstrap's default bright
   red) is applied via inline styles in markInvalid()/clearValidation() in
   crm.clients.js - some input types (date) didn't reliably respect a
   plain CSS class override of Bootstrap's own .is-invalid border-color. */

#customModal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 10000; display: none; align-items: center; justify-content: center; }
.modal-box { background: white; border: 4px solid #ffc107; padding: 25px; border-radius: 8px; width: 420px; text-align: center; }

.list-group-item { text-transform: uppercase !important; font-weight: 600; letter-spacing: 0.5px; }
#resultsList { max-height: 600px; overflow-y: auto; z-index: 9999; background: white; width: 100%; }

/* Push About to bottom */
.sidebar-spacer { flex: 1 1 auto; }

/* Logo block: full width, no gaps */
#sidebar .sidebar-brand { margin: 0; padding: 0; background: #fff; }
#sidebar .sidebar-brand-link,
#sidebar .sidebar-brand a { display: block; width: 100%; }

/* Logo image: preserve ratio, scale to sidebar width */
#sidebar .sidebar-logo {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left top;
  margin: 0;
  padding: 0;
}

/* If you want a little breathing room between logo and first menu item, uncomment: */
/* #sidebar .nav-item:first-of-type { margin-top: 8px; } */

/* About / User Guide */
#aboutArea .about-hero {
  background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
  color: #fff;
  border-radius: 14px;
  padding: 2rem 2.25rem;
  box-shadow: 0 10px 28px rgba(13, 110, 253, 0.28);
}
#aboutArea .about-hero h4 {
  color: #fff;
  font-size: 1.5rem;
  letter-spacing: 0.2px;
}
#aboutArea .about-hero p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.9rem;
  max-width: 640px;
}
#aboutArea .about-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
#aboutArea .about-nav a {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  transition: background 0.15s ease;
  white-space: nowrap;
}
#aboutArea .about-nav a:hover {
  background: rgba(255, 255, 255, 0.3);
}

#aboutArea .about-feature {
  border: none;
  border-radius: 12px;
  border-top: 4px solid var(--about-accent, #0d6efd);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  scroll-margin-top: 15px;
}
#aboutArea .about-feature:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.09);
}
#aboutArea .about-feature-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.6rem;
}
#aboutArea .about-feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--about-accent-bg, #e7f1ff);
  flex-shrink: 0;
}
#aboutArea .about-feature h6 {
  margin: 0;
  font-weight: 700;
  color: #222;
  font-size: 1rem;
}
#aboutArea .about-feature .about-lead {
  color: #555;
  font-size: 0.86rem;
  margin-bottom: 0.75rem;
}
#aboutArea .about-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}
#aboutArea .about-checklist li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.55rem;
  font-size: 0.8rem;
  color: #444;
  line-height: 1.45;
}
#aboutArea .about-checklist li:last-child {
  margin-bottom: 0;
}
#aboutArea .about-checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--about-accent, #0d6efd);
  font-weight: 700;
}