/* ============================================================
   CLAIM4ME DASHBOARD — Styles
   ============================================================ */
:root {
  --c4-green:    #1F4C49;
  --c4-green-dk: #163632;
  --c4-green-lt: #2d6e6a;
  --c4-sage:     #e8f0ef;
  --c4-sage-dk:  #d1e2df;
  --c4-white:    #ffffff;
  --c4-off:      #f7fafa;
  --c4-text:     #1a2e2d;
  --c4-muted:    #6b7b7a;
  --c4-border:   #dce9e7;
  --c4-yellow:   #f5c84a;
  --c4-red:      #e05252;
  --c4-blue:     #3b82f6;
  --c4-success:  #22c55e;
  --c4-warn:     #f59e0b;

  --sidebar-w:   240px;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 1px 4px rgba(0,0,0,0.07), 0 4px 20px rgba(0,0,0,0.05);
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
  --transition:  0.2s ease;
  --font:        'DM Sans', 'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--c4-off);
  color: var(--c4-text);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ───────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--c4-green);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-decoration: none;
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: var(--c4-yellow);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900; color: var(--c4-green);
}
.sidebar-logo-text {
  font-size: 17px; font-weight: 800; color: #fff;
  letter-spacing: -0.02em;
}

.sidebar-section {
  padding: 20px 12px 8px;
}
.sidebar-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: rgba(255,255,255,0.4);
  padding: 0 8px; margin-bottom: 6px;
}
.sidebar-nav { list-style: none; }
.sidebar-nav li + li { margin-top: 2px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.75); text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.sidebar-nav a.active {
  background: rgba(255,255,255,0.15); color: #fff; font-weight: 700;
}
.sidebar-nav a svg { opacity: 0.7; flex-shrink: 0; }
.sidebar-nav a.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto;
  background: var(--c4-yellow);
  color: var(--c4-green);
  font-size: 10px; font-weight: 800;
  padding: 2px 7px; border-radius: 100px;
}

.sidebar-claim-card {
  margin: 12px; padding: 14px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.12);
}
.sidebar-claim-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5); margin-bottom: 4px;
}
.sidebar-claim-id {
  font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 2px;
}
.sidebar-claim-type {
  font-size: 12px; color: rgba(255,255,255,0.6);
}
.sidebar-claim-status {
  margin-top: 10px;
  display: flex; align-items: center; gap: 6px;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c4-yellow);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(1.3); }
}
.sidebar-claim-status-text {
  font-size: 12px; color: var(--c4-yellow); font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
}
.sidebar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--c4-sage-dk);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--c4-green);
  flex-shrink: 0;
}
.sidebar-user-name {
  font-size: 13px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-email {
  font-size: 11px; color: rgba(255,255,255,0.5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Main layout ───────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top bar ───────────────────────────────────────── */
.topbar {
  background: var(--c4-white);
  border-bottom: 1px solid var(--c4-border);
  padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-claim-info h1 {
  font-size: 18px; font-weight: 800;
  letter-spacing: -0.03em; color: var(--c4-text);
}
.topbar-claim-meta {
  font-size: 13px; color: var(--c4-muted); margin-top: 2px;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 100px;
  font-family: var(--font); font-size: 13px; font-weight: 700;
  cursor: pointer; text-decoration: none; border: none;
  transition: all var(--transition);
}
.btn-primary {
  background: var(--c4-green); color: #fff;
}
.btn-primary:hover { background: var(--c4-green-lt); }
.btn-ghost {
  background: transparent; color: var(--c4-text);
  border: 1.5px solid var(--c4-border);
}
.btn-ghost:hover { border-color: var(--c4-green); color: var(--c4-green); }
.btn svg { width: 15px; height: 15px; }

.notification-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--c4-sage); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  position: relative; transition: background var(--transition);
}
.notification-btn:hover { background: var(--c4-sage-dk); }
.notification-dot {
  position: absolute; top: 7px; right: 7px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c4-red); border: 2px solid var(--c4-white);
}

/* ── Content area ──────────────────────────────────── */
.content {
  padding: 28px 32px;
  flex: 1;
}
.content-section {
  margin-bottom: 28px;
}
.section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--c4-muted);
  margin-bottom: 14px;
}

