/* Dashboard specific styles */

.page-header {
  padding: 32px 0 24px;
}
.page-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.page-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 6px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text);
}
.nav-links {
  display: flex;
  gap: 4px;
}
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text); background: var(--surface); }
.nav-link.active { color: var(--accent); background: rgba(212,168,83,0.08); }

/* ALERTS */
.alerts-section {
  padding: 0 0 24px;
}
.alerts-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.alert {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: 10px;
  border: 1px solid;
}
.alert.critical { background: var(--red-bg); border-color: rgba(232,112,90,0.3); color: var(--red); }
.alert.warning  { background: var(--orange-bg); border-color: rgba(212,168,83,0.3); color: var(--orange); }
.alert.ok       { background: rgba(122,173,142,0.08); border-color: rgba(122,173,142,0.25); color: var(--green); }
.alert .dsa-title { color: var(--text); font-size: 14px; font-weight: 600; }
.alert .dsa-desc  { color: var(--text-dim); font-size: 13px; }

/* MORNING OPEN — wrapper grouping missed / maturities / property tax cards */
.morning-section {
  padding: 0 0 24px;
}
.morning-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.morning-header {
  margin-bottom: 8px;
  padding-top: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.morning-header-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.morning-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
}
.morning-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.morning-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(232,112,90,0.35);
  white-space: nowrap;
}
.morning-chip--clear {
  background: var(--surface-2);
  color: var(--green);
  border-color: var(--border);
}

/* UPCOMING MATURITIES — proactive card */
.maturities-section {
  padding: 0 0 16px;
}
.maturities-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}
.maturities-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.maturities-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
}
.maturities-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.maturities-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.maturities-row {
  display: grid;
  grid-template-columns: 1.5fr 2fr 1fr 1.2fr 0.9fr;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
  text-decoration: none;
  color: inherit;
}
.maturities-row:last-child { border-bottom: none; }
.maturities-row:hover { background: var(--surface-2); }
.maturities-cell {
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.maturities-cell--borrower { font-weight: 600; }
.maturities-cell--property { color: var(--text-dim); }
.maturities-cell--balance {
  font-family: var(--font-display);
  font-weight: 700;
  text-align: right;
}
.maturities-cell--maturity {
  font-size: 13px;
  color: var(--text-dim);
}
.maturities-cell--days {
  text-align: right;
}
.maturities-days {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.maturities-days--soon {
  background: var(--orange-bg);
  color: var(--orange);
  border-color: rgba(212,168,83,0.35);
}
.maturities-days--imminent {
  background: var(--red-bg);
  color: var(--red);
  border-color: rgba(232,112,90,0.35);
}
.maturities-empty {
  padding: 24px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* MISSED PAYMENTS — proactive card */
.missed-section {
  padding: 0 0 16px;
}
.missed-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}
.missed-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.missed-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
}
.missed-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}
.missed-see-all {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
  margin-top: 4px;
}
.missed-see-all:hover { opacity: 0.8; }
.missed-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.missed-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
  text-decoration: none;
  color: inherit;
}
.missed-row:last-child { border-bottom: none; }
.missed-row:hover { background: var(--surface-2); }
.missed-cell {
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.missed-cell--borrower { font-weight: 600; }
.missed-cell--missed { text-align: right; }
.missed-cell--since { text-align: right; }
.missed-empty {
  padding: 24px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* PROPERTY TAX DUE — proactive card */
.proptax-section {
  padding: 0 0 16px;
}
.proptax-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}
.proptax-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.proptax-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange);
}
.proptax-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.proptax-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.proptax-row {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.proptax-row:last-child { border-bottom: none; }
.proptax-row:hover { background: var(--surface-2); }
.proptax-cell {
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.proptax-cell--property { font-weight: 600; }
.proptax-cell--due { font-size: 13px; color: var(--text-dim); }
.proptax-cell--amount {
  font-family: var(--font-display);
  font-weight: 700;
  text-align: right;
}
.proptax-empty {
  padding: 24px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.proptax-overflow {
  padding: 12px 20px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  text-align: center;
}

/* METRICS */
.metrics-section {
  padding: 0 0 32px;
}
.metrics-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr 1fr 1fr;
  gap: 16px;
}
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
}
/* Clickable metric card — late loans links to /dashboard/risk */
.metric-card--link {
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  color: inherit;
}
.metric-card--link:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}

