/* HadiTech Design System v2 - Bootstrap 5 compatible */
:root {
    --erp-font-sans: Inter, Manrope, "Plus Jakarta Sans", "Segoe UI", sans-serif;
    /* Palette extraite de l'identité visuelle HadiTech : cyan, acier et graphite. */
    --erp-color-navy: #071621;
    --erp-color-navy-deep: #123f63;
    --erp-color-primary: #079fda;
    --erp-color-primary-light: #35a9d8;
    --erp-color-indigo: #1f689a;
    --erp-color-purple: #174f7d;
    --erp-color-graphite: #111310;
    --erp-color-success: #10b981;
    --erp-color-danger: #ef4444;
    --erp-color-warning: #f97316;
    --erp-color-info: #2563eb;
    --erp-color-bg: #f5f7fb;
    --erp-color-surface: #ffffff;
    --erp-color-border: #e2e8f0;
    --erp-color-text: #0f172a;
    --erp-color-text-muted: #64748b;
    --erp-space-1: 0.25rem;
    --erp-space-2: 0.5rem;
    --erp-space-3: 0.75rem;
    --erp-space-4: 1rem;
    --erp-space-5: 1.25rem;
    --erp-space-6: 1.5rem;
    --erp-space-8: 2rem;
    --erp-radius-xs: 6px;
    --erp-radius-sm: 10px;
    --erp-radius-md: 14px;
    --erp-radius-lg: 18px;
    --erp-radius-pill: 999px;
    --erp-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 6px 18px rgba(15, 23, 42, 0.04);
    --erp-shadow-md: 0 12px 32px rgba(15, 23, 42, 0.09);
    --erp-shadow-focus: 0 0 0 3px rgba(37, 99, 235, 0.2);
    --erp-sidebar-width: 250px;
    --erp-control-height: 42px;
    --erp-transition: 160ms ease;
}

body#cloudonex_body {
    font-family: var(--erp-font-sans);
    color: var(--erp-color-text);
    background: var(--erp-color-bg);
}

.erp-skip-link {
    position: fixed;
    z-index: 2000;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.65rem 0.9rem;
    border-radius: var(--erp-radius-sm);
    color: #ffffff;
    background: var(--erp-color-primary);
    box-shadow: var(--erp-shadow-md);
    transform: translateY(-150%);
    transition: transform var(--erp-transition);
}

.erp-skip-link:focus {
    color: #ffffff;
    transform: translateY(0);
}

.page-content {
    background: var(--erp-color-bg);
}

.erp-sidebar {
    border-right: 0;
    background: linear-gradient(180deg, var(--erp-color-graphite) 0%, var(--erp-color-navy) 52%, var(--erp-color-navy-deep) 100%);
    box-shadow: 10px 0 30px rgba(7, 21, 47, 0.12);
}

.erp-sidebar .primary-nav {
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(53, 169, 216, 0.48) transparent;
}

.erp-sidebar .primary-nav::-webkit-scrollbar,
.erp-table-wrap::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
.nav-tabs::-webkit-scrollbar,
.nav-pills:not(.flex-column)::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

.erp-sidebar .primary-nav::-webkit-scrollbar-track,
.erp-table-wrap::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track,
.nav-tabs::-webkit-scrollbar-track,
.nav-pills:not(.flex-column)::-webkit-scrollbar-track {
    background: transparent;
}

.erp-sidebar .primary-nav::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: var(--erp-radius-pill);
    background: rgba(53, 169, 216, 0.48);
    background-clip: padding-box;
}

.erp-table-wrap::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb,
.nav-tabs::-webkit-scrollbar-thumb,
.nav-pills:not(.flex-column)::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: var(--erp-radius-pill);
    background: #94a3b8;
    background-clip: padding-box;
}

.erp-topbar {
    border-bottom: 1px solid var(--erp-color-border);
    background: var(--erp-color-surface);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

/* Global shell --------------------------------------------------------- */
.erp-sidebar .page-logo {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
}

.erp-sidebar .page-logo-text,
.erp-sidebar .page-logo-link,
.erp-sidebar .nav-menu > li > a,
.erp-sidebar .nav-menu > li > a .nav-link-text {
    color: #e8eefc !important;
}

.erp-sidebar .nav-menu > li > a {
    min-height: 44px;
    margin: 3px 10px;
    border-radius: 10px;
    transition: background var(--erp-transition), color var(--erp-transition), transform var(--erp-transition);
}

.erp-sidebar .nav-menu > .erp-nav-section {
    margin: 0.65rem 0.75rem 0.15rem;
    color: rgba(185, 199, 227, 0.72);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    line-height: 1.2;
    text-transform: uppercase;
}

.erp-sidebar .nav-menu > .erp-nav-section:first-child {
    margin-top: 0.15rem;
}

.nav-function-minify .erp-sidebar .erp-nav-section {
    display: none;
}

.erp-sidebar .nav-menu > li > a > .erp-menu-icon,
.erp-sidebar .nav-menu > li > a > svg {
    display: inline-flex;
    flex: 0 0 22px;
    align-items: center;
    justify-content: center;
    width: 22px !important;
    height: 22px !important;
    margin: 0 !important;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--erp-color-primary-light) !important;
    background: transparent;
    box-sizing: border-box;
    transition: color var(--erp-transition), opacity var(--erp-transition), transform var(--erp-transition);
}

