/* =========================================
   B-MO FINANCIAL — dashboard.css
   Design Premium 2026
   ========================================= */

/* --- Dashboard layout --- */
.dash-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 62px);
  align-items: stretch;
}

/* --- Sidebar --- */
.sidebar,
.dash-sidebar {
  background: #0B1F3A;
  padding: 1.5rem 0;
  position: sticky;
  top: 62px;
  height: calc(100vh - 62px);
  overflow-y: auto;
  min-height: 100%;
}

.sb-user {
  padding: 0 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 1rem;
}

.sb-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(245,158,11,0.2);
  border: 2px solid rgba(245,158,11,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  color: #F59E0B;
  margin-bottom: 0.75rem;
}

.sb-name { font-size: 15px; font-weight: 600; color: #ffffff; }
.sb-type { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 2px; }

.sb-menu { padding: 0 0.5rem; }
.sb-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0.75rem;
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin-bottom: 2px;
  user-select: none;
  border-left: none;
}
.sb-menu a:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
}
.sb-menu a.act {
  background: rgba(245,158,11,0.15);
  color: #F59E0B;
  font-weight: 500;
}
.sb-menu a svg {
  width: 16px; height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  flex-shrink: 0;
}
.sb-menu .sb-sep {
  margin: 0.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 0.5rem;
}

.sb-badge {
  background: #F59E0B;
  color: #0B1F3A;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  margin-left: auto;
}
.sb-badge.danger { background: #EF4444; color: #fff; }

/* --- Dashboard main --- */
.dash-main {
  background: #F5F7FA;
  padding: 1.75rem;
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.dash-header h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: #0B1F3A;
}
.dash-header p {
  font-size: 14px;
  color: var(--text-light);
  margin-top: 3px;
}

/* --- Metric cards --- */
.met-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}

.met {
  background: var(--white);
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.met:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.met .ml {
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
  font-weight: 500;
}
.met .mv {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--font-serif);
  color: #0B1F3A;
  line-height: 1.1;
}
.met .ms {
  font-size: 13px;
  color: #F59E0B;
  margin-top: 4px;
  font-weight: 500;
}

