/* ═══════════════════════════════════════════════════════════
   MasjidBD v13 — Dashboard Page
   css/pages/dashboard.css
   ═══════════════════════════════════════════════════════════ */

.dashboard-page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-6) var(--gutter) var(--sp-12);
}

/* ─────────────────────────────────────────────────────────
   DASHBOARD HEADER
───────────────────────────────────────────────────────── */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}

.dash-header-left {}

.dash-welcome {
  font-size: var(--text-sm);
  color: var(--color-text-3);
  margin-bottom: var(--sp-1);
}

.dash-user-name {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--color-text);
  line-height: 1.1;
}

.dash-mosque-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--color-brand);
  font-weight: var(--weight-medium);
}

.dash-header-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.dash-date-block {
  text-align: right;
}

.dash-date-greg  { font-size: var(--text-sm); color: var(--color-text-2); }
.dash-date-hijri { font-size: var(--text-xs); color: var(--color-text-3); }

/* Notification bell */
.dash-bell-btn {
  position: relative;
  width: 42px; height: 42px;
  border-radius: var(--r-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: all var(--dur-fast);
}
.dash-bell-btn:hover { border-color: var(--color-brand); background: var(--color-surface-3); }

.dash-bell-badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--color-danger);
  color: #fff;
  font-size: 10px;
  font-weight: var(--weight-semi);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--color-canvas);
}

/* ─────────────────────────────────────────────────────────
   ROLE ALERT BANNER
───────────────────────────────────────────────────────── */
.dash-role-banner {
  background: linear-gradient(90deg, rgba(56,181,137,.12), rgba(56,181,137,.04));
  border: 1px solid rgba(56,181,137,.2);
  border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
  font-size: var(--text-sm);
}

.dash-role-banner-icon { font-size: 1.4rem; }
.dash-role-banner-text { color: var(--color-text-2); flex: 1; }
.dash-role-banner-text strong { color: var(--color-brand); }

/* ─────────────────────────────────────────────────────────
   KPI ROW
───────────────────────────────────────────────────────── */
.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.dash-kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: all var(--dur-base) var(--ease);
  position: relative;
  overflow: hidden;
}

.dash-kpi-card:hover { border-color: var(--color-brand); box-shadow: var(--shadow-md); }

[data-theme="glass"] .dash-kpi-card {
  background: var(--glass-bg);
  border-color: var(--glass-border);
}

.dash-kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--kpi-color, var(--color-brand));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base);
}
.dash-kpi-card:hover::before { transform: scaleX(1); }

.dash-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.dash-kpi-label {
  font-size: var(--text-xs);
  color: var(--color-text-3);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.dash-kpi-icon {
  width: 36px; height: 36px;
  border-radius: var(--r);
  background: var(--color-surface-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.dash-kpi-value {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--color-text);
  line-height: 1;
}

.dash-kpi-change {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

.dash-kpi-change.up   { color: var(--color-success); }
.dash-kpi-change.down { color: var(--color-danger); }
.dash-kpi-change.flat { color: var(--color-text-3); }

.dash-kpi-change-arrow { font-size: 12px; }

.dash-kpi-period { font-size: 10px; color: var(--color-text-3); margin-left: 4px; }

/* ─────────────────────────────────────────────────────────
   MAIN DASHBOARD GRID
───────────────────────────────────────────────────────── */
.dash-main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--sp-6);
  align-items: start;
}

.dash-main-left  { display: flex; flex-direction: column; gap: var(--sp-5); }
.dash-main-right { display: flex; flex-direction: column; gap: var(--sp-5); }

/* ─────────────────────────────────────────────────────────
   WIDGET BASE
───────────────────────────────────────────────────────── */
.dash-widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  overflow: hidden;
}

[data-theme="glass"] .dash-widget {
  background: var(--glass-bg);
  border-color: var(--glass-border);
}

.dash-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--color-border);
}

.dash-widget-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semi);
  color: var(--color-text);
}

.dash-widget-action {
  font-size: var(--text-xs);
  color: var(--color-brand);
  cursor: pointer;
  font-weight: var(--weight-medium);
  border: none;
  background: none;
  font-family: var(--font-sans);
  padding: 0;
}

.dash-widget-action:hover { text-decoration: underline; }

.dash-widget-body { padding: var(--sp-4) var(--sp-5); }

/* ─────────────────────────────────────────────────────────
   CHART PLACEHOLDER (replaced by real chart JS)
───────────────────────────────────────────────────────── */
.dash-chart-area {
  height: 220px;
  background: var(--color-sunken);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-3);
  font-size: var(--text-sm);
  position: relative;
  overflow: hidden;
}

