/* Ollie pages, styled with Twenty's design tokens (twenty-ui theme) so they
   sit seamlessly inside the CRM. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
  --font: #333333;
  --font-2: #666666;
  --font-3: #999999;
  --font-light: #b3b3b3;
  --bg: #ffffff;
  --bg-2: #fcfcfc;
  --bg-3: #f1f1f1;
  --bg-4: #ebebeb;
  --hover: rgba(0, 0, 0, 0.04);
  --hover-strong: rgba(0, 0, 0, 0.078);
  --border: #ebebeb;
  --border-light: #f1f1f1;
  --border-strong: #d6d6d6;
  /* House of Marketers brand: fuchsia leads; navy, purple and coral support it. */
  --brand-fuchsia: #fe489c; --brand-navy: #270f95; --brand-purple: #8e2a90; --brand-coral: #f28a63;
  --accent: #dc3486;
  --accent-bg: #fdebf4;
  --accent-border: #f5a9cc;
  --danger: #d4544f;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 0 4px rgba(0, 0, 0, 0.08);
  --shadow-strong: 2px 4px 16px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.04);
  /* Twenty tag colours: background / text */
  --gray-bg: #f1f1f1; --gray: #666666;
  --green-bg: #e9f6ec; --green: #308052;
  --turquoise-bg: #e4f8f3; --turquoise: #147f6e;
  --sky-bg: #e5f6fc; --sky: #31729a;
  --blue-bg: #eef2fd; --blue: #415ac1;
  --purple-bg: #f6eefc; --purple: #7948af;
  --pink-bg: #fae9f5; --pink: #b23887;
  --orange-bg: #fcefd9; --orange: #c25700;
  --yellow-bg: #fef9c3; --yellow: #997000;
  --red-bg: #fbecec; --red: #be3b38;
  font-family: Inter, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  color: var(--font);
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  :root {
    --font: #ebebeb; --font-2: #b3b3b3; --font-3: #818181; --font-light: #666666;
    --bg: #171717; --bg-2: #1b1b1b; --bg-3: #222222; --bg-4: #292929;
    --hover: rgba(255, 255, 255, 0.06); --hover-strong: rgba(255, 255, 255, 0.1);
    --border: #292929; --border-light: #222222; --border-strong: #333333;
    --accent: #ff6aae; --accent-bg: #3a1529; --accent-border: #7a2f57;
    --gray-bg: #262626; --gray: #b3b3b3;
    --green-bg: #17291d; --green: #6cc48d;
    --turquoise-bg: #13282a; --turquoise: #5fd0bf;
    --sky-bg: #13232d; --sky: #75c6ef;
    --blue-bg: #1b2140; --blue: #9eb1ff;
    --purple-bg: #261c33; --purple: #c9a4f0;
    --pink-bg: #2d1828; --pink: #f19cd0;
    --orange-bg: #2d1f12; --orange: #ffa057;
    --yellow-bg: #2a2410; --yellow: #f5d05c;
    --red-bg: #2f1716; --red: #ff8f8a;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
#app { height: 100%; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.grow { flex: 1; }
.muted { color: var(--font-3); }
.empty { padding: 48px 24px; color: var(--font-3); text-align: center; }
.icon { flex-shrink: 0; }

/* Inputs (forms, dialogs) */
input, select, textarea {
  background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
  padding: 0 8px; height: 32px; outline: none; min-width: 0;
}
textarea { height: auto; padding: 6px 8px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-bg); }