/* --- Dashboard box --- */
.dbox {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.dbox-h {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1rem;
  align-items: start;
}

/* --- Timeline --- */
.tl { padding-left: 1.5rem; position: relative; }
.tl::before {
  content: '';
  position: absolute;
  left: 7px; top: 6px; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #0B1F3A, #E5E7EB);
  border-radius: 1px;
}

.tl-it { position: relative; margin-bottom: 1.25rem; }

.tl-dot {
  position: absolute;
  left: -1.5rem;
  top: 4px;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tl-dot.done {
  background: #0B1F3A;
  border: 2px solid #0B1F3A;
  box-shadow: 0 0 0 3px rgba(11,31,58,0.1);
}
.tl-dot.now {
  background: #fff;
  border: 2px solid #F59E0B;
  box-shadow: 0 0 0 4px rgba(245,158,11,0.2);
}
.tl-dot.wait {
  background: #E5E7EB;
  border: 2px solid #D1D5DB;
}

.tl-lb { font-size: 14px; font-weight: 500; color: #1F2937; }
.tl-dt { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.tl-lb.active-step { color: #F59E0B; font-weight: 600; }
.tl-lb.pending-step { color: var(--text-light); }

/* --- Loan rows --- */
.lr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.lr:last-child { border-bottom: none; }
.ln { font-size: 14px; font-weight: 500; color: #1F2937; }
.lm { font-size: 13px; color: var(--text-light); margin-top: 2px; }

/* --- Summary card --- */
.sum-card {
  background: linear-gradient(135deg, #0B1F3A, #1E3A5F);
  border-radius: 12px;
  padding: 1.25rem;
  color: var(--white);
  box-shadow: 0 8px 24px rgba(11,31,58,0.25);
}
.sum-card h3 {
  font-family: var(--font-serif);
  font-size: 16px;
  margin-bottom: 1rem;
  opacity: 0.75;
  font-weight: 500;
}
.sr {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sr:last-of-type { border-bottom: none; }
.sr .sl { color: rgba(255,255,255,0.5); }
.sr .sv { font-weight: 500; color: #fff; }

.sum-total {
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 10px;
  padding: 1rem;
  margin-top: 1rem;
  text-align: center;
}
.sum-total .sa {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  color: #F59E0B;
}
.sum-total .slab {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.trust-i {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin-top: 8px;
}
.trust-d {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #F59E0B;
  flex-shrink: 0;
}

/* --- Documents --- */
.doc-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.doc-tab {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  border: 1.5px solid var(--border);
  background: none;
  cursor: pointer;
  color: var(--text-light);
  font-family: var(--font-sans);
  transition: all 0.2s ease;
  font-weight: 500;
}
.doc-tab:hover { border-color: #0B1F3A; color: #0B1F3A; }
.doc-tab.act {
  background: #0B1F3A;
  color: #fff;
  border-color: #0B1F3A;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.doc-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.doc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.doc-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.doc-icon svg { width: 18px; height: 18px; fill: none; stroke-width: 1.5; }
.doc-name { font-size: 14px; font-weight: 600; color: #1F2937; }
.doc-meta { font-size: 12px; color: var(--text-light); }
.doc-dl {
  background: none;
  border: 1.5px solid var(--border);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  color: #0B1F3A;
  font-family: var(--font-sans);
  margin-top: 4px;
  transition: all 0.2s ease;
  text-align: center;
  font-weight: 500;
}
.doc-dl:hover {
  background: #0B1F3A;
  color: #fff;
  border-color: #0B1F3A;
}

/* --- Alert items --- */
.alert-item {
  display: flex;
  gap: 12px;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  margin-bottom: 8px;
  align-items: flex-start;
  transition: transform 0.15s ease;
}
.alert-item:hover { transform: translateX(2px); }
.alert-item.info   { background: #DBEAFE; border-left: 3px solid #3B82F6; }
.alert-item.warn   { background: #FEF3C7; border-left: 3px solid #F59E0B; }
.alert-item.ok     { background: #DCFCE7; border-left: 3px solid #22C55E; }
.alert-item.danger { background: #FEE2E2; border-left: 3px solid #EF4444; }

.al-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.al-icon svg { width: 14px; height: 14px; fill: none; stroke-width: 2; }
.al-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.al-sub   { font-size: 13px; color: var(--text-muted); }
.al-time  { font-size: 11px; color: var(--text-light); margin-top: 4px; }

/* Alert params */
.alert-param {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.alert-param:last-child { border-bottom: none; }
.alert-param input[type="checkbox"] { width: auto; cursor: pointer; }

/* --- Profile --- */
.prof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.prof-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.prof-box h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  margin-bottom: 1rem;
  font-weight: 600;
  font-family: var(--font-sans);
}
.prow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.prow:last-child { border-bottom: none; }
.prow .plbl { color: var(--text-light); }
.prow .pval { font-weight: 600; color: #1F2937; }

/* Score ring */
.sec-score {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(11,31,58,0.04), rgba(30,58,95,0.06));
  border-radius: 10px;
  margin-bottom: 1rem;
  border: 1px solid rgba(11,31,58,0.08);
}
.score-ring {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 3px solid #0B1F3A;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  flex-shrink: 0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(11,31,58,0.1);
}
.score-n {
  font-size: 18px;
  font-weight: 700;
  color: #0B1F3A;
  font-family: var(--font-serif);
}
.score-l { font-size: 9px; color: var(--text-light); }

/* --- Progress bar --- */
.prog-bar {
  height: 6px;
  background: #E5E7EB;
  border-radius: 3px;
  overflow: hidden;
}
.prog-fill {
  height: 100%;
  background: linear-gradient(90deg, #0B1F3A, #3B82F6);
  border-radius: 3px;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .dash-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .two-col { grid-template-columns: 1fr; }
  .met-row { grid-template-columns: repeat(2, 1fr); }
  .prof-grid { grid-template-columns: 1fr; }
}

/* --- Panels animation --- */
.dpanel {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.dpanel.act {
  opacity: 1;
  transform: translateY(0);
}

/* --- Navigation mobile --- */
.dash-mobile-nav { display: none; }
.mobile-back { display: none !important; }
.sb-menu { display: block; }

@media (max-width: 768px) {
  .dash-layout { flex-direction: column !important; }
  .dash-sidebar { display: none !important; }
  .dash-main { padding: 0 !important; }
  .dash-content { padding: 0 !important; }
  .dpanel { padding: 0.75rem !important; min-height: auto !important; }
  .dbox { border-radius: 8px !important; margin-bottom: 10px !important; }
  .met { padding: 0.75rem !important; }
  .met .mv { font-size: 18px !important; word-break: break-word !important; }
  .met .ml { font-size: 10px !important; }
  .sb-menu { display: none !important; }
  .sb-user { display: none !important; }
  .sb-bottom { display: none !important; }

  .dash-mobile-nav {
    display: block;
    background: #0B1F3A;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 8px 12px;
  }
  .dmn-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  .dmn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: background 0.15s ease;
    background: rgba(255,255,255,0.06);
  }
  .dmn-item:active { background: rgba(255,255,255,0.12); }
  .dmn-item.act { background: rgba(245,158,11,0.2); }
  .dmn-item svg { width: 22px; height: 22px; stroke: rgba(255,255,255,0.5); }
  .dmn-item.act svg { stroke: #F59E0B; }
  .dmn-item span { font-size: 10px; color: rgba(255,255,255,0.5); font-weight: 500; text-align: center; }
  .dmn-item.act span { color: #F59E0B; }
  .dmn-badge {
    position: absolute;
    top: 6px; right: 6px;
    background: #EF4444;
    color: white;
    font-size: 9px;
    width: 16px; height: 16px;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-weight: 600;
  }

  #pg-dash { background: #F5F7FA; }
  .dpanel { background: #F5F7FA !important; padding: 0 !important; }
  .dbox {
    background: var(--white);
    margin: 0 0 8px 0 !important;
    border-radius: 0 !important;
    padding: 16px !important;
    border-left: none !important;
    border-right: none !important;
  }
  .dash-header {
    background: var(--white);
    padding: 16px !important;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
  }
  #unread-count-header { display: none !important; }
}

#pg-dash { min-height: 100vh; }

@media (max-width: 768px) {
  .dash-layout {
    grid-template-columns: 1fr;
  }
  .sidebar,
  .dash-sidebar {
    display: none;
  }
}