/* Simple CSS bar chart for demo */
.dash-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
  height: 180px;
  padding: 0 var(--sp-4);
  position: relative;
}

.dash-bar-chart::before {
  content: '';
  position: absolute;
  left: var(--sp-4); right: var(--sp-4);
  bottom: 0; top: 0;
  background: repeating-linear-gradient(
    to top,
    var(--color-border) 0,
    var(--color-border) 1px,
    transparent 1px,
    transparent 25%
  );
}

.dash-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  z-index: 1;
}

.dash-bar {
  width: 100%;
  border-radius: var(--r) var(--r) 0 0;
  background: var(--color-brand);
  opacity: .75;
  transition: all var(--dur-base);
  min-height: 4px;
}

.dash-bar:hover { opacity: 1; transform: scaleX(1.05); }
.dash-bar.accent { background: var(--c-gold-500); }

.dash-bar-label {
  font-size: 10px;
  color: var(--color-text-3);
  text-align: center;
  white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────
   PRAYER TIMES WIDGET
───────────────────────────────────────────────────────── */
.dash-prayer-widget {}

.dash-prayer-list { display: flex; flex-direction: column; }

.dash-prayer-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}
.dash-prayer-row:last-child { border-bottom: none; }

.dash-prayer-icon { font-size: 18px; }
.dash-prayer-name { font-size: var(--text-sm); color: var(--color-text-2); flex: 1; }
.dash-prayer-time {
  font-variant-numeric: tabular-nums;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}
.dash-prayer-iqamah { font-size: 11px; color: var(--color-text-3); margin-top: 1px; text-align: right; }

.dash-prayer-row.current .dash-prayer-name { color: var(--color-brand); font-weight: var(--weight-medium); }
.dash-prayer-row.current .dash-prayer-time { color: var(--c-gold-600); }

.dash-prayer-row.current .dash-prayer-icon {
  animation: pulse 2s ease-in-out infinite;
}

/* ─────────────────────────────────────────────────────────
   QUICK ACTIONS
───────────────────────────────────────────────────────── */
.dash-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}

.dash-qa-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4);
  background: var(--color-surface-3);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all var(--dur-base);
  font-family: var(--font-sans);
}
.dash-qa-btn:hover {
  border-color: var(--color-brand);
  background: var(--color-surface);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.dash-qa-icon { font-size: 1.6rem; }
.dash-qa-label { font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--color-text-2); text-align: center; }

/* ─────────────────────────────────────────────────────────
   ANNOUNCEMENTS / NOTICES
───────────────────────────────────────────────────────── */
.dash-notice-list { display: flex; flex-direction: column; }

.dash-notice-item {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
}
.dash-notice-item:last-child { border-bottom: none; }
.dash-notice-item:hover .dash-notice-title { color: var(--color-brand); }

