/* ============================================================
   Clear Psychiatry & Psychology — Accountants Dashboard
   Brand tokens mirror the Staff Hub (cp-card, cp-heading, gold).
   forest #45543a · soft green #59664d · sand #d5c9ac
   cream #f3f5ef · ink #172033 · gold #b4a271 · white cards
   ============================================================ */

:root {
  --forest: #45543a;
  --soft:   #59664d;
  --sand:   #d5c9ac;
  --cream:  #f3f5ef;
  --ink:    #172033;
  --gold:   #b4a271;
  --white:  #ffffff;
  --muted:  #6b6f66;
  --border: #dedbcd;
  --card-border: #e3e1d3;
  --danger: #9c3b32;
  --shadow: 0 1px 3px rgba(23, 32, 51, 0.06);
  --radius: 0.75rem;

  --font-sans: "Nunito Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "PT Sans Narrow", "Nunito Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
body {
  background: var(--sand);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; }
a { color: inherit; }

/* -------------------- Header -------------------- */
.cp-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--forest);
  color: var(--cream);
  box-shadow: 0 1px 0 rgba(23, 32, 51, .18);
}
.cp-header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.cp-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.cp-logo { height: 34px; width: 34px; color: var(--gold); }
.cp-brand-text .cp-brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  line-height: 1.1;
}
.cp-brand-text .cp-brand-sub {
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--gold);
  margin-top: 2px;
}
.cp-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.cp-refresh-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  color: var(--cream);
  border: 1px solid rgba(255,255,255,0.25);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.cp-refresh-btn:hover { background: rgba(255,255,255,0.15); border-color: rgba(180,162,113,0.7); }
.cp-refresh-btn svg { color: var(--gold); }
.cp-refresh-btn.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.cp-greeting { text-align: right; line-height: 1.15; }
.cp-greeting-line {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
}
.cp-greeting-date {
  font-size: 12px;
  color: rgba(243,245,239,0.75);
}

/* -------------------- Main / Cards -------------------- */
.cp-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.cp-card {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.cp-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.cp-heading {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--forest);
  letter-spacing: 0.06em;
  margin: 0;
}
.cp-underline::after {
  content: '';
  display: block;
  width: 34px; height: 3px;
  margin-top: 6px;
  border-radius: 2px;
  background: var(--forest);
}
.cp-external {
  font-size: 13px;
  color: var(--soft);
  text-decoration: none;
  font-weight: 600;
  padding: 4px 0;
}
.cp-external:hover { color: var(--forest); text-decoration: underline; }

.mini-heading {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--soft);
  margin: 0 0 10px 0;
}
.mt-6 { margin-top: 22px; }
.mini-note { font-size: 12px; color: var(--muted); margin: -4px 0 10px 0; }

