/* =========================================================
   Signings module -- only classes genuinely new to this module live here.
   Everything else deliberately reuses JCR's app.css so the pages carry the same flavor as JCR and Billing:
   .pg-hdr/.pg-title, .wb-nav-link, .card, .avatar, .field-lbl, .hr-group-hdr/.hr-field-grid/.hr-field/
   .hr-field-value, .pill-tabs, .tab-body, .status-badge (.s-open/.s-pending/.s-returned/.s-approved),
   .btn*, .tbl/.tbl-wrap, .picker-trigger, .grid-header-navy, .empty-state, .page-loading.
   No DealTrak styling or colors are carried over.
   ========================================================= */

/* ----- Page-header tools (right-aligned search box + buttons) ----- */
.sg-hdr-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Same look as the Billing pages' .billing-search .search-input (ebilling.css), sized for a page header. */
.sg-search-input {
    width: 320px;
    max-width: 100%;
    padding: 7px 12px;
    font-size: 13.5px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition);
}

.sg-search-input:focus {
    border-color: var(--border-focus);
}

.sg-search-input::placeholder {
    color: var(--text-light);
}

/* ----- Notice bar (e.g. "DealTrak sent an update") -- the amber .s-pending colours, as a full-width strip ----- */
.sg-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    margin-bottom: 16px;
    background: var(--s-pending-bg);
    color: var(--s-pending-txt);
    border: 1px solid var(--brand-gold-lt);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

/* ----- Small row of pills (deal flags, etc.) ----- */
.sg-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ----- Raw payload viewer ----- */
.sg-payload {
    margin: 0;
    padding: 12px 14px;
    max-height: 60vh;
    overflow: auto;
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

/* ----- Detail page: multi-line values inside a .hr-field-value (people lists, descriptions) ----- */
.sg-value-lines {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px 0 6px;
    font-size: 13.5px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    min-height: 1.2em;
}

.sg-note {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 10px;
}

/* Fee summary strip on the Fees & Business Units tab */
.sg-fee-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 40px;
    margin-bottom: 12px;
}

/* ----- Deal detail: horizontal action menu bar (navy bar, gold labels, click-to-open dropdowns) ----- */
.sg-menubar {
    position: relative;
    z-index: 30;            /* above .sg-menubar-backdrop and the page content, so dropdowns overlay the cards */
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 16px;
    padding: 4px 8px;
    background: var(--brand-navy);
    border-radius: var(--radius-md);
}

/* The bar's left-hand content (the builder: the deal's name + ID) and its right end (the builder's "Deal" button). */
.sg-menubar-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    padding: 6px 10px 6px 14px;
    color: #fff;
}

/* After the Actions menu, a thin divider separates it from the deal's name. */
.sg-menubar-menu + .sg-menubar-title {
    margin-left: 4px;
    border-left: 1px solid rgba(201, 168, 76, 0.35);
}

.sg-menubar-title strong {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sg-menubar-title span {
    font-size: 12px;
    color: var(--brand-gold-lt);
    white-space: nowrap;
}

.sg-menubar-end {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ----- Deal page: "This deal is New -- Take Ownership" strip under the action bar ----- */
.sg-take-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    margin-bottom: 16px;
    background: var(--bg-card);
    border: 1px solid var(--brand-gold-lt);
    border-left: 4px solid var(--brand-gold);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
}

/* Transparent full-screen layer under the bar: a click anywhere outside the open dropdown lands here and closes it. */
.sg-menubar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 29;
}

.sg-menubar-menu {
    position: relative;
}

.sg-menubar-btn,
.sg-menu-item {
    border: 0;
    background: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.sg-menubar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    color: var(--brand-gold);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    border-radius: var(--radius-sm);
}

.sg-menubar-btn[aria-expanded="true"] {
    background: rgba(201, 168, 76, 0.18);
}

.sg-menubar-caret { font-size: 11px; }

.sg-menubar-drop {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 210px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    background: var(--brand-navy);
    border: 1px solid rgba(201, 168, 76, 0.35);
    border-radius: var(--radius-md);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.sg-menu-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    color: var(--brand-gold-lt);
    font-size: 13.5px;
    border-radius: var(--radius-sm);
}

.sg-menu-divider {
    height: 1px;
    margin: 4px 6px;
    background: rgba(201, 168, 76, 0.25);
}

.sg-menubar-btn:hover,
.sg-menu-item:hover:not(:disabled) {
    background: rgba(201, 168, 76, 0.18);
}

.sg-menubar-btn:focus-visible,
.sg-menu-item:focus-visible {
    outline: 2px solid var(--brand-gold);
    outline-offset: -2px;
}

