/* =========================================================
   HBA JCR — E-Billing module stylesheet
   Ported from HBA.ProjectBiller's global app.css (2026-09-18). Reuses JCR's own :root
   tokens/fonts and JCR's existing .btn/.btn-primary/.btn-secondary/.status-badge/.tabs/
   .tab/.page-loading/.spinner/.empty-state/.picker-trigger/.grid-header-navy -- only
   classes genuinely new to this module live here, to avoid duplicating or drifting from
   the base stylesheet. See project memory "JCR eBilling module plan".
   ========================================================= */

/* ----- Billing search / company filter ----- */
.billing-search {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 12px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-lbl {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--brand-navy);
}

.billing-search .search-input {
    flex: 1;
    max-width: 400px;
    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);
}

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

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

.company-filter {
    padding: 7px 32px 7px 12px;
    font-size: 13px;
    font-family: var(--font-sans);
    font-weight: 500;
    color: var(--brand-navy);
    background-color: var(--bg-card);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231A2B4A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    border: 1.5px solid var(--brand-navy);
    border-radius: var(--radius-md);
    outline: none;
    min-width: 180px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.company-filter:focus {
    box-shadow: 0 0 0 3px rgba(26,43,74,0.12);
}

.company-filter option {
    font-weight: 400;
    color: var(--text-primary);
}

/* ----- Tab badge (JCR's own .tabs/.tab already cover the rest) ----- */
.tab-badge {
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-page);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 10px;
    min-width: 20px;
    height: 18px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
}

.tab-badge.active {
    background: var(--brand-gold);
    border-color: var(--brand-gold);
    color: var(--brand-navy);
}

/* ----- Project list / accordion ----- */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.acc-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.acc-item:hover { box-shadow: var(--shadow-hover); }

.acc-item.acc-open { border-color: var(--brand-gold-lt); }

.acc-hdr {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    min-height: 58px;
}

.chevron {
    font-size: 12px;
    color: var(--text-light);
    transition: transform var(--transition);
    flex-shrink: 0;
}

.chevron.open { transform: rotate(180deg); }

.acc-id {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    min-width: 80px;
}

.acc-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.acc-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.acc-hdr-spacer {
    flex: 1;
}

.acc-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 8px;
}

.acc-body {
    padding: 0 16px 16px;
    border-top: 1px solid var(--border);
}

.chip {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 12px;
    background: var(--bg-page);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.notes-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}

.notes-lbl {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    padding-top: 8px;
    flex-shrink: 0;
    width: 44px;
}

.notes-ta {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-page);
    resize: vertical;
    min-height: 60px;
    max-height: 160px;
    transition: border-color var(--transition);
    outline: none;
}

.notes-ta:focus {
    border-color: var(--border-focus);
    background: var(--bg-card);
}

.notes-ta::placeholder { color: var(--text-light); }

.sec-lbl {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 8px;
}

/* ----- E-Billing status badges (module-scoped -- see EbStatusBadge.razor) ----- */
.eb-s-active    { background: var(--s-open-bg);      color: var(--s-open-txt); }
.eb-s-pending   { background: var(--s-pending-bg);   color: var(--s-pending-txt); }
.eb-s-returned  { background: var(--s-returned-bg);  color: var(--s-returned-txt); }
.eb-s-approved  { background: var(--s-approved-bg);  color: var(--s-approved-txt); }
.eb-s-inactive  { background: var(--s-inactive-bg);  color: var(--s-inactive-txt); }
.eb-s-nobilling { background: var(--s-nobilling-bg); color: var(--s-nobilling-txt); }

/* ----- Buttons unique to E-Billing (JCR's own .btn/.btn-primary/.btn-secondary already apply) ----- */
.btn-approve {
    background: var(--s-approved-bg);
    color: var(--s-approved-txt);
    border-color: #BBF7D0;
}

.btn-approve:not(:disabled):hover {
    background: #DCFCE7;
}

.btn-return {
    background: var(--s-returned-bg);
    color: var(--s-returned-txt);
    border-color: #FECACA;
}

