@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,500;9..144,600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #f8f6f1;
  --surface: #ffffff;
  --surface-2: #fbfaf6;
  --ink: #0a1230;
  --ink-muted: #5a6378;
  --ink-soft: #8c93a6;
  --border: #e6e3da;
  --border-soft: #efece5;
  --accent: #1a47c8;
  --accent-soft: #e8eeff;
  --red: #b3261e;
  --red-soft: #fef0ee;
  --amber: #b76900;
  --amber-soft: #fef4e2;
  --green: #1f7d3a;
  --green-soft: #e8f5ec;
  --purple: #5a3eb6;
  --purple-soft: #eeebff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); min-height: 100vh; }
body, button, input, select, textarea {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.serif { font-family: 'Fraunces', Georgia, serif; font-weight: 500; letter-spacing: -0.01em; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; }

.btn-primary { background: var(--ink); color: var(--bg); border: 0; padding: 10px 20px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: opacity 0.12s; white-space: nowrap; }
.btn-primary:hover:not(:disabled) { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--border); padding: 9px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all 0.12s; white-space: nowrap; }
.btn-secondary:hover:not(:disabled) { border-color: var(--ink); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================================
   LOGIN PAGE
============================================================================ */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: var(--bg); }
.auth-shell { width: 100%; max-width: 420px; }
.auth-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 16px; padding: 36px 36px 30px; box-shadow: 0 4px 24px rgba(10,18,48,0.04); }
.auth-h { text-align: center; margin-bottom: 26px; }
.auth-mark { display: inline-flex; width: 48px; height: 48px; border-radius: 11px; background: var(--ink); color: var(--bg); align-items: center; justify-content: center; font-family: 'Fraunces', serif; font-weight: 600; font-size: 17px; margin-bottom: 16px; }
.auth-title { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 500; margin-bottom: 4px; letter-spacing: -0.01em; }
.auth-sub { font-size: 13px; color: var(--ink-muted); }
.auth-error { background: var(--red-soft); color: var(--red); padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.auth-form .field { margin-bottom: 14px; }
.auth-foot { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-soft); text-align: center; font-size: 12px; color: var(--ink-muted); }
.auth-link { color: var(--accent); text-decoration: none; font-weight: 500; }
.auth-link:hover { text-decoration: underline; }

.demo-creds { margin-top: 18px; padding: 14px 16px; background: rgba(10,18,48,0.04); border-radius: 10px; font-size: 12px; color: var(--ink-muted); }
.demo-creds-h { font-weight: 600; color: var(--ink); margin-bottom: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.demo-creds-row { padding: 2px 0; }
.demo-creds-row strong { color: var(--ink); font-weight: 500; }

.field-label { display: block; font-size: 12px; font-weight: 500; color: var(--ink-muted); margin-bottom: 6px; }
.field-input, .field-textarea, .field-select { width: 100%; padding: 10px 12px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; font-size: 14px; font-family: inherit; outline: none; transition: border-color 0.12s; }
.field-input:focus, .field-textarea:focus, .field-select:focus { border-color: var(--ink); }

/* ============================================================================
   APP SHELL (shared for client + staff)
============================================================================ */
.cp-app { min-height: 100vh; display: flex; flex-direction: column; }

.cp-topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 32px; background: var(--surface); border-bottom: 1px solid var(--border-soft); position: sticky; top: 0; z-index: 10; }
.cp-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.cp-brand:hover { text-decoration: none; }
.cp-brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--ink); color: var(--bg); display: flex; align-items: center; justify-content: center; font-family: 'Fraunces', serif; font-weight: 600; font-size: 13px; }
.cp-brand-name { font-weight: 500; font-size: 14px; line-height: 1.1; }
.cp-brand-sub { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }

.cp-user { display: flex; align-items: center; gap: 12px; }
.cp-user-info { text-align: right; }
.cp-user-name { font-weight: 500; font-size: 13px; line-height: 1.2; }
.cp-user-meta { font-size: 11px; color: var(--ink-soft); margin-top: 2px; font-family: 'JetBrains Mono', monospace; }
.cp-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--purple-soft); color: var(--purple); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; }
.cp-avatar.small { width: 32px; height: 32px; font-size: 11px; }
.cp-logout { font-size: 12px; color: var(--ink-muted); padding: 6px 12px; border: 1px solid var(--border); border-radius: 7px; text-decoration: none; transition: all 0.12s; }
.cp-logout:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }

