/* Relationships expand as compact rows, without another layer of cards. */
.row-toggle {
    display: flex;
    width: fit-content;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    min-height: 36px;
    max-width: 100%;
    padding: 4px 8px;
    margin: 3px 0 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #245069;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    white-space: normal;
    text-align: left;
}
.row-toggle:hover { border-color: #b9cdd4; background: #edf4f5; color: #143c52; }
.row-toggle[aria-expanded="true"] { color: #135c38; background: #e7f2eb; }
.row-toggle-chevron { display: inline-block; width: 12px; flex: 0 0 12px; font-size: 23px; line-height: 1; text-align: center; }
.row-toggle[aria-expanded="true"] > .row-toggle-chevron { transform: rotate(90deg); }
.subrow-count { min-width: 22px; padding: 1px 5px; border-radius: 3px; background: #e0eae6; color: #195238; text-align: center; font-size: 12px; }
tbody > tr[data-row-parity="odd"] > :is(td, th) { background-color: #fff; }
tbody > tr[data-row-parity="even"] > :is(td, th) { background-color: #f8fafb; }
tbody > tr.row-is-expanded > :is(td, th) { background-color: #edf4f1; border-bottom-color: #b7cfc3; }
tbody > tr[data-subrow] > td { padding: 0; background: #f4f7f8; border-top: 0; }
.subtable-panel, .subtable-section { margin: 0; padding: 8px 12px 10px 20px; border: 0; border-left: 3px solid #bfd1c7; background: #f4f7f8; }
.subtable-section + .subtable-section { border-top: 1px solid #d7e2e6; }
.subtable-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 5px; }
.subtable-heading h3 { margin: 0; font-size: 13px; line-height: 1.4; }
.subtable-heading > a { font-size: 12px; }
.subtable-caption { padding: 3px 0 6px; text-align: left; color: #436071; font-size: 13px; }
.subtable-panel > .table-wrap, .subtable-section > .table-wrap { border: 0; border-radius: 0; }
table.subtable { font-size: 13px; line-height: 1.45; }
table.subtable > thead > tr > th { padding: 7px 10px; font-size: 12px; }
table.subtable > tbody > tr:not([data-subrow]) > :is(td, th) { padding: 8px 10px; vertical-align: middle; }
table.subtable small { margin-top: 2px; font-size: 12px; line-height: 1.4; }
table.subtable .badge { min-height: auto; padding: 3px 7px; font-size: 12px; }
table.subtable .button { min-height: 32px; padding: 5px 9px; font-size: 13px; }
table.subtable .subtable-section, table.subtable .subtable-panel { padding: 5px 8px 7px 16px; }
.billing-work-table table.subtable th { width: auto; }
.subtable-section > p, .subtable-panel > p { margin: 6px 0 0; font-size: 13px; }
@media (max-width: 800px) {
    .row-toggle { min-height: 44px; }
    .subtable-panel, .subtable-section { padding-left: 10px; padding-right: 6px; }
}
@media print {
    button[data-row-toggle] { display: none !important; }
    tr[data-subrow][hidden] { display: table-row !important; }
    .subtable-section > .table-wrap, .subtable-panel > .table-wrap { overflow: visible; }
}