/* -------------------- Pills -------------------- */
.cp-pill {
  display: inline-flex; align-items: center;
  white-space: nowrap;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.cp-pill.green   { background: rgba(69,84,58,0.10); color: var(--forest); }
.cp-pill.gold    { background: rgba(180,162,113,0.22); color: #7d6c37; }
.cp-pill.neutral { background: #eeece0; color: var(--muted); }
.cp-pill.red     { background: rgba(156,59,50,0.12); color: var(--danger); }

/* -------------------- At-a-glance -------------------- */
.glance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.glance-tile {
  background: rgba(243,245,239,0.6);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 14px 16px;
}
.glance-label {
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--soft);
  margin-bottom: 6px;
}
.glance-num {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
}
.glance-meta {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

/* -------------------- Two-col layout -------------------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}
@media (max-width: 780px) {
  .two-col { grid-template-columns: 1fr; gap: 18px; }
}

/* -------------------- Tables -------------------- */
table.kv {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.kv th, table.kv td {
  text-align: left;
  padding: 8px 10px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
table.kv th {
  color: var(--muted);
  font-weight: 600;
  width: 45%;
  background: rgba(243,245,239,0.35);
}
table.kv tr:last-child th, table.kv tr:last-child td { border-bottom: none; }

table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.tbl thead th {
  text-align: left;
  padding: 10px 10px;
  color: var(--soft);
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11.5px;
  border-bottom: 1px solid var(--border);
  background: rgba(243,245,239,0.5);
}
table.tbl tbody td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: rgba(243,245,239,0.45); }
table.tbl th.right, table.tbl td.right { text-align: right; }

/* Filings-specific — description column wraps */
table.filings td:nth-child(3) { max-width: 520px; }
.filing-type {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  background: #eeece0;
  color: var(--soft);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.tbl-foot { margin-top: 10px; font-size: 13px; }
.cp-inline-link { color: var(--soft); font-weight: 600; text-decoration: none; }
.cp-inline-link:hover { color: var(--forest); text-decoration: underline; }

/* -------------------- Download link -------------------- */
.dl-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  color: var(--forest);
  background: rgba(69,84,58,0.08);
  border: 1px solid rgba(69,84,58,0.20);
  border-radius: 999px;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}
.dl-btn:hover {
  background: rgba(180,162,113,0.20);
  border-color: rgba(180,162,113,0.55);
  color: #5a4a1e;
}
.dl-btn svg { color: currentColor; }
.dl-none { color: var(--muted); font-size: 12px; }

/* -------------------- Share strip -------------------- */
.share-strip {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  display: flex; justify-content: flex-start;
}
.cp-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
}
.cp-btn.primary {
  background: var(--forest);
  color: var(--cream);
  box-shadow: 0 1px 3px rgba(23,32,51,0.14);
}
.cp-btn.primary:hover {
  background: var(--soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(23,32,51,0.16);
}

/* -------------------- Quick launch -------------------- */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.quick-tile {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: var(--white);
  text-decoration: none;
  color: var(--ink);
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
  position: relative;
}
.quick-tile:hover {
  border-color: rgba(180,162,113,0.6);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(23,32,51,0.06);
}
.quick-tile.featured {
  background: linear-gradient(135deg, rgba(69,84,58,0.05), rgba(180,162,113,0.10));
  border-color: rgba(180,162,113,0.45);
}
.quick-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(69,84,58,0.08);
  color: var(--forest);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.quick-tile.featured .quick-icon {
  background: rgba(180,162,113,0.25);
  color: #7d6c37;
}
.quick-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--forest);
}
.quick-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}
.quick-arrow {
  position: absolute;
  top: 12px; right: 12px;
  color: var(--muted);
  opacity: 0.55;
}
.quick-tile:hover .quick-arrow { color: var(--forest); opacity: 1; }

/* -------------------- Footer -------------------- */
.cp-footer {
  border-top: 1px solid var(--border);
  background: rgba(69,84,58,0.04);
  padding: 20px 0;
  margin-top: 12px;
}
.cp-footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.cp-source-note {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  margin: 0;
}

/* -------------------- Animations -------------------- */
.cp-fade { animation: cpFade 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; }
.cp-fade:nth-child(2) { animation-delay: .04s; }
.cp-fade:nth-child(3) { animation-delay: .08s; }
.cp-fade:nth-child(4) { animation-delay: .12s; }
@keyframes cpFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* -------------------- Small screens -------------------- */
@media (max-width: 600px) {
  .cp-header-inner { padding: 10px 14px; gap: 12px; }
  .cp-brand-text .cp-brand-name { font-size: 16px; }
  .cp-main { padding: 18px 14px; gap: 18px; }
  .cp-card { padding: 16px; }
  .cp-greeting { text-align: left; }
  .cp-header-right { width: 100%; justify-content: space-between; }
  table.tbl thead th, table.tbl tbody td { padding: 8px 6px; font-size: 13px; }
  table.kv th, table.kv td { padding: 6px 8px; font-size: 13px; }
}