.cp-main { flex: 1; max-width: 1100px; width: 100%; margin: 0 auto; padding: 32px; }

.cp-footer { padding: 16px 32px; border-top: 1px solid var(--border-soft); display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--ink-soft); flex-wrap: wrap; gap: 8px; }
.cp-footer a { color: var(--ink-muted); }

.cp-back { margin-bottom: 14px; }
.cp-back a { font-size: 13px; color: var(--ink-muted); text-decoration: none; }
.cp-back a:hover { color: var(--ink); }

.cp-page-h { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; gap: 24px; }
.cp-page-title { font-family: 'Fraunces', serif; font-size: 30px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.cp-page-sub { font-size: 13px; color: var(--ink-muted); margin-top: 6px; }

.cp-banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--amber-soft); border: 1px solid #fac775; border-radius: 10px; font-size: 13px; margin-bottom: 20px; line-height: 1.5; }
.cp-banner-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex-shrink: 0; }

.cp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
.cp-kpi { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 12px; padding: 16px 20px; }
.cp-kpi-label { font-size: 12px; color: var(--ink-muted); margin-bottom: 8px; }
.cp-kpi-value { font-family: 'Fraunces', serif; font-size: 28px; font-weight: 500; line-height: 1; letter-spacing: -0.02em; }
.cp-kpi-value.red    { color: var(--red); }
.cp-kpi-value.amber  { color: var(--amber); }
.cp-kpi-value.green  { color: var(--green); }

.cp-section-h { margin-bottom: 14px; }
.cp-section-title { font-family: 'Fraunces', serif; font-size: 20px; font-weight: 500; }

.cp-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 12px; }
.cp-card-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border-soft); }
.cp-card-h h3 { font-size: 14px; font-weight: 600; }
.cp-card-meta { font-size: 12px; color: var(--ink-soft); }

/* ============================================================================
   MATTER LIST (client dashboard)
============================================================================ */
.cp-matters { display: flex; flex-direction: column; gap: 12px; }
.cp-matter { display: block; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 12px; padding: 18px 20px; text-decoration: none; color: var(--ink); transition: all 0.12s; }
.cp-matter:hover { border-color: var(--border); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(10,18,48,0.04); text-decoration: none; }
.cp-matter-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cp-matter-h-l { display: flex; gap: 6px; flex-wrap: wrap; }
.cp-matter-arrow { color: var(--ink-soft); font-size: 18px; }
.cp-matter-title { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 500; margin-bottom: 6px; letter-spacing: -0.01em; }
.cp-matter-summary { font-size: 13px; color: var(--ink-muted); line-height: 1.55; margin-bottom: 16px; }
.cp-matter-foot { display: flex; gap: 16px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--border-soft); font-size: 12px; }
.cp-foot-item { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-muted); }
.cp-foot-item.amber { color: var(--amber); }
.cp-foot-item .danger { color: var(--red); font-weight: 500; }
.cp-foot-item .warn   { color: var(--amber); font-weight: 500; }
.cp-foot-item .muted  { color: var(--ink-muted); }
.cp-foot-meta { color: var(--ink-soft); }