.sg-menu-item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ----- D365 project card (Build Project Tree page) ----- */
.sg-proj-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

/* Project card with its header folded: one line of essentials, click it to unfold. */
.sg-proj-summary {
    display: flex;
    align-items: center;
    gap: 6px 18px;
    flex-wrap: wrap;
    padding: 8px 12px;
    margin-bottom: 4px;
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
}

.sg-proj-summary span + span:not(.sg-proj-summary-more)::before {
    content: "·";
    margin-right: 18px;
    margin-left: -12px;
    color: var(--text-light);
}

.sg-proj-summary-more {
    margin-left: auto;
    font-size: 12px;
    color: var(--brand-navy);
}

/* The Primary card's bottom tabs (Manual / D365 Project): a divider above them, like the ICA card's "Billing Lines" one. */
.sg-proj-tabs {
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

/* D365 Contract Lines tab: what the last Sync got -- row count / error, time, and the request URL (one line, ellipsised). */
.sg-sync-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.sg-sync-url {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

/* D365 Contract Lines tab: the raw payload of the last Sync, folded away under the stored lines. */
.sg-raw {
    margin-top: 14px;
    font-size: 12.5px;
}

.sg-raw > summary {
    cursor: pointer;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.sg-raw .sg-sync-url {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
}

/* ----- Searchable / sortable HTML5 tables (billing lines, D365 lines, the Add Billing Lines popup) -- SigningTableView ----- */
/* Above the table: the count (+ "Clear search & sort") on the left, the search box on the right. */
.sg-tbl-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.sg-tbl-count {
    font-size: 12.5px;
    color: var(--text-muted);
}

.sg-tbl-search {
    width: 280px;
    margin-left: auto;
}

/* A text-style button (e.g. "Clear search & sort"). */
.sg-link-btn {
    border: 0;
    background: none;
    padding: 0 0 0 8px;
    color: var(--brand-navy);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

/* 50-100 lines scroll inside the table's own box; the navy header and the totals stay in view. */
.sg-tbl-scroll {
    max-height: 60vh;
    overflow: auto;
}

.sg-tbl-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

.sg-tbl-scroll tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 1;
    background: var(--bg-card);
}

.sg-tbl-scroll tfoot tr:first-child:not(:last-child) td { bottom: 34px; }   /* "Shown" subtotal sits on top of "Total" */

/* Clickable column headers (sort). */
th.sg-sort {
    cursor: pointer;
    user-select: none;
}

th.sg-sort:hover { text-decoration: underline; }

/* ICA "Add Billing Lines" popup: the parent's lines with checkboxes (click anywhere on a row to tick it). */
.sg-pick tbody tr { cursor: pointer; }
.sg-pick tbody tr.sel { background: var(--s-approved-bg, rgba(201, 168, 76, 0.12)); }

.sg-pick-check {
    width: 40px;
    text-align: center;
}

.sg-pick-check input { cursor: pointer; }

.sg-pick-summary {
    margin-right: auto;
    font-size: 13px;
    color: var(--text-muted);
}

.sg-pick-warn { color: var(--s-returned-txt, #b42318); }

/* "Billing Lines" divider inside a project card */
.sg-subhdr {
    margin: 22px 0 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--brand-navy);
}

.sg-line-desc { white-space: pre-wrap; }

.sg-line-actions {
    white-space: nowrap;
    text-align: right;
}

.sg-line-actions .btn + .btn { margin-left: 4px; }

.sg-icon-btn {
    min-width: 32px;
    padding: 3px 9px;
}

.tbl tfoot td {
    border-top: 2px solid var(--border);
    font-weight: 600;
}

/* ----- Section header tools + the Documents dropdown on a project card ----- */
.sg-section-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sg-docmenu { position: relative; }
.sg-docmenu.open { z-index: 40; }     /* lifts the whole dropdown above the cards below it */

/* Transparent full-screen layer under the open list: a click anywhere outside lands here and closes it. */
.sg-docmenu-backdrop {
    position: fixed;
    inset: 0;
}

.sg-docmenu > .btn,
.sg-docmenu > .sg-menubar-btn {
    position: relative;
    z-index: 1;
}

.sg-docmenu-drop {
    position: absolute;
    z-index: 2;
    top: calc(100% + 4px);
    right: 0;
    min-width: 260px;
    max-width: 420px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.sg-docmenu-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13.5px;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sg-docmenu-item:hover { background: var(--bg-page); }

.sg-docmenu-empty {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-light);
}

/* Section headings in the Documents list (Deal documents / ICA Approvals, 2026-09-25). */
.sg-docmenu-section {
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-light);
}
.sg-docmenu-section + .sg-docmenu-item,
.sg-docmenu-section + .sg-docmenu-empty { margin-top: 0; }
.sg-docmenu-item + .sg-docmenu-section,
.sg-docmenu-empty + .sg-docmenu-section { border-top: 1px solid var(--border); margin-top: 4px; }

/* ICA review: the Scope of Work file list (2026-09-26). */
.sg-scope-list { margin: 2px 0 8px; padding-left: 18px; font-size: 13.5px; }

/* Documents list: the "Upload / manage scope documents…" action (2026-09-26). */
.sg-docmenu-action { color: var(--brand-navy); font-weight: 600; }

/* ICA review: the PM's Billing Control Yes / No (2026-09-26). */
.sg-yesno { display: flex; gap: 18px; }

/* Submit ICA prompt: the two contract-term percentages side by side. */
.sg-terms-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }

/* ----- Billing lines table: narrow #/Phase/value columns, wide Description, compact inputs ----- */
.tbl.sg-lines {
    table-layout: fixed;   /* the <colgroup> widths hold; Description takes the rest */
    width: 100%;
}

.sg-lines td,
.sg-lines th {
    overflow-wrap: anywhere;
}

/* Inputs in a line's row: fill their cell and stay one text-row tall (Description: two rows, resizable). */
.sg-line-input {
    box-sizing: border-box;
    width: 100%;
    padding: 5px 8px;
    font-size: 13px;
}

textarea.sg-line-input {
    min-height: 0;
    line-height: 1.35;
    resize: vertical;
}

/* Project header checkboxes (Document Required / Billing Control): box + label on one line, and a tip that shows
   while the user is at the field (hover or keyboard focus). */
.sg-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    font-size: 13px;
    cursor: pointer;
}

.sg-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: inherit;
}