.erp-sidebar .nav-menu > li.plugin-nav-item > a > .plugin-menu-icon.erp-menu-icon {
    flex-basis: 22px;
    width: 22px !important;
    min-width: 22px;
    height: 22px !important;
    margin: 0 !important;
    color: var(--erp-color-primary-light) !important;
}

.erp-sidebar .nav-menu > li > a > .erp-menu-icon > svg,
.erp-sidebar .nav-menu > li > a > .erp-menu-icon > i {
    display: block;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    font-size: 17px;
    line-height: 18px;
}

.erp-sidebar .nav-menu > li > a svg {
    fill: currentColor !important;
}

/* Les SVG historiques contiennent souvent un canevas transparent 24x24.
   Il ne doit jamais être recoloré comme une forme du pictogramme. */
.erp-sidebar .nav-menu > li > a svg > rect[width="24"][height="24"],
.erp-sidebar .nav-menu > li > a svg > g > rect[width="24"][height="24"],
.erp-sidebar .nav-menu > li > a svg polygon[points="0 0 24 0 24 24 0 24"] {
    fill: none !important;
    stroke: none !important;
}

.erp-sidebar .nav-menu > li > a:hover,
.erp-sidebar .nav-menu > li.active > a,
.erp-sidebar .nav-menu > li.open > a {
    color: #fff !important;
    background: linear-gradient(135deg, rgba(7, 159, 218, 0.94), rgba(31, 104, 154, 0.94));
}

.erp-sidebar .nav-menu > li > a:hover > .erp-menu-icon,
.erp-sidebar .nav-menu > li > a:hover > svg,
.erp-sidebar .nav-menu > li.active > a > .erp-menu-icon,
.erp-sidebar .nav-menu > li.active > a > svg,
.erp-sidebar .nav-menu > li.open > a > .erp-menu-icon,
.erp-sidebar .nav-menu > li.open > a > svg {
    color: #fff !important;
    background: transparent;
    opacity: 1;
    transform: scale(1.04);
}

.erp-sidebar .nav-menu > li.plugin-nav-item.active > a > .plugin-menu-icon.erp-menu-icon,
.erp-sidebar .nav-menu > li.plugin-nav-item.open > a > .plugin-menu-icon.erp-menu-icon,
.erp-sidebar .nav-menu > li.plugin-nav-item > a:hover > .plugin-menu-icon.erp-menu-icon {
    color: #fff !important;
}

.erp-sidebar .nav-menu > li > a > .collapse-sign {
    margin-left: auto;
    opacity: 0.72;
}

.erp-sidebar .nav-menu > li > ul {
    background: rgba(2, 10, 27, 0.22);
}

.erp-sidebar .nav-menu > li > ul a {
    color: #b9c7e3;
    min-height: 38px;
}

.erp-sidebar .nav-menu > li > ul a:hover,
.erp-sidebar .nav-menu > li > ul li.active > a {
    color: #fff;
    background: rgba(53, 169, 216, 0.16);
}

.erp-topbar {
    min-height: 68px;
    padding-inline: var(--erp-space-4);
}

.erp-topbar-tools {
    display: flex;
    align-items: center;
    gap: var(--erp-space-2);
    min-width: 0;
}

.erp-topbar-search {
    position: relative;
    width: clamp(210px, 24vw, 360px);
}

.erp-topbar-search .form-control {
    min-height: 42px;
    padding-left: 2.5rem;
    border-color: var(--erp-color-border);
    border-radius: var(--erp-radius-pill);
    background: #f8fafc;
}