/* Loading skeleton shimmer */
@keyframes mc-shimmer {
  0%   { opacity: 0.35; }
  50%  { opacity: 0.7;  }
  100% { opacity: 0.35; }
}
.mc-skeleton {
  background: var(--border);
  border-radius: 6px;
  min-width: 80px;
  color: transparent !important;
  animation: mc-shimmer 1.4s ease-in-out infinite;
  pointer-events: none;
  user-select: none;
}
.mc-skeleton-sub {
  background: var(--surface-2);
  border-radius: 4px;
  min-width: 120px;
  height: 14px;
  color: transparent !important;
  animation: mc-shimmer 1.4s ease-in-out infinite 0.2s;
  pointer-events: none;
  user-select: none;
  display: inline-block;
}
.mc-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.mc-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.mc-value.accent { color: var(--accent); }
.mc-value--alert { color: var(--red); }
.mc-slash { color: var(--text-muted); font-size: 22px; font-weight: 400; }
.mc-secondary { font-size: 20px; color: var(--text-dim); font-weight: 600; }
.mc-sub { font-size: 12px; color: var(--text-dim); }
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.ok { background: var(--green); }

/* Progress bar — monthly received vs expected */
.mc-progress-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin: 8px 0 6px;
}
.mc-progress-bar {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* Red badge for late count > 0 */
.mc-badge-red {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-display);
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  padding: 0 10px;
  letter-spacing: -0.5px;
}

/* LOANS TABLE */
.loans-section { padding: 0 0 80px; }
.loans-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}
.loans-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.loans-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.loans-table {
  width: 100%;
  border-collapse: collapse;
}
.loans-table thead tr {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.loans-table th {
  padding: 12px 16px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
}
.loans-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.loans-table tbody tr:last-child { border-bottom: none; }
.loans-table tbody tr:hover { background: var(--surface-2); }
.loans-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text);
  vertical-align: middle;
}
.td-name    { font-weight: 600; color: var(--text); }
.td-balance { font-family: var(--font-display); font-weight: 700; }
.td-rate    { color: var(--accent); }
.td-date    { color: var(--text-dim); font-size: 13px; }
.td-actions { text-align: right; width: 48px; }

.status-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.status-chip.ok     { background: rgba(122,173,142,0.15); color: var(--green); }
.status-chip.alert  { background: var(--red-bg);          color: var(--red); }
.status-chip.warn   { background: var(--orange-bg);       color: var(--orange); }
.status-chip.late   { background: var(--red-bg);          color: var(--red); }
.status-chip.maturing { background: var(--orange-bg);     color: var(--orange); }

/* Loan type badges */
.loan-type-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.loan-type-badge.io    { background: rgba(212,168,83,0.15); color: var(--orange); }
.loan-type-badge.amort { background: rgba(74,158,255,0.1);  color: var(--accent); }

/* Borrower link */
.borrower-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.borrower-link:hover { color: var(--accent); }

/* Search bar */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  padding: 9px 14px 9px 38px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  font-family: var(--font-body);
  width: 220px;
  transition: border-color 0.15s, width 0.2s;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  width: 280px;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:disabled { opacity: 0.6; }

/* EMPTY STATE */
.empty-state {
  padding: 60px 20px;
  text-align: center;
}
.empty-icon {
  width: 60px; height: 60px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  color: var(--text-muted);
}
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.empty-sub   { font-size: 13px; color: var(--text-muted); }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
  transition: opacity 0.15s, transform 0.1s;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #0a1510; }
.btn-ghost   { background: transparent; border: 1px solid var(--border); color: var(--text-dim); }
.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.btn-icon:hover { color: var(--red); background: var(--red-bg); }

/* MODAL */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700; color: var(--text);
}
#addLoanForm { padding: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-dim); letter-spacing: 0.04em; }
.form-input {
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  font-family: var(--font-body);
  transition: border-color 0.15s;
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-input::placeholder { color: var(--text-muted); }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* RESPONSIVE */
@media (max-width: 1100px) {
  .metrics-grid { grid-template-columns: 1fr 1fr 1fr; }
  .metric-card--wide { grid-column: span 1; }
}
@media (max-width: 900px) {
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-card--wide { grid-column: span 2; }
  .form-row { grid-template-columns: 1fr; }
  .page-header-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 600px) {
  .page-header-inner { padding: 0 20px; }
  .alerts-inner,
  .metrics-grid,
  .loans-inner,
  .morning-inner { padding: 0 20px; }
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-card--wide { grid-column: span 1; }
  .loans-table { font-size: 13px; }
  .loans-table td, .loans-table th { padding: 10px 12px; }
  .maturities-inner { padding: 0 20px; }
  .maturities-row {
    grid-template-columns: 1fr 0.8fr;
    gap: 8px;
    padding: 12px 16px;
  }
  .maturities-cell--property,
  .maturities-cell--maturity { display: none; }
  .missed-inner { padding: 0 20px; }
  .missed-row {
    grid-template-columns: 1.6fr 1fr;
    gap: 8px;
    padding: 12px 16px;
  }
  .missed-cell--missed { display: none; }
  .proptax-inner { padding: 0 20px; }
  .proptax-row {
    grid-template-columns: 2fr 1fr;
    gap: 8px;
    padding: 12px 16px;
  }
  .proptax-cell--due { display: none; }
}

/* RISK DASHBOARD */
.risk-section {
  padding: 0 0 40px;
}
.risk-section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}
.section-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 24px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.section-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
}

