/* =====================================================
   Client Portal (Demo) — Dashboard styles
   ===================================================== */

.demo-banner {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.18), rgba(34, 211, 238, 0.12));
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.demo-banner strong { color: var(--text); }

/* Login gate */
.login-screen {
  min-height: calc(100vh - 190px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
}
.login-card .logo-mark { width: 52px; height: 52px; margin: 0 auto 20px; }
.login-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.login-card p { font-size: 0.92rem; }
.login-form { text-align: left; display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }

/* Dashboard shell */
.dash-shell { display: none; min-height: calc(100vh - 150px); }
.dash-shell.active { display: grid; grid-template-columns: 240px 1fr; }

.dash-sidebar {
  border-right: 1px solid var(--border);
  padding: 28px 18px;
  background: var(--bg-alt);
}
.dash-profile { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.dash-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--gradient); color: #060810; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dash-profile .name { font-weight: 700; font-size: 0.92rem; }
.dash-profile .role { font-size: 0.78rem; color: var(--text-dim); }

.dash-nav { display: flex; flex-direction: column; gap: 4px; }
.dash-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}
.dash-nav button:hover { background: var(--surface); color: var(--text); }
.dash-nav button.active { background: var(--surface-2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent-2); }
.dash-nav .logout-btn { margin-top: 20px; color: var(--danger); border-top: 1px solid var(--border); padding-top: 16px; border-radius: 0; }

.dash-main { padding: 32px; overflow-x: hidden; }
.dash-panel { display: none; }
.dash-panel.active { display: block; }
.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.dash-header h2 { margin: 0; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card .label { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 8px; }
.stat-card .value { font-size: 1.7rem; font-weight: 800; }
.stat-card .delta { font-size: 0.78rem; color: var(--success); }

.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 28px; }
.bar-chart { display: flex; align-items: flex-end; gap: 14px; height: 180px; margin-top: 20px; }
.bar-chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar-chart .bar { width: 100%; max-width: 34px; border-radius: 6px 6px 0 0; background: var(--gradient); }
.bar-chart .bar-label { font-size: 0.72rem; color: var(--text-dim); }

.dash-list { display: flex; flex-direction: column; gap: 14px; }
.dash-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  flex-wrap: wrap;
}
.dash-row .title { font-weight: 600; margin-bottom: 4px; }
.dash-row .meta { font-size: 0.82rem; color: var(--text-dim); }
.progress-track { width: 140px; height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.progress-fill { height: 100%; background: var(--gradient); }

.activity-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-2); margin-top: 6px; flex-shrink: 0; }
.activity-item .when { font-size: 0.78rem; color: var(--text-dim); }

.message-item { display: flex; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 12px; }
.message-item .msg-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.message-item .msg-body { flex: 1; }
.message-item .msg-head { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 4px; }
.message-item .msg-head .sender { font-weight: 700; }
.message-item .msg-head .time { color: var(--text-dim); }
.message-item p { margin: 0; font-size: 0.92rem; }

.settings-form { max-width: 480px; display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 900px) {
  .dash-shell.active { grid-template-columns: 1fr; }
  .dash-sidebar, .dash-main { min-width: 0; }
  .dash-sidebar { border-right: none; border-bottom: 1px solid var(--border); }
  .dash-nav { flex-direction: row; width: 100%; overflow-x: auto; padding-bottom: 6px; }
  .dash-nav button { flex-shrink: 0; }
  .dash-nav .logout-btn { border-top: none; margin-top: 0; }
  .dash-profile { display: none; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .dash-main { padding: 22px 18px; }
  .dash-row { flex-wrap: wrap; }
  .progress-track { max-width: 100%; }
}
