/* POS Users page clone styles for EPOS */

.manage-users-content {
    padding-top: 0.2rem;
    padding-bottom: 1.1rem;
    padding-left: 0;
    padding-right: 0;
}

.std-dt-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

.std-dt-toolbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.45rem;
    background: var(--bg-surface, #fff);
    color: var(--text-primary, #1e293b);
    padding: 0.45rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.2;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.std-dt-toolbtn:hover {
    background: var(--bg-surface-soft, #f8fafc);
    border-color: var(--border-strong, #cbd5e1);
}

.std-dt-toolbtn i {
    font-size: 1rem;
    opacity: 0.9;
}

.std-dt-toolbtn:focus-visible {
    outline: 2px solid #8351ec;
    outline-offset: 2px;
}

.std-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: inherit;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}

.std-sort-link:hover {
    color: #8351ec;
}

:root[data-theme='dark'] .std-sort-link:hover {
    color: var(--link-primary, #93c5fd);
}

.std-sort-icon--muted {
    opacity: 0.35;
}

.std-sort-icon {
    font-size: 0.65rem;
    opacity: 0.85;
}

.std-dt-col-anchor {
    position: relative;
    display: inline-block;
    vertical-align: top;
}

.std-dt-col-menu[hidden] {
    display: none !important;
}

.std-dt-col-menu:not([hidden]) {
    display: flex !important;
    flex-direction: column;
}

.std-dt-col-menu {
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 50;
    margin-top: 0.25rem;
    min-width: 13.5rem;
    max-width: min(18rem, calc(100vw - 1.5rem));
    max-height: 70vh;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0.45rem 0.35rem;
    border-radius: 0.45rem;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06) !important;
}

.std-dt-col-menu__item {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0.42rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.25;
    color: #0f172a !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0.35rem;
    cursor: pointer;
    box-shadow: none !important;
}

.std-dt-colvis__text {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

.std-dt-col-menu__sort {
    flex-shrink: 0;
    width: 1.1rem;
    text-align: center;
    font-size: 0.65rem;
    line-height: 1;
    color: #64748b;
    font-weight: 600;
    user-select: none;
}

.std-dt-col-menu__sort--muted {
    opacity: 0.55;
    font-weight: 500;
}

.std-dt-col-menu__sort--active {
    opacity: 1;
    color: #8351ec;
    font-weight: 700;
}

.std-dt-col-menu__item:hover {
    background: #f1f5f9 !important;
}

.std-dt-col-menu__item input[type='checkbox'] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
    margin: 0;
    border: 2px solid #94a3b8;
    border-radius: 0.2rem;
    background: #ffffff;
    cursor: pointer;
    position: relative;
    box-sizing: border-box;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.std-dt-col-menu__item input[type='checkbox']:hover {
    border-color: #8351ec;
}

.std-dt-col-menu__item input[type='checkbox']:checked {
    background: #8351ec;
    border-color: #8351ec;
}

.std-dt-col-menu__item input[type='checkbox']:checked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 46%;
    width: 0.22rem;
    height: 0.42rem;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
    box-sizing: border-box;
}

.std-dt-col-menu__item input[type='checkbox']:focus-visible {
    outline: 2px solid #8351ec;
    outline-offset: 2px;
}

:root[data-theme='dark'] .std-dt-col-menu {
    border-color: var(--border-strong, #334155) !important;
    background: var(--bg-elevated, #1e293b) !important;
    color: var(--text-primary, #f1f5f9) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45) !important;
}

:root[data-theme='dark'] .std-dt-col-menu__item {
    color: var(--text-primary, #f1f5f9) !important;
}

:root[data-theme='dark'] .std-dt-col-menu__item:hover {
    background: rgba(255, 255, 255, 0.06) !important;
}

:root[data-theme='dark'] .std-dt-col-menu__sort {
    color: #94a3b8;
}

:root[data-theme='dark'] .std-dt-col-menu__sort--active {
    color: var(--link-primary, #a78bfa);
}

:root[data-theme='dark'] .std-dt-col-menu__item input[type='checkbox'] {
    background: var(--bg-surface, #0f172a);
    border-color: #64748b;
}

:root[data-theme='dark'] .std-dt-col-menu__item input[type='checkbox']:checked {
    background: var(--link-primary, #8351ec);
    border-color: var(--link-primary, #8351ec);
}

.users-page {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.users-page-crumb {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
}

.users-stats {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 0.7rem;
}

.users-stat-card {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.7rem;
    background: var(--bg-surface, #ffffff);
    padding: 0.75rem 0.9rem;
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.08));
}

.users-stat-label {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
}

.users-stat-value {
    margin: 0.25rem 0 0;
    font-size: 1.28rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.users-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.users-toolbar-row {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0;
    margin: 0;
}

.users-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-end;
    align-items: center;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0;
}

.users-filters-pop {
    position: relative;
}

.users-filters-pop > summary {
    list-style: none;
    cursor: pointer;
}

.users-filters-pop > summary::-webkit-details-marker {
    display: none;
}

.users-btn--toolbar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.05rem;
    padding: 0.4rem 0.9rem;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 0.45rem;
    line-height: 1.2;
    border-width: 1px;
    border-style: solid;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.users-filters-pop > summary.users-btn--toolbar {
    appearance: none;
    -webkit-appearance: none;
    user-select: none;
}

.users-page .users-toolbar-actions .users-btn--toolbar:hover {
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
}

.users-page .users-toolbar-actions .users-btn-light.users-btn--toolbar {
    background: var(--bg-surface, #fff);
    border-color: var(--border-strong, #cbd5e1);
    color: var(--text-secondary, #475569);
}

.users-page .users-toolbar-actions .users-btn-info.users-btn--toolbar {
    background: var(--bg-surface-soft, #f8fafc);
    border-color: var(--border-strong, #cbd5e1);
    color: var(--link-primary, #4338ca);
}

.users-page .users-toolbar-actions .users-btn-primary.users-btn--toolbar {
    border-color: #334155;
    background: #1e293b;
    color: #fff;
}

:root[data-theme='dark'] .users-page .users-toolbar-actions .users-btn-light.users-btn--toolbar {
    background: var(--bg-surface-soft, #1e293b);
    border-color: var(--border-strong, #334866);
    color: var(--text-primary, #f1f5f9);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05), 0 1px 4px rgba(0, 0, 0, 0.35);
}

:root[data-theme='dark'] .users-page .users-toolbar-actions .users-btn-info.users-btn--toolbar {
    background: rgba(147, 197, 253, 0.12);
    border-color: rgba(147, 197, 253, 0.35);
    color: var(--link-primary, #93c5fd);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

:root[data-theme='dark'] .users-page .users-toolbar-actions .users-btn-primary.users-btn--toolbar {
    background: linear-gradient(180deg, #3d4f6f 0%, #1e293b 100%);
    border-color: rgba(148, 163, 184, 0.4);
    color: #f8fafc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

:root[data-theme='dark'] .users-page .users-toolbar-actions .users-btn--toolbar:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.users-btn--toolbar i {
    font-size: 0.95rem;
    opacity: 0.92;
}

.users-filter-badge {
    margin-left: 0.1rem;
    padding: 0.08rem 0.35rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(131, 81, 236, 0.15);
    color: var(--link-primary, #4338ca);
}

/* In document flow so the table/card below is never covered (was position:absolute overlay) */
.users-filters-pop-panel {
    position: static;
    top: auto;
    right: auto;
    left: auto;
    z-index: auto;
    width: 100%;
    max-width: min(calc(100vw - 2rem), 46rem);
    margin-top: 0.5rem;
    margin-left: auto;
    margin-right: 0;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.55rem;
    background: var(--bg-surface, #fff);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14);
    padding: 0.65rem 0.75rem 0.75rem;
}

/* Full-width filter row under title: actions bar wraps below main so the panel can span the content area */
.nestiko-shell-page-intro:has(.users-filters-pop) {
    overflow: visible;
}

/* Filters + Add (etc.) stay on one row; open panel drops to full-width row below (details uses display:contents) */
.nestiko-shell-page-intro__actions:has(> .users-filters-pop) {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 16rem;
    min-width: 0;
    max-width: 100%;
    width: auto;
}

.nestiko-shell-page-intro__actions:has(> .users-filters-pop) > .users-filters-pop {
    display: contents;
}

.nestiko-shell-page-intro__actions:has(> .users-filters-pop) > .users-filters-pop > summary {
    order: 1;
}

.nestiko-shell-page-intro__actions:has(> .users-filters-pop) > .users-filters-pop > .users-filters-pop-panel {
    order: 100;
    flex: 1 0 100%;
    width: 100%;
    margin-top: 0;
}

.nestiko-shell-page-intro__actions:has(> .users-filters-pop) > a,
.nestiko-shell-page-intro__actions:has(> .users-filters-pop) > button {
    order: 1;
    flex: 0 0 auto;
}

/* Same when filters live in a toolbar row (e.g. invoice schemes tab) */
.users-toolbar-actions:has(> .users-filters-pop) {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
}

.users-toolbar-actions:has(> .users-filters-pop) > .users-filters-pop {
    display: contents;
}

.users-toolbar-actions:has(> .users-filters-pop) > .users-filters-pop > summary {
    order: 1;
}

.users-toolbar-actions:has(> .users-filters-pop) > .users-filters-pop > .users-filters-pop-panel {
    order: 100;
    flex: 1 0 100%;
    width: 100%;
    margin-top: 0;
}

.users-toolbar-actions:has(> .users-filters-pop) > .users-btn,
.users-toolbar-actions:has(> .users-filters-pop) > button,
.users-toolbar-actions:has(> .users-filters-pop) > a {
    order: 1;
    flex: 0 0 auto;
}

.users-filters-pop-panel .users-search-form {
    padding-top: 0;
}

:root[data-theme='dark'] .users-filters-pop-panel {
    border-color: var(--border-strong, #334866);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

/* —— Filters UI: right-edge drawer (all pages using details.users-filters-pop) —— */
@keyframes users-filters-drawer-in {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

body.users-filters-drawer-open {
    overflow: hidden;
}

/*
 * Backdrop is mounted near the shell/content host by common.js. Keep the title row above page content but
 * below the actual drawer panel; the panel itself must sit above the shell header using shared shell tokens.
 */
body.users-filters-drawer-open header.nestiko-shell-page-intro:has(.users-filters-pop[open]) {
    position: relative;
    z-index: var(--nk-z-overlay-controls);
}

body.users-filters-drawer-open .users-toolbar-row:has(.users-filters-pop[open]) {
    position: relative;
    z-index: var(--nk-z-overlay-controls);
}

/* Real backdrop node (see common.js) — not body::before — avoids stacking/click bugs vs drawer + portaled Select2 */
#users-filters-drawer-backdrop.users-filters-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--nk-z-overlay-backdrop);
    background: rgba(15, 23, 42, 0.48);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#users-filters-drawer-backdrop.users-filters-drawer-backdrop.is-visible {
    pointer-events: auto;
    opacity: 1;
}

:root[data-theme='dark'] #users-filters-drawer-backdrop.users-filters-drawer-backdrop {
    background: rgba(0, 0, 0, 0.58);
}

/*
 * Above backdrop but below the drawer panel. This keeps the trigger row visible while the panel slides over
 * the page and prevents the buttons from painting on top of the drawer content.
 */
body.users-filters-drawer-open .nestiko-shell-page-intro__actions > .users-filters-pop > summary,
body.users-filters-drawer-open .nestiko-shell-page-intro__actions > a,
body.users-filters-drawer-open .nestiko-shell-page-intro__actions > button {
    position: relative;
    z-index: var(--nk-z-overlay-controls);
}

body.users-filters-drawer-open .users-toolbar-actions > .users-filters-pop > summary,
body.users-filters-drawer-open .users-toolbar-actions > .users-btn,
body.users-filters-drawer-open .users-toolbar-actions > a,
body.users-filters-drawer-open .users-toolbar-actions > button {
    position: relative;
    z-index: var(--nk-z-overlay-controls);
}

/*
 * Portaled UI inside the drawer must sit above the panel itself; otherwise the dim layer receives clicks.
 */
body.users-filters-drawer-open .select2-container--open {
    z-index: var(--nk-z-overlay-portaled) !important;
}

body.users-filters-drawer-open .select2-dropdown {
    z-index: var(--nk-z-overlay-portaled) !important;
}

body.users-filters-drawer-open .daterangepicker,
body.users-filters-drawer-open .bootstrap-datetimepicker-widget,
body.users-filters-drawer-open .datepicker.datepicker-dropdown {
    z-index: var(--nk-z-overlay-portaled) !important;
}

details.users-filters-pop[open] > .users-filters-pop-panel {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: min(26rem, 100vw) !important;
    max-width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    margin: 0 !important;
    margin-top: 0 !important;
    padding: calc(1.25rem + env(safe-area-inset-top, 0px)) calc(0.85rem + env(safe-area-inset-right, 0px))
        calc(1.5rem + env(safe-area-inset-bottom, 0px)) calc(0.85rem + env(safe-area-inset-left, 0px)) !important;
    border-radius: 0 !important;
    border: none !important;
    border-left: 1px solid var(--border-default, #e2e8f0) !important;
    z-index: var(--nk-z-overlay-panel) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    box-shadow: -12px 0 48px rgba(15, 23, 42, 0.18) !important;
    animation: users-filters-drawer-in 0.24s ease-out both;
}

html[dir='rtl'] details.users-filters-pop[open] > .users-filters-pop-panel {
    right: auto !important;
    left: 0 !important;
    border-left: none !important;
    border-right: 1px solid var(--border-default, #e2e8f0) !important;
    box-shadow: 12px 0 48px rgba(15, 23, 42, 0.18) !important;
    animation-name: users-filters-drawer-in-rtl;
}

@keyframes users-filters-drawer-in-rtl {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    details.users-filters-pop[open] > .users-filters-pop-panel {
        animation: none !important;
    }
}

:root[data-theme='dark'] details.users-filters-pop[open] > .users-filters-pop-panel {
    border-left-color: var(--border-strong, #334866) !important;
    box-shadow: -16px 0 56px rgba(0, 0, 0, 0.55) !important;
}

:root[data-theme='dark'] html[dir='rtl'] details.users-filters-pop[open] > .users-filters-pop-panel {
    border-right-color: var(--border-strong, #334866) !important;
    box-shadow: 16px 0 56px rgba(0, 0, 0, 0.55) !important;
}

/* Optional heading block at top of filter drawers (see contact list, etc.) */
.users-filters-drawer-intro {
    margin: 0 0 1rem;
    padding: 0 0 1rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.users-filters-drawer-intro__title {
    margin: 0 0 0.5rem;
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: var(--text-primary, #0f172a);
}

.users-filters-drawer-intro__lede {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .users-filters-drawer-intro {
    border-bottom-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .users-filters-drawer-intro__title {
    color: var(--text-primary, #f8fafc);
}

:root[data-theme='dark'] .users-filters-drawer-intro__lede {
    color: #94a3b8;
}

.purchase-return-filters-panel {
    width: min(calc(100vw - 2rem), 34rem);
    max-width: 34rem;
}

.purchases-list-filters-panel {
    width: min(calc(100vw - 2rem), 42rem);
    max-width: 42rem;
}

.sells-list-filters-panel {
    width: min(calc(100vw - 2rem), 46rem);
    max-width: 46rem;
}

.sells-list-filters-panel .select2-container {
    width: 100% !important;
}

.sells-list-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .sells-list-filter-hint {
    color: #94a3b8;
}

.expense-categories-filters-panel {
    width: min(calc(100vw - 2rem), 22rem);
    max-width: 22rem;
}

.expense-categories-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .expense-categories-filter-hint {
    color: #94a3b8;
}

.payment-accounts-filters-panel {
    width: min(calc(100vw - 2rem), 22rem);
    max-width: 22rem;
}

.payment-accounts-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .payment-accounts-filter-hint {
    color: #94a3b8;
}

.balance-sheet-filters-panel {
    width: min(calc(100vw - 2rem), 24rem);
    max-width: 24rem;
}

.balance-sheet-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .balance-sheet-filter-hint {
    color: #94a3b8;
}

.trial-balance-filters-panel {
    width: min(calc(100vw - 2rem), 24rem);
    max-width: 24rem;
}

.trial-balance-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .trial-balance-filter-hint {
    color: #94a3b8;
}

.cash-flow-filters-panel {
    width: min(calc(100vw - 2rem), 44rem);
    max-width: 44rem;
}

.cash-flow-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .cash-flow-filter-hint {
    color: #94a3b8;
}

.payment-account-report-filters-panel {
    width: min(calc(100vw - 2rem), 32rem);
    max-width: 32rem;
}

.payment-account-report-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .payment-account-report-filter-hint {
    color: #94a3b8;
}

.profit-loss-filters-panel {
    width: min(calc(100vw - 2rem), 40rem);
    max-width: 40rem;
}

.profit-loss-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .profit-loss-filter-hint {
    color: #94a3b8;
}

.purchase-sell-filters-panel {
    width: min(calc(100vw - 2rem), 36rem);
    max-width: 36rem;
}

.tax-report-filters-panel {
    width: min(calc(100vw - 2rem), 48rem);
    max-width: 48rem;
}

.tax-report-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .tax-report-filter-hint {
    color: #94a3b8;
}

.trending-products-filters-panel {
    width: min(calc(100vw - 2rem), 52rem);
    max-width: 52rem;
}

.trending-products-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .trending-products-filter-hint {
    color: #94a3b8;
}

.trending-products-filter-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.expense-report-filters-panel {
    width: min(calc(100vw - 2rem), 40rem);
    max-width: 40rem;
}

.expense-report-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .expense-report-filter-hint {
    color: #94a3b8;
}

.expense-report-filter-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.stock-adjustment-filters-panel {
    width: min(calc(100vw - 2rem), 36rem);
    max-width: 36rem;
}

.stock-adjustment-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .stock-adjustment-filter-hint {
    color: #94a3b8;
}

.register-report-filters-panel {
    width: min(calc(100vw - 2rem), 40rem);
    max-width: 40rem;
}

.register-report-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .register-report-filter-hint {
    color: #94a3b8;
}

.register-report-filter-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.sales-representative-filters-panel {
    width: min(calc(100vw - 2rem), 40rem);
    max-width: 40rem;
}

.sales-representative-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .sales-representative-filter-hint {
    color: #94a3b8;
}

.sales-representative-filter-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.stock-expiry-filters-panel {
    width: min(calc(100vw - 2rem), 52rem);
    max-width: 52rem;
}

.stock-expiry-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .stock-expiry-filter-hint {
    color: #94a3b8;
}

.stock-expiry-filter-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.customer-group-filters-panel {
    width: min(calc(100vw - 2rem), 40rem);
    max-width: 40rem;
}

.customer-group-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .customer-group-filter-hint {
    color: #94a3b8;
}

.customer-group-filter-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.product-purchase-filters-panel {
    width: min(calc(100vw - 2rem), 52rem);
    max-width: 52rem;
}

.product-purchase-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .product-purchase-filter-hint {
    color: #94a3b8;
}

.product-purchase-filter-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.product-sell-filters-panel {
    width: min(calc(100vw - 2rem), 56rem);
    max-width: 56rem;
}

.product-sell-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .product-sell-filter-hint {
    color: #94a3b8;
}

.product-sell-filter-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.lot-report-filters-panel {
    width: min(calc(100vw - 2rem), 52rem);
    max-width: 52rem;
}

.lot-report-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .lot-report-filter-hint {
    color: #94a3b8;
}

.lot-report-filter-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.items-report-filters-panel {
    width: min(calc(100vw - 2rem), 52rem);
    max-width: 52rem;
}

.items-report-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .items-report-filter-hint {
    color: #94a3b8;
}

.items-report-filter-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.purchase-payment-report-filters-panel {
    width: min(calc(100vw - 2rem), 48rem);
    max-width: 48rem;
}

.purchase-payment-report-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .purchase-payment-report-filter-hint {
    color: #94a3b8;
}

.purchase-payment-report-filter-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.sell-payment-report-filters-panel {
    width: min(calc(100vw - 2rem), 52rem);
    max-width: 52rem;
}

.sell-payment-report-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .sell-payment-report-filter-hint {
    color: #94a3b8;
}

.sell-payment-report-filter-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.restaurant-table-report-filters-panel {
    width: min(calc(100vw - 2rem), 44rem);
    max-width: 44rem;
}

.restaurant-table-report-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .restaurant-table-report-filter-hint {
    color: #94a3b8;
}

.restaurant-table-report-filter-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.gst-sales-report-filters-panel {
    width: min(calc(100vw - 2rem), 44rem);
    max-width: 44rem;
}

.gst-sales-report-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .gst-sales-report-filter-hint {
    color: #94a3b8;
}

.gst-sales-report-filter-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.gst-purchase-report-filters-panel {
    width: min(calc(100vw - 2rem), 44rem);
    max-width: 44rem;
}

.gst-purchase-report-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .gst-purchase-report-filter-hint {
    color: #94a3b8;
}

.gst-purchase-report-filter-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.service-staff-report-filters-panel {
    width: min(calc(100vw - 2rem), 48rem);
    max-width: 48rem;
}

.service-staff-report-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .service-staff-report-filter-hint {
    color: #94a3b8;
}

.service-staff-report-filter-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.purchase-sell-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .purchase-sell-filter-hint {
    color: #94a3b8;
}

.purchase-return-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

.purchase-return-filters-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.purchase-return-filter-item--wide {
    grid-column: 1 / -1;
}

.purchase-return-filters-panel .select2-container {
    width: 100% !important;
}

.purchase-return-filter-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

@media (max-width: 767px) {
    .purchase-return-filters-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .purchase-return-filter-item--wide {
        grid-column: auto;
    }
}

:root[data-theme='dark'] .purchase-return-filter-hint {
    color: #94a3b8;
}

.purchase-orders-page .purchase-orders-copy {
    margin: 0.35rem 0 0;
    max-width: 58rem;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.purchase-orders-filters-panel {
    width: min(calc(100vw - 2rem), 38rem);
    max-width: 38rem;
}

.purchase-orders-filter-hint {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

.purchase-orders-filters-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.purchase-orders-filter-item--wide {
    grid-column: 1 / -1;
}

.purchase-orders-filters-panel .select2-container {
    width: 100% !important;
}

.purchase-orders-filter-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.purchase-orders-toolbar-pill {
    white-space: nowrap;
}

.purchase-orders-panel .users-panel-head {
    padding: 0.8rem 0.95rem;
}

.purchase-orders-panel-note {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.76rem;
    line-height: 1.55;
    color: var(--text-muted, #64748b);
}

.purchase-orders-panel .users-table-controls {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.purchase-orders-table-wrap {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.94) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.purchase-orders-page .purchase-orders-dt-tools-host .dataTables_filter input {
    min-width: 12rem;
}

@media (max-width: 767px) {
    .purchase-orders-filters-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .purchase-orders-filter-item--wide {
        grid-column: auto;
    }
}

:root[data-theme='dark'] .purchase-orders-page .purchase-orders-copy,
:root[data-theme='dark'] .purchase-orders-panel-note,
:root[data-theme='dark'] .purchase-orders-filter-hint {
    color: #94a3b8;
}

:root[data-theme='dark'] .purchase-orders-table-wrap {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.82) 0%, rgba(22, 32, 51, 0.96) 100%);
}

.users-input {
    width: 100%;
    border: 1px solid var(--border-strong, #cbd5e1);
    border-radius: 0.4rem;
    background: var(--bg-surface, #fff);
    padding: 0.4rem 0.55rem;
    font-size: 0.8rem;
    color: var(--text-primary, #0f172a);
}

.users-input--compact {
    width: auto;
    padding: 0.34rem 0.5rem;
    font-size: 0.76rem;
    min-height: 2rem;
}

.users-bulk-select {
    width: 9rem;
    max-width: 38vw;
    flex-shrink: 0;
}

.users-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 1px solid var(--border-strong, #cbd5e1);
    border-radius: 0.4rem;
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--text-primary, #0f172a);
    padding: 0.4rem 0.7rem;
    font-size: 0.78rem;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    box-sizing: border-box;
    white-space: nowrap;
    vertical-align: middle;
}

.users-btn > i,
.users-btn > svg {
    flex-shrink: 0;
}

.users-btn:hover,
.users-btn:focus {
    text-decoration: none;
    color: inherit;
}

.users-btn--compact {
    padding: 0.34rem 0.55rem;
    font-size: 0.74rem;
    min-height: 2rem;
    line-height: 1.2;
}

.users-btn-primary {
    border-color: #334155;
    background: #1e293b;
    color: #fff;
}

/* Row action menus: page-level .btn-group > .dropdown-toggle rules must not paint Nestiko primary triggers white */
.dataTables_wrapper .btn-group > .dropdown-toggle.users-btn-primary {
    border-color: #334155;
    background: #1e293b;
    color: #fff;
}

.dataTables_wrapper .btn-group.open > .dropdown-toggle.users-btn-primary,
.dataTables_wrapper .btn-group > .dropdown-toggle.users-btn-primary:hover,
.dataTables_wrapper .btn-group > .dropdown-toggle.users-btn-primary:focus {
    filter: brightness(1.06);
    color: #fff;
}

:root[data-theme='dark'] .dataTables_wrapper .btn-group > .dropdown-toggle.users-btn-primary {
    background: #3730a3;
    border-color: #4f46e5;
    color: #f8fafc;
}

:root[data-theme='dark'] .dataTables_wrapper .btn-group.open > .dropdown-toggle.users-btn-primary,
:root[data-theme='dark'] .dataTables_wrapper .btn-group > .dropdown-toggle.users-btn-primary:hover,
:root[data-theme='dark'] .dataTables_wrapper .btn-group > .dropdown-toggle.users-btn-primary:focus {
    filter: brightness(1.12);
    color: #fff;
}

:root[data-theme='dark'] .dataTables_wrapper .btn-group > .dropdown-toggle.users-btn-light {
    background: rgba(30, 41, 59, 0.72);
    border-color: var(--border-strong, #334866);
    color: var(--text-primary, #e2e8f0);
}

:root[data-theme='dark'] .dataTables_wrapper .btn-group.open > .dropdown-toggle.users-btn-light,
:root[data-theme='dark'] .dataTables_wrapper .btn-group > .dropdown-toggle.users-btn-light:hover,
:root[data-theme='dark'] .dataTables_wrapper .btn-group > .dropdown-toggle.users-btn-light:focus {
    background: rgba(51, 65, 85, 0.85);
    border-color: #475569;
    color: #f1f5f9;
}

.users-btn-info {
    border-color: var(--border-strong, #cbd5e1);
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--link-primary, #4338ca);
}

.users-btn-light {
    border-color: var(--border-strong, #cbd5e1);
    background: var(--bg-surface, #fff);
    color: var(--text-secondary, #475569);
}

.users-btn--danger-outline {
    border-color: #dc2626;
    color: #b91c1c;
    background: var(--bg-surface, #fff);
}

.users-btn--danger-outline:hover,
.users-btn--danger-outline:focus {
    background: rgba(220, 38, 38, 0.08);
    border-color: #b91c1c;
    color: #991b1b;
}

:root[data-theme='dark'] .users-btn--danger-outline {
    border-color: #f87171;
    color: #fecaca;
    background: rgba(255, 255, 255, 0.04);
}

:root[data-theme='dark'] .users-btn--danger-outline:hover,
:root[data-theme='dark'] .users-btn--danger-outline:focus {
    background: rgba(248, 113, 113, 0.12);
    border-color: #fca5a5;
    color: #fff;
}

.users-panel {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.75rem;
    background: var(--bg-surface, #fff);
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.08));
    overflow: hidden;
}

.users-panel-head {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.users-panel-head p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-secondary, #475569);
    font-weight: 600;
}

.users-panel-head small {
    color: var(--text-muted, #64748b);
    font-weight: 500;
}

.users-active-filters {
    display: flex;
    gap: 0.42rem;
    flex-wrap: wrap;
}

.users-filter-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 999px;
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--link-primary, #4338ca);
    padding: 0.14rem 0.48rem;
    font-size: 0.72rem;
    font-weight: 600;
}

.users-table-controls {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem 0.55rem;
    padding: 0.42rem 0.75rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.users-table-controls__bulk {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.users-table-controls__tools {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
}

.users-table-controls__tools-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem 0.45rem;
}

.users-page .std-dt-toolbar {
    margin-bottom: 0;
    flex-wrap: nowrap;
    align-items: center;
    flex-shrink: 0;
}

.users-page .std-dt-col-anchor {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.users-length-form,
.users-quick-search {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    flex-shrink: 0;
    min-height: 2rem;
}

.users-quick-search {
    min-width: 0;
    flex-shrink: 1;
}

.users-length-label,
.users-show-label {
    margin: 0;
    font-size: 0.74rem;
    color: var(--text-muted, #64748b);
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.2;
    align-self: center;
}

.users-length-form .users-input--compact {
    width: 4rem;
    min-width: 4rem;
    max-width: 4rem;
    height: 2rem;
    min-height: 2rem;
    margin: 0;
    padding: 0.34rem 1.35rem 0.34rem 0.55rem;
    line-height: 1.2;
    box-sizing: border-box;
    align-self: center;
}

.users-quick-search .users-input--toolbar-search {
    width: 10rem;
    max-width: 12rem;
    min-width: 5.5rem;
    flex: 0 1 10rem;
    height: 2rem;
    min-height: 2rem;
    margin: 0;
    padding: 0.34rem 0.5rem;
    line-height: 1.2;
    box-sizing: border-box;
    align-self: center;
}

.users-page .std-dt-toolbtn {
    padding: 0.32rem 0.48rem;
    font-size: 0.72rem;
    border-radius: 0.35rem;
    gap: 0.28rem;
    min-height: 2rem;
    line-height: 1.2;
}

.users-page .std-dt-toolbtn i {
    font-size: 0.88rem;
}

.users-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 72rem;
}

.users-table th,
.users-table td {
    text-align: left;
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    font-size: 0.8rem;
    color: var(--text-secondary, #475569);
}

.users-table td:first-child,
.users-table th:first-child {
    width: 2.4rem;
    text-align: center;
}

.users-table td[data-col-key='actions'],
.users-table th[data-col-key='actions'],
.users-table td[data-col-key='last_login'],
.users-table th[data-col-key='last_login'],
.users-table td[data-col-key='created'],
.users-table th[data-col-key='created'] {
    white-space: nowrap;
    vertical-align: middle;
}

.users-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-muted, #64748b);
    background: var(--bg-surface-soft, #f8fafc);
    vertical-align: middle;
}

.users-table th .std-sort-link {
    color: inherit;
}

.users-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
}

.users-actions form {
    margin: 0;
    display: inline-flex;
}

.users-action-link,
.users-action-danger {
    border: 1px solid var(--border-strong, #cbd5e1);
    border-radius: 0.4rem;
    background: var(--bg-surface, #fff);
    color: var(--text-secondary, #475569);
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1.2;
}

.users-action-link:hover,
.users-action-link:focus {
    text-decoration: none;
    color: inherit;
}

.users-action-danger {
    border-color: var(--border-strong, #cbd5e1);
    color: var(--danger-text, #b91c1c);
    background: var(--danger-bg, #fee2e2);
}

.users-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.16rem 0.48rem;
    font-size: 0.72rem;
    font-weight: 600;
}

.users-badge-active {
    color: var(--success-text, #166534);
    background: var(--success-bg, #dcfce7);
}

.users-badge-inactive {
    color: var(--danger-text, #b91c1c);
    background: var(--danger-bg, #fee2e2);
}

.users-badge-neutral {
    color: var(--text-secondary, #475569);
    background: var(--bg-surface-soft, #f1f5f9);
    border: 1px solid var(--border-default, #e2e8f0);
}

/* Purchase / payment status pills (DataTables; replaces AdminLTE label bg-*) */
.users-badge.users-badge-success {
    color: var(--success-text, #166534);
    background: var(--success-bg, #dcfce7);
}

.users-badge.users-badge-danger {
    color: var(--danger-text, #b91c1c);
    background: var(--danger-bg, #fee2e2);
}

.users-badge.users-badge-warning {
    color: #b45309;
    background: #fef3c7;
    border: 1px solid #fde68a;
}

.users-badge.users-badge-info {
    color: #1e40af;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
}

a.purchase-status-link,
a.payment-status-label {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    max-width: 100%;
}

a.purchase-status-link:hover .users-badge,
a.payment-status-label:hover .users-badge,
a.payment-status:hover .users-badge {
    filter: brightness(0.96);
}

#purchase_table td .users-badge,
.purchases-page #purchase_table td .users-badge,
.contact-purchases-table-wrap #purchase_table td .users-badge {
    max-width: 100%;
    white-space: nowrap;
}

.users-empty {
    padding: 1.2rem;
    font-size: 0.86rem;
    color: var(--text-muted, #64748b);
}

.users-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.users-page-info {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
}

.users-pagination-nav {
    display: flex;
    justify-content: flex-end;
    flex: 1 1 auto;
}

.users-pagination-nav nav {
    display: flex;
    justify-content: flex-end;
}

.users-pagination .pagination {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    align-items: center;
}

.users-pagination .pagination li a,
.users-pagination .pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.35rem 0.55rem;
    border-radius: 0.35rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface, #fff);
    color: var(--text-secondary, #475569);
    font-size: 0.78rem;
    text-decoration: none;
    box-sizing: border-box;
}

.users-pagination .pagination li a:hover {
    background: var(--bg-surface-soft, #f8fafc);
}

.users-pagination .pagination li.active span {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.users-pagination .pagination li.disabled span {
    opacity: 0.45;
}

.users-table .users-select-all,
.users-table .users-row-check {
    cursor: pointer;
    width: 1rem;
    height: 1rem;
    vertical-align: middle;
}

.users-bulk-form {
    display: none;
}

.users-page .users-btn--toolbar:disabled,
.users-page .users-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.users-flash {
    border-radius: 0.55rem;
    padding: 0.7rem 0.85rem;
    font-size: 0.84rem;
}

.users-flash-success {
    background: var(--success-bg, #dcfce7);
    border: 1px solid var(--border-default, #e2e8f0);
    color: var(--success-text, #166534);
}

.users-flash-error {
    background: var(--danger-bg, #fee2e2);
    border: 1px solid var(--border-default, #e2e8f0);
    color: var(--danger-text, #b91c1c);
}

/* —— View user (profile + tabs) —— */
.users-view-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.users-view-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    letter-spacing: -0.02em;
}

.users-view-user-picker {
    flex: 1 1 14rem;
    max-width: 22rem;
    min-width: 12rem;
}

.users-view-user-picker .select2-container {
    width: 100% !important;
}

/* Flex + fixed height: avoids label riding high and chevron sitting low (Select2 default 28px + mismatched arrow). */
.users-view-user-picker .select2-container--default .select2-selection--single {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.5rem;
    min-height: 2.5rem;
    height: 2.5rem !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box;
    background: var(--bg-surface, #fff);
}

.users-view-user-picker .select2-container--default.select2-container--focus .select2-selection--single,
.users-view-user-picker .select2-container--default.select2-container--open .select2-selection--single {
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.users-view-user-picker .select2-container--default .select2-selection--single .select2-selection__rendered {
    display: flex !important;
    align-items: center !important;
    min-height: 100% !important;
    line-height: 1.25 !important;
    padding: 0 2.25rem 0 0.65rem !important;
    margin: 0 !important;
    color: var(--text-primary, #0f172a);
    font-size: 0.875rem;
    font-weight: 500;
}

.users-view-user-picker .select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 0 !important;
    right: 0.45rem !important;
    width: 1.25rem !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.users-view-user-picker .select2-container--default .select2-selection--single .select2-selection__arrow b {
    position: static !important;
    top: auto !important;
    left: auto !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    transform: none !important;
}

.users-view-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: start;
}

@media (min-width: 992px) {
    .users-view-grid {
        grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
    }
}

.users-view-profile-card {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.75rem;
    background: var(--bg-surface, #fff);
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.08));
    padding: 1.25rem 1.1rem;
    text-align: center;
}

.users-view-avatar {
    width: 6.5rem;
    height: 6.5rem;
    margin: 0 auto 0.85rem;
    border-radius: 999px;
    object-fit: cover;
    border: 3px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.users-view-profile-name {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    line-height: 1.3;
}

.users-view-profile-role {
    margin: 0 0 1rem;
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.users-view-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    text-decoration: none;
}

.users-view-edit-btn:hover,
.users-view-edit-btn:focus {
    text-decoration: none;
    color: #fff;
}

.users-view-meta {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    text-align: left;
    border-top: 1px solid var(--border-default, #e2e8f0);
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.users-view-meta li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.35rem 0.75rem;
    padding: 0.55rem 0;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.users-view-meta li:last-child {
    border-bottom: 0;
}

.users-view-meta b {
    color: var(--text-muted, #64748b);
    font-weight: 600;
}

.users-view-meta .users-view-meta-value {
    color: var(--text-primary, #0f172a);
    font-weight: 500;
    text-align: right;
    word-break: break-word;
}

.users-view-main {
    min-width: 0;
}

.users-view-tabs {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.75rem;
    background: var(--bg-surface, #fff);
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.08));
    overflow: hidden;
}

.users-view-tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.users-view-tab-nav > li {
    margin: 0;
}

.users-view-tab-nav > li > a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.users-view-tab-nav > li > a:hover,
.users-view-tab-nav > li > a:focus {
    color: var(--link-primary, #5b21b6);
    background: rgba(131, 81, 236, 0.06);
}

.users-view-tab-nav > li.active > a,
.users-view-tab-nav > li.active > a:hover,
.users-view-tab-nav > li.active > a:focus {
    color: var(--link-primary, #5b21b6);
    border-bottom-color: #8351ec;
    background: var(--bg-surface, #fff);
}

.users-view-tab-panels {
    padding: 1rem 1.1rem 1.25rem;
}

.users-view-tab-panels > .tab-pane {
    margin: 0;
}

.users-view-tab-panels p {
    margin: 0 0 0.5rem;
    font-size: 0.84rem;
    color: var(--text-secondary, #475569);
    line-height: 1.45;
}

.users-view-tab-panels p strong {
    color: var(--text-primary, #0f172a);
    font-weight: 600;
}

.users-view-details {
    padding-top: 0.35rem;
}

.users-view-details h4 {
    margin: 1rem 0 0.65rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.users-view-details h4:first-child {
    margin-top: 0;
}

.users-view-details hr {
    margin: 1rem 0;
    border: 0;
    border-top: 1px solid var(--border-default, #e2e8f0);
}

.users-page-crumb a {
    color: var(--link-primary, #5b21b6);
    text-decoration: none;
    font-weight: 600;
}

.users-page-crumb a:hover {
    text-decoration: underline;
}

/* —— Edit / add user form (widgets + fields) —— */
.users-edit-page {
    padding-top: 0.05rem;
}

.users-edit-page-heading {
    margin-bottom: 1.15rem !important;
}

.users-edit-page .box-header {
    padding: 0 0 0.65rem;
    margin: 0 0 0.85rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.users-edit-page .box-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    letter-spacing: -0.01em;
}

.users-edit-page .form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.users-edit-page .form-control {
    border-radius: 0.45rem;
    border-color: #e2e8f0;
    font-size: 0.875rem;
    box-shadow: none;
}

.users-edit-page .form-control:focus {
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.users-edit-page .input-group-addon {
    border-color: #e2e8f0;
    background: #f8fafc;
    font-size: 0.8rem;
}

.users-edit-page .help-block {
    font-size: 0.74rem;
    color: #64748b;
    margin-top: 0.35rem;
}

.users-edit-page h4 {
    margin: 0.5rem 0 0.65rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.users-edit-page .checkbox label {
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--text-secondary, #475569);
}

.users-edit-page .select2-container--default .select2-selection--single,
.users-edit-page .select2-container--default .select2-selection--multiple {
    border-radius: 0.45rem !important;
    border-color: #e2e8f0 !important;
    min-height: 2.35rem;
}

.users-edit-page .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 2.2rem;
    padding-left: 0.65rem;
    font-size: 0.875rem;
}

.users-edit-form-actions {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
}

.users-edit-submit {
    padding: 0.55rem 1.85rem !important;
    font-size: 0.88rem !important;
    border-radius: 0.5rem !important;
}

/* Edit / add user: Bootstrap rows inside widgets; label + Know More one line; checkbox + Know More aligned */
.users-edit-page .users-edit-form-row {
    margin-bottom: 0.35rem;
}

.users-edit-page .users-edit-form-row:last-of-type {
    margin-bottom: 0;
}

.users-edit-page .users-edit-label-with-help {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.55rem;
    margin-bottom: 0.4rem;
}

.users-edit-page .users-edit-label-with-help label {
    margin-bottom: 0 !important;
}

.users-edit-page .users-edit-field-stack .select2-container {
    width: 100% !important;
}

.users-edit-page .users-edit-checkbox-help-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    min-height: 2.15rem;
}

.users-edit-page .users-edit-checkbox-help-row > .checkbox {
    flex: 1 1 auto;
    min-width: 0;
    margin-top: 0;
    margin-bottom: 0;
}

.users-edit-page .users-edit-checkbox-help-row > .checkbox label {
    margin-bottom: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    line-height: 1.35;
}

.users-edit-page .users-edit-checkbox-help-row .users-help-trigger {
    margin: 0;
    flex-shrink: 0;
    align-self: center;
}

.users-edit-page .users-edit-checkbox-help-row--solo > .checkbox {
    flex: 0 1 auto;
}

.users-edit-page .users-edit-checkbox-help-row--spaced {
    margin-bottom: 0.65rem;
    justify-content: flex-start;
}

/* Keep “Know More” next to “All locations”, not pushed to the far edge */
.users-edit-page .users-edit-checkbox-help-row--spaced > .checkbox {
    flex: 0 1 auto;
}

.users-edit-page .users-edit-subsection-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    margin: 0 0 0.75rem;
}

.users-edit-page .users-edit-subsection-head h4 {
    margin: 0 !important;
}

.users-edit-page .users-edit-location-grid .checkbox {
    margin-top: 0.25rem;
    margin-bottom: 0.35rem;
}

.users-edit-page .users-edit-location-panel {
    padding-top: 0.15rem;
}

/* —— Roles add / edit form —— */
.role-form-page {
    gap: 1rem;
}

.role-form-shell {
    padding: 1.15rem 1.35rem 1.35rem;
}

.role-form-intro {
    padding-bottom: 1rem;
}

.role-form-intro-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
}

.role-form-permission-stats-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    text-align: right;
}

.role-permission-stats {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.85rem;
    padding: 0.45rem 0.9rem;
    border-radius: 0.55rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
    font-size: 0.8rem;
    line-height: 1.35;
}

.role-permission-stats__label {
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.role-permission-stats__value {
    font-variant-numeric: tabular-nums;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary, #0f172a);
}

.role-permission-stats__sep {
    color: var(--text-muted, #94a3b8);
    font-weight: 600;
    margin: 0 0.05rem;
}

@media (max-width: 991px) {
    .role-form-permission-stats-wrap {
        justify-content: flex-start;
        text-align: left;
        margin-top: 0.65rem;
    }
}

.role-form-name .form-control {
    max-width: 22rem;
}

.role-form-section-label {
    margin: 0.4rem 0 0;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.role-form-groups > hr {
    display: none;
}

.role-form-page .check_group {
    margin: 0;
    padding: 1.05rem 0 1.15rem;
}

.role-form-groups > .check_group {
    border-top: 1px solid var(--border-default, #e2e8f0);
}

.role-form-page .check_group > .col-md-1,
.role-form-page .check_group > .col-md-2,
.role-form-page .check_group > .col-md-3,
.role-form-page .check_group > .col-md-9 {
    min-height: 1px;
}

.role-form-page .check_group h4 {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    text-transform: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    line-height: 1.2;
}

.role-form-page .check_group .checkbox {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.role-form-page .check_group .checkbox + .checkbox {
    margin-top: 0.7rem;
}

.role-form-page .check_group .checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    line-height: 1.38;
    margin: 0;
}

.role-form-page .check_group h4 .users-help-trigger,
.role-form-page .check_group .checkbox .users-help-trigger {
    margin-left: 0;
}

.role-form-page input.input-icheck[type='checkbox'],
.role-form-page input.input-icheck[type='radio'],
.role-form-page .icheckbox_square-blue,
.role-form-page .iradio_square-blue {
    width: 1.05rem;
    height: 1.05rem;
    min-width: 1.05rem;
    border: 1px solid rgba(148, 163, 184, 0.72) !important;
    background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
    background-image: none !important;
    border-radius: 0.3rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(15, 23, 42, 0.04);
    margin-right: 0 !important;
    position: relative;
    flex: 0 0 auto;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.role-form-page input.input-icheck[type='radio'],
.role-form-page .iradio_square-blue {
    border-radius: 0.3rem;
}

.role-form-page input.input-icheck[type='checkbox']:hover,
.role-form-page input.input-icheck[type='radio']:hover,
.role-form-page input.input-icheck[type='checkbox']:focus,
.role-form-page input.input-icheck[type='radio']:focus,
.role-form-page .icheckbox_square-blue:hover,
.role-form-page .icheckbox_square-blue.hover,
.role-form-page .iradio_square-blue:hover,
.role-form-page .iradio_square-blue.hover {
    border-color: rgba(124, 58, 237, 0.55) !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08);
}

.role-form-page input.input-icheck[type='checkbox']::after,
.role-form-page input.input-icheck[type='radio']::after,
.role-form-page .icheckbox_square-blue::after,
.role-form-page .iradio_square-blue::after {
    content: '';
    position: absolute;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.role-form-page input.input-icheck[type='checkbox']::after,
.role-form-page .icheckbox_square-blue::after {
    left: 0.31rem;
    top: 0.08rem;
    width: 0.27rem;
    height: 0.54rem;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0.75);
}

.role-form-page input.input-icheck[type='radio']::after,
.role-form-page .iradio_square-blue::after {
    left: 50%;
    top: 50%;
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 0.1rem;
    background: #ffffff;
    transform: translate(-50%, -50%) scale(0.42);
}

.role-form-page input.input-icheck[type='checkbox']:checked,
.role-form-page input.input-icheck[type='radio']:checked,
.role-form-page .icheckbox_square-blue.checked,
.role-form-page .iradio_square-blue.checked {
    background: linear-gradient(180deg, #8b5cf6, #6d28d9) !important;
    border-color: #7c3aed !important;
    box-shadow: 0 6px 14px rgba(124, 58, 237, 0.18);
}

.role-form-page input.input-icheck[type='checkbox']:checked::after,
.role-form-page input.input-icheck[type='radio']:checked::after,
.role-form-page .icheckbox_square-blue.checked::after,
.role-form-page .iradio_square-blue.checked::after {
    opacity: 1;
}

.role-form-page input.input-icheck[type='checkbox']:checked::after,
.role-form-page .icheckbox_square-blue.checked::after {
    transform: rotate(45deg) scale(1);
}

.role-form-page input.input-icheck[type='radio']:checked::after,
.role-form-page .iradio_square-blue.checked::after {
    transform: translate(-50%, -50%) scale(1);
}

.role-form-page input.input-icheck:disabled,
.role-form-page .icheckbox_square-blue.disabled,
.role-form-page .iradio_square-blue.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.role-form-page .check_group .col-md-2 .checkbox {
    margin-top: 0.15rem;
}

.role-form-page .check_group .radio-group {
    margin-bottom: 0.75rem;
}

.role-form-page .check_group .col-md-9 > .col-md-12,
.role-form-page .check_group .radio-group > .col-md-12 {
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 0.75rem;
}

.role-form-page .check_group .col-md-9 > .col-md-12:last-child,
.role-form-page .check_group .radio-group > .col-md-12:last-child {
    margin-bottom: 0;
}

.role-form-page .check_group .col-md-9 > .col-md-12 > hr,
.role-form-page .check_group .radio-group > .col-md-12 > hr {
    margin: 0.9rem 0 0.2rem;
    border-color: rgba(148, 163, 184, 0.32);
}

.role-form-actions {
    margin-top: 0.75rem;
}

.role-form-actions .col-md-12 {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 991px) {
    .role-form-shell {
        padding: 1rem;
    }

    .role-form-name .form-control {
        max-width: 100%;
    }

    .role-form-page .check_group > [class*='col-md-'] + [class*='col-md-'] {
        margin-top: 0.8rem;
    }

    .role-form-actions .col-md-12 {
        justify-content: stretch;
    }

    .role-form-actions .users-btn {
        width: 100%;
    }
}

/* —— Roles list (server-side DataTables) —— */
.roles-page {
    padding-top: 0.15rem;
}

.roles-panel-head p {
    font-size: 1.02rem !important;
    font-weight: 700 !important;
    color: var(--text-primary, #0f172a) !important;
}

.roles-panel-head p small {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.76rem !important;
    font-weight: 500 !important;
    color: var(--text-muted, #64748b) !important;
    text-transform: none;
    letter-spacing: normal;
}

.roles-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

:is(.roles-page, .users-page) .roles-dt-tools-host {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem 0.45rem;
    min-width: 0;
    flex: 1 1 auto;
}

:is(.roles-page, .users-page) .std-dt-toolbar {
    margin-bottom: 0;
    flex-wrap: nowrap;
    align-items: center;
    flex-shrink: 0;
}

:is(.roles-page, .users-page) .std-dt-col-anchor {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

:is(.roles-page, .users-page) .std-dt-toolbtn {
    min-height: 2rem;
    padding: 0.34rem 0.5rem;
    line-height: 1.2;
}

:is(.roles-page, .users-page) .roles-dt-tools-host .dataTables_length,
:is(.roles-page, .users-page) .roles-dt-tools-host .dataTables_filter {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    flex: 0 0 auto;
}

/* Keep "Show [n] entries" on one line: length menu must not shrink in the flex toolbar. */
:is(.roles-page, .users-page) .roles-dt-tools-host .dataTables_length {
    flex: 0 0 auto;
    flex-shrink: 0;
}

:is(.roles-page, .users-page) .roles-dt-tools-host .dataTables_length label {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.35rem;
    margin: 0;
    min-height: 2rem;
    line-height: 1.2;
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
}

:is(.roles-page, .users-page) .roles-dt-tools-host .dataTables_length select {
    width: 4rem !important;
    min-width: 4rem;
    max-width: 4rem;
    height: 2rem;
    min-height: 2rem;
    flex: 0 0 auto;
    display: inline-block;
    vertical-align: middle;
    align-self: center;
    margin: 0 !important;
    padding: 0.34rem 1.35rem 0.34rem 0.55rem;
    line-height: 1.2;
    box-sizing: border-box;
}

:is(.roles-page, .users-page) .roles-dt-tools-host .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    min-height: 2rem;
    line-height: 1.2;
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
}

:is(.roles-page, .users-page) .roles-dt-tools-host .dataTables_filter input {
    width: 10rem !important;
    max-width: 12rem;
    min-width: 5.5rem;
    height: 2rem;
    min-height: 2rem;
    margin: 0 !important;
    padding: 0.34rem 0.5rem;
    line-height: 1.2;
    box-sizing: border-box;
    align-self: center;
}

.roles-page table#roles_table.dataTable,
.roles-page table.roles-data-table.dataTable {
    width: 100% !important;
    min-width: 52rem !important;
    margin: 0 !important;
    border-collapse: collapse !important;
}

/* Business locations list: many columns; keep name on one line (horizontal scroll in .table-responsive). */
.business-locations-page table#business_location_table.dataTable {
    width: 100% !important;
    min-width: 76rem !important;
    margin: 0 !important;
    border-collapse: collapse !important;
}

.business-locations-page table#business_location_table.dataTable thead th[data-col-key="name"],
.business-locations-page table#business_location_table.dataTable tbody td.business-locations-col-name {
    min-width: 18rem;
    white-space: nowrap;
}

.business-locations-page .business-location-name-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
    max-width: 100%;
}

.business-locations-page .business-location-name-text {
    min-width: 0;
}

.business-locations-page .business-location-level-badge {
    flex-shrink: 0;
}

/* Level column: distinct badge hues for Level-1 … Level-10 */
.business-locations-page table#business_location_table.dataTable thead th[data-col-key="location_level"],
.business-locations-page table#business_location_table.dataTable tbody td.business-locations-col-level {
    min-width: 5.5rem;
    text-align: center;
    white-space: nowrap;
}

.business-locations-page .business-location-level-empty {
    color: var(--text-muted, #94a3b8);
    font-size: 0.85rem;
}

.business-locations-page .business-location-level-col-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.45rem;
    border: 1px solid transparent;
}

.business-locations-page .business-location-level-col-badge--1 {
    background: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}

.business-locations-page .business-location-level-col-badge--2 {
    background: #d1fae5;
    color: #047857;
    border-color: #6ee7b7;
}

.business-locations-page .business-location-level-col-badge--3 {
    background: #fef3c7;
    color: #b45309;
    border-color: #fcd34d;
}

.business-locations-page .business-location-level-col-badge--4 {
    background: #ede9fe;
    color: #5b21b6;
    border-color: #c4b5fd;
}

.business-locations-page .business-location-level-col-badge--5 {
    background: #fce7f3;
    color: #9d174d;
    border-color: #f9a8d4;
}

.business-locations-page .business-location-level-col-badge--6 {
    background: #cffafe;
    color: #0e7490;
    border-color: #67e8f9;
}

.business-locations-page .business-location-level-col-badge--7 {
    background: #e0e7ff;
    color: #3730a3;
    border-color: #a5b4fc;
}

.business-locations-page .business-location-level-col-badge--8 {
    background: #ffedd5;
    color: #c2410c;
    border-color: #fdba74;
}

.business-locations-page .business-location-level-col-badge--9 {
    background: #ecfccb;
    color: #3f6212;
    border-color: #bef264;
}

.business-locations-page .business-location-level-col-badge--10 {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

:root[data-theme='dark'] .business-locations-page .business-location-level-col-badge--1 {
    background: rgba(59, 130, 246, 0.22);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.45);
}

:root[data-theme='dark'] .business-locations-page .business-location-level-col-badge--2 {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.4);
}

:root[data-theme='dark'] .business-locations-page .business-location-level-col-badge--3 {
    background: rgba(245, 158, 11, 0.22);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.45);
}

:root[data-theme='dark'] .business-locations-page .business-location-level-col-badge--4 {
    background: rgba(139, 92, 246, 0.22);
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.45);
}

:root[data-theme='dark'] .business-locations-page .business-location-level-col-badge--5 {
    background: rgba(236, 72, 153, 0.2);
    color: #f9a8d4;
    border-color: rgba(236, 72, 153, 0.4);
}

:root[data-theme='dark'] .business-locations-page .business-location-level-col-badge--6 {
    background: rgba(6, 182, 212, 0.2);
    color: #67e8f9;
    border-color: rgba(6, 182, 212, 0.4);
}

:root[data-theme='dark'] .business-locations-page .business-location-level-col-badge--7 {
    background: rgba(99, 102, 241, 0.22);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.45);
}

:root[data-theme='dark'] .business-locations-page .business-location-level-col-badge--8 {
    background: rgba(249, 115, 22, 0.2);
    color: #fdba74;
    border-color: rgba(249, 115, 22, 0.4);
}

:root[data-theme='dark'] .business-locations-page .business-location-level-col-badge--9 {
    background: rgba(132, 204, 22, 0.2);
    color: #bef264;
    border-color: rgba(132, 204, 22, 0.35);
}

:root[data-theme='dark'] .business-locations-page .business-location-level-col-badge--10 {
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.35);
}

/* Organization tree: territory → cluster → level (nested details) */
.business-locations-page .business-locations-org-tree-wrap {
    margin-bottom: 1rem;
}

.business-locations-page .bl-org-tree {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.65rem;
    background: var(--bg-surface, #fff);
    overflow: hidden;
}

.business-locations-page .bl-org-tree-panel-hint {
    margin: 0;
    padding: 0.55rem 0.85rem;
    font-size: 0.78rem;
    background: var(--bg-surface-soft, #f8fafc);
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.business-locations-page #bl-org-tree-toggle.bl-org-tree-toggle--open {
    border-color: var(--accent-primary, #6366f1);
    color: var(--accent-primary, #6366f1);
    background: #eef2ff;
}

:root[data-theme='dark'] .business-locations-page #bl-org-tree-toggle.bl-org-tree-toggle--open {
    background: rgba(99, 102, 241, 0.15);
}

.business-locations-page .bl-org-tree-body {
    padding: 0.5rem 0.65rem 0.75rem;
    max-height: min(28rem, 55vh);
    overflow: auto;
}

.business-locations-page .bl-org-tree-node {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.45rem;
    margin: 0.4rem 0 0;
    background: var(--bg-surface, #fff);
}

.business-locations-page .bl-org-tree-node > .bl-org-tree-node-summary {
    list-style: none;
    cursor: pointer;
    padding: 0.45rem 0.55rem;
    font-size: 0.84rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.45rem;
}

.business-locations-page .bl-org-tree-node > .bl-org-tree-node-summary::-webkit-details-marker {
    display: none;
}

.business-locations-page .bl-org-tree-node > .bl-org-tree-node-summary::before {
    content: '';
    display: inline-block;
    width: 0.35rem;
    height: 0.35rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    opacity: 0.55;
    flex-shrink: 0;
    transition: transform 0.12s ease;
}

.business-locations-page .bl-org-tree-node[open] > .bl-org-tree-node-summary::before {
    transform: rotate(45deg);
}

.business-locations-page .bl-org-tree-territory {
    margin-top: 0.35rem;
    border-left: 3px solid var(--accent-primary, #6366f1);
}

.business-locations-page .bl-org-tree-cluster {
    margin-left: 0.35rem;
    border-left: 3px solid var(--text-muted, #64748b);
}

.business-locations-page .bl-org-tree-unclustered {
    margin-left: 0.35rem;
    border-left: 3px dashed var(--border-default, #cbd5e1);
}

.business-locations-page .bl-org-tree-unassigned {
    margin-top: 0.65rem;
    border-left: 3px solid var(--color-warning, #f59e0b);
}

.business-locations-page .bl-org-tree-nested {
    padding: 0 0.35rem 0.45rem 0.65rem;
}

.business-locations-page .bl-org-tree-nested--levels {
    padding-left: 0.5rem;
}

.business-locations-page .bl-org-tree-level {
    margin-top: 0.35rem;
    background: var(--bg-surface-soft, #f8fafc);
}

.business-locations-page .bl-org-tree-node-summary--level {
    font-weight: 500;
}

.business-locations-page .bl-org-tree-chevron {
    font-size: 0.95rem;
    opacity: 0.7;
    flex-shrink: 0;
}

.business-locations-page .bl-org-tree-label {
    font-weight: 600;
}

.business-locations-page .bl-org-tree-meta {
    font-size: 0.76rem;
    font-family: ui-monospace, monospace;
    color: var(--text-muted, #64748b);
}

.business-locations-page .bl-org-tree-tag {
    font-size: 0.72rem;
    margin-left: auto;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.business-locations-page .bl-org-tree-level-pill {
    font-size: 0.68rem;
    padding: 0.12rem 0.4rem;
    margin-left: auto;
}

.business-locations-page .bl-org-tree-locations {
    list-style: none;
    margin: 0;
    padding: 0.15rem 0.35rem 0.45rem 1.5rem;
}

.business-locations-page .bl-org-tree-loc {
    font-size: 0.8rem;
    padding: 0.2rem 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.5rem;
    border-bottom: 1px dashed var(--border-default, #e2e8f0);
}

.business-locations-page .bl-org-tree-loc:last-child {
    border-bottom: none;
}

.business-locations-page .bl-org-tree-loc-name {
    font-weight: 500;
}

.business-locations-page .bl-org-tree-loc-city {
    font-size: 0.76rem;
}

.business-locations-page .bl-org-tree-empty {
    margin: 0.25rem 0 0.35rem;
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
}

.business-locations-page .bl-org-tree-empty--root {
    padding: 0.5rem 0.25rem;
}

:is(.roles-panel, .users-panel) .dataTables_wrapper {
    padding: 0;
}

:is(.roles-panel, .users-panel) .dataTables_wrapper > .dataTables_length,
:is(.roles-panel, .users-panel) .dataTables_wrapper > .dataTables_filter {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

:is(.roles-panel, .users-panel) .dataTables_wrapper .row {
    margin-left: 0;
    margin-right: 0;
    padding: 0.45rem 0.65rem;
    align-items: center;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

:is(.roles-panel, .users-panel) .dataTables_length,
:is(.roles-panel, .users-panel) .dataTables_filter {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
}

:is(.roles-panel, .users-panel) .dataTables_length select,
:is(.roles-panel, .users-panel) .dataTables_filter input {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.45rem;
    padding: 0.28rem 0.45rem;
    font-size: 0.8rem;
    background: var(--bg-surface, #fff);
    min-height: 2rem;
}

/* Roles grid uses `.users-table` + DataTables: match Users list / old POS header chrome. */
.roles-panel table.users-table.dataTable thead th {
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-muted, #64748b);
    font-weight: 700;
    background: var(--bg-surface-soft, #f8fafc);
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    padding: 0.55rem 0.65rem;
    vertical-align: middle;
    box-shadow: none;
    white-space: nowrap;
    word-break: keep-all;
}

.roles-panel table#roles_table.users-table.dataTable thead th:first-child {
    width: 2.4rem;
    text-align: center;
}

.roles-panel table.users-table.dataTable thead th .std-sort-link {
    color: inherit;
    white-space: nowrap;
}

/*
 * AdminLTE `datatables.css` adds padding-right + glyphicon `::after` on sortable headers.
 * Reset for Roles and use inline glyphs like Users `std-sort-icon`.
 */
.roles-panel table.users-table.dataTable thead > tr > th.sorting,
.roles-panel table.users-table.dataTable thead > tr > th.sorting_asc,
.roles-panel table.users-table.dataTable thead > tr > th.sorting_desc {
    background-image: none !important;
    cursor: pointer;
    padding-right: 0.65rem !important;
}

.roles-panel table.users-table.dataTable thead th.sorting_disabled,
.roles-panel table.users-table.dataTable thead th.no-sort {
    cursor: default;
    padding-right: 0.65rem !important;
}

.roles-panel table.users-table.dataTable thead th.sorting:before,
.roles-panel table.users-table.dataTable thead th.sorting_asc:before,
.roles-panel table.users-table.dataTable thead th.sorting_desc:before,
.roles-panel table.users-table.dataTable thead th.sorting_disabled:before,
.roles-panel table.users-table.dataTable thead th.sorting_asc_disabled:before,
.roles-panel table.users-table.dataTable thead th.sorting_desc_disabled:before {
    display: none !important;
    content: none !important;
}

.roles-panel table.users-table.dataTable thead > tr > th.sorting:after,
.roles-panel table.users-table.dataTable thead > tr > th.sorting_asc:after,
.roles-panel table.users-table.dataTable thead > tr > th.sorting_desc:after {
    position: static !important;
    display: inline-block !important;
    bottom: auto !important;
    right: auto !important;
    margin-left: 0.28rem;
    font-family: inherit !important;
    font-size: 0.65rem;
    line-height: 1;
    vertical-align: 0.05em;
    font-weight: 700;
    opacity: 1;
}

.roles-panel table.users-table.dataTable thead > tr > th.sorting:after {
    content: '↕' !important;
    opacity: 0.35;
}

.roles-panel table.users-table.dataTable thead > tr > th.sorting_asc:after {
    content: '▲' !important;
    opacity: 0.85;
}

.roles-panel table.users-table.dataTable thead > tr > th.sorting_desc:after {
    content: '▼' !important;
    opacity: 0.85;
}

.roles-panel table.users-table.dataTable thead > tr > th.sorting_disabled:after,
.roles-panel table.users-table.dataTable thead > tr > th.sorting_asc_disabled:after,
.roles-panel table.users-table.dataTable thead > tr > th.sorting_desc_disabled:after {
    content: none !important;
    display: none !important;
}

.roles-panel table.users-table.dataTable tbody td {
    text-align: left;
    font-size: 0.8rem;
    color: var(--text-secondary, #475569);
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    vertical-align: middle;
}

.roles-panel table#roles_table.users-table.dataTable tbody td:first-child {
    width: 2.4rem;
    text-align: center;
}

/* Territories & clusters: first columns are text (name / territory), not the Roles checkbox column. */
.territories-page .roles-panel #territories_table.users-table.dataTable thead th:first-child,
.territories-page .roles-panel #territories_table.users-table.dataTable tbody td:first-child {
    width: auto;
    min-width: 13rem;
    max-width: 55%;
    text-align: left;
    white-space: nowrap;
}

.location-clusters-page .roles-panel #location_clusters_table.users-table.dataTable thead th:nth-child(1),
.location-clusters-page .roles-panel #location_clusters_table.users-table.dataTable tbody td:nth-child(1),
.location-clusters-page .roles-panel #location_clusters_table.users-table.dataTable thead th:nth-child(2),
.location-clusters-page .roles-panel #location_clusters_table.users-table.dataTable tbody td:nth-child(2) {
    width: auto;
    min-width: 12rem;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.roles-panel table.users-table.dataTable tbody tr:hover td {
    background: #fafafa;
}

/* Roles DataTables footer: same pattern as Users `.users-pagination` (info left, pager right, chunky buttons). */
:is(.roles-panel, .users-panel) .roles-dt-bottom {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

:is(.roles-panel, .users-panel) .roles-dt-bottom .dataTables_info {
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

:is(.roles-panel, .users-panel) .roles-dt-bottom .dataTables_paginate {
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    text-align: right;
    flex: 0 0 auto;
    white-space: nowrap;
}

:is(.roles-panel, .users-panel) .roles-dt-bottom .dataTables_paginate .pagination {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

:is(.roles-panel, .users-panel) .roles-dt-bottom .dataTables_paginate .pagination li {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    display: inline-flex;
    align-items: stretch;
}

:is(.roles-panel, .users-panel) .roles-dt-bottom .dataTables_paginate .pagination li a,
:is(.roles-panel, .users-panel) .roles-dt-bottom .dataTables_paginate .pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0.35rem 0.55rem;
    border-radius: 0.35rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface, #fff);
    color: var(--text-secondary, #475569);
    font-size: 0.78rem;
    text-decoration: none;
    box-sizing: border-box;
    line-height: 1.2;
}

:is(.roles-panel, .users-panel) .roles-dt-bottom .dataTables_paginate .pagination li a:hover {
    background: var(--bg-surface-soft, #f8fafc);
}

:is(.roles-panel, .users-panel) .roles-dt-bottom .dataTables_paginate li.paginate_button.current a,
:is(.roles-panel, .users-panel) .roles-dt-bottom .dataTables_paginate li.paginate_button.current span,
:is(.roles-panel, .users-panel) .roles-dt-bottom .dataTables_paginate li.paginate_button.active a,
:is(.roles-panel, .users-panel) .roles-dt-bottom .dataTables_paginate li.paginate_button.active span {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

:is(.roles-panel, .users-panel) .roles-dt-bottom .dataTables_paginate li.paginate_button.disabled a,
:is(.roles-panel, .users-panel) .roles-dt-bottom .dataTables_paginate li.paginate_button.disabled span {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

/* —— Contacts list (customers / suppliers) —— */
.contacts-filters-panel {
    min-width: min(46rem, calc(100vw - 2rem));
}

.contacts-filter-hint {
    margin: 0 0 0.85rem;
    font-size: 0.74rem;
    line-height: 1.45;
    color: var(--text-muted, #64748b);
}

.contacts-filter-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 0.75rem 0.85rem;
}

.contacts-filter-item label {
    display: block;
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.contacts-filter-item .checkbox {
    margin: 0;
    padding-left: 0;
}

/*
 * Bootstrap (.checkbox label) uses padding-left: 20px for a native checkbox pulled in with margin-left: -20px.
 * iCheck replaces the control with .icheckbox_square-blue, so that padding becomes empty space on the left.
 */
.contacts-filter-item .checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding-left: 0 !important;
    min-height: 0;
}

.contacts-filter-item .checkbox input.input-icheck[type='checkbox'] {
    margin-left: 0 !important;
}

html[dir='rtl'] .contacts-filter-item .checkbox input.input-icheck[type='checkbox'] {
    margin-right: 0 !important;
}

/* iCheck already sits beside text; flex gap supplies spacing—drop duplicate margin-right from app.css */
.contacts-filter-item .checkbox label .icheckbox_square-blue,
.contacts-filter-item .checkbox label .iradio_square-blue {
    flex-shrink: 0;
    margin-right: 0 !important;
}

html[dir='rtl'] .contacts-filter-item .checkbox label .icheckbox_square-blue,
html[dir='rtl'] .contacts-filter-item .checkbox label .iradio_square-blue {
    margin-left: 0 !important;
}

/* rtl.css adds padding-right: 20px on .checkbox label */
html[dir='rtl'] .contacts-filter-item .checkbox label {
    padding-right: 0 !important;
    padding-left: 0 !important;
}

:root[data-theme='dark'] .users-filters-pop-panel .icheckbox_square-blue,
:root[data-theme='dark'] .users-filters-pop-panel .iradio_square-blue {
    background-image: none !important;
    border: 2px solid rgba(241, 245, 249, 0.58) !important;
    background: linear-gradient(180deg, #556883, #3d4d66) !important;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 2px 8px rgba(0, 0, 0, 0.4);
}

:root[data-theme='dark'] .users-filters-pop-panel .icheckbox_square-blue.hover,
:root[data-theme='dark'] .users-filters-pop-panel .icheckbox_square-blue:hover,
:root[data-theme='dark'] .users-filters-pop-panel .iradio_square-blue.hover,
:root[data-theme='dark'] .users-filters-pop-panel .iradio_square-blue:hover {
    border-color: rgba(196, 181, 253, 0.95) !important;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.12),
        0 0 0 3px rgba(167, 139, 250, 0.2),
        0 2px 10px rgba(0, 0, 0, 0.42);
}

:root[data-theme='dark'] .users-filters-pop-panel .icheckbox_square-blue.checked,
:root[data-theme='dark'] .users-filters-pop-panel .iradio_square-blue.checked {
    background: linear-gradient(180deg, #8b5cf6, #6d28d9) !important;
    border-color: #c4b5fd !important;
    box-shadow:
        0 0 0 1px rgba(196, 181, 253, 0.22),
        0 8px 18px rgba(109, 40, 217, 0.32);
}

.contacts-filter-item .form-control,
.contacts-filter-item .select2-container--default .select2-selection--single {
    min-height: 2.2rem;
    border-radius: 0.45rem !important;
    border-color: var(--border-default, #e2e8f0) !important;
    box-shadow: none !important;
}

.contacts-filter-item .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 2.1rem;
    padding-left: 0.65rem;
    font-size: 0.84rem;
}

.contacts-filter-item .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 2.1rem;
}

.contacts-filter-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.85rem;
}

.contacts-page .contacts-dt-tools-host {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem 0.45rem;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
}

.contacts-page .contacts-native-tools,
.contacts-page .dt-buttons {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    flex-wrap: nowrap;
    flex-shrink: 0;
    float: none !important;
    width: auto;
}

.contacts-page .contacts-native-tools > .dt-button,
.contacts-page .contacts-native-tools > a.dt-button,
.contacts-page .contacts-native-tools > button.dt-button,
.contacts-page .dt-buttons .dt-button,
.contacts-page .dt-buttons a.dt-button,
.contacts-page .dt-buttons button.dt-button,
.contacts-page .contacts-dt-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.32rem 0.48rem;
    border: 1px solid var(--border-default, #e2e8f0) !important;
    border-radius: 0.35rem !important;
    background: var(--bg-surface, #fff) !important;
    color: var(--text-primary, #1e293b) !important;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: none !important;
    text-decoration: none !important;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    float: none !important;
    margin: 0 !important;
    white-space: nowrap;
}

.contacts-page .contacts-native-tools > .dt-button i,
.contacts-page .contacts-native-tools > a.dt-button i,
.contacts-page .contacts-native-tools > button.dt-button i,
.contacts-page .dt-buttons .dt-button i,
.contacts-page .dt-buttons a.dt-button i,
.contacts-page .dt-buttons button.dt-button i,
.contacts-page .contacts-dt-button i {
    margin-right: 0.32rem;
}

.contacts-page .contacts-native-tools > .dt-button:hover,
.contacts-page .contacts-native-tools > .dt-button:focus,
.contacts-page .dt-buttons .dt-button:hover,
.contacts-page .dt-buttons .dt-button:focus,
.contacts-page .contacts-dt-button:hover,
.contacts-page .contacts-dt-button:focus {
    background: var(--bg-surface-soft, #f8fafc) !important;
    border-color: var(--border-strong, #cbd5e1) !important;
    color: inherit !important;
}

.contacts-page .contacts-native-tools > .dt-button.active,
.contacts-page .dt-buttons .dt-button.active,
.contacts-page .contacts-dt-button.active {
    background: var(--bg-surface-soft, #f8fafc) !important;
}

.contacts-page .contacts-native-tools > .dt-button:not(:first-child):not(:last-child),
.contacts-page .contacts-native-tools > .dt-button:first-child:not(:last-child),
.contacts-page .contacts-native-tools > .dt-button:last-child:not(:first-child),
.contacts-page .dt-buttons.btn-group > .dt-button:not(:first-child):not(:last-child),
.contacts-page .dt-buttons.btn-group > .dt-button:first-child:not(:last-child),
.contacts-page .dt-buttons.btn-group > .dt-button:last-child:not(:first-child) {
    border-radius: 0.35rem !important;
}

.contacts-page .contacts-native-tools > .dt-button + .dt-button,
.contacts-page .dt-buttons.btn-group > .dt-button + .dt-button {
    margin-left: 0 !important;
}

.contacts-page table#contact_table.dataTable,
.contacts-page table.contacts-data-table.dataTable {
    width: 100% !important;
    min-width: 104rem !important;
    margin: 0 !important;
    border-collapse: collapse !important;
}

.contacts-page .roles-panel table.users-table.dataTable thead th:first-child,
.contacts-page .roles-panel table.users-table.dataTable tbody td:first-child {
    width: auto;
    min-width: 7rem;
    text-align: left;
}

.contacts-page .roles-panel table.users-table.dataTable tbody td {
    white-space: nowrap;
}

.contacts-page .roles-panel .dataTables_scrollHead,
.contacts-page .roles-panel .dataTables_scrollBody {
    border: 0;
}

.contacts-page .roles-panel .dataTables_scrollHead table.dataTable {
    margin-top: 0 !important;
}

.contacts-page .users-table-controls__bulk {
    min-width: 0;
    flex: 0 0 auto;
}

.contacts-page .contacts-grid-actions.btn-group {
    display: inline-block;
    vertical-align: middle;
}

.contacts-page .contacts-grid-actions > .dropdown-toggle:not(.users-btn-primary):not(.users-btn-light),
.contacts-page .btn-group > .dropdown-toggle:not(.users-btn-primary):not(.users-btn-light) {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2rem;
    padding: 0.32rem 0.5rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.4rem;
    background: var(--bg-surface, #fff);
    color: var(--text-secondary, #475569);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: none;
}

.contacts-page .contacts-grid-actions > .dropdown-toggle .caret {
    margin-left: 0.12rem;
}

.contacts-page .contacts-grid-actions.btn-group.open > .dropdown-toggle:not(.users-btn-primary):not(.users-btn-light),
.contacts-page .btn-group.open > .dropdown-toggle:not(.users-btn-primary):not(.users-btn-light),
.contacts-page .contacts-grid-actions > .dropdown-toggle:not(.users-btn-primary):not(.users-btn-light):hover,
.contacts-page .contacts-grid-actions > .dropdown-toggle:not(.users-btn-primary):not(.users-btn-light):focus,
.contacts-page .btn-group > .dropdown-toggle:not(.users-btn-primary):not(.users-btn-light):hover,
.contacts-page .btn-group > .dropdown-toggle:not(.users-btn-primary):not(.users-btn-light):focus {
    background: var(--bg-surface-soft, #f8fafc);
    border-color: var(--border-strong, #cbd5e1);
    color: inherit;
}

.contacts-page .contacts-action-menu,
.contacts-page .dropdown-menu {
    border-radius: 0.55rem;
    border-color: var(--border-default, #e2e8f0);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
    padding: 0.25rem 0;
    min-width: 12rem;
    overflow: hidden;
}

.contacts-page .contacts-action-menu > li > a,
.contacts-page .dropdown-menu > li > a {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    font-size: 0.78rem;
    color: var(--text-secondary, #475569);
}

.contacts-page .contacts-action-menu > li > a:hover,
.contacts-page .dropdown-menu > li > a:hover {
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--text-primary, #0f172a);
}

.contacts-page .contacts-action-menu > li > a i,
.contacts-page .dropdown-menu > li > a i {
    width: 1rem;
    text-align: center;
}

.contacts-page .contacts-action-menu > li > a.delete_contact_button {
    color: var(--danger-text, #b91c1c);
}

.contacts-page .contacts-action-menu > li > a.delete_contact_button:hover {
    background: rgba(220, 38, 38, 0.08);
    color: #991b1b;
}

.contacts-page .contacts-action-menu .divider,
.contacts-page .dropdown-menu .divider {
    margin: 0.25rem 0;
}

.contact-name-switch-wrap {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 0.28rem;
}

.contact-supplier-jump-popover {
    position: fixed;
    z-index: 2060;
    min-width: 17rem;
    max-width: min(22rem, calc(100vw - 1.5rem));
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.65rem;
    background: var(--bg-surface, #ffffff);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14);
}

.contact-supplier-jump-popover__label {
    margin: 0 0 0.45rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.contact-supplier-jump-popover select.form-control {
    width: 100%;
    font-size: 0.8rem;
    min-height: 2.15rem;
}

:root[data-theme='dark'] .contact-supplier-jump-popover {
    border-color: #334866;
    background: #111a2c;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

:root[data-theme='dark'] .contact-supplier-jump-popover__label {
    color: #94a3b8;
}

/* —— Contact detail view —— */
.contact-view-page {
    gap: 1rem;
}

.contact-view-toolbar {
    margin-bottom: 0;
}

.contact-view-subtitle {
    display: block;
    margin-top: 0.32rem;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-muted, #64748b);
}

.contact-view-picker {
    max-width: 20rem;
}

.contact-summary-card {
    border: 1px solid rgba(56, 78, 118, 0.45);
    border-radius: 0.9rem;
    background:
        radial-gradient(ellipse 105% 70% at 92% -8%, rgba(94, 129, 200, 0.14) 0%, transparent 52%),
        radial-gradient(ellipse 70% 55% at -5% 102%, rgba(45, 156, 185, 0.09) 0%, transparent 48%),
        linear-gradient(155deg, #253652 0%, #1b2a44 38%, #152238 72%, #111c2f 100%);
    color: #edf3fb;
    box-shadow:
        0 24px 56px rgba(15, 23, 42, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.contact-summary-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(15.5rem, 0.92fr);
    gap: 1rem;
    padding: 0.95rem 1.1rem;
    align-items: stretch;
}

.contact-summary-main,
.contact-summary-side {
    min-width: 0;
}

.contact-summary-main {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-summary-identity {
    display: flex;
    align-items: flex-start;
    gap: 0.72rem;
    margin-bottom: 0;
}

.contact-summary-icon {
    width: 2.55rem;
    height: 2.55rem;
    flex: 0 0 2.55rem;
    border-radius: 0.72rem;
    border: 1px solid rgba(214, 222, 234, 0.18);
    background: rgba(255, 255, 255, 0.09);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: #f8fbff;
}

.contact-summary-overline {
    margin: 0 0 0.12rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #b8c9e8;
    line-height: 1.25;
}

.contact-summary-name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.contact-summary-name-display {
    display: flex;
    align-items: center;
    gap: 0.28rem;
    flex: 1 1 auto;
    min-width: 0;
}

.contact-summary-name-display .contact-summary-name {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.contact-summary-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.05rem;
    height: 2.05rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(214, 222, 234, 0.28);
    background: rgba(255, 255, 255, 0.1);
    color: #e8eef8;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.contact-summary-switch-btn.contact-summary-switch-chevron {
    width: auto;
    height: auto;
    min-width: 1.65rem;
    min-height: 1.65rem;
    padding: 0.12rem 0.2rem;
    margin: 0;
    align-self: center;
    border: none;
    border-radius: 0.35rem;
    background: transparent;
    color: #c5d4ef;
    flex-shrink: 0;
}

.contact-summary-switch-chevron-icon {
    font-size: 0.72rem;
    transition: transform 0.2s ease;
}

.contact-summary-name-row.is-open .contact-summary-name-display {
    display: none;
}

.contact-summary-name-row.is-open .contact-summary-switch-panel {
    flex: 1 1 100%;
    min-width: 0;
}

.contact-summary-switch-btn:hover,
.contact-summary-switch-btn:focus-visible {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.38);
    color: #ffffff;
    outline: none;
}

.contact-summary-switch-btn.contact-summary-switch-chevron:hover,
.contact-summary-switch-btn.contact-summary-switch-chevron:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    border-color: transparent;
    color: #ffffff;
}

.contact-summary-switch-panel {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    flex: 1 1 100%;
    min-width: 0;
}

.contact-summary-switch-panel[hidden] {
    display: none !important;
}

.contact-summary-switch-label {
    display: block;
    margin: 0 0 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a8bad8;
}

.contact-summary-switch-panel .select2-container {
    width: 100% !important;
}

.contact-summary-name-row.is-open .contact-summary-switch-panel .select2-container--default .select2-selection--single {
    min-height: 2.35rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(214, 222, 234, 0.35);
    background: rgba(255, 255, 255, 0.12);
}

.contact-summary-name-row.is-open .contact-summary-switch-panel .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #f8fbff;
    line-height: 2.1rem;
    padding-left: 0.65rem;
}

.contact-summary-name-row.is-open .contact-summary-switch-panel .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #e8eef8 transparent transparent transparent;
}

/* Supplier switch: Select2 menu (dropdownParent body) — match summary card */
.select2-container.contact-summary-switch-select2.select2-container--open {
    z-index: 5100;
}

.select2-dropdown.contact-summary-switch-dropdown {
    z-index: 5100;
    min-width: min(22rem, calc(100vw - 2rem));
    max-width: calc(100vw - 1.5rem);
    margin-top: 0.35rem;
    border: 1px solid rgba(148, 163, 184, 0.22) !important;
    border-radius: 0.75rem !important;
    background: linear-gradient(165deg, #1e2d4a 0%, #17263d 45%, #111c2f 100%) !important;
    box-shadow:
        0 24px 56px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    color: #e8eef8;
}

.contact-summary-switch-dropdown.select2-dropdown--above {
    margin-top: 0;
    margin-bottom: 0.35rem;
    box-shadow:
        0 -20px 48px rgba(0, 0, 0, 0.32),
        0 0 0 1px rgba(255, 255, 255, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.contact-summary-switch-dropdown .select2-search--dropdown {
    padding: 0.65rem 0.7rem 0.55rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.18);
}

.contact-summary-switch-dropdown .select2-search--dropdown .select2-search__field {
    width: 100% !important;
    margin: 0 !important;
    padding: 0.48rem 0.75rem 0.48rem 2.15rem !important;
    border: 1px solid rgba(214, 222, 234, 0.22) !important;
    border-radius: 0.55rem !important;
    background: rgba(255, 255, 255, 0.07) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E")
        0.65rem 50% no-repeat !important;
    background-size: 0.95rem 0.95rem !important;
    color: #f8fbff !important;
    font-size: 0.84rem !important;
    font-weight: 500;
    line-height: 1.35 !important;
    box-shadow: none !important;
}

.contact-summary-switch-dropdown .select2-search--dropdown .select2-search__field::placeholder {
    color: rgba(232, 238, 248, 0.42);
}

.contact-summary-switch-dropdown .select2-search--dropdown .select2-search__field:focus {
    border-color: rgba(167, 139, 250, 0.65) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2) !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.contact-summary-switch-dropdown .select2-results > .select2-results__options {
    max-height: 16.5rem !important;
    padding: 0.35rem 0;
}

.contact-summary-switch-dropdown .select2-results__option {
    margin: 0.1rem 0.45rem;
    padding: 0.55rem 0.75rem !important;
    border-radius: 0.5rem;
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.35;
    color: #dce6f7 !important;
    border-left: none !important;
    transition: background 0.12s ease, color 0.12s ease;
}

.contact-summary-switch-dropdown .select2-results__option--highlighted,
.contact-summary-switch-dropdown .select2-results__option--highlighted.select2-results__option--selectable {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.contact-summary-switch-dropdown .select2-results__option[aria-selected='true'] {
    background: rgba(139, 92, 246, 0.22) !important;
    color: #ffffff !important;
    font-weight: 600;
}

.contact-summary-switch-dropdown .select2-results__option[aria-selected='true'].select2-results__option--highlighted {
    background: rgba(139, 92, 246, 0.3) !important;
}

.contact-summary-switch-dropdown .select2-results__message {
    padding: 0.85rem 1rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

.contact-summary-switch-dropdown .select2-results__option--loading,
.contact-summary-switch-dropdown .select2-results__option--disabled {
    color: #64748b !important;
    opacity: 0.85;
}

.contact-summary-switch-chevron-icon.ti {
    font-size: 0.85rem;
    line-height: 1;
}

.contact-summary-name {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.28;
    color: #f8fbff;
    letter-spacing: -0.02em;
}

section.content.manage-users-content.contact-view-content {
    padding-top: 0.42rem;
}

.users-page.contact-view-page {
    gap: 0.55rem;
}

.contact-summary-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.48rem;
}

.contact-summary-tag {
    display: inline-flex;
    align-items: center;
    min-height: 1.52rem;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(214, 222, 234, 0.2);
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
    font-weight: 600;
    color: #edf3fb;
}

/* One soft panel for address / phone / custom fields — fewer boxes, clearer scan */
.contact-summary-details {
    border: 1px solid rgba(214, 222, 234, 0.12);
    border-radius: 0.72rem;
    background: rgba(6, 12, 22, 0.28);
    padding: 0.35rem 0.65rem 0.45rem;
    box-sizing: border-box;
}

.contact-summary-row {
    display: grid;
    grid-template-columns: 1.65rem minmax(0, 1fr);
    gap: 0.55rem 0.65rem;
    align-items: start;
    padding: 0.52rem 0;
    border-bottom: 1px solid rgba(214, 222, 234, 0.08);
}

.contact-summary-row:last-child {
    border-bottom: none;
    padding-bottom: 0.35rem;
}

.contact-summary-row:first-child {
    padding-top: 0.4rem;
}

.contact-summary-row-icon {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 0.15rem;
    font-size: 0.82rem;
    color: #8eaef0;
    opacity: 0.95;
}

.contact-summary-row-body {
    min-width: 0;
}

.contact-summary-row-label {
    display: block;
    margin: 0 0 0.2rem;
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #a8bad8;
    line-height: 1.3;
}

.contact-summary-row-value {
    margin: 0;
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.45;
    color: #f2f6fc;
    word-break: break-word;
}

.contact-summary-row-value a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

.contact-summary-side {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
}

.contact-summary-side-panel {
    border: 1px solid rgba(214, 222, 234, 0.12);
    border-radius: 0.72rem;
    background: rgba(6, 12, 22, 0.28);
    padding: 0.45rem 0.7rem 0.55rem;
    box-sizing: border-box;
    flex: 1 1 auto;
    min-height: 0;
}

.contact-summary-side-section {
    padding: 0.15rem 0;
}

.contact-summary-side-section--financial {
    margin-top: 0.35rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(214, 222, 234, 0.1);
}

.contact-summary-kv {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.42rem 0;
    border-bottom: 1px solid rgba(214, 222, 234, 0.07);
}

.contact-summary-side-section .contact-summary-kv:last-child {
    border-bottom: none;
    padding-bottom: 0.15rem;
}

.contact-summary-kv-label {
    flex: 0 1 auto;
    font-size: 0.72rem;
    font-weight: 650;
    color: #a8bad8;
    line-height: 1.35;
    letter-spacing: 0.02em;
}

.contact-summary-kv-value {
    text-align: right;
    font-size: 0.84rem;
    font-weight: 600;
    color: #f2f6fc;
    line-height: 1.3;
    word-break: break-word;
}

.contact-summary-kv-value--muted {
    color: #8fa4c4;
    font-weight: 500;
}

.contact-summary-kv-value--figure {
    font-size: 0.92rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.contact-summary-kv-trail {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.12rem;
    text-align: right;
    min-width: 0;
}

.contact-summary-kv-meta {
    font-size: 0.68rem;
    font-weight: 600;
    color: #8fa4c4;
    line-height: 1.2;
}

.contact-summary-kv--money .contact-summary-kv-label {
    max-width: 58%;
}

.contact-summary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: auto;
    width: 100%;
    justify-content: flex-end;
}

.contact-summary-action {
    flex: 0 1 auto;
}

.contact-summary-actions .users-btn.contact-summary-action {
    padding: 0.38rem 0.72rem;
    min-height: 1.85rem;
    font-size: 0.78rem;
    line-height: 1.25;
}

.contact-summary-actions .users-btn-primary {
    border-color: rgba(248, 251, 255, 0.12);
    background: #edf3fb;
    color: #11203b;
}

.contact-summary-actions .users-btn-light {
    border-color: rgba(214, 222, 234, 0.22);
    background: rgba(255, 255, 255, 0.06);
    color: #edf3fb;
}

.contact-summary-actions .users-btn-light:hover,
.contact-summary-actions .users-btn-light:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.contact-view-tabs {
    border-radius: 1rem;
}

.contact-view-tab-nav {
    padding: 0 0.7rem;
    gap: 0.15rem;
    background: var(--bg-surface, #ffffff);
}

.contact-view-tab-nav > li > a {
    min-height: 3rem;
    padding: 0.9rem 0.95rem 0.8rem;
    font-size: 0.81rem;
    border-radius: 0.72rem 0.72rem 0 0;
}

.contact-view-tab-panels {
    padding: 1rem 1.1rem 1.25rem;
}

.contact-view-pane > .row {
    margin-left: -0.6rem;
    margin-right: -0.6rem;
}

.contact-view-pane > .row > [class*='col-'] {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
}

.contact-view-page .form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.contact-view-page .form-control {
    border-radius: 0.55rem;
    border-color: #dbe2ea;
    min-height: 2.42rem;
    box-shadow: none;
    font-size: 0.86rem;
}

.contact-view-page .form-control:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.contact-view-page .select2-container {
    width: 100% !important;
}

.contact-view-page .select2-container--default .select2-selection--single,
.contact-view-page .select2-container--default .select2-selection--multiple {
    border-radius: 0.55rem !important;
    border-color: #dbe2ea !important;
    min-height: 2.42rem;
    background: var(--bg-surface, #ffffff);
}

.contact-view-page .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 2.25rem;
    padding-left: 0.75rem;
    color: var(--text-primary, #0f172a);
    font-size: 0.84rem;
    font-weight: 500;
}

.contact-view-page .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 2.3rem;
}

.contact-ledger-toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.85rem;
    row-gap: 0.5rem;
    margin-bottom: 1rem;
    min-width: 0;
}

.contact-ledger-toolbar-right {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
    min-width: 0;
    overflow: visible;
}

.contact-ledger-control {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    min-width: 0;
}

.contact-ledger-control > label {
    margin: 0;
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.contact-ledger-control--date {
    flex: 0 1 13.5rem;
    min-width: 9.5rem;
    max-width: 15rem;
}

.contact-ledger-control--date .form-control {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    font-size: 0.76rem;
    padding: 0.32rem 0.45rem;
    min-height: 2.05rem;
    height: 2.05rem;
    line-height: 1.25;
}

.contact-ledger-control--format {
    flex: 0 0 auto;
    justify-self: center;
    width: fit-content;
    max-width: 100%;
    min-width: 0;
}

.contact-ledger-control--format > label {
    margin-right: 0.1rem;
}

.contact-ledger-control--location {
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
    overflow: visible;
    gap: 0.6rem;
    align-items: center;
}

.contact-ledger-control--location > label {
    margin-right: 0.12rem;
    align-self: center;
    line-height: 1.2;
}

.contact-ledger-control--location .select2-container {
    flex: 0 0 auto;
    min-width: 12.75rem !important;
    width: 12.75rem !important;
    max-width: 100%;
}

.contact-view-page .contact-ledger-toolbar .select2-container--default .select2-selection--single {
    min-height: 2.05rem;
    height: 2.05rem;
    padding-top: 0.12rem;
}

.contact-view-page .contact-ledger-toolbar .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1.75rem;
    padding-left: 0.58rem;
    padding-right: 1.7rem;
    font-size: 0.76rem;
}

.contact-view-page .contact-ledger-toolbar .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 2rem;
}

.contact-view-page .contact-ledger-toolbar .select2-container--default .select2-selection--single.contact-ledger-location-select2 {
    min-width: 12.75rem;
    min-height: 2.15rem !important;
    height: 2.15rem !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    border-radius: 0.55rem;
    box-sizing: border-box;
}

.contact-view-page .contact-ledger-toolbar .select2-container--default.select2-container--focus .select2-selection--single.contact-ledger-location-select2,
.contact-view-page .contact-ledger-toolbar .select2-container--default.select2-container--open .select2-selection--single.contact-ledger-location-select2 {
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.contact-view-page .contact-ledger-toolbar .select2-container--default .select2-selection--single.contact-ledger-location-select2 .select2-selection__rendered {
    display: flex !important;
    align-items: center !important;
    min-height: 100% !important;
    height: 100% !important;
    margin-top: 0 !important;
    line-height: 1.1 !important;
    padding: 0 1.95rem 0 0.72rem !important;
    box-sizing: border-box;
}

.contact-view-page .contact-ledger-toolbar .select2-container--default .select2-selection--single.contact-ledger-location-select2 .select2-selection__arrow {
    top: 0 !important;
    right: 0.4rem !important;
    width: 1rem !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.contact-view-page .contact-ledger-toolbar .select2-container--default .select2-selection--single.contact-ledger-location-select2 .select2-selection__arrow b {
    position: static !important;
    top: auto !important;
    left: auto !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    transform: none !important;
}

.select2-dropdown.contact-ledger-location-dropdown {
    min-width: 15.5rem !important;
    max-width: calc(100vw - 1.5rem);
}

.select2-dropdown.contact-ledger-location-dropdown .select2-results > .select2-results__options {
    max-height: 17.5rem !important;
}

.select2-dropdown.contact-ledger-location-dropdown .select2-results__option {
    white-space: normal;
    word-break: break-word;
    line-height: 1.45;
    margin: 0.08rem 0.4rem;
    padding: 0.46rem 0.72rem !important;
    border-left: none !important;
    border-radius: 0.45rem;
    background: transparent !important;
}

.select2-dropdown.contact-ledger-location-dropdown .select2-results__option--highlighted,
.select2-dropdown.contact-ledger-location-dropdown .select2-results__option--highlighted.select2-results__option--selectable {
    background: rgba(148, 163, 184, 0.14) !important;
    color: var(--nk-s2-text, #0f172a) !important;
    border-left-color: transparent !important;
}

.select2-dropdown.contact-ledger-location-dropdown .select2-results__option[aria-selected='true'] {
    background: rgba(100, 116, 139, 0.14) !important;
    color: var(--nk-s2-text, #0f172a) !important;
    border-left-color: transparent !important;
    font-weight: 600;
}

.select2-dropdown.contact-ledger-location-dropdown .select2-results__option[aria-selected='true'].select2-results__option--highlighted {
    background: rgba(100, 116, 139, 0.2) !important;
}

:root[data-theme='dark'] .select2-dropdown.contact-ledger-location-dropdown .select2-results__option--highlighted,
:root[data-theme='dark'] .select2-dropdown.contact-ledger-location-dropdown .select2-results__option--highlighted.select2-results__option--selectable {
    background: rgba(148, 163, 184, 0.14) !important;
}

:root[data-theme='dark'] .select2-dropdown.contact-ledger-location-dropdown .select2-results__option[aria-selected='true'] {
    background: rgba(148, 163, 184, 0.18) !important;
}

.contact-ledger-format-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.28rem;
    flex-shrink: 0;
}

.contact-ledger-format-option {
    position: relative;
    margin: 0;
    flex-shrink: 0;
}

.contact-ledger-format-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.contact-ledger-format-option span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.05rem;
    padding: 0.26rem 0.42rem;
    border: 1px solid #dbe2ea;
    border-radius: 0.45rem;
    background: var(--bg-surface, #ffffff);
    color: var(--text-secondary, #475569);
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.15;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.contact-ledger-format-option input:checked + span {
    border-color: #1f2c46;
    background: #1f2c46;
    color: #f8fbff;
    box-shadow: 0 8px 20px rgba(31, 44, 70, 0.18);
}

.contact-ledger-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
    margin-left: 0;
}

.contact-ledger-icon-btn {
    width: 2.08rem;
    height: 2.08rem;
    border: 1px solid #dbe2ea;
    border-radius: 0.65rem;
    background: var(--bg-surface, #ffffff);
    color: var(--text-secondary, #475569);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.contact-ledger-icon-btn:hover,
.contact-ledger-icon-btn:focus {
    border-color: #8b5cf6;
    color: #5b21b6;
    background: rgba(139, 92, 246, 0.06);
    transform: translateY(-1px);
}

.contact-ledger-icon-btn .ti {
    font-size: 1.08rem;
    line-height: 1;
}

.contact-payments-panel {
    min-height: 18rem;
    padding-right: 0.2rem;
}

.contact-payments-shell {
    margin-top: 0.15rem;
}

.contact-payments-head-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.contact-payments-head-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.18);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.08) 0%, rgba(99, 102, 241, 0.08) 100%);
    color: #1d4ed8;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.contact-payments-hero {
    padding: 1rem 1rem 0.1rem;
    background: var(--bg-surface, #ffffff);
}

.contact-payments-copy h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.contact-payments-copy p {
    margin: 0.42rem 0 0;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--text-secondary, #475569);
}

.contact-payments-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 0.9rem;
}

.contact-payments-stat {
    min-width: 0;
    padding: 0.9rem 0.95rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.9rem;
    background: var(--bg-surface-soft, #f8fafc);
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.06));
}

.contact-payments-stat--accent {
    border-color: rgba(59, 130, 246, 0.18);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.08) 0%, rgba(99, 102, 241, 0.08) 100%);
}

.contact-payments-stat span {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.contact-payments-stat strong {
    display: block;
    margin-top: 0.38rem;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text-primary, #0f172a);
    word-break: break-word;
}

.contact-payments-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.95rem 1rem 0;
    background: var(--bg-surface, #ffffff);
}

.contact-payments-toolbar-copy {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary, #475569);
    line-height: 1.55;
}

.contact-payments-table-wrap {
    border-top: 1px solid var(--border-default, #e2e8f0);
}

.contact-payments-table {
    width: 100%;
    min-width: 68rem;
    margin: 0 !important;
}

.contact-payments-table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #64748b);
    font-weight: 700;
    background: var(--bg-surface-soft, #f8fafc);
    border-bottom: 1px solid var(--border-default, #e2e8f0) !important;
    padding: 0.75rem 0.8rem !important;
    vertical-align: middle;
}

.contact-payments-table tbody td {
    padding: 0.85rem 0.8rem !important;
    border-bottom: 1px solid #eef2f7 !important;
    vertical-align: middle;
    color: var(--text-secondary, #334155);
    font-size: 0.82rem;
}

.contact-payments-table tbody tr:hover td {
    background: rgba(248, 250, 252, 0.9);
}

.contact-payment-cell-muted {
    background: rgba(148, 163, 184, 0.06);
}

.contact-payment-date strong,
.contact-payment-ref strong,
.contact-payment-amount,
.contact-payment-link {
    display: block;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.contact-payment-date span,
.contact-payment-ref span,
.contact-payment-link-meta {
    display: block;
    margin-top: 0.28rem;
    font-size: 0.74rem;
    color: var(--text-muted, #64748b);
    line-height: 1.45;
}

.contact-payment-method {
    display: grid;
    gap: 0.45rem;
}

.contact-payment-method-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 0.34rem 0.65rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.08);
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 700;
}

.contact-payment-method-meta {
    font-size: 0.76rem;
    color: var(--text-secondary, #475569);
    line-height: 1.5;
}

.contact-payment-method-meta small {
    color: var(--text-muted, #64748b);
}

.contact-payment-link {
    text-decoration: none;
}

.contact-payment-link:hover,
.contact-payment-link:focus {
    color: #5b21b6;
    text-decoration: none;
}

.contact-payments-actions {
    display: inline-flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.contact-payments-actions .users-btn {
    min-width: 5.65rem;
    justify-content: center;
}

.contact-payments-delete-btn {
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.22);
    background: rgba(254, 242, 242, 0.95);
}

.contact-payments-delete-btn:hover,
.contact-payments-delete-btn:focus {
    color: #991b1b;
    border-color: rgba(239, 68, 68, 0.34);
    background: #fee2e2;
}

.contact-payments-empty {
    padding: 2rem 1rem !important;
    color: var(--text-muted, #64748b);
    font-size: 0.85rem;
}

.contact-payments-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.95rem 1rem 1rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface, #ffffff);
}

.contact-payments-pagination-copy {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}

.contact-payments-pagination-links {
    margin-left: auto;
}

.contact-payments-pagination-links .pagination {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.contact-payments-pagination-links .pagination > li > a,
.contact-payments-pagination-links .pagination > li > span {
    border-radius: 0.55rem !important;
    border: 1px solid var(--border-default, #dbe2ea);
    color: var(--text-secondary, #475569);
    background: var(--bg-surface, #ffffff);
    padding: 0.45rem 0.7rem;
    line-height: 1.2;
}

.contact-payments-pagination-links .pagination > .active > span,
.contact-payments-pagination-links .pagination > .active > span:hover,
.contact-payments-pagination-links .pagination > .active > span:focus,
.contact-payments-pagination-links .pagination > .active > a,
.contact-payments-pagination-links .pagination > .active > a:hover,
.contact-payments-pagination-links .pagination > .active > a:focus {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-color: #6d28d9;
    color: #ffffff;
}

.contact-purchases-shell {
    margin-top: 0.15rem;
}

.contact-purchases-shell .contact-purchases-filters {
    padding: 0.95rem 1rem 0;
    background: var(--bg-surface, #ffffff);
}

.contact-purchases-shell .contact-purchases-filters .form-group {
    margin-bottom: 0.95rem;
}

.contact-purchases-shell .users-table-controls {
    border-top: 1px solid var(--border-default, #e2e8f0);
}

.contact-purchases-shell .contact-purchases-table-wrap {
    border-top: 0;
}

.contact-stock-report-shell {
    margin-top: 0.15rem;
}

.contact-stock-report-shell .contact-stock-report-hero {
    padding: 1rem 1rem 0.1rem;
    background: var(--bg-surface, #ffffff);
}

.contact-stock-report-copy h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.contact-stock-report-copy p {
    margin: 0.42rem 0 0;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--text-secondary, #475569);
}

.contact-stock-report-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 0.9rem;
}

.contact-stock-report-stat {
    min-width: 0;
    padding: 0.9rem 0.95rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.9rem;
    background: var(--bg-surface-soft, #f8fafc);
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.06));
}

.contact-stock-report-stat--accent {
    border-color: rgba(59, 130, 246, 0.18);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.08) 0%, rgba(99, 102, 241, 0.08) 100%);
}

.contact-stock-report-stat span {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.contact-stock-report-stat strong {
    display: block;
    margin-top: 0.38rem;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary, #0f172a);
    word-break: break-word;
}

.contact-stock-report-shell .contact-stock-report-filters {
    padding: 0.95rem 1rem 0;
    background: var(--bg-surface, #ffffff);
}

.contact-stock-report-shell .contact-stock-report-filters .form-group {
    margin-bottom: 0.95rem;
}

.contact-stock-report-shell .users-table-controls {
    border-top: 1px solid var(--border-default, #e2e8f0);
}

.contact-stock-report-shell .contact-stock-report-table-wrap {
    border-top: 0;
}

.contact-stock-report-shell table#supplier_stock_report_table.dataTable {
    width: 100% !important;
    min-width: 64rem !important;
    margin: 0 !important;
}

/*
 * Contact supplier stock report: use the same Nestiko DataTables header/body chrome as `.roles-panel`
 * grids (uppercase labels, soft header band, sort glyphs). First column is product name — not the narrow
 * action column used on purchase lists.
 */
.contact-view-page .contact-stock-report-shell.roles-panel table#supplier_stock_report_table.dataTable thead th:first-child,
.contact-view-page .contact-stock-report-shell.roles-panel table#supplier_stock_report_table.dataTable tbody td:first-child {
    width: auto;
    min-width: 7rem;
    text-align: left;
}

.contact-view-page .contact-stock-report-shell.roles-panel table#supplier_stock_report_table.dataTable tbody td {
    white-space: nowrap;
}

.contact-view-page .contact-stock-report-shell.roles-panel .dataTables_scrollHead,
.contact-view-page .contact-stock-report-shell.roles-panel .dataTables_scrollBody {
    border: 0;
}

.contact-view-page .contact-stock-report-shell.roles-panel .dataTables_scrollHead table.dataTable {
    margin-top: 0 !important;
}

.contact-view-page .box {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.85rem;
    background: var(--bg-surface, #ffffff);
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.08));
}

.contact-view-page .box .box-header {
    padding: 0 0 0.85rem;
    margin: 0 0 0.95rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.contact-view-page .box .box-title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.contact-view-page .info-box {
    border-radius: 0.85rem;
    box-shadow: none;
    overflow: hidden;
}

.contact-ledger-results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
    min-width: 0;
}

.contact-ledger-results::after {
    content: none;
}

.contact-ledger-results > .contact-ledger-overview,
.contact-ledger-results > .contact-ledger-table-block,
.contact-ledger-results > .col-md-12,
.contact-ledger-results > .col-sm-12 {
    grid-column: 1 / -1;
}

.contact-ledger-results > .col-md-6,
.contact-ledger-results > .col-sm-6,
.contact-ledger-results > .col-xs-6 {
    width: auto;
    float: none;
    padding-left: 0;
    padding-right: 0;
}

.contact-ledger-results .contact-ledger-overview.row {
    display: grid !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: min-content;
    gap: 1rem;
    margin: 0 0 1rem;
    align-items: start !important;
}

/* Bootstrap .row clearfix pseudo-elements become extra grid items and break column alignment */
.contact-ledger-results .contact-ledger-overview.row::before,
.contact-ledger-results .contact-ledger-overview.row::after {
    display: none !important;
    content: none !important;
}

/* Format 4: business + contact stacked in one column; partner ledger wider column */
.contact-ledger-results .contact-ledger-overview--pair {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}

.contact-ledger-results .contact-ledger-overview-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.contact-ledger-results .contact-ledger-overview.row > [class*='col-'] {
    width: 100%;
    max-width: 100%;
    float: none;
    padding: 0;
    min-width: 0;
    align-self: start;
}

.contact-ledger-results .contact-ledger-party-card,
.contact-ledger-results .contact-ledger-summary-card {
    height: auto;
    min-height: 0;
    padding: 0.95rem 1rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.9rem;
    background: var(--bg-surface-soft, #f8fafc);
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.06));
}

.contact-ledger-partner-card {
    min-height: 0;
}

.contact-ledger-results .contact-ledger-summary-card + .contact-ledger-summary-card {
    margin-top: 0.8rem;
}

.contact-ledger-results .contact-ledger-label,
.contact-ledger-results .contact-ledger-summary-title,
.contact-ledger-results .contact-ledger-heading {
    margin: 0;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.contact-ledger-results .contact-ledger-party-name {
    margin: 0.4rem 0 0;
    font-size: 1.04rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    line-height: 1.3;
}

.contact-ledger-results .contact-ledger-party-meta,
.contact-ledger-results .contact-ledger-summary-period,
.contact-ledger-results .contact-ledger-summary-note {
    margin: 0.45rem 0 0;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-secondary, #475569);
}

.contact-ledger-results .contact-ledger-summary-table {
    width: 100%;
    margin-top: 0.65rem;
}

.contact-ledger-results .contact-ledger-summary-table > tbody > tr > td {
    padding: 0.45rem 0;
    border-top: 1px solid var(--border-default, #e2e8f0);
    background: transparent;
    font-size: 0.8rem;
    color: var(--text-secondary, #475569);
}

.contact-ledger-results .contact-ledger-summary-table > tbody > tr:first-child > td {
    border-top: 0;
}

.contact-ledger-results .contact-ledger-summary-table > tbody > tr > td:last-child {
    text-align: right;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.contact-ledger-results .contact-ledger-table-block {
    width: 100%;
    float: none;
    clear: both;
    padding: 0;
}

.contact-ledger-results .contact-ledger-heading {
    margin-bottom: 0.75rem;
    text-align: center;
}

.contact-ledger-results .table-responsive {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.9rem;
    background: var(--bg-surface, #ffffff);
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.06));
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.contact-ledger-results table {
    margin-bottom: 0;
}

.contact-ledger-results .table > thead > tr > th {
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--text-secondary, #475569);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    vertical-align: middle;
}

/* Contact ledger #ledger_table: full-width header band + empty state (DataTables) */
.contact-ledger-results #ledger_table_wrapper {
    width: 100%;
}

.contact-ledger-results #ledger_table.dataTable {
    width: 100% !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
}

.contact-ledger-results #ledger_table thead > tr > th {
    background: #1f2c46 !important;
    color: #f8fbff !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-top: none !important;
    padding: 0.62rem 0.5rem !important;
    vertical-align: middle !important;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.contact-ledger-results #ledger_table thead > tr:first-child > th:first-child {
    border-top-left-radius: 0.82rem;
}

.contact-ledger-results #ledger_table thead > tr:first-child > th:last-child {
    border-top-right-radius: 0.82rem;
}

.contact-ledger-results #ledger_table.table > tbody > tr > td.dataTables_empty {
    background: #e8edf5 !important;
    color: #475569 !important;
    padding: 1.65rem 1rem !important;
    text-align: center !important;
    font-size: 0.84rem !important;
    font-weight: 500;
    border-top: none !important;
}

.contact-ledger-results #ledger_table.table > tbody > tr:only-child > td.dataTables_empty {
    border-bottom-left-radius: 0.82rem;
    border-bottom-right-radius: 0.82rem;
}

.contact-ledger-results .table > tbody > tr > td {
    border-top: 1px solid var(--border-default, #e2e8f0);
    vertical-align: top;
    font-size: 0.8rem;
    color: var(--text-secondary, #475569);
}

.contact-ledger-results .table > tbody > tr > td strong,
.contact-ledger-results p strong {
    color: var(--text-primary, #0f172a);
}

.contact-ledger-results .blue-heading {
    color: var(--text-secondary, #475569);
}

.contact-ledger-results .bg-gray,
.contact-ledger-results .bg-light-gray {
    background: var(--bg-surface-soft, #f8fafc) !important;
}

.contact-ledger-results .tw-dw-btn {
    border-radius: 0.45rem;
}

.contact-ledger-group-row > td {
    font-weight: 600;
    color: var(--text-primary, #0f172a);
}

.contact-ledger-detail-row > td {
    border-top: 0 !important;
}

.contact-ledger-detail-cell {
    padding: 0 1rem 1rem !important;
    background: var(--bg-surface-soft, #f8fafc) !important;
}

.contact-ledger-detail-cell > table {
    width: 100%;
    margin: 0;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.8rem;
    overflow: hidden;
    background: var(--bg-surface, #ffffff);
}

.contact-ledger-detail-cell > table > tbody > tr:first-child > th,
.contact-ledger-detail-cell > table > tr:first-child > th {
    border-top: 0;
}

.contact-ledger-detail-cell > table th {
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-secondary, #475569);
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.contact-ledger-detail-cell > table td,
.contact-ledger-detail-cell > table th {
    border-color: var(--border-default, #e2e8f0);
    vertical-align: top;
}

.contact-ledger-detail-cell > table td {
    font-size: 0.78rem;
    color: var(--text-secondary, #475569);
}

.contact-ledger-detail-cell > table td strong,
.contact-ledger-detail-cell > table td b {
    color: var(--text-primary, #0f172a);
}

.contact-ledger-statement-party-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.contact-ledger-party-divider {
    height: 1px;
    margin: 0.95rem 0 0.85rem;
    background: var(--border-default, #e2e8f0);
}

.contact-ledger-statement-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    text-align: center;
}

.contact-ledger-statement-title {
    margin: 0;
    font-size: 1.28rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    letter-spacing: -0.02em;
}

.contact-ledger-statement-subtitle {
    margin: 0.3rem 0 0;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.contact-ledger-statement-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    width: 100%;
    margin-top: 1rem;
}

.contact-ledger-statement-kpi {
    padding: 0.8rem 0.85rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.85rem;
    background: var(--bg-surface, #ffffff);
    text-align: left;
}

.contact-ledger-statement-kpi-label,
.contact-ledger-aging-label {
    display: block;
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    line-height: 1.35;
}

.contact-ledger-statement-kpi-value,
.contact-ledger-aging-value {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    line-height: 1.3;
}

.contact-ledger-transaction-cell {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.contact-ledger-transaction-title {
    font-weight: 600;
    color: var(--text-primary, #0f172a);
    line-height: 1.4;
}

.contact-ledger-transaction-meta {
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--text-muted, #64748b);
    line-height: 1.35;
}

.contact-ledger-balance-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.85rem;
    padding: 0.14rem 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
    color: var(--text-primary, #0f172a);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.contact-ledger-aging-block {
    margin-top: 1rem;
}

.contact-ledger-aging-panel {
    padding: 0.95rem 1rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.9rem;
    background: var(--bg-surface-soft, #f8fafc);
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.06));
}

.contact-ledger-aging-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.8rem;
}

.contact-ledger-aging-card {
    padding: 0.8rem 0.85rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.85rem;
    background: var(--bg-surface, #ffffff);
}

.contact-ledger-aging-card--success {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.2);
}

.contact-ledger-aging-card--warning {
    background: rgba(250, 204, 21, 0.12);
    border-color: rgba(250, 204, 21, 0.24);
}

.contact-ledger-aging-card--amber {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.22);
}

.contact-ledger-aging-card--danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.22);
}

.contact-ledger-aging-card--accent {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.18);
}

@media (max-width: 1199px) {
    .contact-ledger-toolbar {
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 0.15rem;
        -webkit-overflow-scrolling: touch;
        /* Scrollbars: nestiko-scrollbars-global.css */
    }

    .contact-ledger-toolbar-right {
        flex-shrink: 0;
    }

    .contact-ledger-actions {
        justify-content: flex-end;
    }

    .contact-ledger-results .contact-ledger-overview--pair {
        grid-template-columns: minmax(0, 1fr);
    }

    .contact-ledger-aging-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-stock-report-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-payments-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .contact-summary-shell,
    .contact-ledger-results,
    .contact-ledger-results .contact-ledger-overview {
        grid-template-columns: minmax(0, 1fr);
    }

    .contact-view-tab-nav {
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    .contact-view-tab-nav > li {
        flex: 0 0 auto;
    }

    .contact-stock-report-shell table#supplier_stock_report_table.dataTable {
        min-width: 58rem !important;
    }

    .contact-payments-table {
        min-width: 58rem;
    }
}

@media (max-width: 767px) {
    .contact-summary-card {
        border-radius: 0.9rem;
    }

    .contact-summary-shell {
        padding: 0.78rem 0.88rem;
        gap: 0.78rem;
    }

    .contact-summary-kv {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }

    .contact-summary-kv-value,
    .contact-summary-kv-trail {
        text-align: left;
        align-items: flex-start;
        width: 100%;
    }

    .contact-summary-kv--money .contact-summary-kv-label {
        max-width: none;
    }

    .contact-ledger-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        overflow-x: visible;
        row-gap: 0.65rem;
    }

    .contact-ledger-control--format {
        justify-self: stretch;
        width: 100%;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .contact-ledger-toolbar-right {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 0.65rem;
    }

    .contact-ledger-control {
        flex-wrap: wrap;
        width: 100%;
        max-width: none;
    }

    .contact-ledger-control--date,
    .contact-ledger-control--location {
        flex: 1 1 100%;
        max-width: none;
        min-width: 0;
    }

    .contact-ledger-format-group {
        flex-wrap: wrap;
    }

    .contact-ledger-control--location .select2-container {
        flex: 1 1 auto;
        min-width: 0 !important;
        width: 100% !important;
    }

    .contact-ledger-actions {
        margin-left: 0;
        width: auto;
        justify-content: flex-end;
        flex-shrink: 0;
    }

    .contact-stock-report-stats,
    .contact-payments-stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .contact-ledger-statement-kpis,
    .contact-ledger-aging-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .contact-summary-actions .users-btn {
        width: 100%;
    }

    .contact-view-tab-panels {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .contact-stock-report-shell .contact-stock-report-hero,
    .contact-stock-report-shell .contact-stock-report-filters {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .contact-payments-hero,
    .contact-payments-toolbar,
    .contact-payments-pagination {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .contact-payments-toolbar,
    .contact-payments-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .contact-payments-actions {
        justify-content: stretch;
    }

    .contact-payments-actions .users-btn {
        width: 100%;
    }
}

:root[data-theme='dark'] .contact-view-subtitle {
    color: #94a3b8;
}

:root[data-theme='dark'] .contact-summary-card {
    border-color: rgba(56, 78, 118, 0.5);
    background:
        radial-gradient(ellipse 105% 70% at 92% -8%, rgba(88, 122, 190, 0.12) 0%, transparent 52%),
        radial-gradient(ellipse 70% 55% at -5% 102%, rgba(40, 140, 168, 0.08) 0%, transparent 48%),
        linear-gradient(155deg, #1c2a42 0%, #141f33 40%, #10192a 100%);
    box-shadow:
        0 26px 70px rgba(0, 0, 0, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

:root[data-theme='dark'] .contact-summary-overline {
    color: #9eb0cb;
}

:root[data-theme='dark'] .contact-summary-details,
:root[data-theme='dark'] .contact-summary-side-panel {
    border-color: rgba(86, 108, 141, 0.32);
    background: rgba(6, 12, 22, 0.38);
}

:root[data-theme='dark'] .contact-summary-row {
    border-bottom-color: rgba(86, 108, 141, 0.22);
}

:root[data-theme='dark'] .contact-summary-row-label,
:root[data-theme='dark'] .contact-summary-kv-label {
    color: #94a6bf;
}

:root[data-theme='dark'] .contact-summary-row-icon {
    color: #9eb6e8;
}

:root[data-theme='dark'] .contact-summary-side-section--financial {
    border-top-color: rgba(86, 108, 141, 0.28);
}

:root[data-theme='dark'] .contact-summary-kv {
    border-bottom-color: rgba(86, 108, 141, 0.2);
}

:root[data-theme='dark'] .contact-summary-kv-meta,
:root[data-theme='dark'] .contact-summary-kv-value--muted {
    color: #8a9bb5;
}

:root[data-theme='dark'] .contact-summary-actions .users-btn-primary {
    border-color: #d6deea;
    background: #edf3fb;
    color: #13203a;
}

:root[data-theme='dark'] .contact-summary-actions .users-btn-light {
    border-color: rgba(86, 108, 141, 0.42);
    background: rgba(255, 255, 255, 0.05);
    color: #edf3fb;
}

:root[data-theme='dark'] .contact-view-tabs {
    border-color: #334866;
    background: #111a2c;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
}

:root[data-theme='dark'] .contact-view-tab-nav {
    background: #162136;
    border-bottom-color: #334866;
}

:root[data-theme='dark'] .contact-view-tab-nav > li > a {
    color: #cbd5e1;
}

:root[data-theme='dark'] .contact-view-tab-nav > li > a:hover,
:root[data-theme='dark'] .contact-view-tab-nav > li > a:focus {
    color: #f8fbff;
    background: rgba(86, 124, 196, 0.12);
}

:root[data-theme='dark'] .contact-view-tab-nav > li.active > a,
:root[data-theme='dark'] .contact-view-tab-nav > li.active > a:hover,
:root[data-theme='dark'] .contact-view-tab-nav > li.active > a:focus {
    color: #f8fbff;
    background: #111a2c;
    border-bottom-color: #6ea8ff;
}

:root[data-theme='dark'] .contact-view-tab-panels {
    background: #111a2c;
}

/*
 * Contact profile (e.g. Sales tab): filters use components/widget with Tailwind tw-bg-white;
 * align widget chrome to the dark shell (Sales table uses .roles-panel + shared sell_table CSS).
 */
:root[data-theme='dark'] .contact-view-page [class*='tw-bg-white'] {
    background-color: #162136 !important;
    background-image: none !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.38) !important;
}

:root[data-theme='dark'] .contact-view-page [class*='hover:tw-shadow-md']:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45) !important;
}

:root[data-theme='dark'] .contact-view-page [class*='tw-ring-gray'] {
    --tw-ring-color: rgb(51 65 85 / 0.75) !important;
}

:root[data-theme='dark'] .contact-view-page [class*='tw-border-gray'] {
    border-color: rgba(51, 65, 85, 0.55) !important;
}

:root[data-theme='dark'] .contact-view-page .form-group label,
:root[data-theme='dark'] .contact-ledger-results .contact-ledger-party-meta,
:root[data-theme='dark'] .contact-ledger-results .contact-ledger-summary-period,
:root[data-theme='dark'] .contact-ledger-results .contact-ledger-summary-note,
:root[data-theme='dark'] .contact-ledger-results .table > tbody > tr > td,
:root[data-theme='dark'] .contact-ledger-results .contact-ledger-summary-table > tbody > tr > td {
    color: #cbd5e1;
}

:root[data-theme='dark'] .contact-view-page .form-control,
:root[data-theme='dark'] .contact-view-page .select2-container--default .select2-selection--single,
:root[data-theme='dark'] .contact-view-page .select2-container--default .select2-selection--multiple,
:root[data-theme='dark'] .contact-ledger-format-option span,
:root[data-theme='dark'] .contact-ledger-icon-btn {
    border-color: #334866 !important;
    background: #162136;
    color: #e2e8f0;
}

:root[data-theme='dark'] .contact-view-page .form-control:focus {
    border-color: #567cc4;
    box-shadow: 0 0 0 3px rgba(86, 124, 196, 0.18);
}

:root[data-theme='dark'] .contact-view-page .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #edf3fb;
}

:root[data-theme='dark'] .contact-ledger-format-option input:checked + span {
    border-color: #567cc4 !important;
    background: #223352;
    color: #f8fbff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

:root[data-theme='dark'] .contact-ledger-icon-btn:hover,
:root[data-theme='dark'] .contact-ledger-icon-btn:focus {
    border-color: #567cc4 !important;
    color: #f8fbff;
    background: rgba(86, 124, 196, 0.14);
}

:root[data-theme='dark'] .contact-view-page .box {
    border-color: #334866;
    background: #162136;
    box-shadow: none;
}

:root[data-theme='dark'] .contact-purchases-shell .contact-purchases-filters {
    background: #162136;
}

:root[data-theme='dark'] .contact-payments-hero,
:root[data-theme='dark'] .contact-payments-toolbar,
:root[data-theme='dark'] .contact-payments-pagination {
    background: #162136;
}

:root[data-theme='dark'] .contact-stock-report-shell .contact-stock-report-hero,
:root[data-theme='dark'] .contact-stock-report-shell .contact-stock-report-filters {
    background: #162136;
}

:root[data-theme='dark'] .contact-view-page .box .box-header {
    border-bottom-color: #334866;
}

:root[data-theme='dark'] .contact-view-page .box .box-title,
:root[data-theme='dark'] .contact-ledger-results .contact-ledger-party-name,
:root[data-theme='dark'] .contact-ledger-results .table > tbody > tr > td strong,
:root[data-theme='dark'] .contact-ledger-results p strong,
:root[data-theme='dark'] .contact-ledger-results .contact-ledger-summary-table > tbody > tr > td:last-child {
    color: #f8fbff;
}

:root[data-theme='dark'] .contact-stock-report-copy h4,
:root[data-theme='dark'] .contact-stock-report-stat strong,
:root[data-theme='dark'] .contact-payments-copy h4,
:root[data-theme='dark'] .contact-payments-stat strong,
:root[data-theme='dark'] .contact-payment-date strong,
:root[data-theme='dark'] .contact-payment-ref strong,
:root[data-theme='dark'] .contact-payment-amount,
:root[data-theme='dark'] .contact-payment-link {
    color: #f8fbff;
}

:root[data-theme='dark'] .contact-stock-report-copy p,
:root[data-theme='dark'] .contact-stock-report-stat span,
:root[data-theme='dark'] .contact-payments-copy p,
:root[data-theme='dark'] .contact-payments-stat span,
:root[data-theme='dark'] .contact-payments-toolbar-copy,
:root[data-theme='dark'] .contact-payment-date span,
:root[data-theme='dark'] .contact-payment-ref span,
:root[data-theme='dark'] .contact-payment-link-meta,
:root[data-theme='dark'] .contact-payments-pagination-copy {
    color: #94a3b8;
}

:root[data-theme='dark'] .contact-stock-report-stat {
    border-color: #334866;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
}

:root[data-theme='dark'] .contact-payments-stat {
    border-color: #334866;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
}

:root[data-theme='dark'] .contact-stock-report-stat--accent {
    border-color: rgba(96, 165, 250, 0.24);
    background: linear-gradient(180deg, rgba(30, 64, 175, 0.18) 0%, rgba(30, 41, 59, 0.28) 100%);
}

:root[data-theme='dark'] .contact-payments-stat--accent,
:root[data-theme='dark'] .contact-payments-head-pill {
    border-color: rgba(96, 165, 250, 0.24);
    background: linear-gradient(180deg, rgba(30, 64, 175, 0.18) 0%, rgba(30, 41, 59, 0.28) 100%);
    color: #bfdbfe;
}

:root[data-theme='dark'] .contact-payments-table-wrap,
:root[data-theme='dark'] .contact-payments-pagination {
    border-color: #334866;
}

:root[data-theme='dark'] .contact-payments-table thead th {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    border-bottom-color: #334866 !important;
}

:root[data-theme='dark'] .contact-payments-table tbody td {
    color: #cbd5e1;
    border-bottom-color: #25324b !important;
}

:root[data-theme='dark'] .contact-payments-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

:root[data-theme='dark'] .contact-payment-cell-muted {
    background: rgba(255, 255, 255, 0.03);
}

:root[data-theme='dark'] .contact-payment-method-badge {
    background: rgba(96, 165, 250, 0.16);
    color: #bfdbfe;
}

:root[data-theme='dark'] .contact-payment-method-meta,
:root[data-theme='dark'] .contact-payment-method-meta small {
    color: #94a3b8;
}

:root[data-theme='dark'] .contact-payments-pagination-links .pagination > li > a,
:root[data-theme='dark'] .contact-payments-pagination-links .pagination > li > span {
    border-color: #334866;
    background: #10192a;
    color: #cbd5e1;
}

:root[data-theme='dark'] .contact-payments-delete-btn {
    background: rgba(127, 29, 29, 0.24);
    border-color: rgba(248, 113, 113, 0.24);
    color: #fecaca;
}

:root[data-theme='dark'] .contact-payments-delete-btn:hover,
:root[data-theme='dark'] .contact-payments-delete-btn:focus {
    background: rgba(153, 27, 27, 0.32);
    border-color: rgba(248, 113, 113, 0.34);
    color: #fee2e2;
}

:root[data-theme='dark'] .contact-ledger-results .contact-ledger-party-card,
:root[data-theme='dark'] .contact-ledger-results .contact-ledger-summary-card,
:root[data-theme='dark'] .contact-ledger-results .table-responsive {
    border-color: #334866;
    background: #162136;
    box-shadow: none;
}

:root[data-theme='dark'] .contact-ledger-results .contact-ledger-label,
:root[data-theme='dark'] .contact-ledger-results .contact-ledger-summary-title,
:root[data-theme='dark'] .contact-ledger-results .contact-ledger-heading,
:root[data-theme='dark'] .contact-ledger-results .table > thead > tr > th,
:root[data-theme='dark'] .contact-ledger-results .blue-heading {
    color: #94a3b8;
}

:root[data-theme='dark'] .contact-ledger-results .table > thead > tr > th {
    background: #111a2c;
    border-bottom-color: #334866;
}

:root[data-theme='dark'] .contact-ledger-results #ledger_table thead > tr > th,
:root[data-theme='dark'] .contact-ledger-results #ledger_table thead tr.blue-heading th {
    background: #1a2740 !important;
    color: #e8eef8 !important;
    border-bottom-color: rgba(148, 163, 184, 0.22) !important;
}

:root[data-theme='dark'] .contact-ledger-results #ledger_table.table > tbody > tr > td.dataTables_empty {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #94a3b8 !important;
}

:root[data-theme='dark'] .contact-ledger-results .table > tbody > tr > td,
:root[data-theme='dark'] .contact-ledger-results .contact-ledger-summary-table > tbody > tr > td {
    border-top-color: #334866;
}

:root[data-theme='dark'] .contact-ledger-results .bg-gray,
:root[data-theme='dark'] .contact-ledger-results .bg-light-gray {
    background: rgba(255, 255, 255, 0.04) !important;
}

:root[data-theme='dark'] .contact-ledger-group-row > td,
:root[data-theme='dark'] .contact-ledger-detail-cell > table td strong,
:root[data-theme='dark'] .contact-ledger-detail-cell > table td b {
    color: #f8fbff;
}

:root[data-theme='dark'] .contact-ledger-detail-cell {
    background: #111a2c !important;
}

:root[data-theme='dark'] .contact-ledger-detail-cell > table {
    border-color: #334866;
    background: #162136;
}

:root[data-theme='dark'] .contact-ledger-detail-cell > table td,
:root[data-theme='dark'] .contact-ledger-detail-cell > table th {
    border-color: #334866;
}

:root[data-theme='dark'] .contact-ledger-detail-cell > table th {
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
}

:root[data-theme='dark'] .contact-ledger-detail-cell > table td {
    color: #cbd5e1;
}

:root[data-theme='dark'] .contact-ledger-party-divider {
    background: #334866;
}

:root[data-theme='dark'] .contact-ledger-statement-title,
:root[data-theme='dark'] .contact-ledger-transaction-title,
:root[data-theme='dark'] .contact-ledger-statement-kpi-value,
:root[data-theme='dark'] .contact-ledger-aging-value,
:root[data-theme='dark'] .contact-ledger-balance-pill {
    color: #f8fbff;
}

:root[data-theme='dark'] .contact-ledger-statement-subtitle,
:root[data-theme='dark'] .contact-ledger-statement-kpi-label,
:root[data-theme='dark'] .contact-ledger-transaction-meta,
:root[data-theme='dark'] .contact-ledger-aging-label {
    color: #94a3b8;
}

:root[data-theme='dark'] .contact-ledger-statement-kpi,
:root[data-theme='dark'] .contact-ledger-aging-panel,
:root[data-theme='dark'] .contact-ledger-aging-card,
:root[data-theme='dark'] .contact-ledger-balance-pill {
    border-color: #334866;
    background: #111a2c;
    box-shadow: none;
}

:root[data-theme='dark'] .contact-ledger-aging-card--success {
    background: rgba(34, 197, 94, 0.12);
}

:root[data-theme='dark'] .contact-ledger-aging-card--warning {
    background: rgba(250, 204, 21, 0.16);
}

:root[data-theme='dark'] .contact-ledger-aging-card--amber {
    background: rgba(249, 115, 22, 0.14);
}

:root[data-theme='dark'] .contact-ledger-aging-card--danger {
    background: rgba(239, 68, 68, 0.14);
}

:root[data-theme='dark'] .contact-ledger-aging-card--accent {
    background: rgba(59, 130, 246, 0.14);
}

/* —— Contacts import —— */
.contacts-import-page .nestiko-shell-kpis {
    margin-bottom: 0.5rem;
}

.contacts-import-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.contacts-import-panel-body {
    padding: 1rem 1.05rem;
}

.contacts-import-warning {
    margin-bottom: 0.9rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid #fecaca;
    border-radius: 0.55rem;
    background: #fff1f2;
    color: #b91c1c;
    font-size: 0.82rem;
    line-height: 1.5;
}

.contacts-import-form {
    margin: 0;
}

.contacts-import-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
    align-items: end;
}

.contacts-import-file-field {
    margin-bottom: 0;
}

.contacts-import-file-input {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0.55rem 0.65rem;
    border: 1px dashed var(--border-strong, #cbd5e1);
    border-radius: 0.55rem;
    background: var(--bg-surface-soft, #f8fafc);
}

.contacts-import-help,
.contacts-import-copy {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.contacts-import-copy + .contacts-import-copy {
    margin-top: 0.25rem;
}

.contacts-import-copy--muted {
    color: var(--text-muted, #64748b);
}

.contacts-import-submit-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
}

.contacts-import-checklist {
    margin: 0;
    padding-left: 1.15rem;
    color: var(--text-secondary, #475569);
    font-size: 0.83rem;
    line-height: 1.6;
}

.contacts-import-checklist li + li {
    margin-top: 0.35rem;
}

.contacts-import-checklist code {
    padding: 0.08rem 0.35rem;
    border-radius: 0.3rem;
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--text-primary, #0f172a);
}

.contacts-import-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.contacts-import-table {
    width: 100%;
    min-width: 52rem;
    margin-top: 0.85rem;
}

.products-import-page .contacts-import-table {
    min-width: 68rem;
}

.contacts-import-table th:first-child,
.contacts-import-table td:first-child {
    width: 5.5rem;
}

.selling-price-update-page .selling-price-update-export-action,
.selling-price-update-page .selling-price-update-steps {
    margin-top: 0.85rem;
}

/* —— Print labels —— */
.labels-page .labels-page-copy {
    margin: 0.35rem 0 0;
    max-width: 58rem;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.labels-page .users-toolbar-row {
    margin-bottom: 1rem;
}

.labels-page .users-panel + .users-panel {
    margin-top: 1rem;
}

.labels-page .labels-panel-body {
    padding: 1.05rem 1.1rem 1.15rem;
}

.labels-page .labels-panel-body .form-control {
    min-height: 2.5rem;
    border-radius: 0.58rem;
    border: 1px solid var(--border-default, #dbe2ea);
    background: var(--bg-surface, #ffffff);
    color: var(--text-primary, #0f172a);
    box-shadow: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.labels-page .labels-panel-body .form-control:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.labels-page .labels-panel-body .input-group {
    display: flex;
    align-items: stretch;
}

.labels-page .labels-panel-body .input-group > .form-control,
.labels-page .labels-panel-body .input-group > select.form-control {
    flex: 1 1 auto;
}

.labels-page .labels-panel-body .input-group-addon {
    min-width: 2.55rem;
    border-color: var(--border-default, #dbe2ea);
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--text-muted, #64748b);
}

.labels-page .labels-panel-body .input-group .input-group-addon + .form-control,
.labels-page .labels-panel-body .input-group .input-group-addon + select.form-control {
    border-left: none;
    border-radius: 0 0.58rem 0.58rem 0;
}

.labels-page .labels-builder-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.9rem;
    margin-bottom: 0.95rem;
}

.labels-page .labels-builder-toolbar__search {
    flex: 1 1 24rem;
}

.labels-page .labels-builder-toolbar__summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.labels-page .labels-inline-stat {
    min-width: 9rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.82rem;
    background: var(--bg-surface-soft, #f8fafc);
}

.labels-page .labels-inline-stat span {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.labels-page .labels-inline-stat strong {
    display: block;
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary, #0f172a);
}

.labels-page .labels-search-field {
    margin-bottom: 0;
}

.labels-page .labels-builder-note {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid #ddd6fe;
    border-radius: 0.9rem;
    background: linear-gradient(180deg, #faf5ff 0%, #f8fafc 100%);
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-secondary, #475569);
}

.labels-page .labels-builder-note strong {
    color: var(--text-primary, #0f172a);
}

.labels-page .labels-products-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.9rem;
    background: var(--bg-surface, #ffffff);
}

.labels-page .labels-products-table {
    width: 100% !important;
    min-width: 72rem;
    margin: 0 !important;
    border-collapse: collapse !important;
}

.labels-page .labels-products-table th {
    padding: 0.72rem 0.82rem;
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--text-primary, #0f172a);
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    border-color: var(--border-default, #e2e8f0);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: middle;
}

.labels-page .labels-products-table td {
    padding: 0.82rem 0.78rem;
    vertical-align: top;
    border-color: var(--border-default, #e2e8f0);
}

.labels-page .labels-products-table th:first-child,
.labels-page .labels-products-table td:first-child {
    min-width: 18rem;
    white-space: normal;
}

.labels-page .labels-product-meta {
    display: grid;
    gap: 0.45rem;
}

.labels-page .labels-product-name {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-primary, #0f172a);
}

.labels-page .labels-product-variation {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.28rem 0.55rem;
    border: 1px solid #cbd5f5;
    border-radius: 999px;
    background: #eef2ff;
    font-size: 0.74rem;
    font-weight: 700;
    color: #4338ca;
}

.labels-page .labels-row-input,
.labels-page .labels-row-select {
    min-width: 8rem;
}

.labels-page .labels-row-input--qty {
    min-width: 6.5rem;
}

.labels-page .labels-empty-state td {
    padding: 0 !important;
}

.labels-page .labels-empty-state__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 15rem;
    padding: 1.5rem;
    text-align: center;
}

.labels-page .labels-empty-state__inner i {
    font-size: 1.65rem;
    color: #8b5cf6;
}

.labels-page .labels-empty-state__inner strong {
    font-size: 0.95rem;
    color: var(--text-primary, #0f172a);
}

.labels-page .labels-empty-state__inner p {
    max-width: 22rem;
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-secondary, #475569);
}

.labels-page .labels-config-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.labels-page .labels-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0.85rem;
}

.labels-page .labels-config-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    height: 100%;
    padding: 0.95rem 1rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.95rem;
    background: var(--bg-surface, #ffffff);
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease,
        opacity 0.18s ease;
}

.labels-page .labels-config-card:hover {
    border-color: #c4b5fd;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.labels-page .labels-config-card--disabled {
    opacity: 0.76;
    background: var(--bg-surface-soft, #f8fafc);
}

.labels-page .labels-config-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.labels-page .labels-config-card__toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-primary, #0f172a);
}

.labels-page .labels-config-card__checkbox {
    width: 1rem;
    height: 1rem;
    margin: 0.15rem 0 0;
    accent-color: #8b5cf6;
    flex-shrink: 0;
}

.labels-page .labels-config-card__tag {
    display: inline-flex;
    align-items: center;
    padding: 0.24rem 0.55rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--text-muted, #64748b);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.labels-page .labels-config-card__field-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.labels-page .labels-config-card__extra {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px dashed var(--border-default, #dbe2ea);
}

.labels-page .labels-config-card__extra .form-group {
    margin-bottom: 0;
}

.labels-page .labels-output-card {
    position: sticky;
    top: 1.25rem;
    padding: 1.05rem 1.1rem;
    border: 1px solid #ddd6fe;
    border-radius: 1rem;
    background: linear-gradient(180deg, #faf5ff 0%, #f8fafc 100%);
}

.labels-page .labels-output-card__kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7c3aed;
}

.labels-page .labels-output-card__title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary, #0f172a);
}

.labels-page .labels-output-card__copy {
    margin: 0.5rem 0 1rem;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-secondary, #475569);
}

.labels-page .labels-output-card__meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.labels-page .labels-output-card__meta-item {
    padding: 0.78rem 0.85rem;
    border: 1px solid rgba(139, 92, 246, 0.16);
    border-radius: 0.82rem;
    background: rgba(255, 255, 255, 0.55);
}

.labels-page .labels-output-card__meta-item span {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.labels-page .labels-output-card__meta-item strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.labels-page .labels-output-card__list {
    display: grid;
    gap: 0.45rem;
    margin: 0 0 1rem;
    padding-left: 1.1rem;
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.labels-page .labels-preview-button {
    width: 100%;
    min-height: 2.6rem;
    justify-content: center;
    gap: 0.5rem;
}

@media (max-width: 991px) {
    .labels-page .labels-output-card {
        position: static;
        margin-top: 1rem;
    }
}

@media (max-width: 767px) {
    .labels-page .labels-panel-body {
        padding: 0.95rem;
    }

    .labels-page .labels-builder-toolbar__summary {
        width: 100%;
    }

    .labels-page .labels-output-card__meta {
        grid-template-columns: 1fr;
    }
}

/* —— Products list & stock report —— */
.products-filters-panel {
    min-width: min(72rem, calc(100vw - 2rem));
}

.products-filter-row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.products-filter-row > [class*='col-'] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.products-filters-panel .form-group {
    margin-bottom: 0.85rem;
}

.products-filters-panel .form-group label {
    display: block;
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.products-filters-panel .form-control,
.products-filters-panel .select2-container--default .select2-selection--single {
    min-height: 2.2rem;
    border-radius: 0.45rem !important;
    border-color: var(--border-default, #e2e8f0) !important;
    box-shadow: none !important;
}

.products-filters-panel .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 2.1rem;
    padding-left: 0.65rem;
    font-size: 0.84rem;
}

.products-filters-panel .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 2.1rem;
}

.products-filter-check {
    display: flex;
    align-items: flex-end;
    min-height: 4.5rem;
}

.products-filter-check label {
    display: inline-flex !important;
    align-items: center;
    gap: 0.35rem;
    margin: 0 !important;
}

.products-filter-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.35rem;
}

.products-tabs {
    margin-top: 0.25rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.7rem;
    background: var(--bg-surface, #fff);
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.08));
    overflow: hidden;
}

.products-tab-nav {
    margin-bottom: 0.85rem;
}

.products-page #product_list_tab .users-table-controls {
    flex-wrap: wrap;
    align-items: flex-start;
}

.products-page #product_list_tab .users-table-controls__bulk {
    flex: 1 1 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.12rem;
}

.products-page #product_list_tab .users-table-controls__tools {
    flex: 1 1 100%;
    min-width: 0;
}

.products-page #product_list_tab .users-table-controls__tools-inner {
    width: 100%;
    justify-content: flex-end;
}

.products-tab-panels {
    padding: 0;
    background: transparent;
    border: 0;
}

.products-tab-panels > .tab-pane {
    padding: 0;
}

.products-page .products-table-controls-bulk {
    gap: 0.45rem;
    flex-wrap: wrap;
}

.products-page .products-table-controls-bulk form {
    margin: 0;
    display: inline-flex;
}

.products-page .products-dt-tools-host,
.products-page .products-stock-dt-tools-host {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem 0.45rem;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
}

.products-page .dt-buttons {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.products-page .products-native-tools {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
}

.products-page .products-native-tools .dt-button,
.products-page .products-native-tools a.dt-button,
.products-page .products-native-tools button.dt-button,
.products-page .products-native-tools .products-dt-button,
.products-page .products-native-tools a.products-dt-button,
.products-page .products-native-tools button.products-dt-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.25rem !important;
    min-height: 2rem !important;
    padding: 0.32rem 0.5rem !important;
    border: 1px solid var(--border-default, #e2e8f0) !important;
    border-radius: 0.35rem !important;
    background: var(--bg-surface, #fff) !important;
    color: var(--text-primary, #1e293b) !important;
    font-size: 0.74rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.products-page .products-native-tools .dt-button i {
    font-size: 0.86rem;
}

.products-page .products-native-tools .products-dt-button i {
    font-size: 0.86rem;
}

.products-page .products-native-tools .dt-button span {
    display: inline-block;
    margin-left: 0.2rem;
}

.products-page .products-native-tools .products-dt-button span {
    display: inline-block;
    margin-left: 0.2rem;
}

.products-page .dt-buttons .dt-button,
.products-page .dt-buttons a.dt-button,
.products-page .dt-buttons button.dt-button,
.products-page .dt-buttons .products-dt-button,
.products-page .dt-buttons a.products-dt-button,
.products-page .dt-buttons button.products-dt-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.32rem 0.48rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.35rem;
    background: var(--bg-surface, #fff);
    color: var(--text-primary, #1e293b);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: none !important;
    text-decoration: none !important;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.products-page .dt-buttons .dt-button:hover,
.products-page .dt-buttons .dt-button:focus,
.products-page .dt-buttons .products-dt-button:hover,
.products-page .dt-buttons .products-dt-button:focus {
    background: var(--bg-surface-soft, #f8fafc);
    border-color: var(--border-strong, #cbd5e1);
    color: inherit;
}

.products-page .dt-buttons .dt-button.active,
.products-page .dt-buttons .products-dt-button.active {
    background: var(--bg-surface-soft, #f8fafc);
}

.products-page table#product_table.dataTable,
.products-page table.products-data-table.dataTable {
    width: 100% !important;
    min-width: 112rem !important;
    margin: 0 !important;
    border-collapse: collapse !important;
}

.products-page table#stock_report_table.dataTable,
.products-page table.product-stock-report-data-table.dataTable {
    width: 100% !important;
    min-width: 98rem !important;
    margin: 0 !important;
    border-collapse: collapse !important;
}

.products-page .roles-panel table.users-table.dataTable tbody td {
    white-space: nowrap;
}

.products-page table#product_table.dataTable thead th:first-child,
.products-page table#product_table.dataTable tbody td:first-child {
    width: 2.5rem;
    text-align: center;
}

.products-page table#stock_report_table.dataTable thead th:first-child,
.products-page table#stock_report_table.dataTable tbody td:first-child {
    min-width: 6rem;
}

.products-page .roles-panel .dataTables_scrollHead,
.products-page .roles-panel .dataTables_scrollBody {
    border: 0;
}

.products-page .roles-panel .dataTables_scrollHead table.dataTable {
    margin-top: 0 !important;
}

.products-page .product-thumbnail-small {
    width: 2.9rem;
    height: 2.9rem;
    object-fit: cover;
    border-radius: 0.45rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.products-page .products-grid-actions.btn-group {
    display: inline-block;
    vertical-align: middle;
}

.products-page .products-grid-actions > .dropdown-toggle:not(.users-btn-primary):not(.users-btn-light),
.products-page .btn-group > .dropdown-toggle:not(.users-btn-primary):not(.users-btn-light) {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2rem;
    padding: 0.32rem 0.5rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.4rem;
    background: var(--bg-surface, #fff);
    color: var(--text-secondary, #475569);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: none;
}

.products-page .products-grid-actions.btn-group.open > .dropdown-toggle:not(.users-btn-primary):not(.users-btn-light),
.products-page .products-grid-actions > .dropdown-toggle:not(.users-btn-primary):not(.users-btn-light):hover,
.products-page .products-grid-actions > .dropdown-toggle:not(.users-btn-primary):not(.users-btn-light):focus,
.products-page .btn-group.open > .dropdown-toggle:not(.users-btn-primary):not(.users-btn-light),
.products-page .btn-group > .dropdown-toggle:not(.users-btn-primary):not(.users-btn-light):hover,
.products-page .btn-group > .dropdown-toggle:not(.users-btn-primary):not(.users-btn-light):focus {
    background: var(--bg-surface-soft, #f8fafc);
    border-color: var(--border-strong, #cbd5e1);
    color: inherit;
}

.products-page .products-action-menu,
.products-page .dropdown-menu {
    border-radius: 0.55rem;
    border-color: var(--border-default, #e2e8f0);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
    padding: 0.25rem 0;
    min-width: 12.5rem;
    overflow: hidden;
}

.products-page .products-action-menu > li > a,
.products-page .dropdown-menu > li > a {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    font-size: 0.78rem;
    color: var(--text-secondary, #475569);
}

.products-page .products-action-menu > li > a:hover,
.products-page .dropdown-menu > li > a:hover {
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--text-primary, #0f172a);
}

.products-page .products-action-menu > li > a i,
.products-page .dropdown-menu > li > a i {
    width: 1rem;
    text-align: center;
}

.products-page .products-action-menu > li > a.delete-product {
    color: var(--danger-text, #b91c1c);
}

.products-page .products-action-menu > li > a.delete-product:hover {
    background: rgba(220, 38, 38, 0.08);
    color: #991b1b;
}

.expenses-grid-actions.btn-group {
    display: inline-block;
    vertical-align: middle;
}

.expenses-filters-panel {
    width: min(1100px, calc(100vw - 2rem));
}

.expenses-filter-hint {
    margin-bottom: 0.9rem;
}

.expenses-filters-grid {
    display: grid;
    gap: 0.95rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.expenses-filter-item--wide {
    grid-column: span 2;
}

.expenses-filter-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* Purchase requisition list — action dropdown */
.purchase-requisition-page .dropdown-menu {
    border-radius: 0.55rem;
    border-color: var(--border-default, #e2e8f0);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
    padding: 0.25rem 0;
    min-width: 12.5rem;
    overflow: hidden;
}

.purchase-requisition-page .dropdown-menu > li > a {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    font-size: 0.78rem;
    color: var(--text-secondary, #475569);
}

.purchase-requisition-page .dropdown-menu > li > a:hover {
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--text-primary, #0f172a);
}

.purchase-requisition-page .dropdown-menu > li > a i {
    width: 1rem;
    text-align: center;
}

:root[data-theme='dark'] .purchase-requisition-page .dropdown-menu {
    border-color: var(--border-strong, #334866);
    background: var(--bg-surface, #111827);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

:root[data-theme='dark'] .purchase-requisition-page .dropdown-menu > li > a {
    color: var(--text-secondary, #cbd5e1);
}

:root[data-theme='dark'] .purchase-requisition-page .dropdown-menu > li > a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary, #f8fafc);
}

.expenses-action-menu > li > a.delete_expense {
    color: var(--danger-text, #b91c1c);
}

.expenses-action-menu > li > a.delete_expense:hover {
    background: rgba(220, 38, 38, 0.08);
    color: #991b1b;
}

@media (max-width: 767px) {
    .expenses-filter-item--wide {
        grid-column: span 1;
    }
}

.products-page .dropdown-menu .divider {
    margin: 0.25rem 0;
}

:is(.products-page, .stock-report-page) .products-stock-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 1.8rem;
    padding: 0.24rem 0.45rem;
    border-radius: 0.38rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none !important;
    vertical-align: middle;
}

:is(.products-page, .stock-report-page) .products-stock-action-btn i {
    font-size: 0.82rem;
}

:is(.products-page, .stock-report-page) #stock_report_table td .products-stock-action-btn + .products-stock-action-btn {
    margin-left: 0.3rem;
}

/* —— Products add / duplicate —— */
.products-add-page {
    padding-top: 0.05rem;
}

.products-add-page .products-add-copy {
    margin: 0.35rem 0 0;
    max-width: 58rem;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.products-add-page .users-toolbar-row {
    margin-bottom: 1rem;
}

.products-add-page .products-add-mode-pill {
    cursor: default;
}

.products-add-page .products-add-section {
    overflow: hidden;
}

.products-add-page .products-add-section .box-header small {
    display: block;
    margin-top: 0.32rem;
    line-height: 1.45;
    color: var(--text-muted, #64748b);
}

/* Unit / brand: compact “Add …” above full-width select (not inline +) */
.products-add-page .products-add-field-stack .select2-container {
    width: 100% !important;
}

.products-add-page .products-add-field-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-bottom: 0.38rem;
}

.products-add-page .products-add-field-head__label {
    margin-bottom: 0 !important;
    padding-right: 0.15rem;
    font-weight: 600;
    flex: 1 1 8rem;
    min-width: 0;
    line-height: 1.25;
}

.products-add-page .products-add-quickadd-btn {
    flex: 0 1 auto;
    max-width: 100%;
    border-style: dashed;
    border-color: var(--border-strong, #cbd5e1);
    background: transparent;
    color: var(--text-secondary, #475569);
    font-weight: 600;
}

.products-add-page .products-add-quickadd-btn:hover,
.products-add-page .products-add-quickadd-btn:focus {
    border-style: solid;
    background: var(--bg-surface-soft, #f1f5f9);
    color: var(--text-primary, #0f172a);
}

:root[data-theme='dark'] .products-add-page .products-add-quickadd-btn {
    border-color: var(--border-strong, #334866);
    background: rgba(15, 23, 42, 0.35);
    color: var(--text-secondary, #cbd5e1);
}

:root[data-theme='dark'] .products-add-page .products-add-quickadd-btn:hover,
:root[data-theme='dark'] .products-add-page .products-add-quickadd-btn:focus {
    background: rgba(30, 41, 59, 0.85);
    color: var(--text-primary, #f1f5f9);
}

.products-add-page .products-add-section .input-group {
    display: flex;
    align-items: stretch;
}

.products-add-page .products-add-section .input-group > .form-control,
.products-add-page .products-add-section .input-group > .select2-container {
    flex: 1 1 auto;
}

.products-add-page .products-add-section .input-group-btn {
    width: auto;
}

.products-add-page .products-add-section .input-group-btn > .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    min-height: 2.35rem;
    border-color: var(--border-default, #e2e8f0);
    border-left: 0;
    border-radius: 0 0.45rem 0.45rem 0;
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--text-secondary, #475569);
    box-shadow: none;
}

.products-add-page .products-add-section .input-group > .form-control:first-child,
.products-add-page .products-add-section .input-group > .select2-container:first-child .select2-selection {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.products-add-page .products-add-section textarea.form-control {
    min-height: 10rem;
    resize: vertical;
}

.products-add-page .products-add-section input[type='file'] {
    display: block;
    width: 100%;
    font-size: 0.82rem;
    line-height: 1.4;
}

.products-add-page .products-add-section .form-group {
    margin-bottom: 1rem;
}

.products-add-page .products-add-pricing-head-row {
    margin-bottom: 0.15rem;
}

.products-add-page .products-add-pricing-body {
    margin-top: 0.3rem;
    margin-bottom: 0;
}

.products-add-page .products-add-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    margin: 0.2rem 0 0.8rem;
}

.products-add-page .products-add-section-head h4 {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.products-add-page .products-add-checkbox-help-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    min-height: 2.15rem;
}

.products-add-page .products-add-toggle-split-row {
    display: flex;
    flex-wrap: wrap;
}

.products-add-page .products-add-toggle-split-row > [class*='col-'] {
    display: flex;
}

.products-add-page .products-add-toggle-split-row .form-group {
    width: 100%;
}

.products-add-page .products-add-checkbox-help-row > label {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    line-height: 1.35;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.products-add-page .products-add-checkbox-help-row .users-help-trigger {
    margin: 0;
    flex-shrink: 0;
    align-self: center;
}

.products-add-page .products-add-checkbox-copy {
    margin-top: 0.45rem;
}

.products-add-page .products-add-media-stack {
    display: grid;
    gap: 1rem;
}

.products-add-page .products-add-upload-field {
    padding: 0.9rem 0.95rem;
    border: 1px dashed var(--border-default, #cbd5e1);
    border-radius: 0.75rem;
    background: var(--bg-surface-soft, #f8fafc);
}

.products-add-page .products-add-upload-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem 0.65rem;
    margin-bottom: 0.5rem;
}

.products-add-page .products-add-upload-head label {
    margin-bottom: 0;
}

.products-add-page .products-add-upload-required {
    display: inline-flex;
    align-items: center;
    min-height: 1.35rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: rgba(67, 56, 202, 0.1);
    color: var(--link-primary, #4338ca);
}

.products-add-page .products-add-upload-input {
    display: block;
    width: 100%;
    min-height: 2.6rem;
    padding: 0.3rem 0.4rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.55rem;
    background: var(--bg-surface, #fff);
    color: var(--text-secondary, #475569);
    font-size: 0.82rem;
    line-height: 1.35;
}

.products-add-page .products-add-upload-input::file-selector-button {
    margin-right: 0.7rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--border-default, #cbd5e1);
    border-radius: 0.45rem;
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--text-primary, #0f172a);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.products-add-page .products-add-upload-help {
    margin: 0.55rem 0 0;
    font-size: 0.74rem;
    line-height: 1.5;
    color: var(--text-muted, #64748b);
}

.products-add-page .products-add-upload-field .file-input {
    display: block;
    width: 100%;
}

.products-add-page .products-add-upload-field .file-input .input-group {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    width: 100%;
}

.products-add-page .products-add-upload-field .file-caption-main,
.products-add-page .products-add-upload-field .file-input .form-control.file-caption {
    flex: 1 1 auto;
    min-width: 0;
}

.products-add-page .products-add-upload-field .file-input .form-control.file-caption {
    min-height: 2.6rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.55rem 0 0 0.55rem;
    background: var(--bg-surface, #fff);
    box-shadow: none;
    color: var(--text-secondary, #475569);
    font-size: 0.82rem;
}

.products-add-page .products-add-upload-field .file-input .input-group-btn {
    display: flex;
    align-items: stretch;
}

.products-add-page .products-add-upload-field .file-input .btn-file,
.products-add-page .products-add-upload-field .file-input .fileinput-remove,
.products-add-page .products-add-upload-field .file-input .fileinput-upload {
    min-height: 2.6rem;
    border-color: var(--border-default, #cbd5e1);
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--text-primary, #0f172a);
    font-size: 0.78rem;
    font-weight: 600;
    box-shadow: none;
}

.products-add-page .products-add-upload-field .file-input .btn-file {
    border-radius: 0 0.55rem 0.55rem 0;
}

.products-add-page .products-add-upload-field .file-preview {
    margin: 0.7rem 0 0;
    padding: 0.5rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.65rem;
    background: var(--bg-surface, #fff);
    box-shadow: none;
}

.products-add-page .products-add-upload-field .file-drop-zone {
    margin: 0;
    border: 1px dashed var(--border-default, #cbd5e1);
    border-radius: 0.55rem;
}

.products-add-page .products-add-upload-field .file-drop-zone-title {
    padding: 1rem 0.75rem;
    color: var(--text-muted, #64748b);
    font-size: 0.78rem;
}

.products-add-page .products-add-upload-field .file-preview-frame {
    margin: 0.4rem;
    border-radius: 0.55rem;
    box-shadow: none;
}

.products-add-page .products-add-description-input {
    min-height: 12rem !important;
}

.products-add-page .products-add-rack-col {
    margin-bottom: 0.9rem;
}

.products-add-page .products-add-rack-card {
    padding: 0.9rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.75rem;
    background: var(--bg-surface-soft, #f8fafc);
}

.products-add-page .products-add-rack-card > label {
    display: block;
    margin-bottom: 0.55rem;
    font-size: 0.79rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.products-add-page .products-add-rack-card .form-control + .form-control {
    margin-top: 0.55rem;
}

.products-add-page .multi-input {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.55rem;
}

.products-add-page .multi-input > label {
    flex: 1 0 100%;
    margin-bottom: 0;
}

.products-add-page .multi-input > .form-control {
    flex: 3 1 12rem;
    width: auto !important;
}

.products-add-page .multi-input > .select2-container {
    flex: 2 1 10rem;
    width: auto !important;
}

.products-add-page .option-div-group {
    margin-bottom: 1rem;
}

.products-add-page .add-product-price-table {
    margin-bottom: 0;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--bg-surface, #fff);
}

.products-add-page .add-product-price-table th {
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--text-primary, #0f172a);
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    border-color: var(--border-default, #e2e8f0);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.products-add-page .add-product-price-table td {
    padding: 0.9rem 0.85rem;
    vertical-align: top;
    border-color: var(--border-default, #e2e8f0);
}

.products-add-page .add-product-price-table .form-group:last-child {
    margin-bottom: 0;
}

.products-add-page .combo_product_table_footer td {
    background: var(--bg-surface-soft, #f8fafc);
    font-weight: 600;
}

.products-single-price-shell {
    margin-top: 0.2rem;
}

.products-single-price-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.95rem;
}

.products-single-price-card {
    grid-column: span 12;
    min-width: 0;
    padding: 0.95rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.75rem;
    background: var(--bg-surface, #fff);
}

.products-single-price-card__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.55rem;
    margin-bottom: 0.75rem;
}

.products-single-price-card__title {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-primary, #0f172a);
}

.products-single-price-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.products-single-price-field {
    min-width: 0;
}

.products-single-price-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.products-single-price-card .form-group:last-child {
    margin-bottom: 0;
}

.products-single-existing-media {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0 0 0.65rem;
}

.products-single-existing-media .img-thumbnail {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
    border-radius: 0.6rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface, #fff);
    margin: 0;
}

.products-single-existing-media .img-thumbnail img {
    max-width: 4rem;
    max-height: 4rem;
    border-radius: 0.45rem;
    object-fit: cover;
}

.products-single-existing-media .delete-media {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
}

.products-add-page .variation_value_table td,
.products-add-page .variation_value_table th {
    vertical-align: top;
}

.products-add-page .variation_value_table .width-50 {
    width: 50%;
    float: left;
    padding-right: 0.25rem;
}

.products-add-page .variation_value_table .width-50 + .width-50 {
    padding-right: 0;
    padding-left: 0.25rem;
}

.products-add-page .combo_product_table + .col-sm-12 {
    margin-top: 1rem;
}

.products-add-page .combo_product_table + .col-sm-12 .col-sm-4 {
    margin-bottom: 0.85rem;
}

@media (min-width: 992px) {
    .products-single-price-card--purchase {
        grid-column: span 4;
    }

    .products-single-price-card--margin {
        grid-column: span 2;
    }

    .products-single-price-card--selling {
        grid-column: span 3;
    }

    .products-single-price-card--media {
        grid-column: span 3;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .products-single-price-card--purchase,
    .products-single-price-card--margin,
    .products-single-price-card--selling,
    .products-single-price-card--media {
        grid-column: span 6;
    }
}

@media (max-width: 575.98px) {
    .products-single-price-split {
        grid-template-columns: minmax(0, 1fr);
    }
}

.products-add-page .products-add-actions {
    margin-top: 1.4rem;
}

.products-add-page .products-add-submit-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.7rem;
}

.products-add-page .products-add-submit {
    min-height: 2.35rem;
    padding: 0.5rem 0.9rem;
    border-radius: 0.45rem;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.products-add-page .products-add-submit:hover,
.products-add-page .products-add-submit:focus {
    transform: none;
    box-shadow: none;
}

.products-add-page .users-btn.users-btn-primary.products-add-submit:hover,
.products-add-page .users-btn.users-btn-primary.products-add-submit:focus {
    color: #fff;
}

/* Add Product — full form in right drawer from List Products */
.product_add_drawer_modal .nestiko-product-add-drawer-dialog {
    width: min(920px, 96vw);
    margin: 0.75rem 0.75rem 0.75rem auto;
}

.nestiko-product-add-drawer-body {
    max-height: min(78vh, calc(100vh - 140px));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.nestiko-product-add-drawer-header {
    flex-shrink: 0;
}

/* TinyMCE: menus/dialogs above Nestiko modal drawer + header */
body .tox-tinymce-aux,
body .tox-dialog-wrap {
    z-index: 10170 !important;
}

.products-group-prices-page .products-group-prices-copy {
    margin: 0.35rem 0 0;
    max-width: 58rem;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.products-group-prices-page .users-toolbar-row {
    margin-bottom: 1rem;
}

.products-group-prices-panel {
    overflow: hidden;
}

.products-group-prices-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.products-group-prices-label {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.products-group-prices-product h3 {
    margin: 0.35rem 0 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.products-group-prices-product h3 span {
    color: var(--text-secondary, #475569);
    font-weight: 600;
}

.products-group-prices-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    min-width: 18rem;
}

.products-group-prices-meta-card {
    padding: 0.9rem 0.95rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.85rem;
    background: var(--bg-surface-soft, #f8fafc);
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.06));
}

.products-group-prices-meta-card span {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.products-group-prices-meta-card strong {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.products-group-prices-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.products-group-prices-page .products-group-prices-table {
    min-width: 56rem;
}

.products-group-prices-page .products-group-prices-table th {
    vertical-align: top;
}

.products-group-prices-head {
    display: grid;
    gap: 0.3rem;
}

.products-group-prices-head span {
    display: block;
}

.products-group-prices-head small {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.products-group-prices-variation strong {
    display: block;
    color: var(--text-primary, #0f172a);
    font-weight: 700;
}

.products-group-prices-variation span {
    display: block;
    margin-top: 0.22rem;
    color: var(--text-secondary, #475569);
    font-size: 0.76rem;
}

.products-group-prices-default-price {
    display: inline-flex;
    align-items: center;
    min-height: 2.35rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.products-group-prices-cell {
    display: grid;
    gap: 0.55rem;
}

.products-group-prices-cell .form-control {
    min-width: 8rem;
}

.products-group-prices-empty {
    padding: 1.2rem;
    border: 1px dashed var(--border-default, #cbd5e1);
    border-radius: 0.9rem;
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--text-secondary, #475569);
    font-size: 0.84rem;
    line-height: 1.65;
}

.purchase-requisition-create-page .purchase-requisition-create-copy {
    margin: 0.35rem 0 0;
    max-width: 58rem;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.stock-adjustment-create-page .stock-adjustment-create-copy {
    margin: 0.35rem 0 0;
    max-width: 58rem;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.stock-adjustment-create-page .stock-adjustment-create-panel-body {
    padding: 1rem 1.15rem;
}

.stock-adjustment-create-page .users-panel + .users-panel {
    margin-top: 1rem;
}

.expense-create-page .expense-create-copy {
    margin: 0.35rem 0 0;
    max-width: 58rem;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.expense-create-page .expense-create-panel-body {
    padding: 1rem 1.15rem;
}

.expense-create-page .users-panel + .users-panel {
    margin-top: 1rem;
}

.expense-create-page .expense-create-submit-wrap {
    margin-top: 1.25rem;
}

.expense-create-page .expense-create-panel-body hr {
    border-color: var(--border-default, #e2e8f0);
}

.purchase-create-page .purchase-create-copy {
    margin: 0.35rem 0 0;
    max-width: 58rem;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

/* Products strip: Import first, search grows, add product on the right */
.purchase-create-page .purchase-create-products-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.65rem 0.85rem;
    margin-bottom: 0.85rem;
}

.purchase-create-page .purchase-create-products-toolbar__import {
    flex: 0 0 auto;
}

.purchase-create-page .purchase-create-products-toolbar__search {
    flex: 1 1 14rem;
    min-width: 0;
}

.purchase-create-page .purchase-create-products-toolbar__search .form-group {
    margin-bottom: 0;
}

.purchase-create-page .purchase-create-products-toolbar__add {
    flex: 0 0 auto;
    margin-left: auto;
}

.purchase-create-page .purchase-create-products-toolbar__add .form-group {
    margin-bottom: 0;
}

.purchase-create-page .purchase-create-panel-body {
    padding: 1rem 1.15rem;
}

.purchase-create-page .users-panel + .users-panel {
    margin-top: 1rem;
}

.purchase-create-page .purchase-create-submit-wrap {
    margin-top: 0.75rem;
}

.purchase-create-page .purchase-create-panel-body .table-th-green thead th {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.12) 0%, rgba(5, 150, 105, 0.08) 100%);
}

.purchase-return-add-page .purchase-return-add-panel-body {
    padding: 1rem 1.15rem;
}

.purchase-return-add-page .users-panel + .users-panel {
    margin-top: 1rem;
}

.purchase-requisition-create-page .users-toolbar-row {
    align-items: center;
    margin-bottom: 1rem;
}

.purchase-requisition-create-panel {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.purchase-requisition-create-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.15rem;
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.06) 0%, rgba(59, 130, 246, 0.04) 100%);
}

.purchase-requisition-create-hero-copy {
    max-width: 46rem;
}

.purchase-requisition-create-kicker,
.purchase-requisition-create-section-kicker {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7c3aed;
}

.purchase-requisition-create-hero-copy h3,
.purchase-requisition-create-section-head h4 {
    margin: 0.35rem 0 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.purchase-requisition-create-hero-copy p:last-child,
.purchase-requisition-create-section-head p {
    margin: 0.45rem 0 0;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--text-secondary, #475569);
}

.purchase-requisition-create-hero-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    min-width: 22rem;
}

.purchase-requisition-create-meta-card {
    padding: 0.9rem 0.95rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.06));
}

.purchase-requisition-create-meta-card span {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.purchase-requisition-create-meta-card strong {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    line-height: 1.45;
    word-break: break-word;
}

.purchase-requisition-create-section {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 1rem;
    background: var(--bg-surface-soft, #f8fafc);
    padding: 1rem 1.05rem;
}

.purchase-requisition-create-section--table {
    background: var(--bg-surface, #ffffff);
}

.purchase-requisition-create-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.95rem;
}

.purchase-requisition-create-section-head > p {
    max-width: 29rem;
}

.purchase-requisition-field label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.purchase-requisition-field .form-control,
.purchase-requisition-field .select2-container .select2-selection--single,
.purchase-requisition-field .select2-container .select2-selection--multiple,
.purchase-requisition-line-input-group .form-control,
.purchase-requisition-input-group .form-control {
    min-height: 2.8rem;
    border-radius: 0.8rem;
    border-color: var(--border-default, #dbe2ea);
    box-shadow: none;
}

.purchase-requisition-input-group .input-group-addon,
.purchase-requisition-line-input-group .input-group-addon {
    border-color: var(--border-default, #dbe2ea);
    background: var(--bg-surface, #ffffff);
    color: var(--text-secondary, #475569);
}

.purchase-requisition-create-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.purchase-requisition-create-table-wrap {
    position: relative;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 1rem;
    overflow: hidden;
    background: var(--bg-surface, #ffffff);
}

.purchase-requisition-create-table {
    width: 100%;
    min-width: 52rem;
    margin: 0 !important;
}

.purchase-requisition-create-table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #64748b);
    font-weight: 700;
    background: var(--bg-surface-soft, #f8fafc);
    border-bottom: 1px solid var(--border-default, #e2e8f0) !important;
    padding: 0.78rem 0.82rem !important;
    vertical-align: middle;
}

.purchase-requisition-create-table tbody td {
    padding: 0.95rem 0.82rem !important;
    border-bottom: 1px solid #eef2f7 !important;
    vertical-align: top;
    color: var(--text-secondary, #334155);
    font-size: 0.82rem;
}

.purchase-requisition-create-table tbody tr:last-child td {
    border-bottom: none !important;
}

.purchase-requisition-line-product strong,
.purchase-requisition-line-alert {
    display: block;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.purchase-requisition-line-product span,
.purchase-requisition-line-product p,
.purchase-requisition-line-secondary-label {
    display: block;
    margin: 0.28rem 0 0;
    font-size: 0.76rem;
    line-height: 1.5;
    color: var(--text-muted, #64748b);
}

.purchase-requisition-line-secondary-label {
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.purchase-requisition-line-input-group + .purchase-requisition-line-secondary-label {
    margin-top: 0.7rem;
}

.purchase-requisition-create-table .remove_product_line {
    min-width: 2.35rem;
    justify-content: center;
}

.purchase-requisition-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 2.2rem 1rem;
    text-align: center;
    color: var(--text-muted, #64748b);
    border-top: 1px solid var(--border-default, #e2e8f0);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, rgba(255, 255, 255, 0.94) 100%);
}

.purchase-requisition-empty-state strong {
    color: var(--text-primary, #0f172a);
    font-size: 0.94rem;
}

.purchase-requisition-empty-state span {
    max-width: 36rem;
    font-size: 0.82rem;
    line-height: 1.6;
}

.purchase-requisition-empty-state.is-hidden {
    display: none;
}

.purchase-requisition-submit-bar {
    justify-content: center;
}

@media (max-width: 991px) {
    .purchase-requisition-create-hero,
    .purchase-requisition-create-section-head {
        flex-direction: column;
    }

    .purchase-requisition-create-hero-meta {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 767px) {
    .purchase-requisition-create-hero-meta {
        grid-template-columns: minmax(0, 1fr);
    }

    .purchase-requisition-create-actions,
    .purchase-requisition-submit-bar {
        justify-content: stretch;
    }

    .purchase-requisition-create-actions .users-btn,
    .purchase-requisition-submit-bar .users-btn {
        width: 100%;
        justify-content: center;
    }
}

.products-stock-history-page .products-stock-history-copy {
    margin: 0.35rem 0 0;
    max-width: 58rem;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.products-stock-history-page .users-toolbar-row {
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    box-sizing: border-box;
}

.products-stock-history-page .users-toolbar-actions--end {
    flex-shrink: 0;
}

.products-stock-history-page .products-stock-history-product-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 0.4rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
    border: 1px solid rgba(59, 130, 246, 0.28);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.12) 0%, rgba(99, 102, 241, 0.08) 100%);
    color: var(--text-primary, #1e293b);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

:root[data-theme='dark'] .products-stock-history-page .products-stock-history-product-badge {
    border-color: rgba(96, 165, 250, 0.35);
    background: linear-gradient(180deg, rgba(30, 64, 175, 0.35) 0%, rgba(30, 41, 59, 0.55) 100%);
    color: #e2e8f0;
    box-shadow: none;
}

.products-stock-history-filter-panel {
    overflow: hidden;
}

.products-stock-history-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem 1rem;
    padding: 0.75rem 0.75rem 1rem;
    box-sizing: border-box;
}

.products-stock-history-filter-grid .form-group {
    margin-bottom: 0;
}

.products-stock-history-results.is-loading {
    opacity: 0.45;
    transition: opacity 0.18s ease;
}

.products-stock-history-panel {
    overflow: hidden;
}

.products-stock-history-hero {
    display: grid;
    gap: 1rem;
    padding: 1rem 1rem 0;
}

.products-stock-history-copy h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.products-stock-history-copy p {
    margin: 0.45rem 0 0;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--text-secondary, #475569);
}

.products-stock-history-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
}

.products-stock-history-stat {
    min-width: 0;
    padding: 0.92rem 0.95rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.9rem;
    background: var(--bg-surface-soft, #f8fafc);
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.06));
}

.products-stock-history-stat--accent {
    border-color: rgba(59, 130, 246, 0.18);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.08) 0%, rgba(99, 102, 241, 0.08) 100%);
}

.products-stock-history-stat span {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.products-stock-history-stat strong {
    display: block;
    margin-top: 0.38rem;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text-primary, #0f172a);
    word-break: break-word;
}

.products-stock-history-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.products-stock-history-summary-card {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.9rem;
    background: var(--bg-surface-soft, #f8fafc);
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.06));
    padding: 0.95rem 1rem;
}

.products-stock-history-summary-title {
    margin: 0;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.products-stock-history-summary-table {
    width: 100%;
    margin-top: 0.7rem;
}

.products-stock-history-summary-table > tbody > tr > td {
    padding: 0.45rem 0;
    border-top: 1px solid var(--border-default, #e2e8f0);
    background: transparent;
    font-size: 0.8rem;
    color: var(--text-secondary, #475569);
}

.products-stock-history-summary-table > tbody > tr:first-child > td {
    border-top: 0;
}

.products-stock-history-summary-table > tbody > tr > td:last-child {
    text-align: right;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.products-stock-history-toolbar-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    padding: 0.42rem 0.75rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Do not use min-width:0 here — it lets flex shrink this column and stacks “Show / select / entries”. */
.products-stock-history-toolbar-length {
    flex: 0 0 auto;
}

.products-stock-history-toolbar-length .stock-history-dt-lf {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.65rem 1rem;
}

.products-stock-history-toolbar-length .dataTables_length,
.products-stock-history-toolbar-length .dataTables_filter {
    margin: 0;
    flex: 0 0 auto;
    flex-shrink: 0;
}

.products-stock-history-toolbar-length .dataTables_length label {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    line-height: 1.25;
    white-space: nowrap;
    color: var(--text-muted, #64748b);
    font-size: 0.78rem;
    font-weight: 600;
}

/*
 * DataTables adds .form-control (width:100%). Inside a flex <label> that collapses the <select>
 * so the chosen page size is invisible — force intrinsic width + explicit colours.
 */
.products-stock-history-toolbar-length .dataTables_length select,
.products-stock-history-panel .products-stock-history-toolbar-length .dataTables_length select {
    display: inline-block !important;
    width: auto !important;
    min-width: 5.75rem !important;
    max-width: none !important;
    flex: 0 0 auto !important;
    height: 2rem !important;
    min-height: 2rem !important;
    margin: 0 !important;
    padding: 0.28rem 1.85rem 0.28rem 0.5rem !important;
    box-sizing: border-box !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    color: var(--text-primary, #0f172a) !important;
    background-color: var(--bg-surface, #fff) !important;
    border: 1px solid var(--border-default, #e2e8f0) !important;
    border-radius: 0.45rem !important;
    opacity: 1 !important;
    -webkit-appearance: menulist !important;
    appearance: auto !important;
    vertical-align: middle !important;
}

:root[data-theme='dark'] .products-stock-history-toolbar-length .dataTables_length select,
:root[data-theme='dark'] .products-stock-history-panel .products-stock-history-toolbar-length .dataTables_length select {
    color: #e2e8f0 !important;
    background-color: #1a2740 !important;
    border-color: #334866 !important;
}

.products-stock-history-toolbar-row .users-table-controls {
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.products-stock-history-panel .users-table-controls {
    border-top: 1px solid var(--border-default, #e2e8f0);
}

.products-stock-history-panel .products-stock-history-toolbar-row .users-table-controls {
    border-top: 0;
}

.products-stock-history-table-wrap {
    border-top: 0;
}

.products-stock-history-table.dataTable {
    width: 100% !important;
    min-width: 62rem !important;
    margin: 0 !important;
}

.products-stock-history-type-cell {
    white-space: nowrap;
    vertical-align: middle;
}

.products-stock-history-type-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
    white-space: nowrap;
    box-sizing: border-box;
}

/* Type colours — inbound / opening / returns-in vs outbound / returns-out vs adjustment vs manufacturing */
.products-stock-history-type-pill--opening_stock {
    background: rgba(99, 102, 241, 0.14);
    border-color: rgba(99, 102, 241, 0.35);
    color: #4338ca;
}

.products-stock-history-type-pill--purchase,
.products-stock-history-type-pill--purchase_transfer {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.38);
    color: #047857;
}

.products-stock-history-type-pill--sell,
.products-stock-history-type-pill--sell_transfer {
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.35);
    color: #be123c;
}

.products-stock-history-type-pill--stock_adjustment {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(217, 119, 6, 0.4);
    color: #b45309;
}

.products-stock-history-type-pill--purchase_return {
    background: rgba(249, 115, 22, 0.14);
    border-color: rgba(249, 115, 22, 0.38);
    color: #c2410c;
}

.products-stock-history-type-pill--sell_return {
    background: rgba(20, 184, 166, 0.14);
    border-color: rgba(20, 184, 166, 0.38);
    color: #0f766e;
}

.products-stock-history-type-pill--manufacturing_ingredient {
    background: rgba(139, 92, 246, 0.14);
    border-color: rgba(139, 92, 246, 0.35);
    color: #6d28d9;
}

.products-stock-history-type-pill--manufacturing_output {
    background: rgba(6, 182, 212, 0.14);
    border-color: rgba(6, 182, 212, 0.38);
    color: #0e7490;
}

.products-stock-history-type-pill--default {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.28);
    color: #1d4ed8;
}

.products-stock-history-qty {
    font-weight: 700;
}

.products-stock-history-qty--in {
    color: #15803d;
}

.products-stock-history-qty--out {
    color: #dc2626;
}

.products-stock-history-balance {
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.products-stock-history-date-cell strong,
.products-stock-history-ref-cell strong,
.products-stock-history-contact-cell strong {
    display: block;
    color: var(--text-primary, #0f172a);
    font-weight: 700;
}

.products-stock-history-ref-cell span {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary, #475569);
    font-size: 0.78rem;
    line-height: 1.55;
}

@media (max-width: 639px) {
    .products-add-page .products-add-submit {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 991px) {
    .products-group-prices-hero {
        flex-direction: column;
    }

    .products-group-prices-meta {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 639px) {
    .products-group-prices-meta {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 1199px) {
    .products-stock-history-stat-grid,
    .products-stock-history-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .products-stock-history-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .products-stock-history-stat-grid,
    .products-stock-history-overview,
    .products-stock-history-filter-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* —— Purchases edit page —— */
.purchases-edit-page .purchase-edit-copy {
    margin: 0.35rem 0 0;
    max-width: 58rem;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.purchase-form-page .users-toolbar-row {
    margin-bottom: 1rem;
}

.purchase-form-page .users-stat-card .users-stat-value {
    word-break: break-word;
}

.purchase-form-page .purchase-edit-section .box-header {
    margin: 0 0 1rem;
    padding: 0 0 0.95rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.purchase-form-page .purchase-edit-section .box-title {
    float: none;
    display: block;
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary, #0f172a);
}

.purchase-form-page .purchase-edit-section .box-header small {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.purchase-form-page .purchase-edit-section .form-group {
    margin-bottom: 0.95rem;
}

.purchase-form-page .purchase-edit-section .form-control {
    min-height: 2.48rem;
    border-radius: 0.58rem;
    border: 1px solid var(--border-default, #dbe2ea);
    background: var(--bg-surface, #ffffff);
    color: var(--text-primary, #0f172a);
    box-shadow: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.purchase-form-page .purchase-edit-section .form-control:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.purchase-form-page .purchase-edit-section textarea.form-control {
    min-height: 8.75rem;
    resize: vertical;
}

.purchase-form-page .purchase-edit-section input[type='file'] {
    display: block;
    width: 100%;
    font-size: 0.82rem;
    line-height: 1.45;
}

.purchase-form-page .purchase-edit-section .select2-container {
    width: 100% !important;
}

.purchase-form-page .purchase-edit-section .select2-container--default .select2-selection--single,
.purchase-form-page .purchase-edit-section .select2-container--default .select2-selection--multiple {
    min-height: 2.48rem;
    border-radius: 0.58rem;
    border: 1px solid var(--border-default, #dbe2ea);
    background: var(--bg-surface, #ffffff);
}

.purchase-form-page .purchase-edit-section .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 2.32rem;
    padding-left: 0.75rem;
    padding-right: 2rem;
    color: var(--text-primary, #0f172a);
}

.purchase-form-page .purchase-edit-section .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 2.48rem;
    right: 0.5rem;
}

.purchase-form-page .purchase-edit-section .select2-container--default.select2-container--focus .select2-selection--single,
.purchase-form-page .purchase-edit-section .select2-container--default.select2-container--open .select2-selection--single,
.purchase-form-page .purchase-edit-section .select2-container--default.select2-container--focus .select2-selection--multiple,
.purchase-form-page .purchase-edit-section .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.purchase-form-page .purchase-edit-section .input-group-addon {
    min-width: 2.55rem;
    border-color: var(--border-default, #dbe2ea);
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--text-muted, #64748b);
}

.purchase-form-page .purchase-edit-section .input-group {
    display: flex;
    align-items: stretch;
}

.purchase-form-page .purchase-edit-section .input-group > .form-control,
.purchase-form-page .purchase-edit-section .input-group > .select2-container {
    flex: 1 1 auto;
}

.purchase-form-page .purchase-edit-section .input-group-btn {
    width: auto;
}

.purchase-form-page .purchase-edit-section .input-group-btn > .btn {
    min-height: 2.48rem;
    border-color: var(--border-default, #dbe2ea);
    background: var(--bg-surface, #ffffff);
    color: #2563eb;
    border-radius: 0 0.58rem 0.58rem 0;
    box-shadow: none;
}

.purchase-form-page .purchase-edit-section .input-group > .form-control:first-child,
.purchase-form-page .purchase-edit-section .input-group > .select2-container:first-child .select2-selection {
    border-radius: 0.58rem 0 0 0.58rem;
}

.purchase-form-page .purchase-edit-section .input-group > select.form-control + .select2-container .select2-selection--single,
.purchase-form-page .purchase-edit-section .input-group > select.form-control + .select2-container .select2-selection--multiple {
    border-left: none;
    border-radius: 0;
}

.purchase-form-page .multi-input {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.55rem;
}

.purchase-form-page .multi-input > label {
    flex: 1 0 100%;
    margin-bottom: 0;
}

.purchase-form-page .multi-input > .form-control {
    flex: 3 1 12rem;
    width: auto !important;
}

.purchase-form-page .multi-input > .select2-container {
    flex: 2 1 10rem;
    width: auto !important;
}

.purchase-form-page .purchase-edit-inline-card {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.75rem;
    padding: 0.9rem 0.95rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.82rem;
    background: var(--bg-surface-soft, #f8fafc);
}

.purchase-form-page .purchase-edit-inline-card__label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.purchase-form-page .purchase-edit-inline-card__value {
    font-size: 0.82rem;
    line-height: 1.65;
    color: var(--text-primary, #0f172a);
    word-break: break-word;
}

.purchase-form-page .purchase-edit-inline-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.45rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.purchase-form-page .purchase-edit-inline-link:hover,
.purchase-form-page .purchase-edit-inline-link:focus {
    color: #1d4ed8;
    text-decoration: none;
}

.purchase-form-page .purchase-edit-tools {
    margin-bottom: 1rem;
}

.purchase-form-page .purchase-edit-tools .form-group {
    margin-bottom: 0;
}

.purchase-form-page .purchase-edit-action-btn {
    width: 100%;
    min-height: 2.48rem;
    justify-content: center;
}

.purchase-form-page .purchase-edit-tools-end {
    display: flex;
    justify-content: flex-end;
}

.purchase-form-page .purchase-edit-search-group .form-control {
    border-left: none;
}

.purchase-form-page .purchase-edit-table-wrap {
    margin-top: 0.15rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.85rem;
    background: var(--bg-surface, #ffffff);
}

.purchase-form-page table#purchase_entry_table {
    width: 100% !important;
    min-width: 88rem !important;
    margin: 0 !important;
    border-collapse: collapse !important;
}

.purchase-form-page table#purchase_entry_table thead th {
    padding: 0.72rem 0.78rem;
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--text-primary, #0f172a);
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    border-color: var(--border-default, #e2e8f0);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: middle;
}

.purchase-form-page table#purchase_entry_table tbody td {
    padding: 0.78rem 0.72rem;
    vertical-align: top;
    border-color: var(--border-default, #e2e8f0);
    font-size: 0.81rem;
}

.purchase-form-page table#purchase_entry_table tbody td:nth-child(2) {
    min-width: 18rem;
    text-align: left;
    color: var(--text-primary, #0f172a);
}

.purchase-form-page table#purchase_entry_table thead th:last-child,
.purchase-form-page table#purchase_entry_table tbody td:last-child {
    width: 4rem;
    min-width: 4rem;
    text-align: center;
    white-space: nowrap;
}

.purchase-form-page table#purchase_entry_table .form-control.input-sm {
    min-height: 2rem;
    padding: 0.35rem 0.55rem;
    border-radius: 0.5rem;
    font-size: 0.79rem;
}

.purchase-form-page table#purchase_entry_table .select2-container--default .select2-selection--single,
.purchase-form-page table#purchase_entry_table .select2-container--default .select2-selection--multiple {
    min-height: 2rem;
    border-radius: 0.5rem;
}

.purchase-form-page table#purchase_entry_table .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1.84rem;
    padding-left: 0.55rem;
    padding-right: 1.6rem;
    font-size: 0.78rem;
}

.purchase-form-page table#purchase_entry_table .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 2rem;
}

.purchase-form-page table#purchase_entry_table .input-group-addon {
    min-width: 2.3rem;
    padding: 0.35rem 0.45rem;
    font-size: 0.74rem;
}

.purchase-form-page .remove_purchase_entry_row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border: 1px solid #fecaca;
    border-radius: 999px;
    background: #fff1f2;
    color: #be123c !important;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.purchase-form-page .remove_purchase_entry_row:hover,
.purchase-form-page .remove_purchase_entry_row:focus {
    transform: translateY(-1px);
    background: #ffe4e6;
    box-shadow: 0 8px 18px rgba(225, 29, 72, 0.14);
}

.purchase-form-page .purchase-edit-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.purchase-form-page .purchase-edit-metric {
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.82rem;
    background: var(--bg-surface-soft, #f8fafc);
}

.purchase-form-page .purchase-edit-metric span {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.purchase-form-page .purchase-edit-metric strong {
    display: block;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary, #0f172a);
}

.purchase-form-page .purchase-edit-summary-card {
    display: grid;
    gap: 0.7rem;
    height: 100%;
    padding: 1rem;
    border: 1px solid #ddd6fe;
    border-radius: 0.9rem;
    background: linear-gradient(180deg, #faf5ff 0%, #f5f3ff 100%);
}

.purchase-form-page .purchase-edit-summary-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px dashed rgba(139, 92, 246, 0.22);
}

.purchase-form-page .purchase-edit-summary-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.purchase-form-page .purchase-edit-summary-row span {
    font-size: 0.8rem;
    color: var(--text-secondary, #475569);
}

.purchase-form-page .purchase-edit-summary-row strong {
    font-size: 0.86rem;
    font-weight: 700;
    text-align: right;
    color: var(--text-primary, #0f172a);
}

.purchase-form-page .purchase-edit-summary-row--grand {
    padding: 0.75rem 0.8rem;
    border: 1px solid rgba(139, 92, 246, 0.24);
    border-radius: 0.82rem;
    background: rgba(139, 92, 246, 0.08);
}

.purchase-form-page .purchase-edit-summary-row--grand strong {
    font-size: 1rem;
}

.purchase-form-page .purchase-edit-expense-toggle {
    display: flex;
    justify-content: center;
    margin-top: 0.2rem;
}

.purchase-form-page .purchase-edit-expenses-card {
    margin-top: 1rem;
    padding: 1rem 1rem 0.15rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.9rem;
    background: var(--bg-surface-soft, #f8fafc);
}

.purchase-form-page .purchase-edit-actions {
    margin-top: 1.4rem;
}

.purchase-form-page .purchase-edit-submit-bar {
    display: flex;
    justify-content: center;
}

.purchase-form-page .purchase-edit-submit {
    min-height: 2.6rem;
    padding: 0.62rem 1.2rem;
    border-radius: 0.58rem;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.3;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.purchase-form-page .purchase-edit-submit:hover,
.purchase-form-page .purchase-edit-submit:focus {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

@media (max-width: 991px) {
    .purchase-form-page .purchase-edit-metrics {
        grid-template-columns: 1fr;
    }

    .purchase-form-page .purchase-edit-tools-end {
        justify-content: flex-start;
    }
}

@media (max-width: 639px) {
    .purchase-form-page .purchase-edit-action-btn,
    .purchase-form-page .purchase-edit-submit {
        width: 100%;
        justify-content: center;
    }

    .purchase-form-page .purchase-edit-summary-row {
        flex-direction: column;
        gap: 0.2rem;
    }

    .purchase-form-page .purchase-edit-summary-row strong {
        text-align: left;
    }
}

/* —— Purchases delete modal —— */
.nestiko-purchase-delete-modal {
    width: min(44rem, calc(100% - 1.5rem));
    margin: 2.25rem auto;
}

.nestiko-purchase-delete-modal .modal-content {
    overflow: hidden;
    border: none;
    border-radius: 1rem;
    background: var(--bg-surface, #ffffff);
    box-shadow: 0 26px 60px rgba(15, 23, 42, 0.16);
}

.nestiko-purchase-delete-modal .modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.purchase-delete-modal-heading {
    min-width: 0;
}

.purchase-delete-modal-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b91c1c;
}

.nestiko-purchase-delete-modal .modal-title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary, #0f172a);
}

.purchase-delete-modal-copy {
    margin: 0.45rem 0 0;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--text-secondary, #475569);
}

.purchase-delete-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--border-default, #dbe2ea);
    border-radius: 999px;
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--text-muted, #64748b);
    font-size: 1.35rem;
    line-height: 1;
    opacity: 1;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease,
        transform 0.18s ease;
}

.purchase-delete-modal-close:hover,
.purchase-delete-modal-close:focus {
    border-color: #fca5a5;
    background: #fff1f2;
    color: #b91c1c;
    transform: translateY(-1px);
}

.purchase-delete-modal-body {
    padding: 1.1rem 1.25rem 1.2rem;
}

.purchase-delete-modal-alert {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 0.95rem 1rem;
    border: 1px solid #fecaca;
    border-radius: 0.9rem;
    background: linear-gradient(180deg, #fff7ed 0%, #fff1f2 100%);
}

.purchase-delete-modal-alert__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
    font-size: 1rem;
    flex-shrink: 0;
}

.purchase-delete-modal-alert__content strong {
    display: block;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.purchase-delete-modal-alert__content p {
    margin: 0.2rem 0 0;
    font-size: 0.81rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.purchase-delete-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.purchase-delete-modal-card {
    display: grid;
    gap: 0.45rem;
    min-height: 5.1rem;
    padding: 0.9rem 0.95rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.9rem;
    background: var(--bg-surface-soft, #f8fafc);
}

.purchase-delete-modal-card span {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.purchase-delete-modal-card strong {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-primary, #0f172a);
    word-break: break-word;
}

.purchase-delete-modal-card--accent {
    border-color: #fbcfe8;
    background: linear-gradient(180deg, #fff7ed 0%, #fff1f2 100%);
}

.purchase-delete-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
    padding: 0.95rem 1.25rem 1.15rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
}

.purchase-delete-modal-footer .users-btn {
    min-width: 10rem;
    justify-content: center;
}

.purchase-delete-modal-delete {
    border-color: #dc2626;
    background: #dc2626;
    color: #ffffff;
}

.purchase-delete-modal-delete:hover,
.purchase-delete-modal-delete:focus {
    color: #ffffff;
    border-color: #b91c1c;
    background: #b91c1c;
}

.purchase-delete-modal-delete.is-loading {
    opacity: 0.82;
    pointer-events: none;
}

.purchase-delete-modal-delete.is-loading i {
    animation-duration: 0.85s;
}

.modal.fade .nestiko-purchase-delete-modal {
    transform: translateY(16px) scale(0.98);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.modal.in .nestiko-purchase-delete-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* —— Purchases status modal —— */
.nestiko-purchase-status-modal {
    width: min(52rem, calc(100% - 1.5rem));
    margin: 2.25rem auto;
}

.nestiko-purchase-status-modal .modal-content {
    overflow: hidden;
    border: none;
    border-radius: 1rem;
    background: var(--bg-surface, #ffffff);
    box-shadow: 0 26px 60px rgba(15, 23, 42, 0.16);
}

.nestiko-purchase-status-modal .modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.purchase-status-modal-heading {
    min-width: 0;
}

.purchase-status-modal-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2563eb;
}

.nestiko-purchase-status-modal .modal-title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary, #0f172a);
}

.purchase-status-modal-copy {
    margin: 0.45rem 0 0;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--text-secondary, #475569);
}

.purchase-status-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--border-default, #dbe2ea);
    border-radius: 999px;
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--text-muted, #64748b);
    font-size: 1.35rem;
    line-height: 1;
    opacity: 1;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease,
        transform 0.18s ease;
}

.purchase-status-modal-close:hover,
.purchase-status-modal-close:focus {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
    transform: translateY(-1px);
}

.purchase-status-modal-body {
    display: grid;
    gap: 1rem;
    padding: 1.1rem 1.25rem 1.2rem;
}

.purchase-status-modal-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
}

.purchase-status-modal-card {
    display: grid;
    gap: 0.45rem;
    min-height: 5rem;
    padding: 0.9rem 0.95rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.9rem;
    background: var(--bg-surface-soft, #f8fafc);
}

.purchase-status-modal-card span {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.purchase-status-modal-card strong {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-primary, #0f172a);
    word-break: break-word;
}

.purchase-status-modal-card--accent {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #eff6ff 0%, #eef2ff 100%);
}

.purchase-status-modal-flow {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
    border: 1px solid #dbeafe;
    border-radius: 0.95rem;
    background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
}

.purchase-status-modal-flow-card {
    flex: 1 1 0;
    display: grid;
    gap: 0.3rem;
}

.purchase-status-modal-flow-card span {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #475569;
}

.purchase-status-modal-flow-card strong {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary, #0f172a);
}

.purchase-status-modal-flow-card--accent strong {
    color: #1d4ed8;
}

.purchase-status-modal-flow-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid rgba(37, 99, 235, 0.14);
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    font-size: 1rem;
    flex-shrink: 0;
}

.purchase-status-modal-flow-note {
    margin: -0.25rem 0 0;
    font-size: 0.81rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.purchase-status-modal-alert {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 0.95rem 1rem;
    border: 1px solid #bfdbfe;
    border-radius: 0.9rem;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
}

.purchase-status-modal-alert__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    font-size: 1rem;
    flex-shrink: 0;
}

.purchase-status-modal-alert__content strong {
    display: block;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.purchase-status-modal-alert__content p {
    margin: 0.2rem 0 0;
    font-size: 0.81rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.purchase-status-modal-options-shell {
    padding: 1rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.95rem;
    background: var(--bg-surface-soft, #f8fafc);
}

.purchase-status-modal-section-head {
    margin-bottom: 0.9rem;
}

.purchase-status-modal-section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2563eb;
}

.purchase-status-modal-section-head h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.purchase-status-modal-section-head p {
    margin: 0.3rem 0 0;
    font-size: 0.81rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.purchase-status-modal-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.purchase-status-option {
    display: block;
    margin: 0;
    cursor: pointer;
}

.purchase-status-option__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.purchase-status-option__surface {
    position: relative;
    display: grid;
    gap: 0.45rem;
    min-height: 9rem;
    padding: 1rem;
    border: 1px solid var(--border-default, #dbe2ea);
    border-radius: 0.95rem;
    background: var(--bg-surface, #ffffff);
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease,
        transform 0.18s ease;
}

.purchase-status-option__eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.purchase-status-option__label {
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary, #0f172a);
}

.purchase-status-option__copy {
    font-size: 0.81rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.purchase-status-option:hover .purchase-status-option__surface,
.purchase-status-option:focus-within .purchase-status-option__surface {
    border-color: #93c5fd;
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.08);
    transform: translateY(-1px);
}

.purchase-status-option__input:checked + .purchase-status-option__surface {
    border-color: #2563eb;
    background: linear-gradient(180deg, #eff6ff 0%, #eef2ff 100%);
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.14);
}

.purchase-status-option__input:checked + .purchase-status-option__surface::after {
    content: 'Selected';
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    padding: 0.22rem 0.5rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.purchase-status-option__input:checked + .purchase-status-option__surface .purchase-status-option__eyebrow,
.purchase-status-option__input:checked + .purchase-status-option__surface .purchase-status-option__label {
    color: #1d4ed8;
}

.purchase-status-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
    padding: 0.95rem 1.25rem 1.15rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
}

.purchase-status-modal-footer .users-btn {
    min-width: 10rem;
    justify-content: center;
}

.purchase-status-modal-submit {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.purchase-status-modal-submit:hover,
.purchase-status-modal-submit:focus {
    color: #ffffff;
    border-color: #1d4ed8;
    background: #1d4ed8;
}

.purchase-status-modal-submit:disabled,
.purchase-status-modal-submit.is-loading {
    opacity: 0.78;
    pointer-events: none;
}

.purchase-status-modal-submit.is-loading i {
    animation-duration: 0.85s;
}

.modal.fade .nestiko-purchase-status-modal {
    transform: translateY(16px) scale(0.98);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.modal.in .nestiko-purchase-status-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

@media (max-width: 991px) {
    .purchase-status-modal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .purchase-status-modal-options {
        grid-template-columns: 1fr;
    }

    .purchase-status-modal-flow {
        flex-direction: column;
        align-items: stretch;
    }

    .purchase-status-modal-flow-arrow {
        margin: 0 auto;
        transform: rotate(90deg);
    }
}

@media (max-width: 639px) {
    .nestiko-purchase-status-modal {
        width: calc(100% - 1rem);
        margin: 1rem auto;
    }

    .nestiko-purchase-delete-modal {
        width: calc(100% - 1rem);
        margin: 1rem auto;
    }

    .nestiko-purchase-status-modal .modal-header,
    .purchase-status-modal-body,
    .purchase-status-modal-footer,
    .nestiko-purchase-delete-modal .modal-header,
    .purchase-delete-modal-body,
    .purchase-delete-modal-footer {
        padding-left: 0.95rem;
        padding-right: 0.95rem;
    }

    .purchase-status-modal-grid,
    .purchase-delete-modal-grid {
        grid-template-columns: 1fr;
    }

    .purchase-status-modal-footer,
    .purchase-delete-modal-footer {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .purchase-status-modal-footer .users-btn,
    .purchase-delete-modal-footer .users-btn {
        width: 100%;
    }

    .purchase-status-modal-options-shell {
        padding: 0.95rem;
    }
}

/* —— Customer groups list —— */
.customer-groups-page table#customer_groups_table.dataTable,
.customer-groups-page table.customer-groups-data-table.dataTable {
    width: 100% !important;
    min-width: 38rem !important;
    margin: 0 !important;
    border-collapse: collapse !important;
}

.customer-groups-page .roles-panel table.users-table.dataTable th:last-child,
.customer-groups-page .roles-panel table.users-table.dataTable td:last-child {
    width: 11rem;
    white-space: nowrap;
}

/* First column is group name (text), not the Users/Roles checkbox column — left-align, natural width. */
.customer-groups-page .roles-panel table.users-table.dataTable thead th:first-child,
.customer-groups-page .roles-panel table.users-table.dataTable tbody td:first-child {
    width: auto;
    min-width: 12rem;
    max-width: none;
    text-align: left;
}

/* —— Variations list —— */
.variations-page .variations-page-copy {
    margin: 0.35rem 0 0;
    max-width: 58rem;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.variations-page .users-toolbar-row {
    margin-bottom: 1rem;
}

.variations-page table#variation_table.dataTable,
.variations-page table.variations-data-table.dataTable {
    width: 100% !important;
    min-width: 42rem !important;
    margin: 0 !important;
    border-collapse: collapse !important;
}

.variations-page .roles-panel table.users-table.dataTable th:nth-child(2),
.variations-page .roles-panel table.users-table.dataTable td:nth-child(2) {
    min-width: 18rem;
    white-space: normal;
}

.variations-page .roles-panel table.users-table.dataTable th:last-child,
.variations-page .roles-panel table.users-table.dataTable td:last-child {
    width: 10rem;
    white-space: nowrap;
}

.variations-page .variation-values-summary {
    display: inline-block;
    line-height: 1.55;
}

/* —— Selling price groups list —— */
.selling-price-groups-page .selling-price-groups-page-copy {
    margin: 0.35rem 0 0;
    max-width: 58rem;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.selling-price-groups-page .selling-price-groups-notice {
    margin-bottom: 1rem;
    padding: 0.8rem 0.95rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.6rem;
    font-size: 0.84rem;
    line-height: 1.55;
}

.selling-price-groups-page .selling-price-groups-notice--success {
    color: var(--success-text, #166534);
    background: var(--success-bg, #dcfce7);
    border-color: #86efac;
}

.selling-price-groups-page .selling-price-groups-notice--error {
    color: var(--danger-text, #b91c1c);
    background: var(--danger-bg, #fee2e2);
    border-color: #fca5a5;
}

.selling-price-groups-page .users-toolbar-row {
    margin-bottom: 1rem;
}

.selling-price-groups-page table#selling_price_group_table.dataTable,
.selling-price-groups-page table.selling-price-groups-data-table.dataTable {
    width: 100% !important;
    min-width: 52rem !important;
    margin: 0 !important;
    border-collapse: collapse !important;
}

.selling-price-groups-page .roles-panel table.users-table.dataTable th:nth-child(2),
.selling-price-groups-page .roles-panel table.users-table.dataTable td:nth-child(2) {
    min-width: 18rem;
    white-space: normal;
}

.selling-price-groups-page .roles-panel table.users-table.dataTable th:nth-child(3),
.selling-price-groups-page .roles-panel table.users-table.dataTable td:nth-child(3) {
    width: 8.5rem;
    white-space: nowrap;
}

.selling-price-groups-page .roles-panel table.users-table.dataTable th:last-child,
.selling-price-groups-page .roles-panel table.users-table.dataTable td:last-child {
    width: 18rem;
    white-space: nowrap;
}

/* —— Units list —— */
.units-page .units-page-copy {
    margin: 0.35rem 0 0;
    max-width: 58rem;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.units-page .users-toolbar-row {
    margin-bottom: 1rem;
}

.units-page table#unit_table.dataTable,
.units-page table.units-data-table.dataTable {
    width: 100% !important;
    min-width: 44rem !important;
    margin: 0 !important;
    border-collapse: collapse !important;
}

.units-page .roles-panel table.users-table.dataTable th:nth-child(3),
.units-page .roles-panel table.users-table.dataTable td:nth-child(3) {
    width: 9.5rem;
    white-space: nowrap;
}

.units-page .roles-panel table.users-table.dataTable th:last-child,
.units-page .roles-panel table.users-table.dataTable td:last-child {
    width: 10rem;
    white-space: nowrap;
}

/* —— Taxonomy / categories list —— */
.taxonomy-page .taxonomy-page-copy {
    margin: 0.35rem 0 0;
    max-width: 58rem;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.taxonomy-page .users-toolbar-row {
    margin-bottom: 1rem;
}

.taxonomy-page table#category_table.dataTable,
.taxonomy-page table.taxonomy-data-table.dataTable {
    width: 100% !important;
    min-width: 50rem !important;
    margin: 0 !important;
    border-collapse: collapse !important;
}

.taxonomy-page .roles-panel table.users-table.dataTable th:first-child,
.taxonomy-page .roles-panel table.users-table.dataTable td:first-child {
    min-width: 18rem;
    white-space: normal;
}

.taxonomy-page .roles-panel table.users-table.dataTable th:last-child,
.taxonomy-page .roles-panel table.users-table.dataTable td:last-child {
    width: 10rem;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .users-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .users-search-form .users-input--grow {
        flex: 1;
        min-width: 12rem;
    }

    .contacts-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .products-page .products-table-controls-bulk {
        flex-wrap: nowrap;
    }
}

@media (min-width: 1280px) {
    .users-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .roles-page .users-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sales-agents-page .users-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .contacts-page .users-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .products-page .users-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .variations-page .users-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .selling-price-groups-page .users-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .units-page .users-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .taxonomy-page .users-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

:root[data-theme='dark'] .users-page .users-panel-head,
:root[data-theme='dark'] .users-page .users-table-controls {
    background: transparent;
}

:root[data-theme='dark'] .users-page .users-table th {
    background: rgba(255, 255, 255, 0.035);
}

:root[data-theme='dark'] .users-page .users-pagination {
    background: var(--bg-surface, #111a2c);
    border-top-color: var(--border-default, #22314d);
}

:root[data-theme='dark'] .users-page .users-page-info {
    color: var(--text-secondary, #cbd5e1);
}

:root[data-theme='dark'] .users-page .users-pagination .pagination li a,
:root[data-theme='dark'] .users-page .users-pagination .pagination li span {
    background: var(--bg-surface-soft, #1a2740);
    border-color: var(--border-strong, #334866);
    color: var(--text-primary, #e2e8f0);
}

:root[data-theme='dark'] .users-page .users-pagination .pagination li.active span {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

:root[data-theme='dark'] .users-view-title,
:root[data-theme='dark'] .users-view-profile-name,
:root[data-theme='dark'] .users-view-tab-panels p strong,
:root[data-theme='dark'] .users-view-details h4 {
    color: var(--text-primary, #e2e8f0);
}

:root[data-theme='dark'] .users-view-tab-nav {
    background: rgba(255, 255, 255, 0.04);
}

:root[data-theme='dark'] .users-view-tab-nav > li.active > a,
:root[data-theme='dark'] .users-view-tab-nav > li.active > a:hover,
:root[data-theme='dark'] .users-view-tab-nav > li.active > a:focus {
    background: var(--bg-surface, #111a2c);
}

:root[data-theme='dark'] .users-edit-page .box-title,
:root[data-theme='dark'] .users-edit-page h4 {
    color: var(--text-primary, #e2e8f0);
}

:root[data-theme='dark'] .users-edit-page .form-group label,
:root[data-theme='dark'] .users-edit-page .checkbox label {
    color: var(--text-secondary, #cbd5e1);
}

:root[data-theme='dark'] .users-edit-page .form-control {
    background: #1a2740;
    border-color: #334866;
    color: #e2e8f0;
}

/* Select2 surfaces are covered globally in nestiko-select2.css; reinforce borders to match inputs */
:root[data-theme='dark'] .users-edit-page .select2-container--default .select2-selection--single,
:root[data-theme='dark'] .users-edit-page .select2-container--default .select2-selection--multiple {
    border-color: #334866 !important;
}

:root[data-theme='dark'] .users-edit-page textarea.form-control {
    background: #1a2740;
    border-color: #334866;
    color: #e2e8f0;
}

:root[data-theme='dark'] .users-edit-page .input-group-addon {
    background: #111a2c;
    border-color: #334866;
    color: #94a3b8;
}

:root[data-theme='dark'] .users-edit-page .help-block {
    color: #94a3b8;
}

:root[data-theme='dark'] .users-edit-page .box-header {
    border-bottom-color: #22314d;
}

:root[data-theme='dark'] .users-edit-form-actions {
    border-top-color: #22314d;
}

:root[data-theme='dark'] .role-form-section-label {
    color: var(--text-primary, #e5e7eb);
}

:root[data-theme='dark'] .role-permission-stats {
    border-color: #22314d;
    background: rgba(255, 255, 255, 0.04);
}

:root[data-theme='dark'] .role-permission-stats__label {
    color: #94a3b8;
}

:root[data-theme='dark'] .role-permission-stats__value {
    color: #e2e8f0;
}

:root[data-theme='dark'] .role-permission-stats__sep {
    color: #64748b;
}

:root[data-theme='dark'] .role-form-groups > .check_group {
    border-top-color: rgba(148, 163, 184, 0.14);
}

:root[data-theme='dark'] .role-form-page .check_group h4 {
    color: var(--text-muted, #94a3b8);
}

:root[data-theme='dark'] .role-form-page input.input-icheck[type='checkbox'],
:root[data-theme='dark'] .role-form-page input.input-icheck[type='radio'],
:root[data-theme='dark'] .role-form-page .icheckbox_square-blue,
:root[data-theme='dark'] .role-form-page .iradio_square-blue {
    border: 2px solid rgba(241, 245, 249, 0.55) !important;
    background: linear-gradient(180deg, #4b5e78, #354154) !important;
    background-image: none !important;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 2px 8px rgba(0, 0, 0, 0.38);
}

:root[data-theme='dark'] .role-form-page input.input-icheck[type='checkbox']:hover,
:root[data-theme='dark'] .role-form-page input.input-icheck[type='radio']:hover,
:root[data-theme='dark'] .role-form-page input.input-icheck[type='checkbox']:focus,
:root[data-theme='dark'] .role-form-page input.input-icheck[type='radio']:focus,
:root[data-theme='dark'] .role-form-page .icheckbox_square-blue:hover,
:root[data-theme='dark'] .role-form-page .icheckbox_square-blue.hover,
:root[data-theme='dark'] .role-form-page .iradio_square-blue:hover,
:root[data-theme='dark'] .role-form-page .iradio_square-blue.hover {
    border-color: rgba(196, 181, 253, 0.95) !important;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.12),
        0 0 0 3px rgba(167, 139, 250, 0.18),
        0 2px 10px rgba(0, 0, 0, 0.38);
}

:root[data-theme='dark'] .role-form-page input.input-icheck[type='checkbox']:checked,
:root[data-theme='dark'] .role-form-page input.input-icheck[type='radio']:checked,
:root[data-theme='dark'] .role-form-page .icheckbox_square-blue.checked,
:root[data-theme='dark'] .role-form-page .iradio_square-blue.checked {
    background: linear-gradient(180deg, #8b5cf6, #6d28d9) !important;
    border-color: #a78bfa !important;
    box-shadow:
        0 0 0 1px rgba(196, 181, 253, 0.18),
        0 8px 18px rgba(109, 40, 217, 0.28);
}

:root[data-theme='dark'] .role-form-page input.input-icheck[type='radio']::after,
:root[data-theme='dark'] .role-form-page .iradio_square-blue::after {
    background: #ffffff;
}

:root[data-theme='dark'] .role-form-page .check_group .col-md-9 > .col-md-12 > hr,
:root[data-theme='dark'] .role-form-page .check_group .radio-group > .col-md-12 > hr {
    border-color: rgba(148, 163, 184, 0.14);
}

:root[data-theme='dark'] .users-edit-page .tw-bg-white {
    background-color: #111a2c !important;
}

:root[data-theme='dark'] .users-edit-page .hover\:tw-shadow-md:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

:root[data-theme='dark'] .roles-panel-head p {
    color: var(--text-primary, #e2e8f0) !important;
}

:root[data-theme='dark'] .roles-panel-head p small {
    color: #94a3b8 !important;
}

:root[data-theme='dark'] :is(.roles-panel, .users-panel) .dataTables_wrapper > .dataTables_length,
:root[data-theme='dark'] :is(.roles-panel, .users-panel) .dataTables_wrapper > .dataTables_filter,
:root[data-theme='dark'] :is(.roles-panel, .users-panel) .dataTables_wrapper .row {
    background: rgba(255, 255, 255, 0.04);
    border-bottom-color: #22314d;
}

:root[data-theme='dark'] :is(.roles-panel, .users-panel) .dataTables_length select,
:root[data-theme='dark'] :is(.roles-panel, .users-panel) .dataTables_filter input {
    background: #1a2740;
    border-color: #334866;
    color: #e2e8f0;
}

/* Length + search moved into toolbar host (Sells list, contact Sales tab, etc.). */
:root[data-theme='dark'] :is(.roles-page, .users-page) .roles-dt-tools-host .dataTables_length label,
:root[data-theme='dark'] :is(.roles-page, .users-page) .roles-dt-tools-host .dataTables_filter label {
    color: var(--text-secondary, #cbd5e1);
}

:root[data-theme='dark'] :is(.roles-page, .users-page) .roles-dt-tools-host .dataTables_length select,
:root[data-theme='dark'] :is(.roles-page, .users-page) .roles-dt-tools-host .dataTables_filter input {
    background: #1a2740;
    border-color: #334866;
    color: #e2e8f0;
}

:root[data-theme='dark'] .roles-panel table.users-table.dataTable thead th {
    background: rgba(255, 255, 255, 0.035);
    color: #94a3b8;
    border-bottom-color: #22314d;
}

:root[data-theme='dark'] .roles-panel table.users-table.dataTable tbody td {
    color: #cbd5e1;
    border-bottom-color: rgba(148, 163, 184, 0.14);
}

:root[data-theme='dark'] .roles-panel table.users-table.dataTable tbody tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

:root[data-theme='dark'] .manage-users-content .roles-panel table.users-table.table-striped > tbody > tr:nth-of-type(odd) > td,
:root[data-theme='dark'] .manage-users-content .roles-panel table.users-table.dataTable.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(255, 255, 255, 0.025) !important;
}

:root[data-theme='dark'] .manage-users-content .roles-panel table.users-table.table-striped > tbody > tr:nth-of-type(even) > td,
:root[data-theme='dark'] .manage-users-content .roles-panel table.users-table.dataTable.table-striped > tbody > tr:nth-of-type(even) > td {
    background-color: transparent !important;
}

:root[data-theme='dark'] :is(.roles-panel, .users-panel) .roles-dt-bottom {
    background: var(--bg-surface, #111a2c);
    border-top-color: var(--border-default, #22314d);
}

:root[data-theme='dark'] :is(.roles-panel, .users-panel) .roles-dt-bottom .dataTables_info {
    color: var(--text-secondary, #cbd5e1);
}

:root[data-theme='dark'] :is(.roles-panel, .users-panel) .roles-dt-bottom .dataTables_paginate .pagination li a,
:root[data-theme='dark'] :is(.roles-panel, .users-panel) .roles-dt-bottom .dataTables_paginate .pagination li span {
    background: var(--bg-surface-soft, #1a2740);
    border-color: var(--border-strong, #334866);
    color: var(--text-primary, #e2e8f0);
}

:root[data-theme='dark'] :is(.roles-panel, .users-panel) .roles-dt-bottom .dataTables_paginate li.paginate_button.current a,
:root[data-theme='dark'] :is(.roles-panel, .users-panel) .roles-dt-bottom .dataTables_paginate li.paginate_button.current span,
:root[data-theme='dark'] :is(.roles-panel, .users-panel) .roles-dt-bottom .dataTables_paginate li.paginate_button.active a,
:root[data-theme='dark'] :is(.roles-panel, .users-panel) .roles-dt-bottom .dataTables_paginate li.paginate_button.active span {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

:root[data-theme='dark'] .variations-page .variations-page-copy {
    color: #cbd5e1;
}

:root[data-theme='dark'] .selling-price-groups-page .selling-price-groups-page-copy {
    color: #cbd5e1;
}

:root[data-theme='dark'] .selling-price-groups-page .selling-price-groups-notice--success {
    background: rgba(22, 101, 52, 0.2);
    border-color: rgba(74, 222, 128, 0.35);
    color: #bbf7d0;
}

:root[data-theme='dark'] .selling-price-groups-page .selling-price-groups-notice--error {
    background: rgba(185, 28, 28, 0.16);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

:root[data-theme='dark'] .units-page .units-page-copy {
    color: #cbd5e1;
}

:root[data-theme='dark'] .taxonomy-page .taxonomy-page-copy {
    color: #cbd5e1;
}

:root[data-theme='dark'] .contacts-filter-hint,
:root[data-theme='dark'] .contacts-filter-item label {
    color: var(--text-secondary, #cbd5e1);
}

:root[data-theme='dark'] .contacts-filter-item .form-control,
:root[data-theme='dark'] .contacts-filter-item .select2-container--default .select2-selection--single {
    background: #1a2740;
    border-color: #334866 !important;
    color: #e2e8f0;
}

:root[data-theme='dark'] .contacts-filter-item .select2-container--default .select2-selection--single .select2-selection__rendered,
:root[data-theme='dark'] .contacts-filter-item .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--text-primary, #e2e8f0) !important;
}

/* Same “None” / placeholder contrast inside any open filters drawer (not only contacts) */
:root[data-theme='dark'] details.users-filters-pop[open] .users-filters-pop-panel .select2-container--default .select2-selection--single .select2-selection__rendered,
:root[data-theme='dark'] details.users-filters-pop[open] .users-filters-pop-panel .select2-container--default .select2-selection--single .select2-selection__placeholder,
:root[data-theme='dark'] details.users-filters-pop[open] .users-filters-pop-panel .select2-container--default .select2-selection--multiple .select2-selection__rendered,
:root[data-theme='dark'] details.users-filters-pop[open] .users-filters-pop-panel .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
    color: var(--text-primary, #e2e8f0) !important;
}

/* Native <select> filters (no Select2) — e.g. status before select2 class, or other pages */
:root[data-theme='dark'] .users-filters-pop-panel select.form-control {
    color: var(--text-primary, #e2e8f0) !important;
    background-color: var(--bg-surface-soft, #1a2740) !important;
}

:root[data-theme='dark'] .users-filters-pop-panel select.form-control option {
    background-color: var(--bg-surface-soft, #1a2740);
    color: var(--text-primary, #e2e8f0);
}

:root[data-theme='dark'] .contacts-page .contacts-native-tools > .dt-button,
:root[data-theme='dark'] .contacts-page .contacts-native-tools > a.dt-button,
:root[data-theme='dark'] .contacts-page .contacts-native-tools > button.dt-button,
:root[data-theme='dark'] .contacts-page .dt-buttons .dt-button,
:root[data-theme='dark'] .contacts-page .dt-buttons a.dt-button,
:root[data-theme='dark'] .contacts-page .dt-buttons button.dt-button,
:root[data-theme='dark'] .contacts-page .contacts-dt-button {
    background: var(--bg-surface-soft, #1a2740) !important;
    border-color: var(--border-strong, #334866) !important;
    color: var(--text-primary, #e2e8f0) !important;
}

:root[data-theme='dark'] .contacts-page .contacts-native-tools > .dt-button:hover,
:root[data-theme='dark'] .contacts-page .contacts-native-tools > .dt-button:focus,
:root[data-theme='dark'] .contacts-page .dt-buttons .dt-button:hover,
:root[data-theme='dark'] .contacts-page .dt-buttons .dt-button:focus,
:root[data-theme='dark'] .contacts-page .dt-buttons .dt-button.active,
:root[data-theme='dark'] .contacts-page .contacts-dt-button:hover,
:root[data-theme='dark'] .contacts-page .contacts-dt-button:focus,
:root[data-theme='dark'] .contacts-page .contacts-dt-button.active {
    background: rgba(255, 255, 255, 0.06) !important;
}

:root[data-theme='dark'] .contacts-page .contacts-grid-actions > .dropdown-toggle:not(.users-btn-primary):not(.users-btn-light),
:root[data-theme='dark'] .contacts-page .btn-group > .dropdown-toggle:not(.users-btn-primary):not(.users-btn-light) {
    background: var(--bg-surface-soft, #1a2740);
    border-color: var(--border-strong, #334866);
    color: var(--text-primary, #e2e8f0);
}

:root[data-theme='dark'] .contacts-page .contacts-action-menu,
:root[data-theme='dark'] .contacts-page .dropdown-menu {
    background: var(--bg-surface, #111a2c);
    border-color: #22314d;
}

:root[data-theme='dark'] .contacts-page .contacts-action-menu > li > a,
:root[data-theme='dark'] .contacts-page .dropdown-menu > li > a {
    color: #e2e8f0;
}

:root[data-theme='dark'] .contacts-page .contacts-action-menu > li > a:hover,
:root[data-theme='dark'] .contacts-page .dropdown-menu > li > a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

:root[data-theme='dark'] .contacts-page .contacts-action-menu > li > a.delete_contact_button {
    color: #fca5a5;
}

:root[data-theme='dark'] .contacts-page .contacts-action-menu > li > a.delete_contact_button:hover {
    background: rgba(248, 113, 113, 0.14);
    color: #fecaca;
}

:root[data-theme='dark'] .contacts-import-warning {
    background: rgba(185, 28, 28, 0.16);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

:root[data-theme='dark'] .contacts-import-file-input {
    background: rgba(255, 255, 255, 0.035);
    border-color: #334866;
    color: #e2e8f0;
}

:root[data-theme='dark'] .contacts-import-help,
:root[data-theme='dark'] .contacts-import-copy,
:root[data-theme='dark'] .contacts-import-checklist {
    color: #cbd5e1;
}

:root[data-theme='dark'] .contacts-import-checklist code {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

:root[data-theme='dark'] .contacts-import-copy--muted {
    color: #94a3b8;
}

:root[data-theme='dark'] .labels-page .labels-page-copy {
    color: #cbd5e1;
}

:root[data-theme='dark'] .labels-page .labels-panel-body .form-control {
    background: #1a2740;
    border-color: #334866;
    color: #e2e8f0;
}

:root[data-theme='dark'] .labels-page .labels-panel-body .input-group-addon {
    background: rgba(255, 255, 255, 0.05);
    border-color: #334866;
    color: #94a3b8;
}

:root[data-theme='dark'] .labels-page .labels-inline-stat,
:root[data-theme='dark'] .labels-page .labels-products-table-wrap,
:root[data-theme='dark'] .labels-page .labels-config-card,
:root[data-theme='dark'] .labels-page .labels-output-card__meta-item {
    border-color: #334866;
    background: rgba(255, 255, 255, 0.04);
}

:root[data-theme='dark'] .labels-page .labels-inline-stat strong,
:root[data-theme='dark'] .labels-page .labels-product-name,
:root[data-theme='dark'] .labels-page .labels-empty-state__inner strong,
:root[data-theme='dark'] .labels-page .labels-config-card__toggle,
:root[data-theme='dark'] .labels-page .labels-output-card__title,
:root[data-theme='dark'] .labels-page .labels-output-card__meta-item strong {
    color: var(--text-primary, #e2e8f0);
}

:root[data-theme='dark'] .labels-page .labels-inline-stat span,
:root[data-theme='dark'] .labels-page .labels-empty-state__inner p,
:root[data-theme='dark'] .labels-page .labels-config-card__field-label,
:root[data-theme='dark'] .labels-page .labels-output-card__copy,
:root[data-theme='dark'] .labels-page .labels-output-card__list,
:root[data-theme='dark'] .labels-page .labels-output-card__meta-item span {
    color: #94a3b8;
}

:root[data-theme='dark'] .labels-page .labels-builder-note {
    border-color: rgba(167, 139, 250, 0.28);
    background: linear-gradient(180deg, rgba(91, 33, 182, 0.22) 0%, rgba(30, 41, 59, 0.55) 100%);
    color: #cbd5e1;
}

:root[data-theme='dark'] .labels-page .labels-builder-note strong {
    color: #f8fafc;
}

:root[data-theme='dark'] .labels-page .labels-products-table th {
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    border-color: #334866;
}

:root[data-theme='dark'] .labels-page .labels-products-table td {
    border-color: rgba(255, 255, 255, 0.06);
}

:root[data-theme='dark'] .labels-page .labels-product-variation {
    border-color: rgba(129, 140, 248, 0.36);
    background: rgba(79, 70, 229, 0.18);
    color: #c7d2fe;
}

:root[data-theme='dark'] .labels-page .labels-empty-state__inner i {
    color: #c4b5fd;
}

:root[data-theme='dark'] .labels-page .labels-config-card:hover {
    border-color: rgba(167, 139, 250, 0.4);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

:root[data-theme='dark'] .labels-page .labels-config-card--disabled {
    background: rgba(255, 255, 255, 0.03);
}

:root[data-theme='dark'] .labels-page .labels-config-card__tag {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}

:root[data-theme='dark'] .labels-page .labels-config-card__extra {
    border-top-color: #334866;
}

:root[data-theme='dark'] .labels-page .labels-output-card {
    border-color: rgba(167, 139, 250, 0.32);
    background: linear-gradient(180deg, rgba(91, 33, 182, 0.24) 0%, rgba(17, 24, 39, 0.88) 100%);
}

:root[data-theme='dark'] .labels-page .labels-output-card__kicker {
    color: #c4b5fd;
}

:root[data-theme='dark'] .products-filters-panel .form-group label {
    color: var(--text-secondary, #cbd5e1);
}

:root[data-theme='dark'] .products-filters-panel .form-control,
:root[data-theme='dark'] .products-filters-panel .select2-container--default .select2-selection--single {
    background: #1a2740;
    border-color: #334866 !important;
    color: #e2e8f0;
}

:root[data-theme='dark'] .products-page .dt-buttons .dt-button,
:root[data-theme='dark'] .products-page .dt-buttons a.dt-button,
:root[data-theme='dark'] .products-page .dt-buttons button.dt-button {
    background: var(--bg-surface-soft, #1a2740);
    border-color: var(--border-strong, #334866);
    color: var(--text-primary, #e2e8f0);
}

:root[data-theme='dark'] .products-page .dt-buttons .dt-button:hover,
:root[data-theme='dark'] .products-page .dt-buttons .dt-button:focus,
:root[data-theme='dark'] .products-page .dt-buttons .dt-button.active {
    background: rgba(255, 255, 255, 0.06);
}

:root[data-theme='dark'] .products-page .product-thumbnail-small {
    border-color: #334866;
    background: rgba(255, 255, 255, 0.05);
}

:root[data-theme='dark'] .products-page .btn-group > .dropdown-toggle:not(.users-btn-primary):not(.users-btn-light) {
    background: var(--bg-surface-soft, #1a2740);
    border-color: var(--border-strong, #334866);
    color: var(--text-primary, #e2e8f0);
}

:root[data-theme='dark'] .products-page .dropdown-menu {
    background: var(--bg-surface, #111a2c);
    border-color: #22314d;
}

:root[data-theme='dark'] .products-page .dropdown-menu > li > a {
    color: #e2e8f0;
}

:root[data-theme='dark'] .products-page .dropdown-menu > li > a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

:root[data-theme='dark'] .products-add-page .products-add-copy {
    color: var(--text-secondary, #cbd5e1);
}

:root[data-theme='dark'] .products-add-page .products-add-section .box-header small {
    color: var(--text-muted, #94a3b8);
}

:root[data-theme='dark'] .products-add-page .products-add-section .input-group-btn > .btn {
    background: var(--bg-surface-soft, #1a2740);
    border-color: var(--border-strong, #334866);
    color: var(--text-secondary, #cbd5e1);
}

:root[data-theme='dark'] .products-add-page .add-product-price-table {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .products-add-page .add-product-price-table th {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary, #e2e8f0);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .products-add-page .add-product-price-table td,
:root[data-theme='dark'] .products-add-page .combo_product_table_footer td {
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .products-add-page .combo_product_table_footer td {
    background: rgba(255, 255, 255, 0.04);
}

:root[data-theme='dark'] .products-add-page .products-add-section-head h4,
:root[data-theme='dark'] .products-add-page .products-add-rack-card > label,
:root[data-theme='dark'] .products-add-page .products-single-price-card__title {
    color: var(--text-primary, #e2e8f0);
}

:root[data-theme='dark'] .products-add-page .products-add-upload-field,
:root[data-theme='dark'] .products-add-page .products-add-rack-card,
:root[data-theme='dark'] .products-add-page .products-single-price-card,
:root[data-theme='dark'] .products-add-page .products-single-existing-media .img-thumbnail {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .products-add-page .products-add-upload-input {
    background: #1a2740;
    border-color: #334866;
    color: #e2e8f0;
}

:root[data-theme='dark'] .products-add-page .products-add-upload-input::file-selector-button {
    background: rgba(148, 163, 184, 0.14);
    border-color: rgba(148, 163, 184, 0.28);
    color: #f8fafc;
}

:root[data-theme='dark'] .products-add-page .products-add-upload-help,
:root[data-theme='dark'] .products-single-price-field label {
    color: var(--text-muted, #94a3b8);
}

:root[data-theme='dark'] .products-add-page .products-add-upload-field .file-input .form-control.file-caption,
:root[data-theme='dark'] .products-add-page .products-add-upload-field .file-preview {
    background: #1a2740;
    border-color: #334866;
    color: #e2e8f0;
}

:root[data-theme='dark'] .products-add-page .products-add-upload-field .file-input .btn-file,
:root[data-theme='dark'] .products-add-page .products-add-upload-field .file-input .fileinput-remove,
:root[data-theme='dark'] .products-add-page .products-add-upload-field .file-input .fileinput-upload,
:root[data-theme='dark'] .products-add-page .products-add-upload-field .file-drop-zone {
    background: rgba(148, 163, 184, 0.08);
    border-color: #334866;
    color: #f8fafc;
}

:root[data-theme='dark'] .products-add-page .products-add-upload-field .file-drop-zone-title {
    color: #94a3b8;
}

:root[data-theme='dark'] .products-add-page .products-add-submit:hover,
:root[data-theme='dark'] .products-add-page .products-add-submit:focus {
    box-shadow: none;
}

:root[data-theme='dark'] .products-group-prices-page .products-group-prices-copy,
:root[data-theme='dark'] .products-group-prices-product h3 span,
:root[data-theme='dark'] .products-group-prices-head small,
:root[data-theme='dark'] .products-group-prices-variation span,
:root[data-theme='dark'] .products-group-prices-empty {
    color: var(--text-secondary, #cbd5e1);
}

:root[data-theme='dark'] .products-group-prices-label,
:root[data-theme='dark'] .products-group-prices-meta-card span {
    color: var(--text-muted, #94a3b8);
}

:root[data-theme='dark'] .products-group-prices-product h3,
:root[data-theme='dark'] .products-group-prices-meta-card strong,
:root[data-theme='dark'] .products-group-prices-variation strong,
:root[data-theme='dark'] .products-group-prices-default-price {
    color: var(--text-primary, #e2e8f0);
}

:root[data-theme='dark'] .products-group-prices-meta-card,
:root[data-theme='dark'] .products-group-prices-empty {
    border-color: var(--border-strong, #334866);
    background: var(--bg-surface-soft, #1a2740);
    box-shadow: none;
}

:root[data-theme='dark'] .purchase-create-page .purchase-create-copy,
:root[data-theme='dark'] .expense-create-page .expense-create-copy,
:root[data-theme='dark'] .stock-adjustment-create-page .stock-adjustment-create-copy,
:root[data-theme='dark'] .purchase-requisition-create-page .purchase-requisition-create-copy,
:root[data-theme='dark'] .purchase-requisition-create-hero-copy p:last-child,
:root[data-theme='dark'] .purchase-requisition-create-section-head p,
:root[data-theme='dark'] .purchase-requisition-line-product span,
:root[data-theme='dark'] .purchase-requisition-line-product p,
:root[data-theme='dark'] .purchase-requisition-line-secondary-label,
:root[data-theme='dark'] .purchase-requisition-empty-state span {
    color: var(--text-secondary, #cbd5e1);
}

:root[data-theme='dark'] .purchase-requisition-create-meta-card span,
:root[data-theme='dark'] .purchase-requisition-create-section-kicker,
:root[data-theme='dark'] .purchase-requisition-create-kicker {
    color: var(--text-muted, #94a3b8);
}

:root[data-theme='dark'] .purchase-requisition-create-hero-copy h3,
:root[data-theme='dark'] .purchase-requisition-create-section-head h4,
:root[data-theme='dark'] .purchase-requisition-create-meta-card strong,
:root[data-theme='dark'] .purchase-requisition-field label,
:root[data-theme='dark'] .purchase-requisition-line-product strong,
:root[data-theme='dark'] .purchase-requisition-line-alert,
:root[data-theme='dark'] .purchase-requisition-empty-state strong {
    color: var(--text-primary, #e2e8f0);
}

:root[data-theme='dark'] .purchase-requisition-create-hero {
    border-color: rgba(96, 165, 250, 0.2);
    background: linear-gradient(180deg, rgba(30, 64, 175, 0.18) 0%, rgba(30, 41, 59, 0.28) 100%);
}

:root[data-theme='dark'] .purchase-requisition-create-meta-card,
:root[data-theme='dark'] .purchase-requisition-create-section,
:root[data-theme='dark'] .purchase-requisition-create-table-wrap {
    border-color: var(--border-strong, #334866);
    background: var(--bg-surface-soft, #1a2740);
    box-shadow: none;
}

:root[data-theme='dark'] .purchase-requisition-create-section--table,
:root[data-theme='dark'] .purchase-requisition-create-table-wrap {
    background: var(--bg-surface, #162033);
}

:root[data-theme='dark'] .purchase-requisition-field .form-control,
:root[data-theme='dark'] .purchase-requisition-field .select2-container .select2-selection--single,
:root[data-theme='dark'] .purchase-requisition-field .select2-container .select2-selection--multiple,
:root[data-theme='dark'] .purchase-requisition-line-input-group .form-control,
:root[data-theme='dark'] .purchase-requisition-input-group .form-control {
    border-color: var(--border-strong, #334155);
    background: var(--bg-surface, #162033);
    color: var(--text-primary, #f8fafc);
}

:root[data-theme='dark'] .purchase-requisition-input-group .input-group-addon,
:root[data-theme='dark'] .purchase-requisition-line-input-group .input-group-addon {
    border-color: var(--border-strong, #334155);
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
}

:root[data-theme='dark'] .purchase-requisition-create-table thead th {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted, #94a3b8);
    border-bottom-color: var(--border-strong, #334866) !important;
}

:root[data-theme='dark'] .purchase-requisition-create-table tbody td {
    color: var(--text-secondary, #cbd5e1);
    border-bottom-color: rgba(148, 163, 184, 0.14) !important;
}

:root[data-theme='dark'] .purchase-requisition-empty-state {
    border-top-color: var(--border-strong, #334866);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.82) 0%, rgba(22, 32, 51, 0.96) 100%);
}

:root[data-theme='dark'] .products-stock-history-page .products-stock-history-copy,
:root[data-theme='dark'] .products-stock-history-copy p,
:root[data-theme='dark'] .products-stock-history-summary-table > tbody > tr > td,
:root[data-theme='dark'] .products-stock-history-ref-cell span {
    color: var(--text-secondary, #cbd5e1);
}

:root[data-theme='dark'] .products-stock-history-copy h4,
:root[data-theme='dark'] .products-stock-history-stat strong,
:root[data-theme='dark'] .products-stock-history-summary-table > tbody > tr > td:last-child,
:root[data-theme='dark'] .products-stock-history-balance,
:root[data-theme='dark'] .products-stock-history-date-cell strong,
:root[data-theme='dark'] .products-stock-history-ref-cell strong,
:root[data-theme='dark'] .products-stock-history-contact-cell strong {
    color: var(--text-primary, #e2e8f0);
}

:root[data-theme='dark'] .products-stock-history-stat span,
:root[data-theme='dark'] .products-stock-history-summary-title {
    color: var(--text-muted, #94a3b8);
}

:root[data-theme='dark'] .products-stock-history-stat,
:root[data-theme='dark'] .products-stock-history-summary-card {
    border-color: var(--border-strong, #334866);
    background: var(--bg-surface-soft, #1a2740);
    box-shadow: none;
}

:root[data-theme='dark'] .products-stock-history-stat--accent {
    border-color: rgba(96, 165, 250, 0.24);
    background: linear-gradient(180deg, rgba(30, 64, 175, 0.18) 0%, rgba(30, 41, 59, 0.28) 100%);
}

:root[data-theme='dark'] .products-stock-history-summary-table > tbody > tr > td,
:root[data-theme='dark'] .products-stock-history-panel .users-table-controls,
:root[data-theme='dark'] .products-stock-history-toolbar-row {
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .products-stock-history-toolbar-row {
    background: var(--bg-surface-soft, #1a2740);
}

:root[data-theme='dark'] .products-stock-history-type-pill--opening_stock {
    background: rgba(99, 102, 241, 0.22);
    border-color: rgba(165, 180, 252, 0.35);
    color: #c7d2fe;
}

:root[data-theme='dark'] .products-stock-history-type-pill--purchase,
:root[data-theme='dark'] .products-stock-history-type-pill--purchase_transfer {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(52, 211, 153, 0.4);
    color: #6ee7b7;
}

:root[data-theme='dark'] .products-stock-history-type-pill--sell,
:root[data-theme='dark'] .products-stock-history-type-pill--sell_transfer {
    background: rgba(244, 63, 94, 0.18);
    border-color: rgba(251, 113, 133, 0.38);
    color: #fecdd3;
}

:root[data-theme='dark'] .products-stock-history-type-pill--stock_adjustment {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(251, 191, 36, 0.4);
    color: #fde68a;
}

:root[data-theme='dark'] .products-stock-history-type-pill--purchase_return {
    background: rgba(249, 115, 22, 0.2);
    border-color: rgba(253, 186, 116, 0.4);
    color: #fed7aa;
}

:root[data-theme='dark'] .products-stock-history-type-pill--sell_return {
    background: rgba(20, 184, 166, 0.2);
    border-color: rgba(45, 212, 191, 0.4);
    color: #99f6e4;
}

:root[data-theme='dark'] .products-stock-history-type-pill--manufacturing_ingredient {
    background: rgba(139, 92, 246, 0.22);
    border-color: rgba(196, 181, 253, 0.4);
    color: #ddd6fe;
}

:root[data-theme='dark'] .products-stock-history-type-pill--manufacturing_output {
    background: rgba(6, 182, 212, 0.2);
    border-color: rgba(34, 211, 238, 0.4);
    color: #a5f3fc;
}

:root[data-theme='dark'] .products-stock-history-type-pill--default {
    background: rgba(96, 165, 250, 0.16);
    border-color: rgba(147, 197, 253, 0.35);
    color: #bfdbfe;
}

:root[data-theme='dark'] .purchases-edit-page .purchase-edit-copy,
:root[data-theme='dark'] .purchase-form-page .purchase-edit-section .box-header small,
:root[data-theme='dark'] .purchase-form-page .purchase-edit-inline-card__label,
:root[data-theme='dark'] .purchase-form-page .purchase-edit-metric span,
:root[data-theme='dark'] .purchase-form-page .purchase-edit-summary-row span {
    color: var(--text-muted, #94a3b8);
}

:root[data-theme='dark'] .purchase-form-page .purchase-edit-section .box-header {
    border-color: var(--border-strong, #334155);
}

:root[data-theme='dark'] .purchase-form-page .purchase-edit-section .box-title,
:root[data-theme='dark'] .purchase-form-page .purchase-edit-inline-card__value,
:root[data-theme='dark'] .purchase-form-page .purchase-edit-metric strong,
:root[data-theme='dark'] .purchase-form-page .purchase-edit-summary-row strong,
:root[data-theme='dark'] .purchase-form-page table#purchase_entry_table tbody td:nth-child(2) {
    color: var(--text-primary, #f8fafc);
}

:root[data-theme='dark'] .purchase-form-page .purchase-edit-section .form-control,
:root[data-theme='dark'] .purchase-form-page .purchase-edit-section .select2-container--default .select2-selection--single,
:root[data-theme='dark'] .purchase-form-page .purchase-edit-section .select2-container--default .select2-selection--multiple {
    border-color: var(--border-strong, #334155);
    background: var(--bg-surface, #162033);
    color: var(--text-primary, #f8fafc);
}

:root[data-theme='dark'] .purchase-form-page .purchase-edit-section .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary, #f8fafc);
}

:root[data-theme='dark'] .purchase-form-page .purchase-edit-section .input-group-addon,
:root[data-theme='dark'] .purchase-form-page .purchase-edit-section .input-group-btn > .btn {
    border-color: var(--border-strong, #334155);
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
}

:root[data-theme='dark'] .purchase-form-page .purchase-edit-inline-card,
:root[data-theme='dark'] .purchase-form-page .purchase-edit-metric,
:root[data-theme='dark'] .purchase-form-page .purchase-edit-expenses-card {
    border-color: var(--border-strong, #334155);
    background: rgba(255, 255, 255, 0.04);
}

:root[data-theme='dark'] .purchase-form-page .purchase-edit-inline-link {
    color: #93c5fd;
}

:root[data-theme='dark'] .purchase-form-page .purchase-edit-inline-link:hover,
:root[data-theme='dark'] .purchase-form-page .purchase-edit-inline-link:focus {
    color: #bfdbfe;
}

:root[data-theme='dark'] .purchase-form-page .purchase-edit-table-wrap {
    border-color: var(--border-strong, #334155);
    background: var(--bg-surface, #162033);
}

:root[data-theme='dark'] .purchase-form-page table#purchase_entry_table thead th {
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    border-color: var(--border-strong, #334155);
}

:root[data-theme='dark'] .purchase-form-page table#purchase_entry_table tbody td {
    border-color: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
}

:root[data-theme='dark'] .purchase-form-page .remove_purchase_entry_row {
    border-color: rgba(251, 113, 133, 0.3);
    background: rgba(190, 24, 93, 0.18);
    color: #fecdd3 !important;
    box-shadow: none;
}

:root[data-theme='dark'] .purchase-form-page .remove_purchase_entry_row:hover,
:root[data-theme='dark'] .purchase-form-page .remove_purchase_entry_row:focus {
    background: rgba(190, 24, 93, 0.28);
}

:root[data-theme='dark'] .purchase-form-page .purchase-edit-summary-card,
:root[data-theme='dark'] .purchase-form-page .purchase-edit-summary-row--grand {
    border-color: rgba(167, 139, 250, 0.35);
    background: linear-gradient(180deg, rgba(91, 33, 182, 0.22) 0%, rgba(59, 7, 100, 0.16) 100%);
}

:root[data-theme='dark'] .purchase-form-page .purchase-edit-summary-row {
    border-color: rgba(167, 139, 250, 0.22);
}

:root[data-theme='dark'] .nestiko-purchase-delete-modal .modal-content {
    background: var(--bg-surface, #111a2c);
    box-shadow: 0 28px 64px rgba(0, 0, 0, 0.46);
}

:root[data-theme='dark'] .nestiko-purchase-delete-modal .modal-header,
:root[data-theme='dark'] .purchase-delete-modal-footer {
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .purchase-delete-modal-kicker {
    color: #fda4af;
}

:root[data-theme='dark'] .nestiko-purchase-delete-modal .modal-title,
:root[data-theme='dark'] .purchase-delete-modal-alert__content strong,
:root[data-theme='dark'] .purchase-delete-modal-card strong {
    color: var(--text-primary, #f8fafc);
}

:root[data-theme='dark'] .purchase-delete-modal-copy,
:root[data-theme='dark'] .purchase-delete-modal-alert__content p,
:root[data-theme='dark'] .purchase-delete-modal-card span {
    color: var(--text-muted, #94a3b8);
}

:root[data-theme='dark'] .purchase-delete-modal-close {
    border-color: var(--border-strong, #334866);
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
}

:root[data-theme='dark'] .purchase-delete-modal-close:hover,
:root[data-theme='dark'] .purchase-delete-modal-close:focus {
    border-color: rgba(251, 113, 133, 0.36);
    background: rgba(190, 24, 93, 0.22);
    color: #fecdd3;
}

:root[data-theme='dark'] .purchase-delete-modal-alert {
    border-color: rgba(251, 113, 133, 0.28);
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.28) 0%, rgba(76, 5, 25, 0.24) 100%);
}

:root[data-theme='dark'] .purchase-delete-modal-alert__icon {
    background: rgba(251, 113, 133, 0.18);
    color: #fecdd3;
}

:root[data-theme='dark'] .purchase-delete-modal-card {
    border-color: var(--border-strong, #334866);
    background: rgba(255, 255, 255, 0.04);
}

:root[data-theme='dark'] .purchase-delete-modal-card--accent {
    border-color: rgba(251, 113, 133, 0.3);
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.26) 0%, rgba(59, 7, 100, 0.16) 100%);
}

:root[data-theme='dark'] .purchase-delete-modal-delete {
    border-color: #f87171;
    background: #dc2626;
    color: #ffffff;
}

:root[data-theme='dark'] .purchase-delete-modal-delete:hover,
:root[data-theme='dark'] .purchase-delete-modal-delete:focus {
    border-color: #fb7185;
    background: #be123c;
    color: #ffffff;
}

:root[data-theme='dark'] .nestiko-purchase-status-modal .modal-content {
    background: var(--bg-surface, #111a2c);
    box-shadow: 0 28px 64px rgba(0, 0, 0, 0.46);
}

:root[data-theme='dark'] .nestiko-purchase-status-modal .modal-header,
:root[data-theme='dark'] .purchase-status-modal-footer {
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .purchase-status-modal-kicker,
:root[data-theme='dark'] .purchase-status-modal-section-kicker {
    color: #93c5fd;
}

:root[data-theme='dark'] .nestiko-purchase-status-modal .modal-title,
:root[data-theme='dark'] .purchase-status-modal-card strong,
:root[data-theme='dark'] .purchase-status-modal-flow-card strong,
:root[data-theme='dark'] .purchase-status-modal-alert__content strong,
:root[data-theme='dark'] .purchase-status-modal-section-head h5,
:root[data-theme='dark'] .purchase-status-option__label {
    color: var(--text-primary, #f8fafc);
}

:root[data-theme='dark'] .purchase-status-modal-copy,
:root[data-theme='dark'] .purchase-status-modal-card span,
:root[data-theme='dark'] .purchase-status-modal-flow-card span,
:root[data-theme='dark'] .purchase-status-modal-flow-note,
:root[data-theme='dark'] .purchase-status-modal-alert__content p,
:root[data-theme='dark'] .purchase-status-modal-section-head p,
:root[data-theme='dark'] .purchase-status-option__copy,
:root[data-theme='dark'] .purchase-status-option__eyebrow {
    color: var(--text-muted, #94a3b8);
}

:root[data-theme='dark'] .purchase-status-modal-close {
    border-color: var(--border-strong, #334866);
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
}

:root[data-theme='dark'] .purchase-status-modal-close:hover,
:root[data-theme='dark'] .purchase-status-modal-close:focus {
    border-color: rgba(96, 165, 250, 0.38);
    background: rgba(29, 78, 216, 0.18);
    color: #bfdbfe;
}

:root[data-theme='dark'] .purchase-status-modal-card,
:root[data-theme='dark'] .purchase-status-modal-options-shell,
:root[data-theme='dark'] .purchase-status-option__surface {
    border-color: var(--border-strong, #334866);
    background: rgba(255, 255, 255, 0.04);
}

:root[data-theme='dark'] .purchase-status-modal-card--accent {
    border-color: rgba(96, 165, 250, 0.28);
    background: linear-gradient(180deg, rgba(30, 64, 175, 0.2) 0%, rgba(37, 99, 235, 0.1) 100%);
}

:root[data-theme='dark'] .purchase-status-modal-flow {
    border-color: rgba(96, 165, 250, 0.24);
    background: linear-gradient(180deg, rgba(30, 64, 175, 0.18) 0%, rgba(15, 23, 42, 0.22) 100%);
}

:root[data-theme='dark'] .purchase-status-modal-flow-card--accent strong {
    color: #93c5fd;
}

:root[data-theme='dark'] .purchase-status-modal-flow-arrow {
    border-color: rgba(96, 165, 250, 0.24);
    background: rgba(59, 130, 246, 0.14);
    color: #bfdbfe;
}

:root[data-theme='dark'] .purchase-status-modal-alert {
    border-color: rgba(96, 165, 250, 0.24);
    background: linear-gradient(180deg, rgba(30, 64, 175, 0.16) 0%, rgba(15, 23, 42, 0.24) 100%);
}

:root[data-theme='dark'] .purchase-status-modal-alert__icon {
    background: rgba(96, 165, 250, 0.18);
    color: #bfdbfe;
}

:root[data-theme='dark'] .purchase-status-option:hover .purchase-status-option__surface,
:root[data-theme='dark'] .purchase-status-option:focus-within .purchase-status-option__surface {
    border-color: rgba(96, 165, 250, 0.36);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
}

:root[data-theme='dark'] .purchase-status-option__input:checked + .purchase-status-option__surface {
    border-color: #60a5fa;
    background: linear-gradient(180deg, rgba(29, 78, 216, 0.28) 0%, rgba(30, 41, 59, 0.3) 100%);
    box-shadow: 0 18px 36px rgba(2, 6, 23, 0.32);
}

:root[data-theme='dark'] .purchase-status-option__input:checked + .purchase-status-option__surface::after {
    background: rgba(96, 165, 250, 0.16);
    color: #dbeafe;
}

:root[data-theme='dark'] .purchase-status-option__input:checked + .purchase-status-option__surface .purchase-status-option__eyebrow,
:root[data-theme='dark'] .purchase-status-option__input:checked + .purchase-status-option__surface .purchase-status-option__label {
    color: #dbeafe;
}

:root[data-theme='dark'] .purchase-status-modal-submit {
    border-color: #60a5fa;
    background: #2563eb;
    color: #ffffff;
}

:root[data-theme='dark'] .purchase-status-modal-submit:hover,
:root[data-theme='dark'] .purchase-status-modal-submit:focus {
    border-color: #93c5fd;
    background: #1d4ed8;
    color: #ffffff;
}

:root[data-theme='dark'] .users-badge-neutral {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.06);
    border-color: #334155;
}

:root[data-theme='dark'] .users-badge.users-badge-success {
    color: #86efac;
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(34, 197, 94, 0.35);
}

:root[data-theme='dark'] .users-badge.users-badge-danger {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

:root[data-theme='dark'] .users-badge.users-badge-warning {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.45);
}

:root[data-theme='dark'] .users-badge.users-badge-info {
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.22);
    border-color: rgba(59, 130, 246, 0.4);
}

/* Link account modal (AJAX into .view_modal); payment account add/edit modals (AJAX into .account_model) */
.nestiko-link-account-modal .modal-header,
.nestiko-payment-account-modal .modal-header {
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.nestiko-link-account-modal .modal-footer,
.nestiko-payment-account-modal .modal-footer {
    border-top: 1px solid var(--border-default, #e2e8f0);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

:root[data-theme='dark'] .nestiko-link-account-modal .modal-header,
:root[data-theme='dark'] .nestiko-link-account-modal .modal-footer,
:root[data-theme='dark'] .nestiko-payment-account-modal .modal-header,
:root[data-theme='dark'] .nestiko-payment-account-modal .modal-footer {
    border-color: var(--border-strong, #334866);
}

/* Sales commission agent add/edit modal (AJAX into .commission_agent_modal) */
.nestiko-sales-agent-modal {
    width: calc(100vw - 1.5rem);
    max-width: 30.75rem;
    margin: 2.1rem auto;
}

.nestiko-sales-agent-modal .modal-content {
    border: 1px solid #d6deea;
    border-radius: 0.9rem;
    overflow: hidden;
    background: var(--bg-surface, #ffffff);
    box-shadow: 0 26px 64px rgba(15, 23, 42, 0.22);
}

.nestiko-sales-agent-modal .sales-agent-modal-form {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 4.2rem);
}

.nestiko-sales-agent-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3.15rem;
    padding: 0.9rem 1.15rem 0.85rem;
    border-bottom: 1px solid #dbe3ef;
    background: #edf3fb;
    position: relative;
}

.nestiko-sales-agent-modal .modal-title {
    margin: 0;
    width: 100%;
    padding: 0 2.2rem;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    letter-spacing: 0.01em;
}

.nestiko-sales-agent-modal .sales-agent-modal-close {
    margin: 0;
    position: absolute;
    left: 1rem;
    top: 50%;
    width: 1.4rem;
    height: 1.4rem;
    min-width: 1.4rem;
    padding: 0;
    border: 1px solid #c8d3e2;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--text-secondary, #475569);
    font-size: 1.05rem;
    line-height: 1.2rem;
    text-shadow: none;
    opacity: 1;
    box-shadow: none;
    transform: translateY(-50%);
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.nestiko-sales-agent-modal .sales-agent-modal-close:hover,
.nestiko-sales-agent-modal .sales-agent-modal-close:focus {
    background: #ffffff;
    border-color: #b7c5d8;
    color: var(--text-primary, #0f172a);
}

.nestiko-sales-agent-modal .sales-agent-modal-body {
    padding: 0.9rem 1rem 0.7rem;
    overflow-y: auto;
}

.nestiko-sales-agent-modal .form-group {
    margin-bottom: 0.8rem;
}

.nestiko-sales-agent-modal .form-group label {
    display: block;
    margin-bottom: 0.28rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    line-height: 1.35;
}

.nestiko-sales-agent-modal .form-control {
    min-height: 2rem;
    border-radius: 0.45rem;
    border: 1px solid #c9d6e6;
    background: #ffffff;
    color: var(--text-primary, #0f172a);
    font-size: 0.79rem;
    padding: 0.4rem 0.7rem;
    box-shadow: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.nestiko-sales-agent-modal .form-control::placeholder {
    color: #8ea0b6;
}

.nestiko-sales-agent-modal .form-control:focus {
    border-color: #6a86b7;
    box-shadow: 0 0 0 3px rgba(79, 112, 173, 0.14);
}

.nestiko-sales-agent-modal textarea.form-control {
    min-height: 5rem;
    resize: vertical;
}

.nestiko-sales-agent-modal .sales-agent-modal-commission .form-group {
    margin-top: 0.1rem;
    padding-top: 0.8rem;
    border-top: 1px solid #dbe3ef;
}

.nestiko-sales-agent-modal .modal-footer {
    border-top: 1px solid #dbe3ef;
    padding: 0.8rem 1rem 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-end;
    background: rgba(237, 243, 251, 0.52);
}

.nestiko-sales-agent-modal .modal-footer .users-btn {
    min-width: 4.2rem;
    min-height: 1.95rem;
    padding: 0.34rem 0.9rem;
    font-size: 0.73rem;
    justify-content: center;
}

.nestiko-sales-agent-modal .modal-footer .users-btn-primary {
    border-color: #334866;
    background: #223251;
}

.nestiko-sales-agent-modal .modal-footer .users-btn-light {
    border-color: #cbd5e1;
    background: #ffffff;
    color: #475569;
}

.commission_agent_modal.fade .nestiko-sales-agent-modal {
    transform: translate3d(0, 18px, 0);
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.commission_agent_modal.in .nestiko-sales-agent-modal {
    transform: translate3d(0, 0, 0);
}

@media (max-width: 767px) {
    .nestiko-sales-agent-modal {
        width: calc(100vw - 0.75rem);
        margin: 0.4rem auto;
    }

    .nestiko-sales-agent-modal .modal-header,
    .nestiko-sales-agent-modal .sales-agent-modal-body,
    .nestiko-sales-agent-modal .modal-footer {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .nestiko-sales-agent-modal .modal-footer .users-btn {
        flex: 1 1 auto;
    }
}

:root[data-theme='dark'] .nestiko-sales-agent-modal .modal-content {
    border-color: #2c3a58;
    background: #162136;
    box-shadow: 0 30px 82px rgba(0, 0, 0, 0.58);
}

:root[data-theme='dark'] .nestiko-sales-agent-modal .modal-header {
    border-bottom-color: #2c3a58;
    background: #1a2740;
}

:root[data-theme='dark'] .nestiko-sales-agent-modal .modal-title {
    color: #f8fbff;
}

:root[data-theme='dark'] .nestiko-sales-agent-modal .sales-agent-modal-close {
    border-color: #3a4a69;
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
}

:root[data-theme='dark'] .nestiko-sales-agent-modal .sales-agent-modal-close:hover,
:root[data-theme='dark'] .nestiko-sales-agent-modal .sales-agent-modal-close:focus {
    border-color: #516685;
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
}

:root[data-theme='dark'] .nestiko-sales-agent-modal .form-group label {
    color: #d6deea;
}

:root[data-theme='dark'] .nestiko-sales-agent-modal .form-control {
    border-color: #3b4b69;
    background: #121c2f;
    color: #edf3fb;
}

:root[data-theme='dark'] .nestiko-sales-agent-modal .form-control::placeholder {
    color: #7f91ab;
}

:root[data-theme='dark'] .nestiko-sales-agent-modal .form-control:focus {
    border-color: #567cc4;
    box-shadow: 0 0 0 3px rgba(86, 124, 196, 0.18);
}

:root[data-theme='dark'] .nestiko-sales-agent-modal .sales-agent-modal-commission .form-group,
:root[data-theme='dark'] .nestiko-sales-agent-modal .modal-footer {
    border-color: #2c3a58;
}

:root[data-theme='dark'] .nestiko-sales-agent-modal .modal-footer {
    background: #162136;
}

:root[data-theme='dark'] .nestiko-sales-agent-modal .modal-footer .users-btn-primary {
    border-color: #394b6a;
    background: #223352;
    color: #f8fbff;
}

:root[data-theme='dark'] .nestiko-sales-agent-modal .modal-footer .users-btn-light {
    border-color: #334866;
    background: #1a2740;
    color: #d6deea;
}

/* Payment accounts — Account types tab row actions */
.payment-accounts-types-panel .account-type-actions {
    white-space: nowrap;
}

.payment-accounts-types-panel .account-type-actions .users-btn + .users-btn {
    margin-left: 0.35rem;
}

.payment-accounts-page .payment-accounts-grid-actions,
.account-book-page .account-book-row-actions,
.stock-adjustments-page .stock-adjustments-grid-actions,
.stock-transfers-page .stock-transfers-grid-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.purchase-orders-page .purchase-orders-grid-actions.btn-group {
    display: inline-block;
    vertical-align: middle;
}

.sell-list-grid-actions.btn-group {
    display: inline-block;
    vertical-align: middle;
}

.purchase-list-grid-actions.btn-group {
    display: inline-block;
    vertical-align: middle;
}

.purchase-return-list-page .purchase-return-list-grid-actions.btn-group {
    display: inline-block;
    vertical-align: middle;
}

.sell-return-list-page .sell-return-list-grid-actions.btn-group {
    display: inline-block;
    vertical-align: middle;
}

.sells-page .users-view-title .users-page-subtitle {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.35rem;
    opacity: 0.85;
}

@media print {
    body * {
        visibility: hidden;
    }

    .std-print-area,
    .std-print-area * {
        visibility: visible;
    }

    .std-print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    .users-table-wrap {
        overflow: visible !important;
    }
}

/* Business settings page */
.business-settings-page .users-view-toolbar {
    align-items: flex-start;
}

.business-settings-page .business-settings-copy {
    margin: 0.35rem 0 0;
    max-width: 62rem;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.business-settings-page .business-settings-search {
    margin-bottom: 0.2rem;
}

.business-settings-page .business-settings-search .row {
    margin-left: 0;
    margin-right: 0;
}

.business-settings-page .business-settings-search [class*='col-'] {
    float: none;
    margin: 0 auto;
    padding-left: 0;
    padding-right: 0;
}

.business-settings-page .business-settings-search .input-group {
    width: 100%;
    border: 1px solid var(--border-default, #dbe3ef);
    border-radius: 0.9rem;
    overflow: hidden;
    background: var(--bg-surface, #fff);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.business-settings-page .business-settings-search .input-group-addon {
    min-width: 2.8rem;
    border: 0;
    background: rgba(99, 102, 241, 0.08);
    color: #4f46e5;
}

.business-settings-page .business-settings-search .form-control {
    border: 0;
    height: 2.85rem;
    box-shadow: none;
}

.business-settings-page .business-settings-search .select2-container {
    width: 100% !important;
}

.business-settings-page .business-settings-search .select2-container--default .select2-selection--single {
    min-height: 2.85rem;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
}

.business-settings-page .business-settings-search .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 2.85rem;
    padding-left: 0.2rem;
    color: var(--text-muted, #64748b);
}

.business-settings-page .business-settings-shell {
    border-radius: 1rem;
    overflow: hidden;
}

.business-settings-page .business-settings-shell > .tw-p-2,
.business-settings-page .business-settings-shell .tw-py-2 {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.business-settings-page .business-settings-shell .sm\:tw-px-5 {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.business-settings-page .business-settings-shell .tw-flow-root {
    border-top: 0 !important;
}

.business-settings-page .pos-tab-menu {
    padding: 0;
    background: linear-gradient(180deg, #f8fafc 0%, #eef3ff 100%);
    border-right: 1px solid var(--border-default, #e2e8f0);
}

.business-settings-page .pos-tab-menu .list-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin: 0;
    padding: 1rem 0.75rem;
}

.business-settings-page .pos-tab-menu .list-group > a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.65rem;
    padding: 0.68rem 0.8rem;
    border: 1px solid transparent;
    border-radius: 0.85rem;
    background: transparent;
    color: var(--text-secondary, #475569);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.25;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.business-settings-page .pos-tab-menu .list-group > a:hover {
    background: rgba(255, 255, 255, 0.78);
    border-color: var(--border-default, #dbe3ef);
    color: var(--text-primary, #0f172a);
}

.business-settings-page .pos-tab-menu .list-group > a.active,
.business-settings-page .pos-tab-menu .list-group > a.active:hover,
.business-settings-page .pos-tab-menu .list-group > a.active:focus {
    border-color: transparent;
    background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.22);
}

.business-settings-page .pos-tab-menu .list-group > a.active:after {
    display: none;
}

.business-settings-page .pos-tab {
    background: var(--bg-surface, #fff);
    padding: 1rem 1.15rem 1.15rem;
}

.business-settings-page .pos-tab-content {
    padding: 0;
}

.business-settings-page .pos-tab-content:not(.active) {
    display: none;
}

.business-settings-page .business-settings-tab-head {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.85rem;
    background: var(--bg-surface-soft, #f8fafc);
}

.business-settings-page .business-settings-tab-title {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.business-settings-page .business-settings-tab-copy {
    margin: 0.28rem 0 0;
    font-size: 0.79rem;
    line-height: 1.5;
    color: var(--text-muted, #64748b);
}

.business-settings-page .pos-tab-content .row + .row {
    margin-top: 0;
}

.business-settings-page .pos-tab-content .form-group {
    margin-bottom: 1rem;
}

.business-settings-page .pos-tab-content .input-group {
    border-radius: 0.75rem;
    overflow: hidden;
}

.business-settings-page .pos-tab-content .input-group .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.business-settings-page .pos-tab-content .form-control,
.business-settings-page .pos-tab-content .select2-container--default .select2-selection--single,
.business-settings-page .pos-tab-content .select2-container--default .select2-selection--multiple {
    min-height: 2.7rem;
    border-radius: 0.75rem !important;
}

.business-settings-page .pos-tab-content .input-group .select2-container--default .select2-selection--single,
.business-settings-page .pos-tab-content .input-group .select2-container--default .select2-selection--multiple {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.business-settings-page .pos-tab-content .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 2.55rem;
}

.business-settings-page .pos-tab-content input[type='file'] {
    display: block;
    width: 100%;
    padding: 0.32rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.75rem;
    background: var(--bg-surface, #fff);
}

.business-settings-page .pos-tab-content input[type='file']::file-selector-button,
.business-settings-page .pos-tab-content input[type='file']::-webkit-file-upload-button {
    margin-right: 0.7rem;
    border: 0;
    border-radius: 0.6rem;
    background: #2563eb;
    color: #fff;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
}

.business-settings-page .business-settings-actions {
    display: flex;
    justify-content: center;
}

.business-settings-page .business-settings-submit {
    min-width: 12rem;
    justify-content: center;
}

@media (max-width: 991px) {
    .business-settings-page .pos-tab-menu,
    .business-settings-page .pos-tab {
        width: 100%;
    }

    .business-settings-page .pos-tab-menu {
        border-right: 0;
        border-bottom: 1px solid var(--border-default, #e2e8f0);
    }

    .business-settings-page .pos-tab-menu .list-group {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    }

    .business-settings-page .pos-tab {
        padding: 0.95rem;
    }
}

@media (max-width: 767px) {
    .business-settings-page .business-settings-search [class*='col-'] {
        width: 100%;
    }
}

:root[data-theme='dark'] .business-settings-page .business-settings-copy,
:root[data-theme='dark'] .business-settings-page .business-settings-tab-copy {
    color: #94a3b8;
}

:root[data-theme='dark'] .business-settings-page .business-settings-search .input-group,
:root[data-theme='dark'] .business-settings-page .business-settings-shell,
:root[data-theme='dark'] .business-settings-page .pos-tab,
:root[data-theme='dark'] .business-settings-page .business-settings-tab-head,
:root[data-theme='dark'] .business-settings-page .pos-tab-content input[type='file'] {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .business-settings-page .business-settings-search .input-group-addon {
    background: rgba(99, 102, 241, 0.14);
    color: #a5b4fc;
}

:root[data-theme='dark'] .business-settings-page .business-settings-search .select2-container--default .select2-selection--single .select2-selection__rendered,
:root[data-theme='dark'] .business-settings-page .business-settings-tab-title {
    color: var(--text-primary, #e2e8f0);
}

:root[data-theme='dark'] .business-settings-page .pos-tab-menu {
    background: linear-gradient(180deg, rgba(20, 29, 49, 0.98), rgba(29, 41, 67, 1) 100%);
    border-right-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .business-settings-page .pos-tab-menu .list-group > a {
    color: #cbd5e1;
}

:root[data-theme='dark'] .business-settings-page .pos-tab-menu .list-group > a:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(148, 163, 184, 0.2);
    color: #f8fafc;
}

/* Invoice Settings — layout cards (tab 2) */
.invoice-settings-page .invoice-settings-tabs {
    margin-top: 0.5rem;
}

.invoice-settings-page .invoice-settings-layouts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 1rem;
    padding: 0.25rem 0 0.5rem;
}

.invoice-settings-page .invoice-settings-layout-card {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.75rem;
    background: var(--bg-surface, #fff);
    padding: 1rem;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.invoice-settings-page .invoice-settings-layout-card:hover {
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.invoice-settings-page .invoice-settings-layout-card__link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

.invoice-settings-page .invoice-settings-layout-card__link:hover .invoice-settings-layout-card__name {
    color: #6366f1;
}

.invoice-settings-page .invoice-settings-layout-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    font-size: 1.35rem;
}

.invoice-settings-page .invoice-settings-layout-card__name {
    font-weight: 600;
    font-size: 0.98rem;
    line-height: 1.35;
    word-break: break-word;
}

.invoice-settings-page .invoice-settings-layout-card__meta {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
}

.invoice-settings-page .invoice-settings-layout-card__locations {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    line-height: 1.4;
}

:root[data-theme='dark'] .invoice-settings-page .invoice-settings-layout-card {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .invoice-settings-page .invoice-settings-layout-card__locations {
    color: #94a3b8;
}

/* Invoice layout create / edit + Barcode / Printer add/edit — Nestiko shell */
.invoice-layout-edit-page,
.barcode-form-page,
.printer-form-page {
    max-width: 100%;
}

.invoice-layout-edit-page .box,
.barcode-form-page .box,
.printer-form-page .box {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.75rem;
    background: var(--bg-surface, #fff);
    box-shadow: none;
    margin-bottom: 1rem;
}

.invoice-layout-edit-page .box-header,
.barcode-form-page .box-header,
.printer-form-page .box-header {
    background: transparent;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    padding: 0.85rem 1rem;
}

.invoice-layout-edit-page .box-title,
.barcode-form-page .box-title,
.printer-form-page .box-title {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--text-primary, #0f172a);
}

.invoice-layout-edit-page .box-body,
.barcode-form-page .box-body,
.printer-form-page .box-body {
    padding: 1rem 1.1rem;
}

.invoice-layout-edit-page .users-btn-primary.tw-dw-btn-lg,
.invoice-layout-edit-page .tw-dw-btn-primary.tw-dw-btn-lg,
.barcode-form-page .users-btn-primary.tw-dw-btn-lg,
.barcode-form-page .tw-dw-btn-primary.tw-dw-btn-lg,
.printer-form-page .users-btn-primary.tw-dw-btn-lg,
.printer-form-page .tw-dw-btn-primary.tw-dw-btn-lg {
    border-radius: 0.5rem;
    min-width: 8rem;
}

:root[data-theme='dark'] .invoice-layout-edit-page .box,
:root[data-theme='dark'] .barcode-form-page .box,
:root[data-theme='dark'] .printer-form-page .box {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .invoice-layout-edit-page .box-title,
:root[data-theme='dark'] .barcode-form-page .box-title,
:root[data-theme='dark'] .printer-form-page .box-title {
    color: #e2e8f0;
}

:root[data-theme='dark'] .invoice-layout-edit-page .box-header,
:root[data-theme='dark'] .barcode-form-page .box-header,
:root[data-theme='dark'] .printer-form-page .box-header {
    border-bottom-color: var(--border-strong, #334866);
}

/* Compact form modals (restaurant tables add/edit, etc.) */
.nestiko-form-modal.modal-dialog {
    max-width: 26rem;
    margin: 1.75rem auto;
}

.nestiko-form-modal .modal-content {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.75rem;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.15);
    overflow: hidden;
    background: var(--bg-surface, #fff);
}

.nestiko-form-modal .modal-header {
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    padding: 1rem 1.15rem;
}

.nestiko-form-modal .modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #0f172a);
    margin: 0;
}

.nestiko-form-modal .modal-header .close {
    opacity: 0.55;
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1;
}

/* AJAX modals (.view_modal): Bootstrap .close uses float:right + negative margins — breaks flex headers */
.view_modal .modal-dialog .modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    flex-wrap: nowrap;
}

.view_modal .modal-dialog .modal-header > .close {
    float: none !important;
    margin: 0 !important;
    position: relative !important;
    top: auto !important;
    right: auto !important;
    flex-shrink: 0;
    order: 99;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    min-width: 2.25rem;
    padding: 0;
    line-height: 1;
    font-size: 1.2rem;
    font-weight: 500;
    text-shadow: none;
    opacity: 0.75;
    border-radius: 999px;
    border: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--text-secondary, #475569);
}

.view_modal .modal-dialog .modal-header > .close:hover,
.view_modal .modal-dialog .modal-header > .close:focus {
    opacity: 1;
    color: var(--text-primary, #0f172a);
    border-color: var(--border-strong, #cbd5e1);
    background: var(--bg-surface, #ffffff);
}

.view_modal .modal-dialog .modal-header > .close span {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transform: translateY(-0.04em);
}

:root[data-theme='dark'] .view_modal .modal-dialog .modal-header > .close {
    border-color: var(--border-strong, #334866);
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    opacity: 0.9;
}

:root[data-theme='dark'] .view_modal .modal-dialog .modal-header > .close:hover,
:root[data-theme='dark'] .view_modal .modal-dialog .modal-header > .close:focus {
    border-color: #475569;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/*
 * Product record modal is loaded into #view_product_modal.view_modal. Generic `.view_modal .modal-dialog .modal-header`
 * (above) wins specificity over `app.css` `.nestiko-product-view-modal .modal-header`, and AdminLTE/Bootstrap often
 * center `.modal-title`. Force left-aligned header content to match modal body.
 */
#view_product_modal.view_modal .nestiko-product-view-modal .modal-header {
    text-align: left !important;
    align-items: center !important;
    justify-content: space-between !important;
}

#view_product_modal .nestiko-product-view-heading {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    text-align: left !important;
}

#view_product_modal .nestiko-product-view-modal .modal-title,
#view_product_modal .nestiko-product-view-kicker {
    text-align: left !important;
}

#view_product_modal .nestiko-product-view-subtitle {
    justify-content: flex-start !important;
    text-align: left !important;
}

/* Group prices view (stock report → .view_modal): same header alignment fix as product record */
.view_modal .nestiko-group-prices-view-modal .modal-header {
    text-align: left !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.view_modal .nestiko-group-prices-view-heading {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    text-align: left !important;
}

.view_modal .nestiko-group-prices-view-modal .modal-title {
    text-align: left !important;
}

.nestiko-form-modal .modal-body {
    padding: 1.1rem 1.15rem 0.5rem;
}

.nestiko-form-modal .modal-footer {
    border-top: 1px solid var(--border-default, #e2e8f0);
    padding: 0.85rem 1.15rem 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
    background: var(--bg-surface, #fff);
}

/* Modifier add/edit — wider modal, scrollable body so footer stays visible */
.nestiko-form-modal.modal-dialog.nestiko-form-modal--modifiers {
    max-width: min(28rem, calc(100vw - 2rem));
}

.nestiko-form-modal.modal-dialog.nestiko-form-modal--modifiers .modal-content {
    display: flex;
    flex-direction: column;
    max-height: min(90vh, 42rem);
    overflow: hidden;
}

.nestiko-form-modal.modal-dialog.nestiko-form-modal--modifiers .modal-body {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    padding-bottom: 1rem;
}

.nestiko-form-modal.modal-dialog.nestiko-form-modal--modifiers .modifier-add-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.25rem 0 0.75rem;
    color: var(--text-primary, #0f172a);
}

.nestiko-form-modal.modal-dialog.nestiko-form-modal--modifiers .modifier-add-table-wrap {
    margin-bottom: 0;
}

.nestiko-form-modal.modal-dialog.nestiko-form-modal--modifiers .modifier-add-table th.modifier-row-actions,
.nestiko-form-modal.modal-dialog.nestiko-form-modal--modifiers .modifier-add-table td.modifier-row-actions {
    width: 3rem;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

/* Modifier Sets — circular Add next to table search */
.restaurant-modifiers-page .restaurant-modifiers-add-fab {
    flex-shrink: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    width: 3.35rem;
    min-height: 3.35rem;
    padding: 0.35rem 0.2rem 0.4rem;
    margin-left: 0.35rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(145deg, #6366f1 0%, #4f46e5 55%, #4338ca 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.42);
    cursor: pointer;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.05;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.restaurant-modifiers-page .restaurant-modifiers-add-fab i {
    font-size: 1.2rem;
    line-height: 1;
}

.restaurant-modifiers-page .restaurant-modifiers-add-fab:hover,
.restaurant-modifiers-page .restaurant-modifiers-add-fab:focus {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
    color: #fff;
    outline: none;
}

.restaurant-modifiers-page .restaurant-modifiers-add-fab span {
    display: block;
}

:root[data-theme='dark'] .restaurant-modifiers-page .restaurant-modifiers-add-fab {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.nestiko-form-modal .form-group {
    margin-bottom: 1rem;
}

.nestiko-form-modal .form-group label {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary, #334155);
}

.nestiko-form-modal .form-control {
    border-radius: 0.5rem;
}

.nestiko-form-modal .select2-container--default .select2-selection--single {
    border-radius: 0.5rem;
    min-height: 2.5rem;
}

:root[data-theme='dark'] .nestiko-form-modal .modal-content,
:root[data-theme='dark'] .nestiko-form-modal .modal-footer {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .nestiko-form-modal .modal-header {
    border-bottom-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .nestiko-form-modal .modal-title {
    color: #e2e8f0;
}

:root[data-theme='dark'] .nestiko-form-modal .form-group label {
    color: #cbd5e1;
}

:root[data-theme='dark'] .nestiko-form-modal.modal-dialog.nestiko-form-modal--modifiers .modifier-add-section-title {
    color: #e2e8f0;
}

/* Types of service — wide modal + location grid */
.nestiko-form-modal.modal-dialog.nestiko-form-modal--types-of-service {
    max-width: min(40rem, calc(100vw - 2rem));
}

.nestiko-form-modal.modal-dialog.nestiko-form-modal--types-of-service .modal-content {
    display: flex;
    flex-direction: column;
    max-height: min(90vh, 48rem);
    overflow: hidden;
}

.nestiko-form-modal.modal-dialog.nestiko-form-modal--types-of-service .modal-body {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    padding-bottom: 1rem;
}

.nestiko-form-modal.modal-dialog.nestiko-form-modal--types-of-service .types-of-service-locations-table-wrap {
    margin-bottom: 0;
}

.nestiko-form-modal.modal-dialog.nestiko-form-modal--types-of-service .types-of-service-locations-table thead th {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.nestiko-form-modal.modal-dialog.nestiko-form-modal--types-of-service .types-of-service-custom-fields-check {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
}

.nestiko-form-modal.modal-dialog.nestiko-form-modal--types-of-service .types-of-service-custom-fields-check label {
    margin-bottom: 0;
}

.types-of-service-page .types-of-service-add-fab {
    flex-shrink: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    width: 3.35rem;
    min-height: 3.35rem;
    padding: 0.35rem 0.2rem 0.4rem;
    margin-left: 0.35rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(145deg, #1e3a5f 0%, #172554 55%, #0f172a 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.35);
    cursor: pointer;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.05;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.types-of-service-page .types-of-service-add-fab i {
    font-size: 1.2rem;
    line-height: 1;
}

.types-of-service-page .types-of-service-add-fab:hover,
.types-of-service-page .types-of-service-add-fab:focus {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.45);
    color: #fff;
    outline: none;
}

.types-of-service-page .types-of-service-add-fab span {
    display: block;
}

:root[data-theme='dark'] .types-of-service-page .types-of-service-add-fab {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

:root[data-theme='dark'] .nestiko-form-modal.modal-dialog.nestiko-form-modal--types-of-service .types-of-service-locations-table thead th {
    border-bottom-color: var(--border-strong, #334866);
}

/* Package / subscription (tenant) */
.package-subscriptions-page .package-subscriptions-active-body {
    padding: 0 0 0.25rem;
}

.package-subscriptions-active-card {
    max-width: 22rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.75rem;
    padding: 1.1rem 1.15rem 1.15rem;
    background: var(--bg-surface, #fff);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

.package-subscriptions-active-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.package-subscriptions-active-card__title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary, #0f172a);
    line-height: 1.25;
}

.package-subscriptions-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
}

.package-subscriptions-badge--running {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.package-subscriptions-badge--upcoming {
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
    border: 1px solid rgba(99, 102, 241, 0.35);
}

.package-subscriptions-active-card__meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.75rem;
}

.package-subscriptions-remaining {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary, #0f172a);
}

.package-subscriptions-empty {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--danger-text, #b91c1c);
}

.package-subscriptions-next-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.package-subscriptions-active-card--compact {
    max-width: 20rem;
}

.package-subscriptions-active-card__footer {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
}

.package-subscriptions-waiting-text {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    color: var(--text-muted, #64748b);
}

.package-subscriptions-packages-body {
    padding-top: 0.25rem;
}

:root[data-theme='dark'] .package-subscriptions-active-card {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
    box-shadow: none;
}

:root[data-theme='dark'] .package-subscriptions-active-card__title,
:root[data-theme='dark'] .package-subscriptions-remaining {
    color: #e2e8f0;
}

:root[data-theme='dark'] .package-subscriptions-active-card__footer {
    border-top-color: var(--border-strong, #334866);
}

/* Subscription detail modal (View) */
.nestiko-form-modal.nestiko-subscription-detail-modal.modal-dialog {
    max-width: min(46rem, calc(100vw - 2rem));
}

.nestiko-subscription-detail-modal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: min(92vh, 44rem);
    overflow: hidden;
}

.nestiko-subscription-detail-modal .modal-body {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    padding: 1rem 1.15rem 1.1rem;
}

.nestiko-subscription-detail-modal .modal-footer {
    border-top: 1px solid var(--border-default, #e2e8f0);
    padding: 0.85rem 1.15rem 1rem;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.subscription-detail-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 640px) {
    .subscription-detail-panels {
        grid-template-columns: 1fr;
    }
}

.subscription-detail-panel {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.75rem;
    padding: 0.85rem 1rem 1rem;
    background: rgba(248, 250, 252, 0.85);
}

.subscription-detail-panel__label {
    margin: 0 0 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.subscription-detail-panel__body p {
    margin: 0 0 0.35rem;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-primary, #0f172a);
}

.subscription-detail-panel__body p:last-child {
    margin-bottom: 0;
}

.subscription-detail-table-wrap {
    margin-bottom: 0.75rem;
}

.nestiko-subscription-detail-modal .subscription-details {
    margin-bottom: 0;
}

.nestiko-subscription-detail-modal .subscription-details thead th {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary, #0f172a);
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.nestiko-subscription-detail-modal .subscription-details tbody td {
    font-size: 0.9rem;
    vertical-align: middle;
}

.subscription-detail-hr {
    margin: 0.75rem 0 1rem;
    border: 0;
    border-top: 1px solid var(--border-default, #e2e8f0);
}

.subscription-detail-meta {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.subscription-detail-meta__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
}

@media (max-width: 640px) {
    .subscription-detail-meta__row {
        grid-template-columns: 1fr;
    }
}

.subscription-detail-meta__item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.subscription-detail-meta__key {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
}

.subscription-detail-meta__val {
    font-size: 0.9rem;
    color: var(--text-primary, #0f172a);
    word-break: break-word;
}

:root[data-theme='dark'] .subscription-detail-panel {
    background: rgba(17, 26, 44, 0.65);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .nestiko-subscription-detail-modal .subscription-details thead th {
    border-bottom-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .subscription-detail-hr {
    border-top-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .subscription-detail-meta__val,
:root[data-theme='dark'] .subscription-detail-panel__body p {
    color: #e2e8f0;
}

/* Notification templates — horizontal + vertical tabs */
.notification-templates-page .notification-templates-main-panel {
    margin-bottom: 1rem;
}

.notification-templates-panel-body {
    padding: 0 0 0.5rem;
}

.notification-templates-h-tabs {
    margin-bottom: 0;
}

.notification-templates-h-tabs > .nav-tabs {
    margin-bottom: 0;
}

.notification-templates-h-panels {
    padding: 1rem 1rem 1.15rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-top: none;
    border-radius: 0 0 0.65rem 0.65rem;
    background: var(--bg-surface, #fff);
}

.notification-templates-category {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-start;
}

.notification-templates-vnav-col {
    flex: 0 0 13.5rem;
    max-width: 100%;
    max-height: min(70vh, 28rem);
    overflow-y: auto;
}

@media (max-width: 767px) {
    .notification-templates-vnav-col {
        flex: 1 1 100%;
    }
}

.notification-templates-vnav {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.65rem;
    padding: 0.45rem;
    background: rgba(248, 250, 252, 0.85);
}

.notification-templates-vnav > li > a {
    display: block;
    border-radius: 0.45rem;
    padding: 0.55rem 0.65rem;
    background: transparent;
    color: var(--text-secondary, #475569);
    font-weight: 600;
    font-size: 0.84rem;
    line-height: 1.25;
    border: 1px solid transparent;
}

.notification-templates-vnav > li > a:hover,
.notification-templates-vnav > li > a:focus {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary, #0f172a);
    text-decoration: none;
}

.notification-templates-vnav > li.active > a,
.notification-templates-vnav > li.active > a:hover,
.notification-templates-vnav > li.active > a:focus {
    background: rgba(99, 102, 241, 0.14);
    color: #4338ca;
    border-color: rgba(99, 102, 241, 0.35);
}

.notification-templates-vnav-content {
    flex: 1 1 18rem;
    min-width: 0;
}

.notification-templates-pane {
    padding-top: 0.15rem;
}

.notification-templates-tags-block {
    margin-bottom: 0.75rem;
}

.notification-templates-supplier-hint {
    margin-top: 1rem;
    font-size: 0.88rem;
}

:root[data-theme='dark'] .notification-templates-h-panels {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .notification-templates-vnav {
    background: rgba(17, 26, 44, 0.65);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .notification-templates-vnav > li > a {
    color: #cbd5e1;
}

:root[data-theme='dark'] .notification-templates-vnav > li.active > a {
    color: #cbd5f5;
}

/* HRM — landing + single-widget panel pages */
.hrm-landing-page .nestiko-shell-page-intro {
    margin-bottom: 0.35rem;
}

.hrm-panel-page .nestiko-shell-page-intro {
    margin-bottom: 0.75rem;
}

/* HRM — payroll full-page forms (create / edit / view group / payment / my payrolls) */
.payroll-create-page .nestiko-shell-page-intro,
.payroll-edit-page .nestiko-shell-page-intro,
.payroll-view-group-page .nestiko-shell-page-intro,
.payroll-pay-group-page .nestiko-shell-page-intro,
.payroll-my-payrolls-page .nestiko-shell-page-intro {
    margin-bottom: 1rem;
}

.nestiko-shell-page-intro__title .payroll-view-group-intro-code {
    display: inline-block;
    margin-left: 0.35rem;
    font-weight: 600;
    font-size: 0.82em;
    vertical-align: middle;
}

/* HRM — landing cards + full-width panel widgets */
.hrm-landing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

.hrm-landing-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.75rem;
    background: var(--bg-surface, #fff);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.hrm-landing-card:hover {
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
    color: inherit;
}

.hrm-landing-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    font-size: 1.15rem;
}

.hrm-landing-card__title {
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.35;
}

.hrm-panel-page .hrm-panel-widget-col .col-custom,
.hrm-panel-page .hrm-panel-shell .col-custom {
    width: 100% !important;
    max-width: 100%;
    flex: 0 0 100%;
}

:root[data-theme='dark'] .hrm-landing-card {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
}

.hrm-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
    align-items: start;
}

.hrm-overview-page .hrm-overview-item--wide {
    grid-column: 1 / -1;
}

/* HRM overview — primary / pair / rest (overview page only) */
.hrm-overview-page .hrm-overview-primary-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.15rem;
    margin-top: 1rem;
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

.hrm-overview-page .hrm-overview-stack {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    min-width: 0;
    align-self: stretch;
}

.hrm-overview-page .hrm-overview-stack > .hrm-overview-item--stack-foot {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.hrm-overview-page .hrm-overview-stack > .hrm-overview-item--stack-foot > .hrm-overview-widget {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.hrm-overview-page .hrm-overview-stack > .hrm-overview-item--stack-foot .tw-flow-root {
    flex: 1 1 auto;
}

.hrm-overview-page .hrm-overview-focus {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-self: stretch;
}

.hrm-overview-page .hrm-overview-focus .hrm-overview-item--stretch {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.hrm-overview-page .hrm-overview-focus .hrm-overview-item--stretch > .hrm-overview-widget {
    flex: 1 1 auto;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.hrm-overview-page .hrm-overview-focus .hrm-overview-item--stretch > .hrm-overview-widget > .tw-p-2 {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.hrm-overview-page .hrm-overview-focus .hrm-overview-item--stretch .tw-flow-root {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

@media (min-width: 1024px) {
    .hrm-overview-page .hrm-overview-primary-row {
        grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
    }
}

.hrm-overview-page .hrm-overview-pair-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.15rem;
    margin-top: 1.15rem;
    width: 100%;
    min-width: 0;
    align-items: stretch;
}

@media (min-width: 768px) {
    .hrm-overview-page .hrm-overview-pair-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.hrm-overview-page .hrm-overview-grid--rest {
    margin-top: 1.15rem;
    grid-template-columns: 1fr;
}

.hrm-overview-page .hrm-overview-item .col-custom,
.hrm-overview-page .hrm-overview-item .hrm-panel-widget-col {
    width: 100% !important;
    max-width: 100%;
    flex: 0 0 100%;
}

/* HRM overview — Nestiko intro + KPI strip */
.hrm-overview-page .nestiko-shell-page-intro {
    margin-bottom: 0.75rem;
}

.hrm-overview-page .nestiko-shell-kpis {
    margin-bottom: 1rem;
}

.hrm-overview-page .hrm-overview-grid {
    gap: 1.15rem;
    margin-top: 1rem;
}

.hrm-overview-page .hrm-overview-item {
    min-width: 0;
}

.hrm-overview-page .hrm-overview-item > .hrm-overview-widget {
    height: 100%;
    margin-bottom: 0 !important;
}

.hrm-overview-page .hrm-overview-pair-row .hrm-overview-item > .row {
    margin-left: 0;
    margin-right: 0;
}

.hrm-overview-page .hrm-overview-pair-row .col-custom {
    width: 100% !important;
    max-width: 100%;
    flex: 0 0 100%;
    padding-left: 0;
    padding-right: 0;
}

/* Widget cards on HRM (shared with hrm-panel single-widget pages via .hrm-overview-widget) */
.hrm-overview-widget.tw-rounded-xl {
    border-radius: 0.85rem !important;
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.08)) !important;
    border: 1px solid var(--border-default, #e2e8f0) !important;
    --tw-ring-shadow: 0 0 #0000 !important;
    --tw-ring-offset-shadow: 0 0 #0000 !important;
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.hrm-overview-widget.tw-rounded-xl:hover {
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08) !important;
    border-color: rgba(99, 102, 241, 0.22) !important;
}

:root[data-theme='dark'] .hrm-overview-widget.tw-rounded-xl {
    background: var(--bg-surface, #111a2c) !important;
    border-color: var(--border-strong, #334866) !important;
}

:root[data-theme='dark'] .hrm-overview-widget.tw-rounded-xl:hover {
    border-color: rgba(129, 140, 248, 0.35) !important;
}

.hrm-overview-widget .box-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem 0.65rem;
    margin: -0.5rem -0.75rem 0.5rem;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
    border-radius: 0.75rem 0.75rem 0 0;
}

.hrm-overview-widget .box-header > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    background: rgba(99, 102, 241, 0.12);
    color: #6366f1;
}

.hrm-overview-widget .box-title {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary, #0f172a);
}

:root[data-theme='dark'] .hrm-overview-widget .box-header {
    background: rgba(15, 23, 42, 0.55);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .hrm-overview-widget .box-title {
    color: var(--text-primary, #f1f5f9);
}

.hrm-overview-widget .tw-flow-root.tw-border-gray-200 {
    border: none !important;
}

.hrm-overview-widget .tw-py-2.sm\:tw-px-5 {
    padding-top: 0.35rem !important;
    padding-bottom: 0.65rem !important;
}

.hrm-target-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    margin: 0 0 0.85rem;
}

@media (min-width: 480px) {
    .hrm-target-summary {
        grid-template-columns: 1fr 1fr;
    }
}

.hrm-target-summary__item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.55rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.hrm-target-summary__label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #64748b);
    line-height: 1.3;
}

.hrm-target-summary__value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0d9488;
    letter-spacing: -0.02em;
}

:root[data-theme='dark'] .hrm-target-summary__item {
    background: rgba(15, 23, 42, 0.45);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .hrm-target-summary__value {
    color: #5eead4;
}

.hrm-overview-table {
    font-size: 0.84rem;
}

.hrm-overview-table > tbody > tr > td,
.hrm-overview-table > tbody > tr > th,
.hrm-overview-table > thead > tr > th {
    padding: 0.45rem 0.5rem;
    vertical-align: middle;
    border-color: var(--border-default, #e2e8f0) !important;
}

.hrm-overview-table > thead > tr > th {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #64748b);
    background: var(--bg-surface-soft, #f8fafc);
}

.hrm-tier-table > thead > tr > th {
    border-bottom-width: 1px !important;
}

.hrm-overview-table th.hrm-subhead {
    background: var(--bg-surface-soft, #f8fafc) !important;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #64748b);
    border: none !important;
}

.hrm-overview-table-spacer td {
    padding: 0.35rem 0.5rem !important;
    border: none !important;
    height: 0.25rem;
}

.hrm-overview-empty {
    color: var(--text-muted, #94a3b8) !important;
    font-size: 0.84rem;
    padding: 0.75rem 0.5rem !important;
}

:root[data-theme='dark'] .hrm-overview-table > thead > tr > th,
:root[data-theme='dark'] .hrm-overview-table th.hrm-subhead {
    background: rgba(15, 23, 42, 0.65) !important;
}

.hrm-panel-page .hrm-panel-shell {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

/* Essentials — HRM list pages (leave, holiday, payroll): filters toolbar above panel */
.essentials-hrm-list-page .users-toolbar-row {
    margin-bottom: 0.75rem;
}

.essentials-filters-pop-panel {
    min-width: min(46rem, calc(100vw - 2rem));
    max-width: min(46rem, calc(100vw - 2rem));
}

.essentials-filter-hint {
    margin: 0 0 0.75rem;
    font-size: 0.76rem;
    color: var(--text-muted, #64748b);
}

.essentials-hrm-list-page .dataTables_wrapper .dt-buttons:empty {
    display: none !important;
}

/* HRM — Departments & Designations (shared taxonomy index) */
.hrm-taxonomy-page .nestiko-shell-page-intro {
    margin-bottom: 0.75rem;
}

.hrm-taxonomy-page .hrm-taxonomy-kpis {
    margin-bottom: 1rem;
}

/* Taxonomy (catalog / non-HRM): intro + KPI strip */
.taxonomy-page--catalog .nestiko-shell-page-intro {
    margin-bottom: 0.75rem;
}

.taxonomy-page--catalog .taxonomy-catalog-kpis {
    margin-bottom: 1rem;
}

.hrm-taxonomy-page .hrm-taxonomy-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem 0.75rem;
}

.hrm-taxonomy-page .hrm-taxonomy-panel-head .users-toolbar-actions {
    margin-left: auto;
}

/* Four stat cards: explicit columns (roles-page can otherwise win at 1280px) */
.hrm-taxonomy-page .hrm-taxonomy-stats {
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .hrm-taxonomy-page .hrm-taxonomy-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .hrm-taxonomy-page .hrm-taxonomy-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Essentials — overview (/essentials/dashboard) */
.essentials-overview-page .nestiko-shell-page-intro {
    margin-bottom: 0.75rem;
}

.essentials-overview-page .essentials-overview-kpis {
    flex-wrap: wrap;
    align-items: stretch;
}

.essentials-overview-page .essentials-overview-kpis--primary {
    margin-bottom: 0.65rem;
}

.essentials-overview-page .essentials-overview-kpis--primary .nestiko-shell-kpi {
    flex: 1 1 12rem;
    min-width: min(12rem, 100%);
}

.essentials-overview-page .essentials-overview-kpis--secondary {
    margin-bottom: 0.35rem;
}

.essentials-overview-page .essentials-overview-kpis--secondary-single {
    max-width: 28rem;
}

.essentials-overview-page .essentials-overview-kpi-link {
    margin-top: 0.5rem;
    align-self: flex-start;
}

/* Essentials — To Do list */
.essentials-todo-page .essentials-todo-page-heading {
    margin-bottom: 0.85rem;
}

.essentials-todo-page .essentials-todo-page-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    color: var(--text-muted, #64748b);
    max-width: 44rem;
    line-height: 1.45;
}

/* To Do: filters live in panel head next to Add — panel must not clip the popover */
.essentials-todo-page .essentials-todo-panel.users-panel {
    overflow: visible;
}

.essentials-todo-page .essentials-todo-panel-head {
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    position: relative;
    z-index: 6;
}

.essentials-todo-page .essentials-todo-panel-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
}

.essentials-todo-page .essentials-todo-panel-head .users-toolbar-actions {
    margin-left: auto;
}

.essentials-todo-page .essentials-todo-table-wrap {
    padding: 0 0 0.75rem;
}

.essentials-todo-page .essentials-dt-lf--todo-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.essentials-todo-page .essentials-dt-lf--todo-list .dataTables_length,
.essentials-todo-page .essentials-dt-lf--todo-list .dataTables_filter {
    margin: 0;
    float: none;
}

.essentials-todo-page .essentials-dt-lf--todo-list .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.essentials-todo-page .essentials-dt-lf--todo-list .dataTables_filter input {
    min-width: 10rem;
    border-radius: 0.45rem;
    border: 1px solid var(--border-default, #e2e8f0);
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
}

.essentials-todo-page .dataTables_wrapper .dataTables_info {
    padding: 0.5rem 0.75rem 0;
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}

.essentials-todo-page .dataTables_wrapper .dataTables_paginate {
    padding: 0.35rem 0.75rem 0.65rem;
}

.essentials-todo-page .todo-col-action {
    width: 7.5rem;
    min-width: 6.5rem;
    text-align: right;
}

.essentials-todo-page .essentials-todo-data-table td:last-child {
    text-align: right;
    white-space: nowrap;
}

.essentials-todo-page .todo-actions-dropdown .dropdown-menu > li > a {
    font-size: 0.84rem;
    padding: 0.45rem 0.85rem;
}

.essentials-todo-page .todo-actions-dropdown .dropdown-menu > li > a i {
    margin-right: 0.35rem;
    opacity: 0.85;
}

/* Essentials — Add / Edit To Do modal (task_modal) */
.essentials-todo-modal .modal-content {
    border-radius: 0.75rem;
    border: 1px solid var(--border-default, #e2e8f0);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
}

.essentials-todo-modal .modal-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.essentials-todo-modal .modal-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.essentials-todo-modal .modal-body {
    padding: 1rem 1rem 0.5rem;
}

.essentials-todo-modal .modal-body .form-group {
    margin-bottom: 0.85rem;
}

.essentials-todo-modal .modal-body label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.essentials-todo-modal .modal-body .form-control {
    border-radius: 0.45rem;
    font-size: 0.86rem;
}

.essentials-todo-modal .dropzone {
    border: 2px dashed var(--border-default, #cbd5e1) !important;
    border-radius: 0.55rem !important;
    background: var(--bg-surface-soft, #f8fafc) !important;
    min-height: 5.5rem;
}

.essentials-todo-modal .dropzone .dz-message {
    margin: 1rem 0;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

.essentials-todo-modal-footer.modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-end;
    align-items: center;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.essentials-todo-modal-footer .users-btn-primary.ladda-button {
    min-width: 5.5rem;
}

:root[data-theme='dark'] .essentials-todo-modal .modal-content {
    border-color: var(--border-strong, #334866);
    background: var(--bg-surface, #0f172a);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45);
}

:root[data-theme='dark'] .essentials-todo-modal .modal-header {
    background: rgba(15, 23, 42, 0.85);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .essentials-todo-modal .modal-title {
    color: #f1f5f9;
}

:root[data-theme='dark'] .essentials-todo-modal .modal-body label {
    color: #cbd5e1;
}

:root[data-theme='dark'] .essentials-todo-modal .dropzone {
    border-color: var(--border-strong, #334866) !important;
    background: rgba(15, 23, 42, 0.5) !important;
}

:root[data-theme='dark'] .essentials-todo-modal-footer.modal-footer {
    background: rgba(15, 23, 42, 0.65);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .essentials-todo-page .essentials-dt-lf--todo-list {
    background: rgba(15, 23, 42, 0.45);
    border-color: var(--border-strong, #334866);
}

/* Activity log partial — optional empty hint (e.g. Essentials task detail) */
.nestiko-activities-empty-state {
    padding: 0.35rem 0 0.75rem;
}

.nestiko-activities-empty-hint {
    margin: 0.45rem auto 0;
    max-width: 28rem;
    text-align: center;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--text-muted, #64748b);
    font-weight: 400;
}

:root[data-theme='dark'] .nestiko-activities-empty-hint {
    color: #94a3b8;
}

/* Essentials — To Do task detail (single task / comments / documents / activities) */
.essentials-todo-show-page .essentials-todo-show-heading {
    margin-bottom: 0.85rem;
}

.essentials-todo-show-page .essentials-todo-show-id {
    font-weight: 600;
    color: var(--text-muted, #64748b);
    margin-right: 0.35rem;
}

.essentials-todo-show-page .essentials-todo-detail-summary {
    border-top: 3px solid var(--link-primary, #4338ca);
}

.essentials-todo-show-page .essentials-todo-detail-summary-body {
    padding: 0.85rem 1rem 1rem;
}

.essentials-todo-show-page .essentials-todo-detail-line {
    margin: 0 0 0.5rem;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-primary, #0f172a);
}

.essentials-todo-show-page .essentials-todo-detail-label {
    display: inline-block;
    min-width: 8rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    margin-right: 0.35rem;
}

.essentials-todo-show-page .essentials-todo-detail-description {
    margin-top: 0.65rem;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--border-default, #e2e8f0);
}

.essentials-todo-show-page .essentials-todo-detail-description-html {
    font-size: 0.88rem;
    line-height: 1.5;
}

.essentials-todo-show-page .essentials-todo-detail-tabs-wrap {
    margin-top: 0.85rem;
}

.essentials-todo-show-page .essentials-todo-nav-tabs {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.75rem;
    background: var(--bg-surface, #fff);
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.08));
    margin-bottom: 0;
}

.essentials-todo-show-page .essentials-todo-nav-tabs > .nav-tabs {
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.essentials-todo-show-page .essentials-todo-nav-tabs > .nav-tabs > li > a {
    border-radius: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.essentials-todo-show-page .essentials-todo-nav-tabs > .nav-tabs > li.active > a {
    color: var(--link-primary, #4338ca);
    background: var(--bg-surface, #fff);
    border-bottom-color: transparent;
}

.essentials-todo-show-page .essentials-todo-tab-content {
    padding: 0.85rem 1rem 1rem;
}

.essentials-todo-show-page .essentials-todo-tab-hr {
    margin: 1rem 0;
    border-color: var(--border-default, #e2e8f0);
}

.essentials-todo-show-page .essentials-todo-docs-table {
    margin-bottom: 0;
}

.essentials-todo-show-page .essentials-todo-docs-upload {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.65rem;
    background: var(--bg-surface-soft, #f8fafc);
    padding: 1rem 1rem 0.85rem;
    margin-bottom: 0.25rem;
}

.essentials-todo-show-page .essentials-todo-form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    margin-bottom: 0.4rem;
}

.essentials-todo-show-page .essentials-todo-file-input {
    padding: 0.45rem 0.55rem;
    border-radius: 0.45rem;
    font-size: 0.82rem;
}

.essentials-todo-show-page .essentials-todo-file-hint {
    margin: 0.35rem 0 0;
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
}

.essentials-todo-show-page .essentials-todo-textarea {
    border-radius: 0.45rem;
    font-size: 0.86rem;
}

.essentials-todo-show-page .essentials-todo-docs-upload-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.35rem;
    margin-bottom: 0.15rem;
}

.essentials-todo-show-page .essentials-todo-docs-table-title {
    margin: 0 0 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.essentials-todo-show-page .essentials-todo-docs-actions {
    white-space: nowrap;
}

.essentials-todo-show-page .essentials-todo-docs-actions .users-btn + .users-btn {
    margin-left: 0.35rem;
}

.essentials-todo-show-page .essentials-todo-empty-cell {
    text-align: center;
    padding: 1.25rem 0.75rem !important;
    border: none !important;
}

.essentials-todo-show-page .essentials-todo-empty {
    margin: 0;
    font-size: 0.86rem;
    color: var(--text-muted, #64748b);
    text-align: center;
}

.essentials-todo-show-page .essentials-todo-chat-messages .essentials-todo-empty {
    padding: 1rem 0;
}

:root[data-theme='dark'] .essentials-todo-show-page .essentials-todo-docs-upload {
    border-color: var(--border-strong, #334866);
    background: rgba(15, 23, 42, 0.5);
}

:root[data-theme='dark'] .essentials-todo-show-page .essentials-todo-nav-tabs {
    border-color: var(--border-strong, #334866);
    background: var(--bg-surface, #0f172a);
}

:root[data-theme='dark'] .essentials-todo-show-page .essentials-todo-nav-tabs > .nav-tabs {
    background: rgba(15, 23, 42, 0.65);
    border-color: var(--border-strong, #334866);
}

/* Essentials — Documents + Memos lists */
.essentials-document-page .essentials-document-page-heading,
.essentials-memos-page .essentials-memos-page-heading {
    margin-bottom: 0.85rem;
}

.essentials-document-page .essentials-document-page-subtitle,
.essentials-memos-page .essentials-memos-page-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    color: var(--text-muted, #64748b);
    max-width: 44rem;
    line-height: 1.45;
}

/* Documents / Memos: filters in panel head — do not clip the filter popover */
.essentials-document-page .essentials-document-panel.users-panel,
.essentials-memos-page .essentials-memos-panel.users-panel {
    overflow: visible;
}

.essentials-document-page .essentials-document-panel-head,
.essentials-memos-page .essentials-memos-panel-head {
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    position: relative;
    z-index: 6;
}

.essentials-document-page .essentials-document-panel-toolbar,
.essentials-memos-page .essentials-memos-panel-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
}

.essentials-document-page .essentials-document-panel-head .users-toolbar-actions,
.essentials-memos-page .essentials-memos-panel-head .users-toolbar-actions {
    margin-left: auto;
}

.essentials-document-page .essentials-document-upload-shell,
.essentials-memos-page .essentials-document-upload-shell {
    padding: 0 0.75rem;
}

.essentials-document-page .essentials-document-upload-form,
.essentials-memos-page .essentials-document-upload-form {
    margin: 0 0 1rem;
    padding: 1rem;
    border-radius: 0.65rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.essentials-document-page .essentials-document-upload-actions .users-btn,
.essentials-memos-page .essentials-document-upload-actions .users-btn {
    margin-right: 0.5rem;
}

.essentials-document-page .essentials-document-table-wrap,
.essentials-memos-page .essentials-memos-table-wrap {
    padding: 0 0 0.75rem;
}

.essentials-document-page .essentials-dt-lf--document-list,
.essentials-memos-page .essentials-dt-lf--memos-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.essentials-document-page .essentials-dt-lf--document-list .dataTables_length,
.essentials-document-page .essentials-dt-lf--document-list .dataTables_filter,
.essentials-memos-page .essentials-dt-lf--memos-list .dataTables_length,
.essentials-memos-page .essentials-dt-lf--memos-list .dataTables_filter {
    margin: 0;
    float: none;
}

.essentials-document-page .essentials-dt-lf--document-list .dataTables_filter label,
.essentials-memos-page .essentials-dt-lf--memos-list .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.essentials-document-page .essentials-dt-lf--document-list .dataTables_filter input,
.essentials-memos-page .essentials-dt-lf--memos-list .dataTables_filter input {
    min-width: 10rem;
    border-radius: 0.45rem;
    border: 1px solid var(--border-default, #e2e8f0);
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
}

.essentials-document-page .dataTables_wrapper .dataTables_info,
.essentials-memos-page .dataTables_wrapper .dataTables_info {
    padding: 0.5rem 0.75rem 0;
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}

.essentials-document-page .dataTables_wrapper .dataTables_paginate,
.essentials-memos-page .dataTables_wrapper .dataTables_paginate {
    padding: 0.35rem 0.75rem 0.65rem;
}

/* Documents / Memos list — NAME column on one line (no stacked blocks).
   Override global `.users-table td:first-child` (2.4rem + center) meant for checkbox columns. */
.essentials-document-page .users-table.documents th:first-child,
.essentials-document-page .users-table.documents td:first-child,
.essentials-memos-page .users-table.documents th:first-child,
.essentials-memos-page .users-table.documents td:first-child {
    width: auto;
    min-width: 14rem;
    max-width: 36rem;
    text-align: left;
    white-space: nowrap !important;
    vertical-align: middle;
    overflow: hidden;
}

/* Description column: single line + ellipsis (override generic table wrapping) */
.essentials-document-page .users-table.documents td:nth-child(2),
.essentials-document-page .users-table.documents th:nth-child(2),
.essentials-memos-page .users-table.documents td:nth-child(2),
.essentials-memos-page .users-table.documents th:nth-child(2) {
    max-width: 28rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.essentials-document-page .essentials-doc-name-cell,
.essentials-memos-page .essentials-doc-name-cell {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.4rem;
    max-width: 100%;
    min-width: 0;
}

.essentials-document-page .essentials-doc-name-title,
.essentials-memos-page .essentials-doc-name-title {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.essentials-document-page .essentials-doc-name-size,
.essentials-document-page .essentials-doc-name-shared,
.essentials-memos-page .essentials-doc-name-size,
.essentials-memos-page .essentials-doc-name-shared {
    flex-shrink: 0;
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
}

.essentials-document-page .essentials-doc-name-link,
.essentials-memos-page .essentials-doc-name-link {
    flex-shrink: 0;
}

.essentials-document-page .documents-col-action,
.essentials-memos-page .documents-col-action {
    width: 12rem;
    min-width: 10rem;
    text-align: right;
}

.essentials-document-page .documents td:last-child,
.essentials-memos-page .documents td:last-child {
    text-align: right;
    white-space: normal;
}

.essentials-document-page .documents td:last-child .users-btn,
.essentials-memos-page .documents td:last-child .users-btn {
    display: inline-flex;
    margin: 0.15rem 0.15rem 0.15rem 0;
    vertical-align: middle;
}

.essentials-document-page .documents td:last-child .delete_doc,
.essentials-memos-page .documents td:last-child .delete_doc {
    color: #b91c1c;
}

:root[data-theme='dark'] .essentials-document-page .documents td:last-child .delete_doc,
:root[data-theme='dark'] .essentials-memos-page .documents td:last-child .delete_doc {
    color: #fca5a5;
}

:root[data-theme='dark'] .essentials-document-page .essentials-dt-lf--document-list,
:root[data-theme='dark'] .essentials-memos-page .essentials-dt-lf--memos-list {
    background: rgba(15, 23, 42, 0.45);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .essentials-document-page .essentials-document-upload-form,
:root[data-theme='dark'] .essentials-memos-page .essentials-document-upload-form {
    background: rgba(15, 23, 42, 0.35);
    border-color: var(--border-strong, #334866);
}

/* Essentials — Reminders (FullCalendar) — fresh calendar shell */
.essentials-reminder-page .essentials-reminder-page-heading {
    margin-bottom: 0.85rem;
}

.essentials-reminder-page .essentials-reminder-page-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    color: var(--text-muted, #64748b);
    max-width: 44rem;
    line-height: 1.45;
}

.essentials-reminder-page .essentials-reminder-panel-head {
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}

.essentials-reminder-page .essentials-reminder-panel-head .users-toolbar-actions {
    margin-left: auto;
}

.essentials-reminder-page .essentials-reminder-calendar-wrap {
    padding: 0.5rem 0.75rem 1.15rem;
    min-width: 0;
}

/* Soft mesh frame around the grid */
.essentials-reminder-page .essentials-reminder-calendar-shell {
    position: relative;
    border-radius: 1.15rem;
    padding: 1rem 1rem 0.85rem;
    background:
        radial-gradient(120% 80% at 0% 0%, rgba(14, 165, 233, 0.11) 0%, transparent 55%),
        radial-gradient(90% 70% at 100% 10%, rgba(244, 114, 182, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, rgba(248, 250, 252, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
    border: 1px solid rgba(148, 163, 184, 0.38);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.05),
        0 18px 42px rgba(15, 23, 42, 0.06);
}

.essentials-reminder-page .essentials-reminder-calendar-shell::before {
    content: '';
    position: absolute;
    inset: 0.55rem;
    border-radius: 0.85rem;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.65);
    opacity: 0.9;
}

.essentials-reminder-page .essentials-reminder-calendar {
    position: relative;
    z-index: 1;
    min-height: 32rem;
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--bg-surface, #fff);
    border: 1px solid rgba(226, 232, 240, 0.95);
}

/* Toolbar: pill nav + airy title */
.essentials-reminder-page .fc-toolbar {
    margin-bottom: 0 !important;
    padding: 0.65rem 0.75rem 0.85rem;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, rgba(255, 255, 255, 0.5) 100%);
}

.essentials-reminder-page .fc-toolbar .fc-left,
.essentials-reminder-page .fc-toolbar .fc-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.essentials-reminder-page .fc-toolbar .fc-center {
    flex: 1 1 auto;
    min-width: 12rem;
    text-align: center;
}

.essentials-reminder-page .fc-toolbar .fc-center h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary, #0f172a);
}

.essentials-reminder-page .fc-toolbar .fc-button {
    border-radius: 999px !important;
    border: 1px solid rgba(148, 163, 184, 0.45) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: var(--text-secondary, #475569) !important;
    font-size: 0.76rem !important;
    font-weight: 600 !important;
    padding: 0.35rem 0.75rem !important;
    height: auto !important;
    text-shadow: none !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.essentials-reminder-page .fc-toolbar .fc-button:hover {
    background: rgba(241, 245, 249, 0.95) !important;
    border-color: rgba(100, 116, 139, 0.45) !important;
    color: var(--text-primary, #0f172a) !important;
}

.essentials-reminder-page .fc-toolbar .fc-state-active,
.essentials-reminder-page .fc-toolbar .fc-state-down {
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%) !important;
    border-color: transparent !important;
    color: #f8fafc !important;
}

.essentials-reminder-page .fc-toolbar .fc-corner-left .fc-button,
.essentials-reminder-page .fc-toolbar .fc-corner-right .fc-button {
    border-radius: 999px !important;
}

.essentials-reminder-page .fc-toolbar .fc-button-group .fc-button + .fc-button {
    margin-left: 0.25rem;
}

/* Weekday strip */
.essentials-reminder-page .fc-head-container,
.essentials-reminder-page .fc-widget-header {
    border-color: rgba(226, 232, 240, 0.95) !important;
}

.essentials-reminder-page .fc-day-header,
.essentials-reminder-page .fc-widget-header {
    padding: 0.45rem 0.25rem !important;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b) !important;
    background: rgba(248, 250, 252, 0.85) !important;
}

/* Day cells */
.essentials-reminder-page .fc-day-grid .fc-row {
    border-color: rgba(226, 232, 240, 0.85) !important;
}

.essentials-reminder-page .fc-day-top {
    padding: 0.35rem 0.45rem 0.15rem !important;
}

.essentials-reminder-page .fc-day-number {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    opacity: 0.95;
}

.essentials-reminder-page .fc-day:hover .fc-day-number {
    color: var(--text-primary, #0f172a);
}

.essentials-reminder-page .fc-other-month .fc-day-number {
    opacity: 0.38;
}

/* Today: mint ring instead of flat yellow */
.essentials-reminder-page .fc-unthemed .fc-today {
    background: linear-gradient(180deg, rgba(45, 212, 191, 0.14) 0%, rgba(45, 212, 191, 0.04) 100%) !important;
}

.essentials-reminder-page .fc-unthemed td.fc-today {
    border-color: rgba(13, 148, 136, 0.35) !important;
    box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.2);
}

/* Events: soft gradient chips */
.essentials-reminder-page .fc-event {
    margin: 0.12rem 0.15rem 0 !important;
    border-radius: 0.45rem !important;
    border: none !important;
    padding: 0.18rem 0.4rem !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    background: linear-gradient(135deg, #ea580c 0%, #f97316 55%, #fb923c 100%) !important;
    color: #fffefc !important;
    box-shadow: 0 1px 2px rgba(234, 88, 12, 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.essentials-reminder-page .fc-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(234, 88, 12, 0.35);
}

.essentials-reminder-page .fc-event .fc-content {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.essentials-reminder-page .fc-more-cell {
    padding-top: 0.15rem !important;
}

.essentials-reminder-page .fc-more {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    color: var(--text-muted, #64748b) !important;
}

:root[data-theme='dark'] .essentials-reminder-page .essentials-reminder-calendar-shell {
    background:
        radial-gradient(120% 80% at 0% 0%, rgba(14, 165, 233, 0.12) 0%, transparent 55%),
        radial-gradient(90% 70% at 100% 10%, rgba(244, 114, 182, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.88) 100%);
    border-color: var(--border-strong, #334866);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

:root[data-theme='dark'] .essentials-reminder-page .essentials-reminder-calendar-shell::before {
    border-color: rgba(51, 65, 102, 0.65);
}

:root[data-theme='dark'] .essentials-reminder-page .essentials-reminder-calendar {
    background: var(--bg-surface, #0f172a);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .essentials-reminder-page .fc-toolbar {
    border-color: var(--border-strong, #334866);
    background: rgba(15, 23, 42, 0.65);
}

:root[data-theme='dark'] .essentials-reminder-page .fc-toolbar .fc-center h2 {
    color: #f1f5f9;
}

:root[data-theme='dark'] .essentials-reminder-page .fc-toolbar .fc-button {
    background: rgba(30, 41, 59, 0.9) !important;
    border-color: var(--border-strong, #334866) !important;
    color: #e2e8f0 !important;
}

:root[data-theme='dark'] .essentials-reminder-page .fc-toolbar .fc-state-active,
:root[data-theme='dark'] .essentials-reminder-page .fc-toolbar .fc-state-down {
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%) !important;
    color: #0f172a !important;
}

:root[data-theme='dark'] .essentials-reminder-page .fc-day-header,
:root[data-theme='dark'] .essentials-reminder-page .fc-widget-header {
    background: rgba(15, 23, 42, 0.85) !important;
    color: #94a3b8 !important;
    border-color: var(--border-strong, #334866) !important;
}

:root[data-theme='dark'] .essentials-reminder-page .fc-unthemed td,
:root[data-theme='dark'] .essentials-reminder-page .fc-unthemed th {
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .essentials-reminder-page .fc-unthemed .fc-divider,
:root[data-theme='dark'] .essentials-reminder-page .fc-unthemed .fc-list-heading td {
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .essentials-reminder-page .fc-unthemed .fc-today {
    background: linear-gradient(180deg, rgba(45, 212, 191, 0.18) 0%, rgba(45, 212, 191, 0.06) 100%) !important;
}

:root[data-theme='dark'] .essentials-reminder-page .fc-day-number {
    color: #cbd5e1;
}

:root[data-theme='dark'] .essentials-reminder-page .fc-event {
    background: linear-gradient(135deg, #c2410c 0%, #ea580c 100%) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Add reminder modal — form fields */
.essentials-reminder-create-modal .essentials-reminder-form-body {
    padding: 1rem 1rem 0.5rem;
}

.essentials-reminder-create-modal .essentials-reminder-form-body .form-group {
    margin-bottom: 0.9rem;
}

.essentials-reminder-create-modal .essentials-reminder-form-body label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    margin-bottom: 0.35rem;
}

.essentials-reminder-create-modal .essentials-reminder-form-body .form-control {
    border-radius: 0.45rem;
    font-size: 0.86rem;
}

.essentials-reminder-create-modal .essentials-reminder-input-group .input-group-addon {
    min-width: 2.5rem;
    text-align: center;
    background: var(--bg-surface-soft, #f1f5f9);
    border-color: var(--border-default, #e2e8f0);
    color: var(--text-muted, #64748b);
    border-radius: 0.45rem 0 0 0.45rem;
}

.essentials-reminder-create-modal .essentials-reminder-input-group .form-control {
    border-radius: 0 0.45rem 0.45rem 0;
}

:root[data-theme='dark'] .essentials-reminder-create-modal .essentials-reminder-input-group .input-group-addon {
    background: rgba(30, 41, 59, 0.85);
    border-color: var(--border-strong, #334866);
    color: #94a3b8;
}

/* Reminder details modal (view / edit repeat) */
.essentials-reminder-detail-modal .modal-body {
    padding: 1rem 1rem 0.75rem;
}

.essentials-reminder-detail-summary {
    padding: 0.75rem 0.85rem;
    margin-bottom: 1rem;
    border-radius: 0.65rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95) 0%, rgba(255, 255, 255, 0.6) 100%);
}

.essentials-reminder-detail-name {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary, #0f172a);
}

.essentials-reminder-detail-dl {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem 1rem;
}

@media (min-width: 640px) {
    .essentials-reminder-detail-dl {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.essentials-reminder-detail-dl-row {
    margin: 0;
}

.essentials-reminder-detail-dl dt {
    margin: 0 0 0.15rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.essentials-reminder-detail-dl dd {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.essentials-reminder-detail-edit {
    padding-top: 0.15rem;
}

.essentials-reminder-detail-hint {
    margin: 0 0 0.65rem;
    font-size: 0.76rem;
    color: var(--text-muted, #64748b);
    line-height: 1.45;
}

.essentials-reminder-detail-edit .form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.essentials-reminder-detail-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.essentials-reminder-detail-modal .essentials-reminder-delete-btn {
    color: var(--danger-text, #b91c1c);
    border-color: rgba(185, 28, 28, 0.35);
}

.essentials-reminder-detail-modal .essentials-reminder-delete-btn:hover {
    background: rgba(254, 226, 226, 0.55);
    border-color: rgba(185, 28, 28, 0.5);
    color: #991b1b;
}

:root[data-theme='dark'] .essentials-reminder-detail-summary {
    border-color: var(--border-strong, #334866);
    background: rgba(15, 23, 42, 0.55);
}

:root[data-theme='dark'] .essentials-reminder-detail-name {
    color: #f1f5f9;
}

:root[data-theme='dark'] .essentials-reminder-detail-dl dd {
    color: #e2e8f0;
}

:root[data-theme='dark'] .essentials-reminder-detail-modal .essentials-reminder-delete-btn:hover {
    background: rgba(127, 29, 29, 0.35);
}

/* Essentials — Messages (team chat) */
.essentials-messages-page .essentials-messages-page-heading {
    margin-bottom: 0.85rem;
}

.essentials-messages-page .essentials-messages-page-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    color: var(--text-muted, #64748b);
    max-width: 44rem;
    line-height: 1.45;
}

.essentials-messages-page .essentials-messages-panel {
    padding: 0;
    overflow: hidden;
}

.essentials-messages-page .essentials-messages-panel-head {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.essentials-messages-page .essentials-messages-chat {
    height: 70vh;
    min-height: 18rem;
    max-height: 52rem;
    overflow-y: auto;
    padding: 0.65rem 0.75rem 1rem;
    background: var(--bg-surface-soft, #f8fafc);
}

.essentials-messages-page .essentials-message-post {
    margin: 0 0 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface, #fff);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.05),
        0 2px 8px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.essentials-messages-page .essentials-message-post:hover {
    border-color: rgba(148, 163, 184, 0.45);
    box-shadow:
        0 2px 4px rgba(15, 23, 42, 0.06),
        0 8px 20px rgba(15, 23, 42, 0.06);
}

.essentials-messages-page .essentials-message-post-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.5rem;
}

.essentials-messages-page .essentials-message-post-main {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.essentials-messages-page .essentials-message-sender-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

.essentials-messages-page .essentials-message-when {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.76rem;
    color: var(--text-muted, #64748b);
}

.essentials-messages-page .essentials-message-when i {
    font-size: 0.72rem;
    opacity: 0.85;
}

.essentials-messages-page .essentials-message-body {
    margin: 0;
    padding-top: 0.15rem;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
    word-break: break-word;
}

/* Delete: icon in a soft circular control (replaces plain ×) */
.essentials-messages-page .essentials-message-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    margin: 0;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(248, 250, 252, 0.95);
    color: var(--text-muted, #64748b);
    font-size: 0.82rem;
    line-height: 1;
    text-decoration: none !important;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
}

.essentials-messages-page .essentials-message-delete:hover,
.essentials-messages-page .essentials-message-delete:focus {
    outline: none;
    background: rgba(254, 226, 226, 0.65);
    border-color: rgba(185, 28, 28, 0.35);
    color: var(--danger-text, #b91c1c);
    box-shadow: 0 1px 2px rgba(185, 28, 28, 0.12);
}

.essentials-messages-page .essentials-messages-composer {
    border-top: 1px solid var(--border-default, #e2e8f0);
    padding: 0.75rem 1rem 1rem;
    background: var(--bg-surface, #fff);
}

.essentials-messages-page .essentials-messages-composer-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem 0.65rem;
}

.essentials-messages-page .essentials-messages-composer-field--message {
    flex: 1 1 12rem;
    min-width: 0;
}

.essentials-messages-page .essentials-messages-composer-field--location {
    flex: 0 1 14rem;
    min-width: 10rem;
}

.essentials-messages-page .essentials-messages-composer-field--location .form-control {
    width: 100%;
}

.essentials-messages-page .essentials-messages-composer-field--send {
    flex: 0 0 auto;
}

.essentials-messages-page .essentials-messages-composer .form-control {
    border-radius: 0.5rem;
}

:root[data-theme='dark'] .essentials-messages-page .essentials-messages-chat {
    background: rgba(15, 23, 42, 0.35);
}

:root[data-theme='dark'] .essentials-messages-page .essentials-message-post {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .essentials-messages-page .essentials-message-body {
    color: #cbd5e1;
}

:root[data-theme='dark'] .essentials-messages-page .essentials-message-delete {
    background: rgba(30, 41, 59, 0.85);
    border-color: var(--border-strong, #334866);
    color: #94a3b8;
}

:root[data-theme='dark'] .essentials-messages-page .essentials-message-delete:hover,
:root[data-theme='dark'] .essentials-messages-page .essentials-message-delete:focus {
    background: rgba(127, 29, 29, 0.45);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

:root[data-theme='dark'] .essentials-messages-page .essentials-messages-composer {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
}

/* Essentials — Knowledge base index (nested cards) */
.essentials-knowledge-base-page .essentials-knowledge-base-heading {
    margin-bottom: 0.85rem;
}

.essentials-knowledge-base-page .essentials-knowledge-base-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    color: var(--text-muted, #64748b);
    max-width: 46rem;
    line-height: 1.45;
}

.essentials-knowledge-base-page .essentials-knowledge-base-panel-head {
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}

.essentials-knowledge-base-page .essentials-knowledge-base-panel-head .users-toolbar-actions {
    margin-left: auto;
}

.essentials-knowledge-base-page .essentials-kb-grid-body {
    padding: 0.65rem 0.75rem 1.15rem;
}

/* Root KB card */
.essentials-knowledge-base-page .essentials-kb-root-card {
    display: flex;
    flex-direction: column;
    max-height: 34rem;
    margin-bottom: 1.15rem;
    border-radius: 0.85rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface, #fff);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.05),
        0 10px 28px rgba(15, 23, 42, 0.07);
    overflow: hidden;
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.essentials-knowledge-base-page .essentials-kb-root-card:hover {
    border-color: rgba(148, 163, 184, 0.55);
    box-shadow:
        0 2px 6px rgba(15, 23, 42, 0.06),
        0 16px 40px rgba(15, 23, 42, 0.09);
}

.essentials-knowledge-base-page .essentials-kb-root-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(255, 255, 255, 0.92) 100%);
}

.essentials-knowledge-base-page .essentials-kb-root-card__title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary, #0f172a);
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.essentials-knowledge-base-page .essentials-kb-root-card__body {
    padding: 0.85rem 1rem 1rem;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.essentials-knowledge-base-page .essentials-kb-card-description {
    font-size: 0.86rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
    margin-bottom: 0.75rem;
}

.essentials-knowledge-base-page .essentials-kb-card-description.kb-prose {
    max-height: 9rem;
    overflow: auto;
    padding-right: 0.25rem;
}

.essentials-knowledge-base-page .kb-prose p:last-child {
    margin-bottom: 0;
}

.essentials-knowledge-base-page .essentials-kb-card-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    flex-shrink: 0;
}

.essentials-knowledge-base-page .essentials-kb-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.45rem;
    font-size: 0.82rem;
    color: var(--text-secondary, #475569);
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.essentials-knowledge-base-page .essentials-kb-tool:hover {
    background: var(--bg-surface-soft, #f1f5f9);
    color: var(--text-primary, #0f172a);
    border-color: rgba(148, 163, 184, 0.35);
}

.essentials-knowledge-base-page .essentials-kb-tool--danger {
    color: #b91c1c;
}

.essentials-knowledge-base-page .essentials-kb-tool--danger:hover {
    background: rgba(254, 226, 226, 0.55);
    border-color: rgba(185, 28, 28, 0.25);
    color: #991b1b;
}

.essentials-knowledge-base-page .essentials-kb-tool--success {
    color: #047857;
}

.essentials-knowledge-base-page .essentials-kb-tool--success:hover {
    background: rgba(209, 250, 229, 0.65);
    border-color: rgba(5, 150, 105, 0.25);
    color: #065f46;
}

/* Nested stack: sections inside a base */
.essentials-knowledge-base-page .essentials-kb-nest {
    margin-top: 0.15rem;
    padding-top: 0.65rem;
    border-top: 1px dashed rgba(148, 163, 184, 0.45);
}

.essentials-knowledge-base-page .essentials-kb-nest-label {
    margin: 0 0 0.75rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.essentials-knowledge-base-page .essentials-kb-section-card {
    margin-bottom: 0.65rem;
    margin-left: 0.35rem;
    padding-left: 0.5rem;
    border-left: 3px solid rgba(14, 165, 233, 0.55);
    border-radius: 0 0.55rem 0.55rem 0;
    background: rgba(248, 250, 252, 0.85);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-left-width: 3px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.essentials-knowledge-base-page .essentials-kb-section-card:last-child {
    margin-bottom: 0;
}

.essentials-knowledge-base-page .essentials-kb-section-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem 0.35rem 0.5rem;
}

.essentials-knowledge-base-page .essentials-kb-section-card__title {
    margin: 0;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    line-height: 1.35;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.essentials-knowledge-base-page .essentials-kb-section-card__body {
    padding: 0 0.65rem 0.65rem 0.5rem;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-secondary, #475569);
}

.essentials-knowledge-base-page .essentials-kb-section-card__body.kb-prose {
    max-height: 9rem;
    overflow: auto;
}

/* Articles inside a section */
.essentials-knowledge-base-page .essentials-kb-article-list {
    list-style: none;
    margin: 0.65rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.essentials-knowledge-base-page .essentials-kb-article-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    border-radius: 0.45rem;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(226, 232, 240, 0.95);
}

.essentials-knowledge-base-page .essentials-kb-article-link {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    flex: 1;
    min-width: 0;
    color: var(--text-primary, #0f172a);
    font-weight: 600;
    text-decoration: none !important;
}

.essentials-knowledge-base-page .essentials-kb-article-link:hover {
    color: #2563eb;
}

.essentials-knowledge-base-page .essentials-kb-article-icon {
    margin-top: 0.15rem;
    padding: 0.2rem;
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
    opacity: 0.9;
}

.essentials-knowledge-base-page .essentials-kb-article-tools {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.25rem;
}

:root[data-theme='dark'] .essentials-knowledge-base-page .essentials-kb-root-card {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

:root[data-theme='dark'] .essentials-knowledge-base-page .essentials-kb-root-card:hover {
    border-color: rgba(148, 163, 184, 0.45);
}

:root[data-theme='dark'] .essentials-knowledge-base-page .essentials-kb-root-card__head {
    background: rgba(15, 23, 42, 0.65);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .essentials-knowledge-base-page .essentials-kb-root-card__title,
:root[data-theme='dark'] .essentials-knowledge-base-page .essentials-kb-section-card__title {
    color: #f1f5f9;
}

:root[data-theme='dark'] .essentials-knowledge-base-page .essentials-kb-card-description {
    color: #cbd5e1;
}

:root[data-theme='dark'] .essentials-knowledge-base-page .essentials-kb-section-card {
    background: rgba(15, 23, 42, 0.65);
    border-color: var(--border-strong, #334866);
    border-left-color: rgba(56, 189, 248, 0.55);
}

:root[data-theme='dark'] .essentials-knowledge-base-page .essentials-kb-article-item {
    background: rgba(15, 23, 42, 0.85);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .essentials-knowledge-base-page .essentials-kb-article-link {
    color: #e2e8f0;
}

:root[data-theme='dark'] .essentials-knowledge-base-page .essentials-kb-article-link:hover {
    color: #93c5fd;
}

:root[data-theme='dark'] .essentials-knowledge-base-page .essentials-kb-tool:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
    border-color: rgba(148, 163, 184, 0.25);
}

/* Essentials — Knowledge base show + create/edit forms */
.essentials-kb-show-page .essentials-kb-show-layout {
    margin-top: 0.15rem;
}

.essentials-kb-show-page .essentials-kb-show-sidebar-col {
    min-width: 0;
}

.essentials-kb-show-page .essentials-kb-sidebar-panel {
    border-radius: 0.65rem;
    border: 1px solid var(--border-default, #e2e8f0);
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.06));
}

.essentials-kb-show-page .essentials-kb-sidebar-header {
    padding: 0.55rem 0.75rem !important;
}

.essentials-kb-show-page .essentials-kb-sidebar-body {
    padding: 0.5rem 0.65rem 0.75rem !important;
}

.essentials-kb-show-page .essentials-kb-sidebar-article--active {
    background: rgba(13, 148, 136, 0.12);
    border-color: transparent;
}

.essentials-kb-show-page .essentials-kb-show-article-panel {
    padding: 0;
    overflow: hidden;
}

.essentials-kb-show-page .essentials-kb-show-article-head {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.essentials-kb-show-page .essentials-kb-show-article-head p {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.essentials-kb-show-page .essentials-kb-show-share {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted, #64748b);
}

.essentials-kb-show-page .essentials-kb-show-body {
    padding: 1rem 1.15rem 1.25rem;
    font-size: 0.94rem;
    line-height: 1.6;
    word-break: break-word;
}

.essentials-kb-show-page .essentials-kb-show-body img {
    max-width: 100%;
    height: auto;
}

.essentials-kb-show-page .essentials-kb-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.4rem;
    color: var(--text-secondary, #475569);
}

.essentials-kb-show-page .essentials-kb-tool:hover {
    background: var(--bg-surface-soft, #f1f5f9);
    color: var(--text-primary, #0f172a);
}

.essentials-kb-form-page .essentials-kb-form-heading {
    margin-bottom: 1rem;
}

.essentials-kb-form-page .essentials-kb-form-page-subtitle {
    margin: 0.4rem 0 0;
    font-size: 0.88rem;
    color: var(--text-muted, #64748b);
    max-width: 44rem;
    line-height: 1.45;
}

.essentials-kb-form-page .essentials-kb-form-panel {
    padding: 0;
    overflow: hidden;
    border-radius: 0.85rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface, #fff);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.05),
        0 12px 32px rgba(15, 23, 42, 0.06);
}

.essentials-kb-form-page .essentials-kb-form-panel-head--context {
    padding: 0.65rem 1.15rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95) 0%, rgba(255, 255, 255, 0.6) 100%);
}

.essentials-kb-form-page .essentials-kb-form-context {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.5rem;
}

.essentials-kb-form-page .essentials-kb-form-context-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.essentials-kb-form-page .essentials-kb-form-context-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary, #0f172a);
    word-break: break-word;
}

.essentials-kb-form-page .essentials-kb-form-body {
    padding: 1.15rem 1.25rem 1.35rem;
}

.essentials-kb-form-page .essentials-kb-form-body .form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    margin-bottom: 0.4rem;
}

.essentials-kb-form-page .essentials-kb-form-body .form-control {
    border-radius: 0.45rem;
    border-color: rgba(148, 163, 184, 0.45);
}

.essentials-kb-form-page .essentials-kb-form-body .form-control:focus {
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.essentials-kb-form-page .essentials-kb-form-group--editor textarea {
    min-height: 14rem;
}

.essentials-kb-form-page .essentials-kb-form-group--editor .tox-tinymce {
    border-radius: 0.5rem !important;
    border-color: rgba(148, 163, 184, 0.45) !important;
    background: var(--bg-surface, #fff);
}

.essentials-kb-form-page .essentials-kb-form-group--editor .tox .tox-editor-header {
    border-radius: 0.5rem 0.5rem 0 0 !important;
    box-shadow: none !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95) !important;
}

.essentials-kb-form-page .essentials-kb-form-panel .essentials-kb-form-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.15rem 1.1rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.65) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.essentials-kb-form-page .essentials-kb-form-footer .users-btn-primary {
    min-width: 7.5rem;
    font-weight: 600;
}

.essentials-kb-form-page .essentials-kb-form-footer .users-btn-primary i {
    margin-right: 0.35rem;
    opacity: 0.9;
}

:root[data-theme='dark'] .essentials-kb-show-page .essentials-kb-sidebar-panel {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .essentials-kb-show-page .essentials-kb-show-article-panel {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .essentials-kb-form-page .essentials-kb-form-panel {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

:root[data-theme='dark'] .essentials-kb-form-page .essentials-kb-form-panel-head--context {
    background: rgba(15, 23, 42, 0.65);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .essentials-kb-form-page .essentials-kb-form-context-title {
    color: #f1f5f9;
}

:root[data-theme='dark'] .essentials-kb-form-page .essentials-kb-form-panel .essentials-kb-form-footer {
    background: rgba(15, 23, 42, 0.55);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .essentials-kb-form-page .essentials-kb-form-group--editor .tox-tinymce {
    border-color: var(--border-strong, #334866) !important;
    background: var(--bg-surface, #0f172a);
}

/* Essentials — Leave type + Leave list (Nestiko shell + DataTables toolbar) */
.leave-type-page .leave-type-page-heading,
.leave-page .leave-page-heading {
    margin-bottom: 0.85rem;
}

.leave-type-page .leave-type-page-subtitle,
.leave-page .leave-page-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    color: var(--text-muted, #64748b);
    max-width: 42rem;
    line-height: 1.45;
}

.leave-page .leave-page-filters {
    margin-bottom: 0.25rem;
}

.leave-type-page .leave-type-panel-head,
.leave-page .leave-list-panel-head {
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}

.leave-type-page .leave-type-panel-head .users-toolbar-actions,
.leave-page .leave-list-panel-head .users-toolbar-actions {
    margin-left: auto;
}

.leave-type-page .leave-type-table-wrap,
.leave-page .leave-list-table-wrap {
    padding: 0 0 0.75rem;
}

.leave-page .leave-page-summary-row {
    margin-top: 1rem;
    min-width: 0;
}

.leave-type-page .essentials-dt-lf--leave-type,
.leave-page .essentials-dt-lf--leave-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.leave-type-page .essentials-dt-lf--leave-type .dataTables_length,
.leave-type-page .essentials-dt-lf--leave-type .dataTables_filter,
.leave-page .essentials-dt-lf--leave-list .dataTables_length,
.leave-page .essentials-dt-lf--leave-list .dataTables_filter {
    margin: 0;
    float: none;
}

.leave-type-page .essentials-dt-lf--leave-type .dataTables_filter label,
.leave-page .essentials-dt-lf--leave-list .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.leave-type-page .essentials-dt-lf--leave-type .dataTables_filter input,
.leave-page .essentials-dt-lf--leave-list .dataTables_filter input {
    min-width: 10rem;
    border-radius: 0.45rem;
    border: 1px solid var(--border-default, #e2e8f0);
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
}

.leave-type-page .dataTables_wrapper .dataTables_info,
.leave-page .dataTables_wrapper .dataTables_info {
    padding: 0.5rem 0.75rem 0;
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}

.leave-type-page .dataTables_wrapper .dataTables_paginate,
.leave-page .dataTables_wrapper .dataTables_paginate {
    padding: 0.35rem 0.75rem 0.65rem;
}

.leave-type-page .leave-type-col-action {
    width: 7.5rem;
    text-align: right;
}

.leave-page .leave-list-col-action {
    width: 12rem;
    min-width: 10rem;
    text-align: right;
}

.leave-type-page .leave-type-data-table td:last-child {
    text-align: right;
    white-space: nowrap;
}

.leave-page .leave-data-table td:last-child {
    text-align: right;
    white-space: normal;
}

.leave-page .leave-data-table td:last-child .users-btn {
    display: inline-flex;
    margin: 0.15rem 0 0.15rem 0.35rem;
    vertical-align: middle;
}

:root[data-theme='dark'] .leave-type-page .essentials-dt-lf--leave-type,
:root[data-theme='dark'] .leave-page .essentials-dt-lf--leave-list {
    background: rgba(15, 23, 42, 0.45);
    border-color: var(--border-strong, #334866);
}

/* Essentials — Sales targets (HRM) */
.sales-target-page .sales-target-page-heading {
    margin-bottom: 0.85rem;
}

.sales-target-page .sales-target-page-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    color: var(--text-muted, #64748b);
    max-width: 42rem;
    line-height: 1.45;
}

.sales-target-page .sales-target-panel-head {
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}

.sales-target-page .sales-target-table-wrap {
    padding: 0 0 0.75rem;
}

.sales-target-page .essentials-dt-lf--sales-target {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.sales-target-page .essentials-dt-lf--sales-target .dataTables_length,
.sales-target-page .essentials-dt-lf--sales-target .dataTables_filter {
    margin: 0;
    float: none;
}

.sales-target-page .essentials-dt-lf--sales-target .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.sales-target-page .essentials-dt-lf--sales-target .dataTables_filter input {
    min-width: 10rem;
    border-radius: 0.45rem;
    border: 1px solid var(--border-default, #e2e8f0);
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
}

.sales-target-page .dataTables_wrapper .dataTables_info {
    padding: 0.5rem 0.75rem 0;
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}

.sales-target-page .dataTables_wrapper .dataTables_paginate {
    padding: 0.35rem 0.75rem 0.65rem;
}

.sales-target-page .sales-target-col-action {
    width: 11rem;
    min-width: 9rem;
    text-align: right;
}

.sales-target-page .sales-target-data-table td:last-child {
    text-align: right;
    white-space: nowrap;
}

:root[data-theme='dark'] .sales-target-page .essentials-dt-lf--sales-target {
    background: rgba(15, 23, 42, 0.45);
    border-color: var(--border-strong, #334866);
}

/* Essentials — HRM settings (tabs: leave, payroll, attendance, sales target, essentials) */
.hrm-settings-page .hrm-settings-page-heading {
    margin-bottom: 0.85rem;
}

.hrm-settings-page .hrm-settings-page-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    color: var(--text-muted, #64748b);
    max-width: 44rem;
    line-height: 1.45;
}

.hrm-settings-page .hrm-settings-panel {
    margin-bottom: 0;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.hrm-settings-page .hrm-settings-panel > .nav-tabs-custom {
    margin-bottom: 0;
}

.hrm-settings-page .hrm-settings-nav-tabs.nav-tabs-custom {
    margin-bottom: 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface, #fff);
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.08));
    overflow: hidden;
}

.hrm-settings-page .hrm-settings-nav-tabs > .nav-tabs {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
    padding: 0.35rem 0.35rem 0;
    gap: 0.2rem;
}

.hrm-settings-page .hrm-settings-nav-tabs > .nav-tabs > li {
    margin-bottom: 0;
}

.hrm-settings-page .hrm-settings-nav-tabs > .nav-tabs > li > a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 0.45rem 0.45rem 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.5rem 0.55rem;
    border: 1px solid transparent;
}

.hrm-settings-page .hrm-settings-nav-tabs > .nav-tabs > li > a i {
    opacity: 0.88;
    font-size: 0.85rem;
}

.hrm-settings-page .hrm-settings-nav-tabs > .nav-tabs > li.active > a,
.hrm-settings-page .hrm-settings-nav-tabs > .nav-tabs > li.active > a:hover,
.hrm-settings-page .hrm-settings-nav-tabs > .nav-tabs > li.active > a:focus {
    color: var(--text-primary, #0f172a);
    background: var(--bg-surface, #fff);
    border-color: var(--border-default, #e2e8f0);
    border-bottom-color: transparent;
}

.hrm-settings-page .hrm-settings-tab-content {
    padding: 1rem 1rem 1.15rem;
}

.hrm-settings-page .hrm-settings-tab-inner .form-group {
    margin-bottom: 1rem;
}

.hrm-settings-page .hrm-settings-tab-inner .form-group:last-child {
    margin-bottom: 0;
}

.hrm-settings-page .hrm-settings-subheading {
    margin: 0.5rem 0 0.35rem;
    font-size: 0.88rem;
    color: var(--text-secondary, #475569);
}

.hrm-settings-page .hrm-settings-checkbox {
    margin: 0 0 0.75rem;
    padding: 0.5rem 0.65rem;
    border-radius: 0.5rem;
    background: var(--bg-surface-soft, #f8fafc);
    border: 1px solid var(--border-default, #e2e8f0);
}

.hrm-settings-page .hrm-settings-checkbox label {
    font-weight: 500;
    margin: 0;
}

.hrm-settings-page .hrm-settings-attendance-note {
    margin: 1rem 0 0;
    padding: 0.65rem 0.75rem;
    font-size: 0.86rem;
    border-radius: 0.5rem;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.hrm-settings-page .hrm-settings-attendance-note .fa-info-circle {
    margin-right: 0.35rem;
    color: var(--text-muted, #64748b);
}

.hrm-settings-page .hrm-settings-actions {
    display: flex;
    justify-content: center;
    margin: 1rem 0 0.75rem;
}

.hrm-settings-page .hrm-settings-version {
    margin: 0;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .hrm-settings-page .hrm-settings-nav-tabs.nav-tabs-custom {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .hrm-settings-page .hrm-settings-nav-tabs > .nav-tabs {
    background: rgba(15, 23, 42, 0.55);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .hrm-settings-page .hrm-settings-nav-tabs > .nav-tabs > li.active > a,
:root[data-theme='dark'] .hrm-settings-page .hrm-settings-nav-tabs > .nav-tabs > li.active > a:hover,
:root[data-theme='dark'] .hrm-settings-page .hrm-settings-nav-tabs > .nav-tabs > li.active > a:focus {
    color: var(--text-primary, #e2e8f0);
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
    border-bottom-color: transparent;
}

:root[data-theme='dark'] .hrm-settings-page .hrm-settings-checkbox {
    background: rgba(15, 23, 42, 0.45);
    border-color: var(--border-strong, #334866);
}

/* Essentials — Attendance (HRM: clock, tabs, shifts + all attendance tables) */
.attendance-page .attendance-page-heading {
    margin-bottom: 0.85rem;
}

.attendance-page .attendance-page-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    color: var(--text-muted, #64748b);
    max-width: 44rem;
    line-height: 1.45;
}

.attendance-page .attendance-page-alert {
    border-radius: 0.55rem;
}

.attendance-page .attendance-clock-card {
    margin-bottom: 1.15rem;
    padding: 1rem 1rem 0.85rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface, #fff);
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.08));
    text-align: center;
}

.attendance-page .attendance-clock-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
}

.attendance-page .attendance-clock-btn {
    min-width: 8.5rem;
}

.attendance-page .attendance-clocked-in-hint {
    margin: 0.65rem 0 0;
    font-size: 0.84rem;
}

.attendance-page .attendance-nav-tabs.nav-tabs-custom {
    margin-bottom: 0;
    border-radius: 0.75rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface, #fff);
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.08));
    overflow: hidden;
}

.attendance-page .attendance-nav-tabs > .nav-tabs {
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
    padding: 0.25rem 0.35rem 0;
}

.attendance-page .attendance-nav-tabs > .nav-tabs > li > a {
    border-radius: 0.45rem 0.45rem 0 0;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.5rem 0.65rem;
}

.attendance-page .attendance-tab-content {
    padding: 0.85rem 0.85rem 1rem;
}

.attendance-page .attendance-tab-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.65rem;
}

.attendance-page .attendance-tab-filters {
    align-items: flex-end;
    margin-bottom: 0.75rem;
}

.attendance-page .attendance-tab-filters-actions {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    padding-bottom: 0.4rem;
}

@media (max-width: 991px) {
    .attendance-page .attendance-tab-filters-actions {
        justify-content: flex-start;
        margin-top: 0.35rem;
    }
}

.attendance-page .attendance-summary-block {
    margin: 0.5rem 0 0.75rem;
}

.attendance-page .attendance-summary-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.attendance-page .essentials-dt-lf--attendance-list,
.attendance-page .essentials-dt-lf--attendance-shift {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.attendance-page .essentials-dt-lf--attendance-list .dataTables_length,
.attendance-page .essentials-dt-lf--attendance-list .dataTables_filter,
.attendance-page .essentials-dt-lf--attendance-shift .dataTables_length,
.attendance-page .essentials-dt-lf--attendance-shift .dataTables_filter {
    margin: 0;
    float: none;
}

.attendance-page .essentials-dt-lf--attendance-list .dataTables_filter label,
.attendance-page .essentials-dt-lf--attendance-shift .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.attendance-page .essentials-dt-lf--attendance-list .dataTables_filter input,
.attendance-page .essentials-dt-lf--attendance-shift .dataTables_filter input {
    min-width: 10rem;
    border-radius: 0.45rem;
    border: 1px solid var(--border-default, #e2e8f0);
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
}

.attendance-page .dataTables_wrapper .dataTables_info {
    padding: 0.5rem 0.75rem 0;
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}

.attendance-page .dataTables_wrapper .dataTables_paginate {
    padding: 0.35rem 0.75rem 0.65rem;
}

.attendance-page .attendance-col-action {
    width: 9rem;
    min-width: 8rem;
    text-align: right;
}

.attendance-page .attendance-data-table td:last-child .users-btn {
    display: inline-flex;
    margin: 0.15rem 0 0.15rem 0.35rem;
    vertical-align: middle;
}

:root[data-theme='dark'] .attendance-page .attendance-clock-card {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .attendance-page .attendance-nav-tabs.nav-tabs-custom {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .attendance-page .attendance-nav-tabs > .nav-tabs {
    background: rgba(15, 23, 42, 0.55);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .attendance-page .essentials-dt-lf--attendance-list,
:root[data-theme='dark'] .attendance-page .essentials-dt-lf--attendance-shift {
    background: rgba(15, 23, 42, 0.45);
    border-color: var(--border-strong, #334866);
}

/* Essentials — Payroll (tabs: all payrolls, groups, pay components) */
.payroll-page .payroll-page-heading {
    margin-bottom: 0.85rem;
}

.payroll-page .payroll-page-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    color: var(--text-muted, #64748b);
    max-width: 44rem;
    line-height: 1.45;
}

.payroll-page .payroll-nav-tabs.nav-tabs-custom {
    margin-bottom: 0;
    border-radius: 0.75rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface, #fff);
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.08));
    overflow: hidden;
}

.payroll-page .payroll-nav-tabs > .nav-tabs {
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
    padding: 0.25rem 0.35rem 0;
}

.payroll-page .payroll-nav-tabs > .nav-tabs > li > a {
    border-radius: 0.45rem 0.45rem 0 0;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.5rem 0.65rem;
}

.payroll-page .payroll-tab-content {
    padding: 0.85rem 0.85rem 1rem;
}

.payroll-page .payroll-tab-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.65rem;
}

.payroll-page .payroll-tab-inner {
    margin-bottom: 0;
}

.payroll-page .essentials-dt-lf--payroll-list,
.payroll-page .essentials-dt-lf--payroll-groups,
.payroll-page .essentials-dt-lf--payroll-ad {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.payroll-page .essentials-dt-lf--payroll-list .dataTables_length,
.payroll-page .essentials-dt-lf--payroll-list .dataTables_filter,
.payroll-page .essentials-dt-lf--payroll-groups .dataTables_length,
.payroll-page .essentials-dt-lf--payroll-groups .dataTables_filter,
.payroll-page .essentials-dt-lf--payroll-ad .dataTables_length,
.payroll-page .essentials-dt-lf--payroll-ad .dataTables_filter {
    margin: 0;
    float: none;
}

.payroll-page .essentials-dt-lf--payroll-list .dataTables_filter label,
.payroll-page .essentials-dt-lf--payroll-groups .dataTables_filter label,
.payroll-page .essentials-dt-lf--payroll-ad .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.payroll-page .essentials-dt-lf--payroll-list .dataTables_filter input,
.payroll-page .essentials-dt-lf--payroll-groups .dataTables_filter input,
.payroll-page .essentials-dt-lf--payroll-ad .dataTables_filter input {
    min-width: 10rem;
    border-radius: 0.45rem;
    border: 1px solid var(--border-default, #e2e8f0);
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
}

.payroll-page .dataTables_wrapper .dataTables_info {
    padding: 0.5rem 0.75rem 0;
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}

.payroll-page .dataTables_wrapper .dataTables_paginate {
    padding: 0.35rem 0.75rem 0.65rem;
}

.payroll-page .payroll-col-action {
    min-width: 110px;
    text-align: right;
}

.payroll-page .payroll-actions-dropdown .dropdown-menu > li > a {
    font-size: 0.84rem;
    padding: 0.45rem 0.85rem;
}

.payroll-page .payroll-actions-dropdown .dropdown-menu > li > a i {
    margin-right: 0.35rem;
    opacity: 0.85;
}

:root[data-theme='dark'] .payroll-page .payroll-nav-tabs.nav-tabs-custom {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .payroll-page .payroll-nav-tabs > .nav-tabs {
    background: rgba(15, 23, 42, 0.55);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .payroll-page .essentials-dt-lf--payroll-list,
:root[data-theme='dark'] .payroll-page .essentials-dt-lf--payroll-groups,
:root[data-theme='dark'] .payroll-page .essentials-dt-lf--payroll-ad {
    background: rgba(15, 23, 42, 0.45);
    border-color: var(--border-strong, #334866);
}

/* Essentials — Holiday (filters + list) */
.holiday-page .holiday-page-heading {
    margin-bottom: 0.85rem;
}

.holiday-page .holiday-page-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    color: var(--text-muted, #64748b);
    max-width: 40rem;
    line-height: 1.45;
}

.holiday-page .holiday-page-filters {
    margin-bottom: 0.35rem;
}

.holiday-page .holiday-list-panel-head {
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}

.holiday-page .holiday-list-panel-head .users-toolbar-actions {
    margin-left: auto;
}

.holiday-page .holiday-list-table-wrap {
    padding: 0 0 0.75rem;
}

.holiday-page .essentials-dt-lf--holiday-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.holiday-page .essentials-dt-lf--holiday-list .dataTables_length,
.holiday-page .essentials-dt-lf--holiday-list .dataTables_filter {
    margin: 0;
    float: none;
}

.holiday-page .essentials-dt-lf--holiday-list .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.holiday-page .essentials-dt-lf--holiday-list .dataTables_filter input {
    min-width: 10rem;
    border-radius: 0.45rem;
    border: 1px solid var(--border-default, #e2e8f0);
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
}

.holiday-page .dataTables_wrapper .dataTables_info {
    padding: 0.5rem 0.75rem 0;
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}

.holiday-page .dataTables_wrapper .dataTables_paginate {
    padding: 0.35rem 0.75rem 0.65rem;
}

.holiday-page .holiday-col-action {
    min-width: 9.5rem;
    text-align: right;
}

.holiday-page .holidays-data-table td:last-child .users-btn {
    display: inline-flex;
    margin: 0.15rem 0 0.15rem 0.35rem;
    vertical-align: middle;
}

:root[data-theme='dark'] .holiday-page .essentials-dt-lf--holiday-list {
    background: rgba(15, 23, 42, 0.45);
    border-color: var(--border-strong, #334866);
}

/* Leave type — add/edit modal */
#add_leave_type_modal .modal-content {
    border-radius: 0.75rem;
    border: 1px solid var(--border-default, #e2e8f0);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
}

#add_leave_type_modal .modal-header {
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    padding: 0.85rem 1rem;
}

#add_leave_type_modal .modal-title {
    font-size: 1.05rem;
    font-weight: 700;
}

#add_leave_type_modal .modal-body {
    padding: 1rem 1rem 0.25rem;
}

#add_leave_type_modal .modal-footer {
    border-top: 1px solid var(--border-default, #e2e8f0);
    padding: 0.75rem 1rem;
}

:root[data-theme='dark'] #add_leave_type_modal .modal-content {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
}

/* Restaurant — All orders (waiter) + Kitchen orders */
.restaurant-orders-page .users-panel + .users-panel {
    margin-top: 1rem;
}

.restaurant-orders-page .restaurant-orders-filters-panel {
    width: min(calc(100vw - 2rem), 28rem);
    max-width: 28rem;
}

.restaurant-orders-page .restaurant-orders-filter-hint {
    margin: 0 0 0.65rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .restaurant-orders-page .restaurant-orders-filter-hint {
    color: #94a3b8;
}

.restaurant-orders-page .restaurant-orders-filter-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

:is(.restaurant-orders-page, .restaurant-kitchen-page) .restaurant-orders-panel__content {
    padding: 0.75rem 1rem 1rem;
}

.restaurant-orders-page .restaurant-orders-staff-picker {
    margin-bottom: 0;
}

:is(.restaurant-orders-page, .restaurant-kitchen-page) .users-panel h4.text-center {
    margin: 2rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
}

:is(.restaurant-orders-page, .restaurant-kitchen-page) .small-box.bg-gray {
    border-radius: 0.65rem;
    border: 1px solid var(--border-default, #e2e8f0);
    box-shadow: var(--shadow-soft, 0 1px 2px rgba(15, 23, 42, 0.08));
    background: var(--bg-surface-soft, #f8fafc) !important;
}

:root[data-theme='dark'] :is(.restaurant-orders-page, .restaurant-kitchen-page) .small-box.bg-gray {
    background: rgba(15, 23, 42, 0.45) !important;
    border-color: var(--border-strong, #334866);
}

/* Restaurant — Bookings */
.restaurant-bookings-page .users-panel + .users-panel {
    margin-top: 1rem;
}

.restaurant-bookings-page .restaurant-bookings-filters-panel {
    width: min(calc(100vw - 2rem), 28rem);
    max-width: 28rem;
}

.restaurant-bookings-page .restaurant-bookings-filter-hint {
    margin: 0 0 0.65rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .restaurant-bookings-page .restaurant-bookings-filter-hint {
    color: #94a3b8;
}

.restaurant-bookings-page .restaurant-bookings-filter-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.restaurant-bookings-page .restaurant-bookings-location-picker {
    margin-bottom: 0;
}

.restaurant-bookings-page .restaurant-bookings-location-picker .select2-container {
    width: 100% !important;
    max-width: 28rem;
}

.restaurant-bookings-page .restaurant-bookings-location-picker .control-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    margin-bottom: 0.35rem;
}

.restaurant-bookings-page .restaurant-bookings-calendar-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.75rem 1rem 1rem;
}

@media (min-width: 992px) {
    .restaurant-bookings-page .restaurant-bookings-calendar-grid {
        grid-template-columns: minmax(0, 1fr) 12.5rem;
        align-items: start;
    }
}

.restaurant-bookings-page .restaurant-bookings-legend-item {
    border-radius: 0.45rem;
    padding: 0.45rem 0.5rem;
    margin-bottom: 0.45rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.restaurant-bookings-page .restaurant-bookings-legend-hint {
    font-size: 0.78rem;
    line-height: 1.45;
    margin: 0.65rem 0 0;
}

.restaurant-bookings-page .restaurant-bookings-calendar-main .fc-toolbar {
    flex-wrap: wrap;
    gap: 0.35rem;
}

.restaurant-bookings-page .restaurant-bookings-calendar-main #calendar {
    min-height: 28rem;
}

/* Manage modules (superadmin) */
.manage-modules-page .manage-modules-filters-panel {
    width: min(calc(100vw - 2rem), 28rem);
    max-width: 28rem;
}

.manage-modules-page .manage-modules-filter-hint {
    margin: 0 0 0.65rem;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

:root[data-theme='dark'] .manage-modules-page .manage-modules-filter-hint {
    color: #94a3b8;
}

.manage-modules-page .manage-modules-filter-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.manage-modules-page .manage-modules-toolbar-row {
    justify-content: stretch;
    width: 100%;
    margin-bottom: 1rem;
}

.manage-modules-page .manage-modules-toolbar-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.manage-modules-page .manage-modules-panel__body {
    padding: 0.75rem 1rem 1rem;
}

.manage-modules-page .manage-modules-upload-panel {
    margin-bottom: 1rem;
}

.manage-modules-page .manage-modules-table-wrap {
    padding: 0 0 0.75rem;
}

.manage-modules-page .manage-modules-table thead th {
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--text-secondary, #475569);
    font-size: 0.78rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.manage-modules-page .manage-modules-table tbody td {
    vertical-align: top;
    font-size: 0.84rem;
}

.manage-modules-page .manage-modules-table td .users-btn,
.manage-modules-page .manage-modules-table td form {
    vertical-align: middle;
    margin: 0 0.35rem 0.35rem 0;
}

.manage-modules-page .manage-modules-spacer-row td {
    padding: 0.65rem 0;
    border: none;
    background: transparent;
}

.manage-modules-page .manage-modules-btn-uninstall {
    border-color: #f59e0b;
    color: #b45309;
    background: #fffbeb;
}

.manage-modules-page .manage-modules-btn-uninstall:hover,
.manage-modules-page .manage-modules-btn-uninstall:focus {
    background: #fef3c7;
    border-color: #d97706;
    color: #92400e;
    text-decoration: none;
}

.manage-modules-page .manage-modules-version-badge {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.12rem 0.45rem;
    border-radius: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--bg-surface-soft, #f1f5f9);
    color: var(--text-secondary, #64748b);
    border: 1px solid var(--border-default, #e2e8f0);
}

.manage-modules-page .manage-modules-marketplace-icon {
    color: var(--text-muted, #94a3b8);
}

:root[data-theme='dark'] .manage-modules-page .manage-modules-table thead th {
    background: rgba(15, 23, 42, 0.6);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .manage-modules-page .manage-modules-btn-uninstall {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.45);
    color: #fcd34d;
}

/* Administer Backup */
.backup-page .backup-page-alert {
    border-radius: 0.5rem;
}

.backup-page .users-table-controls__tools-inner {
    align-items: center;
    gap: 0.45rem;
}

/* Primary action aligned with the DataTables export toolbar (replaces floating circular FAB). */
.backup-page .backup-create-btn {
    flex-shrink: 0;
    white-space: nowrap;
    text-decoration: none;
}

.backup-page .backup-create-btn:hover,
.backup-page .backup-create-btn:focus {
    text-decoration: none;
}

@media (max-width: 640px) {
    .backup-page .backup-create-btn span {
        max-width: 11rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.backup-page .backup-table-wrap {
    padding: 0 0 0.5rem;
}

.backup-page .backup-data-table thead th {
    background: var(--bg-surface-soft, #f8fafc);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary, #475569);
}

.backup-page .backup-empty-cell {
    padding: 2rem 1rem !important;
    font-size: 0.9rem;
}

.backup-page .backup-cron-section {
    margin: 0;
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.backup-page .backup-cron-label {
    margin: 0 0 0.5rem;
    font-size: 0.84rem;
    color: var(--text-secondary, #475569);
}

.backup-page .backup-cron-code {
    margin: 0;
    padding: 0.65rem 0.85rem;
    border-radius: 0.45rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface, #fff);
    font-size: 0.78rem;
    line-height: 1.45;
    overflow-x: auto;
    color: #b91c1c;
}

.backup-page .backup-cron-code code {
    white-space: pre-wrap;
    word-break: break-all;
    color: inherit;
    background: transparent;
    padding: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

:root[data-theme='dark'] .backup-page .backup-data-table thead th {
    background: rgba(15, 23, 42, 0.6);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .backup-page .backup-cron-section {
    background: rgba(15, 23, 42, 0.35);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .backup-page .backup-cron-code {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
    color: #fca5a5;
}

/* Profit / Loss report — title + print, filters, DT toolbar row */
.profit-loss-report-page .profit-loss-page-title-row {
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.25rem;
}

.profit-loss-report-page .profit-loss-page-title-row > div:first-child {
    flex: 1 1 16rem;
    min-width: 0;
}

.profit-loss-report-page .profit-loss-print-actions {
    flex-shrink: 0;
}

.profit-loss-report-page .profit-loss-filters-section {
    margin-bottom: 1rem;
}

.profit-loss-report-page .profit-loss-breakdown-panel .users-table-controls__tools-inner {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
}

.profit-loss-report-page .profit-loss-breakdown-panel .roles-dt-tools-host {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.45rem;
}

/* Purchase & Sale report — layout, stats, KV tables (no DataTables on this page) */
.purchase-sell-report-page .purchase-sell-page-title-row {
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.25rem;
}

.purchase-sell-report-page .purchase-sell-page-title-row > div:first-child {
    flex: 1 1 16rem;
    min-width: 0;
}

.purchase-sell-report-page .purchase-sell-print-actions {
    flex-shrink: 0;
}

.purchase-sell-report-page .users-stats {
    grid-template-columns: repeat(auto-fill, minmax(10.25rem, 1fr));
}

@media (min-width: 992px) {
    .purchase-sell-report-page .users-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.purchase-sell-report-page .users-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 4.5rem;
}

.purchase-sell-report-page .purchase-sell-filters-section {
    margin-bottom: 1rem;
}

.purchase-sell-report-page .purchase-sell-kv-columns > [class*='col-'] {
    min-width: 0;
}

.purchase-sell-report-page .purchase-sell-kv-wrap {
    padding: 0 0.85rem 0.85rem;
    overflow-x: visible;
}

@media (max-width: 767px) {
    .purchase-sell-report-page .purchase-sell-kv-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.purchase-sell-report-page .purchase-sell-summary-table {
    width: 100%;
    table-layout: fixed;
    margin-bottom: 0;
}

.purchase-sell-report-page .purchase-sell-summary-table tbody th {
    text-align: left;
    vertical-align: middle;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #64748b);
    width: 52%;
    padding: 0.65rem 0.5rem 0.65rem 0;
    border-top: none;
}

.purchase-sell-report-page .purchase-sell-summary-table tbody td {
    text-align: right;
    vertical-align: middle;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary, #0f172a);
    padding: 0.65rem 0 0.65rem 0.5rem;
    border-top: none;
}

.purchase-sell-report-page .purchase-sell-summary-table tbody tr + tr th,
.purchase-sell-report-page .purchase-sell-summary-table tbody tr + tr td {
    border-top: 1px solid var(--border-default, #e2e8f0);
}

.purchase-sell-report-page .purchase-sell-overall-block {
    padding: 0.75rem 1rem 1rem;
}

.purchase-sell-report-page .purchase-sell-overall-block h3 {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    font-size: 0.95rem;
    margin: 0 0 0.65rem;
}

.purchase-sell-report-page .purchase-sell-overall-block h3:last-child {
    margin-bottom: 0;
}

.purchase-sell-report-page .purchase-sell-overall-block h3 span {
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

:root[data-theme='dark'] .purchase-sell-report-page .purchase-sell-summary-table tbody th {
    color: #94a3b8;
}

:root[data-theme='dark'] .purchase-sell-report-page .purchase-sell-summary-table tbody td {
    color: #e2e8f0;
}

/* Tax report — title row, 4-up stats, filters, summary, tab toolbars */
.tax-report-page .tax-report-page-title-row {
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.25rem;
}

.tax-report-page .tax-report-page-title-row > div:first-child {
    flex: 1 1 16rem;
    min-width: 0;
}

.tax-report-page .tax-report-print-actions {
    flex-shrink: 0;
}

.tax-report-page .tax-report-page-copy {
    margin-bottom: 0;
}

.tax-report-page .tax-report-users-stats {
    grid-template-columns: repeat(auto-fill, minmax(10.25rem, 1fr));
}

@media (min-width: 992px) {
    .tax-report-page .tax-report-users-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.tax-report-page .tax-report-users-stats .users-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 4.5rem;
}

.tax-report-page .tax-report-filters-section {
    margin-bottom: 1rem;
}

.tax-report-page .tax-report-summary-panel .tax-report-overall-body {
    padding: 0.65rem 1rem 0.85rem;
}

.tax-report-page .tax-report-overall-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin: 0;
    font-size: 0.95rem;
}

.tax-report-page .tax-report-overall-value {
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

:root[data-theme='dark'] .tax-report-page .tax-report-overall-value {
    color: #e2e8f0;
}

.tax-report-page .tax-report-tabs-panel .nav-tabs-custom {
    margin-bottom: 0;
}

.tax-report-page .tax-report-tabs-panel .nav-tabs.users-view-tab-nav {
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    gap: 0.15rem;
}

.tax-report-page .tax-report-tabs-panel .nav-tabs.users-view-tab-nav > li > a {
    border-radius: 0.45rem 0.45rem 0 0;
    margin-right: 0.15rem;
}

.tax-report-page .tax-report-tabs-panel .nav-tabs.users-view-tab-nav > li.active > a {
    border-bottom-color: transparent;
}

.tax-report-page .tax-report-tabs-panel .users-table-controls__tools-inner {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    justify-content: flex-end;
}

.tax-report-page .tax-report-tabs-panel .roles-dt-tools-host {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.45rem;
}

.tax-report-page .tax-report-tabs-panel .std-dt-toolbar {
    flex: 1 1 auto;
    min-width: 0;
}

/* Hide legacy DataTables Buttons row if defaults still inject it (Nestiko toolbar replaces exports). */
.tax-report-page .dataTables_wrapper .dt-buttons {
    display: none !important;
}

/* GST Sales / GST Purchase reports — stats, filters, toolbar alignment */
.gst-sales-report-page .users-view-toolbar,
.gst-purchase-report-page .users-view-toolbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem 1.25rem;
}

.gst-sales-report-page .users-view-toolbar > div:first-child,
.gst-purchase-report-page .users-view-toolbar > div:first-child {
    flex: 1 1 16rem;
    min-width: 0;
}

.gst-sales-report-page .gst-sales-report-page-copy,
.gst-purchase-report-page .gst-purchase-report-page-copy {
    margin-bottom: 0;
}

.gst-sales-report-page .users-stats,
.gst-purchase-report-page .users-stats {
    grid-template-columns: repeat(auto-fill, minmax(10.25rem, 1fr));
}

@media (min-width: 992px) {
    .gst-sales-report-page .users-stats,
    .gst-purchase-report-page .users-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.gst-sales-report-page .users-stat-card,
.gst-purchase-report-page .users-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 4.5rem;
}

.gst-sales-report-page .gst-sales-report-filters-section,
.gst-purchase-report-page .gst-purchase-report-filters-section {
    margin-bottom: 1rem;
}

.gst-sales-report-page .gst-sales-report-panel .users-table-controls__tools-inner,
.gst-purchase-report-page .gst-purchase-report-panel .users-table-controls__tools-inner {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    justify-content: flex-end;
}

.gst-sales-report-page .gst-sales-report-panel .roles-dt-tools-host,
.gst-purchase-report-page .gst-purchase-report-panel .roles-dt-tools-host {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.45rem;
}

.gst-sales-report-page .gst-sales-report-panel .std-dt-toolbar,
.gst-purchase-report-page .gst-purchase-report-panel .std-dt-toolbar {
    flex: 1 1 auto;
    min-width: 0;
}

.gst-sales-report-page .dataTables_wrapper .dt-buttons,
.gst-purchase-report-page .dataTables_wrapper .dt-buttons {
    display: none !important;
}

/* Shared filters component — expanded on desktop (see filters.blade.php), Nestiko spacing */
.nestiko-filters-panel {
    margin-bottom: 1rem;
}

.nestiko-filters-panel__head {
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.nestiko-filters-panel__head .box-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.nestiko-filters-panel__head .box-title a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-primary, #0f172a);
    text-decoration: none;
}

.nestiko-filters-panel__head .box-title a:hover {
    color: #8351ec;
}

.nestiko-filters-panel__body .box-body {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Customers & Suppliers report */
.contact-report-page .users-view-toolbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem 1.25rem;
}

.contact-report-page .users-view-toolbar > div:first-child {
    flex: 1 1 16rem;
    min-width: 0;
}

.contact-report-page .contact-report-page-copy {
    margin-bottom: 0;
}

.contact-report-page .contact-report-users-stats {
    grid-template-columns: repeat(auto-fill, minmax(10.25rem, 1fr));
}

@media (min-width: 992px) {
    .contact-report-page .contact-report-users-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.contact-report-page .contact-report-users-stats .users-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 4.5rem;
}

.contact-report-page .contact-report-filters-section {
    margin-bottom: 0.25rem;
}

.contact-report-page .contact-report-panel .users-table-controls__tools-inner {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    justify-content: flex-end;
}

.contact-report-page .contact-report-panel .roles-dt-tools-host {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.45rem;
}

.contact-report-page .contact-report-panel .std-dt-toolbar {
    flex: 1 1 auto;
    min-width: 0;
}

.contact-report-page .dataTables_wrapper .dt-buttons {
    display: none !important;
}

/* Customer groups report */
.customer-group-report-page .users-view-toolbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem 1.25rem;
}

.customer-group-report-page .users-view-toolbar > div:first-child {
    flex: 1 1 16rem;
    min-width: 0;
}

.customer-group-report-page .customer-group-report-users-stats {
    grid-template-columns: repeat(auto-fill, minmax(10.25rem, 1fr));
}

@media (min-width: 992px) {
    .customer-group-report-page .customer-group-report-users-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.customer-group-report-page .customer-group-report-users-stats .users-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 4.5rem;
}

.customer-group-report-page .customer-group-report-filters-section {
    margin-bottom: 0.25rem;
}

.customer-group-report-page .customer-group-report-panel .users-table-controls__tools-inner {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    justify-content: flex-end;
}

.customer-group-report-page .customer-group-report-panel .roles-dt-tools-host {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.45rem;
}

.customer-group-report-page .customer-group-report-panel .std-dt-toolbar {
    flex: 1 1 auto;
    min-width: 0;
}

.customer-group-report-page .dataTables_wrapper .dt-buttons {
    display: none !important;
}

/* Stock report — stats, filters, closing summary, table toolbar */
.stock-report-page .users-view-toolbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem 1.25rem;
}

.stock-report-page .users-view-toolbar > div:first-child {
    flex: 1 1 16rem;
    min-width: 0;
}

.stock-report-page .stock-report-page-copy {
    margin-bottom: 0;
}

.stock-report-page .stock-report-users-stats {
    grid-template-columns: repeat(auto-fill, minmax(10.25rem, 1fr));
}

@media (min-width: 992px) {
    .stock-report-page .stock-report-users-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.stock-report-page .stock-report-users-stats .users-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 4.5rem;
}

.stock-report-page .stock-report-filters-section {
    margin-bottom: 0.25rem;
}

.stock-report-page .nestiko-filters-panel__head {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.stock-report-page .nestiko-filters-panel__head .box-title {
    font-size: 0.9rem;
}

.stock-report-page .stock-report-summary-panel .table-responsive {
    padding: 0.5rem 0.85rem 0.85rem;
}

.stock-report-page .stock-report-panel .users-table-controls__tools-inner {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    justify-content: flex-end;
}

.stock-report-page .stock-report-panel .roles-dt-tools-host {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.45rem;
}

.stock-report-page .stock-report-panel .std-dt-toolbar {
    flex: 1 1 auto;
    min-width: 0;
}

.stock-report-page .dataTables_wrapper .dt-buttons {
    display: none !important;
}

/* Reports: suppress default DataTables Buttons when Nestiko toolbar is used (report.js uses dom without B). */
.manage-users-content .users-page.roles-page[class$='-report-page'] .dataTables_wrapper .dt-buttons,
.manage-users-content .users-page.roles-page.product-stock-details-page .dataTables_wrapper .dt-buttons {
    display: none !important;
}

/* Shared Nestiko report shell — title row, toolbar, filters spacing (page-specific stats grids remain below) */
.manage-users-content .users-page.roles-page[class$='-report-page'] .users-view-toolbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem 1.25rem;
}

.manage-users-content .users-page.roles-page[class$='-report-page'] .users-view-toolbar > div:first-child {
    flex: 1 1 16rem;
    min-width: 0;
}

.manage-users-content .users-page.roles-page[class$='-report-page'] .users-edit-page-heading p:last-of-type {
    margin-bottom: 0;
}

.manage-users-content .users-page.roles-page[class$='-report-page'] .users-table-controls__tools-inner {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    justify-content: flex-end;
}

.manage-users-content .users-page.roles-page[class$='-report-page'] .roles-dt-tools-host {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.45rem;
}

.manage-users-content .users-page.roles-page[class$='-report-page'] .users-panel .std-dt-toolbar {
    flex: 1 1 auto;
    min-width: 0;
}

.manage-users-content .users-page.roles-page[class$='-report-page'] .nestiko-filters-panel {
    margin-bottom: 1rem;
}

/* Report 606 / 607 — Transaction purchase & sale */
.transaction-purchase-report-page .transaction-purchase-report-users-stats,
.transaction-sale-report-page .transaction-sale-report-users-stats {
    grid-template-columns: repeat(auto-fill, minmax(10.25rem, 1fr));
}

@media (min-width: 992px) {
    .transaction-purchase-report-page .transaction-purchase-report-users-stats,
    .transaction-sale-report-page .transaction-sale-report-users-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.transaction-purchase-report-page .transaction-purchase-report-users-stats .users-stat-card,
.transaction-sale-report-page .transaction-sale-report-users-stats .users-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 4.5rem;
}

.transaction-purchase-report-page .transaction-purchase-report-filters-section,
.transaction-sale-report-page .transaction-sale-report-filters-section {
    margin-bottom: 0.25rem;
}

/* Payment account report (account_reports) */
.payment-account-report-page .payment-account-report-users-stats {
    grid-template-columns: repeat(auto-fill, minmax(10.25rem, 1fr));
}

@media (min-width: 992px) {
    .payment-account-report-page .payment-account-report-users-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.payment-account-report-page .payment-account-report-users-stats .users-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 4.5rem;
}

.payment-account-report-page .payment-account-report-filters-section {
    margin-bottom: 0.25rem;
}

.payment-account-report-page .dataTables_wrapper .dt-buttons {
    display: none !important;
}

/* Product sell report — 4-up stats */
.product-sell-report-page .product-sell-report-users-stats {
    grid-template-columns: repeat(auto-fill, minmax(10.25rem, 1fr));
}

@media (min-width: 992px) {
    .product-sell-report-page .product-sell-report-users-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.product-sell-report-page .product-sell-report-users-stats .users-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 4.5rem;
}

.product-sell-report-page .product-sell-report-filters-section {
    margin-bottom: 0.25rem;
}

/* Profit / Loss — stats (2 cards) */
.profit-loss-report-page .profit-loss-report-users-stats {
    grid-template-columns: repeat(auto-fill, minmax(10.25rem, 1fr));
}

@media (min-width: 992px) {
    .profit-loss-report-page .profit-loss-report-users-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.profit-loss-report-page .profit-loss-report-users-stats .users-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 4.5rem;
}

/* Trending products report */
.trending-products-report-page .trending-products-report-users-stats {
    grid-template-columns: repeat(auto-fill, minmax(10.25rem, 1fr));
}

@media (min-width: 992px) {
    .trending-products-report-page .trending-products-report-users-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.trending-products-report-page .trending-products-report-users-stats .users-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 4.5rem;
}

.trending-products-report-page .trending-products-report-filters-section {
    margin-bottom: 0.25rem;
}

/* Stock adjustment report */
.stock-adjustment-report-page .stock-adjustment-report-users-stats {
    grid-template-columns: repeat(auto-fill, minmax(10.25rem, 1fr));
}

@media (min-width: 992px) {
    .stock-adjustment-report-page .stock-adjustment-report-users-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.stock-adjustment-report-page .stock-adjustment-report-users-stats .users-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 4.5rem;
}

.stock-adjustment-report-page .stock-adjustment-report-filters-section {
    margin-bottom: 0.25rem;
}

/* Product stock details (report-style; shell class ends with -details-page) */
.product-stock-details-page .product-stock-details-users-stats {
    grid-template-columns: repeat(auto-fill, minmax(10.25rem, 1fr));
}

@media (min-width: 992px) {
    .product-stock-details-page .product-stock-details-users-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.product-stock-details-page .product-stock-details-users-stats .users-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 4.5rem;
}

.product-stock-details-page .product-stock-details-filters-section {
    margin-bottom: 0.25rem;
}

.manage-users-content .users-page.roles-page.product-stock-details-page .nestiko-filters-panel {
    margin-bottom: 1rem;
}

/* Cash flow (account) */
.cash-flow-page .cash-flow-users-stats {
    grid-template-columns: repeat(auto-fill, minmax(10.25rem, 1fr));
}

@media (min-width: 992px) {
    .cash-flow-page .cash-flow-users-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.cash-flow-page .cash-flow-users-stats .users-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 4.5rem;
}

.cash-flow-page .cash-flow-filters-section {
    margin-bottom: 0.25rem;
}

/* Balance sheet & trial balance (account reports) */
.balance-sheet-page .balance-sheet-users-stats,
.trial-balance-page .trial-balance-users-stats {
    grid-template-columns: repeat(auto-fill, minmax(10.25rem, 1fr));
}

@media (min-width: 992px) {
    .balance-sheet-page .balance-sheet-users-stats,
    .trial-balance-page .trial-balance-users-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.balance-sheet-page .balance-sheet-users-stats .users-stat-card,
.trial-balance-page .trial-balance-users-stats .users-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 4.5rem;
}

.balance-sheet-page .balance-sheet-filters-section,
.trial-balance-page .trial-balance-filters-section {
    margin-bottom: 0.25rem;
}

/* Account book (ledger for one account) */
.account-book-page .account-book-users-stats {
    grid-template-columns: repeat(auto-fill, minmax(10.25rem, 1fr));
}

@media (min-width: 992px) {
    .account-book-page .account-book-users-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.account-book-page .account-book-users-stats .users-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 4.5rem;
}

.account-book-page .account-book-filters-section {
    margin-bottom: 0.25rem;
}

.manage-users-content .users-page.roles-page.account-book-page .nestiko-filters-panel {
    margin-bottom: 1rem;
}

.account-book-page .dataTables_wrapper .dt-buttons {
    display: none !important;
}

/* Payment accounts list */
.payment-accounts-page .payment-accounts-users-stats {
    grid-template-columns: repeat(auto-fill, minmax(10.25rem, 1fr));
}

@media (min-width: 992px) {
    .payment-accounts-page .payment-accounts-users-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.payment-accounts-page .payment-accounts-users-stats .users-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 4.5rem;
}

.payment-accounts-page .payment-accounts-filters-section {
    margin-bottom: 0.25rem;
}

.manage-users-content .users-page.roles-page.payment-accounts-page .nestiko-filters-panel {
    margin-bottom: 1rem;
}

.payment-accounts-page .dataTables_wrapper .dt-buttons {
    display: none !important;
}

/* Contact detail — reward log / supplier stock / ledger tables (no duplicate DataTables Buttons vs Nestiko) */
.contacts-page.contact-view-page .dataTables_wrapper .dt-buttons {
    display: none !important;
}

/* Product stock history (AJAX-loaded movement table) */
.products-stock-history-page .dataTables_wrapper .dt-buttons {
    display: none !important;
}

.products-stock-history-page .products-stock-history-users-stats {
    grid-template-columns: repeat(auto-fill, minmax(10.25rem, 1fr));
}

@media (min-width: 992px) {
    .products-stock-history-page .products-stock-history-users-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.products-stock-history-page .products-stock-history-users-stats .users-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 4.5rem;
}

/* Purchase / sell / sales order / sell return lists — filter panel spacing + hide stray DataTables Buttons when Nestiko std-dt-toolbar is used */
.purchases-page .purchases-filters-section,
.sells-page .sells-filters-section,
.sales-orders-page .sales-orders-filters-section,
.sell-return-list-page .sell-return-filters-section {
    margin-bottom: 0.25rem;
}

.manage-users-content .purchases-page .nestiko-filters-panel,
.manage-users-content .sells-page .nestiko-filters-panel,
.manage-users-content .sales-orders-page .nestiko-filters-panel,
.manage-users-content .sell-return-list-page .nestiko-filters-panel {
    margin-bottom: 1rem;
}

.manage-users-content .purchases-page .dataTables_wrapper .dt-buttons,
.manage-users-content .sells-page .dataTables_wrapper .dt-buttons,
.manage-users-content .sales-orders-page .dataTables_wrapper .dt-buttons,
.manage-users-content .sell-return-list-page .dataTables_wrapper .dt-buttons {
    display: none !important;
}

/* POS / drafts / quotations / shipments — collapsible filter panels */
.sale-pos-filters-section,
.shipments-filters-section,
.draft-sales-filters-section,
.quotations-filters-section {
    margin-bottom: 0.25rem;
}

.sale-pos-filters-section .nestiko-filters-panel,
.shipments-filters-section .nestiko-filters-panel,
.draft-sales-filters-section .nestiko-filters-panel,
.quotations-filters-section .nestiko-filters-panel {
    margin-bottom: 1rem;
}

/* Superadmin — business & subscription lists (filters + DataTables) */
.superadmin-business-filters-section,
.superadmin-subscription-filters-section {
    margin-bottom: 0.25rem;
}

.superadmin-business-filters-section .nestiko-filters-panel,
.superadmin-subscription-filters-section .nestiko-filters-panel {
    margin-bottom: 1rem;
}

/* Register report table: global datatables-loader.css handles .dataTables_processing overlay */

/* —— Register report: page intro + KPI cards —— */
.register-report-page {
    gap: 1rem;
}

/* Page title row: flat on the shell — no inset card (avoids dark-mode strip behind intro/toolbar). */
.nestiko-shell-page-intro {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    padding: 1.15rem 1.25rem 1.2rem;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    position: relative;
    overflow: visible;
}

.nestiko-shell-page-intro::before {
    content: none;
    display: none;
}

.nestiko-shell-page-intro__main {
    flex: 1 1 16rem;
    min-width: 0;
    position: relative;
    z-index: 1;
    padding-left: 0;
}

.nestiko-shell-page-intro__crumb {
    margin: 0 0 0.45rem;
}

.nestiko-shell-page-intro__crumb-sep {
    margin: 0 0.28rem;
    opacity: 0.55;
}

.nestiko-shell-page-intro__title {
    margin: 0 0 0.35rem;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--text-primary, #0f172a);
}

.nestiko-shell-page-intro__title-with-help {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin: 0 0 0.35rem;
}

.nestiko-shell-page-intro__title-with-help .nestiko-shell-page-intro__title {
    margin: 0;
}

.nestiko-shell-page-intro__lede {
    margin: 0;
    /* Fill .nestiko-shell-page-intro__main so copy can use space up to the actions column (was max-width: 40rem → awkward 2-line wraps). */
    max-width: none;
    width: 100%;
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--text-muted, #64748b);
}

.nestiko-shell-page-intro__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    z-index: 1;
}

.nestiko-shell-page-intro__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.35rem;
    padding: 0.45rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 0.5rem;
    line-height: 1.2;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
}

.nestiko-shell-page-intro__btn .ti {
    font-size: 1.05rem;
    opacity: 0.92;
}

.nestiko-shell-page-intro__btn--ghost {
    background: var(--bg-surface, #fff);
    border-color: var(--border-default, #e2e8f0);
    color: var(--text-primary, #1e293b);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.nestiko-shell-page-intro__btn--ghost:hover,
.nestiko-shell-page-intro__btn--ghost:focus {
    background: var(--bg-surface-soft, #f8fafc);
    border-color: var(--border-strong, #cbd5e1);
    color: var(--text-primary, #0f172a);
}

.nestiko-shell-page-intro__btn--primary {
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent-primary, #8351ec) 100%, #000) 0%, var(--accent-primary, #8351ec) 100%);
    border-color: color-mix(in srgb, var(--accent-primary, #8351ec) 88%, #1e1b4b);
    color: #fff;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--accent-primary, #8351ec) 35%, transparent);
}

.nestiko-shell-page-intro__btn--primary:hover,
.nestiko-shell-page-intro__btn--primary:focus {
    filter: brightness(1.05);
    color: #fff;
    text-decoration: none;
}

/* KPI strip: always one horizontal row (4–5 cards); narrow screens scroll horizontally */
.nestiko-shell-kpis {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 2px;
}

.nestiko-shell-kpis .nestiko-shell-kpi {
    flex: 1 1 0;
    min-width: 8.75rem;
    max-width: none;
}

.nestiko-shell-kpi {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface, #ffffff);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition:
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.nestiko-shell-kpi:hover {
    border-color: color-mix(in srgb, var(--accent-primary, #8351ec) 28%, var(--border-default, #e2e8f0));
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.nestiko-shell-kpi__icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.65rem;
    background: color-mix(in srgb, var(--accent-primary, #8351ec) 12%, transparent);
    color: var(--accent-primary, #8351ec);
    font-size: 1.2rem;
}

.nestiko-shell-kpi__icon--amber {
    background: color-mix(in srgb, #f59e0b 14%, transparent);
    color: #d97706;
}

.nestiko-shell-kpi__icon--violet {
    background: color-mix(in srgb, #8b5cf6 14%, transparent);
    color: #7c3aed;
}

.nestiko-shell-kpi__icon--emerald {
    background: color-mix(in srgb, #10b981 14%, transparent);
    color: #059669;
}

.nestiko-shell-kpi__body {
    min-width: 0;
}

.nestiko-shell-kpi__label {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.nestiko-shell-kpi__value {
    margin: 0.2rem 0 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text-primary, #0f172a);
}

.nestiko-shell-kpi__value--currency {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0d9488;
}

:root[data-theme='dark'] .nestiko-shell-kpi__value--currency {
    color: #5eead4;
}

/* Filters panel: duplicate title hidden — intro row has Filters + Add */
.register-report-page .register-report-filters-section .nestiko-filters-panel__head {
    display: none !important;
}

.register-report-page .register-report-filters-section .nestiko-filters-panel__body {
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
}

:root[data-theme='dark'] .nestiko-shell-page-intro {
    background: transparent;
    border: none;
    box-shadow: none;
}

:root[data-theme='dark'] .nestiko-shell-page-intro__title {
    color: var(--text-primary, #f1f5f9);
}

:root[data-theme='dark'] .nestiko-shell-page-intro__lede {
    color: var(--text-muted, #94a3b8);
}

:root[data-theme='dark'] .nestiko-shell-page-intro__btn--ghost {
    background: rgba(30, 41, 59, 0.65);
    border-color: var(--border-default, #334155);
    color: var(--text-primary, #e2e8f0);
}

:root[data-theme='dark'] .nestiko-shell-page-intro__btn--ghost:hover,
:root[data-theme='dark'] .nestiko-shell-page-intro__btn--ghost:focus {
    background: rgba(51, 65, 85, 0.75);
    border-color: var(--border-strong, #475569);
}

:root[data-theme='dark'] .nestiko-shell-kpi {
    background: var(--bg-surface, #0f172a);
    border-color: var(--border-default, #334155);
}

:root[data-theme='dark'] .nestiko-shell-kpi:hover {
    border-color: color-mix(in srgb, var(--accent-primary, #a78bfa) 35%, var(--border-default, #334155));
}

:root[data-theme='dark'] .nestiko-shell-kpi__value {
    color: var(--text-primary, #f1f5f9);
}

/* —— Global list pages: tighter shell + stat “KPI” cards + intro row (crumb + toolbar) —— */

/* Stat cards: icon column + stacked label/value (::before + two <p> must use grid, not row flex) */
.manage-users-content .users-stats .users-stat-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 0.75rem;
    row-gap: 0.15rem;
    align-items: start;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    min-width: 0;
    transition:
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.manage-users-content .users-stats .users-stat-card:hover {
    border-color: color-mix(in srgb, var(--accent-primary, #8351ec) 28%, var(--border-default, #e2e8f0));
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.manage-users-content .users-stats .users-stat-card::before {
    content: '';
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    background-color: color-mix(in srgb, var(--accent-primary, #8351ec) 12%, transparent);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 1.2rem 1.2rem;
}

.manage-users-content .users-stats .users-stat-card .users-stat-label {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}

.manage-users-content .users-stats .users-stat-card .users-stat-value {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary, #0f172a);
}

/* Repeating palette for 1…4+ cards per row */
.manage-users-content .users-stats .users-stat-card:nth-child(4n + 1)::before {
    background-color: color-mix(in srgb, var(--accent-primary, #8351ec) 12%, transparent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%237c3aed' d='M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5s-3 1.34-3 3 1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z'/%3E%3C/svg%3E");
}

.manage-users-content .users-stats .users-stat-card:nth-child(4n + 2)::before {
    background-color: color-mix(in srgb, #10b981 14%, transparent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23059669' d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E");
}

.manage-users-content .users-stats .users-stat-card:nth-child(4n + 3)::before {
    background-color: color-mix(in srgb, #f59e0b 14%, transparent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23d97706' d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7v-7zm4-3h2v10h-2V7zm4 3h2v7h-2v-7z'/%3E%3C/svg%3E");
}

.manage-users-content .users-stats .users-stat-card:nth-child(4n + 4)::before {
    background-color: color-mix(in srgb, #8b5cf6 14%, transparent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%237c3aed' d='M21 18v1c0 1.1-.9 2-2 2H5c-1.11 0-2-.9-2-2V5c0-1.1.89-2 2-2h14c1.1 0 2 .9 2 2v1h-9c-1.11 0-2 .9-2 2v8c0 1.1.89 2 2 2h9zm-9-2h10V8H12v8zm4-2.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z'/%3E%3C/svg%3E");
}

:root[data-theme='dark'] .manage-users-content .users-stats .users-stat-card {
    background: var(--bg-surface, #0f172a);
    border-color: var(--border-default, #334155);
}

:root[data-theme='dark'] .manage-users-content .users-stats .users-stat-card:hover {
    border-color: color-mix(in srgb, var(--accent-primary, #a78bfa) 35%, var(--border-default, #334155));
}

:root[data-theme='dark'] .manage-users-content .users-stats .users-stat-card .users-stat-value {
    color: var(--text-primary, #f1f5f9);
}

:root[data-theme='dark'] .manage-users-content .users-stats .users-stat-card .users-stat-label {
    color: var(--text-muted, #94a3b8);
}

/*
 * List pages with: crumb + users-toolbar-row (no users-view-toolbar, no nestiko-shell intro).
 * Mobile: crumb then toolbar (right). Desktop: same row.
 */
.manage-users-content .users-page:not(:has(.nestiko-shell-page-intro)):has(> .users-toolbar-row):not(:has(> .users-view-toolbar)) {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.manage-users-content .users-page:not(:has(.nestiko-shell-page-intro)):has(> .users-toolbar-row):not(:has(> .users-view-toolbar)) > .users-page-crumb {
    order: 1;
    margin: 0;
}

.manage-users-content .users-page:not(:has(.nestiko-shell-page-intro)):has(> .users-toolbar-row):not(:has(> .users-view-toolbar)) > .users-toolbar-row {
    order: 2;
    align-self: flex-end;
    margin: 0;
}

.manage-users-content .users-page:not(:has(.nestiko-shell-page-intro)):has(> .users-toolbar-row):not(:has(> .users-view-toolbar)) > .users-flash {
    order: 3;
}

.manage-users-content .users-page:not(:has(.nestiko-shell-page-intro)):has(> .users-toolbar-row):not(:has(> .users-view-toolbar)) > .users-stats {
    order: 4;
}

.manage-users-content .users-page:not(:has(.nestiko-shell-page-intro)):has(> .users-toolbar-row):not(:has(> .users-view-toolbar)) > .users-panel,
.manage-users-content .users-page:not(:has(.nestiko-shell-page-intro)):has(> .users-toolbar-row):not(:has(> .users-view-toolbar)) > .roles-panel {
    order: 5;
}

/* Tabs, modals hosts, etc. (e.g. products list) — must follow KPI row (default order 0 would jump above the title) */
.manage-users-content .users-page:not(:has(.nestiko-shell-page-intro)):has(> .users-toolbar-row):not(:has(> .users-view-toolbar)) > *:not(.users-page-crumb):not(.users-toolbar-row):not(.users-flash):not(.users-stats):not(.users-panel):not(.roles-panel) {
    order: 6;
}

@media (min-width: 641px) {
    .manage-users-content .users-page:not(:has(.nestiko-shell-page-intro)):has(> .users-toolbar-row):not(:has(> .users-view-toolbar)) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 0.85rem;
        row-gap: 0.5rem;
        align-items: center;
    }

    .manage-users-content .users-page:not(:has(.nestiko-shell-page-intro)):has(> .users-toolbar-row):not(:has(> .users-view-toolbar)) > *:not(.users-page-crumb):not(.users-toolbar-row) {
        grid-column: 1 / -1;
    }

    .manage-users-content .users-page:not(:has(.nestiko-shell-page-intro)):has(> .users-toolbar-row):not(:has(> .users-view-toolbar)) > .users-page-crumb {
        order: unset;
        grid-column: 1;
        grid-row: 1;
        font-size: 0.82rem;
        font-weight: 600;
    }

    .manage-users-content .users-page:not(:has(.nestiko-shell-page-intro)):has(> .users-toolbar-row):not(:has(> .users-view-toolbar)) > .users-toolbar-row {
        order: unset;
        grid-column: 2;
        grid-row: 1;
        align-self: center;
    }
}

/*
 * Title row toolbar: flat on the shell (no inset card).
 * View User uses plain `.users-view-toolbar`; other pages use `.users-edit-page-heading` — both must stay transparent.
 * Bundled CSS uses `.content-wrap [class*=toolbar]` — that matches `users-view-toolbar` and in dark mode wins over a
 * plain class chain; `#scrollable-container.content-wrap` raises specificity so transparent !important applies.
 */
.manage-users-content .users-page > .users-view-toolbar {
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
}

:root[data-theme='dark'] #scrollable-container.content-wrap .manage-users-content .users-page > .users-view-toolbar {
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
}

.manage-users-content .users-page > .users-view-toolbar.users-edit-page-heading {
    padding: 0;
    border-radius: 0;
    margin-bottom: 0;
    gap: 0.75rem;
}

/* .users-stats on list/import pages: same single-row KPI strip as .nestiko-shell-kpis (overrides grid breakpoints) */
.manage-users-content .users-stats {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
    gap: 0.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 2px;
}

.manage-users-content .users-stats > .users-stat-card {
    flex: 1 1 0;
    min-width: 8.75rem;
    max-width: none;
    box-sizing: border-box;
}

/* Superadmin — tenant overview (/superadmin) */
.superadmin-overview-page .nestiko-shell-page-intro {
    margin-bottom: 0.75rem;
}

.superadmin-overview-page .nestiko-shell-page-intro__actions.superadmin-overview-date-filters {
    align-items: flex-start;
}

/* Superadmin dashboard: pill-style period selector (replaces Bootstrap btn-group) */
.superadmin-date-segment {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem;
    padding: 0.28rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border-default, #e2e8f0) 45%, transparent);
    border: 1px solid var(--border-default, #e2e8f0);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.superadmin-date-segment__btn {
    position: relative;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.superadmin-date-segment__btn input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.superadmin-date-segment__label {
    display: block;
    padding: 0.42rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
    color: var(--text-secondary, #475569);
    transition:
        color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.superadmin-date-segment__btn:hover .superadmin-date-segment__label {
    color: var(--text-primary, #0f172a);
    background: rgba(255, 255, 255, 0.65);
}

.superadmin-date-segment__btn input:focus-visible + .superadmin-date-segment__label {
    outline: 2px solid color-mix(in srgb, var(--accent-primary, #8351ec) 55%, transparent);
    outline-offset: 2px;
}

.superadmin-date-segment__btn input:checked + .superadmin-date-segment__label {
    color: #fff;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--accent-primary, #8351ec) 92%, #000) 0%,
        var(--accent-primary, #8351ec) 100%
    );
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.12),
        0 2px 8px color-mix(in srgb, var(--accent-primary, #8351ec) 28%, transparent);
}

:root[data-theme='dark'] .superadmin-date-segment {
    background: rgba(30, 41, 59, 0.55);
    border-color: var(--border-default, #334155);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme='dark'] .superadmin-date-segment__label {
    color: var(--text-muted, #94a3b8);
}

:root[data-theme='dark'] .superadmin-date-segment__btn:hover .superadmin-date-segment__label {
    color: var(--text-primary, #e2e8f0);
    background: rgba(51, 65, 85, 0.55);
}

:root[data-theme='dark'] .superadmin-date-segment__btn input:checked + .superadmin-date-segment__label {
    color: #fff;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--accent-primary, #a78bfa) 88%, #1e1b4b) 0%,
        color-mix(in srgb, var(--accent-primary, #a78bfa) 65%, #312e81) 100%
    );
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.35),
        0 2px 10px color-mix(in srgb, var(--accent-primary, #a78bfa) 32%, transparent);
}

.superadmin-overview-kpis {
    margin-bottom: 1rem;
}

.superadmin-overview-kpi-link {
    margin-top: 0.35rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.superadmin-overview-chart-panel {
    margin-bottom: 0;
}

.superadmin-overview-chart-head p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.superadmin-overview-chart-head-ic {
    font-size: 1.15rem;
    opacity: 0.85;
}

.superadmin-overview-chart-wrap {
    padding: 0.75rem 1rem 1rem;
    min-width: 0;
    overflow-x: auto;
    background: transparent;
}

.superadmin-overview-chart-wrap .highcharts-container {
    border-radius: 0.5rem;
    overflow: hidden;
}

/* Highcharts: blend with Nestiko panel (fixes harsh white block in dark mode) */
.superadmin-overview-chart-wrap .highcharts-background {
    fill: transparent !important;
}

.superadmin-overview-chart-wrap .highcharts-plot-background {
    fill: transparent !important;
}

.superadmin-overview-chart-wrap .highcharts-grid-line {
    stroke: rgba(148, 163, 184, 0.22);
}

:root[data-theme='dark'] .superadmin-overview-chart-wrap .highcharts-axis-labels text,
:root[data-theme='dark'] .superadmin-overview-chart-wrap .highcharts-yaxis-labels text,
:root[data-theme='dark'] .superadmin-overview-chart-wrap .highcharts-xaxis-labels text {
    fill: var(--text-muted, #94a3b8) !important;
}

:root[data-theme='dark'] .superadmin-overview-chart-wrap .highcharts-axis-title,
:root[data-theme='dark'] .superadmin-overview-chart-wrap .highcharts-yaxis .highcharts-axis-title {
    fill: var(--text-muted, #94a3b8) !important;
}

:root[data-theme='dark'] .superadmin-overview-chart-wrap .highcharts-legend-item text {
    fill: var(--text-secondary, #cbd5e1) !important;
}

:root[data-theme='dark'] .superadmin-overview-chart-wrap .highcharts-legend-item:hover text {
    fill: var(--text-primary, #f1f5f9) !important;
}

:root[data-theme='dark'] .superadmin-overview-chart-wrap .highcharts-tick,
:root[data-theme='dark'] .superadmin-overview-chart-wrap .highcharts-axis-line {
    stroke: var(--border-default, #334155) !important;
}

:root[data-theme='dark'] .superadmin-overview-chart-wrap .highcharts-grid-line {
    stroke: rgba(148, 163, 184, 0.12) !important;
}

:root[data-theme='dark'] .superadmin-overview-chart-panel .users-panel-head p {
    color: var(--text-secondary, #cbd5e1);
}

/* Superadmin module: DataTables pages — intro spacing + toolbar (class on page root: .superadmin-module-dt) */
.superadmin-module-dt .nestiko-shell-page-intro {
    margin-bottom: 0.75rem;
}

.superadmin-business-filters-pop-panel {
    min-width: min(42rem, calc(100vw - 2rem));
}

.superadmin-business-filters-pop-actions {
    margin-top: 0.65rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
}

.superadmin-business-panel .users-table-wrap {
    padding: 0;
}

/* Superadmin module: DataTables toolbar + export buttons (align + dark mode) */
.superadmin-module-dt .superadmin-business-dt-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.superadmin-module-dt .superadmin-business-dt-length {
    flex: 0 0 auto;
    min-width: min(100%, 12rem);
}

.superadmin-module-dt .superadmin-business-dt-buttons {
    flex: 1 1 14rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
}

.superadmin-module-dt .superadmin-business-dt-buttons .dt-buttons,
.superadmin-module-dt .superadmin-business-dt-buttons .dt-buttons.dt-native-buttons {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 !important;
    float: none !important;
}

.superadmin-module-dt .superadmin-business-dt-filter {
    flex: 0 0 auto;
    margin-left: auto;
}

.superadmin-module-dt .superadmin-business-dt-toolbar .dataTables_length,
.superadmin-module-dt .superadmin-business-dt-toolbar .dataTables_filter {
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.superadmin-module-dt .superadmin-business-dt-toolbar .dataTables_length label,
.superadmin-module-dt .superadmin-business-dt-toolbar .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
}

.superadmin-module-dt .superadmin-business-dt-toolbar .dataTables_length select,
.superadmin-module-dt .superadmin-business-dt-toolbar .dataTables_filter input {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.45rem;
    padding: 0.28rem 0.45rem;
    font-size: 0.8rem;
    background: var(--bg-surface, #fff);
    color: var(--text-primary, #0f172a);
    min-height: 2rem;
}

/* Override app.css hardcoded white on export buttons for this page */
.superadmin-module-dt .dataTables_wrapper .dt-buttons .dt-button,
.superadmin-module-dt .dataTables_wrapper .dt-buttons a.dt-button,
.superadmin-module-dt .dataTables_wrapper .dt-buttons button.dt-button,
.superadmin-module-dt .dataTables_wrapper .dt-buttons .dt-native-btn,
.superadmin-module-dt .dataTables_wrapper .dt-buttons a.dt-native-btn,
.superadmin-module-dt .dataTables_wrapper .dt-buttons button.dt-native-btn {
    background: var(--bg-surface, #fff) !important;
    border-color: var(--border-default, #e2e8f0) !important;
    color: var(--text-primary, #1e293b) !important;
}

.superadmin-module-dt .dataTables_wrapper .dt-buttons .dt-button:hover,
.superadmin-module-dt .dataTables_wrapper .dt-buttons .dt-button:focus,
.superadmin-module-dt .dataTables_wrapper .dt-buttons .dt-native-btn:hover,
.superadmin-module-dt .dataTables_wrapper .dt-buttons .dt-native-btn:focus {
    background: var(--bg-surface-soft, #f8fafc) !important;
    border-color: var(--border-strong, #cbd5e1) !important;
    color: var(--text-primary, #0f172a) !important;
}

.superadmin-module-dt .roles-dt-bottom {
    width: 100%;
    box-sizing: border-box;
}

.superadmin-module-dt .roles-dt-bottom .dataTables_paginate {
    margin-left: auto !important;
}

:root[data-theme='dark'] .superadmin-module-dt .superadmin-business-dt-toolbar {
    background: rgba(255, 255, 255, 0.04);
    border-bottom-color: var(--border-default, #22314d);
}

:root[data-theme='dark'] .superadmin-module-dt .superadmin-business-dt-toolbar .dataTables_length select,
:root[data-theme='dark'] .superadmin-module-dt .superadmin-business-dt-toolbar .dataTables_filter input {
    background: #1a2740;
    border-color: #334866;
    color: #e2e8f0;
}

:root[data-theme='dark'] .superadmin-module-dt .superadmin-business-dt-toolbar .dataTables_length label,
:root[data-theme='dark'] .superadmin-module-dt .superadmin-business-dt-toolbar .dataTables_filter label {
    color: var(--text-muted, #94a3b8);
}

:root[data-theme='dark'] .superadmin-module-dt .dataTables_wrapper .dt-buttons .dt-button,
:root[data-theme='dark'] .superadmin-module-dt .dataTables_wrapper .dt-buttons a.dt-button,
:root[data-theme='dark'] .superadmin-module-dt .dataTables_wrapper .dt-buttons button.dt-button,
:root[data-theme='dark'] .superadmin-module-dt .dataTables_wrapper .dt-buttons .dt-native-btn,
:root[data-theme='dark'] .superadmin-module-dt .dataTables_wrapper .dt-buttons a.dt-native-btn,
:root[data-theme='dark'] .superadmin-module-dt .dataTables_wrapper .dt-buttons button.dt-native-btn {
    background: var(--bg-surface-soft, #1a2740) !important;
    border-color: var(--border-strong, #334866) !important;
    color: var(--text-primary, #e2e8f0) !important;
}

:root[data-theme='dark'] .superadmin-module-dt .dataTables_wrapper .dt-buttons .dt-button:hover,
:root[data-theme='dark'] .superadmin-module-dt .dataTables_wrapper .dt-buttons .dt-button:focus,
:root[data-theme='dark'] .superadmin-module-dt .dataTables_wrapper .dt-buttons .dt-native-btn:hover,
:root[data-theme='dark'] .superadmin-module-dt .dataTables_wrapper .dt-buttons .dt-native-btn:focus {
    background: rgba(51, 65, 85, 0.55) !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

:root[data-theme='dark'] .superadmin-module-dt ul.dt-button-collection {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-default, #334155);
}

:root[data-theme='dark'] .superadmin-module-dt ul.dt-button-collection .dt-button {
    color: var(--text-secondary, #cbd5e1) !important;
}

:root[data-theme='dark'] .superadmin-module-dt ul.dt-button-collection .dt-button:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #f1f5f9 !important;
}

/* Superadmin — package subscription list */
.superadmin-subscription-filters-pop-panel {
    min-width: min(36rem, calc(100vw - 2rem));
}

.superadmin-subscription-filters-pop-actions {
    margin-top: 0.65rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
}

.superadmin-subscription-panel .users-table-wrap {
    padding: 0;
}

/* Superadmin — Edit Subscription dates modal (AJAX → .view_modal) */
.view_modal .edit-subscription-modal-dialog {
    width: auto;
    max-width: 22.5rem;
    margin: 1.75rem auto;
}

.view_modal .edit-subscription-modal {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.85rem;
    overflow: hidden;
    background: var(--bg-surface, #fff);
    box-shadow: 0 22px 56px rgba(15, 23, 42, 0.18);
}

.view_modal .edit-subscription-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: linear-gradient(180deg, var(--bg-surface-soft, #f8fafc) 0%, var(--bg-surface, #fff) 100%);
}

.view_modal .edit-subscription-modal__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--text-primary, #0f172a);
    line-height: 1.3;
    flex: 1;
    min-width: 0;
}

.view_modal .edit-subscription-modal__close {
    float: none;
    margin: 0;
    padding: 0.15rem 0.35rem;
    font-size: 1.35rem;
    font-weight: 400;
    line-height: 1;
    opacity: 0.65;
    color: var(--text-secondary, #64748b);
    text-shadow: none;
}

.view_modal .edit-subscription-modal__close:hover,
.view_modal .edit-subscription-modal__close:focus {
    opacity: 1;
    color: var(--text-primary, #0f172a);
}

.view_modal .edit-subscription-modal__body {
    padding: 1rem 1rem 0.85rem;
}

.view_modal .edit-subscription-modal__fields {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.view_modal .edit-subscription-modal__group {
    margin-bottom: 0;
}

.view_modal .edit-subscription-modal__label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #64748b);
}

.view_modal .edit-subscription-modal__group .form-control.users-input {
    max-width: 100%;
    font-size: 0.88rem;
    padding: 0.45rem 0.6rem;
    border-radius: 0.5rem;
}

.view_modal .edit-subscription-modal__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.modal-open .datepicker.datepicker-dropdown {
    z-index: 10100 !important;
}

:root[data-theme='dark'] .view_modal .edit-subscription-modal {
    background: linear-gradient(180deg, rgba(17, 26, 44, 0.98) 0%, rgba(15, 23, 42, 0.99) 100%);
    border-color: var(--border-strong, #334866);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

:root[data-theme='dark'] .view_modal .edit-subscription-modal__header {
    background: linear-gradient(180deg, rgba(26, 39, 64, 0.95) 0%, rgba(17, 26, 44, 0.98) 100%);
    border-bottom-color: #334866;
}

:root[data-theme='dark'] .view_modal .edit-subscription-modal__title {
    color: #f1f5f9;
}

:root[data-theme='dark'] .view_modal .edit-subscription-modal__close {
    color: #94a3b8;
}

:root[data-theme='dark'] .view_modal .edit-subscription-modal__close:hover,
:root[data-theme='dark'] .view_modal .edit-subscription-modal__close:focus {
    color: #f8fafc;
}

:root[data-theme='dark'] .view_modal .edit-subscription-modal__label {
    color: #94a3b8;
}

:root[data-theme='dark'] .view_modal .edit-subscription-modal__group .form-control.users-input {
    background: #1a2740;
    border-color: #334866;
    color: #e2e8f0;
}

:root[data-theme='dark'] .view_modal .edit-subscription-modal__footer {
    background: rgba(15, 23, 42, 0.75);
    border-top-color: #334866;
}

:root[data-theme='dark'] .modal-open .datepicker.datepicker-dropdown {
    background: #1a2740;
    border-color: #334866;
    color: #e2e8f0;
}

:root[data-theme='dark'] .modal-open .datepicker table tr td.day:hover,
:root[data-theme='dark'] .modal-open .datepicker table tr td.day.focused {
    background: rgba(99, 102, 241, 0.25);
}

/* Superadmin — Add Subscription modal (AJAX → .view_modal) */
.view_modal .add-subscription-modal-dialog {
    width: auto;
    max-width: 26rem;
    margin: 1.75rem auto;
}

.view_modal .add-subscription-modal {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.85rem;
    overflow: visible;
    background: var(--bg-surface, #fff);
    box-shadow: 0 22px 56px rgba(15, 23, 42, 0.18);
}

.view_modal .add-subscription-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: linear-gradient(180deg, var(--bg-surface-soft, #f8fafc) 0%, var(--bg-surface, #fff) 100%);
}

.view_modal .add-subscription-modal__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--text-primary, #0f172a);
    line-height: 1.3;
    flex: 1;
    min-width: 0;
}

.view_modal .add-subscription-modal__close {
    float: none;
    margin: 0;
    padding: 0.15rem 0.35rem;
    font-size: 1.35rem;
    font-weight: 400;
    line-height: 1;
    opacity: 0.65;
    color: var(--text-secondary, #64748b);
    text-shadow: none;
}

.view_modal .add-subscription-modal__close:hover,
.view_modal .add-subscription-modal__close:focus {
    opacity: 1;
    color: var(--text-primary, #0f172a);
}

.view_modal .add-subscription-modal__body {
    padding: 1rem 1rem 0.85rem;
}

.view_modal .add-subscription-modal__fields {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.view_modal .add-subscription-modal__group {
    margin-bottom: 0;
}

.view_modal .add-subscription-modal__label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #64748b);
}

.view_modal .add-subscription-modal__group .add-subscription-modal__input {
    max-width: 100%;
    font-size: 0.88rem;
    padding: 0.45rem 0.6rem;
    border-radius: 0.5rem;
}

.view_modal .add-subscription-modal__group .select2-container {
    width: 100% !important;
    max-width: 100%;
}

.view_modal .add-subscription-modal__group .select2-container--default .select2-selection--single {
    min-height: 2.45rem;
    border-radius: 0.5rem;
    border-color: var(--border-default, #cbd5e1);
}

.view_modal .add-subscription-modal__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

:root[data-theme='dark'] .view_modal .add-subscription-modal {
    background: linear-gradient(180deg, rgba(17, 26, 44, 0.98) 0%, rgba(15, 23, 42, 0.99) 100%);
    border-color: var(--border-strong, #334866);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

:root[data-theme='dark'] .view_modal .add-subscription-modal__header {
    background: linear-gradient(180deg, rgba(26, 39, 64, 0.95) 0%, rgba(17, 26, 44, 0.98) 100%);
    border-bottom-color: #334866;
}

:root[data-theme='dark'] .view_modal .add-subscription-modal__title {
    color: #f1f5f9;
}

:root[data-theme='dark'] .view_modal .add-subscription-modal__close {
    color: #94a3b8;
}

:root[data-theme='dark'] .view_modal .add-subscription-modal__close:hover,
:root[data-theme='dark'] .view_modal .add-subscription-modal__close:focus {
    color: #f8fafc;
}

:root[data-theme='dark'] .view_modal .add-subscription-modal__label {
    color: #94a3b8;
}

:root[data-theme='dark'] .view_modal .add-subscription-modal__group .add-subscription-modal__input {
    background: #1a2740;
    border-color: #334866;
    color: #e2e8f0;
}

:root[data-theme='dark'] .view_modal .add-subscription-modal__footer {
    background: rgba(15, 23, 42, 0.75);
    border-top-color: #334866;
}

/* Superadmin — subscription packages (card grid, Nestiko shell) */
.superadmin-packages-page .nestiko-shell-page-intro {
    margin-bottom: 0.75rem;
}

.superadmin-packages-panel .superadmin-packages-cards-wrap {
    padding: 0;
    min-width: 0;
}

.superadmin-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr));
    gap: 1.15rem;
    padding: 0.85rem 1rem 1.15rem;
    box-sizing: border-box;
}

.superadmin-package-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    border-radius: 0.9rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface, #fff);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.05),
        0 4px 18px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.superadmin-package-card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 10px 28px rgba(15, 23, 42, 0.1),
        0 2px 8px rgba(15, 23, 42, 0.05);
    border-color: color-mix(in srgb, var(--accent-primary, #8351ec) 32%, var(--border-default, #e2e8f0));
}

.superadmin-package-card--popular {
    border-color: color-mix(in srgb, var(--accent-primary, #8351ec) 42%, var(--border-default, #e2e8f0));
    box-shadow:
        0 4px 22px color-mix(in srgb, var(--accent-primary, #8351ec) 14%, transparent),
        0 1px 2px rgba(15, 23, 42, 0.06);
}

.superadmin-package-card--inactive {
    opacity: 0.92;
}

.superadmin-package-card__header {
    padding: 1rem 1rem 0.35rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem 0.65rem;
}

.superadmin-package-card__title {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--text-primary, #0f172a);
    flex: 1 1 8rem;
    min-width: 0;
}

.superadmin-package-card__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 1rem 0.75rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.superadmin-package-card__meta-icons {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.superadmin-package-card__icon-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 0.4rem;
    background: color-mix(in srgb, var(--accent-primary, #8351ec) 10%, transparent);
    color: var(--accent-primary, #8351ec);
    font-size: 0.95rem;
}

.superadmin-package-card__toolbar-right {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.superadmin-package-card__pill {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.2;
}

.superadmin-package-card__pill--popular {
    background: color-mix(in srgb, var(--accent-primary, #8351ec) 14%, transparent);
    color: var(--accent-primary, #5b21b6);
    border: 1px solid color-mix(in srgb, var(--accent-primary, #8351ec) 35%, transparent);
}

.superadmin-package-card__pill--ok {
    background: color-mix(in srgb, #16a34a 14%, transparent);
    color: #15803d;
    border: 1px solid color-mix(in srgb, #22c55e 35%, transparent);
}

.superadmin-package-card__pill--muted {
    background: color-mix(in srgb, #64748b 12%, transparent);
    color: #475569;
    border: 1px solid var(--border-default, #e2e8f0);
}

.superadmin-package-card__icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.45rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
    color: var(--text-secondary, #475569);
    text-decoration: none !important;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.superadmin-package-card__icon-btn:hover,
.superadmin-package-card__icon-btn:focus {
    background: var(--bg-surface, #fff);
    border-color: var(--border-strong, #cbd5e1);
    color: var(--text-primary, #0f172a);
}

.superadmin-package-card__icon-btn--danger:hover,
.superadmin-package-card__icon-btn--danger:focus {
    background: rgba(254, 226, 226, 0.65);
    border-color: #fca5a5;
    color: #b91c1c;
}

.superadmin-package-card__features {
    list-style: none;
    margin: 0;
    padding: 0.75rem 1rem;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary, #475569);
}

.superadmin-package-card__features li {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    line-height: 1.4;
}

.superadmin-package-card__features li .ti {
    flex-shrink: 0;
    margin-top: 0.12rem;
    font-size: 0.95rem;
    color: color-mix(in srgb, var(--accent-primary, #8351ec) 88%, #334155);
    opacity: 0.95;
}

.superadmin-package-card__price {
    margin: 0;
    padding: 1rem 1rem 1.05rem;
    text-align: center;
    border-top: 1px solid var(--border-default, #e2e8f0);
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--accent-primary, #8351ec) 9%, transparent) 0%,
        transparent 72%
    );
}

.superadmin-package-card__amount {
    display: block;
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--text-primary, #0f172a);
}

.superadmin-package-card__amount .display_currency {
    font-weight: inherit;
}

.superadmin-package-card__amount--free {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: normal;
    line-height: 1.35;
}

.superadmin-package-card__interval {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
}

.superadmin-package-card__desc {
    padding: 0.85rem 1rem 1.05rem;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-secondary, #475569);
    border-top: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
    margin-top: auto;
}

.superadmin-packages-pagination {
    padding: 0.5rem 1rem 1rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    border-top: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.superadmin-packages-pagination .pagination {
    margin: 0;
}

:root[data-theme='dark'] .superadmin-package-card {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-default, #334155);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.35),
        0 6px 22px rgba(0, 0, 0, 0.25);
}

:root[data-theme='dark'] .superadmin-package-card:hover {
    border-color: color-mix(in srgb, var(--accent-primary, #a78bfa) 45%, var(--border-default, #334155));
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.45),
        0 0 0 1px color-mix(in srgb, var(--accent-primary, #a78bfa) 22%, transparent);
}

:root[data-theme='dark'] .superadmin-package-card--popular {
    border-color: color-mix(in srgb, var(--accent-primary, #a78bfa) 55%, #334155);
    box-shadow:
        0 6px 26px color-mix(in srgb, var(--accent-primary, #a78bfa) 12%, transparent),
        0 1px 2px rgba(0, 0, 0, 0.35);
}

:root[data-theme='dark'] .superadmin-package-card__title {
    color: var(--text-primary, #f1f5f9);
}

:root[data-theme='dark'] .superadmin-package-card__toolbar {
    border-bottom-color: var(--border-default, #334155);
}

:root[data-theme='dark'] .superadmin-package-card__icon-hint {
    background: rgba(167, 139, 250, 0.12);
    color: #c4b5fd;
}

:root[data-theme='dark'] .superadmin-package-card__pill--popular {
    background: rgba(167, 139, 250, 0.14);
    color: #e9d5ff;
    border-color: rgba(167, 139, 250, 0.35);
}

:root[data-theme='dark'] .superadmin-package-card__pill--ok {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.35);
}

:root[data-theme='dark'] .superadmin-package-card__pill--muted {
    background: rgba(148, 163, 184, 0.1);
    color: #cbd5e1;
    border-color: #475569;
}

:root[data-theme='dark'] .superadmin-package-card__icon-btn {
    background: rgba(30, 41, 59, 0.85);
    border-color: #475569;
    color: #e2e8f0;
}

:root[data-theme='dark'] .superadmin-package-card__icon-btn:hover,
:root[data-theme='dark'] .superadmin-package-card__icon-btn:focus {
    background: rgba(51, 65, 85, 0.9);
    border-color: #64748b;
    color: #f8fafc;
}

:root[data-theme='dark'] .superadmin-package-card__icon-btn--danger:hover,
:root[data-theme='dark'] .superadmin-package-card__icon-btn--danger:focus {
    background: rgba(127, 29, 29, 0.35);
    border-color: #f87171;
    color: #fecaca;
}

:root[data-theme='dark'] .superadmin-package-card__features {
    color: #cbd5e1;
}

:root[data-theme='dark'] .superadmin-package-card__features li .ti {
    color: #c4b5fd;
    opacity: 1;
}

:root[data-theme='dark'] .superadmin-package-card__price {
    border-top-color: var(--border-default, #334155);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.14) 0%, rgba(17, 26, 44, 0.2) 100%);
}

:root[data-theme='dark'] .superadmin-package-card__amount {
    color: #f8fafc;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

:root[data-theme='dark'] .superadmin-package-card__interval {
    color: #94a3b8;
}

:root[data-theme='dark'] .superadmin-package-card__amount--free {
    color: #e2e8f0;
    text-shadow: none;
}

:root[data-theme='dark'] .superadmin-package-card__desc {
    background: rgba(15, 23, 42, 0.55);
    color: #cbd5e1;
    border-top-color: var(--border-default, #334155);
}

:root[data-theme='dark'] .superadmin-packages-pagination {
    background: rgba(17, 26, 44, 0.65);
    border-top-color: var(--border-default, #334155);
}

:root[data-theme='dark'] .superadmin-packages-pagination .pagination > li > a,
:root[data-theme='dark'] .superadmin-packages-pagination .pagination > li > span {
    background: #1a2740;
    border-color: #334866;
    color: #e2e8f0;
}

/* Subscription / public pricing — same card shell + primary CTA */
.superadmin-package-card--subscribe {
    min-height: 100%;
}

.superadmin-package-card__header-main {
    flex: 1 1 auto;
    min-width: 0;
}

.superadmin-package-card__subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    line-height: 1.45;
    font-weight: 500;
    color: var(--text-secondary, #475569);
}

.superadmin-packages-grid--subscribe {
    padding: 0.35rem 0 0.5rem;
}

.package-subscriptions-packages-body .superadmin-packages-grid--subscribe {
    padding: 0.85rem 1rem 1.15rem;
}

.superadmin-package-card__cta {
    margin-top: auto;
    padding: 0.85rem 1rem 1.05rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.superadmin-package-card__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.65rem;
    padding: 0 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none !important;
    color: #fff !important;
    background: #2563eb;
    border: 1px solid #2563eb;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}

.superadmin-package-card__btn:hover,
.superadmin-package-card__btn:focus {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

:root[data-theme='dark'] .superadmin-package-card__subtitle {
    color: #94a3b8;
}

:root[data-theme='dark'] .superadmin-package-card__cta {
    background: rgba(15, 23, 42, 0.65);
    border-top-color: var(--border-default, #334155);
}

:root[data-theme='dark'] .superadmin-package-card__btn {
    background: #2563eb;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

:root[data-theme='dark'] .superadmin-package-card__btn:hover,
:root[data-theme='dark'] .superadmin-package-card__btn:focus {
    background: #1d4ed8;
    border-color: #60a5fa;
}

/* Superadmin — packages create/edit form */
.superadmin-package-form-page .users-panel.superadmin-package-form-panel,
.superadmin-coupon-form-page .users-panel.superadmin-coupon-form-panel {
    border-radius: 0.75rem;
    overflow: hidden;
}

.superadmin-package-form-body {
    padding: 0.75rem 1rem 1.25rem;
}

.superadmin-package-form .form-group {
    margin-bottom: 1rem;
}

.superadmin-package-form__hint {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    margin-top: 0.25rem;
}

.superadmin-package-form__input-group .superadmin-package-form__addon {
    background: var(--bg-surface-soft, #f1f5f9);
    border-color: var(--border-default, #e2e8f0);
    color: var(--text-secondary, #475569);
}

/* Package form — grouped sections (subscription options, modules, visibility, edit-only) */
.superadmin-package-form__section {
    margin-top: 1.25rem;
    padding: 1rem 1rem 1.1rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.65rem;
    background: var(--bg-surface-soft, #f8fafc);
    clear: both;
}

.superadmin-package-form__section--subscription {
    margin-top: 0.75rem;
}

.superadmin-package-form__section-head {
    margin-bottom: 0.85rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.superadmin-package-form__section-heading {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.35rem 0;
    color: var(--text-primary, #0f172a);
}

.superadmin-package-form__section-lede {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-secondary, #475569);
}

.superadmin-package-form__section .row {
    margin-left: -8px;
    margin-right: -8px;
}

.superadmin-package-form__section .row > [class*='col-'] {
    padding-left: 8px;
    padding-right: 8px;
}

/* Checkbox / module grids: replace float columns with CSS grid so boxes align and rows don’t collapse */
.superadmin-package-form__section--subscription .row,
.superadmin-package-form__section--visibility .row,
.superadmin-package-form__section--modules .row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
    row-gap: 0.75rem;
    margin-left: 0;
    margin-right: 0;
}

.superadmin-package-form__section--subscription .row > [class*='col-'],
.superadmin-package-form__section--visibility .row > [class*='col-'],
.superadmin-package-form__section--modules .row > [class*='col-'] {
    width: 100%;
    float: none;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

.superadmin-package-form__section--subscription .row > .col-xs-12,
.superadmin-package-form__section--visibility .row > .col-xs-12 {
    grid-column: 1 / -1;
}

.superadmin-package-form__section--visibility .row > .col-xs-12.superadmin-package-form__only-businesses {
    margin-top: 0.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
}

.superadmin-package-form__section--visibility .superadmin-package-form__only-businesses .form-group {
    margin-bottom: 0;
}

.superadmin-package-form__section--visibility .superadmin-package-form__only-businesses .form-group label {
    display: inline;
    margin-right: 0.35rem;
}

.superadmin-package-form__section--visibility .superadmin-package-form__only-businesses .users-help-trigger {
    vertical-align: middle;
    margin-bottom: 0.5rem;
}

.superadmin-package-form__section--visibility .superadmin-package-form__only-businesses .select2-container {
    margin-top: 0.35rem;
}

@media (max-width: 767px) {
    .superadmin-package-form__section--subscription .row,
    .superadmin-package-form__section--visibility .row,
    .superadmin-package-form__section--modules .row {
        grid-template-columns: 1fr;
    }
}

.superadmin-package-form__check-item {
    margin: 0;
    padding: 0.15rem 0 0.15rem 0.05rem;
    min-height: 1.5rem;
}

.superadmin-package-form__section .form-group:last-child {
    margin-bottom: 0;
}

.superadmin-package-form__check-item:last-child {
    margin-bottom: 0;
}

.superadmin-package-form__check-item .checkbox {
    margin: 0;
}

.superadmin-package-form__check-item .checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    line-height: 1.4;
    font-weight: 500;
    font-size: 0.8rem;
    margin: 0;
}

.superadmin-package-form__check-item .checkbox label .icheckbox_square-blue {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.superadmin-package-form__check-item .checkbox > .users-help-trigger {
    margin-left: 1.85rem;
    margin-top: 0.2rem;
}

.superadmin-package-form__section--advanced {
    border-style: dashed;
    margin-top: 1.35rem;
    padding-top: 1rem;
}

.superadmin-package-form__update-subs {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.superadmin-package-form__section--advanced .superadmin-package-form__update-subs {
    margin-bottom: 0;
}

.superadmin-package-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.35rem;
    padding: 1.15rem 1rem 1.2rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

/* Superadmin — coupons create/edit form */
.superadmin-coupon-form-body {
    padding: 0.75rem 1rem 1rem;
}

.superadmin-coupon-form .form-group {
    margin-bottom: 1rem;
}

.superadmin-coupon-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 1rem 1.1rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.superadmin-package-form-page .select2-container--default .select2-selection--single,
.superadmin-package-form-page .select2-container--default .select2-selection--multiple,
.superadmin-coupon-form-page .select2-container--default .select2-selection--single,
.superadmin-coupon-form-page .select2-container--default .select2-selection--multiple {
    border-color: var(--border-default, #cbd5e1);
    background: var(--bg-input, #fff);
    min-height: 38px;
}

.superadmin-package-form-page .select2-container--default .select2-selection--multiple .select2-selection__choice,
.superadmin-coupon-form-page .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.35);
}

:root[data-theme='dark'] .superadmin-package-form-page .users-panel.superadmin-package-form-panel,
:root[data-theme='dark'] .superadmin-coupon-form-page .users-panel.superadmin-coupon-form-panel {
    background: rgba(17, 26, 44, 0.92);
    border-color: var(--border-default, #334155);
}

:root[data-theme='dark'] .superadmin-package-form-body {
    color: #e2e8f0;
}

:root[data-theme='dark'] .superadmin-package-form__hint {
    color: #94a3b8;
}

:root[data-theme='dark'] .superadmin-package-form__section {
    background: rgba(15, 23, 42, 0.55);
    border-color: #334866;
}

:root[data-theme='dark'] .superadmin-package-form__section-head {
    border-bottom-color: #334866;
}

:root[data-theme='dark'] .superadmin-package-form__section-heading {
    color: #f1f5f9;
}

:root[data-theme='dark'] .superadmin-package-form__section-lede {
    color: #94a3b8;
}

:root[data-theme='dark'] .superadmin-package-form__check-item .checkbox label {
    color: #e2e8f0;
}

:root[data-theme='dark'] .superadmin-package-form__section--visibility .row > .col-xs-12.superadmin-package-form__only-businesses {
    border-top-color: #334155;
}

:root[data-theme='dark'] .superadmin-package-form__input-group .superadmin-package-form__addon {
    background: #1a2740;
    border-color: #334866;
    color: #cbd5e1;
}

:root[data-theme='dark'] .superadmin-package-form-actions {
    background: rgba(15, 23, 42, 0.65);
    border-top-color: #334155;
}

:root[data-theme='dark'] .superadmin-package-form__update-subs {
    border-top-color: #334155;
}

:root[data-theme='dark'] .superadmin-package-form-page .select2-container--default .select2-selection--single,
:root[data-theme='dark'] .superadmin-package-form-page .select2-container--default .select2-selection--multiple,
:root[data-theme='dark'] .superadmin-coupon-form-page .select2-container--default .select2-selection--single,
:root[data-theme='dark'] .superadmin-coupon-form-page .select2-container--default .select2-selection--multiple {
    background: #111a2e;
    border-color: #334866;
    color: #e2e8f0;
}

:root[data-theme='dark'] .superadmin-package-form-page .select2-container--default .select2-selection--single .select2-selection__rendered,
:root[data-theme='dark'] .superadmin-coupon-form-page .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #e2e8f0;
}

:root[data-theme='dark'] .superadmin-package-form-page .select2-container--default .select2-selection--multiple .select2-selection__choice,
:root[data-theme='dark'] .superadmin-coupon-form-page .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.45);
    color: #e2e8f0;
}

:root[data-theme='dark'] .superadmin-coupon-form-body {
    color: #e2e8f0;
}

:root[data-theme='dark'] .superadmin-coupon-form-actions {
    background: rgba(15, 23, 42, 0.65);
    border-top-color: #334155;
}

/* Superadmin — add business (flatten shared register_form input-group icon rails) */
.superadmin-add-business-page .users-panel.superadmin-add-business-panel {
    border-radius: 0.75rem;
    overflow: hidden;
}

.superadmin-add-business-form {
    padding: 0.75rem 1rem 1rem;
}

.superadmin-add-business-form fieldset {
    margin: 0 0 1.25rem;
    padding: 0;
    border: 0;
}

.superadmin-add-business-form fieldset > legend {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #0f172a);
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    width: 100%;
}

.superadmin-add-business-form .form-group {
    margin-bottom: 1rem;
}

.superadmin-add-business-form .input-group-addon {
    display: none !important;
}

.superadmin-add-business-form .input-group {
    display: block;
    width: 100%;
}

.superadmin-add-business-form .input-group > .form-control:not(.select2-hidden-accessible) {
    width: 100%;
    border: 1px solid var(--border-strong, #cbd5e1);
    border-radius: 0.4rem;
    background: var(--bg-surface, #fff);
    padding: 0.4rem 0.55rem;
    font-size: 0.8rem;
    color: var(--text-primary, #0f172a);
    height: auto;
    min-height: 2.25rem;
}

.superadmin-add-business-form .input-group .form-control:focus:not(.select2-hidden-accessible) {
    border-color: var(--border-focus, #3b82f6);
    outline: 0;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.superadmin-add-business-form .input-group .select2-container {
    width: 100% !important;
}

.superadmin-add-business-subscription-row {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
    clear: both;
}

.superadmin-add-business-subscription-row .form-group {
    margin-bottom: 1rem;
}

.superadmin-add-business-form-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 1rem 1.1rem;
    margin: 0 -1rem -1rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.superadmin-add-business-page .select2-container--default .select2-selection--single,
.superadmin-add-business-page .select2-container--default .select2-selection--multiple {
    border-color: var(--border-default, #cbd5e1);
    background: var(--bg-input, #fff);
    min-height: 38px;
}

.superadmin-add-business-page .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    padding-left: 0.55rem;
    font-size: 0.8rem;
}

:root[data-theme='dark'] .superadmin-add-business-page .users-panel.superadmin-add-business-panel {
    background: rgba(17, 26, 44, 0.92);
    border-color: var(--border-default, #334155);
}

:root[data-theme='dark'] .superadmin-add-business-form fieldset > legend {
    color: #e2e8f0;
    border-bottom-color: #334155;
}

:root[data-theme='dark'] .superadmin-add-business-form .input-group .form-control:not(.select2-hidden-accessible) {
    background: #111a2e;
    border-color: #334866;
    color: #e2e8f0;
}

:root[data-theme='dark'] .superadmin-add-business-form-actions {
    background: rgba(15, 23, 42, 0.65);
    border-top-color: #334155;
}

:root[data-theme='dark'] .superadmin-add-business-subscription-row {
    border-top-color: #334155;
}

:root[data-theme='dark'] .superadmin-add-business-page .select2-container--default .select2-selection--single,
:root[data-theme='dark'] .superadmin-add-business-page .select2-container--default .select2-selection--multiple {
    background: #111a2e;
    border-color: #334866;
    color: #e2e8f0;
}

:root[data-theme='dark'] .superadmin-add-business-page .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #e2e8f0;
}

/* Superadmin — coupons list */
.superadmin-coupons-panel .users-table-wrap {
    padding: 0;
}

/* Superadmin — application settings (uses master shell: master_settings_shell_styles.blade.php) */
.superadmin-superadmin-settings-page .superadmin-settings-master-topbar {
    justify-content: flex-end;
    width: 100%;
}

.superadmin-superadmin-settings-page .superadmin-settings-search-topbar {
    width: 100%;
    max-width: 22rem;
    min-width: 0;
}

.superadmin-superadmin-settings-page .superadmin-settings-search-topbar .input-group {
    width: 100%;
    border-radius: 0.45rem;
    overflow: hidden;
}

.superadmin-superadmin-settings-page .settings-tabnav-links a.list-group-item {
    margin-bottom: 0;
}

/* Wider Category column than default shell (10.75rem ≈ 172px) — long tab labels need room. */
@media (min-width: 1024px) {
    .superadmin-superadmin-settings-page .settings-main > aside.settings-tabnav.pos-tab-menu {
        flex: 0 0 14.5rem;
        width: 14.5rem;
        min-width: 14.5rem;
    }
}

.superadmin-superadmin-settings-page .pos-tab-content {
    padding: 0;
}

.superadmin-superadmin-settings-page .pos-tab-content:not(.active) {
    display: none;
}

.superadmin-superadmin-settings-page .pos-tab-content .row + .row {
    margin-top: 0;
}

/* Explicit grid rows: predictable columns and top alignment (flex + mixed col-* caused scattered fields).
   Include .settings-card-body so these beat master_settings_shell_styles (loaded after this file). */
/* Row gap only — avoid stacking with .form-group margin-bottom (was doubling vertical space).
   direction: ltr keeps column 1 on the visual left when html[dir=rtl] (otherwise grids mirror and fields look “scattered”). */
.superadmin-superadmin-settings-page .settings-card-body .pos-tab-content .row.superadmin-settings-row {
    display: grid !important;
    direction: ltr !important;
    unicode-bidi: isolate;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.55rem 1rem;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0.75rem;
    width: 100%;
    align-items: start;
}

.superadmin-superadmin-settings-page .settings-card-body .pos-tab-content .row.superadmin-settings-row:last-child {
    margin-bottom: 0;
}

.superadmin-superadmin-settings-page .settings-card-body .pos-tab-content .row.superadmin-settings-row .form-group {
    margin-bottom: 0;
}

.superadmin-superadmin-settings-page .settings-card-body .pos-tab-content .row.superadmin-settings-row .form-group > label[for]:first-child {
    display: block;
    margin-bottom: 0.3rem;
}

@media (min-width: 768px) {
    .superadmin-superadmin-settings-page .settings-card-body .pos-tab-content .row.superadmin-settings-row--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .superadmin-superadmin-settings-page .settings-card-body .pos-tab-content .row.superadmin-settings-row--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .superadmin-superadmin-settings-page .settings-card-body .pos-tab-content .row.superadmin-settings-row--4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .superadmin-superadmin-settings-page .settings-card-body .pos-tab-content .row.superadmin-settings-row--split-1-2 {
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    }
}

.superadmin-superadmin-settings-page .settings-card-body .pos-tab-content .row.superadmin-settings-row > [class*='col-'] {
    float: none !important;
    width: auto !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    min-width: 0 !important;
    align-self: stretch;
}

.superadmin-superadmin-settings-page .superadmin-settings-section {
    margin: 0 0 0.85rem;
    padding: 0 0 0.85rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.superadmin-superadmin-settings-page .superadmin-settings-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.superadmin-superadmin-settings-page .superadmin-settings-section:not(:first-of-type) {
    padding-top: 0.35rem;
}

.superadmin-superadmin-settings-page .superadmin-settings-section-title {
    margin: 0 0 0.75rem;
    padding: 0 0 0.5rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.superadmin-superadmin-settings-page .superadmin-settings-section-title small {
    font-weight: 600;
    color: var(--text-muted, #64748b);
}

.superadmin-superadmin-settings-page .superadmin-settings-prose {
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.superadmin-superadmin-settings-page .superadmin-settings-prose p:last-child {
    margin-bottom: 0;
}

.superadmin-superadmin-settings-page .superadmin-settings-gateway-label-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.35rem;
}

.superadmin-superadmin-settings-page .superadmin-settings-gateway-label-row > label {
    margin-bottom: 0 !important;
    flex: 0 1 auto;
    min-width: 0;
}

.superadmin-superadmin-settings-page .superadmin-settings-gateway-label-row .users-help-trigger {
    margin-left: 0;
    flex-shrink: 0;
}

/* Legacy rows without .superadmin-settings-row: flex fallback (prefer superadmin-settings-row in new markup). */
.superadmin-superadmin-settings-page .pos-tab-content .row:not(.superadmin-settings-two-col):not(.superadmin-settings-row) {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.75rem 1rem;
    margin-left: 0;
    margin-right: 0;
}

.superadmin-superadmin-settings-page .pos-tab-content .row:not(.superadmin-settings-two-col):not(.superadmin-settings-row) > [class*='col-'] {
    float: none;
    padding-left: 0;
    padding-right: 0;
    min-width: 0;
}

/* Super Admin Settings: enforce 2-column grid + full-width cells (overrides any stray flex). */
/* direction: ltr keeps column 1 on the visual left when html[dir=rtl] — otherwise grid auto-flow leaves an empty column on the left. */
.superadmin-superadmin-settings-page .settings-card-body .superadmin-settings-tab-pane--super > .row.superadmin-settings-two-col {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.85rem 1rem !important;
    align-items: start;
    justify-content: start;
    justify-items: stretch;
    direction: ltr;
    width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.superadmin-superadmin-settings-page .settings-card-body .superadmin-settings-two-col > [class*='col-'] {
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.superadmin-superadmin-settings-page .settings-card-body .superadmin-settings-two-col > .col-xs-12 {
    grid-column: 1 / -1;
}

@media (max-width: 767px) {
    .superadmin-superadmin-settings-page .settings-card-body .superadmin-settings-tab-pane--super > .row.superadmin-settings-two-col {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

.superadmin-superadmin-settings-page .pos-tab-content .row > .clearfix {
    display: none;
}

.superadmin-superadmin-settings-page .pos-tab-content .row > h4 {
    flex: 1 1 100%;
    width: 100%;
    margin: 0.85rem 0 0.35rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.superadmin-superadmin-settings-page .pos-tab-content .row > h4:first-child {
    margin-top: 0;
}

.superadmin-superadmin-settings-page .pos-tab-content .row:not(.superadmin-settings-two-col):not(.superadmin-settings-row) > .col-xs-3 {
    flex: 1 1 calc(25% - 0.75rem);
    max-width: calc(25% - 0.75rem);
}

.superadmin-superadmin-settings-page .pos-tab-content .row:not(.superadmin-settings-two-col):not(.superadmin-settings-row) > .col-xs-4 {
    flex: 1 1 calc(33.333% - 0.67rem);
    max-width: calc(33.333% - 0.67rem);
}

.superadmin-superadmin-settings-page .pos-tab-content .row:not(.superadmin-settings-two-col):not(.superadmin-settings-row) > .col-xs-6 {
    flex: 1 1 calc(50% - 0.5rem);
    max-width: calc(50% - 0.5rem);
}

.superadmin-superadmin-settings-page .pos-tab-content .row:not(.superadmin-settings-two-col):not(.superadmin-settings-row) > .col-xs-8 {
    flex: 1 1 calc(66.666% - 0.34rem);
    max-width: calc(66.666% - 0.34rem);
}

.superadmin-superadmin-settings-page .pos-tab-content .row:not(.superadmin-settings-two-col):not(.superadmin-settings-row) > .col-xs-12 {
    flex: 1 1 100%;
    max-width: 100%;
}

.superadmin-superadmin-settings-page .pos-tab-content .row:not(.superadmin-settings-two-col):not(.superadmin-settings-row) > [class*='col-md-4'] {
    flex: 1 1 calc(33.333% - 0.67rem);
    max-width: calc(33.333% - 0.67rem);
}

@media (max-width: 767px) {
    .superadmin-superadmin-settings-page .pos-tab-content .row:not(.superadmin-settings-two-col):not(.superadmin-settings-row) > [class*='col-'] {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

.superadmin-superadmin-settings-page .pos-tab-content .form-group {
    margin-bottom: 0.65rem;
}

/* Super Admin Settings tab: true half / half columns + inputs fill column (was col-xs-4 ≈ 33% wide). */
.superadmin-superadmin-settings-page .superadmin-settings-tab-pane--super .row.superadmin-settings-two-col > [class*='col-'] {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.superadmin-superadmin-settings-page .superadmin-settings-tab-pane--super .form-group {
    width: 100%;
    max-width: 100%;
}

.superadmin-superadmin-settings-page .superadmin-settings-tab-pane--super .form-control,
.superadmin-superadmin-settings-page .superadmin-settings-tab-pane--super .form-control.users-input {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
}

.superadmin-superadmin-settings-page .superadmin-settings-tab-pane--super .select2-container {
    width: 100% !important;
    max-width: 100% !important;
}

.superadmin-superadmin-settings-page .pos-tab-content label {
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

/* Flat fields (no Bootstrap input-group icon rails) — matches Nestiko users-input elsewhere */
.superadmin-superadmin-settings-page .pos-tab-content .form-control,
.superadmin-superadmin-settings-page .pos-tab-content .select2-container--default .select2-selection--single,
.superadmin-superadmin-settings-page .pos-tab-content .select2-container--default .select2-selection--multiple {
    min-height: 2.5rem;
    border-radius: 0.4rem !important;
    border-color: var(--border-strong, #cbd5e1);
    background: var(--bg-surface, #fff);
    color: var(--text-primary, #0f172a);
    font-size: 0.8rem;
}

.superadmin-superadmin-settings-page .pos-tab-content .input-group .form-control,
.superadmin-superadmin-settings-page .pos-tab-content .input-group .select2-container--default .select2-selection--single,
.superadmin-superadmin-settings-page .pos-tab-content .input-group .select2-container--default .select2-selection--multiple {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.superadmin-superadmin-settings-page .pos-tab-content .input-group-addon {
    background: var(--bg-surface-soft, #f1f5f9);
    border-color: var(--border-default, #e2e8f0);
    color: var(--text-secondary, #475569);
}

.superadmin-superadmin-settings-page .pos-tab-content .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 2.35rem;
    color: inherit;
    padding-left: 0.55rem;
    font-size: 0.8rem;
}

.superadmin-superadmin-settings-page #superadmin_settings_form .select2-container {
    width: 100% !important;
    max-width: 100%;
}

.superadmin-superadmin-settings-page .pos-tab-content .form-group label:not([for]) {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    cursor: pointer;
}

.superadmin-superadmin-settings-page .pos-tab-content .form-group label:not([for]) .icheckbox_square-blue {
    flex-shrink: 0;
    margin-top: 0;
}

.superadmin-superadmin-settings-page .superadmin-settings-field--alert-days > label {
    font-size: 0.74rem;
    line-height: 1.35;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.superadmin-superadmin-settings-page .superadmin-settings-superadmin-footer {
    margin-top: 0.35rem;
    margin-left: 0;
    padding-top: 1rem;
    padding-left: 0;
    border-top: 1px solid var(--border-default, #e2e8f0);
}

.superadmin-superadmin-settings-page .superadmin-settings-checkbox-block {
    margin-bottom: 0.65rem;
}

.superadmin-superadmin-settings-page .superadmin-settings-checkbox-block label {
    align-items: flex-start;
}

.superadmin-superadmin-settings-page .superadmin-settings-checkbox-block .icheckbox_square-blue {
    margin-top: 0.2rem;
}

.superadmin-superadmin-settings-page .superadmin-settings-checkbox-label {
    font-weight: 600;
    line-height: 1.35;
}

.superadmin-superadmin-settings-page .superadmin-settings-checkbox-help {
    margin: 0.5rem 0 0 0;
    max-width: 42rem;
    padding-left: 1.75rem;
}

/* Form + card use full width beside Category nav (flex: 1 1 auto can shrink and leave empty space). */
.superadmin-superadmin-settings-page .settings-main .settings-form {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    padding-bottom: 0.5rem;
}

.superadmin-superadmin-settings-page .settings-form .settings-card {
    width: 100%;
    max-width: 100%;
}

.superadmin-superadmin-settings-page .superadmin-settings-version-line {
    margin-bottom: 0;
    padding: 0.5rem 0.65rem;
    border-radius: 0.35rem;
    background: rgba(239, 68, 68, 0.08);
    color: var(--text-muted, #64748b);
    font-size: 0.76rem;
}

:root[data-theme='dark'] .superadmin-superadmin-settings-page .superadmin-settings-superadmin-footer {
    border-top-color: #334155;
}

:root[data-theme='dark'] .superadmin-superadmin-settings-page .superadmin-settings-version-line {
    background: rgba(239, 68, 68, 0.12);
    color: #94a3b8;
}

.superadmin-superadmin-settings-page .pos-tab-content textarea.form-control {
    min-height: 8rem;
    line-height: 1.45;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
}

.superadmin-superadmin-settings-page .pos-tab-content h4 {
    margin: 1rem 0 0.75rem;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.superadmin-superadmin-settings-page .pos-tab-content hr {
    border-color: var(--border-default, #e2e8f0);
}

/* Email/SMTP: divider before welcome-email checkbox — room above & below so it does not sit on adjacent rows */
.superadmin-superadmin-settings-page .pos-tab-content hr.superadmin-settings-hr {
    margin-top: 0.85rem;
    margin-bottom: 0.85rem;
    border: 0;
    border-top: 1px solid var(--border-default, #e2e8f0);
}

/* Email/SMTP: checkbox + Know More on one aligned row (iCheck + pill button share vertical center) */
.superadmin-superadmin-settings-page .superadmin-settings-checkbox-help-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
}

.superadmin-superadmin-settings-page .superadmin-settings-checkbox-help-row > label {
    display: inline-flex !important;
    align-items: center;
    gap: 0.45rem;
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0 !important;
}

.superadmin-superadmin-settings-page .superadmin-settings-checkbox-help-row .users-help-trigger {
    margin-left: 0;
    flex-shrink: 0;
    align-self: center;
}

/* ReCAPTCHA block: title line matches other field labels; no Bootstrap .checkbox wrapper (avoids default left indent). */
.superadmin-superadmin-settings-page .superadmin-settings-inline-field-label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.79rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.superadmin-superadmin-settings-page .pos-tab-content .help-block {
    color: var(--text-muted, #64748b);
}

.superadmin-superadmin-settings-page .pos-tab-content code {
    display: inline-block;
    max-width: 100%;
    padding: 0.35rem 0.55rem;
    border-radius: 0.45rem;
    background: var(--bg-surface-soft, #f1f5f9);
    border: 1px solid var(--border-default, #e2e8f0);
    font-size: 0.78rem;
    word-break: break-word;
}

.superadmin-superadmin-settings-page .pos-tab-content mark {
    background: rgba(250, 204, 21, 0.35);
    color: inherit;
    padding: 0.1rem 0.2rem;
    border-radius: 0.2rem;
}

@media (max-width: 991px) {
    .superadmin-superadmin-settings-page .settings-tabnav.pos-tab-menu,
    .superadmin-superadmin-settings-page .settings-card-body.pos-tab {
        width: 100%;
    }

    .superadmin-superadmin-settings-page .settings-tabnav.pos-tab-menu {
        border-right: 0;
        border-bottom: 1px solid var(--border-default, #e2e8f0);
    }

    .superadmin-superadmin-settings-page .settings-tabnav-links.list-group {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    }

    .superadmin-superadmin-settings-page .settings-card-body.pos-tab {
        padding: 0.95rem;
    }
}

:root[data-theme='dark'] .superadmin-superadmin-settings-page .superadmin-settings-search-topbar .input-group {
    background: var(--bg-surface, #111a2c);
    border-color: var(--border-strong, #334866);
}

:root[data-theme='dark'] .superadmin-superadmin-settings-page .superadmin-settings-search-topbar .input-group-addon {
    background: rgba(99, 102, 241, 0.14);
    border-color: #334866;
    color: #a5b4fc;
}

:root[data-theme='dark'] .superadmin-superadmin-settings-page .superadmin-settings-search-topbar .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #e2e8f0;
}

:root[data-theme='dark'] .superadmin-superadmin-settings-page .pos-tab-content .form-control,
:root[data-theme='dark'] .superadmin-superadmin-settings-page .pos-tab-content select.form-control,
:root[data-theme='dark'] .superadmin-superadmin-settings-page .pos-tab-content textarea.form-control {
    background: #1a2740;
    border-color: #334866;
    color: #e2e8f0;
}

:root[data-theme='dark'] .superadmin-superadmin-settings-page .pos-tab-content .form-control::placeholder,
:root[data-theme='dark'] .superadmin-superadmin-settings-page .pos-tab-content textarea.form-control::placeholder {
    color: #64748b;
}

:root[data-theme='dark'] .superadmin-superadmin-settings-page .pos-tab-content .input-group-addon {
    background: #111a2c;
    border-color: #334866;
    color: #94a3b8;
}

:root[data-theme='dark'] .superadmin-superadmin-settings-page .pos-tab-content .select2-container--default .select2-selection--single,
:root[data-theme='dark'] .superadmin-superadmin-settings-page .pos-tab-content .select2-container--default .select2-selection--multiple {
    background: #1a2740;
    border-color: #334866;
    color: #e2e8f0;
}

:root[data-theme='dark'] .superadmin-superadmin-settings-page .pos-tab-content .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #e2e8f0;
}

:root[data-theme='dark'] .superadmin-superadmin-settings-page .pos-tab-content .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.45);
    color: #e2e8f0;
}

:root[data-theme='dark'] .superadmin-superadmin-settings-page .pos-tab-content label,
:root[data-theme='dark'] .superadmin-superadmin-settings-page .pos-tab-content .checkbox label {
    color: #cbd5e1;
}

:root[data-theme='dark'] .superadmin-superadmin-settings-page .superadmin-settings-inline-field-label {
    color: #cbd5e1;
}

:root[data-theme='dark'] .superadmin-superadmin-settings-page .pos-tab-content h4 {
    color: #e2e8f0;
}

:root[data-theme='dark'] .superadmin-superadmin-settings-page .pos-tab-content .help-block,
:root[data-theme='dark'] .superadmin-superadmin-settings-page .pos-tab-content .form-text.text-muted,
:root[data-theme='dark'] .superadmin-superadmin-settings-page .pos-tab-content small {
    color: #94a3b8;
}

:root[data-theme='dark'] .superadmin-superadmin-settings-page .pos-tab-content hr {
    border-color: #334866;
}

:root[data-theme='dark'] .superadmin-superadmin-settings-page .pos-tab-content hr.superadmin-settings-hr {
    border-top-color: #334866;
}

:root[data-theme='dark'] .superadmin-superadmin-settings-page .pos-tab-content code {
    background: rgba(15, 23, 42, 0.9);
    border-color: #334866;
    color: #e2e8f0;
}

:root[data-theme='dark'] .superadmin-superadmin-settings-page .pos-tab-content .text-danger {
    color: #fca5a5 !important;
}

:root[data-theme='dark'] .superadmin-superadmin-settings-page .pos-tab-content a {
    color: #93c5fd;
}

/* Superadmin — communicator (compose + history) */
.superadmin-communicator-page .superadmin-communicator-compose-panel {
    margin-bottom: 1rem;
    border-radius: 0.75rem;
    overflow: hidden;
}

.superadmin-communicator-panel-head p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.superadmin-communicator-panel-ic {
    font-size: 1.15rem;
    opacity: 0.85;
}

.superadmin-communicator-compose-body {
    padding: 0;
    min-width: 0;
}

.superadmin-communicator-compose-inner {
    margin: 0.75rem 1rem 1rem;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.85rem;
    background: linear-gradient(165deg, var(--bg-surface-soft, #f8fafc) 0%, var(--bg-surface, #fff) 55%);
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    padding: 1.15rem 1.25rem 1.25rem;
}

.superadmin-communicator-form {
    margin: 0;
}

.superadmin-communicator-form-grid {
    margin-left: -8px;
    margin-right: -8px;
}

.superadmin-communicator-form-grid > [class*='col-'] {
    padding-left: 8px;
    padding-right: 8px;
}

.superadmin-communicator-field {
    margin-bottom: 1.1rem;
}

.superadmin-communicator-label {
    display: block;
    margin-bottom: 0.45rem;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.01em;
    color: var(--text-secondary, #475569);
}

.superadmin-communicator-field-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

.superadmin-communicator-field-head .superadmin-communicator-label {
    margin-bottom: 0;
}

.superadmin-communicator-recipient-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.superadmin-communicator-recipient-actions .users-btn {
    font-size: 0.76rem;
}

.superadmin-communicator-page .superadmin-communicator-recipients-select + .select2-container {
    width: 100% !important;
}

.superadmin-communicator-page .superadmin-communicator-field--recipients .select2-container--default .select2-selection--multiple {
    min-height: 3rem;
    border-radius: 0.65rem !important;
    border-color: var(--border-default, #cbd5e1);
    background: var(--bg-surface, #fff);
    padding: 0.2rem 0.35rem;
}

.superadmin-communicator-page .superadmin-communicator-field--recipients .select2-container--default .select2-selection--multiple .select2-selection__choice {
    border-radius: 0.45rem;
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.35);
    color: var(--text-primary, #0f172a);
}

.superadmin-communicator-field--message .superadmin-communicator-editor-wrap {
    border-radius: 0.65rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface, #fff);
    overflow: hidden;
    min-height: 18rem;
}

.superadmin-communicator-field--message textarea.superadmin-communicator-message-area {
    width: 100%;
    min-height: 16rem;
    border: 0;
    border-radius: 0.65rem;
    resize: vertical;
    font-size: 0.85rem;
    line-height: 1.5;
}

.superadmin-communicator-field--message .tox-tinymce {
    border: 0 !important;
    border-radius: 0 !important;
    min-height: 18rem !important;
}

.superadmin-communicator-field--message .tox .tox-edit-area__iframe {
    background: var(--bg-surface, #fff);
}

.superadmin-communicator-send-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    margin-bottom: 0 !important;
    padding-top: 1rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
}

.superadmin-communicator-history-wrap {
    padding: 0.75rem 1rem 1rem;
    min-width: 0;
}

:root[data-theme='dark'] .superadmin-communicator-compose-inner {
    background: linear-gradient(165deg, rgba(17, 26, 44, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
    border-color: var(--border-strong, #334866);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

:root[data-theme='dark'] .superadmin-communicator-label,
:root[data-theme='dark'] .superadmin-communicator-field-head .superadmin-communicator-label {
    color: #cbd5e1;
}

:root[data-theme='dark'] .superadmin-communicator-page .superadmin-communicator-field--recipients .select2-container--default .select2-selection--multiple {
    background: #1a2740;
    border-color: #334866;
}

:root[data-theme='dark'] .superadmin-communicator-page .superadmin-communicator-field--recipients .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: rgba(99, 102, 241, 0.22);
    border-color: rgba(129, 140, 248, 0.45);
    color: #e2e8f0;
}

:root[data-theme='dark'] .superadmin-communicator-page .superadmin-communicator-field--recipients .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    color: #e2e8f0;
}

:root[data-theme='dark'] .superadmin-communicator-field--message .superadmin-communicator-editor-wrap {
    border-color: #334866;
    background: #111a2e;
}

:root[data-theme='dark'] .superadmin-communicator-field--message textarea.superadmin-communicator-message-area {
    background: #111a2e;
    color: #e2e8f0;
}

:root[data-theme='dark'] .superadmin-communicator-field--message .tox .tox-edit-area__iframe {
    background: #0f172a;
}

:root[data-theme='dark'] .superadmin-communicator-send-row {
    border-top-color: #334866;
}

:root[data-theme='dark'] .superadmin-communicator-field--message .tox-tinymce {
    background: #111a2e;
}

:root[data-theme='dark'] .superadmin-communicator-compose-inner .users-input {
    background: #1a2740;
    border-color: #334866;
    color: #e2e8f0;
}

:root[data-theme='dark'] .superadmin-communicator-compose-inner .users-input::placeholder {
    color: #64748b;
}

/* Add Sale — POS-aligned layout (sell/create) */
.add-sale-page.manage-users-content {
    padding-bottom: 1.5rem;
}

.add-sale-shell {
    max-width: 100%;
    margin: 0 auto;
}

.add-sale-page .add-sale-page-intro.nestiko-shell-page-intro {
    margin-bottom: 1rem;
}

.add-sale-location-bar {
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.65rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: linear-gradient(135deg, var(--bg-surface-soft, #f8fafc) 0%, var(--bg-surface, #fff) 100%);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.add-sale-location-bar .form-group {
    margin-bottom: 0;
}

.add-sale-location-bar .input-group-addon {
    border-radius: 0.45rem 0 0 0.45rem;
    background: var(--bg-surface, #fff);
    border-color: var(--border-default, #e2e8f0);
}

.add-sale-location-bar .form-control {
    border-radius: 0;
    border-color: var(--border-default, #e2e8f0);
    min-height: 2.25rem;
}

.add-sale-page .box.box-solid {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.65rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    margin-bottom: 1rem;
}

.add-sale-page .box.box-solid > .box-body {
    padding: 1rem 1.1rem 1.15rem;
}

.add-sale-pos-table-wrap {
    margin-left: 0;
    margin-right: 0;
    padding: 0.5rem 0 0.25rem;
}

.add-sale-pos-table-wrap .table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.add-sale-page #pos_table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    border: none;
}

.add-sale-page #pos_table thead tr th {
    background: linear-gradient(180deg, #5b3bb8 0%, #4a2fa0 100%);
    color: #f8fafc;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-color: rgba(255, 255, 255, 0.12) !important;
    padding: 0.65rem 0.45rem;
    vertical-align: middle;
}

.add-sale-page #pos_table thead tr th i {
    color: rgba(248, 250, 252, 0.85);
}

.add-sale-page #pos_table tbody tr td {
    border-color: var(--border-default, #e2e8f0);
    vertical-align: middle;
    font-size: 0.875rem;
}

.add-sale-page #pos_table.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: var(--bg-surface-soft, #f8fafc);
}

.add-sale-pos-table-wrap .table-responsive + .table-responsive table {
    margin-bottom: 0;
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.5rem;
    overflow: hidden;
}

.add-sale-pos-table-wrap .table-responsive + .table-responsive table td {
    background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
    border: none !important;
    padding: 0.65rem 1rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}

.add-sale-pos-table-wrap .price_total,
.add-sale-pos-table-wrap .total_quantity {
    font-variant-numeric: tabular-nums;
    color: #4338ca;
}

.add-sale-pos-table-wrap .col-sm-10 {
    margin-top: 0.35rem;
}

.add-sale-pos-table-wrap .col-sm-10 .input-group .form-control {
    border-radius: 0.45rem 0 0 0.45rem;
    border: 1px solid var(--border-default, #e2e8f0);
    min-height: 2.6rem;
    font-size: 0.9rem;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.add-sale-pos-table-wrap .col-sm-10 .input-group-btn .btn,
.add-sale-pos-table-wrap .col-sm-10 .input-group-btn > .btn {
    min-height: 2.6rem;
    border-color: var(--border-default, #e2e8f0);
    background: var(--bg-surface, #fff);
}

.add-sale-pos-table-wrap .col-sm-10 .input-group-btn .btn:hover {
    background: var(--bg-surface-soft, #f8fafc);
    border-color: #8351ec;
    color: #8351ec;
}

.add-sale-actions-row {
    margin-top: 0.5rem;
    padding: 1rem 0 0.5rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
}

.add-sale-actions-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.65rem;
}

.add-sale-action-btn {
    min-width: 9.5rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.add-sale-action-btn--success {
    background: linear-gradient(180deg, #059669 0%, #047857 100%) !important;
    border-color: #047857 !important;
    color: #fff !important;
}

.add-sale-action-btn--success:hover,
.add-sale-action-btn--success:focus {
    filter: brightness(1.05);
    color: #fff !important;
}

:root[data-theme='dark'] .add-sale-location-bar {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    border-color: var(--border-strong, #334155);
}

:root[data-theme='dark'] .add-sale-page .box.box-solid {
    border-color: var(--border-strong, #334155);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

:root[data-theme='dark'] .add-sale-page #pos_table thead tr th {
    background: linear-gradient(180deg, #4c1d95 0%, #3b0764 100%);
    color: #f1f5f9;
}

:root[data-theme='dark'] .add-sale-pos-table-wrap .table-responsive + .table-responsive table td {
    background: linear-gradient(180deg, rgba(76, 29, 149, 0.35) 0%, rgba(59, 7, 100, 0.45) 100%);
    color: #e2e8f0;
}

:root[data-theme='dark'] .add-sale-pos-table-wrap .price_total,
:root[data-theme='dark'] .add-sale-pos-table-wrap .total_quantity {
    color: #c4b5fd;
}

:root[data-theme='dark'] .add-sale-actions-row {
    border-top-color: var(--border-strong, #334155);
}

/* List POS (sale_pos/index) */
.list-pos-page.manage-users-content {
    padding-bottom: 1.5rem;
}

.list-pos-shell {
    max-width: 100%;
    margin: 0 auto;
}

.list-pos-page .list-pos-page-intro.nestiko-shell-page-intro {
    margin-bottom: 1rem;
}

.list-pos-filters-section {
    margin-bottom: 1rem;
}

.list-pos-page .list-pos-filters-panel.nestiko-filters-panel {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.65rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.list-pos-page .list-pos-filters-panel .nestiko-filters-panel__head {
    background: linear-gradient(180deg, var(--bg-surface-soft, #f8fafc) 0%, var(--bg-surface, #fff) 100%);
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.list-pos-page .list-pos-filters-panel .box-title a {
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    text-decoration: none;
}

.list-pos-page .list-pos-filters-panel .box-title a:hover {
    color: #8351ec;
}

.list-pos-data-widget.box-solid {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.65rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.list-pos-page .list-pos-data-widget .box-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.25rem 0.5rem;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    background: linear-gradient(180deg, var(--bg-surface-soft, #f8fafc) 0%, var(--bg-surface, #fff) 100%);
}

.list-pos-page .list-pos-data-widget .box-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
}

.list-pos-page .dataTables_wrapper {
    padding-top: 0.25rem;
}

.list-pos-page .pos-sales-dt-lf,
.list-pos-page .draft-sales-dt-lf,
.list-pos-page .quotations-dt-lf,
.list-pos-page .shipments-dt-lf,
.list-pos-page .shipments-dt-lf-source,
.list-pos-page .pos-subscriptions-dt-lf,
.list-pos-page .subscriptions-dt-lf-source {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.list-pos-page .pos-sales-dt-lf .dataTables_length label,
.list-pos-page .draft-sales-dt-lf .dataTables_length label,
.list-pos-page .quotations-dt-lf .dataTables_length label,
.list-pos-page .shipments-dt-lf .dataTables_length label,
.list-pos-page .shipments-dt-lf-source .dataTables_length label,
.list-pos-page .pos-subscriptions-dt-lf .dataTables_length label,
.list-pos-page .subscriptions-dt-lf-source .dataTables_length label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

.list-pos-page .pos-sales-dt-lf .dataTables_filter input,
.list-pos-page .draft-sales-dt-lf .dataTables_filter input,
.list-pos-page .quotations-dt-lf .dataTables_filter input,
.list-pos-page .shipments-dt-lf .dataTables_filter input,
.list-pos-page .shipments-dt-lf-source .dataTables_filter input,
.list-pos-page .pos-subscriptions-dt-lf .dataTables_filter input,
.list-pos-page .subscriptions-dt-lf-source .dataTables_filter input {
    border-radius: 0.45rem;
    border: 1px solid var(--border-default, #e2e8f0);
    min-height: 2.25rem;
    padding: 0.35rem 0.65rem;
}

.list-pos-page #subscriptions_table thead tr th {
    background: linear-gradient(180deg, #5b3bb8 0%, #4a2fa0 100%);
    color: #f8fafc;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-color: rgba(255, 255, 255, 0.12) !important;
    padding: 0.65rem 0.45rem;
    vertical-align: middle;
}

.list-pos-page #subscriptions_table.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: var(--bg-surface-soft, #f8fafc);
}

.list-pos-page #subscriptions_table tbody tr td {
    border-color: var(--border-default, #e2e8f0);
    font-size: 0.82rem;
    vertical-align: middle;
}

.list-pos-page #sell_table thead tr th {
    background: linear-gradient(180deg, #5b3bb8 0%, #4a2fa0 100%);
    color: #f8fafc;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-color: rgba(255, 255, 255, 0.12) !important;
    padding: 0.65rem 0.45rem;
    vertical-align: middle;
}

.list-pos-page #sell_table.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: var(--bg-surface-soft, #f8fafc);
}

.list-pos-page #sell_table tbody tr td {
    border-color: var(--border-default, #e2e8f0);
    font-size: 0.82rem;
    vertical-align: middle;
}

.list-pos-page #sell_table tfoot tr.footer-total td,
.contact-view-sales-panel #sell_table tfoot tr.footer-total td {
    background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
    border-top: 2px solid rgba(91, 59, 184, 0.35);
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    padding: 0.65rem 0.45rem;
}

.list-pos-page #sell_table tfoot .footer_sale_total,
.list-pos-page #sell_table tfoot .footer_total_paid,
.list-pos-page #sell_table tfoot .footer_total_remaining,
.list-pos-page #sell_table tfoot .footer_total_sell_return_due,
.contact-view-sales-panel #sell_table tfoot .footer_sale_total,
.contact-view-sales-panel #sell_table tfoot .footer_total_paid,
.contact-view-sales-panel #sell_table tfoot .footer_total_remaining,
.contact-view-sales-panel #sell_table tfoot .footer_total_sell_return_due {
    font-variant-numeric: tabular-nums;
    color: #4338ca;
}

.list-pos-page .dataTables_info {
    font-size: 0.8rem;
    color: var(--text-secondary, #475569);
}

.list-pos-page .dataTables_paginate .paginate_button {
    border-radius: 0.4rem !important;
}

:root[data-theme='dark'] .list-pos-page .list-pos-filters-panel.nestiko-filters-panel {
    border-color: var(--border-strong, #334155);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

:root[data-theme='dark'] .list-pos-page .list-pos-filters-panel .nestiko-filters-panel__head {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
    border-bottom-color: var(--border-strong, #334155);
}

:root[data-theme='dark'] .list-pos-page .list-pos-data-widget.box-solid {
    border-color: var(--border-strong, #334155);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

:root[data-theme='dark'] .list-pos-page .list-pos-data-widget .box-header {
    border-bottom-color: var(--border-strong, #334155);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
}

:root[data-theme='dark'] .list-pos-page #sell_table thead tr th {
    background: linear-gradient(180deg, #4c1d95 0%, #3b0764 100%);
    color: #f1f5f9;
}

:root[data-theme='dark'] .list-pos-page #sell_table tfoot tr.footer-total td,
:root[data-theme='dark'] .contact-view-sales-panel #sell_table tfoot tr.footer-total td {
    background: linear-gradient(180deg, rgba(76, 29, 149, 0.35) 0%, rgba(59, 7, 100, 0.45) 100%);
    color: #e2e8f0;
    border-top-color: rgba(196, 181, 253, 0.35);
}

:root[data-theme='dark'] .list-pos-page #sell_table tfoot .footer_sale_total,
:root[data-theme='dark'] .list-pos-page #sell_table tfoot .footer_total_paid,
:root[data-theme='dark'] .list-pos-page #sell_table tfoot .footer_total_remaining,
:root[data-theme='dark'] .list-pos-page #sell_table tfoot .footer_total_sell_return_due,
:root[data-theme='dark'] .contact-view-sales-panel #sell_table tfoot .footer_sale_total,
:root[data-theme='dark'] .contact-view-sales-panel #sell_table tfoot .footer_total_paid,
:root[data-theme='dark'] .contact-view-sales-panel #sell_table tfoot .footer_total_remaining,
:root[data-theme='dark'] .contact-view-sales-panel #sell_table tfoot .footer_total_sell_return_due {
    color: #c4b5fd;
}

/* Add Draft / Add Quotation — same shell as Add Sale, distinct intro accent */
.add-draft-page .nestiko-shell-page-intro,
.add-quotation-page .nestiko-shell-page-intro {
    border-left: 4px solid #f59e0b;
    padding-left: 1rem;
}

.add-quotation-page .nestiko-shell-page-intro {
    border-left-color: #0ea5e9;
}

:root[data-theme='dark'] .add-draft-page .nestiko-shell-page-intro,
:root[data-theme='dark'] .add-quotation-page .nestiko-shell-page-intro {
    border-left-color: #fbbf24;
}

:root[data-theme='dark'] .add-quotation-page .nestiko-shell-page-intro {
    border-left-color: #38bdf8;
}

/* List Drafts — amber accent on intro (shares list-pos table rules via .list-pos-page) */
.list-drafts-page.list-pos-page .nestiko-shell-page-intro {
    border-left: 4px solid #f59e0b;
    padding-left: 1rem;
}

:root[data-theme='dark'] .list-drafts-page.list-pos-page .nestiko-shell-page-intro {
    border-left-color: #fbbf24;
}

/* List quotations — sky accent (matches Add Quotation) */
.list-quotations-page.list-pos-page .nestiko-shell-page-intro {
    border-left: 4px solid #0ea5e9;
    padding-left: 1rem;
}

:root[data-theme='dark'] .list-quotations-page.list-pos-page .nestiko-shell-page-intro {
    border-left-color: #38bdf8;
}

/* List Sell Return — slate accent */
.sell-return-list-page.list-pos-page .nestiko-shell-page-intro {
    border-left: 4px solid #64748b;
    padding-left: 1rem;
}

:root[data-theme='dark'] .sell-return-list-page.list-pos-page .nestiko-shell-page-intro {
    border-left-color: #94a3b8;
}

/* Shipments list */
.shipments-page.list-pos-page .nestiko-shell-page-intro {
    border-left: 4px solid #6366f1;
    padding-left: 1rem;
}

:root[data-theme='dark'] .shipments-page.list-pos-page .nestiko-shell-page-intro {
    border-left-color: #a5b4fc;
}

/* Subscriptions list (recurring invoices) */
.subscriptions-list-page.list-pos-page .nestiko-shell-page-intro {
    border-left: 4px solid #0d9488;
    padding-left: 1rem;
}

:root[data-theme='dark'] .subscriptions-list-page.list-pos-page .nestiko-shell-page-intro {
    border-left-color: #2dd4bf;
}

/* Import sales */
.import-sales-page.list-pos-page .nestiko-shell-page-intro {
    border-left: 4px solid #f59e0b;
    padding-left: 1rem;
}

:root[data-theme='dark'] .import-sales-page.list-pos-page .nestiko-shell-page-intro {
    border-left-color: #fbbf24;
}

.import-sales-page .nestiko-import-fields-table {
    margin-top: 0.5rem;
    margin-bottom: 0;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--border-default, #e2e8f0);
}

.import-sales-page .nestiko-import-fields-table thead th {
    background: var(--bg-surface-soft, #f1f5f9);
    color: var(--text-primary, #1e293b);
    font-size: 0.82rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
}

.import-sales-page .nestiko-import-history-table thead tr th {
    background: linear-gradient(180deg, #5b3bb8 0%, #4a2fa0 100%);
    color: #f8fafc;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-color: rgba(255, 255, 255, 0.12) !important;
    padding: 0.65rem 0.45rem;
    vertical-align: middle;
}

.import-sales-page .nestiko-import-history-table.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: var(--bg-surface-soft, #f8fafc);
}

.import-sales-page .nestiko-import-history-table tbody tr td {
    border-color: var(--border-default, #e2e8f0);
    font-size: 0.82rem;
    vertical-align: middle;
}

/* —— Home dashboard (/home): DataTables toolbar — same pattern as Superadmin business list —— */
.home-dashboard-page .home-dashboard-dt-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    padding: 0.55rem 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-default, #e2e8f0);
    background: var(--bg-surface-soft, #f8fafc);
}

.home-dashboard-page .home-dashboard-dt-length {
    flex: 0 0 auto;
    min-width: min(100%, 14rem);
}

.home-dashboard-page .home-dashboard-dt-buttons {
    flex: 1 1 14rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
}

.home-dashboard-page .home-dashboard-dt-filter {
    flex: 0 0 auto;
    margin-left: auto;
}

.home-dashboard-page .home-dashboard-dt-toolbar .dataTables_length,
.home-dashboard-page .home-dashboard-dt-toolbar .dataTables_filter {
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.home-dashboard-page .home-dashboard-dt-toolbar .dataTables_length label,
.home-dashboard-page .home-dashboard-dt-toolbar .dataTables_filter label {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.35rem;
    margin: 0;
    min-height: 2rem;
    line-height: 1.2;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
}

.home-dashboard-page .home-dashboard-dt-toolbar .dataTables_length select,
.home-dashboard-page .home-dashboard-dt-toolbar .dataTables_filter input {
    border: 1px solid var(--border-default, #e2e8f0);
    border-radius: 0.45rem;
    padding: 0.28rem 0.45rem;
    font-size: 0.8rem;
    background: var(--bg-surface, #fff);
    color: var(--text-primary, #0f172a);
    min-height: 2rem;
    margin: 0 !important;
    box-sizing: border-box;
    align-self: center;
    vertical-align: middle;
}

.home-dashboard-page .home-dashboard-dt-toolbar .dataTables_length select {
    min-width: 4.5rem;
    max-width: 11rem;
    width: auto !important;
    padding-right: 1.75rem;
}

.home-dashboard-page .home-dashboard-dt-buttons .dt-buttons,
.home-dashboard-page .home-dashboard-dt-buttons .dt-buttons.dt-native-buttons {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 !important;
    float: none !important;
}

.home-dashboard-page .home-dashboard-dt-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.75rem 0;
    margin-top: 0.35rem;
    border-top: 1px solid var(--border-default, #e2e8f0);
}

.home-dashboard-page .home-dashboard-dt-bottom .dataTables_info {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.8rem;
    color: var(--text-secondary, #475569);
}

.home-dashboard-page .home-dashboard-dt-bottom .dataTables_paginate {
    margin: 0 !important;
    padding: 0 !important;
    margin-left: auto !important;
}

.home-dashboard-page .home-dashboard-dt-bottom .dataTables_paginate .paginate_button {
    border-radius: 0.4rem !important;
}

@media (max-width: 991px) {
    .home-dashboard-page .home-dashboard-dt-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .home-dashboard-page .home-dashboard-dt-buttons {
        justify-content: flex-start;
    }

    .home-dashboard-page .home-dashboard-dt-filter {
        margin-left: 0;
        width: 100%;
    }

    .home-dashboard-page .home-dashboard-dt-toolbar .dataTables_filter input {
        width: 100% !important;
        max-width: none;
    }
}

:root[data-theme='dark'] .home-dashboard-page .home-dashboard-dt-toolbar {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-default, #22314d);
}

:root[data-theme='dark'] .home-dashboard-page .home-dashboard-dt-toolbar .dataTables_length select,
:root[data-theme='dark'] .home-dashboard-page .home-dashboard-dt-toolbar .dataTables_filter input {
    background: #1a2740;
    border-color: #334866;
    color: #e2e8f0;
}

:root[data-theme='dark'] .home-dashboard-page .home-dashboard-dt-toolbar .dataTables_length label,
:root[data-theme='dark'] .home-dashboard-page .home-dashboard-dt-toolbar .dataTables_filter label {
    color: var(--text-muted, #94a3b8);
}

:root[data-theme='dark'] .home-dashboard-page .home-dashboard-dt-bottom {
    border-top-color: var(--border-default, #22314d);
}

:root[data-theme='dark'] .home-dashboard-page .home-dashboard-dt-bottom .dataTables_info {
    color: var(--text-muted, #94a3b8);
}

:root[data-theme='dark'] .home-dashboard-page .dataTables_wrapper .dt-buttons .dt-button,
:root[data-theme='dark'] .home-dashboard-page .dataTables_wrapper .dt-buttons a.dt-button,
:root[data-theme='dark'] .home-dashboard-page .dataTables_wrapper .dt-buttons button.dt-button {
    background: var(--bg-surface-soft, #1a2740) !important;
    border-color: var(--border-strong, #334866) !important;
    color: var(--text-primary, #e2e8f0) !important;
}

:root[data-theme='dark'] .home-dashboard-page .dataTables_wrapper .dt-buttons .dt-button:hover,
:root[data-theme='dark'] .home-dashboard-page .dataTables_wrapper .dt-buttons .dt-button:focus {
    background: rgba(51, 65, 85, 0.55) !important;
    border-color: #4b6fc8 !important;
    color: #fff !important;
}

/* Select2 multi-select (nestiko-select2.css): ensure badge layout wins over page-scoped min-heights */
body .select2-container--default .select2-selection.select2-selection--multiple {
    min-height: auto !important;
}

.select2-container--default[dir='rtl'] .select2-selection--multiple .select2-selection__choice,
.select2-container--default[dir='rtl'] .select2-selection--multiple .select2-selection__placeholder,
.select2-container--default[dir='rtl'] .select2-selection--multiple .select2-search--inline {
    float: none !important;
}
