/* =========================================
   MERIDIA — dashboard.css
   Sidebar · Panels · Metrics · Timeline
   Doc cards · Alerts · Profile · Security
   ========================================= */

/* --- Dashboard layout --- */
.dash-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  min-height: calc(100vh - 90px);
}

/* --- Sidebar --- */
.sidebar {
  background: var(--white);
  border-right: 0.5px solid var(--border);
  padding: 1.25rem 0;
  position: sticky;
  top: 62px;
  height: calc(100vh - 62px);
  overflow-y: auto;
}
.sb-user {
  padding: 0 1.25rem 1rem;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 0.75rem;
}
.sb-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--info-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 13px;
  color: var(--info-txt);
  margin-bottom: 0.6rem;
}
.sb-name { font-size: 13px; font-weight: 500; }
.sb-type { font-size: 11px; color: var(--text-muted); }

.sb-menu { padding: 0; }
.sb-menu a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 1.25rem;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  border-left: 2px solid transparent;
  user-select: none;
}
.sb-menu a:hover { background: var(--gray-100); color: var(--text-main); }
.sb-menu a.act   { color: var(--navy); font-weight: 500; border-left-color: var(--gold); background: var(--gray-100); }
.sb-menu a svg   { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.5; flex-shrink: 0; }
.sb-menu .sb-sep { margin-top: 0.5rem; border-top: 0.5px solid var(--border); padding-top: 0.5rem; }

.sb-badge {
  background: var(--navy);
  color: var(--white);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 10px;
  margin-left: auto;
}
.sb-badge.danger { background: #E24B4A; }

/* --- Dashboard main --- */
.dash-main {
  background: var(--gray-100);
  padding: 1.5rem;
}
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}
.dash-header h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
}
.dash-header p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* --- Metric cards --- */
.met-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 1.25rem;
}
.met {
  background: var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1rem;
}
.met .ml { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; }
.met .mv { font-size: 20px; font-weight: 500; font-family: var(--font-serif); }
.met .ms { font-size: 10px; color: var(--gold); margin-top: 2px; }

/* --- Dashboard box --- */
.dbox {
  background: var(--white);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.dbox-h {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 1rem;
  align-items: start;
}

/* --- Timeline --- */
.tl { padding-left: 1.1rem; position: relative; }
.tl::before {
  content: '';
  position: absolute;
  left: 5px; top: 4px; bottom: 0;
  width: 1px;
  background: var(--border);
}
.tl-it { position: relative; margin-bottom: 1rem; }
.tl-dot {
  position: absolute;
  left: -1.1rem;
  top: 3px;
  width: 12px; height: 12px;
  border-radius: 50%;
}
.tl-dot.done { background: var(--navy); border: 2px solid var(--navy); }
.tl-dot.now  { background: var(--white); border: 2px solid var(--gold); box-shadow: 0 0 0 3px rgba(184,150,62,0.15); }
.tl-dot.wait { background: var(--gray-200); border: 1.5px solid var(--gray-400); }
.tl-lb { font-size: 12px; font-weight: 500; }
.tl-dt { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.tl-lb.active-step { color: var(--gold); }
.tl-lb.pending-step { color: var(--text-muted); }

/* --- Loan rows --- */
.lr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 0.5px solid var(--border);
}
.lr:last-child { border-bottom: none; }
.ln { font-size: 12px; font-weight: 500; }
.lm { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* --- Summary card (navy) --- */
.sum-card {
  background: var(--navy);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  color: var(--white);
}
.sum-card h3 {
  font-family: var(--font-serif);
  font-size: 16px;
  margin-bottom: 0.9rem;
  opacity: 0.85;
}
.sr {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  padding: 6px 0;
  border-bottom: 0.5px solid rgba(255,255,255,0.12);
}
.sr:last-of-type { border-bottom: none; }
.sr .sl { color: #8fa3b8; }
.sr .sv { font-weight: 500; color: var(--white); }
.sum-total {
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  margin-top: 0.9rem;
  text-align: center;
}
.sum-total .sa {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
  color: var(--gold-light);
}
.sum-total .slab {
  font-size: 10px;
  color: #8fa3b8;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.trust-i {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: #8fa3b8;
  margin-top: 6px;
}
.trust-d { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }

/* --- Documents --- */
.doc-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.doc-tab {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11px;
  border: 0.5px solid var(--border-md);
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-sans);
  transition: var(--transition);
}
.doc-tab.act { background: var(--navy); color: var(--white); border-color: var(--navy); }

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.doc-card {
  background: var(--white);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.doc-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.doc-icon svg { width: 16px; height: 16px; fill: none; stroke-width: 1.5; }
.doc-name { font-size: 12px; font-weight: 500; }
.doc-meta { font-size: 11px; color: var(--text-muted); }
.doc-dl {
  background: none;
  border: 0.5px solid var(--border-md);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  cursor: pointer;
  color: var(--text-main);
  font-family: var(--font-sans);
  margin-top: 4px;
  transition: var(--transition);
  text-align: center;
}
.doc-dl:hover { background: var(--gray-100); }

/* --- Alert items --- */
.alert-item {
  display: flex;
  gap: 12px;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  align-items: flex-start;
}
.alert-item.info   { background: var(--info-bg);   border-left: 3px solid var(--info-bdr); }
.alert-item.warn   { background: var(--warn-bg);   border-left: 3px solid var(--warn-bdr); }
.alert-item.ok     { background: var(--success-bg); border-left: 3px solid var(--success-bdr); }
.alert-item.danger { background: var(--danger-bg); border-left: 3px solid var(--danger-bdr); }
.al-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.al-icon svg { width: 13px; height: 13px; fill: none; stroke-width: 2; }
.al-title { font-size: 12px; font-weight: 500; margin-bottom: 2px; }
.al-sub   { font-size: 11px; color: var(--text-muted); }
.al-time  { font-size: 10px; color: var(--text-light); margin-top: 3px; }

/* Alert params */
.alert-param {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--border);
  font-size: 12px;
}
.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: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.prof-box h3 { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 1rem; font-weight: 500; font-family: var(--font-sans); }
.prow { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 0.5px solid var(--border); font-size: 12px; }
.prow:last-child { border-bottom: none; }
.prow .plbl { color: var(--text-muted); }
.prow .pval { font-weight: 500; }

/* Score ring */
.sec-score { display: flex; align-items: center; gap: 12px; padding: 1rem; background: var(--gray-100); border-radius: var(--radius-md); margin-bottom: 1rem; }
.score-ring { width: 58px; height: 58px; border-radius: 50%; border: 3px solid var(--navy); display: flex; align-items: center; justify-content: center; flex-direction: column; flex-shrink: 0; }
.score-n { font-size: 16px; font-weight: 500; color: var(--navy); font-family: var(--font-serif); }
.score-l { font-size: 9px; color: var(--text-muted); }

/* --- 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; }
}
