/* NCS ERP — Vuexy-inspired (font, dark mode, sidebar collapse) */
:root {
    --primary-dark-green: #095c4d;
    --primary-dark-green-rgb: 9, 92, 77;
    --primary-dark-green-deep: #043d32;
    --primary-dark-green-light: #0e9686;
    --primary-dark-green-hover: #0a6b5a;
    --accent-orange: #ff6f00;
    --accent-orange-rgb: 255, 111, 0;
    --bg-light: #f5f5f9;
    --surface: #ffffff;
    --text-dark: #566a7f;
    --text-heading: #384551;
    --text-muted: #a1acb8;
    --white: #ffffff;
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 80px;
    --navbar-height: 64px;
    --transition-speed: 0.28s;
    --border-color: #e4e6ef;
    --card-shadow: 0 2px 6px 0 rgba(67, 89, 113, 0.12);
    --card-shadow-hover: 0 4px 18px 0 rgba(67, 89, 113, 0.16);
    --menu-hover-bg: rgba(255, 255, 255, 0.06);
    --navbar-bg: rgba(255, 255, 255, 0.96);
    --table-head-bg: #f8f9fa;
    --ncs-bar-gradient: linear-gradient(90deg, #c5d6ce 0%, #dce5e1 55%, #e8ecea 100%);
    --ncs-bar-border: #b8c9c2;
    --ncs-bar-text: #2d4a42;
    --ncs-bar-text-muted: #4a5f56;
    --ncs-table-shell-radius: 12px;
    --ncs-table-sticky-head-bg: #dce5e1;
    --ncs-table-sticky-head-shadow: 0 1px 0 var(--ncs-bar-border), 0 3px 6px rgba(27, 67, 50, 0.08);
}

[data-theme="dark"] {
    /* Nền trung tính — chữ sáng, tách lớp rõ (brand xanh chỉ accent) */
    --bg-light: #121413;
    --surface: #1d2220;
    --surface-raised: #2a312f;
    --text-dark: #e2e8e6;
    --text-heading: #f8fbfb;
    --text-muted: #a3b5b0;
    --border-color: #434c49;
    --card-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.4);
    --card-shadow-hover: 0 4px 18px 0 rgba(0, 0, 0, 0.5);
    --navbar-bg: rgba(29, 34, 32, 0.98);
    --table-head-bg: #252b29;
    --menu-hover-bg: rgba(255, 255, 255, 0.08);
    /* Accent / link — sáng, đọc rõ trên nền tối */
    --primary-dark-green: #34d399;
    --primary-dark-green-rgb: 52, 211, 153;
    --primary-dark-green-deep: #095c4d;
    --primary-dark-green-light: #6ee7b7;
    --primary-dark-green-hover: #2dd4bf;
    --ncs-bar-gradient: linear-gradient(90deg, rgba(45, 90, 74, 0.55) 0%, rgba(55, 75, 68, 0.4) 55%, rgba(75, 85, 82, 0.35) 100%);
    --ncs-bar-border: rgba(255, 255, 255, 0.12);
    --ncs-bar-text: #b8d4c8;
    --ncs-bar-text-muted: #9cb3a8;
    --ncs-table-sticky-head-bg: rgba(55, 75, 68, 0.96);
    --ncs-table-sticky-head-shadow: 0 1px 0 var(--ncs-bar-border), 0 3px 6px rgba(0, 0, 0, 0.25);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body,
button,
input,
select,
textarea,
.form-control,
.form-select,
.btn,
.dropdown-menu,
.modal-content {
    font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

body {
    background-color: var(--bg-light);
    overflow-x: hidden;
    color: var(--text-dark);
    font-size: 0.9375rem;
    line-height: 1.47;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

html {
    scroll-behavior: smooth;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--text-heading);
}

a {
    color: var(--primary-dark-green);
}

a:hover {
    color: var(--accent-orange);
}

/* ========== Layout shell (Vuexy vertical menu) ========== */
.layout-wrapper {
    min-height: 100vh;
}

.layout-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.layout-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ========== Sidebar / menu ========== */
#sidebar.layout-menu {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(165deg, #095c4d 0%, #043d32 55%, #032821 100%);
    color: var(--white);
    transition: width var(--transition-speed) ease, transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    z-index: 1001;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#sidebar .sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    justify-content: center;
}

#sidebar .btn-sidebar-footer {
    width: 100%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 0.375rem;
    padding: 0.5rem;
    transition: background 0.2s ease;
}

#sidebar .btn-sidebar-footer:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

html.layout-sidebar-collapsed #sidebar .btn-sidebar-footer i {
    transform: rotate(180deg);
}

#sidebar .sidebar-header.app-brand {
    padding: 1.25rem 1.5rem 1rem;
    background: transparent;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 72px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#sidebar .app-brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 0.5rem;
    background: var(--accent-orange);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255, 111, 0, 0.35);
}

#sidebar .app-brand-text h3 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: #fff;
}

#sidebar .app-brand-text h3 span {
    color: var(--accent-orange);
}

#sidebar .app-brand-text small {
    font-size: 0.7rem;
    opacity: 0.72;
    letter-spacing: 0.02em;
}

#sidebar .menu-inner-shadow {
    height: 4px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, transparent 100%);
    flex-shrink: 0;
}

#sidebar ul.components.menu-inner {
    padding: 0.75rem 0.75rem 1.5rem;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

#sidebar ul li {
    margin-bottom: 0.2rem;
}

#sidebar ul li a {
    padding: 0.62rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    border-left: none;
    border-radius: 0.375rem;
    margin: 0 0.15rem;
}

#sidebar ul li a:hover {
    color: #fff;
    background: var(--menu-hover-bg);
}

#sidebar ul li.active > a {
    color: #fff;
    background: var(--accent-orange);
    box-shadow: 0 2px 8px rgba(255, 111, 0, 0.35);
}

#sidebar .menu-icon {
    margin-right: 0;
    width: 1.35rem;
    text-align: center;
    font-size: 1.1rem;
    opacity: 0.95;
    flex-shrink: 0;
}

#sidebar .menu-link-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity var(--transition-speed) ease;
}

/* Thu gọn sidebar — chỉ icon */
html.layout-sidebar-collapsed {
    --sidebar-width: var(--sidebar-width-collapsed);
}

html.layout-sidebar-collapsed #sidebar .app-brand-text,
html.layout-sidebar-collapsed #sidebar .menu-link-text,
html.layout-sidebar-collapsed #sidebar .submenu-chevron,
html.layout-sidebar-collapsed #sidebar .submenu-pane,
html.layout-sidebar-collapsed #sidebar .sidebar-footer {
    display: none !important;
}

html.layout-sidebar-collapsed #sidebar .sidebar-header.app-brand {
    justify-content: center;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

html.layout-sidebar-collapsed #sidebar ul li a,
html.layout-sidebar-collapsed #sidebar .sidebar-submenu-toggle {
    justify-content: center;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
}

html.layout-sidebar-collapsed #sidebar .nav-badge-count {
    position: absolute;
    top: 6px;
    right: 8px;
    min-width: 16px;
    height: 16px;
    font-size: 9px;
    margin-left: 0;
}

html.layout-sidebar-collapsed #sidebar ul li a {
    position: relative;
}

/* Ẩn hoàn toàn sidebar */
html.layout-sidebar-hidden {
    --sidebar-width: 0px;
}

html.layout-sidebar-hidden #sidebar.layout-menu {
    transform: translateX(-100%);
    width: var(--sidebar-width-collapsed);
    box-shadow: none;
}

html.layout-sidebar-hidden.layout-sidebar-collapsed #sidebar.layout-menu {
    width: 260px;
}

html.layout-sidebar-hidden #content.layout-page {
    margin-left: 0 !important;
    width: 100% !important;
}

/* Submenu */
#sidebar .sidebar-submenu-toggle {
    padding: 0.62rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    border-left: none;
    border-radius: 0.375rem;
    margin: 0 0.15rem;
}

#sidebar .sidebar-submenu-parent.active > .sidebar-submenu-toggle,
#sidebar .sidebar-submenu-toggle:hover {
    color: #fff;
    background: var(--menu-hover-bg);
}

#sidebar .sidebar-submenu-parent.active > .sidebar-submenu-toggle {
    background: var(--menu-active-bg);
    color: #fff;
    box-shadow: none;
    border-left: none;
}

#sidebar .submenu-pane {
    background: transparent;
    padding: 0.15rem 0 0.25rem 0.5rem;
}

#sidebar .submenu-list li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 400;
    border-left: none;
    border-radius: 0.375rem;
}

#sidebar .submenu-list li a:hover,
#sidebar .submenu-list li.active > a {
    background: var(--accent-orange);
    color: #fff;
}

#sidebar .sidebar-submenu-toggle .submenu-chevron {
    transition: transform 0.2s ease;
    opacity: 0.7;
    font-size: 0.7rem;
}

#sidebar .sidebar-submenu-toggle[aria-expanded="true"] .submenu-chevron {
    transform: rotate(180deg);
}

/* ========== Main content area ========== */
#content.layout-page {
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    transition: width var(--transition-speed) ease, margin-left var(--transition-speed) ease;
    position: relative;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: var(--bg-light);
}

.content-wrapper {
    flex: 1;
    width: 100%;
    padding: 1.5rem 1.75rem 2rem;
}

/* ========== Top navbar (Vuexy layout-navbar) ========== */
.navbar-custom.layout-navbar {
    background-color: var(--navbar-bg);
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 0 rgba(67, 89, 113, 0.08);
    padding: 0 1.25rem;
    min-height: var(--navbar-height);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1020;
    transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.navbar-icon-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--text-heading);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.navbar-icon-btn:hover,
.navbar-icon-btn:focus {
    background: rgba(var(--primary-dark-green-rgb), 0.08);
    color: var(--primary-dark-green);
}

[data-theme="dark"] .navbar-icon-btn:hover {
    background: rgba(var(--primary-dark-green-rgb), 0.15);
    color: var(--primary-dark-green-light);
}

.dropdown-toggle-no-caret::after {
    display: none !important;
}

.theme-dropdown-menu {
    min-width: 200px;
}

.theme-dropdown-menu .w-16 {
    width: 1.25rem;
}

.theme-dropdown-menu .theme-option.active {
    background: rgba(var(--primary-dark-green-rgb), 0.1);
    color: var(--primary-dark-green);
    font-weight: 600;
}

[data-theme="dark"] .theme-dropdown-menu .theme-option.active {
    background: rgba(var(--primary-dark-green-rgb), 0.18);
    color: var(--primary-dark-green-light);
}

[data-theme="dark"] .theme-icon-light {
    display: none !important;
}

