.hedera-table-column-guide {
    direction: rtl;
    font-size: 10px;
    line-height: 1.8;
    padding: 7px 10px;
    margin: 4px 0 6px;
    border: 1px solid #d6e7e1;
    border-radius: 8px;
    background: #f3f8f5;
    color: #31574b;
    overflow-wrap: anywhere;
}
.hedera-table-column-guide[hidden] { display: none !important; }
/* Independent report-table themes. Every rule is anchored to an opted-in table
   or to controls created by table_theme.js; page chrome is never recolored. */

html:root body table[data-table-theme="light"],
html:root body table[data-table-theme="light"] > :is(thead, tbody, tfoot),
html:root body table[data-table-theme="light"] > :is(thead, tbody, tfoot) > tr,
html:root body table[data-table-theme="light"] > :is(thead, tbody, tfoot) > tr > :is(th, td) {
    --bs-table-bg: #fff !important;
    --bs-table-color: #18352e !important;
    --bs-table-striped-bg: #f0f5f2 !important;
    --bs-table-striped-color: #18352e !important;
    --bs-table-hover-bg: #e3eee8 !important;
    --bs-table-hover-color: #18352e !important;
    --bs-table-active-bg: #dcebe2 !important;
    --bs-table-active-color: #16372c !important;
    --bs-table-bg-type: #fff !important;
    --bs-table-bg-state: #fff !important;
    --bs-table-accent-bg: transparent !important;
    --bs-table-border-color: #d7e3dc !important;
    --bs-table-box-shadow: inset 0 0 0 9999px var(--bs-table-bg-type, transparent) !important;
}

html:root body table[data-table-theme="light"] {
    color: #18352e !important;
    background: #fff !important;
    border-color: #d7e3dc !important;
    color-scheme: light;
}

html:root body table[data-table-theme="light"] > thead > tr > :is(th, td),
html:root body table[data-table-theme="light"] > tfoot > tr > :is(th, td) {
    background-color: #e7f0eb !important;
    color: #173a30 !important;
    border-color: #cddbd3 !important;
}

html:root body table[data-table-theme="light"] > tbody > tr > :is(th, td) {
    background-color: #fff !important;
    color: #18352e !important;
    border-color: #d7e3dc !important;
}

html:root body table[data-table-theme="light"] > tbody > tr:nth-child(even) > :is(th, td) {
    --bs-table-bg-type: #f0f5f2 !important;
    background-color: #f0f5f2 !important;
}

html:root body table[data-table-theme="light"] > tbody > tr:hover > :is(th, td) {
    --bs-table-bg-state: #e3eee8 !important;
    background-color: #e3eee8 !important;
    color: #18352e !important;
}

html:root body table[data-table-theme="light"][data-table-theme="light"][data-table-theme="light"][data-table-theme="light"] > tbody > tr:is(
    .table-success, .table-warning, .table-info, .table-primary, .table-secondary,
    .table-light, .table-active, .manufacturer-product-selected, .brand-self,
    .drug-row-highlight, .row-selected, .selected-row, .highlighted, .is-selected,
    .is-highlighted, [aria-selected="true"], .bg-white, .bg-light, [style*="background"]
) > :is(th, td) {
    --bs-table-bg: #dcebe2 !important;
    --bs-table-bg-type: #dcebe2 !important;
    --bs-table-bg-state: #dcebe2 !important;
    --bs-table-accent-bg: transparent !important;
    background-color: #dcebe2 !important;
    color: #173a30 !important;
}

html:root body table[data-table-theme="light"] :is(a, a:visited) {
    color: #145b48 !important;
    text-decoration: underline !important;
    text-decoration-color: currentColor !important;
    text-underline-offset: 2px;
}

html:root body table[data-table-theme="light"] :is(a:hover, a:focus-visible) {
    color: #0b4435 !important;
}

html:root body table[data-table-theme="light"] :is(
    .table-success, .table-warning, .table-info, .table-primary, .table-secondary,
    .table-light, .table-active, .manufacturer-product-selected, .brand-self,
    .drug-row-highlight, .row-selected, .selected-row, .highlighted, .is-selected,
    .is-highlighted, [aria-selected="true"], .bg-white, .bg-light, [style*="background"]
) :is(p, div, label, li, dt, dd, span, strong, em, small, code, .text-muted):not(.badge):not(.badge *):not(.btn):not(.btn *):not(button):not(button *) {
    color: #173a30 !important;
}