/* ============================================================================
   PILLS
============================================================================ */
.cp-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 3px 8px; border-radius: 5px; font-weight: 500; line-height: 1.3; white-space: nowrap; }
.cp-pill.section { font-family: 'JetBrains Mono', monospace; font-size: 11px; padding: 3px 7px; letter-spacing: -0.01em; }
.cp-pill.tiny { font-size: 10px; padding: 2px 6px; }
.cp-pill.danger { background: var(--red-soft); color: var(--red); }
.cp-pill.warn { background: var(--amber-soft); color: var(--amber); }
.cp-pill.muted { background: #f1efe8; color: #444441; }

/* ============================================================================
   PROGRESS BAR (status timeline)
============================================================================ */
.cp-progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.cp-progress-step { text-align: center; }
.cp-progress-bar { height: 6px; border-radius: 3px; background: #d3d1c7; margin-bottom: 8px; }
.cp-progress-step.done .cp-progress-bar { background: #1d9e75; }
.cp-progress-step.active .cp-progress-bar { background: #ba7517; }
.cp-progress-label { font-size: 11px; font-weight: 500; color: var(--ink-soft); }
.cp-progress-step.done .cp-progress-label,
.cp-progress-step.active .cp-progress-label { color: var(--ink); }
.cp-progress-step.active .cp-progress-label { color: #633806; }
.cp-progress-meta { font-size: 10px; color: var(--ink-soft); margin-top: 2px; }

/* ============================================================================
   MATTER DETAIL
============================================================================ */
.cp-detail-h { margin-bottom: 18px; }
.cp-detail-h-pills { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.cp-detail-title { font-family: 'Fraunces', serif; font-size: 28px; font-weight: 500; margin-bottom: 6px; letter-spacing: -0.02em; line-height: 1.2; }
.cp-detail-meta { font-size: 13px; color: var(--ink-muted); line-height: 1.5; }

.cp-status-card { padding: 22px 24px; margin-bottom: 16px; }
.cp-summary { font-size: 14px; line-height: 1.6; color: var(--ink); margin-bottom: 22px; }

.cp-detail-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; }
.cp-detail-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Action items */
.cp-action-row { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border-soft); }
.cp-action-row:last-child { border-bottom: 0; }
.cp-action-row.done { opacity: 0.55; }
.cp-action-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.cp-action-body { flex: 1; min-width: 0; }
.cp-action-title { font-size: 13px; font-weight: 500; line-height: 1.4; }
.cp-action-title.strike { text-decoration: line-through; }
.cp-action-desc { font-size: 12px; color: var(--ink-muted); margin-top: 3px; line-height: 1.5; }
.cp-action-due { font-size: 11px; color: var(--ink-soft); margin-top: 4px; }

.cp-empty-inline { padding: 24px 18px; text-align: center; color: var(--ink-soft); font-size: 13px; }

/* Messages */
.cp-thread { padding: 8px 18px; max-height: 460px; overflow-y: auto; }
.cp-msg { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.cp-msg:last-child { border-bottom: 0; }
.cp-msg.system { opacity: 0.7; }
.cp-msg.system .cp-msg-text { font-style: italic; font-size: 12px; }
.cp-msg-avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 500; flex-shrink: 0; }
.cp-msg-body { flex: 1; min-width: 0; }
.cp-msg-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.cp-msg-name { font-size: 13px; font-weight: 500; }
.cp-msg-time { font-size: 11px; color: var(--ink-soft); }
.cp-msg-text { font-size: 13px; color: var(--ink-muted); line-height: 1.55; word-wrap: break-word; }

.cp-msg-form { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border-soft); }
.cp-msg-input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; font-size: 13px; font-family: inherit; outline: none; resize: none; line-height: 1.4; }
.cp-msg-input:focus { border-color: var(--ink); }

.cp-form-error { padding: 8px 18px; color: var(--red); font-size: 12px; background: var(--red-soft); }

/* Documents */
.cp-doc-row { display: flex; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--border-soft); }
.cp-doc-row:last-of-type { border-bottom: 0; }
.cp-doc-icon { flex-shrink: 0; padding-top: 2px; }
.cp-doc-body { flex: 1; min-width: 0; }
.cp-doc-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-doc-meta { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.cp-doc-meta-text { font-size: 11px; color: var(--ink-soft); }
.cp-doc-upload { width: calc(100% - 36px); margin: 12px 18px; font-size: 12px; padding: 8px 12px; }

/* Fees */
.cp-fees-summary { padding: 18px; }
.cp-fees-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-size: 13px; }
.cp-fees-row.small { font-size: 12px; margin-bottom: 0; margin-top: 8px; }
.cp-fees-row .green { color: var(--green); }
.cp-fees-row .amber { color: var(--amber); }
.cp-fees-row strong { font-size: 16px; font-weight: 500; font-family: 'Fraunces', serif; }
.cp-fees-bar-wrap { height: 6px; background: #f1efe8; border-radius: 3px; overflow: hidden; }
.cp-fees-bar { height: 100%; background: #1d9e75; border-radius: 3px; transition: width 0.3s; }

.cp-fees-ledger { padding: 0 18px 14px; border-top: 1px solid var(--border-soft); }
.cp-ledger-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.cp-ledger-row:last-child { border-bottom: 0; }
.cp-ledger-desc { font-size: 12px; font-weight: 500; }
.cp-ledger-date { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
.cp-ledger-amt { font-size: 13px; font-weight: 500; font-family: 'JetBrains Mono', monospace; }
.cp-ledger-amt.green { color: var(--green); }

.cp-pay-btn { width: calc(100% - 36px); margin: 0 18px 18px; }

.cp-ca-card { padding: 18px; }
.cp-ca-label { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 10px; }
.cp-ca-row { display: flex; align-items: center; gap: 12px; }
.cp-ca-name { font-size: 13px; font-weight: 500; }
.cp-ca-firm { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }

.cp-empty { text-align: center; padding: 64px 24px; color: var(--ink-muted); background: var(--surface); border: 1px dashed var(--border); border-radius: 12px; }
.cp-empty h3 { font-size: 16px; color: var(--ink); margin-bottom: 6px; font-weight: 600; }

/* Staff table */
.cp-table { width: 100%; border-collapse: collapse; }
.cp-table th { text-align: left; font-size: 11px; font-weight: 500; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; padding: 12px 14px; border-bottom: 1px solid var(--border-soft); }
.cp-table td { padding: 14px; border-bottom: 1px solid var(--border-soft); font-size: 13px; vertical-align: top; }
.cp-table tr:last-child td { border-bottom: 0; }

/* Responsive */
@media (max-width: 920px) {
  .cp-kpis { grid-template-columns: repeat(2, 1fr); }
  .cp-detail-grid { grid-template-columns: 1fr; }
  .cp-main { padding: 20px; }
  .cp-topbar { padding: 12px 18px; }
  .cp-detail-title { font-size: 22px; }
  .cp-page-title { font-family: 'Fraunces', serif; font-size: 24px; }
  .cp-progress-label { font-size: 10px; }
}
@media (max-width: 540px) {
  .cp-user-info { display: none; }
  .cp-progress { gap: 4px; }
  .cp-progress-label { font-size: 9px; }
  .cp-matter-foot { gap: 10px; }
}

/* ============================================================================
   RICH CLIENT DASHBOARD (tabs, overview, services, documents, calendar, knowledge)
============================================================================ */

.cp-status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; background: var(--surface-2); border-radius: 7px; font-size: 11px; }
.cp-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.cp-status-text { color: var(--ink-muted); }

.cp-tabs { background: var(--surface); border-bottom: 1px solid var(--border-soft); position: sticky; top: 64px; z-index: 9; }
.cp-tabs-inner { max-width: 1100px; margin: 0 auto; padding: 0 32px; display: flex; gap: 0; overflow-x: auto; }
.cp-tab { display: inline-flex; align-items: center; gap: 6px; padding: 14px 16px; font-size: 13px; color: var(--ink-muted); text-decoration: none; border-bottom: 2px solid transparent; font-weight: 500; white-space: nowrap; transition: all 0.12s; }
.cp-tab:hover { color: var(--ink); text-decoration: none; }
.cp-tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.cp-tab-count { font-size: 10px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-muted); font-weight: 500; }
.cp-tab.active .cp-tab-count { background: var(--ink); color: var(--bg); }

.cp-page-h { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; gap: 14px; flex-wrap: wrap; }
.cp-page-title { font-family: 'Fraunces', serif; font-size: 26px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.15; margin-bottom: 4px; }
.cp-page-sub { font-size: 13px; color: var(--ink-muted); }

.cp-overview-h { margin-bottom: 22px; }

.cp-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 768px) { .cp-grid-2 { grid-template-columns: 1fr; } }

.cp-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; margin-bottom: 14px; overflow: hidden; }