/* Buttons (Twenty Button: secondary / tertiary / primary) */
.t-btn {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px;
  border-radius: 4px; border: 1px solid var(--border); background: var(--bg);
  color: var(--font-2); font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background 0.1s ease;
}
.t-btn:hover { background: var(--hover); }
.t-btn.icon-only { width: 24px; padding: 0; justify-content: center; }
.t-btn.tertiary { border-color: transparent; background: transparent; }
.t-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .t-btn.primary { background: #dc3486; border-color: #dc3486; } }
.t-btn.primary:hover { filter: brightness(0.95); }
.t-btn.danger { color: var(--danger); }
.t-segmented { display: inline-flex; background: var(--bg-3); border-radius: 4px; padding: 2px; gap: 2px; }
.t-segmented button { border: 0; background: transparent; height: 20px; padding: 0 8px; border-radius: 3px; color: var(--font-3); font-weight: 500; cursor: pointer; }
.t-segmented button.active { background: var(--bg); color: var(--font); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }

/* Tags, avatars, record chips */
.t-tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 4px;
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-weight: 400;
}
.c-gray { background: var(--gray-bg); color: var(--gray); }
.c-green { background: var(--green-bg); color: var(--green); }
.c-turquoise { background: var(--turquoise-bg); color: var(--turquoise); }
.c-sky { background: var(--sky-bg); color: var(--sky); }
.c-blue { background: var(--blue-bg); color: var(--blue); }
.c-purple { background: var(--purple-bg); color: var(--purple); }
.c-pink { background: var(--pink-bg); color: var(--pink); }
.c-orange { background: var(--orange-bg); color: var(--orange); }
.c-yellow { background: var(--yellow-bg); color: var(--yellow); }
.c-red { background: var(--red-bg); color: var(--red); }
.t-empty { color: var(--font-light); }
.t-avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px;
  border-radius: 50%; font-size: 9px; font-weight: 500; flex-shrink: 0; line-height: 1;
}
.t-avatar.company { border-radius: 2px; }
.t-avatar.deal { border-radius: 2px; background: var(--bg-4); color: var(--font-2); }
.t-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 4px; max-width: 100%;
  border-radius: 4px; background: var(--bg-3); border: 0; color: var(--font); cursor: pointer; font-weight: 500;
}
.t-chip:hover { background: var(--bg-4); }
span.t-chip { cursor: default; }
.t-chip.muted { color: var(--font-3); text-decoration: line-through; }
.t-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-count { color: var(--font-3); font-weight: 500; }

/* Menus (dropdowns) */
.t-menu {
  position: fixed; z-index: 2500; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-strong); overflow: hidden;
}
.t-menu-search { width: 100%; height: 36px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 0 12px; box-shadow: none !important; }
.t-menu-list { max-height: 280px; overflow-y: auto; padding: 4px; display: flex; flex-direction: column; gap: 2px; }
.t-menu-footer { border-top: 1px solid var(--border); padding: 4px; }
.t-menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 8px; border: 0;
  border-radius: 4px; background: transparent; cursor: pointer; text-align: left; color: var(--font-2);
}
.t-menu-item:hover { background: var(--hover); }
.t-menu-item.danger { color: var(--danger); }
.t-menu-item .t-chip { pointer-events: none; }
.t-menu-hint { color: var(--font-3); font-size: 12px; white-space: nowrap; }
.t-menu-empty { padding: 8px; color: var(--font-3); }
.t-menu-pane { padding: 8px; display: flex; flex-direction: column; gap: 8px; }

/* Inline-edit cells */
.t-cell { display: flex; align-items: center; min-height: 32px; padding: 0 8px; gap: 4px; min-width: 0; overflow: hidden; }
.t-cell.center { justify-content: center; }
.t-cell.clickable { cursor: pointer; border-radius: 4px; }
.t-cell.clickable:hover { background: var(--hover); }
.t-cell.multiline .t-text { white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding: 6px 0; line-height: 1.4; }
.t-cell .t-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-cell.editing { padding: 0; overflow: visible; position: relative; }
.t-cell.editing input, .t-cell.editing textarea { width: 100%; border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-bg); background: var(--bg); }
.t-cell.editing textarea { position: absolute; top: 0; left: 0; z-index: 5; min-height: 96px; min-width: 240px; box-shadow: var(--shadow-strong); }
.t-check { width: 14px; height: 14px; accent-color: var(--accent); cursor: pointer; margin: 0; }

