/* CapitalSites owners' dashboard + client portal.
   Layout follows Miga's reference (OneListing "My Wallet"): white top bar, icon sidebar, light-gray canvas,
   white rounded cards, soft status pills. Accent is the CapitalSites garnet #782F40 instead of the
   reference's coral, so the dashboard matches the brand. Fonts: Jost (headings) + Inter (UI). */
:root {
  --canvas: #F4F4F5; --surface: #FFFFFF; --ink: #111111; --ink-2: #5F5F66; --ink-3: #8C8C94; --line: #ECECEF; --head: #F3F3F5;
  --accent: #782F40; --accent-2: #9A3D52; --accent-soft: #F6E9EC; --accent-ink: #FFFFFF;
  --ok: #2F7A3E; --ok-bg: #E3F4E5; --warn: #9A5B00; --warn-bg: #FDEBD3; --bad: #B4232A; --bad-bg: #FCE4E4; --info: #2F5C8F; --info-bg: #E5EEF8; --muted-bg: #EFEFF1;
  --radius: 10px; --radius-card: 18px; --shadow: 0 1px 2px rgba(17,17,17,.04), 0 8px 24px rgba(17,17,17,.04);
  --font-display: "Jost", system-ui, sans-serif; --font-body: "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 14.5px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 50; }
.ico { width: 18px; height: 18px; flex: none; }

/* ---- top bar ---- */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .inner { padding: 0 28px; display: flex; align-items: center; gap: 24px; min-height: 72px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 600 21px/1 var(--font-display); color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.wordmark .wm-text span { color: var(--accent); }
.wordmark .mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; font: 700 17px/1 var(--font-display); }
.who { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--head); color: var(--ink); font-weight: 600; }
.who-text { display: grid; line-height: 1.25; } .who-text b { font-weight: 500; font-size: 14px; } .who-text small { color: var(--ink-3); font-size: 12px; }
.top-out { background: none; border: 0; color: var(--ink-2); cursor: pointer; font: inherit; display: inline-flex; gap: 6px; align-items: center; }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 24px 20px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 72px; height: calc(100vh - 72px); overflow-y: auto; }
.side nav { display: grid; gap: 2px; margin-bottom: 18px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 14.5px; }
.side .ico-wrap { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--head); color: var(--ink); transition: background .2s, color .2s; }
.side nav a:hover .ico-wrap { background: var(--accent-soft); color: var(--accent); }
.side nav a[aria-current="page"] { color: var(--accent); }
.side nav a[aria-current="page"] .ico-wrap { background: var(--accent); color: #fff; }
.side-cta, .side-out { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 42px; border-radius: 8px; font: 500 14px/1 var(--font-body); text-decoration: none; cursor: pointer; border: 0; }
.side-cta { background: var(--ink); color: #fff; } .side-cta:hover { background: #2a2a2a; }
.side-out { background: var(--head); color: var(--ink); margin-top: 8px; } .side-out:hover { background: #E7E7EA; }
.side form.inline { display: block; }

main { padding: 32px 32px 80px; min-width: 0; }
main.narrow { max-width: 1100px; margin: 0 auto; }

/* ---- type ---- */
.eyebrow { font: 500 11px/1.2 var(--font-body); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; line-height: 1.12; margin: 0 0 12px; }
h1 { font-size: clamp(28px, 3.2vw, 38px); margin-bottom: 24px; } h2 { font-size: 23px; } h3 { font-size: 17px; }
h1 em, h2 em { font-style: normal; color: inherit; } /* one-voice headlines in the app */
p { max-width: 72ch; } .muted { color: var(--ink-2); } .small { font-size: 13px; }

/* ---- cards & grids ---- */
.grid { display: grid; gap: 24px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--surface); border: 0; border-radius: var(--radius-card); padding: 26px 28px; min-width: 0; box-shadow: var(--shadow); }
.card + .card { margin-top: 24px; } .grid > .card + .card, .stats > .card + .card, .side-col > .card + .card { margin-top: 0; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.section { margin-top: 28px; }

/* stat cards */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-bottom: 28px; }
.stat { display: flex; gap: 22px; align-items: flex-start; }
.stat-ico { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 14px; background: var(--accent); color: #fff; flex: none; }
.stat-ico .ico { width: 30px; height: 30px; stroke-width: 1.9; }
.stat .label { font-weight: 500; font-size: 14px; margin: 2px 0 2px; }
.stat .value { font: 700 32px/1.1 var(--font-display); letter-spacing: -0.01em; margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.stat ul { list-style: none; margin: 0; padding: 0; color: var(--ink-2); font-size: 13px; }
.stat li::before { content: "•"; color: var(--ink-3); margin-right: 6px; }

.dash { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.dash .side-col { display: grid; gap: 24px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.chip { display: inline-block; padding: 3px 9px; border-radius: 999px; background: var(--head); font-size: 12px; font-weight: 500; color: var(--ink); }
.tabs { display: flex; gap: 28px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 0 10px; color: var(--ink-3); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--ink); }
.big-note { font-size: 15px; margin: 6px 0 16px; } .big-note b { color: var(--accent); font-weight: 600; }
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.pager a, .pager span { display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 13px; }
.pager [aria-current="page"] { border: 2px solid var(--ink); font-weight: 600; } .pager .off { color: var(--ink-3); }

/* ---- buttons & forms ---- */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 9px 18px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font: 500 14px/1 var(--font-body); text-decoration: none; cursor: pointer; border-radius: 8px; }
.btn:hover { background: #2a2a2a; }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } .btn--accent:hover { background: #5f2433; }
.btn--pill { border-radius: 8px; min-height: 42px; }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line); } .btn--ghost:hover { background: var(--head); }
.btn--danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
form.inline { display: inline; }
label { display: grid; gap: 5px; font-size: 13px; font-weight: 500; }
input, select, textarea { font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid #DDDDE2; background: #fff; color: var(--ink); border-radius: var(--radius); min-height: 42px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 96px; } input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.fields { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.fields .wide { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; min-width: 0; } legend { font-weight: 600; padding: 0 6px; }
.hint { font-weight: 400; color: var(--ink-2); font-size: 12px; }
.flash { padding: 13px 16px; border-radius: 12px; background: var(--info-bg); color: var(--info); margin-bottom: 22px; font-weight: 500; }
.flash--error { background: var(--bad-bg); color: var(--bad); } .flash--ok { background: var(--ok-bg); color: var(--ok); }
.flash ul { margin: 6px 0 0; padding-left: 18px; font-weight: 400; }

/* ---- tables ---- */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
th { text-align: left; font: 600 11px/1.2 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); padding: 14px 16px; background: var(--head); border: 0; white-space: nowrap; }
th:first-child { border-radius: 10px 0 0 10px; } th:last-child { border-radius: 0 10px 10px 0; }
td { padding: 15px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td a { color: var(--ink); text-decoration: none; font-weight: 500; } td a:hover { color: var(--accent); text-decoration: underline; }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius-card); padding: 12px; box-shadow: var(--shadow); }
.card .table-wrap { padding: 0; box-shadow: none; border-radius: 0; }

/* soft status pills */
.badge { display: inline-block; padding: 4px 10px; font-size: 12px; font-weight: 600; border-radius: 999px; white-space: nowrap; border: 0; }
.tone-ok { color: var(--ok); } .tone-warn { color: var(--warn); } .tone-bad { color: var(--bad); } .tone-info { color: var(--info); } .tone-muted { color: var(--ink-2); }
.badge.tone-ok { background: var(--ok-bg); } .badge.tone-warn { background: var(--warn-bg); } .badge.tone-bad { background: var(--bad-bg); } .badge.tone-info { background: var(--info-bg); } .badge.tone-muted { background: var(--muted-bg); }

/* ---- client stages, details ---- */
.stages { display: grid; grid-template-columns: repeat(6, 1fr); background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow); margin: 0 0 24px; padding: 0; overflow: hidden; }
.stages li { list-style: none; padding: 16px; border-left: 1px solid var(--line); font-size: 13px; }
.stages li:first-child { border-left: 0; } .stages ol { margin: 0; padding: 0; display: contents; }
.stages .n { display: block; font: 700 22px/1 var(--font-display); color: #D4D4DA; margin-bottom: 6px; }
.stages .done .n { color: var(--ink); } .stages .current { background: var(--accent-soft); } .stages .current .n { color: var(--accent); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 14px; margin: 0; } .kv dt { color: var(--ink-2); }
.preview-frame { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.concepts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.concept iframe { width: 100%; height: 360px; border: 1px solid var(--line); border-radius: 12px; background: #fff; pointer-events: none; }
.concept.selected { outline: 3px solid var(--accent); }
.list-plain { list-style: none; padding: 0; margin: 0; } .list-plain li { padding: 10px 0; border-bottom: 1px solid var(--line); } .list-plain li:last-child { border-bottom: 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; overflow-wrap: anywhere; }
details > summary { cursor: pointer; font-weight: 500; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.empty { padding: 28px; text-align: center; color: var(--ink-2); border: 1px dashed #DDDDE2; border-radius: 12px; background: var(--surface); }
.card .empty { background: transparent; }

@media (max-width: 1180px) { .dash { grid-template-columns: 1fr; } }
@media (max-width: 980px) { .stats { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .top .inner { padding: 0 16px; min-height: 64px; gap: 12px; } .who-text { display: none; } .who .btn { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 10px 16px; flex-direction: row; align-items: center; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); gap: 8px; }
  .side nav { display: flex; gap: 4px; margin: 0; } .side nav a { white-space: nowrap; padding: 6px 8px; }
  .side-cta, .side-out { width: auto; padding: 0 14px; margin: 0; white-space: nowrap; }
  main { padding: 22px 16px 64px; } .card { padding: 20px 18px; }
  .g2, .g3 { grid-template-columns: 1fr; } .stages { grid-template-columns: repeat(3, 1fr); } .stages li:nth-child(4) { border-left: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
