/* Kasama Client Dashboard — Kasama brand system (Brand Guide, Jan 2025).
   Ink Black #272727 · Cobalt Blue #273A90 · Burnt Orange #D8553E (alerts ONLY) · Paper White #F8F5EE
   Metropolis for communication, Geometos for the wordmark and method labels. */

@font-face {
  font-family: "Metropolis";
  src: url("brand/Metropolis-Regular.otf") format("opentype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Metropolis";
  src: url("brand/Metropolis-SemiBold.otf") format("opentype");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Metropolis";
  src: url("brand/Metropolis-Bold.otf") format("opentype");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geometos";
  src: url("brand/Geometos.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  --ink: #272727;
  --ink-2: #55524c;
  --muted: #8a867e;
  --line: #e6e1d6;
  --bg: #F8F5EE;
  --surface: #ffffff;
  --cobalt: #273A90;
  --cobalt-soft: #e8ebf6;
  --orange: #D8553E;          /* reserved for alerts / needs-attention */
  --orange-ink: #a63a28;
  --orange-soft: #fbe9e4;
  --good-bg: #e6f0e9; --good-ink: #1e5c38;
  --info-bg: var(--cobalt-soft); --info-ink: var(--cobalt);
  --warn-bg: #faeee1; --warn-ink: #8a5220;
  --bad-bg: var(--orange-soft); --bad-ink: var(--orange-ink);
  --done-bg: var(--cobalt-soft); --done-ink: var(--cobalt);
  --neutral-bg: #efece4; --neutral-ink: #45423c;
  --radius-sm: 8px;
  --radius-lg: 12px;
  --space-section: 52px;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }   /* nothing may widen the page */
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.55 "Metropolis", -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--cobalt); }
h1 { font-size: 31px; font-weight: 700; margin: 0 0 4px; letter-spacing: .01em; }
h2 { font-size: 21px; font-weight: 700; margin: 0 0 4px; }
h3 { font-size: 16px; font-weight: 600; margin: 0 0 10px; }
h4 { font-size: 12px; font-weight: 600; margin: 16px 0 8px; text-transform: uppercase;
     letter-spacing: .08em; color: var(--ink-2); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
b, strong { font-weight: 600; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }

/* layout */
.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 20px 64px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px;
           align-items: start; }
@media (max-width: 780px) { .two-col { grid-template-columns: 1fr; } }

/* sections — one consistent rhythm for the whole page */
.page-section { margin-top: var(--space-section); }
.section-head { margin-bottom: 14px; }
.section-head h2 .qualifier,
h2 .goal-period, h2 .qualifier {
  font-weight: 400; font-size: 14px; color: var(--ink-2); margin-left: 10px;
}
.section-note {
  margin: 6px 0 0; font-size: 14px; color: var(--ink-2);
  border-left: 3px solid var(--cobalt); padding-left: 10px; max-width: 720px;
}
.source-line { margin-top: 10px; }
.source-line a { color: var(--muted); }

/* top bar */
.topbar { background: var(--surface); border-bottom: 2px solid var(--ink); }
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink);
         text-decoration: none; }
.brand-logo { height: 30px; width: auto; }
.brand-name { font-family: "Geometos", "Metropolis", sans-serif; font-size: 15px;
              letter-spacing: .12em; }
.brand-sub { color: var(--muted); font-size: 13px; font-weight: 400; }
.topbar nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; color: var(--ink-2); padding: 8px 4px; }
.who { color: var(--muted); }
.topbar nav a.help-btn, a.help-btn.btn {
  background: var(--cobalt); color: #fff !important; border: none;
  padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 13.5px;
}
.topbar nav a.help-btn:hover { background: #1d2c70; text-decoration: none; }
@media (max-width: 640px) {
  .brand-sub, .who { display: none; }
  .topbar-inner { padding: 10px 14px; }
}

/* cards */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px;
}
.hero { margin: 10px 0 0; }
.method-tag {
  font-family: "Geometos", "Metropolis", sans-serif; font-size: 12px;
  letter-spacing: .18em; text-transform: uppercase; color: var(--cobalt);
  margin: 4px 0 0;
}
.eyebrow {
  font-family: "Geometos", "Metropolis", sans-serif; font-size: 10.5px;
  letter-spacing: .18em; text-transform: uppercase; color: var(--cobalt);
  margin: 0 0 2px;
}
h2.after-eyebrow { margin-top: 0; }

