/* ==========================================================================
   Rowe table skin for Tabulator, plus the toolbar pieces that sit above it.

   Every Tabulator rule is written as `.tabulator.rowe-table ...` so it carries
   one class more than the vendor rule it replaces and wins whatever order the
   two stylesheets load in.
   ========================================================================== */

:root {
    --rowe-table-accent: var(--bs-primary, #7367f0);
    --rowe-table-accent-rgb: var(--bs-primary-rgb, 115, 103, 240);
    --rowe-table-line: rgba(75, 70, 92, 0.08);
    --rowe-table-muted: #a5a3ae;
}

/* ---- Card ---------------------------------------------------------------- */

.rowe-table-card {
    border: 0;
    box-shadow: 0 10px 28px -22px rgba(47, 43, 61, 0.45);
    transition: opacity 0.15s ease;
}

.rowe-table-card.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

/* ---- Toolbar: filters on the left, search on the right -------------------- */

.rowe-table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem 1rem;
    margin-bottom: 1.1rem;
}

.rowe-table-search {
    position: relative;
    flex: 0 1 22rem;
    min-width: 14rem;
}

.rowe-table-search > i {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rowe-table-muted);
    font-size: 1.1rem;
    pointer-events: none;
}

.rowe-table-search .form-control {
    height: 2.5rem;
    padding-left: 2.6rem;
    padding-right: 1rem;
    border-radius: 50rem;
}

/* ---- Segmented selector: one soft track, the chosen option lifted on it --- */

.rowe-switch {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.3rem;
    border-radius: 1.5rem;
    background: rgba(var(--rowe-table-accent-rgb), 0.08);
}

.rowe-switch-item {
    border: 0;
    background: transparent;
    color: var(--bs-body-color);
    padding: 0.45rem 1rem;
    border-radius: 50rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.rowe-switch-item:hover {
    background: rgba(var(--rowe-table-accent-rgb), 0.14);
    color: var(--rowe-table-accent);
}

.rowe-switch-item.is-active,
.rowe-switch-item.is-active:hover {
    background: var(--rowe-table-accent);
    color: #fff;
    box-shadow: 0 3px 8px -2px rgba(var(--rowe-table-accent-rgb), 0.55);
}

.rowe-switch-item small {
    font-size: inherit;
    font-weight: 400;
    opacity: 0.7;
    margin-left: 0.2rem;
}

.rowe-switch-dot {
    display: inline-block;
    width: 0.4rem;
    height: 0.4rem;
    margin-left: 0.4rem;
    border-radius: 50%;
    background: var(--rowe-table-accent);
    vertical-align: middle;
}

.rowe-switch-item.is-active .rowe-switch-dot {
    background: #fff;
}

/* ---- Tabulator ------------------------------------------------------------ */

.tabulator.rowe-table {
    border: 0;
    background: transparent;
    color: var(--bs-body-color);
    font-size: 0.9375rem;
}

/* Header: no filled band; quiet labels over a tinted rule. */
.tabulator.rowe-table .tabulator-header {
    border: 0;
    border-bottom: 2px solid rgba(var(--rowe-table-accent-rgb), 0.22);
    background: transparent;
    color: var(--rowe-table-accent);
    font-weight: 600;
}

.tabulator.rowe-table .tabulator-header .tabulator-col,
.tabulator.rowe-table .tabulator-header .tabulator-col.tabulator-sortable:hover {
    border: 0;
    background: transparent;
}

.tabulator.rowe-table .tabulator-header .tabulator-col .tabulator-col-content {
    padding: 0.8rem 0.75rem;
}

.tabulator.rowe-table .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tabulator.rowe-table .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title {
    padding-right: 1.6rem;
}

/* Sort arrows: faint until the column is the one being sorted. */
.tabulator.rowe-table .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter {
    right: 0.5rem;
}

.tabulator.rowe-table .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="none"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {
    border-bottom-color: rgba(var(--rowe-table-accent-rgb), 0.28);
}

.tabulator.rowe-table .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="ascending"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {
    border-bottom-color: var(--rowe-table-accent);
}

.tabulator.rowe-table .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="descending"] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {
    border-top-color: var(--rowe-table-accent);
}

/* Rows */
.tabulator.rowe-table .tabulator-tableholder .tabulator-table {
    background: transparent;
    color: inherit;
}

.tabulator.rowe-table .tabulator-row,
.tabulator.rowe-table .tabulator-row.tabulator-row-even {
    background: transparent;
    border-bottom: 1px solid var(--rowe-table-line);
    transition: background-color 0.12s ease;
}

