/* ==========================================================================
   Ingen UI components (v1.7)
   Plain CSS so it works with the Tailwind CDN build. Palette: brand indigo,
   slate neutrals, emerald/amber/rose for status. Light first, .dark overrides.
   ========================================================================== */

:root {
    --ui-radius: 0.75rem;
    --ui-radius-sm: 0.5rem;
    --ui-border: #e2e8f0;
    --ui-surface: #ffffff;
    --ui-muted: #64748b;
    --ui-text: #0f172a;
    --ui-brand: #4f46e5;
    --ui-brand-hover: #4338ca;
    --ui-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.04);
}
.dark {
    --ui-border: #334155;
    --ui-surface: #1e293b;
    --ui-muted: #94a3b8;
    --ui-text: #f8fafc;
    --ui-shadow: none;
}

html { -webkit-text-size-adjust: 100%; }

/* ---------- Page header ---------- */
.page-header {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 640px) {
    /* Title and actions share a row when both fit; otherwise the actions wrap below the title */
    .page-header { flex-direction: row; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; column-gap: 1.5rem; }
    .page-header > :first-child { flex: 1 1 24rem; }
}
.page-title {
    font-size: 1.25rem;
    line-height: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--ui-text);
    overflow-wrap: anywhere;
}
@media (min-width: 1024px) { .page-title { font-size: 1.5rem; line-height: 2rem; } }
.page-subtitle { margin-top: 0.25rem; font-size: 0.8125rem; color: var(--ui-muted); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
@media (max-width: 639px) {
    .page-actions > .btn-primary:last-child { flex: 1 1 auto; }
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ui-muted);
}
.breadcrumbs a { color: var(--ui-muted); transition: color .15s; }
.breadcrumbs a:hover { color: var(--ui-brand); }
.breadcrumbs [aria-current] { color: var(--ui-text); font-weight: 600; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumbs-sep { font-size: 0.5625rem; opacity: 0.6; }
/* On phones only the parent crumb is shown, as a back link */
@media (max-width: 639px) {
    .breadcrumbs > :not(:nth-last-child(3)) { display: none; }
    .breadcrumbs > a:nth-last-child(3)::before {
        content: "\f060";
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        font-size: 0.625rem;
        margin-right: 0.375rem;
    }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.25rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid transparent;
    border-radius: var(--ui-radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25rem;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn i { font-size: 0.75rem; }
.btn-sm { min-height: 1.875rem; padding: 0.3125rem 0.625rem; font-size: 0.75rem; gap: 0.375rem; }
.btn-icon { padding: 0; width: 2.25rem; }
.btn-sm.btn-icon { width: 1.875rem; }

.btn-primary { background: var(--ui-brand); color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, 0.25); }
.btn-primary:hover { background: var(--ui-brand-hover); color: #fff; }
.btn-success { background: #059669; color: #fff; }
.btn-success:hover { background: #047857; color: #fff; }
.btn-danger { background: #e11d48; color: #fff; }
.btn-danger:hover { background: #be123c; color: #fff; }
.btn-secondary { background: var(--ui-surface); color: #334155; border-color: var(--ui-border); box-shadow: var(--ui-shadow); }
.btn-secondary:hover { background: #f8fafc; border-color: #cbd5e1; color: #0f172a; }
.dark .btn-secondary { color: #e2e8f0; }
.dark .btn-secondary:hover { background: #273449; border-color: #475569; color: #fff; }
.btn-ghost { background: transparent; color: #475569; }
.btn-ghost:hover { background: #f1f5f9; color: #0f172a; }
.dark .btn-ghost { color: #cbd5e1; }
.dark .btn-ghost:hover { background: rgba(51, 65, 85, 0.6); color: #fff; }
.btn-danger-ghost { background: transparent; color: #e11d48; }
.btn-danger-ghost:hover { background: #fff1f2; }
.dark .btn-danger-ghost { color: #fb7185; }
.dark .btn-danger-ghost:hover { background: rgba(225, 29, 72, 0.12); }

/* ---------- Cards ---------- */
.card {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow);
    min-width: 0;
}
.card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--ui-border);
}
@media (min-width: 640px) { .card-header { padding: 1rem 1.25rem; } }
.card-title { font-size: 0.9375rem; font-weight: 600; color: var(--ui-text); }
.card-subtitle { font-size: 0.75rem; color: var(--ui-muted); margin-top: 0.125rem; }
.card-body { padding: 1rem; }
@media (min-width: 640px) { .card-body { padding: 1.25rem; } }
.card-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--ui-border);
    background: rgba(248, 250, 252, 0.6);
    border-radius: 0 0 var(--ui-radius) var(--ui-radius);
}
.dark .card-footer { background: rgba(15, 23, 42, 0.35); }
.card-danger { border-color: #fecdd3; }
.dark .card-danger { border-color: rgba(225, 29, 72, 0.35); }

/* Definition list for detail pages: label / value rows */
.dl { display: grid; gap: 0.75rem 1.5rem; }
@media (min-width: 640px) { .dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dl dt { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ui-muted); }
.dl dd { margin-top: 0.125rem; font-size: 0.875rem; color: var(--ui-text); overflow-wrap: anywhere; }

/* ---------- Alerts (system banners, inline notices) ---------- */
.alert {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem 0.75rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid;
    border-radius: var(--ui-radius-sm);
    font-size: 0.8125rem;
}
.alert > i { margin-top: 0.1875rem; }
.alert-body { flex: 1 1 16rem; min-width: 0; }
.alert-title { font-weight: 600; }
.alert-text { font-size: 0.75rem; opacity: 0.85; margin-top: 0.125rem; }
.alert-actions { display: flex; flex-wrap: wrap; gap: 0.375rem; align-self: center; }
.alert details > summary { cursor: pointer; list-style: none; display: inline; text-decoration: underline; text-underline-offset: 2px; font-size: 0.75rem; font-weight: 500; }
.alert details > summary::-webkit-details-marker { display: none; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-danger { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.alert-info { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.dark .alert-warning { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.3); color: #fcd34d; }
.dark .alert-danger { background: rgba(225, 29, 72, 0.1); border-color: rgba(225, 29, 72, 0.35); color: #fda4af; }
.dark .alert-info { background: rgba(99, 102, 241, 0.12); border-color: rgba(99, 102, 241, 0.35); color: #c7d2fe; }
.dark .alert-success { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.3); color: #6ee7b7; }
.alert code { padding: 0 0.25rem; border-radius: 0.25rem; background: rgba(0, 0, 0, 0.06); font-size: 0.6875rem; }

/* ---------- Dropdown menus (toggleDropdown) ---------- */
.app-dropdown { position: relative; }
.menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.375rem);
    z-index: 60;
    min-width: 12rem;
    padding: 0.375rem;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: 0 10px 30px -8px rgba(15, 23, 42, 0.25);
}
.menu-item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #334155;
    text-align: left;
    white-space: nowrap;
}
.menu-item i { width: 1rem; text-align: center; color: #94a3b8; font-size: 0.75rem; }
.menu-item:hover { background: #f1f5f9; color: #0f172a; }
.dark .menu-item { color: #e2e8f0; }
.dark .menu-item:hover { background: rgba(51, 65, 85, 0.6); color: #fff; }
.menu-item-danger, .menu-item-danger i { color: #e11d48; }
.menu-item-danger:hover { background: #fff1f2; color: #be123c; }
.dark .menu-item-danger, .dark .menu-item-danger i { color: #fb7185; }
.dark .menu-item-danger:hover { background: rgba(225, 29, 72, 0.12); }
.menu-sep { height: 1px; margin: 0.375rem 0; background: var(--ui-border); }
.menu-label { padding: 0.375rem 0.625rem 0.25rem; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ui-muted); }

/* ---------- Forms ---------- */
.form-label { display: block; margin-bottom: 0.375rem; font-size: 0.8125rem; font-weight: 500; color: #334155; }
.dark .form-label { color: #cbd5e1; }
.form-help { margin-top: 0.375rem; font-size: 0.75rem; color: var(--ui-muted); }
.form-input, .form-select, .form-textarea { min-height: 2.375rem; }
@media (max-width: 639px) {
    /* 16px stops iOS zooming into focused fields */
    .form-input, .form-select, .form-textarea { font-size: 1rem; }
}
.form-grid { display: grid; gap: 1rem; }
@media (min-width: 768px) {
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid .col-span-full { grid-column: 1 / -1; }
}
/* Sticky save bar at the bottom of long forms */
.form-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: 0 -4px 16px -8px rgba(15, 23, 42, 0.15);
}
.dark .form-actions { background: rgba(30, 41, 59, 0.92); }
@media (max-width: 639px) { .form-actions > .btn { flex: 1 1 0; } }

/* ---------- Tabs ---------- */
.tabs {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--ui-border);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.875rem;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ui-muted);
    white-space: nowrap;
}
.tab:hover { color: var(--ui-text); }
.tab.is-active { color: var(--ui-brand); border-color: var(--ui-brand); }
.dark .tab.is-active { color: #a5b4fc; border-color: #818cf8; }
.tab-count { padding: 0 0.375rem; border-radius: 9999px; background: #f1f5f9; font-size: 0.6875rem; color: #475569; }
.dark .tab-count { background: #334155; color: #cbd5e1; }

.chip {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.0625rem 0.5rem; border-radius: 9999px;
    background: #f1f5f9; color: #475569; font-size: 0.6875rem; font-weight: 600; white-space: nowrap;
}
.dark .chip { background: #334155; color: #cbd5e1; }

/* ---------- Empty state ---------- */
.empty-state { padding: 2.5rem 1rem; text-align: center; }
.empty-state-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 3rem; height: 3rem; margin-bottom: 0.75rem; border-radius: 9999px;
    background: #eef2ff; color: var(--ui-brand); font-size: 1.125rem;
}
.dark .empty-state-icon { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; }
.empty-state-title { font-size: 0.9375rem; font-weight: 600; color: var(--ui-text); }
.empty-state-text { margin: 0.25rem auto 0; max-width: 28rem; font-size: 0.8125rem; color: var(--ui-muted); }

/* ---------- Shell: sidebar nav ---------- */
.nav-section { padding: 1rem 0.75rem 0.375rem; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #94a3b8; }
.nav-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.5rem 0.75rem; border-radius: var(--ui-radius-sm);
    font-size: 0.8125rem; font-weight: 500; color: #475569;
    transition: background-color .15s, color .15s;
}
.nav-link i { width: 1.25rem; text-align: center; font-size: 0.8125rem; }
.nav-link:hover { background: #f1f5f9; color: #0f172a; }
.nav-link.is-active { background: #eef2ff; color: #4338ca; font-weight: 600; }
.dark .nav-link { color: #94a3b8; }
.dark .nav-link:hover { background: rgba(30, 41, 59, 0.8); color: #fff; }
.dark .nav-link.is-active { background: rgba(79, 70, 229, 0.18); color: #c7d2fe; }

/* Phone search overlay in the admin top bar */
.mobile-search-open {
    position: absolute !important;
    inset: 0;
    z-index: 40;
    display: flex !important;
    align-items: center;
    max-width: none !important;
    padding: 0 0.75rem;
    background: var(--ui-surface);
}
.mobile-search-open > div:first-child { flex: 1 1 auto; }
.mobile-search-open #global-search-dropdown { left: 0.5rem; right: 0.5rem; top: 100%; }

/* ---------- Text helpers ---------- */
.truncate-cell { display: block; max-width: 18rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-muted { color: var(--ui-muted); }
.tabular { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   List tables (.table-ui)
   Both rules follow the width of the table's card (container queries), not the
   viewport, so they account for the sidebar and for narrow cards.
   - Column priority: .col-lg / .col-xl / .col-2xl cells hide when the card is
     narrower than 720 / 940 / 1120px; put the same data in a .fold-lg / .fold-xl /
     .fold-2xl line inside the primary cell so nothing is lost.
   - Below 640px every row becomes a card: .col-check, .col-primary and
     .col-status form the top line, other cells show as "label: value" using
     data-label, and .col-actions sits at the bottom.
   ========================================================================== */
.card-body, .cq { container-type: inline-size; }
.table-ui { width: 100%; }
table.dataTable.table-ui { margin-top: 0.75rem !important; margin-bottom: 0.75rem !important; }
table.dataTable.table-ui thead th,
.table-ui thead th { padding: 0.625rem 0.75rem !important; white-space: nowrap; }
table.dataTable.table-ui tbody td,
.table-ui tbody td { padding: 0.75rem !important; vertical-align: middle; font-size: 0.8125rem !important; }
.table-ui .col-check { width: 2.5rem; text-align: center; padding-right: 0 !important; }
.table-ui .col-actions { width: 1%; text-align: right; white-space: nowrap; }
.table-ui .col-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-ui .col-nowrap { white-space: nowrap; }
.table-ui thead th.col-num { text-align: right; }
.cell-title { font-weight: 600; color: var(--ui-text); }
a.cell-title:hover, .cell-title a:hover { color: var(--ui-brand); }
.cell-link { font-weight: 600; color: var(--ui-brand); }
.cell-link:hover { text-decoration: underline; }
.dark .cell-link { color: #a5b4fc; }
.cell-sub { margin-top: 0.125rem; font-size: 0.75rem; color: var(--ui-muted); }
.cell-sub a:hover { color: var(--ui-brand); text-decoration: underline; }
.cell-danger { color: #e11d48; }
.dark .cell-danger { color: #fb7185; }
.table-ui input[type="checkbox"] { width: 1rem; height: 1rem; border-radius: 0.25rem; accent-color: var(--ui-brand); cursor: pointer; }

.table-ui .col-primary .cell-link { white-space: nowrap; }
.table-ui td.col-primary > * { max-width: 19rem; }
.fold-lg, .fold-xl, .fold-2xl { display: none; }
@container (max-width: 719.98px) {
    .table-ui .col-lg { display: none; }
    .table-ui .fold-lg { display: block; }
}
@container (max-width: 939.98px) {
    .table-ui .col-xl { display: none; }
    .table-ui .fold-xl { display: block; }
}
@container (max-width: 1119.98px) {
    .table-ui .col-2xl { display: none; }
    .table-ui .fold-2xl { display: block; }
}

.table-clickable-rows tbody tr { cursor: pointer; transition: background-color .12s; }
.table-clickable-rows tbody tr:hover { background: #f8fafc; }
.dark .table-clickable-rows tbody tr:hover { background: rgba(30, 41, 59, 0.5); }
.table-ui tbody tr.is-selected,
table.dataTable.table-ui tbody tr.is-selected { background: #eef2ff !important; }
.dark .table-ui tbody tr.is-selected,
.dark table.dataTable.table-ui tbody tr.is-selected { background: rgba(79, 70, 229, 0.14) !important; }
@container (max-width: 639.98px) {
    .table-ui tbody tr.is-selected { border-color: #a5b4fc; }
}

/* Row actions: one visible button + a "more" menu */
.row-actions { display: inline-flex; align-items: center; gap: 0.25rem; }

@container (max-width: 639.98px) {
    .table-ui .fold-lg, .table-ui .fold-xl, .table-ui .fold-2xl { display: none; }
    .table-ui thead { display: none; }
    .table-ui, .table-ui tbody { display: block; width: 100% !important; }
    table.dataTable.table-ui { border: 0 !important; }
    .table-ui tbody tr {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: start;
        gap: 0.375rem 0.75rem;
        margin-bottom: 0.625rem;
        padding: 0.875rem;
        border: 1px solid var(--ui-border);
        border-radius: var(--ui-radius);
        background: var(--ui-surface) !important;
    }
    .table-ui tbody td,
    table.dataTable.table-ui tbody td { display: block; padding: 0 !important; border: 0 !important; width: auto !important; }
    .table-ui td.col-check { grid-column: 1; grid-row: 1; width: auto; padding-top: 0.125rem !important; }
    .table-ui td.col-primary { grid-column: 2; grid-row: 1; min-width: 0; }
    .table-ui td.col-primary > * { max-width: none; }
    .table-ui tr:not(:has(.col-check)) td.col-primary { grid-column: 1 / 3; }
    .table-ui td.col-status { grid-column: 3; grid-row: 1; justify-self: end; }
    /* "Label    value" rows; a value with a sub-line stacks on the right */
    table.table-ui tbody td[data-label] {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: baseline;
        column-gap: 1rem;
        text-align: right;
    }
    table.table-ui tbody td[data-label]::before {
        content: attr(data-label);
        grid-column: 1;
        grid-row: 1;
        font-size: 0.75rem;
        font-weight: 500;
        color: var(--ui-muted);
        text-align: left;
    }
    table.table-ui tbody td[data-label] > * { grid-column: 2; justify-self: end; max-width: 100%; }
    .table-ui td[data-label] .cell-sub { margin-top: 0; }
    table.table-ui tbody td.col-actions {
        grid-column: 1 / -1;
        display: flex;
        justify-content: flex-end;
        width: auto;
        margin-top: 0.25rem;
        padding-top: 0.625rem !important;
        border-top: 1px solid var(--ui-border) !important;
    }
    table.table-ui tbody td.col-mobile-hide { display: none; }
    table.table-ui tbody td.dataTables_empty { grid-column: 1 / -1; text-align: center; padding: 1.5rem 0 !important; }
    .table-ui .truncate-cell { max-width: 100%; }
}

/* ---------- Filter pills (status filters above lists) ---------- */
.filter-pills { display: flex; gap: 0.375rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 0.125rem; }
.filter-pills::-webkit-scrollbar { display: none; }
.filter-pill {
    display: inline-flex; align-items: center; gap: 0.375rem;
    padding: 0.375rem 0.75rem; border-radius: 9999px;
    border: 1px solid var(--ui-border); background: var(--ui-surface);
    font-size: 0.8125rem; font-weight: 500; color: #475569; white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s;
}
.filter-pill:hover { border-color: #cbd5e1; color: var(--ui-text); }
.filter-pill .tab-count { background: #f1f5f9; }
.filter-pill.is-active { background: #eef2ff; border-color: #c7d2fe; color: #4338ca; font-weight: 600; }
.filter-pill.is-active .tab-count { background: #e0e7ff; color: #4338ca; }
.dark .filter-pill { color: #cbd5e1; }
.dark .filter-pill.is-active { background: rgba(79, 70, 229, 0.2); border-color: rgba(129, 140, 248, 0.45); color: #c7d2fe; }
.dark .filter-pill.is-active .tab-count { background: rgba(129, 140, 248, 0.25); color: #e0e7ff; }

/* ---------- Sticky bulk-action bar ---------- */
.bulk-bar {
    position: fixed;
    left: 50%;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    z-index: 45;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 0.75rem;
    width: max-content;
    max-width: calc(100vw - 1.5rem);
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    border-radius: 0.875rem;
    background: #0f172a;
    color: #f8fafc;
    box-shadow: 0 16px 40px -12px rgba(15, 23, 42, 0.55);
}
.dark .bulk-bar { background: #e2e8f0; color: #0f172a; }
@media (min-width: 1024px) { .bulk-bar { left: calc(50% + 8rem); max-width: calc(100vw - 18rem); } }
.bulk-bar.hidden { display: none; }
.bulk-bar-count { font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.bulk-bar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; }
.bulk-bar .btn-ghost { color: #cbd5e1; }
.bulk-bar .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.dark .bulk-bar .btn-ghost { color: #334155; }
.dark .bulk-bar .btn-ghost:hover { background: rgba(15, 23, 42, 0.08); color: #0f172a; }
.bulk-bar .btn-secondary { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.16); color: #f8fafc; box-shadow: none; }
.bulk-bar .btn-secondary:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.dark .bulk-bar .btn-secondary { background: #fff; border-color: #cbd5e1; color: #0f172a; }
.menu-up { top: auto; bottom: calc(100% + 0.5rem); }
body.has-bulk-bar main { padding-bottom: 6rem; }

/* ---------- DataTables on small screens ---------- */
@media (max-width: 639px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter { float: none; text-align: left; margin-bottom: 0.5rem; }
    .dataTables_wrapper .dataTables_filter input { margin-left: 0; width: 100%; }
    .dataTables_wrapper .dataTables_filter label { display: block; }
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate { float: none; text-align: center; }
}