/* executive summary band */
.summary-band { margin-top: 22px; border-top: 4px solid var(--cobalt); }
.summary-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.summary-narrative { margin: 12px 0 2px; font-size: 16px; line-height: 1.6; max-width: 860px; }
.capsules { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.capsule {
  display: flex; flex-direction: column; text-decoration: none;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 16px; min-width: 128px; color: var(--ink);
}
.capsule:hover { border-color: var(--ink-2); text-decoration: none; }
.capsule-n { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.capsule-l { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.capsule.warn .capsule-n { color: var(--warn-ink); }
.capsule.good .capsule-n { color: var(--good-ink); }

/* needs your attention */
.attention-title { color: var(--orange-ink); }
.attention-card { border-left: 4px solid var(--orange); }
.attention-list { list-style: none; margin: 0; padding: 0; }
.attention-list li { display: flex; gap: 12px; align-items: baseline; padding: 9px 0;
                     border-bottom: 1px solid var(--line); font-size: 14.5px; }
.attention-list li:last-child { border-bottom: none; }

/* flashes */
.flashes { max-width: 1080px; margin: 12px auto 0; padding: 0 20px; }
.flash { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 8px; font-size: 14px; }
.flash-ok { background: var(--good-bg); color: var(--good-ink); }
.flash-error { background: var(--bad-bg); color: var(--bad-ink); }

/* login */
.login-card {
  max-width: 380px; margin: 60px auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 32px;
  border-top: 4px solid var(--cobalt);
}
.login-card label { display: block; margin: 14px 0 4px; font-size: 13px; color: var(--ink-2); }
.login-card input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 16px; font-family: inherit; background: var(--bg);
}
.login-card .btn { width: 100%; margin-top: 20px; }

/* buttons & forms */
.btn {
  display: inline-block; padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 14px; font-family: inherit; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad-ink); border-color: #e8c5bc; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.link-btn { background: none; border: none; color: var(--bad-ink); cursor: pointer;
            font-size: 12px; text-decoration: underline; padding: 0; font-family: inherit; }
.inline { display: inline; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.inline-form input, .inline-form select,
.stack-form input, .stack-form select, .stack-form textarea {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 16px; font-family: inherit; background: #fff;
}
.stack-form label { display: block; margin: 10px 0 2px; font-size: 13px; color: var(--ink-2); }
.stack-form input, .stack-form textarea { width: 100%; }
.stack-form .inline-form label { flex: 0 0 auto; }
.stack-form .inline-form input { width: auto; }
.check input { width: auto !important; }
.row-actions { display: flex; gap: 8px; margin-top: 12px; }
.section-toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
                   gap: 4px 16px; }
.section-toggles .check { font-size: 14px; color: var(--ink); margin: 2px 0; }

/* chips — status is never colour alone: icon + label always */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  white-space: nowrap;
}
.chip.sm { padding: 2px 8px; font-size: 12px; }
.chip-ic { font-size: 10px; }
.chip.good { background: var(--good-bg); color: var(--good-ink); }
.chip.info { background: var(--info-bg); color: var(--info-ink); }
.chip.warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip.bad { background: var(--bad-bg); color: var(--bad-ink); }
.chip.done { background: var(--done-bg); color: var(--done-ink); }
.chip.neutral { background: var(--neutral-bg); color: var(--neutral-ink); }
.chip.muted { background: var(--neutral-bg); color: var(--muted); }

/* goals — compact expandable rows */
.goal-list { padding: 6px 18px; }
.goal-row { border-bottom: 1px solid var(--line); margin: 0; }
.goal-row:last-child { border-bottom: none; }
.goal-row summary {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 0; cursor: pointer; font-size: 15px; color: var(--ink);
  list-style: none;
}
.goal-row summary::-webkit-details-marker { display: none; }
.goal-row summary:hover .goal-title { color: var(--cobalt); }
.goal-flag summary { box-shadow: inset 3px 0 0 var(--orange); padding-left: 10px; }
.goal-num {
  flex: none; width: 26px; height: 26px; border-radius: var(--radius-sm);
  background: var(--cobalt); color: #fff; font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.goal-main { flex: 1 1 260px; min-width: 200px; display: flex; flex-direction: column; gap: 1px; }
.goal-title { font-weight: 600; line-height: 1.35; }
.goal-headline { line-height: 1.4; }
.goal-bar-wrap { flex: none; display: inline-flex; align-items: center; gap: 8px; }
.progress.mini { width: 110px; height: 6px; margin: 0; }
.goal-pct { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.disclose { color: var(--muted); font-size: 20px; transform: rotate(90deg);
            transition: transform .15s; flex: none; }
.goal-row[open] .disclose { transform: rotate(-90deg); }
.goal-detail { padding: 2px 0 16px 38px; }

/* progress bars */
.progress {
  height: 8px; background: var(--neutral-bg); border-radius: 4px;
  overflow: hidden; margin-top: 8px;
}
.progress-fill {
  height: 100%; background: var(--cobalt); border-radius: 0 4px 4px 0; min-width: 4px;
  display: block;
}
.progress-label { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); }
.progress-label b { color: var(--ink); }
.budget-progress { max-width: 560px; }

/* priorities */
.prio-list { list-style: none; margin: 0; padding: 0; }
.prio-list li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0;
                border-bottom: 1px solid var(--line); font-size: 14px; }
