/* BD Tiles Fittings 360 - Professional interface refinement */
:root {
    --bdtf-sidebar-width: 250px;
    --bdtf-sidebar-collapsed: 82px;
    --bdtf-header-height: 76px;
    --bdtf-navy: #10243f;
    --bdtf-teal: #087f73;
    --bdtf-teal-dark: #075e56;
    --bdtf-purple: #6d4aff;
    --bdtf-sky: #2b8cff;
    --bdtf-amber: #f59e0b;
    --bdtf-rose: #e94f64;
    --bdtf-page-bg: #f4f7fb;
    --bdtf-border: #e2e8f0;
    --bdtf-text: #172033;
    --bdtf-muted: #6b7890;
}

html { scroll-behavior: auto !important; }
body.bdtf-app-shell { overflow-x: hidden; background: var(--bdtf-page-bg); }
body.bdtf-app-shell #loader { display: none !important; }
.bdtf-page-content { display: block !important; min-height: calc(100vh - 126px); padding-bottom: 28px; }

/* Header */
.page header.container-fluid {
    left: 0;
    width: 100%;
    min-height: var(--bdtf-header-height);
    border-bottom: 1px solid rgba(203, 213, 225, .75);
    box-shadow: 0 8px 30px rgba(15, 23, 42, .055);
}
.page .navbar {
    min-height: var(--bdtf-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 24px;
}
.bdtf-header-left { display: flex; align-items: center; min-width: 0; gap: 14px; }
.bdtf-header-context { flex-direction: column; min-width: 0; line-height: 1.15; }
.bdtf-header-kicker { color: var(--bdtf-muted); font-size: 9px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; }
.bdtf-header-module { max-width: 340px; margin-top: 4px; color: var(--bdtf-text); font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page .navbar .nav-menu { margin-left: auto; gap: 4px; }
.page .navbar .nav-menu > li,
.page .navbar .nav-menu > div { display: flex; align-items: center; }
.page .navbar .nav-menu > li > a:not(.btn-pos),
.page .navbar .nav-menu > div > a:not(.btn-pos) {
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 10px;
    border: 1px solid transparent;
    color: #6253d9;
}
.page .navbar .nav-menu > li > a:not(.btn-pos):hover,
.page .navbar .nav-menu > div > a:not(.btn-pos):hover {
    border-color: #ddd8ff;
    background: #f3f1ff;
    transform: none;
}
.page .navbar .menu-btn,
.page .navbar .btn-pos { width: 46px; height: 46px; border-radius: 13px !important; }
.page .navbar .btn-pos span { font-weight: 800; }
.page .navbar .right-sidebar {
    top: 60px;
    right: 12px;
    min-width: 235px;
    padding: 8px;
    border: 1px solid var(--bdtf-border);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .16);
}
.page .navbar .right-sidebar li a { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 9px; color: #445169; }
.page .navbar .right-sidebar li a:hover { color: var(--bdtf-primary); background: #ecfdf7; }

/* Sidebar */
nav.side-navbar { width: var(--bdtf-sidebar-width); overflow: visible; }
.page { width: calc(100% - var(--bdtf-sidebar-width)); margin-left: var(--bdtf-sidebar-width); }
nav.side-navbar.shrink { width: var(--bdtf-sidebar-collapsed); }
.page.active { width: calc(100% - var(--bdtf-sidebar-collapsed)); margin-left: var(--bdtf-sidebar-collapsed); }
.side-navbar .brand-big {
    height: var(--bdtf-header-height);
    min-height: var(--bdtf-header-height);
    display: flex;
    align-items: center;
    padding: 8px 15px;
    overflow: hidden;
}
.side-navbar .brand-big > a { display: block; width: 100%; overflow: hidden; }
.side-navbar .bdtf-brand { width: 100%; gap: 10px; }
.side-navbar .bdtf-brand-symbol { width: 48px; height: 48px; flex: 0 0 48px; }
.side-navbar .bdtf-brand-copy { min-width: 0; overflow: hidden; }
.side-navbar .bdtf-brand-copy strong { display: block; max-width: 160px; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
nav.side-navbar #side-main-menu { height: calc(100vh - var(--bdtf-header-height)); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
nav.side-navbar #side-main-menu::-webkit-scrollbar { width: 5px; }
nav.side-navbar #side-main-menu::-webkit-scrollbar-thumb { border-radius: 99px; background: #cbd5e1; }
nav.side-navbar ul li > a { padding: 10px 12px; border-radius: 12px; }
nav.side-navbar ul li > a > i:first-child {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 9px;
    border-radius: 9px;
    color: #6d4aff;
    background: #f1efff;
    font-size: 15px;
}
nav.side-navbar ul li:nth-child(4n+2) > a > i:first-child { color: #087f73; background: #e8fbf7; }
nav.side-navbar ul li:nth-child(4n+3) > a > i:first-child { color: #d97706; background: #fff7df; }
nav.side-navbar ul li:nth-child(4n+4) > a > i:first-child { color: #2563eb; background: #eaf2ff; }
nav.side-navbar ul li > a:hover > i:first-child { color: #fff; background: var(--bdtf-primary); transform: none; }
nav.side-navbar ul li.active > a > i:first-child,
nav.side-navbar ul li > a[aria-expanded="true"] > i:first-child { color: var(--bdtf-primary); background: #fff; }
nav.side-navbar ul li > a[aria-expanded="true"] { transform: none; }
nav.side-navbar ul ul { margin-left: 27px; padding-left: 12px; }
nav.side-navbar ul ul li a { padding: 8px 11px; border-radius: 8px; }
nav.side-navbar ul ul li a i { display: none !important; }
nav.side-navbar ul ul li.bdtf-priority-menu a { color: #075e56; background: #eafaf6 !important; font-weight: 800; }
nav.side-navbar.shrink ul li > a > i:first-child { margin-right: 0; }
nav.side-navbar.shrink .brand-big { padding: 8px 16px; }
nav.side-navbar.shrink .bdtf-brand-symbol { width: 48px; height: 48px; flex-basis: 48px; }

/* Page headings, filter cards and form layout */
.bdtf-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 24px; }
.bdtf-page-heading h2 { margin: 7px 0 4px; font-size: 27px; font-weight: 850; }
.bdtf-page-heading p { margin: 0; color: var(--bdtf-muted); }
.bdtf-page-eyebrow { display: inline-flex; align-items: center; gap: 7px; color: var(--bdtf-primary); font-size: 10px; font-weight: 850; letter-spacing: .7px; text-transform: uppercase; }
.bdtf-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.card > .card-header.mt-2 { margin-top: 0 !important; }
.card > .card-header h3.text-center { margin: 0; text-align: left !important; font-size: 19px; font-weight: 820; }
section > .container-fluid:first-child { padding-top: 20px; }
section > .container-fluid > .card:first-child { overflow: visible; }

/* Tables */
.table-responsive,
.bdtf-pro-table-wrap {
    margin: 14px 16px 24px;
    border: 1px solid var(--bdtf-border);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(15, 23, 42, .055);
    overflow-x: auto;
}
.table-responsive > table { margin-bottom: 0; }
table.table { width: 100% !important; margin-bottom: 0; border-collapse: separate; border-spacing: 0; }
table.table thead th {
    height: 48px;
    padding: 12px 13px;
    border: 0;
    border-bottom: 1px solid #dbe5ef;
    color: #ecfdf5;
    background: linear-gradient(105deg, #12334f, #087f73);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .48px;
    text-transform: uppercase;
    vertical-align: middle;
}
table.table thead th:first-child { border-top-left-radius: 13px; }
table.table thead th:last-child { border-top-right-radius: 13px; }
table.table tbody td { padding: 12px 13px; color: #46536a; border-top: 0; border-bottom: 1px solid #edf2f7; vertical-align: middle; }
table.table tbody tr:nth-child(even) td { background: #fafcff; }
table.table tbody tr:hover td { color: #173a36; background: #eefbf7 !important; }
table.table tfoot th,
table.table tfoot td,
table.table .tfoot th,
table.table .tfoot td {
    padding: 13px;
    border-top: 2px solid #a7e5d9 !important;
    border-bottom: 0;
    color: #083f3a;
    background: linear-gradient(90deg, #ddfaf3, #effcf8) !important;
    font-weight: 850;
    vertical-align: middle;
}
table.table tfoot th:first-child,
table.table tfoot td:first-child { border-bottom-left-radius: 13px; }
table.table tfoot th:last-child,
table.table tfoot td:last-child { border-bottom-right-radius: 13px; }
.table .btn-group .btn,
.table .btn-sm { min-height: 32px; padding: 5px 9px; border-radius: 8px; }
.dataTables_wrapper { padding: 17px 18px 12px; }
.dataTables_wrapper .row:first-child { align-items: center; margin-bottom: 12px; }
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter { color: #66758b; font-size: 11px; font-weight: 700; }
.dataTables_wrapper .dataTables_filter input { width: 190px; margin-left: 8px; }
.dataTables_wrapper .dt-buttons { display: inline-flex; flex-wrap: wrap; gap: 5px; margin-left: 10px; }
.dataTables_wrapper .dt-buttons .btn,
.dataTables_wrapper .dt-buttons button {
    min-height: 35px;
    padding: 7px 10px;
    border: 0;
    border-radius: 8px !important;
    color: #fff;
    background: #63718a;
    font-size: 10px;
    font-weight: 800;
}
.dataTables_wrapper .dt-buttons .buttons-pdf { background: #e4485e; }
.dataTables_wrapper .dt-buttons .buttons-excel { background: #15965a; }
.dataTables_wrapper .dt-buttons .buttons-csv { background: #2686c9; }
.dataTables_wrapper .dt-buttons .buttons-print { background: #334155; }
.dataTables_wrapper .dt-buttons .buttons-colvis { background: #6d4aff; }
.dataTables_info { padding-top: 15px !important; color: #8490a2 !important; }
.dataTables_paginate { padding-top: 10px !important; }
table.fixedHeader-floating,
table.fixedHeader-locked { display: none !important; }

/* Report UI */
.bdtf-report-center { padding-bottom: 30px; }
.bdtf-report-filter-card { overflow: visible; }
.bdtf-filter-card-header,
.bdtf-result-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bdtf-filter-card-header strong { display: block; color: var(--bdtf-text); font-size: 15px; }
.bdtf-filter-card-header small { display: block; margin-top: 4px; color: var(--bdtf-muted); }
.bdtf-date-presets { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.bdtf-date-presets button {
    padding: 7px 10px;
    border: 1px solid #dbe3ed;
    border-radius: 8px;
    color: #56657c;
    background: #fff;
    font-size: 10px;
    font-weight: 750;
    cursor: pointer;
}
.bdtf-date-presets button:hover { color: #fff; border-color: var(--bdtf-primary); background: var(--bdtf-primary); }
.bdtf-smart-filter-form .form-group { margin-bottom: 16px; }
.bdtf-smart-filter-form label { margin-bottom: 6px; color: #536176; font-size: 10px; font-weight: 850; letter-spacing: .35px; text-transform: uppercase; }
.bdtf-filter-footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 3px; border-top: 1px dashed #e2e8f0; }
.bdtf-report-summary-card {
    position: relative;
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding: 18px 20px;
    border-radius: 15px;
    color: #fff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .12);
}
.bdtf-report-summary-card::after { content: ''; position: absolute; right: -24px; bottom: -33px; width: 105px; height: 105px; border: 18px solid rgba(255,255,255,.11); border-radius: 50%; }
.bdtf-report-summary-card span { position: relative; z-index: 1; font-size: 10px; font-weight: 800; letter-spacing: .55px; text-transform: uppercase; opacity: .82; }
.bdtf-report-summary-card strong { position: relative; z-index: 1; margin-top: 7px; font-size: 25px; font-weight: 850; }
.bdtf-summary-1 { background: linear-gradient(135deg, #0f766e, #0d9488); }
.bdtf-summary-2 { background: linear-gradient(135deg, #5740d9, #7c3aed); }
.bdtf-summary-3 { background: linear-gradient(135deg, #1676d2, #38a0ef); }
.bdtf-summary-4 { background: linear-gradient(135deg, #ed8a08, #f97316); }
.bdtf-report-result-card { overflow: visible; }
.bdtf-result-header h4 { margin: 4px 0 0; }
.bdtf-export-toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.bdtf-export-toolbar .btn { min-height: 36px; padding: 7px 11px; font-size: 10px; }
.bdtf-report-result-card .table-responsive { margin: 0; border: 0; border-top: 1px solid var(--bdtf-border); border-radius: 0 0 15px 15px; box-shadow: none; }
.bdtf-report-result-card .table thead th:first-child,
.bdtf-report-result-card .table thead th:last-child { border-radius: 0; }

/* Existing report pages */
body.bdtf-report-page section > .container-fluid > .card:first-child,
body.bdtf-report-page section > .container-fluid:first-child > .card:first-child { border-top: 4px solid var(--bdtf-primary); }
body.bdtf-report-page .card-header h3,
body.bdtf-report-page .card-header h4 { text-align: left !important; }
body.bdtf-report-page .bdtf-auto-export-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 16px 0; }

/* Stabilise layout */
.animate-bottom { animation: none !important; }
.mCSB_container { margin-right: 0 !important; }
.mCSB_scrollTools { display: none !important; }
.bootstrap-select .dropdown-toggle:focus { outline: none !important; }

@media (max-width: 1199px) {
    nav.side-navbar { width: var(--bdtf-sidebar-width); transform: translateX(-100%); transition: transform .22s ease; }
    nav.side-navbar:not(.shrink) { transform: translateX(0); }
    .page, .page.active, .page.active-sm { width: 100%; margin-left: 0; }
    .page .navbar { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 767px) {
    .page .navbar { gap: 8px; }
    .page .navbar .nav-menu { gap: 1px; }
    .page .navbar .nav-menu > li > a:not(.btn-pos),
    .page .navbar .nav-menu > div > a:not(.btn-pos) { min-width: 36px; min-height: 36px; padding: 6px; }
    .page .navbar .menu-btn, .page .navbar .btn-pos { width: 40px; height: 40px; }
    .bdtf-page-heading,
    .bdtf-filter-card-header,
    .bdtf-result-header { align-items: flex-start; flex-direction: column; }
    .bdtf-heading-actions,
    .bdtf-date-presets,
    .bdtf-export-toolbar { justify-content: flex-start; }
    .table-responsive { margin-left: 8px; margin-right: 8px; }
    .dataTables_wrapper { padding: 12px 10px; }
    .dataTables_wrapper .dataTables_filter input { width: 145px; }
}

/* ========================================================================
   BD Tiles Fittings 360 - Visual refinement pack
   Header labels, responsive KPI cards, POS workspace, tables, status colours,
   navigation states and complete light/dark theme alignment.
   ======================================================================== */
:root {
    --bdtf-shell-bg: #f3f7fa;
    --bdtf-surface-strong: #ffffff;
    --bdtf-surface-soft: #f8fbfc;
    --bdtf-surface-muted: #eef4f6;
    --bdtf-border-strong: #d8e3e8;
    --bdtf-copy: #152238;
    --bdtf-copy-soft: #52627a;
    --bdtf-copy-muted: #8592a6;
    --bdtf-table-head: #0b625c;
    --bdtf-table-head-text: #ffffff;
    --bdtf-table-foot: #dff3ef;
    --bdtf-table-foot-text: #0b4f49;
    --bdtf-row-hover: #edf9f6;
    --bdtf-sidebar-active: #0b756b;
    --bdtf-sidebar-active-soft: #e5f7f3;
    --bdtf-success: #15945f;
    --bdtf-warning: #d98508;
    --bdtf-danger: #dc3e55;
    --bdtf-info: #287fd0;
    --bdtf-secondary: #68768a;
}

html[data-bdtf-theme="dark"],
body.dark-mode {
    --bdtf-shell-bg: #07111d;
    --bdtf-surface-strong: #0f1b2b;
    --bdtf-surface-soft: #132235;
    --bdtf-surface-muted: #192a3e;
    --bdtf-border-strong: #273a50;
    --bdtf-copy: #f2f7fb;
    --bdtf-copy-soft: #becbdd;
    --bdtf-copy-muted: #8797ad;
    --bdtf-table-head: #0a6c63;
    --bdtf-table-head-text: #ffffff;
    --bdtf-table-foot: #163f3b;
    --bdtf-table-foot-text: #dcfff8;
    --bdtf-row-hover: #16312f;
    --bdtf-sidebar-active-soft: #123934;
}

body.bdtf-app-shell,
body.pos-page { background: var(--bdtf-shell-bg) !important; color: var(--bdtf-copy-soft); }
.page { background: var(--bdtf-shell-bg); }

/* Header: readable primary actions and balanced utility controls */
.page header.container-fluid {
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(14px);
}
.page .navbar {
    padding: 10px 22px;
    gap: 16px;
}
.bdtf-header-left { flex: 1 1 auto; }
.bdtf-header-context { max-width: min(340px, 30vw); }
.page .navbar .nav-menu {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 7px;
}
.page .navbar .nav-menu > li > a,
.page .navbar .nav-menu > div > a {
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.page .navbar .bdtf-header-action {
    width: auto !important;
    min-width: 98px;
    height: 44px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    color: #fff !important;
    background: var(--bdtf-primary) !important;
    box-shadow: 0 8px 18px rgba(15, 118, 110, .18);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.page .navbar .bdtf-header-action:hover {
    color: #fff !important;
    background: var(--bdtf-dark) !important;
    box-shadow: 0 10px 22px rgba(15, 48, 45, .22);
}
.page .navbar .bdtf-pos-launch { background: #0f766e !important; }
.page .navbar .bdtf-quick-add-toggle { background: #126c64 !important; }
.bdtf-action-caret { margin-left: 1px; font-size: 10px; opacity: .8; }
.page .navbar .bdtf-icon-action,
.page .navbar .bdtf-language-trigger {
    width: 42px;
    min-width: 42px !important;
    height: 42px;
    min-height: 42px !important;
    padding: 0 !important;
    border: 1px solid var(--bdtf-border-strong) !important;
    border-radius: 11px;
    color: #6253d9 !important;
    background: var(--bdtf-surface-strong);
}
.page .navbar .bdtf-icon-action:hover,
.page .navbar .bdtf-language-trigger:hover {
    color: var(--bdtf-primary) !important;
    border-color: rgba(15, 118, 110, .28) !important;
    background: var(--bdtf-sidebar-active-soft) !important;
}
.bdtf-language-menu .bdtf-language-trigger { width: auto; gap: 7px; padding: 0 11px !important; }
.bdtf-language-menu .right-sidebar { min-width: 190px; }
.bdtf-language-menu .right-sidebar a { width: 100%; justify-content: flex-start; }
.bdtf-language-menu .right-sidebar a.is-active-language { color: var(--bdtf-primary); background: var(--bdtf-sidebar-active-soft); font-weight: 800; }
.bdtf-language-code {
    width: 30px;
    padding: 3px 5px;
    border-radius: 6px;
    color: var(--bdtf-primary);
    background: var(--bdtf-sidebar-active-soft);
    font-size: 9px;
    font-weight: 900;
    text-align: center;
}
.bdtf-user-menu-trigger {
    min-width: 126px !important;
    justify-content: flex-start !important;
    padding: 8px 11px !important;
    border: 1px solid transparent !important;
    border-radius: 11px;
}
.bdtf-user-menu-trigger > span {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sidebar: professional icon system and unmistakable active/inactive states */
nav.side-navbar {
    border-right: 1px solid var(--bdtf-border-strong);
    background: var(--bdtf-surface-strong);
}
.side-navbar .brand-big { border-bottom: 1px solid var(--bdtf-border-strong); }
nav.side-navbar ul li > a {
    position: relative;
    margin: 2px 8px;
    padding: 9px 10px;
    color: var(--bdtf-copy-soft);
    font-size: 12.5px;
    font-weight: 650;
    border: 1px solid transparent;
    border-radius: 10px;
}
nav.side-navbar ul li > a > i:first-child,
nav.side-navbar ul li:nth-child(4n+2) > a > i:first-child,
nav.side-navbar ul li:nth-child(4n+3) > a > i:first-child,
nav.side-navbar ul li:nth-child(4n+4) > a > i:first-child {
    width: 34px;
    height: 34px;
    min-width: 34px;
    color: var(--bdtf-primary);
    background: var(--bdtf-sidebar-active-soft);
    border-radius: 9px;
}
nav.side-navbar ul li > a:hover {
    color: var(--bdtf-primary);
    border-color: rgba(15, 118, 110, .13);
    background: var(--bdtf-sidebar-active-soft);
}
nav.side-navbar ul li > a:hover > i:first-child {
    color: #fff;
    background: var(--bdtf-primary);
}
nav.side-navbar > ul > li.bdtf-parent-active > a,
nav.side-navbar > ul > li.bdtf-menu-open > a,
nav.side-navbar #side-main-menu > li.active > a {
    color: #fff !important;
    border-color: transparent;
    background: var(--bdtf-sidebar-active) !important;
    box-shadow: 0 7px 16px rgba(15, 118, 110, .18);
}
nav.side-navbar > ul > li.bdtf-parent-active > a > i:first-child,
nav.side-navbar > ul > li.bdtf-menu-open > a > i:first-child,
nav.side-navbar #side-main-menu > li.active > a > i:first-child {
    color: var(--bdtf-primary) !important;
    background: #fff !important;
}
nav.side-navbar ul ul {
    margin: 2px 11px 7px 24px;
    padding: 4px 0 4px 11px;
    border-left: 1px solid var(--bdtf-border-strong);
}
nav.side-navbar ul ul li a {
    min-height: 34px;
    margin: 1px 4px;
    padding: 8px 10px 8px 17px;
    color: var(--bdtf-copy-muted);
    background: transparent !important;
    font-size: 11.5px;
    font-weight: 600;
}
nav.side-navbar ul ul li a::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 50%;
    width: 6px;
    height: 6px;
    border: 2px solid #a9b7c7;
    border-radius: 50%;
    transform: translateY(-50%);
}
nav.side-navbar ul ul li a:hover {
    color: var(--bdtf-primary);
    background: var(--bdtf-sidebar-active-soft) !important;
}
nav.side-navbar ul ul li.bdtf-current-menu > a,
nav.side-navbar ul ul li.active > a,
nav.side-navbar ul ul a.bdtf-current-link {
    color: var(--bdtf-primary) !important;
    background: var(--bdtf-sidebar-active-soft) !important;
    font-weight: 800;
}
nav.side-navbar ul ul li.bdtf-current-menu > a::before,
nav.side-navbar ul ul li.active > a::before,
nav.side-navbar ul ul a.bdtf-current-link::before {
    border-color: var(--bdtf-primary);
    background: var(--bdtf-primary);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, .10);
}
nav.side-navbar.shrink ul li > a { margin-left: 9px; margin-right: 9px; }
nav.side-navbar.shrink ul li > a > i:first-child { width: 38px; height: 38px; min-width: 38px; }

/* Dashboard KPI cards: values never escape their cards */
.bdtf-stat-grid > [class*="col-"] { min-width: 0; }
.bdtf-stat-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 19px;
}
.bdtf-stat-copy {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}
.bdtf-stat-copy > span,
.bdtf-stat-copy em {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bdtf-stat-copy strong {
    width: 100%;
    max-width: 100%;
    display: block;
    overflow: hidden;
    margin: 5px 0 6px;
    color: var(--bdtf-copy);
    font-size: clamp(17px, 1.48vw, 23px);
    line-height: 1.16;
    letter-spacing: -.45px;
    white-space: nowrap;
    text-overflow: clip;
    font-variant-numeric: tabular-nums;
}
.bdtf-stat-copy strong small {
    display: block;
    margin-bottom: 2px;
    font-size: 9px;
    line-height: 1;
}
.bdtf-panel-card,
.bdtf-dashboard-toolbar,
.bdtf-health-card,
.bdtf-stat-card { background: var(--bdtf-surface-strong); border-color: var(--bdtf-border-strong); }

/* Tables: comfortable type, solid header/footer and reliable horizontal movement */
.table-responsive,
.bdtf-pro-table-wrap {
    max-width: calc(100% - 32px);
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 118, 110, .55) var(--bdtf-surface-muted);
}
.table-responsive::-webkit-scrollbar,
.bdtf-pro-table-wrap::-webkit-scrollbar { height: 10px; }
.table-responsive::-webkit-scrollbar-track,
.bdtf-pro-table-wrap::-webkit-scrollbar-track { background: var(--bdtf-surface-muted); border-radius: 99px; }
.table-responsive::-webkit-scrollbar-thumb,
.bdtf-pro-table-wrap::-webkit-scrollbar-thumb { background: rgba(15, 118, 110, .58); border-radius: 99px; }
table.table {
    min-width: 100%;
    color: var(--bdtf-copy-soft);
    background: var(--bdtf-surface-strong);
    font-size: 13.25px;
    line-height: 1.42;
}
table.table.bdtf-wide-table { width: max-content !important; }
table.table thead th,
table.table.dataTable thead th {
    height: 54px;
    padding: 13px 15px;
    color: var(--bdtf-table-head-text) !important;
    background: var(--bdtf-table-head) !important;
    border-right: 1px solid rgba(255,255,255,.09) !important;
    border-bottom: 0 !important;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .28px;
    line-height: 1.25;
    text-transform: uppercase;
    white-space: nowrap;
}
table.table thead th:last-child { border-right: 0 !important; }
table.table tbody td {
    min-height: 48px;
    padding: 13px 15px;
    color: var(--bdtf-copy-soft);
    background: var(--bdtf-surface-strong);
    border-bottom: 1px solid var(--bdtf-border-strong);
    font-size: 13.25px;
    vertical-align: middle;
}
table.table tbody tr:nth-child(even) td { background: var(--bdtf-surface-soft); }
table.table tbody tr:hover td { color: var(--bdtf-copy); background: var(--bdtf-row-hover) !important; }
table.table tfoot th,
table.table tfoot td,
table.table .tfoot th,
table.table .tfoot td {
    min-height: 51px;
    padding: 14px 15px;
    color: var(--bdtf-table-foot-text) !important;
    background: var(--bdtf-table-foot) !important;
    border-top: 2px solid rgba(15, 118, 110, .26) !important;
    border-bottom: 0 !important;
    font-size: 13px;
    font-weight: 850;
    line-height: 1.3;
    white-space: nowrap;
}
.dataTables_wrapper { color: var(--bdtf-copy-soft); font-size: 12px; }
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter { font-size: 12px; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    min-height: 39px;
    color: var(--bdtf-copy);
    background: var(--bdtf-surface-strong);
    border: 1px solid var(--bdtf-border-strong);
    border-radius: 9px;
}
.dataTables_wrapper .dt-buttons .btn,
.dataTables_wrapper .dt-buttons button { min-height: 38px; padding: 8px 12px; font-size: 11px; }
.dataTables_info { color: var(--bdtf-copy-muted) !important; font-size: 12px; }
.dataTables_paginate .paginate_button,
.page-item .page-link { min-width: 37px; min-height: 37px; font-size: 12px; }

/* Status colours: consistent across all list/report pages */
.bdtf-status-badge,
.table .badge,
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}
.badge-success { color: #087346 !important; background: #dcf8e9 !important; border-color: #b8efd3 !important; }
.badge-warning { color: #965b00 !important; background: #fff1cc !important; border-color: #f8dda0 !important; }
.badge-danger { color: #ad243a !important; background: #ffe1e6 !important; border-color: #f7bdc7 !important; }
.badge-info,
.badge-primary { color: #175fa0 !important; background: #dceeff !important; border-color: #b9dcfa !important; }
.badge-secondary { color: #586577 !important; background: #e9eef3 !important; border-color: #d7e0e8 !important; }

/* POS: clean two-panel workspace with usable product cards and checkout area */
body.bdtf-pos-body,
body.bdtf-pos-ready { background: var(--bdtf-shell-bg) !important; }
.bdtf-pos-shell { padding: 14px 0 18px !important; }
.bdtf-pos-shell > .container-fluid { padding: 0 16px !important; }
.bdtf-pos-shell > .container-fluid > .row { align-items: stretch; }
.bdtf-pos-catalog,
.bdtf-pos-cart { min-width: 0; }
.bdtf-pos-catalog {
    padding: 0 12px !important;
}
.bdtf-pos-cart {
    padding: 0 12px 0 4px !important;
}
.bdtf-pos-navbar {
    min-height: 64px;
    margin: 0 0 12px !important;
    padding: 8px 12px !important;
    border: 1px solid var(--bdtf-border-strong);
    border-radius: 14px !important;
    background: var(--bdtf-surface-strong) !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .07) !important;
}
.bdtf-pos-navbar .menu-btn,
.bdtf-pos-navbar .nav-menu > li > a {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid var(--bdtf-border-strong);
    border-radius: 10px;
    color: #6253d9;
    background: var(--bdtf-surface-strong);
}
.bdtf-pos-navbar .menu-btn { color: #fff; border-color: transparent; background: var(--bdtf-primary); }
.bdtf-pos-navbar .nav-menu { gap: 5px; }
.bdtf-pos-navbar .nav-menu > li { margin-left: 0 !important; }
.bdtf-pos-navbar .nav-menu > li > a:hover { color: var(--bdtf-primary); background: var(--bdtf-sidebar-active-soft); }
.bdtf-pos-tool-label { display: none; font-size: 10px; font-weight: 750; }
.bdtf-pos-cart > form,
.bdtf-pos-cart .payment-form {
    min-height: calc(100vh - 30px);
    padding: 15px;
    border: 1px solid var(--bdtf-border-strong);
    border-radius: 17px;
    background: var(--bdtf-surface-strong);
    box-shadow: 0 13px 32px rgba(15, 23, 42, .07);
}
.pos-page .top-fields { margin-top: 5px; }
.pos-page .top-fields label {
    top: -7px;
    color: var(--bdtf-copy-muted);
    background: var(--bdtf-surface-strong);
    font-size: 10px;
    font-weight: 750;
}
.pos-page .top-fields input,
.pos-page .top-fields .btn,
.pos-page .top-fields .dropdown-toggle {
    height: 42px !important;
    color: var(--bdtf-copy);
    background: var(--bdtf-surface-strong) !important;
    border: 1px solid var(--bdtf-border-strong) !important;
    border-radius: 10px !important;
}
.more-options {
    min-height: 42px;
    margin: 5px 0 0;
    border-radius: 10px !important;
    box-shadow: none;
}
.bdtf-pos-search { position: relative; margin: 10px 0 12px !important; }
.bdtf-pos-search > i {
    position: absolute;
    left: 15px;
    top: 50%;
    z-index: 3;
    color: var(--bdtf-primary);
    font-size: 16px;
    transform: translateY(-50%);
}
.bdtf-pos-search .form-control {
    height: 48px;
    padding: 10px 14px 10px 43px;
    border: 1px solid rgba(15, 118, 110, .30) !important;
    border-radius: 12px;
    color: var(--bdtf-copy);
    background: var(--bdtf-surface-strong);
    font-size: 13px;
    box-shadow: 0 6px 18px rgba(15, 118, 110, .06);
}
.bdtf-pos-search .form-control:focus { border-color: var(--bdtf-primary) !important; box-shadow: 0 0 0 3px rgba(15, 118, 110, .10); }
.pos-page .product-btns { gap: 8px; margin: 0 0 12px; }
.pos-page .product-btns .btn {
    min-height: 43px;
    margin: 0 !important;
    border: 1px solid var(--bdtf-border-strong) !important;
    border-radius: 11px !important;
    color: var(--bdtf-copy-soft) !important;
    background: var(--bdtf-surface-strong) !important;
    font-size: 12px;
    font-weight: 800;
    box-shadow: none;
}
.pos-page .product-btns .btn:hover,
.pos-page .product-btns .btn.is-active-filter {
    color: #fff !important;
    border-color: var(--bdtf-primary) !important;
    background: var(--bdtf-primary) !important;
    box-shadow: 0 7px 17px rgba(15, 118, 110, .18);
}
.pos-page .table-container.main {
    height: calc(100vh - 148px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 2px 14px;
    border: 1px solid var(--bdtf-border-strong);
    border-radius: 14px;
    background: var(--bdtf-surface-soft);
}
.pos-page .product-grid { align-content: flex-start; }
.pos-page .product-grid > div {
    width: calc(100% / 3) !important;
    min-width: 0;
    max-width: none;
    min-height: 174px;
    padding: 10px !important;
    border: 0 !important;
    border-right: 1px solid var(--bdtf-border-strong) !important;
    border-bottom: 1px solid var(--bdtf-border-strong) !important;
    border-radius: 0;
    background: var(--bdtf-surface-strong) !important;
}
.pos-page .product-grid > div:hover {
    z-index: 2;
    transform: none;
    background: var(--bdtf-row-hover) !important;
    box-shadow: inset 0 0 0 2px rgba(15, 118, 110, .28);
}
.pos-page .product-grid > div img {
    width: 100%;
    height: 94px;
    object-fit: contain;
    padding: 5px;
    border-radius: 10px;
    background: #fff;
}
.pos-page .product-grid > div p {
    min-height: 38px;
    margin: 8px 0 3px;
    color: var(--bdtf-copy);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.45;
}
.pos-page .product-grid > div span { color: var(--bdtf-copy-muted); font-size: 10.5px; font-weight: 650; }
.bdtf-pos-cart-table {
    height: calc(100vh - 400px);
    min-height: 235px;
    margin: 0 !important;
    border: 1px solid var(--bdtf-border-strong);
    border-radius: 13px;
    background: var(--bdtf-surface-strong);
}
.pos-page #myTable { min-width: 700px; }
.pos-page #myTable thead th {
    height: 45px;
    padding: 10px 12px;
    color: #fff !important;
    background: var(--bdtf-table-head) !important;
    font-size: 10.5px;
}
.pos-page #tbody-id tr td { padding: 11px 8px; font-size: 12px; }
.pos-page .edit-product { color: var(--bdtf-copy); font-size: 12.5px; line-height: 1.4; }
.pos-page .minus,
.pos-page .plus,
.pos-page .ibtnDel { min-width: 34px; min-height: 34px; padding: 5px 8px; border-radius: 8px !important; }
.pos-page .numkey.qty { min-width: 48px; min-height: 34px; border-radius: 8px; }
.bdtf-pos-totals {
    padding: 10px 12px !important;
    border-top: 1px solid var(--bdtf-border-strong) !important;
    color: var(--bdtf-copy-soft);
    background: var(--bdtf-surface-soft) !important;
}
.bdtf-pos-totals .totals-title { display: block; color: var(--bdtf-copy-muted); font-size: 9.5px; text-transform: uppercase; }
.bdtf-pos-totals strong:not(.totals-title) { color: var(--bdtf-copy); font-size: 12.5px; }
.bdtf-pos-grand-total {
    margin-top: 10px;
    padding: 13px 18px;
    border: 0;
    border-radius: 13px;
    color: #fff;
    background: var(--bdtf-dark) !important;
    box-shadow: 0 10px 22px rgba(15, 48, 45, .18);
}
.bdtf-pos-grand-total h2 { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 0; color: #fff; font-size: 14px; font-weight: 750; text-transform: uppercase; }
.bdtf-pos-grand-total #grand-total { font-size: 25px; font-weight: 900; font-variant-numeric: tabular-nums; }
.bdtf-pos-payment-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 9px; }
.bdtf-pos-payment-options .column-5 { width: auto !important; margin: 0 !important; padding: 0 !important; }
.bdtf-pos-payment-options .more-payment-options { grid-column: span 1; }
.bdtf-pos-payment-options .btn-custom {
    width: 100%;
    min-height: 43px;
    margin: 0;
    padding: 8px 7px;
    border: 0;
    border-radius: 10px !important;
    color: #fff;
    font-size: 10.5px;
    font-weight: 800;
    white-space: normal;
}

/* Complete dark-theme alignment */
body.dark-mode .page header.container-fluid,
body.dark-mode nav.side-navbar,
body.dark-mode .side-navbar .brand-big,
body.dark-mode .card,
body.dark-mode .card-header,
body.dark-mode .modal-content,
body.dark-mode .modal-header,
body.dark-mode .modal-footer,
body.dark-mode .table-responsive,
body.dark-mode .bdtf-pro-table-wrap,
body.dark-mode .bdtf-pos-navbar,
body.dark-mode .bdtf-pos-cart > form,
body.dark-mode .bdtf-pos-cart .payment-form,
body.dark-mode .dropdown-menu,
body.dark-mode .right-sidebar {
    color: var(--bdtf-copy-soft) !important;
    background: var(--bdtf-surface-strong) !important;
    border-color: var(--bdtf-border-strong) !important;
}
body.dark-mode .form-control,
body.dark-mode .custom-select,
body.dark-mode .bootstrap-select > .dropdown-toggle,
body.dark-mode .select2-container .select2-selection {
    color: var(--bdtf-copy) !important;
    background: var(--bdtf-surface-soft) !important;
    border-color: var(--bdtf-border-strong) !important;
}
body.dark-mode table.table tbody td { color: var(--bdtf-copy-soft); background: var(--bdtf-surface-strong); border-color: var(--bdtf-border-strong); }
body.dark-mode table.table tbody tr:nth-child(even) td { background: var(--bdtf-surface-soft); }
body.dark-mode table.table tbody tr:hover td { color: var(--bdtf-copy); background: var(--bdtf-row-hover) !important; }
body.dark-mode .bdtf-stat-copy strong,
body.dark-mode .bdtf-card-header h4,
body.dark-mode .bdtf-dashboard-toolbar h5,
body.dark-mode .bdtf-product-copy strong,
body.dark-mode .bdtf-health-card strong,
body.dark-mode .bdtf-pos-search .form-control,
body.dark-mode .pos-page .edit-product { color: var(--bdtf-copy) !important; }
body.dark-mode .page .navbar .bdtf-icon-action,
body.dark-mode .page .navbar .bdtf-language-trigger,
body.dark-mode .bdtf-pos-navbar .nav-menu > li > a { background: var(--bdtf-surface-soft); }

@media (min-width: 1500px) {
    .pos-page .product-grid > div { width: 25% !important; }
    .bdtf-stat-copy strong { font-size: 22px; }
}
@media (max-width: 1199px) {
    .page .navbar .bdtf-header-action { min-width: 44px; padding: 8px 11px !important; }
    .page .navbar .bdtf-header-action .bdtf-action-label,
    .page .navbar .bdtf-header-action .bdtf-action-caret { display: none; }
    .bdtf-user-menu-trigger { min-width: 44px !important; }
    .bdtf-user-menu-trigger > span { display: none; }
    .bdtf-stat-copy strong { font-size: 20px; }
    .bdtf-pos-payment-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
    .bdtf-pos-cart { order: 1; padding: 0 10px !important; }
    .bdtf-pos-catalog { order: 2 !important; padding: 14px 10px 0 !important; }
    .bdtf-pos-cart > form,
    .bdtf-pos-cart .payment-form { min-height: auto; }
    .pos-page .table-container.main { height: 520px; }
    .bdtf-pos-cart-table { height: 330px; }
}
@media (max-width: 767px) {
    .page .navbar { padding: 8px 10px; gap: 8px; }
    .page .navbar .nav-menu { gap: 3px; }
    .page .navbar .bdtf-header-action,
    .page .navbar .bdtf-icon-action,
    .page .navbar .bdtf-language-trigger { width: 38px !important; min-width: 38px !important; height: 38px; min-height: 38px !important; padding: 0 !important; }
    .bdtf-language-menu .bdtf-language-trigger span { display: none !important; }
    .table-responsive,
    .bdtf-pro-table-wrap { max-width: calc(100% - 16px); margin-left: 8px; margin-right: 8px; }
    table.table thead th { padding: 11px 12px; font-size: 10.5px; }
    table.table tbody td { padding: 11px 12px; font-size: 12.5px; }
    .bdtf-stat-card { min-height: 126px; }
    .pos-page .product-grid > div { width: 33.333% !important; }
}
@media (max-width: 500px) {
    .pos-page .product-grid > div { width: 50% !important; }
    .bdtf-pos-payment-options { grid-template-columns: 1fr 1fr; }
}

/* Final component constraints */
.bdtf-quick-add-menu .dropdown-menu {
    min-width: 220px;
    padding: 8px;
    border: 1px solid var(--bdtf-border-strong);
    border-radius: 13px;
    background: var(--bdtf-surface-strong);
    box-shadow: 0 18px 44px rgba(15, 23, 42, .15);
}
.bdtf-quick-add-menu .dropdown-menu .dropdown-item { padding: 0; border-radius: 8px; overflow: hidden; }
.bdtf-quick-add-menu .dropdown-menu .dropdown-item > a {
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 9px 11px;
    color: var(--bdtf-copy-soft);
    font-size: 11.5px;
    font-weight: 650;
}
.bdtf-quick-add-menu .dropdown-menu .dropdown-item > a:hover { color: var(--bdtf-primary); background: var(--bdtf-sidebar-active-soft); }
.bdtf-pos-cart-table { max-width: 100% !important; }
body.dark-mode .bdtf-quick-add-menu .dropdown-menu .dropdown-item > a { color: var(--bdtf-copy-soft); }