.sg-check input[type="checkbox"]:disabled,
.sg-check:has(input:disabled) {
    cursor: not-allowed;
}

.sg-check-tip {
    display: none;
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-light);
}

.hr-field:hover > .sg-check-tip,
.hr-field:focus-within > .sg-check-tip {
    display: block;
}

/* ----- Project Tree tab: financial lines pane (pin / rail) + the selected line's project ----- */
.sg-tree {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.sg-tree-main {
    flex: 1 1 0;
    min-width: 0;   /* lets the project card's wide grids shrink instead of overflowing */
}

/* Pinned: docked beside the content, and it stays in view while the page scrolls. */
.sg-tree-pane {
    flex: 0 0 320px;
    width: 320px;
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

/* Unpinned: the pane floats over the content beside a slim rail, and folds away when a line is picked. */
.sg-tree.unpinned .sg-tree-pane {
    position: absolute;
    top: 0;
    left: 44px;
    z-index: 40;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.sg-tree-backdrop {
    position: fixed;
    inset: 0;
    z-index: 39;
}

.sg-tree-rail {
    flex: 0 0 36px;
    align-self: stretch;
    min-height: 180px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--brand-navy);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    writing-mode: vertical-rl;
    transition: background var(--transition);
}

.sg-tree-rail:hover { background: var(--bg-page); }

.sg-tree-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--brand-navy);
    font-size: 14px;
    font-weight: 600;
}

.sg-tree-group {
    padding: 10px 12px 4px;
    color: var(--text-light);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sg-tree-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    border-left: 3px solid transparent;
    background: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition);
}

.sg-tree-row:hover { background: var(--bg-page); }

.sg-tree-row.sel {
    background: rgba(201, 168, 76, 0.15);
    border-left-color: var(--brand-gold);
}

.sg-tree-row.info { color: var(--text-muted); }

.sg-tree-check {
    flex: 0 0 auto;
    color: var(--brand-navy);
    font-size: 16px;
    line-height: 1;
}

.sg-tree-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sg-tree-name small {
    display: block;
    color: var(--text-light);
    font-size: 11.5px;
}

.sg-tree-amt {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 12px;
}

.sg-tree-none {
    flex: 0 0 auto;
    min-width: 42px;
    color: var(--text-light);
    text-align: center;
}

/* Rows are divs now (a "+" button sits inside them, and a button can't nest in a button). */
.sg-tree-row {
    box-sizing: border-box;
    user-select: none;
}

/* A project listed under its financial line: indented (inline padding-left by depth), a little smaller. */
.sg-tree-row.proj { font-size: 12.5px; }
.sg-tree-row.proj.cancelled { opacity: 0.55; }