/* Twenty record table */
.t-table-wrap { overflow-x: auto; border-top: 1px solid var(--border); }
.t-table { border-collapse: collapse; width: 100%; table-layout: fixed; }
.t-table th {
  height: 32px; padding: 0 8px; text-align: left; font-weight: 500; color: var(--font-3); white-space: nowrap;
  border-bottom: 1px solid var(--border); border-right: 1px solid var(--border-light); overflow: hidden; text-overflow: ellipsis;
}
.t-table th .icon { vertical-align: -3px; margin-right: 4px; }
.t-table td { padding: 0; border-bottom: 1px solid var(--border-light); border-right: 1px solid var(--border-light); vertical-align: middle; }
.t-table th:last-child, .t-table td:last-child { border-right: 0; }
.t-table tr:hover td { background: var(--bg-2); }
.t-table td.first { padding-left: 8px; }
.t-table tr.inactive td { opacity: 0.55; }
.t-table .row-action { visibility: hidden; }
.t-table tr:hover .row-action { visibility: visible; }
.t-add-row {
  display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; width: 100%; border: 0;
  border-bottom: 1px solid var(--border-light); background: transparent; color: var(--font-3); cursor: pointer; text-align: left;
}
.t-add-row:hover { background: var(--hover); color: var(--font-2); }

/* Record-page style field list */
.t-field { display: flex; align-items: flex-start; gap: 8px; min-height: 32px; }
.t-field-label { display: flex; align-items: center; gap: 6px; width: 120px; flex-shrink: 0; min-height: 32px; color: var(--font-3); }
.t-field-value { flex: 1; min-width: 0; }
.t-field-value .t-cell { padding: 0 6px; }

/* Sections */
.t-section { padding: 16px 24px 8px; }
.t-section-head { display: flex; align-items: center; gap: 6px; height: 32px; color: var(--font-2); margin-bottom: 4px; }
.t-section-title { font-weight: 600; color: var(--font); }
.t-card { border: 1px solid var(--border); border-radius: 8px; background: var(--bg); overflow: hidden; }

/* Dialog */
.t-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.36); display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; z-index: 2000; }
.t-dialog { width: 400px; max-width: calc(100vw - 32px); background: var(--bg); border-radius: 8px; box-shadow: var(--shadow-strong); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.t-dialog-title { font-size: 1.23rem; font-weight: 600; }
.t-dialog-field { display: flex; flex-direction: column; gap: 4px; }
.t-dialog-field > span { color: var(--font-3); font-size: 0.92rem; font-weight: 500; }
.t-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.t-dialog-actions .t-btn { height: 32px; padding: 0 12px; }

.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); padding: 8px 12px; border-radius: 8px; background: var(--bg); color: var(--font); border: 1px solid var(--border); box-shadow: var(--shadow-strong); z-index: 3000; }
.toast.error { color: var(--danger); background: var(--red-bg); border-color: transparent; }