[data-theme="dark"] .theme-icon-dark {
    display: inline-block !important;
}

[data-theme="light"] .theme-icon-dark {
    display: none !important;
}

.navbar-custom .season-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    border-radius: 0.375rem;
    background: rgba(var(--primary-dark-green-rgb), 0.08);
    color: var(--primary-dark-green);
    font-weight: 600;
    font-size: 0.875rem;
}

.navbar-custom .season-chip i {
    opacity: 0.85;
}

.navbar-custom .btn-light {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 0.4rem 0.75rem;
    font-weight: 500;
    color: var(--text-heading);
    box-shadow: none;
}

.navbar-custom .btn-light:hover {
    background: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-heading);
}

.navbar-custom .dropdown-menu {
    border: none;
    box-shadow: 0 0.25rem 1rem rgba(67, 89, 113, 0.18);
    border-radius: 0.5rem;
    padding: 0.35rem;
}

.navbar-custom .dropdown-item {
    border-radius: 0.375rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.875rem;
}

.navbar-custom .user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-dark-green), var(--primary-dark-green-light));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    margin-right: 0.35rem;
}

/* ========== Page headers ========== */
.page-title {
    color: var(--primary-dark-green) !important;
    font-weight: 600;
    font-size: 1.375rem;
    letter-spacing: -0.01em;
}

.page-subtitle {
    color: var(--text-dark);
    font-size: 0.8125rem;
}

/* ========== Buttons ========== */
.btn-orange {
    background-color: var(--accent-orange);
    color: var(--white);
    border: none;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: box-shadow 0.2s ease, transform 0.15s ease, background-color 0.2s ease;
    box-shadow: 0 2px 6px rgba(var(--accent-orange-rgb), 0.35);
}

.btn-orange:hover,
.btn-orange:focus {
    background-color: #e65c00;
    color: var(--white);
    box-shadow: 0 4px 12px rgba(var(--accent-orange-rgb), 0.4);
}

.btn-success {
    background-color: var(--primary-dark-green);
    border-color: var(--primary-dark-green);
}

.btn-success:hover {
    background-color: var(--primary-dark-green-hover);
    border-color: var(--primary-dark-green-hover);
}

.btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-heading);
    border-radius: 0.375rem;
}

.btn-outline-secondary:hover {
    background: #f1f2f8;
    border-color: #d9dee3;
    color: var(--text-heading);
}

[data-theme="dark"] .btn-outline-secondary:hover {
    background: rgba(var(--primary-dark-green-rgb), 0.12);
    border-color: var(--border-color);
    color: var(--text-heading);
}

.btn-outline-primary {
    color: var(--primary-dark-green);
    border-color: rgba(var(--primary-dark-green-rgb), 0.4);
    border-radius: 0.375rem;
}

.btn-outline-primary:hover {
    background: rgba(var(--primary-dark-green-rgb), 0.08);
    color: var(--primary-dark-green);
    border-color: var(--primary-dark-green);
}

/* ========== Cards (Vuexy card) ========== */
.card,
.card-metric {
    border: none;
    border-radius: 0.5rem;
    box-shadow: var(--card-shadow);
    background: var(--surface);
    color: var(--text-dark);
    transition: box-shadow 0.22s ease, background-color var(--transition-speed) ease;
}

.card-metric:hover {
    box-shadow: var(--card-shadow-hover);
}

.card-metric .icon-box {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.bg-green-light {
    background-color: rgba(var(--primary-dark-green-rgb), 0.12);
    color: var(--primary-dark-green);
}

[data-theme="dark"] .bg-green-light {
    background-color: rgba(var(--primary-dark-green-rgb), 0.14);
    color: var(--text-heading);
}

/* ========== NCS bar gradient — tiêu đề section / bảng (đồng bộ Thống kê) ========== */
.ncs-page-head {
    margin-bottom: 1.25rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--ncs-bar-border);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    background: var(--ncs-bar-gradient);
}
.ncs-page-head__title,
.ncs-page-head > h1,
.ncs-page-head > h4,
.ncs-page-head .page-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--ncs-bar-text);
}
.ncs-page-head__meta,
.ncs-page-head > p {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    color: var(--ncs-bar-text-muted);
}

.ncs-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 1.15rem;
    background: var(--ncs-bar-gradient);
    border-bottom: 1px solid var(--ncs-bar-border);
}
.ncs-section-head :is(h1, h2, h3, h4, h5, h6, .ncs-section-head__title) {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ncs-bar-text);
}

.ncs-bar-title,
.admin-section-title,
.pdash-finance-block > .pdash-finance-block__title,
.khsx-panel > :is(h2, h3, h4, h5, h6).fw-bold,
.khsx-config-section-title,
.pf-section-title,
.profile-section-title {
    display: block;
    padding: 0.65rem 1.15rem;
    margin: 0 0 0.75rem;
    background: var(--ncs-bar-gradient);
    border-bottom: 1px solid var(--ncs-bar-border);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ncs-bar-text);
}
.card.card-metric > .ncs-bar-title {
    margin: -1.5rem -1.5rem 0.75rem;
}
.card.card-metric.p-3 > .ncs-bar-title {
    margin: -1rem -1rem 0.75rem;
}
.profile-section-title {
    margin-top: 1rem;
    border-top: 0;
}
.profile-section-title:first-of-type {
    margin-top: 0;
}
.pdash-finance-block > .pdash-finance-block__title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    border: 1px solid var(--ncs-bar-border);
    border-bottom: 1px solid var(--ncs-bar-border);
}
.pdash-finance-block > .pdash-finance-block__title i,
.pf-section-title i,
.khsx-panel > :is(h2, h3, h4, h5, h6).fw-bold i {
    opacity: 0.75;
    margin-right: 0.35rem;
}

.biz-panel > .biz-panel__title,
.biz-panel > .d-flex:has(.biz-panel__title) {
    margin: -1rem -1.15rem 0.75rem;
    padding: 0.65rem 1.15rem;
    background: var(--ncs-bar-gradient);
    border-bottom: 1px solid var(--ncs-bar-border);
}
.biz-panel__title {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ncs-bar-text) !important;
    margin: 0 !important;
}
.biz-panel > .d-flex:has(.biz-panel__title) .biz-panel__link {
    font-size: 0.72rem;
    color: var(--ncs-bar-text-muted);
}

.pdash-card > .pdash-card__head {
    margin: -1.25rem -1.35rem 1rem;
    padding: 0.65rem 1.35rem;
    background: var(--ncs-bar-gradient);
    border-bottom: 1px solid var(--ncs-bar-border);
}
.pdash-card__title {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ncs-bar-text) !important;
    margin: 0 !important;
}
.pdash-card__desc {
    color: var(--ncs-bar-text-muted) !important;
    font-size: 0.72rem !important;
}

.table thead tr,
.ncs-table thead tr,
.stats-table thead tr,
.pdash-table thead tr,
table.orders-table thead tr,
table.admin-table thead tr,
table.products-table thead tr,
table.customers-table thead tr,
.kl-emp-scroll table thead tr,
.khsx-table thead tr,
.khsx-target-table thead tr,
.khsx-season-table thead tr,
.bom-editor thead tr {
    background: var(--ncs-bar-gradient);
}
.table thead th,
.ncs-table thead th,
.stats-table thead th,
.pdash-table thead th,
table.orders-table thead th,
table.admin-table thead th,
table.products-table thead th,
table.customers-table thead th,
.kl-emp-scroll table thead th,
.khsx-table thead th,
.khsx-target-table thead th,
.khsx-season-table thead th,
.bom-editor thead th {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--ncs-bar-border);
    background: transparent !important;
    --bs-table-bg: transparent;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ncs-bar-text);
    text-align: left;
    white-space: nowrap;
}
.table thead th.text-end,
.ncs-table thead th.text-end,
.stats-table thead th.text-end,
.pdash-table thead th.text-end,
table.orders-table thead th.text-end {
    text-align: right;
}
.khsx-pivot thead tr {
    background: var(--ncs-bar-gradient);
}
.khsx-pivot thead th {
    background: transparent !important;
    color: var(--ncs-bar-text);
    border-bottom: 1px solid var(--ncs-bar-border);
}
.khsx-pivot thead th.khsx-pivot-sticky {
    background: var(--ncs-table-sticky-head-bg) !important;
}
[data-theme="dark"] .khsx-pivot thead th.khsx-pivot-sticky {
    background: var(--ncs-table-sticky-head-bg) !important;
}

.orders-table-card .card-header-tabs,
.customers-table-card .card-header-tabs {
    background: var(--ncs-bar-gradient) !important;
    border-bottom-color: var(--ncs-bar-border) !important;
}

/* Orders list — scoped class, không dùng table.orders-table global thead transparent */
#ordersTableContainer .orders-list-table > thead > tr {
    background: var(--ncs-table-sticky-head-bg) !important;
}
#ordersTableContainer .orders-list-table > thead > tr > th {
    background: var(--ncs-table-sticky-head-bg) !important;
    --bs-table-bg: var(--ncs-table-sticky-head-bg);
    border-top: 0 !important;
    border-radius: 0 !important;
    text-align: center;
}
#ordersTableContainer .orders-list-table > tbody > tr > td.num-cell {
    text-align: center;
}

.modal-header.bg-green-light {
    background: var(--ncs-bar-gradient) !important;
    border-bottom: 1px solid var(--ncs-bar-border);
    color: var(--ncs-bar-text);
}
.modal-header.bg-green-light .modal-title {
    color: var(--ncs-bar-text) !important;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-page-header.ncs-page-head {
    padding: 0.85rem 1rem;
}
.admin-page-header.ncs-page-head .page-title {
    font-size: 1.25rem;
}

.admin-card .card-body > .admin-section-title,
.admin-card .admin-section-title,
.admin-settings-card .admin-section-title {
    margin: -0.85rem -0.85rem 0.65rem;
    border-radius: 8px 8px 0 0;
}
.admin-card .card-body > .d-flex:has(.admin-section-title) {
    margin: -0.85rem -0.85rem 0.65rem;
    padding: 0.65rem 0.85rem;
    background: var(--ncs-bar-gradient);
    border-bottom: 1px solid var(--ncs-bar-border);
    border-radius: 8px 8px 0 0;
}
.admin-card .card-body > .d-flex:has(.admin-section-title) .admin-section-title {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
}

.page-title-bar.ncs-page-head {
    margin-bottom: 1rem;
}
.page-title-bar.ncs-page-head .page-title {
    font-size: 1.25rem;
}

.orders-hero.ncs-page-head {
    padding: 0;
    overflow: hidden;
}
.orders-hero.ncs-page-head .orders-hero-body {
    padding: 0.85rem 1rem;
}
.orders-hero.ncs-page-head .orders-hero-title {
    color: var(--ncs-bar-text);
}
.orders-hero.ncs-page-head .orders-hero-eyebrow {
    color: var(--ncs-bar-text-muted);
}
.orders-hero.ncs-page-head .orders-hero-icon {
    color: var(--ncs-bar-text);
    background: rgba(45, 74, 66, 0.12);
    border-color: var(--ncs-bar-border);
}
.section-card .section-header {
    background: var(--ncs-bar-gradient);
    border-bottom: 1px solid var(--ncs-bar-border);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ncs-bar-text);
}