.btn-return:not(:disabled):hover {
    background: #FEE2E2;
}

/* ----- Billing line editor (percent/amount inputs) ----- */
.pct-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
}

.pct-sel {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 6px;
    font-size: 12px;
    font-family: var(--font-sans);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition);
}

.pct-sel:focus { border-color: var(--border-focus); }

.pct-inp {
    width: 72px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 6px;
    font-size: 12px;
    font-family: var(--font-sans);
    text-align: right;
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition);
}

.pct-inp:focus { border-color: var(--border-focus); }

.reset-lnk {
    font-size: 13px;
    color: var(--text-light);
    cursor: pointer;
    transition: color var(--transition);
    line-height: 1;
}

.reset-lnk:hover { color: var(--brand-gold); }

.field-error {
    margin-top: 4px;
    font-size: 10.5px;
    color: var(--s-returned-txt);
    white-space: normal;
    text-align: right;
}

.amt-inp {
    width: 96px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 6px;
    font-size: 12px;
    font-family: var(--font-sans);
    text-align: right;
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition);
}

.amt-inp:focus { border-color: var(--border-focus); }

.empty-lines {
    padding: 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
}

/* ----- Billing worksheet (letterhead + lines table) ----- */
.wks-letterhead {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 16px 20px;
    margin: 12px 0 16px;
}

.wks-lh-top {
    text-align: left;
    border-bottom: 2px solid var(--brand-navy);
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.wks-lh-title {
    font-family: var(--font-serif);
    font-size: 19px;
    font-weight: 700;
    color: var(--brand-navy);
}

.wks-lh-sub {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2px;
}

.wks-lh-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.wks-lh-party {
    font-size: 12.5px;
    color: var(--text-primary);
    line-height: 1.5;
}

.wks-lh-lbl {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 3px;
}

.wks-lh-placeholder {
    color: var(--text-light);
    font-style: italic;
}

.wks-lh-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12.5px;
    color: var(--text-primary);
    border-top: 2px solid var(--brand-navy);
    border-bottom: 2px solid var(--brand-navy);
    padding: 10px 2px;
    margin: 0 0 16px;
}

.wks-lh-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 20px;
    font-weight: 600;
}

.wks-lh-field { white-space: nowrap; }

.wks-lh-flabel { color: var(--text-primary); }

.wks-lh-fvalue { color: var(--text-primary); }

.wks-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.wks-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.wks-table thead th {
    background: transparent;
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    padding: 8px 10px;
    border-bottom: 2px solid var(--text-primary);
    white-space: nowrap;
    text-align: left;
}

.wks-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.wks-table tbody tr:last-child { border-bottom: none; }