html:root body table[data-table-theme="dark"],
html:root body table[data-table-theme="dark"] > :is(thead, tbody, tfoot),
html:root body table[data-table-theme="dark"] > :is(thead, tbody, tfoot) > tr,
html:root body table[data-table-theme="dark"] > :is(thead, tbody, tfoot) > tr > :is(th, td) {
    --bs-table-bg: #17231f !important;
    --bs-table-color: #e5f0eb !important;
    --bs-table-striped-bg: #1d2c26 !important;
    --bs-table-striped-color: #e5f0eb !important;
    --bs-table-hover-bg: #294036 !important;
    --bs-table-hover-color: #f2fbf7 !important;
    --bs-table-active-bg: #315345 !important;
    --bs-table-active-color: #f4fff9 !important;
    --bs-table-bg-type: #17231f !important;
    --bs-table-bg-state: #17231f !important;
    --bs-table-accent-bg: transparent !important;
    --bs-table-border-color: #344a40 !important;
    --bs-table-box-shadow: inset 0 0 0 9999px var(--bs-table-bg-type, transparent) !important;
}

html:root body table[data-table-theme="dark"] {
    color: #e5f0eb !important;
    background: #17231f !important;
    border-color: #344a40 !important;
    color-scheme: dark;
}

html:root body table[data-table-theme="dark"] > :is(thead, tfoot) > tr > :is(th, td) {
    --bs-table-bg-type: #263b32 !important;
    background-color: #263b32 !important;
    color: #f0faf5 !important;
    border-color: #405a4d !important;
}

html:root body table[data-table-theme="dark"] > tbody > tr > :is(th, td) {
    background-color: #17231f !important;
    color: #e5f0eb !important;
    border-color: #344a40 !important;
}

html:root body table[data-table-theme="dark"] > tbody > tr:nth-child(even) > :is(th, td) {
    --bs-table-bg-type: #1d2c26 !important;
    background-color: #1d2c26 !important;
}

html:root body table[data-table-theme="dark"] > tbody > tr:hover > :is(th, td) {
    --bs-table-bg-state: #294036 !important;
    background-color: #294036 !important;
    color: #f2fbf7 !important;
}

html:root body table[data-table-theme="dark"][data-table-theme="dark"][data-table-theme="dark"][data-table-theme="dark"] > tbody > tr:is(
    .table-success, .table-warning, .table-info, .table-primary, .table-secondary,
    .table-light, .table-active, .manufacturer-product-selected, .brand-self,
    .drug-row-highlight, .row-selected, .selected-row, .highlighted, .is-selected,
    .is-highlighted, [aria-selected="true"], .bg-white, .bg-light, [style*="background"]
) > :is(th, td) {
    --bs-table-bg: #315345 !important;
    --bs-table-bg-type: #315345 !important;
    --bs-table-bg-state: #315345 !important;
    --bs-table-accent-bg: transparent !important;
    background-color: #315345 !important;
    color: #f4fff9 !important;
}

html:root body table[data-table-theme="dark"] :is(a, a:visited) {
    color: #9de4c2 !important;
    text-decoration: underline !important;
    text-decoration-color: currentColor !important;
    text-underline-offset: 2px;
}

html:root body table[data-table-theme="dark"] :is(a:hover, a:focus-visible) {
    color: #c4f5d9 !important;
}

html:root body table[data-table-theme="dark"] :is(
    p, div, label, li, dt, dd, span, strong, em, small, code, .text-muted, .small, .text-secondary
):not(.badge):not(.badge *):not(.btn):not(.btn *):not(button):not(button *) {
    color: #d7e8df !important;
}

html:root body table[data-table-theme="dark"] :is(
    .table-success, .table-warning, .table-info, .table-primary, .table-secondary,
    .table-light, .table-active, .manufacturer-product-selected, .brand-self,
    .drug-row-highlight, .row-selected, .selected-row, .highlighted, .is-selected,
    .is-highlighted, [aria-selected="true"], .bg-white, .bg-light, [style*="background"]
) :is(p, div, label, li, dt, dd, span, strong, em, small, code, .text-muted):not(.badge):not(.badge *):not(.btn):not(.btn *):not(button):not(button *) {
    color: #f4fff9 !important;
}