.cp-card-label { font-size: 11px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.cp-card-sublabel { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
.cp-card-h-bar { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-soft); }
.cp-link-small { font-size: 12px; color: var(--accent); text-decoration: none; font-weight: 500; }
.cp-link-small:hover { text-decoration: underline; }

/* Mini stats grid (used on Overview, Documents, Calendar) */
.cp-mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
@media (max-width: 768px) { .cp-mini-stats { grid-template-columns: repeat(2, 1fr); } }
.cp-mini-stat { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 12px; padding: 14px 16px; }
.cp-mini-stat-label { font-size: 11px; color: var(--ink-muted); margin-bottom: 6px; }
.cp-mini-stat-value { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 500; line-height: 1; letter-spacing: -0.01em; }
.cp-mini-stat-value.warn { color: var(--amber); }
.cp-mini-stat-value.good { color: var(--green); }
.cp-mini-stat-sub { font-size: 11px; color: var(--ink-soft); margin-top: 6px; }
.cp-mini-stat-sub.warn { color: var(--amber); }
.cp-mini-stat-sub.good { color: var(--green); }

/* Tax Health Score card */
.cp-health-card { padding: 20px; }
.cp-health-row { display: flex; align-items: center; gap: 18px; margin: 14px 0; }
.cp-health-info { flex: 1; }
.cp-health-label { font-size: 17px; font-weight: 500; margin-bottom: 4px; }
.cp-health-desc { font-size: 12px; color: var(--ink-muted); line-height: 1.55; }
.cp-health-stats { display: flex; flex-direction: column; gap: 7px; padding-top: 14px; border-top: 1px solid var(--border-soft); font-size: 12px; }
.cp-health-stat { display: flex; justify-content: space-between; align-items: center; }
.cp-health-stat-label { color: var(--ink-muted); }
.cp-health-stat-value { font-weight: 500; }
.cp-health-stat-value.good { color: var(--green); }
.cp-health-stat-value.warn { color: var(--amber); }

/* 5-year Journey card */
.cp-journey-card { padding: 20px; }
.cp-journey-chart { margin: 16px 0 6px; }
.cp-journey-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-soft); padding: 0 4px; }
.cp-journey-stats { display: flex; justify-content: space-between; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--border-soft); }
.cp-journey-stat-label { font-size: 11px; color: var(--ink-muted); }
.cp-journey-stat-value { font-family: 'Fraunces', serif; font-size: 16px; font-weight: 500; margin-top: 2px; }