.bg-orange-light {
    background-color: rgba(var(--accent-orange-rgb), 0.12);
    color: var(--accent-orange);
}

.kpi-card-btn {
    min-height: 110px;
    cursor: pointer;
    border: 0;
    background: transparent;
    text-align: left;
}

.kpi-card-btn h6 {
    min-height: 34px;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.kpi-card-btn h3 {
    color: var(--text-heading);
    font-weight: 600;
}

/* ========== Tables ========== */
.table {
    --bs-table-bg: transparent;
    color: var(--text-dark);
}

.table thead th {
    padding: 0.85rem 0.75rem;
}

.table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
    border-color: var(--border-color);
}

.table-hover tbody tr:hover {
    background-color: rgba(var(--primary-dark-green-rgb), 0.04);
}

/* ========== Sticky table headers (system-wide) ========== */
/*
 * Quy ước: KHÔNG bọc bảng sticky bằng .table-responsive (Bootstrap) — WebKit mất sticky.
 * Cấu trúc: .ncs-table-shell > .ncs-table-scroll > table.sticky-table-head
 */
.ncs-table-shell,
.orders-table-card.card,
.card.orders-table-card,
.customers-table-card,
.products-table-card {
    overflow: visible;
}

.ncs-table-shell,
.orders-table-card,
.products-table-card,
.customers-table-card,
.khsx-table-wrap,
.khsx-season-scroll {
    border: 1px solid var(--border-color);
    border-radius: var(--ncs-table-shell-radius);
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.ncs-table-shell > .ncs-table-scroll,
.products-table-card > .ncs-table-scroll,
.customers-table-card > .ncs-table-scroll,
.orders-table-card > .ncs-table-scroll,
.orders-table-card > .orders-scroll-pane {
    border-radius: var(--ncs-table-shell-radius);
}

.ncs-table-scroll,
.ncs-table-scroll-pane,
.orders-scroll-pane,
.products-scroll-pane,
.customers-scroll-pane,
.admin-table-wrap,
.kl-emp-scroll,
.wh-table-wrap,
.khsx-season-scroll,
.khsx-table-wrap.ncs-table-scroll,
.table-responsive[style*="max-height"] {
    display: block;
    width: 100%;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
}

.ncs-table-scroll--viewport {
    max-height: 52vh;
}

.ncs-table-scroll--orders {
    max-height: calc(100vh - 280px);
}

.ncs-table-scroll--products {
    max-height: calc(100vh - 220px);
}

.ncs-table-scroll--customers {
    max-height: calc(100vh - 260px);
}

.ncs-table-scroll--khsx {
    max-height: 48vh;
}

.ncs-table-scroll > table,
.ncs-table-scroll > .table,
.orders-scroll-pane > table,
.products-scroll-pane > table,
.customers-scroll-pane > table,
.admin-table-wrap > table,
.kl-emp-scroll > table,
.wh-table-wrap > table,
.wh-table-wrap > .wh-table,
.khsx-season-scroll > table,
.khsx-table-wrap.ncs-table-scroll > table,
.sticky-table-head,
#ordersTableContainer .orders-list-table,
.table-responsive[style*="max-height"] .table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.ncs-table-scroll > table.sticky-table-head > thead,
.ncs-table-scroll > table > thead,
.orders-scroll-pane > table > thead,
.products-scroll-pane > table > thead,
.customers-scroll-pane > table > thead,
.admin-table-wrap > table > thead,
.kl-emp-scroll > table > thead,
.wh-table-wrap > table > thead,
.khsx-season-scroll > table > thead,
.sticky-table-head > thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.sticky-table-head > thead > tr > th,
.ncs-table-scroll > table > thead > tr > th,
.orders-scroll-pane > table > thead > tr > th,
.products-scroll-pane > table > thead > tr > th,
.customers-scroll-pane > table > thead > tr > th,
.admin-table-wrap > table > thead > tr > th,
.kl-emp-scroll > table > thead > tr > th,
.wh-table-wrap > table > thead > tr > th,
.khsx-season-scroll > table > thead > tr > th,
.inv-table-wrap > table > thead > tr > th,
.audit-table-wrap > table > thead > tr > th,
.table-responsive[style*="max-height"] > table > thead > tr > th,
#ordersTableContainer .orders-list-table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 11;
    background: var(--ncs-table-sticky-head-bg) !important;
    --bs-table-bg: var(--ncs-table-sticky-head-bg);
    background-clip: padding-box;
    box-shadow: var(--ncs-table-sticky-head-shadow);
    border-bottom: 1px solid var(--ncs-bar-border);
    color: var(--ncs-bar-text);
}

.admin-table-wrap .admin-table > thead > tr > th,
#ordersTableContainer .orders-list-table > thead > tr > th {
    z-index: 12;
}

.table-light {
    --bs-table-bg: transparent;
}
.table-light thead th {
    background: transparent !important;
    color: var(--ncs-bar-text);
}
.table-light.sticky-table-head > thead > tr > th,
.ncs-table-scroll .table-light > thead > tr > th {
    background: var(--ncs-table-sticky-head-bg) !important;
    --bs-table-bg: var(--ncs-table-sticky-head-bg);
}

/* ========== Forms ========== */
.form-label {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--text-heading);
    margin-bottom: 0.35rem;
}

.form-control,
.form-select {
    border-radius: 0.375rem;
    border-color: var(--border-color);
    font-size: 0.9375rem;
    color: var(--text-heading);
    background-color: var(--surface);
    padding: 0.5rem 0.85rem;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--surface-raised);
    border-color: var(--border-color);
    color: var(--text-heading);
}

[data-theme="dark"] .form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(var(--primary-dark-green-rgb), 0.5);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-dark-green-rgb), 0.12);
}

.form-section {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem 1.15rem;
    background: var(--surface);
    box-shadow: none;
}

/* ========== Modals ========== */
.modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.75rem rgba(67, 89, 113, 0.22);
    background: var(--surface);
    color: var(--text-dark);
}

[data-theme="dark"] .modal-content .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.15rem 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: var(--text-heading);
}

