/* ================================================================
   tabulator-compact.css
   Compact, minimal Tabulator overrides for SB Admin 2 / Bootstrap 4
   Apply to any wrapper: <div class="tabulator-compact">
   ================================================================ */

/* --- Base ---------------------------------------------------- */
.tabulator-compact .tabulator {
    font-size: 0.8rem;
    border: none;
    background: transparent;
}

/* --- Header -------------------------------------------------- */
.tabulator-compact .tabulator-header {
    background-color: #f8f9fc;
    border-bottom: 2px solid #e3e6f0;
    color: #858796;
}

.tabulator-compact .tabulator-col {
    background-color: transparent;
    border-right: 1px solid #e3e6f0;
}

.tabulator-compact .tabulator-col-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #858796;
    padding: 6px 8px 2px;
}

/* --- Column header filters ---------------------------------- */
.tabulator-compact .tabulator-header-filter input,
.tabulator-compact .tabulator-header-filter select {
    font-size: 0.72rem;
    height: 24px;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #d1d3e2;
    color: #6e707e;
    background: #fff;
}

.tabulator-compact .tabulator-header-filter input:focus,
.tabulator-compact .tabulator-header-filter select:focus {
    border-color: #bac8f3;
    outline: none;
    box-shadow: 0 0 0 0.15rem rgba(78,115,223,.15);
}

/* --- Rows ---------------------------------------------------- */
.tabulator-compact .tabulator-row {
    border-bottom: 1px solid #f0f2f8;
    min-height: 34px;
}

.tabulator-compact .tabulator-row .tabulator-cell {
    padding: 5px 8px;
    font-size: 0.8rem;
    border-right: 1px solid #f0f2f8;
    color: #5a5c69;
}

.tabulator-compact .tabulator-row.tabulator-row-even {
    background-color: #fafbff;
}

.tabulator-compact .tabulator-row:hover,
.tabulator-compact .tabulator-row.tabulator-row-even:hover {
    background-color: #eaecf4;
    cursor: default;
}

/* --- Footer / Pagination ------------------------------------ */
.tabulator-compact .tabulator-footer {
    background-color: #fff !important;
    border-top: 1px solid #e3e6f0;
    padding: 0 !important;
    font-size: 0.75rem;
    color: #858796;
    font-weight: 400 !important;
}

/* footer-contents: force flex row, centered, space-between */
.tabulator-compact .tabulator-footer-contents {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 6px 10px !important;
}

/* page-size SPAN (left side): inline-flex, centered */
.tabulator-compact span.tabulator-page-size {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px;
    margin: 0 !important;
}

.tabulator-compact span.tabulator-page-size > label {
    font-size: 0.72rem;
    line-height: 26px;
    margin: 0;
    color: #858796;
    white-space: nowrap;
}

/* page-size SELECT */
.tabulator-compact select.tabulator-page-size {
    height: 26px !important;
    padding: 0 5px !important;
    font-size: 0.72rem !important;
    border: 1px solid #d1d3e2 !important;
    border-radius: 1px !important;
    background: #fff;
    color: #5a5c69;
    cursor: pointer;
    margin: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    vertical-align: middle;
    line-height: normal;
}

/* paginator (right side): flex child, push content right */
.tabulator-compact .tabulator-paginator {
    display: flex !important;
    flex: 1;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 3px;
    text-align: right;
}

.tabulator-compact .tabulator-paginator > label {
    font-size: 0.72rem;
    line-height: 26px;
    margin: 0 4px 0 0;
    color: #858796;
    white-space: nowrap;
}

/* pages SPAN: strip Tabulator's 0 7px margin, make flex */
.tabulator-compact .tabulator-pages {
    display: inline-flex !important;
    align-items: center !important;
    gap: 2px;
    margin: 0 !important;
}