.dash-notice-icon-wrap {
  width: 36px; height: 36px;
  border-radius: var(--r);
  background: var(--color-surface-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.dash-notice-content { flex: 1; min-width: 0; }
.dash-notice-title   { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-text); margin-bottom: 2px; }
.dash-notice-meta    { font-size: var(--text-xs); color: var(--color-text-3); display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.dash-notice-unread  { width: 8px; height: 8px; border-radius: 50%; background: var(--color-brand); flex-shrink: 0; margin-top: 4px; }

/* ─────────────────────────────────────────────────────────
   MEMBERS TABLE (admin/govt)
───────────────────────────────────────────────────────── */
.dash-members-table-wrap {
  overflow-x: auto;
}

.dash-members-table {
  width: 100%;
  border-collapse: collapse;
}

.dash-members-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  color: var(--color-text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-sunken);
  white-space: nowrap;
}

.dash-members-table td {
  padding: 11px 14px;
  font-size: var(--text-sm);
  color: var(--color-text-2);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.dash-members-table tr:last-child td { border-bottom: none; }
.dash-members-table tbody tr:hover td { background: var(--color-surface-3); }

.dash-member-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--color-surface-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-right: var(--sp-2);
  vertical-align: middle;
}

.dash-member-name  { color: var(--color-text); font-weight: var(--weight-medium); }
.dash-role-pill    { display: inline-block; padding: 3px 10px; border-radius: var(--r-full); font-size: 11px; font-weight: var(--weight-medium); }
.dash-role-pill.imam      { background: rgba(99,102,241,.1); color: #6366f1; }
.dash-role-pill.volunteer { background: rgba(14,165,233,.1); color: #0ea5e9; }
.dash-role-pill.finance   { background: rgba(184,148,58,.1); color: var(--c-gold-600); }
.dash-role-pill.admin     { background: rgba(56,181,137,.1); color: var(--color-brand); }
.dash-role-pill.member    { background: var(--color-surface-3); color: var(--color-text-3); }
.dash-role-pill.govt      { background: rgba(220,38,38,.1); color: #dc2626; }

/* ─────────────────────────────────────────────────────────
   FINANCE MODULE
───────────────────────────────────────────────────────── */
.dash-finance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.dash-finance-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
}

[data-theme="glass"] .dash-finance-card {
  background: var(--glass-bg);
  border-color: var(--glass-border);
}

.dfc-label  { font-size: var(--text-xs); color: var(--color-text-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: var(--sp-2); }
.dfc-value  { font-family: var(--font-serif); font-size: 1.8rem; color: var(--color-text); }
.dfc-sub    { font-size: var(--text-xs); color: var(--color-text-3); margin-top: 4px; }

.dfc-value.income { color: var(--color-success); }
.dfc-value.expense { color: var(--color-danger); }

/* Ledger rows */
.dash-ledger { display: flex; flex-direction: column; }

.dash-ledger-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--color-border);
}
.dash-ledger-row:last-child { border-bottom: none; }

.dash-ledger-icon {
  width: 36px; height: 36px;
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.dash-ledger-icon.income  { background: var(--color-success-bg); }
.dash-ledger-icon.expense { background: var(--color-danger-bg); }

.dash-ledger-desc { flex: 1; }
.dash-ledger-title { font-size: var(--text-sm); color: var(--color-text); font-weight: var(--weight-medium); }
.dash-ledger-date  { font-size: var(--text-xs); color: var(--color-text-3); }

.dash-ledger-amount {
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  font-variant-numeric: tabular-nums;
}
.dash-ledger-amount.income  { color: var(--color-success); }
.dash-ledger-amount.expense { color: var(--color-danger); }

/* ─────────────────────────────────────────────────────────
   VOLUNTEER TASK LIST
───────────────────────────────────────────────────────── */
.dash-task-list { display: flex; flex-direction: column; gap: var(--sp-3); }

.dash-task-item {
  background: var(--color-surface-3);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  transition: all var(--dur-base);
}

.dash-task-item:hover { border-color: var(--color-brand); }
.dash-task-item.done  { opacity: .5; }

.dash-task-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  transition: all var(--dur-fast);
  display: flex; align-items: center; justify-content: center;
  background: none;
}
.dash-task-check:hover { border-color: var(--color-brand); }
.dash-task-item.done .dash-task-check {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #fff;
}

.dash-task-content { flex: 1; }
.dash-task-title   { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-text); margin-bottom: 2px; }
.dash-task-item.done .dash-task-title { text-decoration: line-through; color: var(--color-text-3); }
.dash-task-due     { font-size: var(--text-xs); color: var(--color-text-3); }
.dash-task-due.overdue { color: var(--color-danger); }

.dash-task-priority {
  font-size: 10px;
  font-weight: var(--weight-semi);
  padding: 2px 8px;
  border-radius: var(--r-full);
  margin-left: auto;
  flex-shrink: 0;
}

.dash-task-priority.high   { background: var(--color-danger-bg);  color: var(--color-danger); }
.dash-task-priority.medium { background: rgba(245,158,11,.1);      color: #d97706; }
.dash-task-priority.low    { background: var(--color-success-bg);  color: var(--color-success); }

/* ─────────────────────────────────────────────────────────
   PDF DOCUMENTS MODULE
───────────────────────────────────────────────────────── */
.dash-docs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}

.dash-doc-card {
  background: var(--color-surface-3);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  text-align: center;
  cursor: pointer;
  transition: all var(--dur-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
}

.dash-doc-card:hover {
  border-color: var(--color-brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.dash-doc-icon  { font-size: 2rem; }
.dash-doc-label { font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--color-text-2); line-height: 1.3; }
.dash-doc-size  { font-size: 10px; color: var(--color-text-3); }

/* ─────────────────────────────────────────────────────────
   GOVT MODULE
───────────────────────────────────────────────────────── */
.dash-govt-map-widget {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--color-sunken);
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  color: var(--color-text-3);
  border: 1px solid var(--color-border);
}

/* District table for govt */
.dash-district-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}

.dash-div-card {
  background: var(--color-surface-3);
  border-radius: var(--r-lg);
  border: 1px solid var(--color-border);
  padding: var(--sp-4);
  text-align: center;
  cursor: pointer;
  transition: all var(--dur-base);
}
.dash-div-card:hover { border-color: var(--color-brand); transform: translateY(-2px); }

.dash-div-name  { font-size: var(--text-sm); font-weight: var(--weight-semi); color: var(--color-text); margin-bottom: var(--sp-2); }
.dash-div-mosques { font-family: var(--font-serif); font-size: 1.5rem; color: var(--color-brand); }
.dash-div-label { font-size: 10px; color: var(--color-text-3); margin-top: 2px; }

/* ─────────────────────────────────────────────────────────
   CHAT / AI ASSISTANT (inline panel)
───────────────────────────────────────────────────────── */
.chat-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--color-brand);
  border: none;
  box-shadow: 0 6px 24px rgba(11,61,46,.35);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: var(--z-fixed);
  transition: all var(--dur-base) var(--ease);
}
.chat-fab:hover { background: var(--color-brand-hover); transform: scale(1.08); box-shadow: 0 8px 32px rgba(11,61,46,.45); }