/* MATURITY LADDER */
.ladder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.ladder-bucket {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 18px;
}
.ladder-bucket--balloon {
  border-color: rgba(212, 168, 83, 0.35);
  background: rgba(212, 168, 83, 0.04);
}
.lb-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.lb-bar-wrap {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}
.lb-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.5s ease;
  min-width: 4px;
}
.lb-value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.lb-count {
  font-size: 12px;
  color: var(--text-dim);
}
.lb-tag {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 8px;
  background: rgba(212, 168, 83, 0.15);
  color: var(--orange);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.ladder-total {
  font-size: 13px;
  color: var(--text-dim);
  padding-top: 8px;
}

/* PAYMENT HEALTH */
.health-layout {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}
.donut-wrap {
  flex-shrink: 0;
  width: 160px;
}
.donut-svg {
  width: 160px;
  height: 160px;
}
.health-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hl-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.hl-info {
  flex: 1;
  min-width: 0;
}
.hl-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}
.hl-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.hl-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
  min-width: 2px;
}
.hl-metrics {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 90px;
}
.hl-principal {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.hl-pct {
  font-size: 11px;
  color: var(--text-dim);
}
.hl-count {
  font-size: 11px;
  color: var(--text-muted);
}

/* CONCENTRATION */
.conc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.conc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
}
.conc-card-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.conc-empty {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px 0;
}
.conc-table {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.conc-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.conc-rank {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 18px;
}
.conc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 120px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conc-warning-badge {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(232, 124, 90, 0.15);
  color: var(--red);
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-left: 4px;
}
.conc-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.conc-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.5s ease;
  min-width: 3px;
}
.conc-values {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 90px;
}
.conc-amt {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.conc-pct {
  font-size: 11px;
  color: var(--text-dim);
}
.conc-pct--warn {
  color: var(--red);
  font-weight: 600;
}
.conc-count {
  font-size: 11px;
  color: var(--text-muted);
}

/* RISK ALERTS LIST */
.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.risk-alert-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-radius: 10px;
  border: 1px solid;
}
.risk-alert-item.critical {
  background: var(--red-bg);
  border-color: rgba(232, 112, 90, 0.3);
}
.risk-alert-item.warning {
  background: var(--orange-bg);
  border-color: rgba(212, 168, 83, 0.3);
}
.rai-icon { flex-shrink: 0; }
.risk-alert-item.critical .rai-icon { color: var(--red); }
.risk-alert-item.warning  .rai-icon { color: var(--orange); }
.rai-body { flex: 1; min-width: 0; }
.rai-title { font-size: 14px; font-weight: 600; color: var(--text); }
.rai-desc  { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rai-type  {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 3px 8px;
  background: var(--surface-2);
  border-radius: 6px;
  white-space: nowrap;
}
.rai-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.rai-action:hover { opacity: 0.8; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .health-layout { flex-direction: column; }
  .conc-layout { grid-template-columns: 1fr; }
  .ladder-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .risk-section-inner { padding: 0 20px; }
  .ladder-grid { grid-template-columns: 1fr; }
  .conc-values { min-width: 70px; }
}

/* RISK SUMMARY BANNER */
.risk-summary-banner {
  padding: 0 0 28px;
}
.rsb-items {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.rsb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  flex: 1;
}
.rsb-item strong { color: var(--text); font-weight: 700; }
.rsb-item--ok { color: var(--text-dim); }
.rsb-item--ok svg { color: var(--green); }
.rsb-item--alert { color: var(--red); background: var(--red-bg); }
.rsb-item--alert strong { color: var(--red); }
.rsb-item--warn svg { color: var(--orange); }
.rsb-sep {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .rsb-items { flex-direction: column; }
  .rsb-sep { width: 100%; height: 1px; }
  .rsb-item { width: 100%; }
}

/* MONTHLY MATURITY CALENDAR */
.mcal-grid {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 200px;
  margin-bottom: 12px;
  padding-bottom: 4px;
}
.mcal-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
  height: 100%;
  justify-content: flex-end;
  border-radius: 6px;
  padding: 0 2px 6px;
  transition: background 0.15s;
}
.mcal-col--active {
  cursor: pointer;
}
.mcal-col--active:hover {
  background: rgba(212,168,83,0.06);
}
.mcal-col--open {
  background: rgba(212,168,83,0.1);
}
.mcal-col--beyond .mcal-bar { opacity: 0.35; }
.mcal-bar-wrap {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: flex-end;
  margin-bottom: 4px;
}
.mcal-bar {
  width: 100%;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  min-height: 3px;
  position: relative;
  transition: height 0.4s ease;
}
.mcal-bar--beyond {
  background: var(--text-muted);
}
.mcal-bar-count {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.mcal-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.02em;
}
.mcal-year {
  font-size: 9px;
  color: var(--text-muted);
  text-align: center;
}
.mcal-value {
  font-size: 9px;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Calendar detail panel */
.mcal-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
  animation: mcal-fade 0.15s ease;
}
@keyframes mcal-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mcal-detail-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.mcal-detail-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mcal-detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.mcal-detail-info { flex: 1; min-width: 0; }
.mcal-detail-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mcal-detail-prop {
  font-size: 11px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mcal-detail-meta {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.mcal-detail-bal {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
@media (max-width: 600px) {
  .mcal-grid { height: 160px; }
  .mcal-bar-wrap { height: 110px; }
  .mcal-bar-count { font-size: 9px; top: -14px; }
}

/* Toast — post-import success banner (and other transient notices) */
.toast {
  position: fixed;
  top: 80px;
  right: 24px;
  padding: 12px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  font-family: var(--font-sans, 'DM Sans', system-ui, sans-serif);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 2500;
  animation: toastSlideIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100vw - 48px);
}
.toast-success {
  background: #059669;
  color: #fff;
}
.toast-warning {
  background: #d97706;
  color: #fff;
}
.toast-error {
  background: #dc2626;
  color: #fff;
}
.toast .toast-close {
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  margin-left: 12px;
  cursor: pointer;
  opacity: 0.85;
  padding: 0 4px;
}
.toast .toast-close:hover {
  opacity: 1;
}
@keyframes toastSlideIn {
  from { transform: translateX(120%); }
  to { transform: translateX(0); }
}

/* WELCOME PANEL — first-run empty state */
.welcome-section {
  padding: 24px 24px 12px;
}
.welcome-inner {
  max-width: 920px;
  margin: 24px auto 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 56px 48px 44px;
  text-align: center;
}
.welcome-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 14px;
}
.welcome-headline {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  margin: 0 auto 36px;
  max-width: 640px;
}
.welcome-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.welcome-card {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 22px 18px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.1s, background 0.15s;
}
.welcome-card:hover {
  border-color: var(--accent);
  background: rgba(212, 168, 83, 0.05);
}
.welcome-card:active { transform: scale(0.98); }
.welcome-card-icon { font-size: 24px; margin-bottom: 10px; }
.welcome-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.welcome-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.welcome-sample {
  font-size: 13px;
  color: var(--text-muted);
}
.welcome-sample-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  text-decoration: underline;
}
.welcome-sample-link:hover { opacity: 0.85; }
@media (max-width: 720px) {
  .welcome-inner { padding: 36px 22px 28px; }
  .welcome-headline { font-size: 22px; }
  .welcome-cards { grid-template-columns: 1fr; }
}

/* ONBOARDING CHECKLIST — dismissible first-run banner */
.onboarding-checklist {
  padding: 0 24px 16px;
}
.onboarding-checklist-inner {
  max-width: 920px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 22px;
}
.onboarding-checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.onboarding-checklist-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
}
.onboarding-checklist-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.onboarding-checklist-dismiss:hover {
  background: var(--surface-2);
  color: var(--text);
}
.onboarding-checklist-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 28px;
}
.onboarding-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-dim);
}
.onboarding-check {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  position: relative;
}
.onboarding-item--done .onboarding-check {
  background: var(--green);
  border-color: var(--green);
}
.onboarding-item--done .onboarding-check::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1.5px;
  width: 5px;
  height: 9px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.onboarding-item--done .onboarding-item-text,
.onboarding-item--done .onboarding-item-link {
  color: var(--text-muted);
  text-decoration: line-through;
}
.onboarding-item-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.onboarding-item-link:hover { text-decoration: underline; }
@media (max-width: 720px) {
  .onboarding-checklist-list { grid-template-columns: 1fr; }
}