.modal-body {
    padding: 1.25rem 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* ========== Alerts, badges, list ========== */
.alert {
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.list-group-item {
    border-color: var(--border-color);
}

.badge {
    font-weight: 500;
    border-radius: 0.25rem;
}

/* ========== Accordion ========== */
.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: 0.375rem !important;
    overflow: hidden;
    margin-bottom: 0.5rem;
    box-shadow: none;
}

.accordion-button {
    font-weight: 600;
    color: var(--text-heading);
    font-size: 0.9375rem;
    box-shadow: none !important;
}

.accordion-button:not(.collapsed) {
    background: rgba(var(--primary-dark-green-rgb), 0.08);
    color: var(--primary-dark-green);
}

/* ========== Misc components ========== */
.product-thumb {
    height: 180px;
    object-fit: cover;
    border-radius: 0.375rem;
}

.product-card {
    overflow: hidden;
    border-radius: 0.5rem;
}

.product-card .card-body {
    padding: 1rem 1rem 0.75rem;
}

.product-edit-card {
    cursor: default;
}

.order-detail-btn {
    color: var(--primary-dark-green);
}

.order-detail-btn:hover {
    color: var(--accent-orange);
}

.popover {
    max-width: 520px;
    border: none;
    box-shadow: 0 0.25rem 1.25rem rgba(67, 89, 113, 0.2);
    border-radius: 0.5rem;
}

.popover .popover-body {
    font-size: 0.875rem;
    line-height: 1.45;
}

.hub-expected-inbound-header-btn {
    color: inherit;
    font-weight: 600;
    font-size: inherit;
    text-decoration: underline dotted;
    text-underline-offset: 0.15em;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}
.hub-expected-inbound-header-btn:hover:not(:disabled),
.hub-expected-inbound-header-btn:focus:not(:disabled) {
    color: var(--bs-warning-text-emphasis, #997404);
}
.hub-expected-inbound-header-btn--empty,
.hub-expected-inbound-header-btn:disabled {
    text-decoration: none;
    cursor: default;
    opacity: 0.85;
}
.hub-expected-inbound-popover-wrap {
    max-width: min(560px, 96vw);
}
.hub-expected-inbound-popover-wrap .popover-body {
    max-height: min(360px, 60vh);
    overflow: auto;
    padding: 0.35rem 0.5rem;
}
.hub-expected-inbound-table {
    width: auto;
    min-width: 100%;
    --bs-table-cell-padding-y: 0.12rem;
    --bs-table-cell-padding-x: 0.35rem;
}
.hub-expected-inbound-table th,
.hub-expected-inbound-table td {
    padding: 0.12rem 0.35rem;
    font-size: 0.78rem;
    line-height: 1.2;
    vertical-align: middle;
}
.hub-expected-inbound-table thead th {
    color: var(--bs-secondary-color);
    font-weight: 600;
    border-bottom: 1px solid var(--bs-border-color);
    padding-top: 0.1rem;
    padding-bottom: 0.2rem;
    white-space: nowrap;
}
.hub-inbound-sp {
    max-width: 10rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.hub-inbound-date-col {
    min-width: 2.25rem;
    font-variant-numeric: tabular-nums;
}
.hub-inbound-qty-cell {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 2rem;
}

.product-hover-thumb {
    width: 100%;
    max-height: 120px;
    object-fit: cover;
    border-radius: 0.375rem;
}

.product-hover-popover {
    pointer-events: none;
    max-width: min(320px, 92vw);
}
.product-hover-popover .popover-arrow {
    display: none;
}

.product-hover-tip {
    position: fixed;
    z-index: 1090;
    display: none;
    max-width: min(320px, 92vw);
    padding: 0.65rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--text-dark, #566a7f);
    background: var(--surface, #fff);
    border: 1px solid var(--border-color, #e4e6ef);
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 1.25rem rgba(67, 89, 113, 0.2);
    pointer-events: none;
}

.order-table-compact td,
.order-table-compact th {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    font-size: 0.875rem;
}

.role-preview-select {
    min-width: 11rem;
    max-width: 14rem;
    font-size: 0.8125rem;
}
.role-preview-banner {
    border-bottom: 1px solid #fcd34d !important;
}

.order-status-badge {
    font-weight: 600;
    border-radius: 0.25rem;
    padding: 0.35rem 0.55rem;
    transition: filter 0.16s ease, box-shadow 0.16s ease;
}

.order-status-badge:hover {
    filter: brightness(0.98);
    box-shadow: 0 2px 8px rgba(67, 89, 113, 0.12);
}

/* Tag trạng thái — tông vintage, đậm vừa, bớt chói */
.status-waiting {
    background: #c9922a;
    color: #fffef8;
    border: 1px solid #a87822;
}
.status-packing {
    background: #c45c26;
    color: #fffef8;
    border: 1px solid #a34a1f;
}
.status-delivering {
    background: #4a6fa5;
    color: #fffef8;
    border: 1px solid #3a5884;
}
.status-delivered {
    background: #4d8a5e;
    color: #fffef8;
    border: 1px solid #3d6e4b;
}
.status-routing {
    background: #3a8a96;
    color: #fffef8;
    border: 1px solid #2f707a;
}
.status-routed {
    background: #7a6298;
    color: #fffef8;
    border: 1px solid #624f7a;
}
.status-bumped {
    background: #a84343;
    color: #fffef8;
    border: 1px solid #863535;
}
.status-cancelled {
    background: #8a8279;
    color: #fffef8;
    border: 1px solid #6f6860;
}
.status-default {
    background: #7a756d;
    color: #fffef8;
    border: 1px solid #625e57;
}

.product-picker-dropdown {
    position: absolute;
    z-index: 30;
    max-height: 240px;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    box-shadow: 0 0.25rem 1rem rgba(67, 89, 113, 0.16);
    border-radius: 0.5rem;
    overflow-y: auto;
    animation: fadeInLift 0.14s ease;
}

.product-picker-item {
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    line-height: 1.35;
    border-bottom: 1px solid var(--border-color, #e4e6ef);
}

.product-picker-item:last-child {
    border-bottom: none;
}

.product-picker-item:hover,
.product-picker-item:focus {
    background: rgba(var(--primary-dark-green-rgb, 9, 92, 77), 0.08);
    outline: none;
}

.product-oos-tag {
    color: #dc3545;
    font-style: italic;
    font-weight: 500;
}

.custom-product-select__trigger {
    display: block;
    width: 100%;
    cursor: pointer;
}

.custom-product-select__menu {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: calc(100% + 0.25rem);
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border: 2px solid #7bc9a3;
    border-radius: 0.5rem;
    box-shadow: 0 4px 14px rgba(11, 81, 50, 0.12);
}

.qty-input-compact {
    width: 80px;
    min-width: 72px;
    text-align: center;
    padding-left: 0.3rem;
    padding-right: 0.3rem;
}

#inventoryByCategory table td,
#inventoryByCategory table th {
    vertical-align: middle;
}

.order-action-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
}

.nav-badge-count {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #ff3e1d;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 10rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(255, 62, 29, 0.4);
    margin-left: auto;
}

.nav-badge-group {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
    flex-shrink: 0;
}

.nav-badge-group .nav-badge-count {
    margin-left: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.625rem;
}

.nav-badge-count--share {
    background: #2563eb;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.45);
}

.nav-badge-count--mine {
    background: #ff3e1d;
    box-shadow: 0 2px 6px rgba(255, 62, 29, 0.4);
}

html.layout-sidebar-collapsed #sidebar .nav-badge-group {
    position: absolute;
    top: 2px;
    right: 2px;
    margin-left: 0;
}

.print-badge-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: #ff3e1d;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    z-index: 10;
}

#orderItemsTable th:nth-child(1),
#orderItemsTable td:nth-child(1) { min-width: 220px; }
#orderItemsTable th:nth-child(2),
#orderItemsTable td:nth-child(2) { width: 90px; }
#orderItemsTable th:nth-child(3),
#orderItemsTable td:nth-child(3) { width: 140px; }
#orderItemsTable th:nth-child(4),
#orderItemsTable td:nth-child(4) { width: 90px; }
#orderItemsTable th:nth-child(5),
#orderItemsTable td:nth-child(5) { width: 160px; }

#newCategoryWrap .form-control,
#newCategoryWrap .btn {
    height: 38px;
}

#orderItemsTable tbody tr {
    transition: background 0.16s ease;
}

#orderItemsTable tbody tr:hover {
    background: rgba(var(--primary-dark-green-rgb), 0.04);
}

.toast {
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 1rem rgba(67, 89, 113, 0.2);
}

/* Products page — align với Vuexy card toolbar */
.products-toolbar {
    border: none !important;
    border-radius: 0.5rem;
    background: var(--surface);
    box-shadow: var(--card-shadow);
}

.products-kpi-inline .kpi-chip {
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-dark);
    border-radius: 0.25rem;
    padding: 0.2rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 500;
}

@keyframes fadeInLift {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== Responsive ========== */
@media (max-width: 991.98px) {
    html.layout-sidebar-collapsed {
        --sidebar-width: 260px;
    }

    #sidebar.layout-menu {
        transform: translateX(-100%);
        width: 260px !important;
        margin-left: 0;
    }

    #sidebar.layout-menu.mobile-open {
        transform: translateX(0);
        box-shadow: 0 0.25rem 1.5rem rgba(0, 0, 0, 0.25);
    }

    #content.layout-page {
        width: 100% !important;
        margin-left: 0 !important;
    }

    html.layout-sidebar-hidden #sidebar.layout-menu {
        transform: translateX(-100%);
    }

    .content-wrapper {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .container-fluid.p-4,
    .content-wrapper {
        padding: 1rem !important;
    }

    .card-metric {
        border-radius: 0.5rem;
    }

    .order-table-compact td,
    .order-table-compact th {
        font-size: 0.8125rem;
    }

    .popover {
        max-width: 92vw;
    }
}

/* ========== Dark mode — Bootstrap overrides ========== */
[data-theme="dark"] body {
    color: var(--text-dark);
}

[data-theme="dark"] .content-wrapper h4,
[data-theme="dark"] .content-wrapper h5,
[data-theme="dark"] .content-wrapper h6,
[data-theme="dark"] .page-title {
    color: var(--text-heading) !important;
}

[data-theme="dark"] .modal-title {
    color: var(--text-heading);
}

[data-theme="dark"] .card,
[data-theme="dark"] .card-metric {
    color: var(--text-dark);
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .text-dark {
    color: var(--text-heading) !important;
}

[data-theme="dark"] .table-light {
    --bs-table-bg: var(--table-head-bg);
    --bs-table-color: var(--text-heading);
}

[data-theme="dark"] .accordion-button {
    background: var(--surface);
    color: var(--text-heading);
}

[data-theme="dark"] .accordion-button:not(.collapsed) {
    background: rgba(var(--primary-dark-green-rgb), 0.14);
    color: var(--text-heading);
}

[data-theme="dark"] .accordion-item {
    background: var(--surface);
}

[data-theme="dark"] .list-group-item {
    background: var(--surface);
    color: var(--text-dark);
}

[data-theme="dark"] .dropdown-menu {
    background: var(--surface);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-dark);
}

[data-theme="dark"] .dropdown-item:hover {
    background: rgba(var(--primary-dark-green-rgb), 0.12);
    color: var(--text-heading);
}

[data-theme="dark"] .popover {
    background: var(--surface);
    color: var(--text-dark);
}

[data-theme="dark"] .popover .popover-body {
    color: var(--text-dark);
}

[data-theme="dark"] .bg-light {
    background-color: var(--surface-raised) !important;
    color: var(--text-heading) !important;
}

[data-theme="dark"] .badge.bg-light {
    background-color: rgba(var(--primary-dark-green-rgb), 0.22) !important;
    color: var(--text-heading) !important;
}

[data-theme="dark"] #productsInventoryTable thead th {
    background: var(--table-head-bg);
    color: var(--text-heading);
}

[data-theme="dark"] #productsInventoryTable tbody tr:nth-child(even) {
    background: rgba(var(--primary-dark-green-rgb), 0.04);
}

[data-theme="dark"] #productsInventoryTable tbody tr:hover {
    background: rgba(var(--primary-dark-green-rgb), 0.1);
}

[data-theme="dark"] .product-name-detail {
    color: var(--text-heading);
}

[data-theme="dark"] .section-card,
[data-theme="dark"] .bom-editor,
[data-theme="dark"] .products-toolbar {
    background: var(--surface);
    border-color: var(--border-color);
}

[data-theme="dark"] .section-card .section-header {
    background: var(--surface-raised);
    border-color: var(--border-color);
    color: var(--text-heading);
}

[data-theme="dark"] .input-group-text {
    background: var(--surface-raised);
    border-color: var(--border-color);
    color: var(--text-dark);
}

[data-theme="dark"] .form-label {
    color: var(--text-heading);
}

[data-theme="dark"] .btn-success {
    background-color: #0d9488;
    border-color: #0d9488;
    color: #fff;
}

[data-theme="dark"] .btn-success:hover {
    background-color: var(--primary-dark-green-hover);
    border-color: var(--primary-dark-green-hover);
    color: #fff;
}

[data-theme="dark"] a:hover {
    color: var(--primary-dark-green-light);
}

[data-theme="dark"] .table-hover tbody tr:hover {
    background-color: rgba(var(--primary-dark-green-rgb), 0.08);
}

[data-theme="dark"] .bom-editor {
    border-color: var(--border-color);
}

[data-theme="dark"] .bom-editor thead th {
    background: var(--surface-raised);
    color: var(--text-dark);
    border-color: var(--border-color);
}

[data-theme="dark"] .bom-editor .bom-empty-row td {
    color: var(--text-muted);
}

[data-theme="dark"] .section-card.section-filling .section-header {
    background: rgba(var(--primary-dark-green-rgb), 0.12);
    color: var(--text-heading);
}

[data-theme="dark"] .section-card.section-box .section-header {
    background: rgba(var(--accent-orange-rgb), 0.12);
    color: #fcd9b0;
}

[data-theme="dark"] .section-card.section-bom .section-header {
    background: var(--surface-raised);
    color: var(--text-heading);
}