/* ── Cards ─────────────────────────────────────────── */
.card {
  background: var(--c4-white);
  border-radius: var(--radius);
  border: 1px solid var(--c4-border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 18px 22px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.card-title {
  font-size: 15px; font-weight: 800;
  letter-spacing: -0.02em; color: var(--c4-text);
}
.card-body { padding: 18px 22px; }
.card-subtitle {
  font-size: 13px; color: var(--c4-muted); margin-top: 2px;
}

/* ── Grid layouts ──────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-left-heavy { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.grid-right-heavy { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }

/* ── STATUS TIMELINE ───────────────────────────────── */
.timeline-wrap {
  padding: 24px 22px;
}
.timeline {
  display: flex;
  align-items: flex-start;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  top: 20px; left: 20px; right: 20px;
  height: 2px;
  background: var(--c4-border);
  z-index: 0;
}
.timeline-progress-bar {
  position: absolute;
  top: 20px; left: 20px;
  height: 2px;
  background: var(--c4-green);
  z-index: 1;
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}
.timeline-step {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 10px; position: relative; z-index: 2;
}
.step-node {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--c4-border);
  background: var(--c4-white);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--c4-muted);
  transition: all 0.4s ease;
  position: relative;
}
.step-node.done {
  background: var(--c4-green); border-color: var(--c4-green); color: #fff;
}
.step-node.active {
  background: var(--c4-white); border-color: var(--c4-green);
  color: var(--c4-green); box-shadow: 0 0 0 4px rgba(31,76,73,0.12);
}
.step-node.active::after {
  content: '';
  position: absolute; inset: 4px; border-radius: 50%;
  border: 2px solid var(--c4-green);
  animation: spin-ring 1.5s linear infinite;
}
@keyframes spin-ring {
  to { transform: rotate(360deg); }
}
.step-info { text-align: center; }
.step-name {
  font-size: 12px; font-weight: 700; color: var(--c4-text);
}
.step-name.muted { color: var(--c4-muted); }
.step-time {
  font-size: 11px; color: var(--c4-muted); margin-top: 2px;
}
.step-checkmark {
  width: 18px; height: 18px;
}

/* ── AI PROCESSING CARD ─────────────────────────────── */
.ai-card {
  background: linear-gradient(135deg, var(--c4-green) 0%, var(--c4-green-lt) 100%);
  border: none;
  color: #fff;
}
.ai-card .card-title { color: #fff; }
.ai-card .card-subtitle { color: rgba(255,255,255,0.65); }

.ai-pulse-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; background: rgba(255,255,255,0.1);
  border-radius: var(--radius-sm); margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.15);
}
.ai-pulse-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  animation: ai-breathe 2s ease-in-out infinite;
}
@keyframes ai-breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.08); opacity: 0.8; }
}
.ai-current-task {
  font-size: 13px; font-weight: 600; color: #fff;
}
.ai-task-detail {
  font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 2px;
}