.erp-topbar-search .fal {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 0.95rem;
    color: var(--erp-color-text-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.erp-topbar-search kbd {
    position: absolute;
    top: 50%;
    right: 0.7rem;
    padding: 0.18rem 0.4rem;
    border: 1px solid var(--erp-color-border);
    border-radius: 6px;
    color: var(--erp-color-text-muted);
    background: #ffffff;
    transform: translateY(-50%);
    font-size: 0.7rem;
}

.erp-global-search-results {
    position: absolute;
    z-index: 1100;
    top: calc(100% + 0.55rem);
    left: 0;
    width: min(520px, calc(100vw - 1rem));
    max-height: min(70vh, 580px);
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--erp-color-border);
    border-radius: var(--erp-radius-md);
    color: var(--erp-color-text);
    background: #ffffff;
    box-shadow: var(--erp-shadow-md);
}

.erp-global-search-group + .erp-global-search-group {
    margin-top: 0.45rem;
    padding-top: 0.45rem;
    border-top: 1px solid var(--erp-color-border);
}

.erp-global-search-group-title {
    padding: 0.35rem 0.55rem;
    color: var(--erp-color-text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.erp-global-search-item {
    display: block;
    padding: 0.55rem;
    border-radius: 8px;
    color: var(--erp-color-text);
    text-decoration: none;
}

.erp-global-search-item:hover,
.erp-global-search-item:focus {
    color: var(--erp-color-primary);
    background: #eff9fd;
}

.erp-global-search-item strong,
.erp-global-search-item small { display: block; }
.erp-global-search-item small { margin-top: 0.12rem; color: var(--erp-color-text-muted); }
.erp-global-search-state { padding: 1rem; color: var(--erp-color-text-muted); text-align: center; }
.erp-mobile-search-toggle { display: none; }

.erp-topbar-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 42px;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--erp-color-border);
    border-radius: var(--erp-radius-sm);
    color: var(--erp-color-text);
    background: #fff;
    font-weight: 650;
    white-space: nowrap;
    flex: 0 0 auto;
    transition: border-color var(--erp-transition), box-shadow var(--erp-transition), transform var(--erp-transition);
}

.erp-topbar-action:hover {
    color: var(--erp-color-primary);
    border-color: #a9dcf0;
    box-shadow: var(--erp-shadow-sm);
    transform: translateY(-1px);
}

.erp-topbar-action.is-primary {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(135deg, var(--erp-color-primary), var(--erp-color-indigo));
}

.erp-content {
    width: 100%;
    max-width: 1920px;
    padding: clamp(1rem, 2vw, 2rem) !important;
}

/* Shared components ---------------------------------------------------- */
.btn,
.form-control,
.form-select,
.select2-container .select2-selection,
.dropdown-menu,
.modal-content,
.alert,
.pagination .page-link {
    border-radius: var(--erp-radius-sm);
}

.btn {
    min-height: 40px;
    font-weight: 650;
    transition: transform var(--erp-transition), box-shadow var(--erp-transition), background var(--erp-transition);
}

.btn-primary {
    border-color: var(--erp-color-primary);
    background: linear-gradient(135deg, var(--erp-color-primary), var(--erp-color-indigo));
}

.btn-success {
    border-color: #10b981;
    color: #ffffff;
    background: #10b981;
}

.btn-success:hover,
.btn-success:focus {
    border-color: #059669;
    color: #ffffff;
    background: #059669;
}

.btn-warning {
    border-color: #f59e0b;
    color: #111827;
    background: #fbbf24;
}

.btn-warning:hover,
.btn-warning:focus {
    border-color: #d97706;
    color: #111827;
    background: #f59e0b;
}

.btn-danger {
    border-color: var(--erp-color-danger);
    color: #ffffff;
    background: var(--erp-color-danger);
}

.btn-danger:hover,
.btn-danger:focus {
    border-color: #dc2626;
    color: #ffffff;
    background: #dc2626;
}

.btn-info {
    border-color: var(--erp-color-info);
    color: #ffffff;
    background: var(--erp-color-info);
}

.btn-light,
.btn-default {
    border-color: var(--erp-color-border);
    color: var(--erp-color-text);
    background: #ffffff;
}

.btn:disabled,
.erp-btn:disabled,
[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.55;
}

.form-control,
.form-select,
.erp-input,
.erp-select {
    min-height: var(--erp-control-height);
    border-color: var(--erp-color-border);
    color: var(--erp-color-text);
    background-color: #ffffff;
    transition: border-color var(--erp-transition), box-shadow var(--erp-transition), background var(--erp-transition);
}

.form-control::placeholder,
.erp-input::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.form-control:focus,
.form-select:focus,
.erp-input:focus,
.erp-select:focus,
.select2-container--focus .select2-selection {
    border-color: var(--erp-color-primary) !important;
    box-shadow: var(--erp-shadow-focus) !important;
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
    color: #64748b;
    background: #f1f5f9;
    cursor: not-allowed;
}

.form-control.is-invalid,
.form-select.is-invalid,
.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
    border-color: var(--erp-color-danger);
}