[data-theme="dark"] .product-form-compact .pf-panel {
    background: var(--surface);
    border-color: var(--border-color);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* ========== Orders hero KPI (dùng chung ERP + Hub) ========== */
.orders-page,
.hub-page {
    margin-bottom: 0.5rem;
}
.orders-partner-delivery-meta .form-label {
    font-size: 0.875rem;
}
.orders-partner-delivery-meta .orders-hub-stock-receipt-check {
    flex-shrink: 0;
    padding-left: 0;
    margin-right: 0;
}
.orders-partner-delivery-meta .orders-hub-stock-receipt-check .form-check-input {
    margin-top: 0.1rem;
}
.orders-partner-delivery-meta .orders-hub-stock-receipt-check .form-check-label {
    font-size: 0.75rem;
    line-height: 1.2;
    color: var(--text-muted, #6c757d);
    white-space: nowrap;
}
@media (max-width: 991.98px) {
    .orders-partner-delivery-meta .orders-hub-stock-receipt-check .form-check-label {
        white-space: normal;
        max-width: 5.5rem;
    }
}
.orders-hero {
    margin-bottom: 0.75rem;
}
.orders-hero-body {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 0.85rem 1rem;
    padding: 0.85rem 1rem;
}
.orders-hero-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1 1 200px;
    min-width: 0;
}
.orders-hero-icon {
    width: 44px;
    height: 44px;
    border-radius: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--primary-dark-green, #095c4d);
    background: rgba(var(--primary-dark-green-rgb, 9, 92, 77), 0.1);
    border: 1px solid rgba(var(--primary-dark-green-rgb, 9, 92, 77), 0.15);
    flex-shrink: 0;
}
.orders-hero-text { min-width: 0; }
.orders-hero-eyebrow {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted, #a1acb8);
    margin-bottom: 0.15rem;
    line-height: 1.2;
}
.orders-hero-title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-heading, #384551);
    margin: 0;
    line-height: 1.25;
}
.orders-hero-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
    flex: 2 1 280px;
    max-width: 100%;
}
.orders-stat {
    flex: 1 1 76px;
    min-width: 76px;
    max-width: 120px;
    padding: 0.45rem 0.65rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color, #e4e6ef);
    background: var(--surface, #fff);
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    position: relative;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.orders-stat::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 0.5rem 0 0 0.5rem;
    opacity: 0.85;
}
.orders-stat:hover {
    border-color: rgba(var(--primary-dark-green-rgb, 9, 92, 77), 0.25);
    box-shadow: 0 4px 12px rgba(67, 89, 113, 0.08);
}
.orders-stat-label {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #a1acb8);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.orders-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    color: var(--text-heading, #384551);
    line-height: 1.1;
}
.orders-stat--total::before { background: var(--primary-dark-green, #095c4d); }
.orders-stat--total .orders-stat-value { color: var(--primary-dark-green, #095c4d); }
.orders-stat--pending::before { background: #f59e0b; }
.orders-stat--pending .orders-stat-value { color: #b45309; }
.orders-stat--packing::before { background: #f97316; }
.orders-stat--packing .orders-stat-value { color: #c2410c; }
.orders-stat--ship::before { background: #3b82f6; }
.orders-stat--ship .orders-stat-value { color: #1d4ed8; }
.orders-stat--routing::before { background: #0ea5e9; }
.orders-stat--routing .orders-stat-value { color: #0369a1; }
.orders-stat.is-zero .orders-stat-value { opacity: 0.45; }
.orders-stat--link { cursor: pointer; }
.orders-hero-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    flex: 0 0 auto;
    align-self: center;
}
.orders-hero-actions .btn { font-size: 0.8125rem; }
.orders-hint {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    margin-bottom: 0.65rem;
    border-radius: 0.35rem;
    border: 1px solid rgba(var(--primary-dark-green-rgb, 9, 92, 77), 0.12);
    background: rgba(var(--primary-dark-green-rgb, 9, 92, 77), 0.04);
    color: var(--text-muted, #697a8d);
}
.orders-toolbar { margin-bottom: 0.65rem !important; }
.orders-toolbar .card-body { padding: 0.45rem 0.65rem !important; }
.orders-toolbar-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}
.orders-search {
    flex: 1 1 220px;
    min-width: 180px;
    max-width: 360px;
}
.orders-search .input-group-text {
    background: var(--surface, #fff);
    border-color: var(--border-color, #e4e6ef);
    color: var(--text-muted, #a1acb8);
}
.orders-filter-select,
.orders-filter-date {
    width: 128px;
    flex: 0 0 auto;
    font-size: 0.8125rem;
    min-height: 31px;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
}
.orders-filter-type {
    width: 118px;
}

/* Hub orders — single-row filter strip (hub + ERP orders page) */
.hub-page .orders-toolbar:has(.hub-orders-strip) .card-body,
.orders-page .orders-toolbar:has(.hub-orders-strip) .card-body,
.orders-page .orders-toolbar:has(.orders-filter-toolbar) .card-body {
    padding: 0.5rem 0.65rem !important;
}
.hub-page .orders-toolbar-row:has(.hub-orders-strip),
.orders-page .orders-filter-toolbar {
    display: block;
    width: 100%;
}
.hub-orders-toolbar {
    width: 100%;
}
.orders-page .hub-strip-select--season {
    max-width: 9.5rem;
    min-width: 7rem;
}
.hub-orders-strip-inner {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.15rem;
    min-height: 38px;
    padding: 0.2rem 0.35rem 0.2rem 0.5rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #fff 0%, #f4f6f9 100%);
    border: 1px solid var(--border-color, #dfe3ea);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}
.hub-strip-leading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    flex-shrink: 0;
    color: var(--primary-dark-green, #095c4d);
    background: rgba(var(--primary-dark-green-rgb, 9, 92, 77), 0.1);
    font-size: 0.7rem;
}
.hub-strip-control {
    font-size: 0.8125rem;
    color: var(--text-body, #384551);
    border: none;
    background: transparent;
    outline: none;
    box-shadow: none;
}
.hub-strip-control:focus {
    outline: none;
    box-shadow: none;
}
.hub-strip-select {
    flex: 0 1 auto;
    max-width: 7.5rem;
    min-width: 5.5rem;
    padding: 0.35rem 1.35rem 0.35rem 0.45rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23697a8d' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.35rem center;
    border-radius: 0.35rem;
    transition: background-color 0.15s;
}
.hub-strip-select:hover,
.hub-strip-select:focus {
    background-color: rgba(var(--primary-dark-green-rgb, 9, 92, 77), 0.06);
}
.hub-strip-vrule {
    flex-shrink: 0;
    width: 1px;
    height: 1.35rem;
    margin: 0 0.15rem;
    background: var(--border-color, #dfe3ea);
}
.hub-strip-dates {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 0.15rem;
    padding: 0 0.15rem;
}
.hub-strip-date {
    width: 7.1rem;
    padding: 0.35rem 0.25rem;
    color-scheme: light;
}
.hub-strip-date-dash {
    color: var(--text-muted, #a1acb8);
    font-size: 0.75rem;
    user-select: none;
}
.hub-strip-search {
    display: flex;
    align-items: center;
    flex: 1 1 140px;
    min-width: 120px;
    gap: 0.35rem;
    margin: 0;
    padding: 0 0.35rem 0 0.15rem;
}
.hub-strip-search-icon {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--text-muted, #a1acb8);
}
.hub-strip-search-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.35rem 0.25rem;
}
.hub-strip-search-input::placeholder {
    color: #b4bdcc;
}
.hub-strip-vrule--actions {
    margin-left: 0.1rem;
}
.hub-strip-actions {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 0.2rem;
    padding-right: 0.15rem;
}
.hub-strip-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted, #697a8d);
    transition: background 0.15s, color 0.15s;
}
.hub-strip-icon-btn:hover {
    background: rgba(15, 23, 42, 0.06);
    color: var(--text-body, #384551);
}
.hub-strip-icon-btn--primary {
    color: var(--primary-dark-green, #095c4d);
    background: rgba(var(--primary-dark-green-rgb, 9, 92, 77), 0.12);
}
.hub-strip-icon-btn--primary:hover {
    background: rgba(var(--primary-dark-green-rgb, 9, 92, 77), 0.2);
    color: var(--primary-dark-green, #095c4d);
}
.hub-orders-product-summary {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.5rem;
    background: linear-gradient(90deg, rgba(25, 135, 84, 0.12) 0%, rgba(253, 126, 20, 0.08) 100%);
    border: 1px solid rgba(25, 135, 84, 0.28);
    border-left: 4px solid #198754;
    font-size: 0.8125rem;
}
.hub-product-summary-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.45rem;
    background: rgba(25, 135, 84, 0.15);
    color: #157347;
    flex-shrink: 0;
}
.hub-product-summary-body {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    min-width: 0;
}
.hub-product-summary-name {
    font-weight: 600;
    color: #157347;
}
.hub-product-summary-meta {
    color: var(--text-muted, #697a8d);
}
.hub-product-summary-qty {
    font-weight: 700;
    font-size: 0.9375rem;
    color: #e8590c;
}
.hub-product-summary-hint {
    color: var(--text-muted, #a1acb8);
    font-size: 0.75rem;
}
.hub-order-product-qty {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    background: linear-gradient(135deg, #fd7e14 0%, #e8590c 100%);
    vertical-align: middle;
    white-space: nowrap;
}
.hub-orders-batch-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    margin-top: 0.5rem;
    padding: 0.4rem 0.65rem;
    border-radius: 0.375rem;
    background: var(--surface, #fff);
    border: 1px dashed var(--border-color, #e4e6ef);
    font-size: 0.8125rem;
}

/* Orders table cap — title + filter strip glued to table card (hub + ERP) */
.orders-table-card > .orders-table-cap {
    padding: 0.6rem 0.75rem 0.55rem;
    border-bottom: 1px solid var(--border-color, #e4e6ef);
    background: linear-gradient(
        180deg,
        rgba(var(--primary-dark-green-rgb, 9, 92, 77), 0.04) 0%,
        var(--surface, #fff) 72%
    );
    border-radius: var(--ncs-table-shell-radius, 12px) var(--ncs-table-shell-radius, 12px) 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.orders-table-cap-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    min-width: 0;
}
.orders-table-cap-head {
    margin-bottom: 0;
    flex-shrink: 0;
}
.orders-table-cap-title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-dark, #2f3847);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    line-height: 1.3;
}
.orders-table-cap-title i {
    color: var(--primary-dark-green, #095c4d);
    font-size: 0.8125rem;
    opacity: 0.9;
}
.orders-table-cap-filters {
    min-width: 0;
}
.orders-table-cap-filters .hub-orders-strip {
    margin: 0;
}
.orders-table-cap-meta {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.orders-table-cap-meta:not(:has(.hub-orders-product-summary:not(.d-none), .hub-orders-batch-bar:not(.d-none))) {
    display: none;
}
.orders-table-cap-meta .hub-orders-product-summary,
.orders-table-cap-meta .hub-orders-batch-bar {
    margin-top: 0;
}
.hub-orders-strip-inner--in-cap {
    border-radius: 10px;
}
@media (min-width: 992px) {
    .orders-table-cap-row {
        flex-direction: row;
        align-items: center;
        gap: 0.65rem 0.85rem;
    }
    .orders-table-cap-row--search-only {
        justify-content: flex-start;
    }
    .orders-table-cap--erp .orders-table-cap-search {
        width: 100%;
        max-width: none;
        justify-content: flex-start;
    }
    .orders-table-cap--erp .orders-table-search {
        flex: 1 1 280px;
        max-width: 480px;
    }
    .orders-table-cap--hub .orders-table-cap-search {
        width: 100%;
        max-width: none;
        justify-content: flex-start;
    }
    .orders-table-cap--hub .orders-table-search {
        flex: 1 1 280px;
        max-width: 480px;
    }
    .orders-table-cap-row--search {
        justify-content: space-between;
    }
    .orders-table-cap-title {
        white-space: nowrap;
    }
    .orders-table-cap-search {
        flex: 1 1 auto;
        justify-content: flex-end;
    }
}
@media (max-width: 991.98px) {
    .orders-table-cap-head {
        margin-bottom: 0;
    }
}

/* Search-only cap row */
.orders-table-cap-search {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.5rem;
    min-width: 0;
}
.orders-table-search {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 1 1 220px;
    min-width: 180px;
    max-width: 420px;
    margin: 0;
}
.orders-table-search-icon {
    color: var(--text-muted, #697a8d);
    font-size: 0.8125rem;
    flex-shrink: 0;
}
.orders-table-search-input {
    font-size: 0.8125rem;
}
.orders-cap-season {
    width: auto;
    max-width: 11rem;
    font-size: 0.8125rem;
    flex-shrink: 0;
}
.orders-cap-clear-btn {
    flex-shrink: 0;
    padding: 0.25rem 0.5rem;
}

/* Column-header filters */
.ncs-col-th {
    vertical-align: middle !important;
    white-space: nowrap;
    overflow: visible;
    position: relative;
}
.ncs-col-filter {
    display: inline-flex;
    max-width: 100%;
    position: relative;
}
.ncs-col-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 500;
    font-size: inherit;
    line-height: 1.3;
    text-transform: inherit;
    letter-spacing: inherit;
    white-space: nowrap;
}
.ncs-col-filter-btn.dropdown-toggle::after {
    display: none;
}
.ncs-col-filter-chevron {
    font-size: 0.55em;
    opacity: 0.5;
    margin-left: 0.15rem;
    transition: color 0.15s ease, opacity 0.15s ease;
}
.ncs-col-filter-btn.is-filter-active {
    color: var(--accent-orange, #e8590c);
}
.ncs-col-filter-btn.is-filter-active .ncs-col-filter-chevron {
    color: var(--accent-orange, #e8590c);
    opacity: 1;
}
.ncs-col-filter-menu {
    min-width: 11rem;
    max-width: 16rem;
    padding: 0.5rem 0.55rem !important;
    z-index: 1300;
}
.ncs-col-filter-menu.show {
    z-index: 1300;
}
.ncs-col-filter-menu-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted, #697a8d);
    margin-bottom: 0.35rem;
}
.ncs-col-filter-menu-actions {
    margin-top: 0.4rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border-color, #e4e6ef);
}
.ncs-col-filter-dates .form-label,
.ncs-col-filter-qty .form-label {
    color: var(--text-muted, #697a8d);
}
.orders-list-table thead .ncs-col-filter-menu,
.hub-list-table thead .ncs-col-filter-menu {
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
}

[data-theme="dark"] .orders-table-card > .orders-table-cap {
    background: linear-gradient(
        180deg,
        rgba(var(--primary-dark-green-rgb, 9, 92, 77), 0.12) 0%,
        var(--surface, #1e293b) 72%
    );
    border-bottom-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .orders-table-cap-title {
    color: var(--text-body, #e2e8f0);
}

.hub-order-row-selected {
    background: rgba(var(--primary-dark-green-rgb, 9, 92, 77), 0.06);
}

[data-theme="dark"] .hub-orders-strip-inner {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .hub-strip-select:hover,
[data-theme="dark"] .hub-strip-select:focus {
    background-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .orders-hero.ncs-page-head .orders-hero-icon {
    background: rgba(45, 74, 66, 0.25);
}

/* ========== Minh Anh Hub ========== */
.hub-page {
    --hub-table-font: 0.8125rem;
}
.hub-finance {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}
@media (max-width: 767px) {
    .hub-finance { grid-template-columns: 1fr; }
}
.hub-finance-card {
    background: var(--surface, #fff);
    border: 1px solid var(--border-color, #e4e6ef);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}
.hub-finance-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}
.hub-finance-card--revenue::before { background: var(--primary-dark-green, #095c4d); }
.hub-finance-card--paid::before { background: #059669; }
.hub-finance-card--due::before { background: #dc2626; }
.hub-finance-card__label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}
.hub-finance-card__value {
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    color: var(--text-heading);
    line-height: 1.2;
}
.hub-finance-card--revenue .hub-finance-card__value { color: var(--primary-dark-green, #095c4d); }
.hub-finance-card--due .hub-finance-card__value { color: #b91c1c; }
.hub-finance-card__sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.hub-cust-page .hub-finance {
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}
.hub-cust-page .hub-finance-card {
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.hub-cust-page .hub-finance-card__label {
    font-size: 0.58rem;
    letter-spacing: 0.04em;
    margin-bottom: 0.05rem;
}
.hub-cust-page .hub-finance-card__value {
    font-size: 0.92rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.hub-cust-page .hub-finance-card__value .fs-6 {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
}
.hub-cust-page .hub-finance-card__sub {
    font-size: 0.58rem;
    margin-top: 0.05rem;
}
.hub-cust-page .orders-hero-stats {
    gap: 0.35rem;
}
.hub-cust-page .orders-stat {
    min-width: 64px;
    max-width: 96px;
    padding: 0.32rem 0.45rem;
}
.hub-cust-page .orders-stat-value {
    font-size: 1rem;
}
.hub-cust-page .orders-stat-label {
    font-size: 0.58rem;
}

/* Hub dashboard — header KPI giống dashboard ERP (biz-revenue-hero) */
.hub-page .biz-dash__head {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "title actions";
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--ncs-bar-border);
    border-radius: 14px;
    background: var(--ncs-bar-gradient);
    box-shadow: var(--card-shadow);
}
.hub-page .biz-dash__head > .flex-grow-1 {
    grid-area: title;
    min-width: 0;
}
.hub-page .biz-dash__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ncs-bar-text);
}
.hub-page .biz-dash__meta {
    font-size: 0.72rem;
    color: var(--ncs-bar-text-muted);
    margin: 0.15rem 0 0;
}
.hub-page .biz-dash__head-actions {
    grid-area: actions;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    justify-content: flex-end;
}
.hub-dash-date-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.45rem;
    font-size: 0.72rem;
    color: var(--ncs-bar-text-muted);
}
.hub-dash-date-filter .form-control {
    width: auto;
    min-width: 8.5rem;
    max-width: 10.5rem;
    font-size: 0.72rem;
    padding: 0.2rem 0.45rem;
    border-color: var(--ncs-bar-border);
    background: rgba(255, 255, 255, 0.72);
}
.hub-page .biz-dash__head-actions.w-100 {
    width: auto;
}
.hub-page .biz-dash__kpis {
    grid-area: kpis;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.65rem;
    align-items: stretch;
    justify-content: flex-end;
    min-width: 0;
}
.hub-page .biz-revenue-hero {
    flex: 1 1 0;
    min-width: 11.5rem;
    max-width: 19rem;
    width: 19rem;
    padding: 0.55rem 0.8rem 0.65rem;
    border-radius: 12px;
    border: 1px solid rgba(27, 67, 50, 0.18);
    background: linear-gradient(135deg, #ffffff 0%, #f4faf7 48%, #eef6f1 100%);
    box-shadow: 0 6px 20px rgba(27, 67, 50, 0.08);
}
@media (max-width: 767.98px) {
    .hub-page .biz-dash__head {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "actions";
    }
    .hub-page .biz-dash__head-actions {
        justify-content: flex-start;
        width: 100%;
    }
    .hub-page .biz-dash__kpis {
        width: 100%;
        overflow-x: auto;
        justify-content: stretch;
        padding-bottom: 0.1rem;
    }
    .hub-page .biz-revenue-hero {
        flex: 1 0 calc(50% - 0.35rem);
        min-width: 10.5rem;
        max-width: none;
        width: auto;
    }
}
.hub-page .biz-revenue-hero__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.32rem;
}
.hub-page .biz-revenue-hero__eyebrow {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #5c6b63;
}
.hub-page .biz-revenue-hero__ratio {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.2rem 0.35rem;
    line-height: 1.1;
}
.hub-page .biz-revenue-hero__achieved {
    font-size: clamp(1rem, 2vw, 1.35rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #1b4332;
}
.hub-page .biz-revenue-hero__sep { font-weight: 600; color: #94a39a; }
.hub-page .biz-revenue-hero__target {
    font-size: clamp(0.85rem, 1.6vw, 1.05rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #6b7c72;
}
.hub-page .biz-revenue-hero__ring {
    --pct: 0;
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 50%;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--ring-color, #1b4332) calc(var(--pct) * 1%), #e2ebe6 0);
    box-shadow: 0 0 0 3px #fff, 0 3px 10px rgba(27, 67, 50, 0.1);
}
.hub-page .biz-revenue-hero__ring-inner {
    width: 2.55rem;
    height: 2.55rem;
    border-radius: 50%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.hub-page .biz-revenue-hero__pct {
    font-size: 0.88rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #1b4332;
}
.hub-page .biz-revenue-hero__pct-label {
    font-size: 0.48rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #8a9a92;
}
.hub-page .biz-revenue-hero__bar {
    height: 6px;
    border-radius: 99px;
    background: #e2ebe6;
    overflow: hidden;
}
.hub-page .biz-revenue-hero__bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2d6a4f 0%, #40916c 55%, #52b788 100%);
    transition: width 0.5s ease;
}
.hub-page .biz-revenue-hero--mid .biz-revenue-hero__achieved { color: #b45309; }
.hub-page .biz-revenue-hero--mid .biz-revenue-hero__ring { --ring-color: #f59e0b; }
.hub-page .biz-revenue-hero--mid .biz-revenue-hero__bar-fill {
    background: linear-gradient(90deg, #d97706 0%, #f59e0b 60%, #fbbf24 100%);
}
.hub-page .biz-revenue-hero--strong .biz-revenue-hero__achieved { color: #0369a1; }
.hub-page .biz-revenue-hero--strong .biz-revenue-hero__ring { --ring-color: #0ea5e9; }
.hub-page .biz-revenue-hero--strong .biz-revenue-hero__bar-fill {
    background: linear-gradient(90deg, #0284c7 0%, #0ea5e9 55%, #38bdf8 100%);
}
.hub-page .biz-revenue-hero--success .biz-revenue-hero__achieved { color: #b45309; }
.hub-page .biz-revenue-hero--success .biz-revenue-hero__ring { --ring-color: #f59e0b; }
.hub-page .biz-revenue-hero--success .biz-revenue-hero__bar-fill {
    background: linear-gradient(90deg, #b45309 0%, #f59e0b 50%, #fcd34d 100%);
}
.hub-page .biz-kpi-grid--single-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.55rem;
    overflow-x: auto;
    margin-bottom: 0.85rem;
    padding-top: 4px;
    padding-bottom: 0.25rem;
}
.hub-page .hub-kpi-strip--cols-4,
.hub-page .hub-kpi-strip--cols-5 {
    display: grid;
    overflow-x: visible;
    flex-wrap: unset;
}
.hub-page .hub-kpi-strip--cols-4 .hub-kpi-card,
.hub-page .hub-kpi-strip--cols-5 .hub-kpi-card {
    flex: unset;
    min-width: 0;
}
.hub-page .hub-kpi-strip--cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}
.hub-page .hub-kpi-strip--cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1199.98px) {
    .hub-page .hub-kpi-strip--cols-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 767.98px) {
    .hub-page .hub-kpi-strip--cols-5,
    .hub-page .hub-kpi-strip--cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.hub-page .biz-kpi-grid--single-row .biz-kpi,
.hub-page .hub-kpi-strip .hub-kpi-card {
    flex: 1 0 0;
    min-width: 8.75rem;
    padding: 0.55rem 0.65rem 0.5rem;
    background: linear-gradient(165deg, var(--surface, #fff) 0%, rgba(var(--primary-dark-green-rgb), 0.03) 100%);
    border: 1px solid var(--border-color, #e4e6ef);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 14px rgba(15, 23, 42, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    position: relative;
    overflow: hidden;
}
.hub-page .hub-kpi-strip .hub-kpi-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 14px 0 0 14px;
    background: var(--hub-kpi-accent, rgba(var(--primary-dark-green-rgb), 0.55));
}
.hub-page .hub-kpi-card--revenue { --hub-kpi-accent: #0d5c4a; }
.hub-page .hub-kpi-card--profit { --hub-kpi-accent: #0369a1; }
.hub-page .hub-kpi-card--referral { --hub-kpi-accent: #7c3aed; }
.hub-page .hub-kpi-card--orders { --hub-kpi-accent: #059669; }
.hub-page .hub-kpi-card--debt { --hub-kpi-accent: #dc2626; }
.hub-page .hub-kpi-card--revenue .biz-kpi__value { color: #0d5c4a; }
.hub-page .hub-kpi-card--profit .biz-kpi__value { color: #0369a1; }
.hub-page .hub-kpi-card--referral .biz-kpi__value { color: #6d28d9; }
.hub-page .hub-kpi-card--orders .biz-kpi__value { color: #047857; }
a.biz-kpi:hover,
.hub-page .hub-kpi-strip a.hub-kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--primary-dark-green-rgb), 0.28);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    color: inherit;
    z-index: 2;
}
.hub-page .biz-kpi__label {
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.18rem;
    line-height: 1.2;
    padding-left: 0.15rem;
}
.hub-page .biz-kpi__value {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--primary-dark-green, #095c4d);
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
    padding-left: 0.15rem;
}
.hub-page .biz-kpi__sub {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 0.12rem;
    padding-left: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hub-tsln-pct {
    color: #b91c1c;
    font-weight: 700;
}
.hub-page .biz-kpi--warn .biz-kpi__value { color: #b45309; }
.hub-page .biz-kpi--danger .biz-kpi__value { color: #c62828; }
.hub-page .biz-kpi__value--ratio .biz-kpi__value-sep {
    font-weight: 600;
    color: #8a9a92;
    margin: 0 0.08rem;
}
[data-theme="dark"] .hub-page .biz-revenue-hero {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-raised) 100%);
    border-color: var(--border-color);
}
[data-theme="dark"] .hub-page .biz-kpi-grid--single-row .biz-kpi,
[data-theme="dark"] .hub-page .hub-kpi-strip .hub-kpi-card {
    background: linear-gradient(165deg, var(--surface-raised, #1e293b) 0%, rgba(var(--primary-dark-green-rgb), 0.08) 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}
[data-theme="dark"] .hub-dash-pie::after {
    background: var(--surface-raised, #1e293b);
}

.hub-table-card.orders-table-card {
    border-radius: 14px;
}
.hub-list-table.orders-list-table {
    font-size: var(--hub-table-font);
}
.hub-list-table thead th {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    background: var(--ncs-table-sticky-head-bg, var(--table-head-bg));
    border-bottom: 1px solid var(--ncs-bar-border);
    padding: 0.32rem 0.45rem;
}
.hub-list-table tbody td {
    padding: 0.32rem 0.45rem;
    vertical-align: middle;
}
.hub-list-table .hub-items-cell {
    max-width: 280px;
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--text-dark);
}
.hub-list-table .hub-items-cell .hub-items-toggle {
    color: var(--primary-dark-green);
    cursor: pointer;
    font-weight: 500;
    border: 0;
    background: none;
    padding: 0;
    font-size: inherit;
}
.hub-order-detail-row td {
    background: rgba(var(--primary-dark-green-rgb), 0.04);
    border-top: none;
    padding-top: 0;
    padding-bottom: 0.75rem;
}
.hub-order-detail-panel {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface);
    font-size: 0.8125rem;
}
.hub-order-detail-panel table {
    margin: 0;
    font-size: 0.75rem;
}
.hub-cust-inactive { opacity: 0.55; }
.hub-cust-debt { color: #b91c1c; font-weight: 600; }
.hub-cust-row { cursor: pointer; }
.hub-cust-row:hover td { background: rgba(4, 120, 87, 0.04); }
.hub-cust-kind-badge { font-weight: 500; font-size: 0.72rem; }
.hub-order-cust {
    font-size: inherit;
    line-height: 1.3;
}
.hub-type-badge {
    font-size: 0.65rem;
    font-weight: 500;
}
.hub-status-badge {
    font-size: 0.65rem;
    font-weight: 600;
}
.hub-list-table .order-status-badge,
.hub-list-table .payment-status-badge {
    font-size: 0.65rem;
    padding: 0.28em 0.42em;
    white-space: nowrap;
}
.payment-status-badge {
    font-weight: 600;
    border-radius: 0.25rem;
}
.payment-status-badge--partial {
    background: #fef3c7 !important;
    color: #92400e !important;
    border: 1px solid #fcd34d;
}
.hub-page .hub-orders-actions.orders-actions-wrap {
    justify-content: flex-start;
    gap: 0.2rem;
}
.hub-page .hub-cust-actions.orders-actions-wrap {
    justify-content: center;
}
.hub-page .hub-ncs-badge {
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hub-page .hub-ncs-badge__sep {
    opacity: 0.55;
    margin: 0 0.15rem;
}
.hub-page .order-action-icon {
    width: 28px;
    height: 28px;
    font-size: 0.72rem;
    border-radius: 0.3rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.hub-profit-pos { color: #047857; font-weight: 600; }
.hub-profit-neg { color: #b91c1c; font-weight: 600; }
.hub-profit-est { font-style: italic; cursor: help; }
.hub-profit-est-mark { opacity: 0.75; margin-right: 0.1rem; }
.hub-order-items-detail {
    width: 100%;
    table-layout: auto;
}
.hub-order-items-detail thead th {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.3rem 0.5rem;
    vertical-align: middle;
    white-space: nowrap;
    background: var(--ncs-table-sticky-head-bg, var(--table-head-bg));
    border-bottom: 1px solid var(--border-color);
}
.hub-order-items-detail tbody td {
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    vertical-align: middle;
}
.hub-order-items-detail .hub-order-disc-cell {
    white-space: nowrap;
    line-height: 1.25;
}
.hub-order-items-detail th.text-end,
.hub-order-items-detail td.text-end {
    font-variant-numeric: tabular-nums;
}
.hub-order-discount-summary {
    color: var(--text-dark);
    line-height: 1.45;
}
.hub-dash-panel {
    background: var(--surface, #fff);
    border: 1px solid var(--border-color, #e4e6ef);
    border-radius: 14px;
    overflow: hidden;
}
.hub-dash-panel .ncs-section-head.hub-dash-section-head {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--ncs-bar-border);
    border-radius: 14px 14px 0 0;
}
.hub-dash-panel .ncs-section-head.hub-dash-section-head span:first-child {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ncs-bar-text);
}
.hub-dash-section-head__meta {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--ncs-bar-text-muted, #6b7c72);
    text-transform: none;
    letter-spacing: 0;
}
.hub-dash-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--border-color, #e4e6ef);
    background: rgba(var(--primary-dark-green-rgb), 0.04);
}
.hub-dash-panel__title {
    font-size: 0.78rem;
    font-weight: 500;
    margin: 0;
    color: var(--text-dark, #1b4332);
    letter-spacing: 0.01em;
}
.hub-dash-panel__body { padding: 0.5rem 0.75rem; }
.hub-dash-delivery-scroll {
    max-height: 240px;
    overflow-y: auto;
    padding-right: 0.15rem;
}
.hub-dash-delivery-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.32rem 0;
    border-bottom: 1px solid var(--border-color, #e4e6ef);
    font-size: 0.78rem;
    line-height: 1.3;
}
.hub-dash-delivery-item:last-child { border-bottom: none; }
.hub-dash-num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.hub-dash-empty {
    margin: 0;
    padding: 1rem 0;
    text-align: center;
    color: #6b7c72;
    font-size: 0.85rem;
}
.hub-dash-rank-table {
    font-size: 0.74rem;
}
.hub-dash-rank-table thead tr.hub-dash-table-cols--titled th {
    background: var(--ncs-bar-gradient);
    border-bottom: 1px solid var(--ncs-bar-border);
    border-top: none;
    padding: 0.45rem 0.55rem;
    vertical-align: middle;
}
.hub-dash-rank-table thead tr.hub-dash-table-cols--titled .hub-dash-table-cols__title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ncs-bar-text);
    text-align: left;
}
.hub-dash-rank-table thead tr.hub-dash-table-cols--titled th:not(.hub-dash-table-cols__title) {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--ncs-bar-text-muted, #6b7c72);
}
.hub-dash-rank-table thead tr.hub-dash-table-cols__rank,
.hub-dash-rank-table thead tr.hub-dash-table-cols--titled .hub-dash-table-cols__rank {
    width: 1.35rem;
    padding-left: 0.55rem !important;
}
.hub-dash-rank-table .hub-dash-table-caption th {
    background: var(--ncs-bar-gradient);
    border-bottom: 1px solid var(--ncs-bar-border);
    color: var(--ncs-bar-text);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-top: none;
}
.hub-dash-rank-table thead tr.hub-dash-table-cols th {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #6b7c72;
    border-bottom-width: 1px;
    padding: 0.28rem 0.4rem;
}
.hub-dash-rank-table tbody td {
    padding: 0.28rem 0.4rem;
    vertical-align: middle;
}
.hub-dash-rank {
    width: 1.35rem;
    color: #94a39a;
    font-variant-numeric: tabular-nums;
    padding-left: 0.55rem !important;
}
.hub-dash-rank-table tbody tr:first-child .hub-dash-rank {
    color: #1b4332;
    font-weight: 700;
}
.hub-dash-chart-wrap {
    position: relative;
    width: 100%;
    max-width: 168px;
    height: 168px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hub-dash-pie {
    width: 148px;
    height: 148px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
    position: relative;
}
.hub-dash-pie::after {
    content: '';
    position: absolute;
    inset: 28%;
    border-radius: 50%;
    background: var(--surface, #fff);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.05);
}
.hub-dash-chart-empty {
    min-height: 148px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hub-dash-rev-type-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.hub-dash-rev-type-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border-color, #e4e6ef);
    font-variant-numeric: tabular-nums;
}
.hub-dash-rev-type-item:last-child {
    border-bottom: none;
}
.hub-dash-rev-type-item__dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--dot, #0d5c4a);
    flex-shrink: 0;
}
.hub-dash-stock-table thead th {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 0.28rem 0.55rem;
}
.hub-dash-stock-table tbody td {
    padding: 0.28rem 0.55rem;
    vertical-align: middle;
    font-size: 0.78rem;
}
.hub-page .card.card-metric {
    border-radius: 14px;
    overflow: hidden;
}
.hub-page .card.card-metric .ncs-section-head {
    padding: 0.4rem 0.75rem;
}
.hub-page .card.card-metric .ncs-section-head span {
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0.01em;
}
.hub-page .card.card-metric .card-body {
    padding: 0.55rem 0.75rem;
}
.hub-dashboard-grid .card.card-metric {
    height: 100%;
}
.hub-dashboard-grid .hub-dash-card__label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.hub-dashboard-grid .hub-dash-card__value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-heading);
    font-variant-numeric: tabular-nums;
}
.hub-public-page {
    min-height: 100vh;
    background: var(--bg-light);
    padding: 1.25rem;
}
.hub-place-order-shell {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    gap: 1rem;
    max-width: 1180px;
    margin: 0 auto;
}
.hub-place-order-main {
    flex: 1 1 420px;
    max-width: 760px;
    margin: 0;
}
.hub-delivery-meta-row .form-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hub-delivery-meta-row input[type="date"] {
    min-width: 0;
}
.hub-order-history-card {
    flex: 0 1 340px;
    width: 100%;
    max-width: 380px;
    margin: 0;
    max-height: calc(100vh - 2.5rem);
    display: flex;
    flex-direction: column;
}
.hub-order-history-card .hub-public-body {
    overflow-y: auto;
    flex: 1 1 auto;
}
.hub-history-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.65rem;
    background: #fafcfb;
}
.hub-history-item:last-child {
    margin-bottom: 0;
}
@media (max-width: 991.98px) {
    .hub-place-order-shell {
        flex-direction: column;
        align-items: stretch;
    }
    .hub-place-order-main,
    .hub-order-history-card {
        max-width: 760px;
        width: 100%;
        margin: 0 auto;
    }
    .hub-order-history-card {
        max-height: none;
    }
}
.hub-public-card {
    max-width: 760px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    background: var(--surface);
}
.hub-public-card .hub-public-head {
    padding: 1rem 1.25rem;
    background: var(--ncs-bar-gradient);
    border-bottom: 1px solid var(--ncs-bar-border);
}
.hub-public-card .hub-public-head h5 {
    margin: 0;
    color: var(--ncs-bar-text);
    font-weight: 600;
}
.hub-public-card .hub-public-body {
    padding: 1.25rem;
}
.hub-public-card.hub-public-order-form .hub-add-line-btn {
    width: 1.65rem;
    height: 1.65rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border-radius: 0.35rem;
}
.hub-public-card.hub-public-order-form .hub-add-line-btn:hover {
    background: rgba(25, 135, 84, 0.08);
}

.hub-contract-form .hub-form-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted, #697a8d);
}
.hub-contract-form .form-label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}
.hub-contract-form .hub-preview-hints {
    min-height: 0;
    line-height: 1.4;
}
.hub-contract-form .hub-product-lines-wrap {
    --hub-contract-cols: minmax(0, 5fr) minmax(0, 2fr) minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr);
    border: 1px solid var(--border-color, #e7e9ed);
    border-radius: 0.4rem;
    padding: 0.5rem 0.4rem 0.35rem;
    background: rgba(var(--primary-dark-green-rgb, 4, 120, 87), 0.02);
    min-height: 2.5rem;
}
.hub-contract-form--line-disc .hub-product-lines-wrap {
    --hub-contract-cols: minmax(0, 4fr) minmax(0, 1.6fr) minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 1.8fr) minmax(0, 1fr);
}
.hub-contract-form .hub-product-lines-head,
.hub-contract-form .hub-product-line,
.hub-contract-form .hub-contract-totals-row {
    display: grid;
    grid-template-columns: var(--hub-contract-cols);
    column-gap: 0.25rem;
    align-items: center;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}
.hub-contract-form .hub-product-lines-head {
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
    margin-bottom: 0.25rem;
    font-size: 0.8125rem;
}
.hub-contract-form .hub-product-line {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    border-radius: 0.35rem;
    transition: background 0.15s ease;
}
.hub-contract-form .hub-product-line:hover {
    background: rgba(var(--primary-dark-green-rgb, 4, 120, 87), 0.04);
}
.hub-contract-form .hub-product-line > * {
    display: flex;
    align-items: center;
    min-width: 0;
}
.hub-contract-form .hub-grid-product {
    justify-content: flex-start;
}
.hub-contract-form .hub-grid-action {
    justify-content: center;
}
.hub-contract-form .hub-product-line .text-end-col,
.hub-contract-form .hub-contract-totals-row .text-end-col {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    text-align: right;
}
.hub-contract-form .hub-product-line .text-center-col {
    justify-content: center;
    text-align: center;
}
.hub-contract-form .hub-product-lines-head .hub-grid-qty {
    text-align: center;
}
.hub-contract-form .hub-product-lines-head .hub-grid-unit,
.hub-contract-form .hub-product-lines-head .hub-grid-amt {
    text-align: right;
}
.hub-contract-form .hub-product-lines-head .hub-grid-disc {
    text-align: center;
}
.hub-contract-form .hub-product-line .hub-disc-inp {
    width: 3.25rem;
    min-width: 2.75rem;
    max-width: 3.5rem;
    padding: 0.12rem 0.15rem;
    font-size: 0.8125rem;
}
.hub-contract-form .hub-product-empty {
    padding: 0.5rem 0.25rem;
    font-size: 0.875rem;
}
.hub-contract-form .hub-product-section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.hub-contract-form .hub-product-section-label.hub-form-section-title {
    font-size: 0.7rem;
    letter-spacing: 0.02em;
}
.hub-contract-form .hub-product-line .form-select,
.hub-contract-form .hub-product-line .form-control {
    font-size: 0.875rem;
}
.hub-contract-form .hub-product-line .hub-qty-inp {
    width: 3rem;
    min-width: 2.75rem;
    max-width: 3.25rem;
    padding: 0.12rem 0.2rem;
    font-size: 0.8125rem;
    line-height: 1.2;
}
.hub-contract-form .hub-grid-qty {
    justify-content: center;
}
.hub-contract-form .hub-product-search-wrap {
    position: relative;
}
.hub-contract-form .hub-product-search-wrap .product-picker-dropdown {
    top: calc(100% + 0.25rem);
}
.hub-contract-form .hub-add-line-btn {
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.3rem;
    font-size: 0.7rem;
    color: var(--primary-dark-green, #047857);
    border-color: var(--primary-dark-green, #047857);
    flex-shrink: 0;
}
.hub-contract-form .hub-add-line-btn:hover {
    background: rgba(var(--primary-dark-green-rgb, 4, 120, 87), 0.1);
    color: var(--primary-dark-green, #047857);
    border-color: var(--primary-dark-green, #047857);
}
.hub-contract-form .hub-line-amt,
.hub-contract-form .hub-line-unit {
    font-size: 0.8125rem;
    white-space: nowrap;
}
.hub-contract-form .hub-line-amt {
    font-weight: 600;
}
.hub-contract-form .hub-contract-totals {
    border-top: 1px dashed var(--border-color, #e7e9ed);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}
.hub-contract-form .hub-contract-totals-row {
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
}
.hub-contract-form .hub-contract-totals-label {
    grid-column: 1 / 4;
    text-align: right;
    color: var(--text-muted, #697a8d);
    font-size: 0.8125rem;
    padding-right: 0.25rem;
}
.hub-contract-form .hub-contract-totals-value {
    grid-column: 4;
    font-weight: 600;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.hub-contract-form .hub-contract-totals-spacer {
    grid-column: 5;
}
.hub-contract-form .hub-contract-totals-row--grand .hub-contract-totals-label,
.hub-contract-form .hub-contract-totals-row--grand .hub-contract-totals-value {
    font-weight: 700;
    font-size: 0.95rem;
}
.hub-contract-form .hub-contract-totals-row--grand.text-success .hub-contract-totals-label,
.hub-contract-form .hub-contract-totals-row--grand.text-success .hub-contract-totals-value {
    color: var(--bs-success, #198754);
}
.hub-contract-form .hub-contract-totals-row--grand.text-danger .hub-contract-totals-label,
.hub-contract-form .hub-contract-totals-row--grand.text-danger .hub-contract-totals-value {
    color: var(--bs-danger, #dc3545);
}
.hub-contract-form .hub-contract-totals-row--grand {
    border-top: 1px solid var(--border-color, #e7e9ed);
    margin-top: 0.35rem;
    padding-top: 0.5rem;
}
.hub-contract-form .hub-contract-totals .text-discount {
    color: #dc3545;
}

[data-theme="dark"] .hub-order-detail-row td {
    background: rgba(var(--primary-dark-green-rgb), 0.06);
}
[data-theme="dark"] .hub-order-detail-panel {
    background: var(--surface-raised);
}