/* Smart Insights card */
.cp-insights-card { }
.cp-insight-row { display: flex; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border-soft); align-items: flex-start; }
.cp-insight-row:last-child { border-bottom: 0; }
.cp-insight-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 500; font-size: 14px; flex-shrink: 0; }
.cp-insight-urgent  { background: var(--red-soft);    color: var(--red); }
.cp-insight-warn    { background: var(--amber-soft);  color: var(--amber); }
.cp-insight-success { background: var(--green-soft);  color: var(--green); }
.cp-insight-info    { background: var(--purple-soft); color: var(--purple); }
.cp-insight-body { flex: 1; min-width: 0; }
.cp-insight-title { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.cp-insight-desc { font-size: 12px; color: var(--ink-muted); line-height: 1.55; margin-bottom: 8px; }
.cp-insight-cta { display: inline-block; font-size: 11px; color: var(--accent); text-decoration: none; font-weight: 500; }
.cp-insight-cta:hover { text-decoration: underline; }

/* Active matters mini list (overview) */
.cp-matter-mini { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border-soft); text-decoration: none; color: var(--ink); transition: background 0.12s; }
.cp-matter-mini:last-child { border-bottom: 0; }
.cp-matter-mini:hover { background: var(--surface-2); text-decoration: none; }
.cp-matter-mini-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 500; font-family: 'JetBrains Mono', monospace; flex-shrink: 0; }
.cp-matter-mini-body { flex: 1; min-width: 0; }
.cp-matter-mini-title { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.cp-matter-mini-meta { font-size: 11px; color: var(--ink-muted); }

/* Deadline rows (overview, calendar) */
.cp-deadline-row { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--border-soft); text-decoration: none; color: var(--ink); transition: background 0.12s; }
.cp-deadline-row:last-child { border-bottom: 0; }
.cp-deadline-row:hover { background: var(--surface-2); text-decoration: none; }
.cp-deadline-date { width: 44px; flex-shrink: 0; text-align: center; }
.cp-deadline-day { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 500; line-height: 1; }
.cp-deadline-mon { font-size: 10px; color: var(--ink-muted); text-transform: uppercase; margin-top: 2px; letter-spacing: 0.04em; }
.cp-deadline-body { flex: 1; min-width: 0; }
.cp-deadline-title { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.cp-deadline-meta { font-size: 11px; color: var(--ink-muted); display: flex; align-items: center; gap: 4px; }

/* CA card (large, dark blue) */
.cp-ca-card-large { background: #042c53; border: 0; padding: 20px 22px; }
.cp-ca-row-large { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cp-ca-avatar-large { width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,0.13); color: #b5d4f4; display: flex; align-items: center; justify-content: center; font-family: 'Fraunces', serif; font-size: 19px; font-weight: 500; flex-shrink: 0; }
.cp-ca-info { flex: 1; min-width: 200px; color: white; }
.cp-ca-label-large { font-size: 11px; color: #b5d4f4; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; margin-bottom: 4px; }
.cp-ca-name-large { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 500; margin-bottom: 3px; }
.cp-ca-meta-large { font-size: 12px; color: #b5d4f4; line-height: 1.5; }
.cp-ca-actions { display: flex; flex-direction: column; gap: 7px; }
.cp-btn-wa { background: #25d366; color: white; border: 0; padding: 8px 16px; border-radius: 7px; font-size: 12px; font-weight: 500; text-decoration: none; white-space: nowrap; text-align: center; }
.cp-btn-wa:hover { opacity: 0.9; text-decoration: none; color: white; }
.cp-btn-ghost-light { background: rgba(255,255,255,0.13); color: white; border: 0; padding: 8px 16px; border-radius: 7px; font-size: 12px; font-weight: 500; text-decoration: none; white-space: nowrap; text-align: center; }
.cp-btn-ghost-light:hover { background: rgba(255,255,255,0.2); text-decoration: none; color: white; }

/* Recommendations */
.cp-recommend-card { }
.cp-recommend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 20px; }
@media (max-width: 768px) { .cp-recommend-grid { grid-template-columns: 1fr; } }
.cp-recommend-tile { padding: 14px; background: var(--surface-2); border-radius: 10px; text-decoration: none; color: var(--ink); display: block; transition: all 0.12s; }
.cp-recommend-tile:hover { background: var(--surface); border: 1px solid var(--border); transform: translateY(-1px); text-decoration: none; }
.cp-recommend-icon { display: inline-flex; width: 26px; height: 26px; border-radius: 6px; align-items: center; justify-content: center; font-size: 10px; font-weight: 500; font-family: 'JetBrains Mono', monospace; margin-bottom: 6px; }
.cp-recommend-title { font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.cp-recommend-desc { font-size: 11px; color: var(--ink-muted); line-height: 1.5; margin-bottom: 6px; }
.cp-recommend-price { font-size: 11px; color: var(--accent); font-weight: 500; }

/* Pills */
.cp-pill { font-size: 11px; padding: 3px 9px; border-radius: 5px; font-weight: 500; display: inline-block; line-height: 1.3; white-space: nowrap; }
.cp-pill.tiny { font-size: 10px; padding: 2px 7px; }
.pill-red    { background: var(--red-soft);    color: var(--red); }
.pill-amber  { background: var(--amber-soft);  color: var(--amber); }
.pill-green  { background: var(--green-soft);  color: var(--green); }
.pill-purple { background: var(--purple-soft); color: var(--purple); }
.pill-blue   { background: var(--accent-soft); color: var(--accent); }
.pill-gray   { background: var(--surface-2);   color: var(--ink-muted); }

/* Filter row */
.cp-filter-row { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.cp-filter { padding: 7px 14px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; font-size: 12px; color: var(--ink-muted); text-decoration: none; font-weight: 500; transition: all 0.12s; }
.cp-filter:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }
.cp-filter.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cp-filter-count { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: rgba(0,0,0,0.06); font-size: 10px; }
.cp-filter.active .cp-filter-count { background: rgba(255,255,255,0.18); }

/* Matters list cards */
.cp-matters { display: flex; flex-direction: column; gap: 12px; }
.cp-matter { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; padding: 18px 20px; text-decoration: none; color: var(--ink); transition: all 0.12s; display: block; }
.cp-matter:hover { border-color: var(--ink); transform: translateY(-1px); text-decoration: none; box-shadow: 0 4px 12px rgba(10,18,48,0.04); }
.cp-matter-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.cp-matter-h-l { display: flex; gap: 6px; flex-wrap: wrap; }
.cp-matter-arrow { color: var(--ink-soft); font-size: 18px; }
.cp-matter-title { font-family: 'Fraunces', serif; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; margin-bottom: 6px; }
.cp-matter-summary { font-size: 13px; color: var(--ink-muted); line-height: 1.55; margin-bottom: 14px; }

.cp-progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 14px; }
.cp-progress-step .cp-progress-bar { height: 5px; border-radius: 3px; background: #e6e3da; }
.cp-progress-step.done .cp-progress-bar { background: var(--green); }
.cp-progress-step.active .cp-progress-bar { background: var(--amber); }
.cp-progress-step .cp-progress-label { font-size: 10px; margin-top: 5px; color: var(--ink-soft); }
.cp-progress-step.done .cp-progress-label { color: var(--green); }
.cp-progress-step.active .cp-progress-label { color: var(--amber); }

.cp-matter-foot { display: flex; gap: 14px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border-soft); font-size: 12px; }
.cp-foot-item { display: flex; gap: 4px; align-items: center; }
.cp-foot-meta { color: var(--ink-soft); }
.cp-foot-item.amber { color: var(--amber); font-weight: 500; }

.danger { color: var(--red); font-weight: 500; }
.warn { color: var(--amber); font-weight: 500; }

/* Empty state */
.cp-empty { background: var(--surface); border: 1px dashed var(--border); border-radius: 14px; padding: 40px 20px; text-align: center; }
.cp-empty h3 { font-family: 'Fraunces', serif; font-size: 17px; font-weight: 500; margin-bottom: 6px; }
.cp-empty p { font-size: 13px; color: var(--ink-muted); }
.cp-empty-inline { padding: 18px 20px; text-align: center; font-size: 12px; color: var(--ink-muted); }

/* Services page */
.cp-services { display: flex; flex-direction: column; gap: 14px; }
.cp-service { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; padding: 20px; }
.cp-service-h { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.cp-service-icon { width: 40px; height: 40px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; font-family: 'JetBrains Mono', monospace; flex-shrink: 0; }
.cp-service-info { flex: 1; min-width: 0; }
.cp-service-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.cp-service-title { font-family: 'Fraunces', serif; font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.cp-service-desc { font-size: 13px; color: var(--ink-muted); line-height: 1.55; }

.cp-packages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 768px) { .cp-packages { grid-template-columns: 1fr; } }
.cp-package { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 10px; padding: 14px; position: relative; }
.cp-package.popular { border: 2px solid var(--ink); padding: 13px; }
.cp-package-tag { position: absolute; top: -10px; left: 12px; background: var(--ink); color: var(--bg); font-size: 10px; font-weight: 500; padding: 3px 9px; border-radius: 4px; }
.cp-package-name { font-size: 11px; color: var(--ink-muted); margin-bottom: 4px; }
.cp-package-price { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 500; margin-bottom: 10px; line-height: 1; }
.cp-package-quote { font-size: 13px; color: var(--ink-muted); font-family: inherit; font-weight: 400; }
.cp-package-cta { display: inline-block; font-size: 12px; color: var(--accent); text-decoration: none; font-weight: 500; }
.cp-package-cta:hover { text-decoration: underline; }

/* Info card (used as inline informational note) */
.cp-info-card { padding: 16px 20px; display: flex; align-items: center; gap: 14px; background: var(--accent-soft); border-color: rgba(26,71,200,0.15); }
.cp-info-icon { width: 32px; height: 32px; border-radius: 8px; background: rgba(26,71,200,0.12); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 500; font-size: 14px; flex-shrink: 0; }
.cp-info-body { font-size: 13px; line-height: 1.55; color: var(--ink); }
.cp-info-body strong { color: var(--ink); font-weight: 500; }

/* Documents page */
.cp-doc-group { }
.cp-doc-group-h { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border-soft); }
.cp-doc-group-icon { width: 32px; height: 32px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 500; font-family: 'JetBrains Mono', monospace; flex-shrink: 0; }
.cp-doc-group-title { flex: 1; min-width: 0; }
.cp-doc-group-name { font-size: 13px; font-weight: 500; }
.cp-doc-group-meta { font-size: 11px; color: var(--ink-muted); margin-top: 2px; }
.cp-doc-list { }
.cp-doc-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border-soft); }
.cp-doc-row:last-child { border-bottom: 0; }
.cp-doc-icon { width: 32px; height: 32px; border-radius: 6px; background: var(--surface-2); color: var(--ink-muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cp-doc-icon svg { width: 16px; height: 16px; }
.cp-doc-body { flex: 1; min-width: 0; }
.cp-doc-name { font-size: 13px; font-weight: 500; margin-bottom: 3px; word-break: break-word; }
.cp-doc-meta { font-size: 11px; color: var(--ink-muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cp-doc-action { font-size: 12px; color: var(--accent); text-decoration: none; font-weight: 500; padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; }
.cp-doc-action:hover { border-color: var(--accent); text-decoration: none; }

/* Calendar page */
.cp-cal-card { padding: 20px; }
.cp-cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.cp-cal-title { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 500; }
.cp-cal-nav { display: flex; gap: 6px; }
.cp-cal-nav-btn { padding: 6px 12px; border: 1px solid var(--border); background: var(--surface); border-radius: 7px; font-size: 12px; color: var(--ink-muted); text-decoration: none; }
.cp-cal-nav-btn:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }

.cp-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cp-cal-dow { padding: 8px 4px; text-align: center; font-size: 10px; font-weight: 500; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.cp-cal-cell { aspect-ratio: 1.2 / 1; min-height: 60px; padding: 6px 8px; background: var(--surface-2); border-radius: 6px; position: relative; }
.cp-cal-cell.empty { background: transparent; }
.cp-cal-cell.today { background: var(--accent-soft); border: 1px solid var(--accent); }
.cp-cal-cell.has-events { background: var(--surface); border: 1px solid var(--border); }
.cp-cal-cell.today.has-events { background: var(--accent-soft); border: 1px solid var(--accent); }
.cp-cal-day { font-family: 'Fraunces', serif; font-size: 14px; font-weight: 500; }
.cp-cal-cell.today .cp-cal-day { color: var(--accent); }
.cp-cal-dots { position: absolute; bottom: 5px; left: 6px; right: 6px; display: flex; gap: 3px; align-items: center; flex-wrap: wrap; }
.cp-cal-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.cp-cal-more { font-size: 9px; color: var(--ink-soft); }

.cp-cal-legend { display: flex; gap: 14px; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--border-soft); flex-wrap: wrap; }
.cp-cal-legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-muted); }

.cp-cal-list-row { display: flex; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--border-soft); align-items: center; }
.cp-cal-list-row:last-child { border-bottom: 0; }
.cp-cal-list-date { width: 70px; font-family: 'Fraunces', serif; font-size: 14px; font-weight: 500; color: var(--accent); flex-shrink: 0; }
.cp-cal-list-body { flex: 1; min-width: 0; }
.cp-cal-list-event { font-size: 13px; font-weight: 500; }
.cp-cal-list-who { font-size: 11px; color: var(--ink-muted); margin-top: 2px; }

/* Knowledge page */
.cp-knowledge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 14px; }
.cp-knowledge-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 12px; padding: 16px 18px; }
.cp-know-h { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.cp-know-pill { font-size: 11px; padding: 3px 10px; border-radius: 5px; font-weight: 500; font-family: 'JetBrains Mono', monospace; }
.cp-know-name { font-size: 13px; font-weight: 500; }
.cp-know-severity { font-size: 11px; color: var(--ink-soft); margin-bottom: 10px; }
.cp-know-desc { font-size: 12px; color: var(--ink-muted); line-height: 1.55; margin-bottom: 10px; }
.cp-know-action { padding: 10px 12px; background: var(--surface-2); border-radius: 7px; font-size: 12px; line-height: 1.55; color: var(--ink-muted); }
.cp-know-action strong { color: var(--ink); font-weight: 500; }

.cp-faqs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.cp-faq { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 10px; padding: 14px 18px; }
.cp-faq-q { font-size: 13px; font-weight: 500; cursor: pointer; outline: none; list-style: none; padding-right: 24px; position: relative; }
.cp-faq-q::-webkit-details-marker { display: none; }
.cp-faq-q::after { content: '+'; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--ink-muted); transition: transform 0.15s; }
.cp-faq[open] .cp-faq-q::after { content: '−'; }
.cp-faq-a { font-size: 12px; color: var(--ink-muted); line-height: 1.6; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-soft); }