/* Final cascade contract: tables own their colors, independently of page theme
   and of later, more-specific report CSS. Bootstrap inset stripes are reset. */
html:root body table[data-table-theme="light"] {
    --htt-bg:#fff; --htt-stripe:#f0f5f2; --htt-hover:#e3eee8;
    --htt-selected:#dcebe2; --htt-head:#e7f0eb; --htt-text:#18352e;
    --htt-link:#145b48; --htt-border:#d7e3dc;
}
html:root body table[data-table-theme="dark"] {
    --htt-bg:#17231f; --htt-stripe:#1d2c26; --htt-hover:#294036;
    --htt-selected:#315345; --htt-head:#263b32; --htt-text:#e5f0eb;
    --htt-link:#9de4c2; --htt-border:#344a40;
}
html:root:root:root:root:root:root:root:root:root:root body table[data-table-theme] {
    color:var(--htt-text)!important;
    background:var(--htt-bg)!important;
    border-color:var(--htt-border)!important;
}
html:root:root:root:root:root:root:root:root:root:root body table[data-table-theme] > :is(thead,tbody,tfoot) > tr > :is(td,th) {
    --bs-table-bg:var(--htt-bg)!important;
    --bs-table-bg-type:transparent!important;
    --bs-table-bg-state:transparent!important;
    --bs-table-accent-bg:transparent!important;
    --bs-table-color:var(--htt-text)!important;
    --bs-table-striped-color:var(--htt-text)!important;
    --bs-table-hover-color:var(--htt-text)!important;
    --bs-table-active-color:var(--htt-text)!important;
    background:var(--htt-bg)!important;
    color:var(--htt-text)!important;
    border-color:var(--htt-border)!important;
    box-shadow:none!important;
}
html:root:root:root:root:root:root:root:root:root:root body table[data-table-theme] > :is(thead,tfoot) > tr > :is(td,th) {
    background:var(--htt-head)!important;
}
html:root:root:root:root:root:root:root:root:root:root body table[data-table-theme] > tbody > tr:nth-child(even) > :is(td,th) {
    background:var(--htt-stripe)!important;
}
html:root:root:root:root:root:root:root:root:root:root body table[data-table-theme] > tbody > tr:hover > :is(td,th) {
    background:var(--htt-hover)!important;
}
html:root:root:root:root:root:root:root:root:root:root body table[data-table-theme] > tbody > tr:is(
    .table-success,.table-warning,.table-info,.table-primary,.table-secondary,
    .table-light,.table-active,.manufacturer-product-selected,.brand-self,
    .drug-row-highlight,.row-selected,.selected-row,.highlighted,.is-selected,
    .is-highlighted,[aria-selected="true"],.bg-white,.bg-light,[style*="background"]
) > :is(td,th) {
    background:var(--htt-selected)!important;
}
html:root:root:root:root:root:root:root:root:root:root body table[data-table-theme] :is(p,div,label,li,dt,dd,span,strong,em,small,code,details,summary,b,.text-muted,.small,.text-secondary):not(.badge):not(.badge *):not(.btn):not(.btn *):not(button):not(button *) {
    color:var(--htt-text)!important;
}
html:root:root:root:root:root:root:root:root:root:root body table[data-table-theme] :is(a,a:visited,a:hover,a:focus-visible),
html:root:root:root:root:root:root:root:root:root:root body table[data-table-theme] a :is(span,strong,small,code) {
    color:var(--htt-link)!important;
    text-decoration-color:currentColor!important;
}

/* Preserve the semantic foreground/background pairing of Bootstrap actions and
   badges instead of flattening them into ordinary table copy. */
html:root body table[data-table-theme] :is(.badge, .btn, button, input, select, textarea, option) {
    color-scheme: inherit;
}

.hedera-table-theme-control,
.hedera-tables-global-control {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid rgba(69, 134, 111, .48);
    border-radius: 9px;
    background: #eef6f1;
    color: #204a3c;
    font-family: 'Diodrum Fa', 'YekanBakh', Tahoma, sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: 0 2px 7px rgba(12, 37, 27, .12);
    transition: transform .16s ease;
}