.wks-table tbody tr:hover { background: #FAFAF8; }

.wks-table tbody tr.wks-row-locked {
    cursor: not-allowed;
}

.wks-table td {
    padding: 8px 10px;
    vertical-align: middle;
}

.wks-table th.num,
.wks-table td.num {
    text-align: right;
}

.wks-desc {
    max-width: 220px;
    white-space: normal;
    overflow-wrap: break-word;
}

.wks-table tfoot .wks-totals-row {
    font-weight: 700;
    border-top: 2px solid var(--border);
}

.wks-table tfoot .wks-current-billing-row {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wks-table tfoot .wks-current-billing-row td {
    border-top: 1px solid var(--text-primary);
}

/* ----- Workflow history ----- */
.hist-acc {
    margin: 0 14px 10px;
}

.hist-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.hist-table thead th {
    background: var(--bg-page);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    text-align: left;
}

.hist-table tbody tr {
    border-bottom: 1px solid var(--border);
}

.hist-table tbody tr:last-child { border-bottom: none; }

.hist-table td {
    padding: 8px 10px;
    vertical-align: middle;
    text-align: left;
}

/* ----- Billing summary grids (My Work: Active/No Billing/Inactive) ----- */
.billing-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.billing-summary .bs-section:only-child {
    grid-column: 1 / -1;
}

.billing-summary .bs-hdr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.billing-summary .bs-title {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.billing-summary .bs-count {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 13px;
}

.billing-summary .bs-hdr-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.billing-summary .bs-page-size {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-sans);
    font-size: 12.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

.billing-summary .bs-page-size select {
    font-family: var(--font-sans);
    font-size: 12.5px;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px 6px;
}

.billing-summary .bs-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.billing-summary .bs-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 10px;
    font-family: var(--font-sans);
    font-size: 12.5px;
    color: var(--text-muted);
}

.billing-summary .bs-pager button {
    font-family: var(--font-sans);
    font-size: 12.5px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
}

.billing-summary .bs-pager button:disabled {
    opacity: 0.4;
    cursor: default;
}

.billing-summary .grid-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    background: var(--bg-card);
}

/* Navy DxGrid header treatment, matching JCR's own .grid-header-navy but applied here via
   plain CSS since BillingSummaryGrid uses CssClass="exec-summary-grid" rather than the
   CustomizeElement approach JCR's own grids use. */
.billing-summary .exec-summary-grid thead th {
    background: var(--brand-navy) !important;
    color: rgba(255, 255, 255, 0.82) !important;
    font-family: var(--font-sans) !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 10px 12px !important;
    border-right: 1px solid rgba(255, 255, 255, 0.07) !important;
    border-bottom: none !important;
    white-space: nowrap;
}

.billing-summary .exec-summary-grid thead th svg,
.billing-summary .exec-summary-grid thead th .dxbl-image {
    color: var(--brand-gold) !important;
    fill: var(--brand-gold) !important;
    opacity: 0.85;
}

.billing-summary .exec-summary-grid .dxbl-grid-filter-row th,
.billing-summary .exec-summary-grid .dxbl-grid-filter-row td {
    background: var(--bg-page) !important;
    color: var(--text-primary) !important;
    font-family: var(--font-sans) !important;
    font-size: 12.5px !important;
    font-weight: 400 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    padding: 5px 8px !important;
    border-bottom: 2px solid var(--border) !important;
}

.billing-summary .exec-summary-grid .dxbl-grid-filter-row input,
.billing-summary .exec-summary-grid .dxbl-grid-filter-row select {
    font-family: var(--font-sans) !important;
    font-size: 12.5px !important;
    color: var(--text-primary) !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
}

.billing-summary .exec-summary-grid tbody td {
    font-family: var(--font-sans) !important;
    font-size: 13px !important;
    color: var(--text-primary) !important;
    padding: 9px 12px !important;
    border-bottom: 1px solid var(--border) !important;
    vertical-align: middle;
}

.billing-summary .exec-summary-grid tbody tr:hover td {
    background: #FAFAF8 !important;
}

.billing-summary .exec-summary-grid .dxbl-pager,
.billing-summary .exec-summary-grid .dxbl-grid-pager {
    font-family: var(--font-sans) !important;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-page) !important;
    border-top: 1px solid var(--border) !important;
    padding: 8px 14px;
}

/* ----- Intercompany billing log tab (mirrors .hist-table navy-ish accordion body) ----- */
.ic-log-accordion .dxbl-grid thead th {
    background: var(--brand-navy) !important;
    color: rgba(255, 255, 255, 0.82) !important;
    font-family: var(--font-sans) !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ----- Project Detail page header/footer (JCR's own .pg-hdr/.pg-title already apply) ----- */
.back-link {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--brand-navy);
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.pg-footer {
    margin-top: 16px;
}

/* ----- AR Billing grid (single DxGrid + detail row, navy header) ----- */
.grid-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    background: var(--bg-card);
}

.grid-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 8px 14px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    min-height: 44px;
    width: 100%;
}

.grid-wrap .ar-grid,
.grid-wrap .ar-grid.dxbl-card {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    font-family: var(--font-sans) !important;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-card);
}

.grid-wrap .ar-grid thead th {
    background: var(--brand-navy) !important;
    color: rgba(255, 255, 255, 0.82) !important;
    font-family: var(--font-sans) !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 10px 12px !important;
    border-right: 1px solid rgba(255, 255, 255, 0.07) !important;
    border-bottom: none !important;
    white-space: nowrap;
}