.invalid-feedback {
    color: #b91c1c;
    font-weight: 600;
}

.input-group-text {
    min-height: var(--erp-control-height);
    border-color: var(--erp-color-border);
    color: var(--erp-color-text-muted);
    background: #f8fafc;
}

.select2-container .select2-selection--single {
    min-height: var(--erp-control-height);
    border-color: var(--erp-color-border);
}

.select2-container .select2-selection--single .select2-selection__rendered {
    line-height: calc(var(--erp-control-height) - 2px);
}

.select2-container .select2-selection--single .select2-selection__arrow {
    height: calc(var(--erp-control-height) - 2px);
}

.form-check-input {
    accent-color: var(--erp-color-primary);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--erp-color-primary) !important;
    outline-offset: 2px;
    box-shadow: var(--erp-shadow-focus) !important;
}

.card,
.panel {
    border-color: var(--erp-color-border);
    box-shadow: var(--erp-shadow-sm);
}

.panel {
    overflow: hidden;
    border-radius: var(--erp-radius-md);
    background: var(--erp-color-surface);
}

.panel .panel-hdr {
    min-height: 56px;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--erp-color-border);
    color: var(--erp-color-text);
    background: #ffffff;
}

.panel .panel-hdr h2,
.panel .panel-hdr h3,
.panel .panel-hdr h4 {
    color: inherit;
    font-weight: 750;
}

.table > :not(caption) > * > * {
    padding: 0.72rem 0.75rem;
    border-color: #edf2f7;
    vertical-align: middle;
}

.table > thead > tr > th {
    color: #334155;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    background: #f8fafc;
}

.table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: #f0f9fd;
    color: var(--erp-color-text);
}

.pagination .page-link {
    min-width: 38px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--erp-color-text-muted);
    border-color: var(--erp-color-border);
}

.pagination .page-item.active .page-link {
    color: #ffffff;
    border-color: var(--erp-color-primary);
    background: var(--erp-color-primary);
}

label,
.form-label {
    color: #334155;
    font-weight: 650;
}

.modal-content,
.dropdown-menu {
    border-color: var(--erp-color-border);
    box-shadow: var(--erp-shadow-md);
}

.modal-header,
.modal-footer {
    border-color: var(--erp-color-border);
}

.modal-title {
    color: var(--erp-color-text);
    font-weight: 750;
}

.dropdown-item {
    display: flex;
    align-items: center;
    min-height: 38px;
    border-radius: 8px;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: var(--erp-color-primary);
    background: #eff9fd;
}

.badge,
[class*="erp-status-"] {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 24px;
    padding: 0.28rem 0.55rem;
    border-radius: var(--erp-radius-pill);
    font-size: 0.7rem;
    font-weight: 750;
    line-height: 1;
}

.alert {
    border-width: 1px;
    border-left-width: 4px;
    box-shadow: var(--erp-shadow-sm);
}

.nav-tabs,
.nav-pills:not(.flex-column) {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.3rem;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.nav-tabs {
    padding: 0.3rem;
    border: 1px solid var(--erp-color-border);
    border-radius: var(--erp-radius-md);
    background: #ffffff;
}

.nav-tabs .nav-link,
.nav-pills .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.55rem 0.8rem;
    border: 0;
    border-radius: 10px;
    color: var(--erp-color-text-muted);
    font-weight: 700;
    white-space: nowrap;
}

.nav-tabs .nav-link:hover,
.nav-pills .nav-link:hover {
    color: var(--erp-color-primary);
    background: #eff9fd;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link,
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    color: #ffffff;
    border: 0;
    background: linear-gradient(135deg, var(--erp-color-primary), var(--erp-color-indigo));
    box-shadow: 0 6px 16px rgba(7, 159, 218, 0.2);
}

.breadcrumb,
.page-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1rem;
    color: var(--erp-color-text-muted);
    font-size: 0.78rem;
}

.breadcrumb a,
.page-breadcrumb a {
    color: var(--erp-color-text-muted);
}

.breadcrumb a:hover,
.page-breadcrumb a:hover {
    color: var(--erp-color-primary);
}

.panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.panel-toolbar .btn-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.badge-success,
.erp-status-success { color: #047857; background: #d1fae5; }
.badge-warning,
.erp-status-warning { color: #c2410c; background: #ffedd5; }
.badge-danger,
.erp-status-error { color: #b91c1c; background: #fee2e2; }
.badge-info,
.erp-status-info { color: #1d4ed8; background: #dbeafe; }

.erp-empty-state {
    display: grid;
    place-items: center;
    min-height: 220px;
    padding: var(--erp-space-8);
    color: var(--erp-color-text-muted);
    text-align: center;
}

.dataTables_empty,
.erp-table-wrap td.dataTables_empty,
.table-responsive td.dataTables_empty {
    height: 180px;
    padding: 2rem !important;
    color: var(--erp-color-text-muted) !important;
    background: #fbfdff !important;
    font-size: 0.86rem;
    font-weight: 650;
    text-align: center !important;
    white-space: normal;
}

.dataTables_empty::before {
    content: "";
    display: block;
    width: 42px;
    height: 42px;
    margin: 0 auto 0.75rem;
    border: 1px solid #bae6f5;
    border-radius: 50%;
    background:
        radial-gradient(circle, var(--erp-color-primary) 0 3px, transparent 4px),
        #eff9fd;
}

.erp-empty-state > :first-child {
    margin-top: 0;
}

.erp-empty-state h2,
.erp-empty-state h3,
.erp-empty-state h4 {
    margin-bottom: 0.4rem;
    color: var(--erp-color-text);
    font-weight: 750;
}

.erp-empty-state p {
    max-width: 42rem;
    margin-bottom: 1rem;
}

.dataTables_processing {
    z-index: 5;
    min-width: 180px;
    padding: 0.8rem 1rem !important;
    border: 1px solid var(--erp-color-border) !important;
    border-radius: var(--erp-radius-sm);
    color: var(--erp-color-text-muted) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: var(--erp-shadow-md);
    font-weight: 700;
}

.md-preloader circle,
.spinner-border {
    color: var(--erp-color-primary);
    stroke: var(--erp-color-primary);
}

.erp-error-state {
    display: grid;
    place-items: center;
    min-height: 180px;
    padding: 2rem;
    border: 1px solid #fecaca;
    border-radius: var(--erp-radius-md);
    color: #991b1b;
    background: #fff7f7;
    text-align: center;
}

.erp-skeleton {
    border-radius: var(--erp-radius-xs);
    background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%);
    background-size: 200% 100%;
    animation: erp-skeleton 1.4s ease infinite;
}

@keyframes erp-skeleton {
    to { background-position: -200% 0; }
}

@media (max-width: 1199.98px) {
    .erp-topbar-search { width: 220px; }
    .erp-topbar-action-label { display: none; }
}

@media (max-width: 991.98px) {
    .erp-topbar .dropdown-icon-menu {
        display: none !important;
    }

    .erp-topbar [data-class="mobile-nav-on"] {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        min-width: 44px;
        height: 44px;
        padding: 0;
        color: #ffffff !important;
        border: 1px solid rgba(53, 169, 216, 0.36) !important;
        border-radius: var(--erp-radius-sm) !important;
        background: rgba(7, 159, 218, 0.18) !important;
    }

    .erp-topbar [data-class="mobile-nav-on"]:hover {
        color: #ffffff !important;
        background: rgba(7, 159, 218, 0.32) !important;
    }
}

@media (max-width: 767.98px) {
    html,
    body#cloudonex_body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .erp-topbar { min-height: 60px; padding-inline: 0.5rem; }
    .erp-topbar-tools { gap: 0.25rem; }
    .erp-mobile-search-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        border: 1px solid rgba(53, 169, 216, 0.3);
        border-radius: var(--erp-radius-sm);
        color: #ffffff;
        background: rgba(7, 159, 218, 0.14);
    }
    .erp-topbar-search { display: none; }
    .erp-topbar-search.is-open {
        position: fixed;
        z-index: 1200;
        top: 66px;
        left: 0.5rem;
        display: block;
        width: calc(100vw - 1rem);
    }
    .erp-topbar-search.is-open .form-control { box-shadow: var(--erp-shadow-md); }
    .erp-global-search-results { width: 100%; }
    .erp-topbar-action { width: 40px; min-height: 40px; padding: 0; flex: 0 0 40px; }
    .erp-content { padding: 0.85rem !important; }
    .erp-card-header { align-items: flex-start; flex-direction: column; }
    .table-responsive, .erp-table-wrap { -webkit-overflow-scrolling: touch; }
}

@media (max-width: 575.98px) {
    .dashboard-alert-details .panel-hdr {
        align-items: flex-start;
        gap: var(--erp-space-2);
    }

    .dashboard-alert-details .list-group-item {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .dashboard-alert-details .table {
        min-width: 640px;
    }

    .erp-topbar-tools > .erp-topbar-action,
    .erp-topbar-tools > .dropdown,
    .erp-topbar-quick-links,
    .erp-topbar-theme,
    .erp-topbar-notes {
        display: none !important;
    }

    .erp-topbar > .d-flex {
        gap: 0.2rem;
        margin-left: 0.2rem;
    }

    .erp-topbar .header-icon,
    .erp-topbar .erp-theme-launcher {
        width: 40px;
        min-width: 40px;
        height: 40px;
    }

    .erp-topbar-profile .header-icon {
        margin-left: 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: more) {
    :root {
        --erp-color-border: #94a3b8;
        --erp-color-text-muted: #475569;
        --erp-shadow-focus: 0 0 0 4px rgba(7, 159, 218, 0.34);
    }

    .erp-sidebar .nav-menu > li > a,
    .erp-topbar .header-icon,
    .erp-topbar-action,
    .btn,
    .form-control,
    .form-select,
    .panel,
    .card {
        border-width: 2px;
    }

    :where(a, button, input, select, textarea, [tabindex]):focus-visible {
        outline-width: 3px !important;
    }
}

@media (forced-colors: active) {
    .erp-sidebar,
    .erp-topbar,
    .erp-topbar-action,
    .btn,
    .nav-tabs .nav-link.active,
    .nav-pills .nav-link.active {
        color: ButtonText;
        border-color: ButtonText;
        background: Canvas;
        box-shadow: none;
    }

    .erp-sidebar .nav-menu > li.active > a,
    .erp-sidebar .nav-menu > li.open > a,
    .nav-tabs .nav-link.active,
    .nav-pills .nav-link.active {
        color: HighlightText;
        background: Highlight;
    }

    :where(a, button, input, select, textarea, [tabindex]):focus-visible {
        outline: 3px solid Highlight !important;
    }
}

.erp-content {
    padding-top: 1.2rem;
}

.erp-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.erp-page-title {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--erp-color-text);
}

.erp-page-subtitle {
    margin: 0;
    color: var(--erp-color-text-muted);
    font-size: 0.93rem;
}

.erp-section {
    margin-bottom: 1rem;
}

.erp-card,
.panel.erp-card {
    border: 1px solid var(--erp-color-border);
    border-radius: var(--erp-radius-md);
    background: var(--erp-color-surface);
    box-shadow: var(--erp-shadow-sm);
    overflow: hidden;
}

.erp-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--erp-color-border);
}

.erp-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--erp-color-text);
}

