@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif&family=Inter+Tight:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f6f5f1;
  --canvas: #fbfaf6;
  --surface: #ffffff;
  --surface-2: #faf8f3;
  --ink: #1a1a17;
  --ink-2: #3a3a35;
  --muted: #79766e;
  --subtle: #b8b4a8;
  --line: #ece8dd;
  --line-2: #e3dfd1;
  --accent: #2d5d3b;
  --accent-soft: #e7efe6;
  --gold: #b8893d;
  --gold-soft: #f5ecd9;
  --rose: #b04a3f;
  --rose-soft: #f5e3df;
  --sky: #4a6da4;
  --sky-soft: #e3eaf3;
  --violet: #6e4aa4;
  --violet-soft: #ece4f3;
  --radius: 18px;
}
html, body { background: var(--bg); }
body {
  font-family: 'Inter Tight', sans-serif;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}
a { color: inherit; text-decoration: none; }
.serif { font-family: 'Instrument Serif', serif; font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: 'JetBrains Mono', monospace; }

.app {
  width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background: var(--bg);
}
.app.full { grid-template-columns: 1fr; }

/* ------------- Sidebar ------------- */
.sidebar {
  position: sticky; top: 0;
  height: 100vh;
  padding: 22px 18px;
  display: flex; flex-direction: column;
  gap: 6px;
  border-right: 1px solid var(--line);
  background: var(--bg);
  overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 4px 8px 16px;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  display: grid; place-items: center;
  font-family: 'Instrument Serif', serif;
  font-size: 20px;
  position: relative;
}
.brand-mark.client { background: linear-gradient(135deg, #4a6da4, #2d5d3b); }
.brand-mark.external { background: linear-gradient(135deg, #6e4aa4, #b8893d); }
.brand-mark::after {
  content:''; position: absolute; inset: 3px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
}
.brand-name { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }

.workspace {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 4px 0 16px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
  cursor: pointer;
}
.ws-avatar {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, #2d5d3b, #4a8064);
  color: white; font-size: 11px; font-weight: 600;
  display: grid; place-items: center;
}
.ws-avatar.client { background: linear-gradient(135deg, #4a6da4, #6e4aa4); }
.ws-avatar.external { background: linear-gradient(135deg, #b8893d, #b04a3f); }
.ws-info { flex:1; min-width: 0; }
.ws-name { font-size: 13px; font-weight: 600; }
.ws-meta { font-size: 11px; color: var(--muted); }

.nav-label {
  font-size: 10.5px; font-weight: 500; color: var(--subtle);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 14px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  font-weight: 500;
  position: relative;
  text-decoration: none;
}
.nav-item:hover { background: rgba(0,0,0,0.025); color: var(--ink); }
.nav-item.active {
  background: var(--ink);
  color: var(--bg);
}
.nav-item svg { color: var(--muted); flex-shrink: 0; }
.nav-item.active svg { color: rgba(255,255,255,0.85); }
.nav-item .count {
  margin-left: auto; font-size: 11px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 1px 7px; border-radius: 999px; color: var(--muted);
  font-weight: 500;
}
.nav-item.active .count {
  background: rgba(255,255,255,0.12); border-color: transparent; color: var(--bg);
}

.sidebar-promo {
  margin-top: auto;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(160deg, #1a1a17, #3a3a35);
  color: var(--bg);
  position: relative;
  overflow: hidden;
}
.sidebar-promo::before {
  content:''; position: absolute; right: -20px; top: -20px;
  width: 100px; height: 100px; border-radius: 50%;
  background: radial-gradient(circle, rgba(184,137,61,0.4), transparent 70%);
}
.promo-tag { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; font-weight: 600; }
.promo-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.promo-desc { font-size: 12px; color: rgba(255,255,255,0.65); margin-top: 4px; line-height: 1.5; }
.promo-cta {
  margin-top: 10px; font-size: 12px; color: var(--bg);
  display: inline-flex; align-items: center; gap: 5px;
  font-weight: 500; cursor: pointer;
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  margin-top: 10px;
  border-radius: 12px;
  cursor: pointer;
}
.sidebar-user:hover { background: rgba(0,0,0,0.03); }
.av {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 600;
}
.av-sr { background: #f5ecd9; color: #b8893d; border: 1px solid #ead7a7; }
.user-info { flex:1; min-width: 0;}
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--muted); }

/* ------------- Main + Topbar ------------- */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 32px;
  background: rgba(246,245,241,0.85);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.search {
  flex: 1; max-width: 520px;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted); font-size: 13px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
  cursor: text;
}
.kbd {
  margin-left: auto; font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; background: var(--bg); border: 1px solid var(--line);
  padding: 2px 6px; border-radius: 5px; color: var(--muted);
}
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 11px;
  display: grid; place-items: center;
  cursor: pointer; color: var(--ink-2);
  position: relative;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.dot {
  position: absolute; top: 8px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--rose); border: 2px solid var(--surface);
}
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 11px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); box-shadow: 0 1px 0 rgba(0,0,0,0.02);
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn-primary {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.08);
}
.btn-primary:hover { background: #2d2d28; }
.btn-accent {
  background: var(--accent); color: white; border-color: var(--accent);
}
.btn-accent:hover { filter: brightness(1.08); }
.btn-ghost {
  background: transparent; border-color: transparent;
}
.btn-ghost:hover { background: rgba(0,0,0,0.04); }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 12px 20px; font-size: 14px; border-radius: 12px; }

.page { padding: 28px 32px 56px; display: flex; flex-direction: column; gap: 22px; }
.page-narrow { max-width: 1080px; width: 100%; margin: 0 auto; padding: 28px 32px 56px; display: flex; flex-direction: column; gap: 22px; }

.crumbs {
  font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs .here { color: var(--ink); font-weight: 500; }
.crumbs span.sep { color: var(--subtle); }

/* ------------- Hero / page header ------------- */
.hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 32px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 18px 40px -28px rgba(0,0,0,0.12);
}
.hero::before {
  content:''; position: absolute; right: -120px; top: -120px;
  width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(45,93,59,0.08), transparent 65%);
}
.hero::after {
  content:''; position: absolute; right: -60px; bottom: -160px;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(184,137,61,0.08), transparent 65%);
}
.hero-grid {
  display: grid; grid-template-columns: 1fr auto;
  gap: 32px; align-items: center;
  position: relative; z-index: 1;
}
.hero-tag {
  font-size: 11.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.12em;
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.hero-tag .live {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px rgba(45,93,59,0.15);
}
.hero-title {
  font-size: 36px; line-height: 1.1; letter-spacing: -0.025em;
  font-weight: 500;
}
.hero-title em { font-family: 'Instrument Serif', serif; font-style: italic; font-weight: 400; color: var(--accent); }
.hero-meta {
  display: flex; align-items: center; gap: 18px;
  margin-top: 16px; font-size: 13px; color: var(--muted);
  flex-wrap: wrap;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta b { color: var(--ink); font-weight: 600; }
.dotsep { width: 3px; height: 3px; border-radius: 50%; background: var(--subtle); }

.avatars { display: flex; }
.avatars .av { width: 26px; height: 26px; margin-left: -8px; border: 2px solid var(--surface); font-size: 10px; }
.avatars .av:first-child { margin-left: 0; }
.av-1 { background:#f5ecd9; color:#b8893d; }
.av-2 { background:#e3eaf3; color:#4a6da4; }
.av-3 { background:#e7efe6; color:#2d5d3b; }
.av-4 { background:#f5e3df; color:#b04a3f; }
.av-5 { background:#ece4f3; color:#6e4aa4; }
.av-more { background: var(--surface-2); color: var(--muted); border:1px solid var(--line); }

.hero-actions { display: flex; gap: 10px; flex-shrink: 0; }

.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  position: relative; z-index: 1;
}
.hero-stat { padding: 0 20px; border-right: 1px solid var(--line); }
.hero-stat:first-child { padding-left: 0; }
.hero-stat:last-child { border-right: none; }
.hs-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; }
.hs-value { font-size: 30px; font-weight: 500; letter-spacing: -0.025em; margin-top: 8px; display: flex; align-items: baseline; gap: 6px; }
.hs-value .unit { font-size: 14px; color: var(--muted); font-weight: 400; }
.hs-value .serif-num { font-family: 'Instrument Serif', serif; font-size: 36px; font-weight: 400; }
.hs-trend { font-size: 12px; margin-top: 6px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.up { color: var(--accent); font-weight: 600; }
.down { color: var(--rose); font-weight: 600; }
.spark { width: 60px; height: 18px; }

/* ------------- Layout primitives ------------- */
.cols-2 { display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px; }
.cols-2-eq { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cols-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.col { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
  overflow: hidden;
}
.card-elevated {
  box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 24px 48px -32px rgba(0,0,0,0.18);
}
.card-pad { padding: 22px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 14px;
  gap: 14px;
}
.card-title { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.card-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card-link {
  font-size: 12.5px; color: var(--ink-2); cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  text-decoration: none; padding: 6px 10px; border-radius: 8px;
}
.card-link:hover { background: var(--surface-2); }

.chip {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 5px;
}
.chip.green { background: var(--accent-soft); color: var(--accent); border-color: rgba(45,93,59,0.18); }
.chip.amber { background: var(--gold-soft); color: var(--gold); border-color: rgba(184,137,61,0.25); }
.chip.rose { background: var(--rose-soft); color: var(--rose); border-color: rgba(176,74,63,0.2); }
.chip.sky { background: var(--sky-soft); color: var(--sky); border-color: rgba(74,109,164,0.22); }
.chip.violet { background: var(--violet-soft); color: var(--violet); border-color: rgba(110,74,164,0.22); }
.chip.ink { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ------------- Score / metrics ------------- */
.score-card {
  padding: 0;
  background:
    radial-gradient(circle at 0% 0%, rgba(45,93,59,0.05), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(184,137,61,0.06), transparent 50%),
    var(--surface);
}
.score-body {
  display: grid; grid-template-columns: 240px 1fr;
  gap: 32px;
  padding: 8px 26px 26px;
}
.score-ring-wrap {
  display: flex; flex-direction: column; align-items: center;
  padding-top: 8px;
}
.score-ring { position: relative; width: 200px; height: 200px; display: grid; place-items: center; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .center { position: absolute; text-align: center; }
.score-ring .center .num {
  font-family: 'Instrument Serif', serif;
  font-size: 64px; font-weight: 400; line-height: 1;
  letter-spacing: -0.02em;
}
.score-ring .center .out { font-size: 13px; color: var(--muted); margin-top: 4px; }
.score-tag {
  margin-top: 14px; font-size: 12px; color: var(--accent);
  background: var(--accent-soft); padding: 5px 11px; border-radius: 999px;
  font-weight: 600;
  border: 1px solid rgba(45,93,59,0.18);
}
.score-explain {
  font-size: 12px; color: var(--muted); margin-top: 10px;
  text-align: center; line-height: 1.5; padding: 0 8px;
}
.metric-list { display: flex; flex-direction: column; gap: 14px; }
.metric {
  display: grid; grid-template-columns: 150px 1fr 70px;
  align-items: center; gap: 14px;
}
.metric-name { font-size: 13.5px; font-weight: 500; }
.metric-name small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.metric-track {
  height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden;
  border: 1px solid var(--line);
  position: relative;
}
.metric-track span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #4a8064);
}
.metric-track.warn span { background: linear-gradient(90deg, var(--gold), #d4a45c); }
.metric-track.bad span { background: linear-gradient(90deg, var(--rose), #d06a5d); }
.metric-val {
  font-family: 'Instrument Serif', serif; font-size: 22px;
  text-align: right; line-height: 1;
}
.metric-val small { color: var(--muted); font-size: 12px; font-family: 'Inter Tight', sans-serif; margin-left: 1px; }

.insight {
  margin: 0 22px 22px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(45,93,59,0.05), rgba(184,137,61,0.04));
  border: 1px solid rgba(45,93,59,0.12);
  display: flex; gap: 14px; align-items: flex-start;
}
.insight-icon {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--surface);
  display: grid; place-items: center;
  color: var(--accent);
  border: 1px solid rgba(45,93,59,0.15);
  flex-shrink: 0;
}
.insight-body { flex: 1; }
.insight-tag { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); font-weight: 600; }
.insight-text { font-size: 13.5px; margin-top: 2px; line-height: 1.55; }
.insight-text b { font-weight: 600; }

/* ------------- Timeline / activity ------------- */
.timeline { padding: 4px 4px 16px; position: relative; }
.tl-item {
  display: grid; grid-template-columns: 36px 1fr;
  gap: 14px; padding: 12px 22px;
  position: relative;
  cursor: pointer;
}
.tl-item:hover { background: var(--surface-2); }
.tl-icon {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  z-index: 1;
}
.tl-icon.green { background: var(--accent-soft); color: var(--accent); border-color: rgba(45,93,59,0.18); }
.tl-icon.gold { background: var(--gold-soft); color: var(--gold); border-color: rgba(184,137,61,0.22); }
.tl-icon.rose { background: var(--rose-soft); color: var(--rose); border-color: rgba(176,74,63,0.22); }
.tl-icon.sky  { background: var(--sky-soft); color: var(--sky); border-color: rgba(74,109,164,0.22); }
.tl-text { font-size: 13.5px; font-weight: 500; }
.tl-text b { font-weight: 600; }
.tl-meta { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; align-items: center; }

/* ------------- Conflicts list ------------- */
.conf-card { padding: 0 22px 8px; }
.conf-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.conf-item:last-child { border-bottom: none; }
.conf-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.sev {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; letter-spacing: 0.04em;
}
.sev.high { background: var(--rose-soft); color: var(--rose); }
.sev.med { background: var(--gold-soft); color: var(--gold); }
.sev.low { background: var(--sky-soft); color: var(--sky); }
.conf-type { font-size: 12px; color: var(--muted); }
.conf-ref { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--muted); background: var(--surface-2); padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); }
.conf-title { font-size: 14.5px; font-weight: 500; margin-bottom: 6px; line-height: 1.45; }
.conf-rec { font-size: 13px; color: var(--muted); line-height: 1.6; }
.conf-rec b { color: var(--ink); font-weight: 500; }
.conf-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; gap: 12px; flex-wrap: wrap; }
.suggest { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.suggest .av { width: 22px; height: 22px; font-size: 10px; }
.suggest b { color: var(--ink); font-weight: 600; }
.tiny-btn {
  font-size: 12px; padding: 6px 11px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink-2); font-weight: 500; cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
}
.tiny-btn:hover { background: var(--bg); }
.tiny-btn.solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tiny-btn.solid:hover { background: #2d2d28; }
.tiny-btn.accent { background: var(--accent); color: white; border-color: var(--accent); }
.tiny-btn.danger { background: var(--rose); color: white; border-color: var(--rose); }

/* ------------- Approvals list ------------- */
.appr-list { padding: 8px 22px 22px; display: flex; flex-direction: column; gap: 8px; }
.appr {
  display: grid; grid-template-columns: auto 1fr auto auto;
  gap: 14px; align-items: center;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}
.appr:hover { background: var(--bg); }
.appr-stage {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line);
  padding: 3px 8px; border-radius: 7px;
  font-weight: 500;
  display: inline-block;
}
.appr-progress { display: flex; gap: 3px; margin-top: 4px; }
.appr-progress span { width: 16px; height: 3px; border-radius: 2px; background: var(--line-2); }
.appr-progress span.done { background: var(--accent); }
.appr-progress span.now { background: var(--gold); }
.appr-title { font-size: 13.5px; font-weight: 500; }
.appr-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.appr-owner { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.appr-due { font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; min-width: 76px; color: var(--muted); }
.appr-due.late { color: var(--rose); font-weight: 600; }

/* ------------- Conversational assistant card ------------- */
.assist-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(184,137,61,0.08), transparent 60%),
    linear-gradient(160deg, #1a1a17, #2a2a25);
  color: var(--bg);
  border: 1px solid #2a2a25;
  border-radius: 18px;
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.assist-card::before {
  content:''; position: absolute; left: -40px; bottom: -80px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(45,93,59,0.4), transparent 65%);
}
.assist-tag {
  font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold); font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px;
  position: relative; z-index: 1;
}
.assist-title {
  font-size: 24px; line-height: 1.2; letter-spacing: -0.02em;
  margin-top: 10px; font-weight: 500;
  position: relative; z-index: 1;
}
.assist-title em { font-family:'Instrument Serif', serif; font-style: italic; font-weight: 400; color: #d4b58a; }
.assist-suggestions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; position: relative; z-index: 1; }
.assist-suggest {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 11px 14px;
  border-radius: 11px;
  font-size: 13px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}
.assist-suggest:hover { background: rgba(255,255,255,0.08); }
.assist-suggest svg { color: rgba(255,255,255,0.55); flex-shrink: 0; }
.assist-input {
  margin-top: 16px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  display: flex; align-items: center; gap: 10px;
  position: relative; z-index: 1;
}
.assist-input input {
  background: transparent; border: 0; outline: 0;
  color: rgba(255,255,255,0.92);
  flex: 1; font: inherit;
}
.assist-input input::placeholder { color: rgba(255,255,255,0.45); }
.assist-input .send {
  margin-left: auto; width: 28px; height: 28px;
  background: var(--gold); border-radius: 8px;
  display: grid; place-items: center; color: var(--ink); cursor: pointer;
  border: 0;
}

/* ------------- Aging table ------------- */
.aging-card { padding: 4px 0 16px; }
.aging-head {
  display: grid; grid-template-columns: 2.4fr 1fr 1.4fr 0.8fr 1fr 1.4fr 1fr;
  padding: 12px 22px; border-bottom: 1px solid var(--line);
  font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 500;
}
.aging-row {
  display: grid; grid-template-columns: 2.4fr 1fr 1.4fr 0.8fr 1fr 1.4fr 1fr;
  padding: 14px 22px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  cursor: pointer;
}
.aging-row:last-child { border-bottom: none; }
.aging-row:hover { background: var(--surface-2); }
.it-title { font-weight: 500; }
.it-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.owner-cell { display:flex; align-items:center; gap:8px; }
.owner-cell .av { width: 26px; height: 26px; font-size: 11px; }
.aging-vis { display: flex; align-items: center; gap: 10px; }
.aging-vis .track {
  flex: 1; height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden;
  border: 1px solid var(--line);
  max-width: 90px;
}
.aging-vis .track span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), #d4a45c); }
.aging-vis.crit .track span { background: linear-gradient(90deg, var(--rose), #d06a5d); }
.aging-vis .pill { font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.crit-text { color: var(--rose); font-weight: 600; }
.warn-text { color: var(--gold); font-weight: 600; }
.ok-text { color: var(--accent); font-weight: 600; }

/* ------------- Generic table ------------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th {
  text-align: left; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.07em; font-weight: 500;
  padding: 12px 22px; border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.tbl tbody td {
  padding: 14px 22px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle;
}
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }

/* ------------- Form ------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; padding: 11px 13px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface);
  font: inherit; color: var(--ink); font-size: 13.5px;
  outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,0.06); }
.textarea { min-height: 100px; resize: vertical; line-height: 1.55; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ------------- Login screens ------------- */
.auth-shell {
  min-height: 100vh; width: 100%;
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.auth-shell.single { grid-template-columns: 1fr; }
.auth-art {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #1a1a17, #2a2a25);
  color: var(--bg);
  padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-art::before {
  content:''; position: absolute; right: -120px; top: -80px;
  width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(184,137,61,0.35), transparent 65%);
}
.auth-art::after {
  content:''; position: absolute; left: -100px; bottom: -120px;
  width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(45,93,59,0.35), transparent 65%);
}
.auth-art.client::before { background: radial-gradient(circle, rgba(74,109,164,0.4), transparent 65%); }
.auth-art.client::after { background: radial-gradient(circle, rgba(110,74,164,0.35), transparent 65%); }
.auth-art.external::before { background: radial-gradient(circle, rgba(184,137,61,0.4), transparent 65%); }
.auth-art.external::after { background: radial-gradient(circle, rgba(176,74,63,0.3), transparent 65%); }
.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.auth-brand .brand-mark { width: 38px; height: 38px; font-size: 22px; }
.auth-quote { position: relative; z-index: 1; max-width: 460px; }
.auth-quote .tag { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.auth-quote h2 { font-family: 'Instrument Serif', serif; font-size: 44px; line-height: 1.1; font-weight: 400; margin-top: 14px; letter-spacing: -0.015em; }
.auth-quote h2 em { color: #d4b58a; font-style: italic; }
.auth-quote p { font-size: 14px; color: rgba(255,255,255,0.7); margin-top: 16px; line-height: 1.6; }
.auth-foot { position: relative; z-index: 1; font-size: 12px; color: rgba(255,255,255,0.5); display: flex; gap: 14px; }

.auth-form-wrap {
  display: grid; place-items: center;
  padding: 56px;
}
.auth-form { width: 100%; max-width: 380px; }
.auth-form h1 {
  font-family: 'Instrument Serif', serif;
  font-size: 38px; line-height: 1.1; font-weight: 400;
  letter-spacing: -0.015em; margin-bottom: 8px;
}
.auth-form h1 em { font-style: italic; color: var(--accent); }
.auth-form .sub { font-size: 13.5px; color: var(--muted); margin-bottom: 28px; }
.auth-divider { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: var(--subtle); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.1em; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-bottom { font-size: 12.5px; color: var(--muted); margin-top: 22px; text-align: center; }
.auth-bottom a { color: var(--ink); font-weight: 600; }

.idp-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 500; font-size: 13.5px;
  margin-bottom: 10px;
}
.idp-btn:hover { background: var(--surface-2); }
.idp-btn .logo { width: 18px; height: 18px; display: inline-grid; place-items: center; }

/* ------------- Misc ------------- */
.split-line { height: 1px; background: var(--line); width: 100%; margin: 4px 0; }

.empty {
  padding: 36px; text-align: center; color: var(--muted);
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.empty svg { color: var(--subtle); }

.tabs { display: inline-flex; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; gap: 2px; }
.tab {
  padding: 7px 14px; border-radius: 9px; font-size: 13px; cursor: pointer;
  color: var(--muted); font-weight: 500;
}
.tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 0 rgba(0,0,0,0.04); }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 18px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { color: var(--ink); }

.wizard-steps { display: flex; align-items: center; gap: 6px; margin-bottom: 22px; }
.wstep {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}
.wstep .num {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface-2); display: grid; place-items: center;
  font-size: 11px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line);
}
.wstep.done { color: var(--accent); border-color: rgba(45,93,59,0.18); background: var(--accent-soft); }
.wstep.done .num { background: var(--accent); color: white; border-color: var(--accent); }
.wstep.active { color: var(--ink); border-color: var(--ink); background: var(--ink); color: var(--bg); }
.wstep.active .num { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.wstep .arrow { color: var(--subtle); }

.toggle { width: 36px; height: 20px; background: var(--line-2); border-radius: 999px; position: relative; cursor: pointer; transition: background .2s; }
.toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; background: white; border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2); transition: left .2s;
}
.toggle.on { background: var(--accent); }
.toggle.on::after { left: 18px; }

.callout {
  padding: 14px 16px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(45,93,59,0.18);
  font-size: 13px;
  display: flex; gap: 12px; align-items: flex-start;
}
.callout.warn { background: var(--gold-soft); color: var(--gold); border-color: rgba(184,137,61,0.25); }
.callout.danger { background: var(--rose-soft); color: var(--rose); border-color: rgba(176,74,63,0.2); }
.callout.info { background: var(--sky-soft); color: var(--sky); border-color: rgba(74,109,164,0.22); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600;
  padding: 4px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}

.kpi-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 20px 22px;
  position: relative; overflow: hidden;
}
.kpi-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; }
.kpi-value { font-family: 'Instrument Serif', serif; font-size: 38px; font-weight: 400; line-height: 1; margin-top: 10px; letter-spacing: -0.02em; }
.kpi-value small { font-size: 13px; color: var(--muted); font-family: 'Inter Tight', sans-serif; margin-left: 4px; }
.kpi-trend { font-size: 12px; margin-top: 10px; color: var(--muted); }

/* Graph view */
.graph-canvas {
  position: relative; height: 460px;
  background:
    radial-gradient(circle at 25% 30%, rgba(45,93,59,0.06), transparent 50%),
    radial-gradient(circle at 75% 70%, rgba(184,137,61,0.05), transparent 50%),
    var(--surface-2);
  border-radius: 16px; border: 1px solid var(--line);
  overflow: hidden;
}
.gnode {
  position: absolute; padding: 8px 12px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12px; font-weight: 500;
  box-shadow: 0 4px 12px -6px rgba(0,0,0,0.15);
  cursor: pointer;
}
.gnode .gnode-meta { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.gnode.green { border-color: rgba(45,93,59,0.3); background: var(--accent-soft); color: var(--accent); }
.gnode.gold { border-color: rgba(184,137,61,0.3); background: var(--gold-soft); color: var(--gold); }
.gnode.rose { border-color: rgba(176,74,63,0.3); background: var(--rose-soft); color: var(--rose); }
.gnode.sky { border-color: rgba(74,109,164,0.3); background: var(--sky-soft); color: var(--sky); }
.gnode.violet { border-color: rgba(110,74,164,0.3); background: var(--violet-soft); color: var(--violet); }

/* Chat */
.chat-shell { display: grid; grid-template-rows: 1fr auto; height: calc(100vh - 80px); }
.chat-list { padding: 24px 32px; display: flex; flex-direction: column; gap: 18px; overflow: auto; }
.bubble { max-width: 720px; padding: 14px 18px; border-radius: 16px; font-size: 14px; line-height: 1.55; }
.bubble.you { align-self: flex-end; background: var(--ink); color: var(--bg); }
.bubble.ai { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); }
.bubble.ai .src { display: block; margin-top: 10px; font-size: 12px; color: var(--muted); }
.bubble.ai .src a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; margin-right: 10px; }
.chat-input-bar {
  padding: 16px 32px 22px; background: var(--bg); border-top: 1px solid var(--line);
  display: flex; gap: 10px; align-items: center;
}
.chat-input-bar .grow { flex: 1; }
.chat-input-bar input { width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font: inherit; outline: none; }

/* white-label */
.brand-client {
  --bg: #f3f5f8;
  --canvas: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f3f5f8;
  --ink: #16223a;
  --ink-2: #2d3a55;
  --muted: #6b7791;
  --subtle: #aab3c5;
  --line: #e1e5ee;
  --line-2: #d6dbe7;
  --accent: #2c4a8a;
  --accent-soft: #e3eaf3;
  --gold: #b8893d;
  --gold-soft: #f5ecd9;
}
.brand-external {
  --bg: #f6f3ee;
  --canvas: #faf7f1;
  --surface: #ffffff;
  --surface-2: #f7f3ec;
  --ink: #2a2218;
  --ink-2: #4a4030;
  --muted: #7c6f57;
  --subtle: #b9ad94;
  --line: #ebe3d2;
  --line-2: #ddd4bf;
  --accent: #8a5a2c;
  --accent-soft: #f5ecd9;
}

/* Print niceties */
@media (max-width: 1480px) {
  .app { width: 100%; }
}