.grid-wrap .ar-grid thead th svg,
.grid-wrap .ar-grid thead th .dxbl-image {
    color: var(--brand-gold) !important;
    fill: var(--brand-gold) !important;
    opacity: 0.85;
}

.grid-wrap .ar-grid .dxbl-grid-filter-row th,
.grid-wrap .ar-grid .dxbl-grid-filter-row td {
    background: var(--bg-page) !important;
    color: var(--text-primary) !important;
    font-family: var(--font-sans) !important;
    font-size: 12.5px !important;
    font-weight: 400 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    padding: 5px 8px !important;
    border-bottom: 2px solid var(--border) !important;
}

.grid-wrap .ar-grid .dxbl-grid-filter-row input,
.grid-wrap .ar-grid .dxbl-grid-filter-row select {
    font-family: var(--font-sans) !important;
    font-size: 12.5px !important;
    color: var(--text-primary) !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
}

.grid-wrap .ar-grid .dxbl-grid-filter-row input:focus,
.grid-wrap .ar-grid .dxbl-grid-filter-row select:focus {
    border-color: var(--border-focus) !important;
    outline: none !important;
}

.grid-wrap .ar-grid tbody td {
    font-family: var(--font-sans) !important;
    font-size: 13px !important;
    color: var(--text-primary) !important;
    padding: 9px 12px !important;
    border-bottom: 1px solid var(--border) !important;
    vertical-align: middle;
}

.grid-wrap .ar-grid tbody tr:hover td {
    background: #FAFAF8 !important;
}

.ar-notes-cell {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.grid-wrap .ar-grid .dxbl-grid-expand-button {
    color: var(--brand-navy) !important;
}

.grid-wrap .ar-grid .dxbl-pager,
.grid-wrap .ar-grid .dxbl-grid-pager {
    font-family: var(--font-sans) !important;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-page) !important;
    border-top: 1px solid var(--border) !important;
    padding: 8px 14px;
}

.grid-wrap .ar-grid .dxbl-pager button,
.grid-wrap .ar-grid .dxbl-grid-pager button {
    font-family: var(--font-sans) !important;
    font-size: 12px;
    color: var(--brand-navy);
    border-radius: var(--radius-sm);
}

.grid-wrap .ar-grid .dxbl-pager button.active,
.grid-wrap .ar-grid .dxbl-grid-pager button.active {
    background: var(--brand-navy) !important;
    color: #fff !important;
    border-color: var(--brand-navy) !important;
}

/* ----- Approvals pages ----- */
.approvals-info {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.bc-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
}

.bc-pending { background: var(--bc-pending-bg); color: var(--bc-pending-txt); }
.bc-passed  { background: var(--bc-passed-bg);  color: var(--bc-passed-txt); }

.ap-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
}

.ap-pm { background: var(--ap-pm-bg); color: var(--ap-pm-txt); }
.ap-ar { background: var(--ap-ar-bg); color: var(--ap-ar-txt); }
.ap-oa { background: var(--ap-oa-bg); color: var(--ap-oa-txt); }

/* Approval-view billing lines table (distinct from PM Billing's .wks-table -- shows a
   Currency column and $-prefixed amounts, no "Current Billing" footer row) */