.erp-card-body {
    padding: 1rem;
}

.erp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.75rem;
}

.erp-kpi-col {
    grid-column: span 12;
}

.erp-kpi-card {
    position: relative;
    border: 1px solid var(--erp-color-border);
    border-radius: var(--erp-radius-sm);
    background: var(--erp-color-surface);
    box-shadow: var(--erp-shadow-sm);
    padding: 0.9rem 1rem;
    min-height: 108px;
}

.erp-kpi-label {
    margin: 0 0 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--erp-color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.erp-kpi-value {
    margin: 0;
    font-size: 1.4rem;
    line-height: 1.15;
    font-weight: 800;
    color: var(--erp-color-text);
}

.erp-kpi-meta {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--erp-color-text-muted);
}

.erp-kpi-accent-primary {
    border-left: 4px solid var(--erp-color-primary);
}

.erp-kpi-accent-success {
    border-left: 4px solid var(--erp-color-success);
}

.erp-kpi-accent-danger {
    border-left: 4px solid var(--erp-color-danger);
}

.erp-kpi-accent-warning {
    border-left: 4px solid var(--erp-color-warning);
}

.erp-kpi-accent-info {
    border-left: 4px solid var(--erp-color-info);
}

.erp-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: flex-end;
    padding: 0.8rem;
    border: 1px solid var(--erp-color-border);
    border-radius: var(--erp-radius-sm);
    background: #fbfcfe;
}

.erp-filter-item {
    min-width: 170px;
    flex: 1 1 170px;
}

.erp-filter-item label {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--erp-color-text-muted);
    text-transform: uppercase;
}

.erp-input,
.erp-select {
    width: 100%;
    border: 1px solid var(--erp-color-border);
    border-radius: 10px;
    min-height: 40px;
    padding: 0.45rem 0.7rem;
    background: #fff;
    color: var(--erp-color-text);
}