[data-theme="glass"] .chat-fab {
  background: rgba(56,181,137,.8);
  backdrop-filter: blur(12px);
}

.chat-fab svg { width: 26px; height: 26px; stroke: #fff; }

.badge-unread {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 20px; height: 20px;
  border-radius: 10px;
  background: var(--color-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--color-canvas);
  padding: 0 4px;
}

/* Chat window */
.chat-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 360px;
  max-height: 540px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl, 0 25px 60px rgba(0,0,0,.25));
  z-index: var(--z-fixed);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: scaleIn var(--dur-base) var(--ease);
  transform-origin: bottom right;
}

.chat-window.open { display: flex; }

[data-theme="glass"] .chat-window {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  border-color: var(--glass-border);
}

.chat-win-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--color-brand);
  color: #fff;
  flex-shrink: 0;
}

.chat-win-avatar { font-size: 1.4rem; }
.chat-win-name   { font-size: var(--text-sm); font-weight: var(--weight-semi); flex: 1; }
.chat-win-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  opacity: .8;
}
.chat-win-status::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-green-300, #6ee7b7);
  animation: pulse 2s ease-in-out infinite;
}

.chat-win-close {
  width: 28px; height: 28px;
  border-radius: var(--r);
  background: rgba(255,255,255,.15);
  border: none;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  font-family: var(--font-sans);
  transition: background var(--dur-fast);
}
.chat-win-close:hover { background: rgba(255,255,255,.25); }

/* Messages area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  scrollbar-width: thin;
}

.chat-msg {
  display: flex;
  gap: var(--sp-2);
  max-width: 85%;
}

.chat-msg.user { flex-direction: row-reverse; align-self: flex-end; }
.chat-msg.bot  { align-self: flex-start; }

.chat-msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--color-surface-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  align-self: flex-end;
}

.chat-msg-bubble {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-lg);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.chat-msg.bot .chat-msg-bubble {
  background: var(--color-surface-3);
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 4px;
  color: var(--color-text);
}

.chat-msg.user .chat-msg-bubble {
  background: var(--color-brand);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg-time { font-size: 10px; color: var(--color-text-3); margin-top: 4px; display: block; }
.chat-msg.user .chat-msg-time { text-align: right; }

/* Typing indicator */
.chat-typing {
  display: flex;
  gap: 4px;
  padding: var(--sp-2) var(--sp-3);
  background: var(--color-surface-3);
  border-radius: var(--r-lg);
  width: fit-content;
}

.chat-typing-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--color-text-3);
  animation: blink 1.2s ease-in-out infinite;
}
.chat-typing-dot:nth-child(2) { animation-delay: .15s; }
.chat-typing-dot:nth-child(3) { animation-delay: .30s; }

/* Input row */
.chat-input-row {
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  background: var(--color-sunken);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--dur-fast);
  resize: none;
}
.chat-input:focus { border-color: var(--color-brand); }

.chat-send-btn {
  width: 38px; height: 38px;
  border-radius: var(--r);
  background: var(--color-brand);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: #fff;
  transition: background var(--dur-fast);
  flex-shrink: 0;
}
.chat-send-btn:hover { background: var(--color-brand-hover); }
.chat-send-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Quick reply chips */
.chat-quick-replies {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  padding: 0 var(--sp-4) var(--sp-2);
}

.chat-quick-btn {
  padding: 5px 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: var(--text-xs);
  color: var(--color-text-2);
  cursor: pointer;
  transition: all var(--dur-fast);
  font-family: var(--font-sans);
}
.chat-quick-btn:hover { border-color: var(--color-brand); color: var(--color-brand); }
