/* Dashboard-specific styles for /demo */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body { font-family: 'DM Sans', sans-serif; background: #0a1628; color: #f0f4f8; min-height: 100vh; }

.demo-banner {
  background: linear-gradient(135deg, #1a2d1a 0%, #0f2010 100%);
  border-bottom: 1px solid rgba(0,200,150,0.3);
  padding: 10px 24px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: #aabbaa;
  position: sticky; top: 0; z-index: 100;
}
.demo-banner .banner-left { display: flex; align-items: center; gap: 10px; }
.demo-banner .pulse-dot { width: 8px; height: 8px; background: #00D4AA; border-radius: 50%; animation: pulse 2s infinite; }
.demo-banner strong { color: #00D4AA; }
.demo-banner .back-link {
  color: #8899aa; text-decoration: none; font-size: 12px;
  padding: 4px 12px; border: 1px solid rgba(136,153,170,0.3); border-radius: 6px; transition: all 0.2s;
}
.demo-banner .back-link:hover { color: #f0f4f8; border-color: rgba(240,244,248,0.3); }

.dash-header { padding: 24px 32px 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.dash-title { display: flex; align-items: center; gap: 12px; }
.dash-title .logo { font-size: 20px; font-weight: 700; color: #f0f4f8; }
.dash-title .logo span { color: #00D4AA; }
.dash-title .badge { background: rgba(0,212,170,0.1); border: 1px solid rgba(0,212,170,0.3); color: #00D4AA; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px; }
.dash-actions { display: flex; align-items: center; gap: 10px; }

.btn { padding: 8px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; font-family: inherit; }
.btn-primary { background: #00D4AA; color: #0a1628; }
.btn-primary:hover { background: #00C896; transform: translateY(-1px); }
.btn-primary:disabled { background: #1a4a3a; color: #4a7a6a; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: #8899aa; border: 1px solid rgba(136,153,170,0.3); }
.btn-ghost:hover { color: #f0f4f8; border-color: rgba(240,244,248,0.3); }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; padding: 24px 32px 0; }
.stat-card { background: #132040; border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; padding: 20px; }
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: #8899aa; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: #f0f4f8; }
.stat-value.critical { color: #ff4d4d; }
.stat-value.warning { color: #f5a623; }
.stat-value.healthy { color: #00D4AA; }
.stat-sub { font-size: 12px; color: #8899aa; margin-top: 4px; }

.dash-body { display: grid; grid-template-columns: 1fr 380px; gap: 20px; padding: 20px 32px 32px; }
@media (max-width: 1100px) { .dash-body { grid-template-columns: 1fr; } }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-size: 14px; font-weight: 600; color: #8899aa; text-transform: uppercase; letter-spacing: 0.6px; }
.section-count { font-size: 12px; color: #8899aa; background: rgba(255,255,255,0.05); padding: 2px 8px; border-radius: 10px; }

.table-container { background: #132040; border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; overflow: hidden; }
.facilities-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.facilities-table thead { background: rgba(255,255,255,0.03); border-bottom: 1px solid rgba(255,255,255,0.06); }
.facilities-table th { padding: 12px 16px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: #5a6a7a; }
.facilities-table td { padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.facilities-table tbody tr:last-child td { border-bottom: none; }
.facilities-table tbody tr:hover { background: rgba(255,255,255,0.02); }

.borrower-name { font-weight: 600; color: #e0e8f0; font-size: 13px; }
.borrower-sub { font-size: 11px; color: #5a6a7a; margin-top: 2px; }

.type-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; }
.type-CRE { background: rgba(100,160,255,0.15); color: #6484c8; }
.type-CI  { background: rgba(160,100,255,0.15); color: #9864c8; }
.type-ABL { background: rgba(255,180,60,0.15);  color: #c8962a; }

.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.status-critical { background: rgba(255,77,77,0.12); color: #ff6666; }
.status-critical::before { background: #ff4d4d; }
.status-warning  { background: rgba(245,166,35,0.12); color: #f5b542; }
.status-warning::before  { background: #f5a623; }
.status-healthy  { background: rgba(0,200,150,0.12); color: #00C896; }
.status-healthy::before  { background: #00C896; }

.metric-value { font-family: 'DM Mono', monospace; font-size: 13px; color: #c0ccd8; }
.metric-breach { color: #ff4d4d; font-weight: 600; }
.metric-warn   { color: #f5a623; }
.metric-na     { color: #3a4a5a; }

.alerts-panel { display: flex; flex-direction: column; gap: 20px; }
.alerts-list { display: flex; flex-direction: column; gap: 10px; }

.alert-card { background: #132040; border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; padding: 14px 16px; transition: all 0.2s; }
.alert-card.critical { border-left: 3px solid #ff4d4d; }
.alert-card.warning  { border-left: 3px solid #f5a623; }
.alert-card.acknowledged { opacity: 0.45; }
.alert-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.alert-type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; padding: 2px 7px; border-radius: 4px; }
.alert-type.critical { background: rgba(255,77,77,0.15); color: #ff6666; }
.alert-type.warning  { background: rgba(245,166,35,0.15); color: #f5b542; }
.alert-borrower { font-size: 12px; font-weight: 600; color: #c0ccd8; margin-bottom: 4px; }
.alert-message  { font-size: 12px; color: #8899aa; line-height: 1.4; }
.alert-detail   { font-size: 11px; color: #5a6a7a; line-height: 1.4; margin-top: 6px; }

.ack-btn { font-size: 11px; padding: 4px 10px; border-radius: 5px; background: transparent; border: 1px solid rgba(136,153,170,0.25); color: #8899aa; cursor: pointer; font-family: inherit; white-space: nowrap; transition: all 0.2s; flex-shrink: 0; }
.ack-btn:hover { border-color: rgba(0,212,170,0.4); color: #00D4AA; }
.ack-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ack-label { font-size: 11px; color: #4a6a5a; }

.runs-list { display: flex; flex-direction: column; gap: 8px; }
.run-card { background: #0f1f38; border: 1px solid rgba(255,255,255,0.05); border-radius: 8px; padding: 12px 14px; font-size: 12px; }
.run-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.run-status { font-size: 11px; font-weight: 600; }
.run-status.complete { color: #00D4AA; }
.run-status.running  { color: #f5a623; }
.run-status.failed   { color: #ff4d4d; }
.run-time    { font-size: 11px; color: #4a5a6a; font-family: 'DM Mono', monospace; }
.run-summary { color: #7a8a9a; line-height: 1.4; }

.loading { display: flex; align-items: center; justify-content: center; padding: 60px; color: #4a5a6a; font-size: 14px; gap: 10px; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(0,212,170,0.2); border-top-color: #00D4AA; border-radius: 50%; animation: spin 0.8s linear infinite; }

.toast { position: fixed; bottom: 24px; right: 24px; background: #162848; border: 1px solid rgba(0,212,170,0.3); color: #00D4AA; padding: 12px 18px; border-radius: 10px; font-size: 13px; font-weight: 500; transform: translateY(80px); opacity: 0; transition: all 0.3s; z-index: 1000; }
.toast.show  { transform: translateY(0); opacity: 1; }
.toast.error { border-color: rgba(255,77,77,0.3); color: #ff6666; }

@keyframes pulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:0.5; transform:scale(0.85); } }
@keyframes spin   { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .facilities-table th:nth-child(4), .facilities-table td:nth-child(4),
  .facilities-table th:nth-child(5), .facilities-table td:nth-child(5) { display: none; }
  .dash-header, .stats-row, .dash-body { padding-left: 16px; padding-right: 16px; }
}