.erp-input:focus,
.erp-select:focus {
    outline: none;
    border-color: #7aa2ff;
    box-shadow: 0 0 0 0.2rem rgba(29, 78, 216, 0.12);
}

.erp-btn {
    border-radius: 10px;
    font-weight: 600;
    border: 1px solid transparent;
    padding: 0.45rem 0.85rem;
}

.erp-btn-primary {
    background: var(--erp-color-primary);
    border-color: var(--erp-color-primary);
    color: #fff;
}

.erp-btn-primary:hover,
.erp-btn-primary:focus {
    background: #1843bc;
    border-color: #1843bc;
    color: #fff;
}

.erp-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.28rem 0.52rem;
}

.erp-badge-success {
    color: #166534;
    background: #dcfce7;
}

.erp-badge-warning {
    color: #92400e;
    background: #fef3c7;
}

.erp-badge-danger {
    color: #991b1b;
    background: #fee2e2;
}

.erp-badge-info {
    color: #075985;
    background: #e0f2fe;
}

.erp-table-wrap {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 transparent;
    border: 1px solid var(--erp-color-border);
    border-radius: var(--erp-radius-sm);
    background: #fff;
}

.erp-table-wrap table {
    margin-bottom: 0;
    min-width: 760px;
}

.erp-table-wrap thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 1;
}

/* Products & Services table polish */
.erp-products-panel {
    --erp-brand-blue: #3aa7d9;
    --erp-brand-blue-dark: #1f6f9e;
    --erp-brand-blue-ink: #184e74;
    --erp-brand-blue-soft: #e8f5fc;
    --erp-brand-black: #0d1420;
    border: 1px solid var(--erp-color-border);
    border-radius: 16px;
    overflow: hidden;
    background: var(--erp-color-surface);
    box-shadow: 0 10px 24px rgba(13, 20, 32, 0.11);
}

.erp-products-panel .panel-hdr {
    min-height: auto;
    border-bottom: 1px solid #24344d;
    padding: 0.95rem 1rem;
    background: linear-gradient(120deg, var(--erp-brand-black) 0%, var(--erp-brand-blue-dark) 60%, var(--erp-brand-blue) 100%);
}

.erp-products-panel .panel-hdr h2 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    color: #f5fbff;
    letter-spacing: 0.02em;
}

.erp-products-panel .panel-toolbar .btn {
    border-radius: 10px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.erp-products-panel .panel-toolbar .btn-primary {
    background: var(--erp-brand-blue);
    border-color: var(--erp-brand-blue);
    color: #062238;
}

.erp-products-panel .panel-toolbar .btn-primary:hover,
.erp-products-panel .panel-toolbar .btn-primary:focus {
    background: #2c9ad0;
    border-color: #2c9ad0;
}

.erp-products-panel .panel-toolbar .btn-success {
    background: #111c2c;
    border-color: #2a3a53;
    color: #e9f5ff;
}

.erp-products-panel .panel-toolbar .btn-success:hover,
.erp-products-panel .panel-toolbar .btn-success:focus {
    background: #1a2a43;
    border-color: #33445f;
}

.erp-products-content {
    padding: 1rem;
    background: linear-gradient(180deg, #f7fbff 0%, #f1f8ff 100%);
}

.erp-products-table-wrap {
    border: 1px solid #cfdfee;
    border-radius: 12px;
    background: #ffffff;
    overflow: auto;
}

.erp-products-table {
    min-width: 980px;
    margin-bottom: 0;
}

.erp-products-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 1px solid #c6daec;
    background: linear-gradient(180deg, #eff8fd 0%, #e3f3fb 100%);
    color: #25567a;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    padding: 0.78rem 0.8rem;
}

.erp-products-table tbody td {
    border-top: 1px solid #e3edf7;
    color: #15283e;
    vertical-align: middle;
    padding: 0.72rem 0.8rem;
}

.erp-products-table.table-striped tbody tr:nth-of-type(odd) td {
    background: #f9fcff;
}

.erp-products-table tbody tr:hover td {
    background: var(--erp-brand-blue-soft);
}

.erp-products-thumb {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
    object-position: center;
    border: 1px solid #cde0f1;
    background: #ffffff;
    box-shadow: 0 4px 11px rgba(17, 40, 66, 0.1);
}

.erp-products-table .erp-col-qty {
    text-align: right;
    white-space: nowrap;
}

.erp-products-table .erp-qty-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    border-radius: 999px;
    padding: 0.18rem 0.55rem;
    border: 1px solid #b7d8eb;
    background: #e3f2fb;
    color: var(--erp-brand-blue-ink);
    font-weight: 700;
    font-size: 0.78rem;
    line-height: 1.2;
}

.erp-products-table .erp-col-toggle,
.erp-products-table .erp-col-actions {
    white-space: nowrap;
}

.erp-products-table .erp-col-toggle {
    text-align: center;
}

.erp-products-table .erp-col-actions {
    text-align: right;
}

.erp-products-table .erp-row-actions {
    display: inline-flex;
    justify-content: flex-end;
    gap: 0.35rem;
    float: none !important;
}

.erp-products-table .erp-row-actions .btn {
    border-radius: 9px;
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbddef;
}

.erp-products-table .erp-row-actions .btn-primary {
    background: var(--erp-brand-blue);
    border-color: var(--erp-brand-blue);
    color: #062238;
}

.erp-products-table .erp-row-actions .btn-dark {
    background: #182538;
    border-color: #182538;
}

.erp-products-panel .dataTables_wrapper .dataTables_filter input,
.erp-products-panel .dataTables_wrapper .dataTables_length select {
    border: 1px solid #c4d9ea;
    border-radius: 10px;
    background: #fff;
    color: #15324f;
}

.erp-products-panel .dataTables_wrapper .dataTables_filter input:focus,
.erp-products-panel .dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--erp-brand-blue);
    box-shadow: 0 0 0 0.18rem rgba(58, 167, 217, 0.2);
}