.prio-list li:last-child { border-bottom: none; }

/* bar chart — single series, values labelled, table fallback in details */
.bar-chart {
  display: flex; align-items: flex-end; gap: 10px;
  height: 150px; padding: 8px 4px 0; margin-top: 4px;
}
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center;
           justify-content: flex-end; height: 100%; gap: 4px; }
.bar { width: 100%; max-width: 40px; background: var(--cobalt); border-radius: 4px 4px 0 0; }
.bar-val { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bar-lab { font-size: 12px; color: var(--muted); }

/* tables — quiet rules, right-aligned numbers */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { border-collapse: collapse; margin-top: 8px; font-size: 13.5px; min-width: 260px; }
.data-table th, .data-table td {
  border: 0; border-bottom: 1px solid var(--line); padding: 7px 14px 7px 0; text-align: left;
}
.data-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
                 color: var(--muted); font-weight: 600; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* tiles — neutral by default; accent only when it means something */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
         gap: 12px; margin-bottom: 4px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
        padding: 14px 16px; }
.tile-n { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-l { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tile-bad { border-top: 3px solid var(--orange); }
.tile-bad .tile-n { color: var(--bad-ink); }
.tile-good .tile-n { color: var(--good-ink); }
.delta-up { color: var(--good-ink); font-weight: 600; }
.delta-down { color: var(--bad-ink); font-weight: 600; }

/* to-do lists */
.todo-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.todo-list li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.todo-list li:last-child { border-bottom: none; }
.todo-link { color: var(--ink); text-decoration: none; }
.todo-link:hover { color: var(--cobalt); text-decoration: underline; }
.due-date { display: inline-block; font-size: 12px; font-weight: 600; color: var(--ink-2);
            font-variant-numeric: tabular-nums; margin-right: 6px; }
.due-date.bad { color: var(--bad-ink); }
.assignee {
  display: inline-block; background: var(--cobalt-soft); color: var(--cobalt);
  border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 600;
  margin-left: 4px;
}
.done-list li { color: var(--ink-2); }

/* details */
details { margin-top: 10px; }
summary { cursor: pointer; font-size: 14px; color: var(--cobalt); padding: 8px 0; }
summary:hover { text-decoration: underline; }
.mini-update { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.mini-update:last-child { border-bottom: none; }
.mini-update .chip { margin-right: 6px; }
.mini-update p { margin: 4px 0 0; color: var(--ink-2); }

/* admin */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
              gap: 16px; margin-top: 16px; }
.client-card.inactive { opacity: .55; }
.new-client { border-style: dashed; }
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.admin-goal { border-bottom: 1px solid var(--line); padding: 10px 0; margin-top: 0; }
.admin-goal summary { font-size: 14.5px; color: var(--ink); }
.prio-row { display: flex; gap: 8px; align-items: center; padding: 6px 0;
            border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.prio-row b { flex: 1; min-width: 200px; font-weight: 600; font-size: 14px; }
.prio-row input, .prio-row select { padding: 5px 8px; border: 1px solid var(--line);
                                     border-radius: 6px; font-size: 13px; font-family: inherit; }
.user-list { list-style: none; padding: 0; font-size: 14px; }
.user-list li { padding: 5px 0; }
.metric-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.settings-card { margin-top: 24px; }
.crumb { margin: 0 0 4px; font-size: 13px; }
.viewing-as {
  background: var(--warn-bg); color: var(--warn-ink); padding: 8px 14px;
  border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px;
}
main > section.card { margin-top: 16px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 40px 16px 24px;
        display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.foot a { color: var(--muted); }
.foot-logo { height: 18px; width: auto; opacity: .7; }

/* mobile */
@media (max-width: 640px) {
  h1 { font-size: 26px; }
  h2 { font-size: 19px; }
  .section-head h2 .qualifier, h2 .goal-period, h2 .qualifier {
    display: block; margin: 2px 0 0; }
  .page-section { margin-top: 40px; }
  summary { padding: 12px 0; font-size: 15px; }
  .goal-row summary { padding: 14px 0; }
  .goal-flag summary { padding-left: 10px; }
  .goal-bar-wrap { order: 3; }
  .goal-main { flex-basis: 100%; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile-l { font-size: 12px; }
  .bar-lab, .bar-val { font-size: 11.5px; }
  .capsule { flex: 1 1 40%; min-width: 0; }
  .assignee { margin-left: 0; margin-top: 2px; }
  .todo-list li { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
}