/* Page header bar (like Twenty's top bar) */
.t-topbar { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 24px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.t-topbar .title { font-weight: 600; font-size: 1.08rem; }
.t-topbar .sep { width: 1px; height: 16px; background: var(--border); }
.status { color: var(--font-3); font-size: 0.92rem; }

/* ── Blue Sheet (laid out like the HoM Blue Sheet document) ── */
.doc-desk { flex: 1; overflow: auto; background: var(--bg-3); padding: 24px 16px 48px; }
.doc { max-width: 1120px; margin: 0 auto; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 40px 48px 32px; }
.doc-head { text-align: center; margin-bottom: 24px; }
.doc-kicker { color: var(--font-3); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.85rem; }
.doc-head h1 { margin: 6px 0 12px; font-size: 2rem; font-weight: 600; letter-spacing: -0.01em; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.doc-meta { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; }
.doc-score { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 4px; font-weight: 500; }
.doc-score.good { background: var(--green-bg); color: var(--green); }
.doc-score.ok { background: var(--orange-bg); color: var(--orange); }
.doc-score.low { background: var(--red-bg); color: var(--red); }
.doc-intro { max-width: 760px; margin: 16px auto 0; color: var(--font-2); line-height: 1.6; text-align: left; }
.doc-section { margin-top: 24px; }
.doc-scroll { overflow-x: auto; }
.doc-table { border-collapse: collapse; width: 100%; table-layout: fixed; border: 1px solid var(--border-strong); }
.doc-label-col { width: 230px; }
.doc-item-col { width: 250px; }
.doc-add-colw { width: 150px; }
.doc-summary .doc-label-col { width: 230px; }
.doc-band { background: var(--bg-4); padding: 0; border-bottom: 1px solid var(--border-strong); text-align: left; }
.doc-band-inner { position: sticky; left: 0; max-width: calc(1120px - 98px); display: flex; align-items: center; gap: 12px; padding: 10px 12px; font-weight: 400; color: var(--font); }
.doc-band strong { font-weight: 600; }
.doc-band-note { color: var(--font-2); }
.doc-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--font-2); cursor: pointer; }
.doc-label { position: sticky; left: 0; z-index: 1; text-align: left; vertical-align: top; font-weight: 600; padding: 9px 12px; border: 1px solid var(--border-strong); background: var(--bg-2); line-height: 1.35; }
.doc-hint { font-weight: 400; color: var(--font-2); }
.doc-table td { border: 1px solid var(--border-strong); vertical-align: top; padding: 2px 4px; }
.doc-table td .t-cell { min-height: 34px; }
.doc-table td .t-cell.multiline .t-text { -webkit-line-clamp: 6; }
.doc-item-head { background: var(--bg-2); }
.doc-col-head { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 4px; }
.doc-col-head .t-chip { max-width: 100%; }
.doc-col-head .t-btn.icon-only { align-self: flex-end; margin-top: -26px; }
.doc-empty { color: var(--font-3); padding: 16px !important; vertical-align: middle !important; }
.doc-add-col { background: var(--bg-2); vertical-align: middle !important; text-align: center; }
.doc-add { display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--border-strong); background: var(--bg); color: var(--font-2); border-radius: 6px; padding: 8px 12px; cursor: pointer; font-weight: 500; }
.doc-add:hover { border-color: var(--accent-border); color: var(--accent); background: var(--accent-bg); }
.doc-flags { list-style: none; margin: 0; padding: 6px 6px; display: flex; flex-direction: column; gap: 6px; }
.doc-flags li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.doc-flags li.sev-high .icon { color: var(--red); }
.doc-flags li.sev-mid .icon { color: var(--orange); }
.doc-flags li.sev-low .icon { color: var(--font-3); }
.doc-prose { line-height: 1.65; }
.doc-bullets { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-weight: 500; }
.doc-bullets em { font-weight: 400; color: var(--font-2); }
mark { background: #fff36b; color: inherit; padding: 0 2px; border-radius: 2px; }
@media (prefers-color-scheme: dark) { mark { background: #6b5e00; } }
.doc-key { border: 1px solid var(--border); border-radius: 8px; }
.doc-key > summary { cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-weight: 600; list-style: none; }
.doc-key[open] > summary { border-bottom: 1px solid var(--border); }
.doc-key-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px 32px; padding: 16px; }
.doc-key-block h3 { font-size: 1rem; margin: 8px 0 8px; text-decoration: underline; text-underline-offset: 3px; }
.doc-key-block p { margin: 6px 0; color: var(--font-2); line-height: 1.55; }
.doc-pills { display: flex; flex-wrap: wrap; gap: 4px; }
@media (max-width: 860px) { .doc { padding: 24px 16px; } .doc-label-col { width: 160px; } }

/* ── Org chart ── */
.body { flex: 1; display: flex; min-height: 0; }
.canvas { flex: 1; position: relative; overflow: hidden; background-color: var(--bg-2); background-image: radial-gradient(var(--border-strong) 1px, transparent 1px); background-size: 16px 16px; cursor: grab; touch-action: none; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.edges { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; }
.edge .line { fill: none; stroke: var(--font-3); stroke-width: 1.5; }
.edge .line.dotted { stroke: var(--pink); stroke-dasharray: 5 4; }
.edge .hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; pointer-events: stroke; }
.edge.selected .line { stroke: var(--accent); stroke-width: 2.5; }
.edge.left .line { stroke-dasharray: 2 3; opacity: 0.6; }
path.temp { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 4; }
.card {
  position: absolute; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px 8px 12px; box-shadow: var(--shadow); cursor: move; user-select: none; overflow: hidden;
  display: flex; flex-direction: column; gap: 2px;
}
.card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--role, var(--border-strong)); }
.card.selected { border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-bg), var(--shadow); }
.card.left { opacity: 0.6; background: var(--bg-2); }
.card.left .name { text-decoration: line-through; }
.card .head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.card .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .title { color: var(--font-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .tags { display: flex; gap: 4px; flex-wrap: wrap; overflow: hidden; margin-top: 4px; max-height: 44px; }
.card .t-tag { height: 18px; padding: 0 6px; font-size: 0.92rem; }
.card .handle { position: absolute; right: 6px; top: 6px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent); background: var(--bg); cursor: crosshair; opacity: 0; transition: opacity 0.1s; }
.card:hover .handle, .card.selected .handle { opacity: 1; }
.group { position: absolute; border: 1.5px dashed; border-radius: 12px; }
.group.selected { border-style: solid; }
.glabel { position: absolute; left: 12px; top: 8px; font-size: 0.92rem; font-weight: 600; cursor: move; display: flex; align-items: center; gap: 6px; user-select: none; }
.glabel .dot { width: 8px; height: 8px; border-radius: 2px; }
.gresize { position: absolute; right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; }
.legend summary { cursor: pointer; font-weight: 500; color: var(--font-2); }
.legend:not([open]) { padding: 4px 10px; }
.legend { position: absolute; left: 12px; bottom: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; max-width: 300px; color: var(--font-2); }
.legend .swatch { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.legend .line { display: inline-block; width: 20px; margin-right: 6px; border-top: 1.5px solid var(--font-3); vertical-align: middle; }
.legend .line.dotted { border-top: 1.5px dashed var(--pink); }
.legend .hint { color: var(--font-3); margin-top: 4px; }
.panel { width: 340px; border-left: 1px solid var(--border); overflow-y: auto; background: var(--bg); }
.panel-head { padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 4px; }
.panel-head .name { font-size: 1.23rem; font-weight: 600; }
.panel-body { padding: 4px 12px 16px; }
.panel-group { padding: 8px 4px 4px; color: var(--font-3); font-weight: 500; font-size: 0.92rem; text-transform: uppercase; letter-spacing: 0.04em; }
.panel-note { margin: 8px 4px; padding: 8px 10px; border-radius: 4px; background: var(--orange-bg); color: var(--orange); }

/* ── Dashboard ── */
.tabs { display: flex; gap: 2px; align-items: center; padding: 0 24px; border-bottom: 1px solid var(--border); min-height: 40px; }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 8px; border: 0; background: transparent; color: var(--font-3); font-weight: 500; cursor: pointer; border-bottom: 1px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--font-2); }
.tab.active { color: var(--font); border-bottom-color: var(--font); }
.overview { padding: 16px 24px; overflow-y: auto; flex: 1; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-bottom: 16px; }
.kpi { border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.kpi .label { color: var(--font-3); font-weight: 500; }
.kpi .value { font-size: 1.54rem; font-weight: 600; margin-top: 6px; }
.kpi .sub { color: var(--font-3); margin-top: 2px; }
.card-box { border: 1px solid var(--border); border-radius: 8px; margin: 0 0 16px; overflow: hidden; }
.card-box > h3 { margin: 0; padding: 0 12px; height: 40px; display: flex; align-items: center; font-size: 1rem; font-weight: 600; border-bottom: 1px solid var(--border); }
.card-box table { border-collapse: collapse; width: 100%; }
.card-box th { height: 32px; padding: 0 12px; text-align: left; font-weight: 500; color: var(--font-3); border-bottom: 1px solid var(--border-light); }
.card-box td { height: 32px; padding: 0 12px; border-bottom: 1px solid var(--border-light); }
.card-box tr:last-child td { border-bottom: 0; }
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.barcell { width: 30%; }
.bar { display: block; height: 8px; border-radius: 4px; background: var(--accent); opacity: 0.75; }
tr.overdue td { color: var(--danger); }
.notice { color: var(--font-3); margin: -8px 0 16px; }
.targets { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: auto; }
.targets-grid { border-collapse: collapse; width: 100%; min-width: 900px; font-variant-numeric: tabular-nums; }
.targets-grid th { position: sticky; top: 0; z-index: 1; background: var(--bg); color: var(--font-3); font-weight: 500; padding: 0 8px; height: 32px; border-bottom: 1px solid var(--border); text-align: right; }
.targets-grid th:first-child { text-align: left; padding-left: 24px; }
.targets-grid td { padding: 2px 8px; height: 40px; border-bottom: 1px solid var(--border-light); text-align: right; }
.targets-grid td:first-child { text-align: left; padding-left: 24px; }
.targets-grid tr.pod td { background: var(--purple-bg); font-weight: 600; }
.targets-grid tr.pod td:first-child { color: var(--purple); cursor: pointer; }
.targets-grid tr.owner td { background: var(--bg-2); font-weight: 500; }
.targets-grid tr.owner td:first-child { padding-left: 40px; }
.targets-grid tr.account td:first-child { padding-left: 56px; }
.targets-grid tr.grand td { font-weight: 600; border-top: 1px solid var(--border-strong); background: var(--bg-2); }
.targets-grid td.cell input { width: 100%; max-width: 120px; height: 26px; font-weight: 500; text-align: right; border-color: transparent; background: transparent; }
.targets-grid td.cell input:hover { background: var(--hover); }
.targets-grid td.cell input:focus { background: var(--bg); border-color: var(--accent-border); }
.targets-grid .inv { font-size: 0.85rem; color: var(--font-3); }
.targets-grid td.good .inv { color: var(--green); font-weight: 500; }
.targets-grid td.ok .inv { color: var(--orange); }
.targets-grid td.low .inv { color: var(--red); }
.targets-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 24px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.targets-toolbar select { height: 24px; }
@media (max-width: 860px) { .bs-cols, .cols { grid-template-columns: 1fr; } .panel { width: 280px; } .t-section { padding: 12px 12px 8px; } }
.card .head, .card .title { flex-shrink: 0; }
.t-field-value .t-cell.center { justify-content: flex-start; }
.bs-flag-body .t-chip { align-self: flex-start; }
.targets-grid td.cell input { margin-right: -8px; }

/* Blue Sheet: summary cards (strengths / red flags / action plan as points) */
.doc-band-title { font-weight: 600; font-size: 1.05rem; padding: 10px 2px 8px; }
.bs-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
@media (max-width: 1000px) { .bs-cards { grid-template-columns: 1fr; } }
.bs-card { border: 1px solid var(--border-strong); border-top-width: 4px; border-radius: 8px; padding: 12px 14px; background: var(--bg); }
.bs-card.strengths { border-top-color: var(--green); }
.bs-card.flags { border-top-color: var(--red); }
.bs-card.plan { border-top-color: var(--brand-navy); }
.bs-card-head { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; }
.bs-card.strengths .bs-card-head .icon { color: var(--green); }
.bs-card.flags .bs-card-head .icon { color: var(--red); }
.bs-card.plan .bs-card-head .icon { color: var(--brand-navy); }
.bs-hint { margin: 4px 0 10px; color: var(--font-3); font-size: 0.9rem; }
.bs-points { margin: 0 0 6px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.bs-points:is(ul) { list-style: disc; }
.bs-card.flags .bs-points { list-style: none; padding-left: 0; }
.bs-point { line-height: 1.4; }
.bs-card.flags .bs-point { display: flex; align-items: flex-start; gap: 8px; }
.bs-flag-dot { flex-shrink: 0; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--red); }
.bs-point-text { cursor: text; border-radius: 4px; padding: 1px 3px; margin: -1px -3px; }
.bs-point-text:hover { background: var(--hover); }
.bs-point-x { visibility: hidden; border: 0; background: transparent; color: var(--font-3); cursor: pointer; padding: 0 2px; vertical-align: middle; }
.bs-point:hover .bs-point-x { visibility: visible; }
.bs-point-input { width: 100%; font: inherit; padding: 4px 6px; border: 1px solid var(--accent-border); border-radius: 4px; resize: vertical; }
.bs-add { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--font-3); cursor: pointer; padding: 4px 0; font: inherit; }
.bs-add:hover { color: var(--font); }
.bs-empty { margin: 0 0 4px; color: var(--font-3); font-style: italic; }
.bs-auto { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border-strong); }
.bs-auto-title { font-size: 0.85rem; color: var(--font-3); margin-bottom: 2px; }
.bs-auto .doc-flags { padding: 4px 0; }