.sg-tree-branch {
    flex: 0 0 auto;
    color: var(--text-light);
}

.sg-tree-hint {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
}

/* The "+" on a line or a project: adds a project there. */
.sg-tree-add {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid var(--brand-gold);
    border-radius: var(--radius-sm, 4px);
    background: transparent;
    color: var(--brand-navy);
    font-family: inherit;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition);
}

.sg-tree-add:hover,
.sg-tree-add:focus-visible { background: rgba(201, 168, 76, 0.3); }

/* ----- Project Hierarchy tab: the Project tab's tree (financial line -> projects -> ICA projects), read-only, full width ----- */
.sg-hier-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

/* Build Project Tree sits on the left; Expand / Collapse all are pushed to the right. */
.sg-hier-toolbar-start {
    margin-right: auto;
}

/* ----- Full-screen overlay (the builder's "Deal" view): dimmed backdrop, a large panel with a title bar + ✕ ----- */
.sg-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.45);
}

.sg-overlay-panel {
    display: flex;
    flex-direction: column;
    width: min(1400px, 100%);
    background: var(--bg-page);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    outline: none;
}

.sg-overlay-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: var(--brand-navy);
    color: var(--brand-gold-lt);
    font-weight: 600;
}

.sg-overlay-close {
    border: 0;
    background: none;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.sg-overlay-close:hover { background: rgba(201, 168, 76, 0.18); }

.sg-overlay-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.sg-hier-scroll {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    box-shadow: var(--shadow-card);
}

.sg-hier {
    min-width: 860px;
    --sg-hier-cols: minmax(320px, 3fr) 110px 130px 190px 110px;
}

.sg-hier-head,
.sg-hier-row {
    display: grid;
    grid-template-columns: var(--sg-hier-cols);
    align-items: center;
    column-gap: 12px;
    padding: 0 14px;
}

.sg-hier-head {
    padding-top: 10px;
    padding-bottom: 10px;
    background: var(--brand-navy);
    color: var(--brand-gold-lt);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sg-hier-head .num,
.sg-hier-cell.num { text-align: right; }

/* "Primary" / "Business units", the same small caps as the left pane's group labels. */
.sg-hier-group {
    padding: 10px 14px 4px;
    color: var(--text-light);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sg-hier-row {
    min-height: 40px;
    border-left: 3px solid transparent;
    font-size: 13px;
    cursor: default;
    outline: none;
    transition: background var(--transition);
}

.sg-hier-row[aria-expanded] { cursor: pointer; }
.sg-hier-row:hover { background: var(--bg-page); }
.sg-hier-row:focus-visible { box-shadow: inset 0 0 0 2px var(--brand-gold); }

/* A financial line: a touch heavier, with the gold marker the left pane uses for the selected row. */
.sg-hier-row.line {
    border-left-color: var(--brand-gold);
    background: rgba(26, 43, 74, 0.04);
    font-weight: 600;
}

/* A project under it: regular weight, smaller, dimmed once cancelled (as in the left pane). */
.sg-hier-row.proj { font-size: 12.5px; }
.sg-hier-row.proj.cancelled { opacity: 0.55; }

.sg-hier-name {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding-top: 6px;
    padding-bottom: 6px;
}

.sg-hier-chev,
.sg-hier-dot {
    flex: 0 0 16px;
    color: var(--brand-navy);
    text-align: center;
}

.sg-hier-dot { color: var(--text-light); }

.sg-hier-check {
    flex: 0 0 auto;
    color: var(--brand-navy);
    font-size: 16px;
    line-height: 1;
}

.sg-hier-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sg-hier-text small {
    display: block;
    color: var(--text-light);
    font-size: 11.5px;
    font-weight: 400;
}

.sg-hier-count {
    flex: 0 0 auto;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--border);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}

.sg-hier-cell {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sg-hier-cell small {
    margin-left: 4px;
    color: var(--text-light);
    font-size: 11px;
}

/* ----- Deal card at the top of the deal page: collapsible ----- */
.sg-dealcard { position: relative; }

.sg-dealcard-toggle {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 1;
}

.sg-dealcard.collapsed {
    align-items: center !important;
    margin-bottom: 14px !important;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-right: 56px;   /* room for the toggle */
}

/* ----- ICA approval routing (2026-09-24): the strip on an ICA card showing where it is in the approval ----- */
.sg-wf-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 12px;
    margin-bottom: 12px;
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.sg-wf-comment {
    font-size: 12.5px;
    font-style: italic;
    color: var(--s-returned-txt, #b42318);
}
