: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; }

#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 area should fill the viewport height under the page padding */
#aboutArea.about-area {
  height: calc(100vh - 30px); /* 30px because .main-wrapper has 15px padding top+bottom */
}

/* Make the card fill the About area */
#aboutArea .about-card {
  height: 100%;
}

/* Card body as a flex column so the PDF frame expands */
#aboutArea .about-card-body {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* PDF frame takes all remaining height */
#aboutArea .about-pdf-frame {
  flex: 1 1 auto;
  min-height: 0;          /* important: allows iframe to size correctly in flex containers */
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

/* iframe fills the frame */
#aboutArea .about-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}