/* page BUTTONS */
.tabulator-compact .tabulator-page {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 26px !important;
    min-width: 28px !important;
    padding: 0 7px !important;
    font-size: 0.8rem !important;
    line-height: 1 !important;
    border: 1px solid #d1d3e2 !important;
    border-radius: 2px !important;
    background: #fff !important;
    color: #6e707e !important;
    cursor: pointer;
    margin: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.tabulator-compact .tabulator-page:hover:not([disabled]) {
    background: #4e73df !important;
    color: #fff !important;
    border-color: #4e73df !important;
}

.tabulator-compact .tabulator-page.active {
    background: #4e73df !important;
    color: #fff !important;
    border-color: #4e73df !important;
    font-weight: 600;
}

.tabulator-compact .tabulator-page[disabled] {
    opacity: 0.35 !important;
    cursor: default;
    pointer-events: none;
}

/* --- Inactive row muting ------------------------------------ */
.tabulator-compact .tabulator-row.row-inactive .tabulator-cell {
    color: #b5b7c0;
}

.tabulator-compact .tabulator-row.row-inactive,
.tabulator-compact .tabulator-row.row-inactive.tabulator-row-even {
    background-color: #fff8f8;
}

.tabulator-compact .tabulator-row.row-inactive:hover,
.tabulator-compact .tabulator-row.row-inactive.tabulator-row-even:hover {
    background-color: #fceaea;
}

/* --- Borderless icon-only action buttons -------------------- */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #858796;
    font-size: 0.82rem;
    line-height: 1;
    vertical-align: middle;
    transition: background 0.12s, color 0.12s;
    cursor: pointer;
}

.btn-icon:hover,
.btn-icon:focus {
    background: #eaecf4;
    color: #4e73df;
    text-decoration: none;
    outline: none;
}

.btn-icon-danger:hover,
.btn-icon-danger:focus {
    background: #fde8e8;
    color: #e74a3b;
}

/* --- Toolbar buttons ---------------------------------------- */
.table-toolbar .btn {
    font-size: 0.78rem;
}

/* --- Cell vertical alignment -------------------------------- */
.tabulator-compact .tabulator-cell {
    display: flex;
    align-items: center;
}

/* --- Sort arrows: softer/subtler ---------------------------- */
.tabulator-compact .tabulator-col .tabulator-col-sorter {
    opacity: 0.25;
}
.tabulator-compact .tabulator-col:hover .tabulator-col-sorter {
    opacity: 0.55;
}
.tabulator-compact .tabulator-col[aria-sort="ascending"] .tabulator-col-sorter,
.tabulator-compact .tabulator-col[aria-sort="descending"] .tabulator-col-sorter {
    opacity: 0.85;
    color: #4e73df;
}
.tabulator-compact .tabulator-arrow {
    border-width: 4px !important;
}

/* --- Ellipsis icon: replaced by bi-three-dots-vertical in JS */
.btn-icon .bi-three-dots-vertical {
    font-size: 0.82rem;
}

/* --- Sidebar nav item spacing ------------------------------- */
.sidebar .nav-item .nav-link {
    padding: 0.45rem 1rem !important;
}

/* --- Sidebar: hide circular bottom toggle ------------------- */
#sidebarToggle {
    display: none !important;
}

/* --- Sidebar: always show topbar hamburger ------------------ */
#sidebarToggleTop {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

/* --- Show inactive toggle label ----------------------------- */
.show-inactive-label {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    color: #858796;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    font-weight: 500;
}
.show-inactive-label input[type="checkbox"] {
    margin-right: 0.3rem;
    cursor: pointer;
}

/* ================================================================
   form-compact – compact form style for create/edit pages
   Apply class="form-compact" to the <form> element
   ================================================================ */
.form-compact .form-control {
    font-size: 0.82rem;
    height: calc(1.5em + 0.55rem + 2px);
    padding: 0.275rem 0.6rem;
    border-radius: 3px;
    color: #5a5c69;
    border-color: #d1d3e2;
}

.form-compact textarea.form-control {
    height: auto;
}

.form-compact .form-control::placeholder {
    color: #c4c6d0;
    font-style: italic;
    opacity: 1;
}

.form-compact .form-control:focus {
    border-color: #bac8f3;
    box-shadow: 0 0 0 0.15rem rgba(78,115,223,.18);
}

.form-compact label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #5a5c69;
    margin-bottom: 0.2rem;
    letter-spacing: 0.01em;
}

.form-compact .form-group {
    margin-bottom: 0.8rem;
}

.form-compact small.form-text {
    font-size: 0.7rem;
}

.form-compact .invalid-feedback {
    font-size: 0.7rem;
}

.form-compact .custom-control-label {
    font-size: 0.82rem;
}