.erp-products-panel .dataTables_wrapper .pagination .page-link {
    border-color: #c8dbed;
    color: #1d4f74;
}

.erp-products-panel .dataTables_wrapper .pagination .page-item.active .page-link {
    background: var(--erp-brand-blue-dark);
    border-color: var(--erp-brand-blue-dark);
    color: #fff;
}

.erp-products-panel .dataTables_wrapper .pagination .page-link:hover {
    background: #e6f4fc;
    color: #0f3857;
}

.erp-empty-state {
    text-align: center;
    border: 1px dashed var(--erp-color-border);
    border-radius: var(--erp-radius-sm);
    background: #fff;
    color: var(--erp-color-text-muted);
    padding: 1.2rem;
}

.erp-empty-title {
    margin: 0;
    font-weight: 700;
    color: var(--erp-color-text);
}

.erp-empty-subtitle {
    margin: 0.4rem 0 0;
    font-size: 0.9rem;
}

.erp-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

/* DataTables compatibility */
div.dataTables_wrapper div.dataTables_filter input,
div.dataTables_wrapper div.dataTables_length select {
    border: 1px solid var(--erp-color-border);
    border-radius: 10px;
}

/* Responsive breakpoints */
@media (min-width: 576px) {
    .erp-kpi-col {
        grid-column: span 6;
    }
}

@media (min-width: 992px) {
    body:not(.clx-navigation-type-top):not(.nav-function-minify) .page-sidebar {
        width: var(--erp-sidebar-width);
        max-width: var(--erp-sidebar-width);
    }

    .clx-fixed-header:not(.clx-navigation-type-top):not(.nav-function-minify) .page-header {
        margin-left: var(--erp-sidebar-width);
    }

    .clx-fixed-header:not(.clx-navigation-type-top):not(.clx-fixed-navigation):not(.nav-function-minify) .page-logo {
        width: var(--erp-sidebar-width);
    }

    .clx-fixed-navigation:not(.clx-navigation-type-top):not(.nav-function-hidden):not(.nav-function-minify) .page-content-wrapper {
        padding-left: var(--erp-sidebar-width);
    }

    .nav-function-hidden:not(.clx-navigation-type-top):not(.nav-function-minify) .page-sidebar {
        left: calc((var(--erp-sidebar-width) - 10px) * -1);
    }

    .nav-function-hidden:not(.clx-navigation-type-top):not(.nav-function-minify) .page-sidebar::after {
        left: var(--erp-sidebar-width);
    }

    .erp-kpi-col {
        grid-column: span 4;
    }

    .erp-kpi-col-xl {
        grid-column: span 2;
    }
}

@media (max-width: 991.98px) {
    .page-content {
        padding: 0.9rem;
    }

    .erp-topbar .page-logo-text {
        font-size: 0.9rem;
    }

    .erp-products-panel .panel-toolbar .btn-group {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        gap: 0.45rem;
    }

    .erp-products-panel .panel-toolbar .btn-group .btn {
        flex: 1 1 auto;
    }

    .erp-products-table {
        min-width: 760px;
    }

    .erp-products-table thead th,
    .erp-products-table tbody td {
        padding: 0.64rem 0.68rem;
    }
}