.tabulator.rowe-table .tabulator-row.tabulator-selectable:hover,
.tabulator.rowe-table .tabulator-row:hover {
    background: rgba(var(--rowe-table-accent-rgb), 0.05);
    cursor: default;
}

.tabulator.rowe-table .tabulator-row .tabulator-cell {
    border: 0;
    padding: 0.8rem 0.75rem;
    line-height: 1.4;
}

.tabulator.rowe-table .tabulator-row .tabulator-cell.rowe-cell-strong {
    color: var(--bs-heading-color, #5d596c);
    font-weight: 500;
}

/* A status is an icon and its word: no chip, no fill. */
.tabulator.rowe-table .rowe-state {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.tabulator.rowe-table .rowe-state i {
    font-size: 1.15rem;
}

/* Columns that did not fit, folded under the row on narrow screens. */
.tabulator.rowe-table .tabulator-row .tabulator-responsive-collapse {
    border: 0;
    padding: 0 0.75rem 0.8rem 2.6rem;
}

.tabulator.rowe-table .tabulator-row .tabulator-responsive-collapse table {
    font-size: 0.875rem;
}

.tabulator.rowe-table .tabulator-row .tabulator-responsive-collapse td {
    padding: 0.15rem 0.75rem 0.15rem 0;
    vertical-align: top;
}

.tabulator.rowe-table .tabulator-row .tabulator-responsive-collapse td:first-child {
    color: var(--rowe-table-muted);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    padding-top: 0.3rem;
}

.tabulator.rowe-table .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: rgba(var(--rowe-table-accent-rgb), 0.12);
    color: var(--rowe-table-accent);
}

/* The vendor glyph is drawn white for its dark default disc. */
.tabulator.rowe-table .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle svg {
    stroke: var(--rowe-table-accent);
}

.tabulator.rowe-table .tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover {
    opacity: 1;
    background: rgba(var(--rowe-table-accent-rgb), 0.22);
}

/* Empty state */
.tabulator.rowe-table .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents {
    color: var(--rowe-table-muted);
    font-size: 0.9375rem;
    font-weight: 400;
    padding: 2.5rem 1rem;
}

/* Footer: counter on the left, pager on the right. */
.tabulator.rowe-table .tabulator-footer {
    border: 0;
    background: transparent;
    color: var(--rowe-table-muted);
    font-weight: 400;
    padding: 1rem 0 0;
}

.tabulator.rowe-table .tabulator-footer .tabulator-footer-contents {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0;
}

.tabulator.rowe-table .tabulator-footer .tabulator-page-counter {
    font-size: 0.8125rem;
}

.tabulator.rowe-table .tabulator-footer .tabulator-paginator {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    color: var(--rowe-table-muted);
    font-size: 0.8125rem;
}

.tabulator.rowe-table .tabulator-footer .tabulator-paginator label {
    margin: 0;
}

.tabulator.rowe-table .tabulator-footer .tabulator-page-size {
    height: 2.1rem;
    margin: 0 0.9rem 0 0.4rem;
    padding: 0 1.9rem 0 0.8rem;
    border: 1px solid var(--bs-border-color, #dbdade);
    border-radius: 50rem;
    background-color: transparent;
    color: var(--bs-body-color);
}

.tabulator.rowe-table .tabulator-footer .tabulator-pages {
    display: inline-flex;
    gap: 0.25rem;
    margin: 0;
}

.tabulator.rowe-table .tabulator-footer .tabulator-page {
    min-width: 2.1rem;
    height: 2.1rem;
    margin: 0;
    padding: 0 0.55rem;
    border: 0;
    border-radius: 50rem;
    background: rgba(75, 70, 92, 0.06);
    color: var(--bs-body-color);
    font-size: 0.8125rem;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.tabulator.rowe-table .tabulator-footer .tabulator-page:not(.disabled):not(.active):hover {
    background: rgba(var(--rowe-table-accent-rgb), 0.16);
    color: var(--rowe-table-accent);
}

.tabulator.rowe-table .tabulator-footer .tabulator-page.active {
    background: var(--rowe-table-accent);
    color: #fff;
    box-shadow: 0 3px 8px -2px rgba(var(--rowe-table-accent-rgb), 0.55);
}

.tabulator.rowe-table .tabulator-footer .tabulator-page:disabled,
.tabulator.rowe-table .tabulator-footer .tabulator-page.disabled {
    opacity: 0.4;
}

@media (max-width: 767.98px) {
    .rowe-switch { border-radius: 1rem; }
    .rowe-switch-item small { display: none; }
    .rowe-table-search { flex-basis: 100%; }

    .tabulator.rowe-table .tabulator-footer .tabulator-footer-contents,
    .tabulator.rowe-table .tabulator-footer .tabulator-paginator {
        justify-content: center;
    }
}