.hedera-table-theme-control:hover,
.hedera-tables-global-control:hover {
    background: #dceee4;
    border-color: #43856c;
    transform: translateY(-1px);
}

.hedera-table-theme-control:focus-visible,
.hedera-tables-global-control:focus-visible {
    outline: 3px solid #4a9a78;
    outline-offset: 2px;
}

/* The public header gains an extra table toggle. Wrap the real header, not
   the document or its tables; administrative headers have no such control. */
@media (max-width: 640px) {
    .hub-header .hub-bar:has(.hedera-tables-global-control) {
        flex-wrap: wrap;
        min-width: 0;
    }
    .hub-header .hub-user:has(.hedera-tables-global-control) {
        flex-wrap: wrap;
        min-width: 0;
        max-width: 100%;
    }
}

.hedera-table-theme-control[aria-pressed="true"],
.hedera-tables-global-control[aria-pressed="true"] {
    background: #223a30;
    border-color: #537b66;
    color: #e8f6ed;
}

.hedera-table-theme-control[aria-pressed="true"]:hover,
.hedera-tables-global-control[aria-pressed="true"]:hover {
    background: #2c4b3d;
}

.hedera-table-theme-control {
    margin: 0 0 7px auto;
}

.hedera-table-theme-control[hidden] {
    display: none !important;
}

@media (max-width: 600px) {
    .hedera-table-theme-control {
        min-height: 34px;
        margin-bottom: 6px;
        padding-inline: 9px;
    }

    .hedera-tables-global-control {
        min-height: 36px;
        padding-inline: 9px;
        font-size: 10px;
    }

    html:root body table[data-table-theme] {
        font-size: .92em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hedera-table-theme-control,
    .hedera-tables-global-control {
        transition: none;
    }
}

/* Every public report table keeps its complete row set inside a bounded,
   horizontally scrollable well. The header stays in view while reading. */
html:root body .hedera-report-table-scroll[data-hedera-table-scroll] {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: var(--hedera-report-table-height);
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}
html:root body .hedera-report-table-scroll > table {
    margin-bottom: 0;
}
html:root body table[data-table-theme] > thead > tr > :is(th,td) {
    position: sticky;
    top: 0;
    z-index: 4;
}

/* Shared-count and nested drill-in actions inherit the table's own palette,
   including when a light table sits on a dark report page. */
html:root body table[data-table-theme="light"] :is(
    button[data-shared-count],.shared-count-button,.shared-count-btn,.count-button
) {
    border: 1px solid #a8c8b8 !important;
    border-radius: 6px !important;
    background: #eaf4ee !important;
    color: #174f3d !important;
    font-weight: 750;
}
html:root body table[data-table-theme="dark"] :is(
    button[data-shared-count],.shared-count-button,.shared-count-btn,.count-button
) {
    border: 1px solid #547a67 !important;
    border-radius: 6px !important;
    background: #29483a !important;
    color: #e9fff2 !important;
    font-weight: 750;
}
html:root body table[data-table-theme] :is(
    button[data-shared-count],.shared-count-button,.shared-count-btn,.count-button
):is(:hover,:focus-visible) {
    filter: brightness(.96);
}

/* Company/distributor detail counts are dialog triggers, not semantic green
   buttons; the active table theme owns their text contrast. */
html:root body table[data-table-theme] :is(.cso-count-button,.cd-count-button) {
    color: var(--htt-text) !important;
    border: 1px solid var(--htt-border) !important;
    background: var(--htt-head) !important;
}

/* Keep table controls independent from the page theme as well. */
html:root body .hedera-table-theme-control,
html:root body .hedera-tables-global-control {
    color-scheme: light;
}
html:root body table[data-table-theme="light"] :is(
    button[data-shared-count],.shared-count-button,.shared-count-btn,.count-button,
    .cso-count-button,.cd-count-button
):focus-visible {
    outline: 2px solid #216b57 !important;
    outline-offset: 2px;
}
html:root body table[data-table-theme="dark"] :is(
    button[data-shared-count],.shared-count-button,.shared-count-btn,.count-button,
    .cso-count-button,.cd-count-button
):focus-visible {
    outline: 2px solid #9de4c2 !important;
    outline-offset: 2px;
}