.bl-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.bl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.bl-table thead th {
    background: var(--bg-page);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.bl-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.bl-table tbody tr:last-child { border-bottom: none; }

.bl-table tbody tr:hover { background: #FAFAF8; }

.bl-table tbody tr.bl-row-locked {
    background: var(--s-returned-bg);
    cursor: not-allowed;
}

.bl-table tbody tr.bl-row-locked:hover { background: #FCE4E4; }

.bl-table td {
    padding: 8px 10px;
    vertical-align: middle;
}

.bl-table th.num,
.bl-table td.num {
    text-align: right;
}

.bl-desc {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bl-table tfoot .bl-totals-row {
    font-weight: 700;
    border-top: 2px solid var(--border);
}

/* ----- Dashboards (PM Dashboard uses .pm-exec-summary-grids: 1 column; Executive
   Dashboard uses .exec-summary-grids: 2 columns side by side -- kept as distinct class
   names since the two pages had separate .razor.css files in source with different
   grid-template-columns under the same class name.) ----- */
.pm-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 24px;
    margin-bottom: 24px;
}

.pm-kpi-box {
    background: var(--brand-navy);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 18px 20px;
    text-align: center;
}

.pm-kpi-value {
    font-family: var(--font-sans);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}

.pm-kpi-label {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 4px;
}

.pm-exec-summary-grids {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.exec-summary-grids {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
}

.exec-summary-cell-narrow {
    width: 80%;
    margin: 0 auto;
}

.exec-summary-title {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.exec-summary-cell .exec-summary-grid {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    background: var(--bg-card);
    font-family: var(--font-sans);
    overflow: hidden;
}

.exec-summary-cell .exec-summary-grid thead th {
    background: var(--brand-navy) !important;
    color: rgba(255, 255, 255, 0.82) !important;
    font-family: var(--font-sans) !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 10px 12px !important;
    border-right: 1px solid rgba(255, 255, 255, 0.07) !important;
    border-bottom: none !important;
    white-space: nowrap;
}

.exec-summary-cell .exec-summary-grid thead th svg,
.exec-summary-cell .exec-summary-grid thead th .dxbl-image {
    color: var(--brand-gold) !important;
    fill: var(--brand-gold) !important;
    opacity: 0.85;
}

.exec-summary-cell .exec-summary-grid tbody td {
    font-family: var(--font-sans) !important;
    font-size: 13px !important;
    color: var(--text-primary) !important;
    padding: 9px 12px !important;
    border-bottom: 1px solid var(--border) !important;
    vertical-align: middle;
}

.exec-summary-cell .exec-summary-grid tbody tr:hover td {
    background: #FAFAF8 !important;
}

/* ----- PM/AR Groups setup page (JCR's own .wb-grid-toolbar/.transfer-box/.grid-header-navy/
   .grid-row-selected already apply) ----- */
.um-form-layout {
    width: 100%;
    max-width: 420px;
}

/* Billing Workbench / Approvals persona switcher (2026-10-07): one button per persona the user holds, above the persona's
   own page. A segmented bar rather than .tabs, so it doesn't look like the page's own tab row underneath (e.g. PM Billing). */
.eb-persona-bar {
    display: inline-flex;
    margin: 0 0 14px;
    border: 1.5px solid var(--brand-navy);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.eb-persona-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border: 0;
    border-right: 1px solid var(--brand-navy);
    background: var(--bg-card);
    color: var(--brand-navy);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}
.eb-persona-btn:last-child { border-right: 0; }
.eb-persona-btn.active { background: var(--brand-navy); color: #fff; }
.eb-persona-btn .tab-badge { height: 16px; }

/* Billing project action bar (EbProjectActionBar, 2026-10-07): Signings' .sg-menubar (signings.css), plus these. */
.eb-menubar { margin-bottom: 12px; }
.acc-item > .eb-menubar { margin: 0; }                                   /* as a card's header: flush with the card */
.acc-item.eb-has-bar { overflow: visible; }                             /* let the bar's dropdowns out of the card */
.acc-item.eb-has-bar > .eb-menubar { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.acc-item.eb-has-bar:not(.acc-open) > .eb-menubar { border-radius: var(--radius-md); }
.eb-menubar:has(.sg-menubar-drop, .sg-docmenu.open) { z-index: 45; }   /* an open menu sits above the next card's bar */
.eb-menubar-toggle { cursor: pointer; }
.eb-menubar .chevron { color: var(--brand-gold); font-size: 10px; }
.eb-menubar .sg-docmenu-drop { z-index: 2; }
.eb-bar-chip {
    font-size: 11.5px;
    padding: 3px 9px;
    border-radius: 10px;
    border: 1px solid rgba(201, 168, 76, 0.45);
    color: var(--brand-gold-lt);
    white-space: nowrap;
}
.eb-bar-chip-warn { background: var(--bc-pending-bg); color: var(--bc-pending-txt); border-color: var(--bc-pending-txt); }

/* PM/AR Groups setup (2026-10-08): groups left / members right, copied from DealTrak's BD Groups page (.ld-*). */
.ld-layout {
    display: grid;
    grid-template-columns: minmax(240px, 320px) 1fr;
    gap: 16px;
    align-items: start;
}
@media (max-width: 900px) {
    .ld-layout { grid-template-columns: 1fr; }
}
.ld-list, .ld-detail { min-width: 0; }
.ld-inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin: 8px 0 12px;
}
.ld-inline-form .ld-tagbox { flex: 1; min-width: 200px; }
.ld-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 62vh;
    overflow-y: auto;
}
.ld-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    cursor: pointer;
    color: var(--text-primary);
    font: inherit;
}
.ld-item:hover { background: var(--bg-page); }
.ld-item.selected { background: var(--brand-cream); border-color: var(--border-focus); }
.ld-item:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 1px; }
.ld-item-name { font-weight: 600; }
.ld-item-meta { font-size: 12px; color: var(--text-muted); }
/* A heading row in an .ld-items list (Enterprise Data > DealTrak, 2026-10-09: the BU Group above its BUs). */
.ld-group-lbl {
    margin: 8px 0 2px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--brand-navy);
}
.ld-group-lbl:first-child { margin-top: 0; }
.ld-detail-hdr { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ld-detail-title { margin: 0; font-size: 18px; font-weight: 600; }
.ld-hint { margin: 8px 0 16px; font-size: 13px; color: var(--text-muted); }
.ld-add { margin-bottom: 8px; }

/* Dashboard, summary and Billing list (ar-grid) headers (2026-10-08): wrap long captions onto a second line instead of cutting them off with "…" --
   overrides the white-space: nowrap above (and DevExpress's own one-line caption). Whole words stay together. */
.exec-summary-cell .exec-summary-grid thead th,
.billing-summary .exec-summary-grid thead th,
.grid-wrap .ar-grid thead th,
.exec-summary-cell .exec-summary-grid thead th *,
.grid-wrap .ar-grid thead th *,
.billing-summary .exec-summary-grid thead th * {
    white-space: normal !important;
    text-overflow: clip !important;
    overflow-wrap: normal;
    word-break: keep-all;
    vertical-align: bottom;
}

/* Totals line up with the values above them (2026-10-08): the total row gets the same cell padding as the rows (DevExpress's own
   footer padding is smaller, so bold totals sat further right), and every number uses fixed-width digits so units, tens and
   decimals stack in columns even when the total is bold. */
.exec-summary-cell .exec-summary-grid tfoot td,
.billing-summary .exec-summary-grid tfoot td,
.grid-wrap .ar-grid tfoot td,
.exec-summary-cell .exec-summary-grid .dxbl-grid-footer-row > td,
.billing-summary .exec-summary-grid .dxbl-grid-footer-row > td,
.grid-wrap .ar-grid .dxbl-grid-footer-row > td {
    padding: 9px 12px !important;
    font-variant-numeric: tabular-nums;
}
.exec-summary-cell .exec-summary-grid tbody td,
.billing-summary .exec-summary-grid tbody td,
.grid-wrap .ar-grid tbody td {
    font-variant-numeric: tabular-nums;
}

/* AR Workbench, My Work (2026-10-08): two titled sections -- Ready for Approval, Ready for Billing. */
.eb-work-section { margin: 16px 0 28px; }
.eb-work-title { margin: 0 0 10px; font-size: 15px; font-weight: 600; color: var(--brand-navy); }
/* AR Workbench My Work: Ready for Approval and Ready for Billing side by side (2026-10-08); stacked below 1200px. */
.eb-work-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.eb-work-split > .eb-work-section { min-width: 0; margin-top: 16px; }
@media (max-width: 1200px) {
    .eb-work-split { grid-template-columns: 1fr; }
}
/* A status grid without Export (AR Workbench, 2026-10-08): hide DevExpress's then-empty toolbar strip. */
.eb-no-toolbar .dxbl-grid-toolbar-container,
.eb-no-toolbar .dxbl-toolbar { display: none !important; }

/* Project Hierarchy tree (2026-10-08): rows reuse Signings' .sg-tree-row / .sg-tree-name / .sg-tree-branch / .sg-tree-amt. */
.eb-tree { display: flex; flex-direction: column; }
.eb-tree-parent { cursor: default; font-size: 14px; border-left-color: var(--brand-gold); background: rgba(201, 168, 76, 0.08); }
.eb-tree-chevron { flex: 0 0 auto; display: inline-block; font-size: 10px; color: var(--text-light); transform: rotate(-90deg); transition: transform var(--transition); }
.eb-tree-chevron.open { transform: none; color: var(--brand-navy); }
.eb-tree-lines { padding: 4px 12px 12px 58px; }
.eb-tree-lines .tbl { font-size: 12.5px; }
/* Project Hierarchy view switch (By Project / By Phase, 2026-10-09) and the IC-phase leaf rows. */
.eb-view-toggle { display: flex; gap: 18px; margin: 0 0 12px; font-size: 13px; }
.eb-view-toggle label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.eb-tree-leaf { cursor: default; }
/* IC Billing Pending (2026-10-19): the worksheet column's empty dash, the breakdown popup's note and company codes. */
.eb-muted { color: var(--text-muted); }
.eb-note { font-size: 12.5px; color: var(--text-muted); margin: 0 0 10px; }
.eb-upper { text-transform: uppercase; }
/* A carried-forward submission in the PM's Billing tab (2026-10-20). */
.eb-carried-badge { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 9px; font-size: 11px;
                    background: #FFF4E0; color: #8A5A00; border: 1px solid #F0D29A; white-space: nowrap; cursor: help; }
/* PM Dashboard: Trading Projects / IC Projects side by side (2026-10-20); stacked on narrow screens. */
.eb-trading-ic { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }   /* equal halves (user, 2026-10-20) */
.eb-dash-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.eb-trading-ic .exec-summary-cell { min-width: 0; }
.eb-trading-ic .exec-summary-grid { width: 100%; }
@media (max-width: 1400px) { .eb-trading-ic { grid-template-columns: 1fr; } }
/* The PM Dashboard layout sits inside .billing-summary, which is itself a 2-column grid (the PM Billing tab's) -- span both. */
.billing-summary > .eb-trading-ic { grid-column: 1 / -1; }
/* PM Dashboard grids (2026-10-20): column widths are percentages (no horizontal scroll); a header that doesn't fit its
   column wraps onto a second line instead of being cut off. */
.eb-trading-ic .exec-summary-grid thead th,
.eb-trading-ic .exec-summary-grid thead th .dxbl-grid-header-content,
.eb-trading-ic .exec-summary-grid thead th .dxbl-text {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: normal;
}
.eb-trading-ic .exec-summary-grid thead th { vertical-align: middle; line-height: 1.3; }
/* AR My Work with only Ready for Approval (Ready for Billing hidden, 2026-10-20): one full-width column. */
.eb-work-split.eb-work-single { grid-template-columns: 1fr; }

/* IC Billing Pending popup (2026-10-26): one block per IC project -- its whole worksheet, the lines linked to the clicked main line
   highlighted, and Approve / Return for its PM approver. */
.eb-ic-review { border: 1px solid var(--border, #d6dbe3); border-radius: 6px; padding: 10px 12px; margin: 0 0 14px; }
.eb-ic-review-hdr { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.eb-ic-review-total { color: var(--brand-navy, #1b2a4a); font-weight: 600; }
.eb-ic-review-actions { margin-left: auto; display: flex; gap: 8px; }
.eb-ic-review-grand { display: flex; gap: 10px; align-items: baseline; justify-content: flex-end; margin-top: 4px; }
.tbl tr.eb-ic-linked td { background: #fff4d6 !important; font-weight: 600; }
.tbl tr.eb-ic-linked td:first-child { box-shadow: inset 3px 0 0 #b8913a; }
.eb-ic-linked-key { background: #fff4d6; padding: 0 4px; border-radius: 3px; font-weight: 600; }