.ai-steps { display: flex; flex-direction: column; gap: 8px; }
.ai-step {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: rgba(255,255,255,0.7);
}
.ai-step.done { color: rgba(255,255,255,0.95); }
.ai-step.active { color: #fff; font-weight: 600; }
.ai-step-dot {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
}
.ai-step-dot.done    { background: rgba(255,255,255,0.25); }
.ai-step-dot.active  { background: var(--c4-yellow); animation: ai-breathe 1.5s infinite; }
.ai-step-dot.pending { background: rgba(255,255,255,0.1); }
.ai-step-dot svg { width: 12px; height: 12px; }

.ai-progress-bar-wrap {
  margin-top: 16px;
}
.ai-progress-label {
  display: flex; justify-content: space-between;
  font-size: 11px; color: rgba(255,255,255,0.6); margin-bottom: 6px;
}
.ai-progress-track {
  height: 5px; background: rgba(255,255,255,0.15); border-radius: 100px; overflow: hidden;
}
.ai-progress-fill {
  height: 100%; background: var(--c4-yellow); border-radius: 100px;
  transition: width 1.5s ease;
}

/* ── NEXT STEPS PANEL ──────────────────────────────── */
.steps-list { display: flex; flex-direction: column; gap: 0; }
.step-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--c4-border);
}
.step-item:last-child { border-bottom: none; }
.step-item-icon {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.step-item-icon.done    { background: #dcfce7; }
.step-item-icon.active  { background: #fef9c3; }
.step-item-icon.pending { background: var(--c4-sage); }
.step-item-icon svg { width: 15px; height: 15px; }
.step-item-content {}
.step-item-title {
  font-size: 14px; font-weight: 700; color: var(--c4-text);
}
.step-item-title.muted { color: var(--c4-muted); font-weight: 500; }
.step-item-desc {
  font-size: 12px; color: var(--c4-muted); margin-top: 2px; line-height: 1.5;
}
.step-item-time {
  font-size: 11px; color: var(--c4-muted); margin-top: 4px; font-style: italic;
}

/* ── COMMUNICATION LOG ─────────────────────────────── */
.comm-log { display: flex; flex-direction: column; gap: 0; }
.comm-entry {
  display: flex; gap: 14px; padding: 16px 0;
  border-bottom: 1px solid var(--c4-border);
  position: relative;
}
.comm-entry:last-child { border-bottom: none; }
.comm-icon {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.comm-icon.c4    { background: var(--c4-sage); }
.comm-icon.ins   { background: #fef3c7; }
.comm-icon.sys   { background: #ede9fe; }
.comm-body {}
.comm-header {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.comm-actor {
  font-size: 13px; font-weight: 700; color: var(--c4-text);
}
.comm-arrow {
  font-size: 12px; color: var(--c4-muted);
}
.comm-target {
  font-size: 13px; color: var(--c4-muted);
}
.comm-tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 8px; border-radius: 100px; margin-left: auto;
}
.comm-tag.sent     { background: #dcfce7; color: #15803d; }
.comm-tag.received { background: #dbeafe; color: #1d4ed8; }
.comm-tag.internal { background: #ede9fe; color: #7c3aed; }
.comm-tag.escalate { background: #fee2e2; color: #b91c1c; }
.comm-msg {
  font-size: 13px; color: var(--c4-text); margin-top: 5px; line-height: 1.55;
}
.comm-date {
  font-size: 11px; color: var(--c4-muted); margin-top: 4px;
}
.comm-decoder {
  margin-top: 10px; padding: 10px 12px;
  background: var(--c4-sage); border-radius: var(--radius-sm);
  border-left: 3px solid var(--c4-green);
}
.comm-decoder-label {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--c4-green); margin-bottom: 4px;
}
.comm-decoder-text {
  font-size: 12px; color: var(--c4-text); line-height: 1.5;
}

/* ── DOCUMENT VAULT ─────────────────────────────────── */
.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--c4-border);
  background: var(--c4-white);
  transition: border-color var(--transition);
}
.doc-item:hover { border-color: var(--c4-green); }
.doc-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 18px;
}
.doc-icon.pdf  { background: #fee2e2; }
.doc-icon.img  { background: #dbeafe; }
.doc-icon.c4   { background: var(--c4-sage); }
.doc-info { flex: 1; min-width: 0; }
.doc-name {
  font-size: 13px; font-weight: 700; color: var(--c4-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.doc-meta {
  font-size: 11px; color: var(--c4-muted); margin-top: 2px;
}
.doc-tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 3px 8px; border-radius: 100px;
}
.doc-tag.yours   { background: var(--c4-sage); color: var(--c4-green); }
.doc-tag.insurer { background: #fef3c7; color: #92400e; }
.doc-tag.c4      { background: #ede9fe; color: #5b21b6; }
.doc-actions {
  display: flex; gap: 4px; flex-shrink: 0;
}
.doc-btn {
  width: 30px; height: 30px; border-radius: 6px;
  border: 1px solid var(--c4-border); background: var(--c4-white);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.doc-btn:hover { background: var(--c4-sage); border-color: var(--c4-green); }
.doc-btn svg { width: 14px; height: 14px; color: var(--c4-muted); }

.doc-upload-zone {
  margin-top: 12px; padding: 20px;
  border: 2px dashed var(--c4-border);
  border-radius: var(--radius-sm);
  text-align: center; cursor: pointer;
  transition: all var(--transition);
}
.doc-upload-zone:hover {
  border-color: var(--c4-green); background: var(--c4-sage);
}
.doc-upload-icon { font-size: 24px; margin-bottom: 6px; }
.doc-upload-text { font-size: 13px; color: var(--c4-muted); }
.doc-upload-text strong { color: var(--c4-green); }

/* ── CLAIM STRENGTH ─────────────────────────────────── */
.strength-gauge-wrap {
  display: flex; flex-direction: column; align-items: center; padding: 8px 0 16px;
}
.gauge-svg { width: 160px; height: 90px; overflow: visible; }
.gauge-track { fill: none; stroke: var(--c4-border); stroke-width: 14; }
.gauge-fill  {
  fill: none; stroke-width: 14;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4,0,0.2,1);
}
.gauge-score {
  font-size: 32px; font-weight: 900; fill: var(--c4-text);
  font-family: var(--font); letter-spacing: -0.04em;
}
.gauge-label {
  font-size: 12px; fill: var(--c4-muted); font-family: var(--font);
}
.strength-verdict {
  font-size: 16px; font-weight: 800; color: var(--c4-text);
  margin-top: 6px; letter-spacing: -0.02em;
}
.strength-reason {
  font-size: 12px; color: var(--c4-muted); text-align: center;
  line-height: 1.5; margin-top: 6px; max-width: 200px;
}

.strength-factors { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.strength-factor {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--c4-text);
}
.strength-factor-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.strength-factor-dot.good { background: var(--c4-success); }
.strength-factor-dot.warn { background: var(--c4-warn); }
.strength-factor-dot.bad  { background: var(--c4-red); }

/* ── SETTLEMENT ESTIMATOR ──────────────────────────── */
.settlement-range {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 16px; padding: 16px 0 20px; border-bottom: 1px solid var(--c4-border);
}
.settlement-min, .settlement-max {
  text-align: center;
}
.settlement-amount {
  font-size: 26px; font-weight: 900; letter-spacing: -0.03em; color: var(--c4-text);
}
.settlement-sublabel {
  font-size: 11px; color: var(--c4-muted); margin-top: 2px;
}
.settlement-dash {
  font-size: 22px; color: var(--c4-border); font-weight: 300; margin-bottom: 18px;
}
.settlement-track-wrap { padding: 12px 0; }
.settlement-track {
  height: 8px; background: var(--c4-sage); border-radius: 100px; position: relative;
}
.settlement-fill {
  position: absolute; top: 0; left: 15%; right: 5%; height: 100%;
  background: linear-gradient(90deg, #fbbf24 0%, var(--c4-green) 100%);
  border-radius: 100px;
  transition: all 1.2s ease;
}
.settlement-track-labels {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--c4-muted); margin-top: 5px;
}
.settlement-note {
  font-size: 12px; color: var(--c4-muted); line-height: 1.5;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--c4-border);
}
.settlement-clauses { margin-top: 12px; }
.settlement-clause {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px; color: var(--c4-text); padding: 6px 0;
  border-bottom: 1px solid var(--c4-border);
}
.settlement-clause:last-child { border-bottom: none; }
.clause-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }

/* ── NOTIFICATIONS PANEL ───────────────────────────── */
.notif-list { display: flex; flex-direction: column; gap: 6px; }
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px; background: var(--c4-white);
  border-radius: var(--radius-sm); border: 1px solid var(--c4-border);
}
.notif-item.unread { border-left: 3px solid var(--c4-green); background: var(--c4-sage); }
.notif-emoji { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.notif-content {}
.notif-msg {
  font-size: 13px; color: var(--c4-text); font-weight: 500; line-height: 1.45;
}
.notif-item.unread .notif-msg { font-weight: 700; }
.notif-time { font-size: 11px; color: var(--c4-muted); margin-top: 3px; }

/* ── PREF TOGGLES ───────────────────────────────────── */
.pref-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--c4-border);
}
.pref-row:last-child { border-bottom: none; }
.pref-label { font-size: 13px; font-weight: 600; color: var(--c4-text); }
.pref-desc  { font-size: 12px; color: var(--c4-muted); margin-top: 2px; }
.toggle {
  position: relative; width: 40px; height: 22px; flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0; border-radius: 100px;
  background: var(--c4-border); cursor: pointer;
  transition: background var(--transition);
}
.toggle input:checked + .toggle-track { background: var(--c4-green); }
.toggle-track::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-track::after { transform: translateX(18px); }

/* ── CHAT WIDGET ─────────────────────────────────────── */
.chat-wrap {
  display: flex; flex-direction: column; height: 320px;
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--c4-border); border-radius: 100px; }

.chat-msg {
  max-width: 85%; display: flex; flex-direction: column; gap: 4px;
}
.chat-msg.c4 { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; }
.chat-bubble {
  padding: 10px 14px; border-radius: 16px; font-size: 13px; line-height: 1.5;
}
.chat-msg.c4   .chat-bubble { background: var(--c4-sage); color: var(--c4-text); border-bottom-left-radius: 4px; }
.chat-msg.user .chat-bubble { background: var(--c4-green); color: #fff; border-bottom-right-radius: 4px; }
.chat-sender { font-size: 10px; color: var(--c4-muted); }
.chat-msg.user .chat-sender { text-align: right; }

.chat-input-wrap {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--c4-border);
}
.chat-input {
  flex: 1; padding: 9px 14px; border-radius: 100px;
  border: 1.5px solid var(--c4-border); font-family: var(--font);
  font-size: 13px; color: var(--c4-text); outline: none;
  transition: border-color var(--transition);
  background: var(--c4-white);
}
.chat-input:focus { border-color: var(--c4-green); }
.chat-send-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--c4-green); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition); flex-shrink: 0;
}
.chat-send-btn:hover { background: var(--c4-green-lt); }
.chat-send-btn svg { width: 16px; height: 16px; color: #fff; }

/* ── MILESTONE BANNER ──────────────────────────────── */
.milestone-banner {
  background: linear-gradient(135deg, #064e3b 0%, var(--c4-green) 100%);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 28px;
  border: 1px solid rgba(255,255,255,0.1);
  position: relative; overflow: hidden;
}
.milestone-banner::after {
  content: '🎉';
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 36px; opacity: 0.15;
}
.milestone-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.milestone-text {}
.milestone-title {
  font-size: 15px; font-weight: 800; color: #fff; letter-spacing: -0.02em;
}
.milestone-desc {
  font-size: 13px; color: rgba(255,255,255,0.7); margin-top: 2px;
}
.milestone-dismiss {
  margin-left: auto; background: none; border: none;
  color: rgba(255,255,255,0.5); cursor: pointer; font-size: 18px; flex-shrink: 0;
  line-height: 1; padding: 4px; transition: color var(--transition);
}
.milestone-dismiss:hover { color: #fff; }

/* ── STAT PILLS ─────────────────────────────────────── */
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--c4-white);
  border-radius: var(--radius);
  border: 1px solid var(--c4-border);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--c4-muted);
}
.stat-value {
  font-size: 22px; font-weight: 900; color: var(--c4-text);
  letter-spacing: -0.03em;
}
.stat-sub {
  font-size: 12px; color: var(--c4-muted);
}
.stat-sub.up   { color: var(--c4-success); }
.stat-sub.warn { color: var(--c4-warn); }

/* ── TABS ───────────────────────────────────────────── */
.tab-bar {
  display: flex; gap: 2px; margin-bottom: 18px;
  background: var(--c4-sage); border-radius: var(--radius-sm);
  padding: 3px;
}
.tab-btn {
  flex: 1; padding: 8px 12px; border-radius: 6px;
  border: none; background: transparent; cursor: pointer;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  color: var(--c4-muted); transition: all var(--transition);
}
.tab-btn.active {
  background: var(--c4-white); color: var(--c4-text);
  box-shadow: var(--shadow-sm);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── EMPTY STATES ──────────────────────────────────── */
.empty-state {
  text-align: center; padding: 32px; color: var(--c4-muted);
}
.empty-state-icon { font-size: 32px; margin-bottom: 8px; }
.empty-state-text { font-size: 14px; }

/* ── UTILITY ────────────────────────────────────────── */
.flex    { display: flex; }
.items-center { align-items: center; }
.gap-8   { gap: 8px; }
.gap-12  { gap: 12px; }
.mt-4    { margin-top: 4px; }
.mt-8    { margin-top: 8px; }
.mt-12   { margin-top: 12px; }
.mt-16   { margin-top: 16px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted  { color: var(--c4-muted); }
.text-green  { color: var(--c4-green); }
.font-bold   { font-weight: 700; }
.font-black  { font-weight: 900; }
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 700;
}
.badge-yellow  { background: #fef9c3; color: #92400e; }
.badge-green   { background: #dcfce7; color: #15803d; }
.badge-blue    { background: #dbeafe; color: #1d4ed8; }
.badge-purple  { background: #ede9fe; color: #5b21b6; }
.badge-grey    { background: var(--c4-sage); color: var(--c4-muted); }
.badge-red     { background: #fee2e2; color: #b91c1c; }

/* ── ACTION LIST (What We Need From You) ────────────── */
.action-card { border-left: 3px solid var(--c4-yellow); }

.action-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.action-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--c4-border);
}
.action-item:last-child { border-bottom: none; }

.action-item-icon {
  font-size: 20px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c4-sage);
  border-radius: 8px;
  flex-shrink: 0;
  margin-top: 2px;
}

.action-item-body {
  flex: 1;
  min-width: 0;
}

.action-item-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--c4-text);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.action-item-desc {
  font-size: 13px;
  color: var(--c4-muted);
  line-height: 1.5;
  margin-bottom: 4px;
}

.action-item-timing {
  font-size: 11px;
  color: var(--c4-muted);
  margin-top: 4px;
  font-style: italic;
}

.action-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.action-tag.required { background: #fee2e2; color: #b91c1c; }
.action-tag.optional { background: var(--c4-sage); color: var(--c4-muted); }

.action-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--c4-sage);
  border: 1px solid var(--c4-border);
  color: var(--c4-green);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--c4-font);
  padding: 6px 12px;
  border-radius: 100px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
  margin-top: 2px;
}
.action-upload-btn:hover {
  background: var(--c4-sage-dk);
  border-color: var(--c4-green);
}

.action-upload-hint {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--c4-off);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--c4-muted);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}
.action-upload-hint svg { flex-shrink: 0; margin-top: 2px; }

/* ── VIEW SWITCHING ─────────────────────────────────── */
.view {
  display: none;
  animation: fadeIn 0.2s ease;
}
.view.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── SCROLLBAR ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c4-border); border-radius: 100px; }

/* ── MOBILE ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar     { display: none; }
  .main        { margin-left: 0; }
  .grid-2, .grid-3, .grid-left-heavy, .grid-right-heavy { grid-template-columns: 1fr; }
  .stats-row   { grid-template-columns: 1fr 1fr; }
  .content     { padding: 16px; }
  .topbar      { padding: 12px 16px; gap: 10px; }
  .topbar-actions { gap: 8px; }
  .topbar-actions .btn-ghost { display: none; } /* hide "back to site" on mobile to save space */
  .topbar h1   { font-size: 18px; }

  /* Mobile bottom nav bar */
  .mobile-nav  { display: flex; }

  /* Pad content so it isn't hidden behind bottom nav */
  .content     { padding-bottom: 80px; }

  /* Chat input bar sits above mobile nav */
  .chat-input-wrap { bottom: 72px; }

  /* Make cards full-width on mobile */
  .card        { border-radius: 12px; }

  /* Stat cards 2-column grid */
  .stat-card   { padding: 16px; }

  /* Comm entries - adjust for small screens */
  .comm-entry  { gap: 10px; }
  .comm-icon   { width: 32px; height: 32px; font-size: 14px; flex-shrink: 0; }

  /* Topbar: stack claim info */
  .topbar-claim-meta { font-size: 11px; }
}

@media (max-width: 500px) {
  .stats-row   { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card   { padding: 12px; }
  .stat-value  { font-size: 22px; }
  .timeline    { flex-wrap: wrap; gap: 12px; }
  .timeline::before, .timeline-progress-bar { display: none; }
  .tab-bar     { gap: 4px; }
  .tab-btn     { font-size: 12px; padding: 6px 10px; }
}

/* ── MOBILE BOTTOM NAV ──────────────────────────────── */
.mobile-nav {
  display: none; /* shown only on mobile via media query above */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--c4-white);
  border-top: 1px solid var(--c4-border);
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
  z-index: 200;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 12px;
  color: var(--c4-muted);
  font-size: 10px;
  font-family: var(--c4-font);
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 8px;
  transition: color 0.15s ease;
  min-width: 52px;
}

.mobile-nav-btn svg { flex-shrink: 0; }

.mobile-nav-btn.active {
  color: var(--c4-green);
}

.mobile-nav-btn:hover {
  color: var(--c4-green);
}
