/* ============================================================================
   BizSphere – Enterprise Design System
   Refined two-tier header, consistent spacing on an 8px grid, balanced
   colour palette with WCAG-AA contrast, and polished component tokens.
   ============================================================================ */

/* ---------------------------------------------------------------------------
   DESIGN TOKENS
   --------------------------------------------------------------------------- */
:root {
    --default-font-family: "Inter";
    --font-size-base: 14px;
    --font-size-lg: 15px;
    --line-height-base: 1.55;

    /* --- Colour – Topbar (dark tier) --- */
    --color-topbar-bg: #0f172a;
    --color-topbar-text: #f1f5f9;

    /* --- Colour – Menu bar (light tier) --- */
    --color-menu-bg: #ffffff;
    --color-menu-text: #334155;
    --color-menu-hover: #f1f5f9;
    --color-menu-active-bg: #eef2ff;
    --color-menu-active-border: #c7d2fe;

    /* --- Colour – Surfaces --- */
    --color-body-bg: #f1f5f9;
    --color-card-bg: #ffffff;
    --color-card-muted: #f8fafc;
    --color-table-stripe: #f8fafc;
    --color-table-header: #f1f5f9;

    /* --- Colour – Text hierarchy --- */
    --color-text-primary: #0f172a;
    --color-text-secondary: #475569;
    --color-text-muted: #94a3b8;

    /* --- Colour – Accent & semantic --- */
    --color-accent: #4f46e5;
    --color-accent-hover: #4338ca;
    --color-accent-light: #eef2ff;
    --color-danger: #dc2626;
    --color-danger-hover: #b91c1c;
    --color-success: #16a34a;
    --color-success-hover: #15803d;
    --color-warning: #d97706;
    --color-warning-hover: #b45309;
    --color-info: #0284c7;

    /* --- Standard button colors (global) --- */
    --btn-primary: #007bff;
    --btn-primary-hover: #0069d9;
    --btn-success: #28a745;
    --btn-success-hover: #218838;
    --btn-secondary: #6c757d;
    --btn-secondary-hover: #5a6268;

    /* --- Borders --- */
    --border-color: #e2e8f0;
    --border-strong: #cbd5e1;

    /* --- Shadows (subtle enterprise feel) --- */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.10);
    --shadow-header: 0 1px 3px rgba(15, 23, 42, 0.12), 0 1px 2px rgba(15, 23, 42, 0.06);

    /* --- Layout --- */
    --header-top-height: 48px;
    --header-bottom-height: 44px;
    --header-total-height: calc(var(--header-top-height) + var(--header-bottom-height));
    --container-max: 1400px;
    --content-padding: 24px;

    /* --- Radii --- */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 999px;

    /* --- Transitions --- */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

/* ---------------------------------------------------------------------------
   RESET & BASE
   --------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

@media (min-width: 1200px) {
    html { font-size: var(--font-size-lg); }
}

body {
    font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif),
                 "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    background: var(--color-body-bg);
    color: var(--color-text-primary);
    line-height: var(--line-height-base);
    margin: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

img {
    max-width: 100%;
    display: block;
}

/* ---------------------------------------------------------------------------
   TWO-TIER HEADER
   --------------------------------------------------------------------------- */
.bz-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    box-shadow: var(--shadow-header);
}

/* --- Top bar (dark) --- */
.bz-header-top {
    height: var(--header-top-height);
    background: var(--color-topbar-bg);
    color: var(--color-topbar-text);
}

/* --- Bottom bar (white nav) --- */
.bz-header-bottom {
    height: var(--header-bottom-height);
    background: var(--color-menu-bg);
    border-bottom: 1px solid var(--border-color);
}

/* --- Shared container mixin --- */
.bz-header-top__container,
.bz-header-bottom__container,
.bz-page-header-container,
.bz-content-container,
.bz-footer-container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--content-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bz-header-top__container {
    height: 100%;
    gap: 16px;
}

/* --- Brand --- */
.bz-brand-block {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bz-menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(248, 250, 252, 0.2);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-topbar-text);
    font-size: 18px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.bz-menu-toggle:hover {
    background: rgba(248, 250, 252, 0.1);
}

.bz-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-topbar-text) !important;
    font-weight: 600;
    font-size: 18px;
    letter-spacing: -0.3px;
}

.bz-brand-icon {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.bz-brand-badge {
    font-size: 9px;
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.18);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* --- Top-bar actions --- */
.bz-header-top__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bz-top-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(248, 250, 252, 0.15);
    background: transparent;
    color: var(--color-topbar-text);
    font-size: 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
    position: relative;
}

.bz-top-icon-btn:hover {
    background: rgba(248, 250, 252, 0.1);
}

.bz-top-icon-btn .bz-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
    border: 1.5px solid var(--color-topbar-bg);
}

.bz-top-icon-btn .bz-count-badge {
    position: absolute;
    top: -5px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    border: 1px solid var(--color-topbar-bg);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.bz-notification-menu {
    width: min(360px, calc(100vw - 24px));
    padding: 0;
    overflow: hidden;
}

.bz-notification-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fafc;
}

.bz-notification-menu__title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.bz-notification-menu__subtitle {
    margin-top: 2px;
    font-size: 12px;
    color: #64748b;
}

.bz-notification-menu__list {
    max-height: 420px;
    overflow-y: auto;
}

.bz-notification-menu__item {
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.bz-notification-menu__item:last-child {
    border-bottom: 0;
}

.bz-notification-menu__item.is-unread {
    background: rgba(59, 130, 246, 0.06);
}

.bz-notification-menu__item-link {
    flex: 1 1 auto;
    padding: 0;
    color: inherit;
    white-space: normal;
}

.bz-notification-menu__item-link:active,
.bz-notification-menu__item-link:focus,
.bz-notification-menu__item-link:hover {
    background: transparent;
    color: inherit;
}

.bz-notification-menu__item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.bz-notification-menu__item-title {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.bz-notification-menu__item-marker {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #2563eb;
}

.bz-notification-menu__item-task {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}

.bz-notification-menu__item-meta {
    margin-top: 6px;
}

.bz-notification-menu__priority {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.bz-notification-menu__item-message {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.45;
    color: #475569;
}

.bz-notification-menu__item-time {
    margin-top: 6px;
    font-size: 11px;
    color: #94a3b8;
}

.bz-notification-menu__item-actions {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    flex: 0 0 auto;
}

.bz-notification-menu__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 8px;
    background: #fff;
    color: #475569;
    text-decoration: none;
}

.bz-notification-menu__action:hover {
    background: #f8fafc;
    color: #0f172a;
}

.bz-notification-menu__action.is-disabled {
    opacity: 0.6;
    cursor: default;
}

.bz-notification-menu__empty {
    padding: 18px 14px;
    font-size: 13px;
    color: #64748b;
    text-align: center;
}

.bz-notification-menu__footer {
    padding: 10px 14px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fafc;
}

.bz-notification-menu__view-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #2563eb;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.bz-notification-menu__view-all:hover {
    color: #1d4ed8;
}

.bz-notification-grid-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bz-notification-grid-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bz-notification-grid-title {
    font-weight: 700;
    color: #0f172a;
}

.bz-notification-grid-task {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}

.bz-notification-grid-priority {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    width: fit-content;
    padding: 2px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.bz-notification-grid-message {
    font-size: 12px;
    line-height: 1.45;
    color: #475569;
}

/* --- User chip --- */
.bz-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 10px 3px 3px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(248, 250, 252, 0.2);
    background: rgba(248, 250, 252, 0.06);
    color: var(--color-topbar-text);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.bz-user-chip:hover {
    background: rgba(248, 250, 252, 0.12);
}

.bz-user-chip img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid rgba(248, 250, 252, 0.25);
}

.bz-user-chip span {
    font-size: 13px;
    font-weight: 500;
}

.bz-user-chip .bi-chevron-down {
    font-size: 11px;
    opacity: 0.6;
}

/* User dropdown menu */
.bz-header-top__actions .dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 4px;
    min-width: 180px;
}

.bz-header-top__actions .dropdown-item {
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 13px;
    color: var(--color-text-primary) !important;
}

.bz-header-top__actions .dropdown-item:hover {
    background: var(--color-menu-hover);
    color: var(--color-accent) !important;
}

/* ---------------------------------------------------------------------------
   NAVIGATION (DevExtreme Menu overrides)
   --------------------------------------------------------------------------- */
.bz-header-bottom__container {
    height: 100%;
    justify-content: flex-start;
}

.bz-nav-desktop {
    width: 100%;
}

#topNavigationMenu {
    width: 100%;
    border: none !important;
    background: transparent !important;
}

#topNavigationMenu .dx-menu {
    border: none !important;
    background: transparent !important;
}

#topNavigationMenu .dx-menu-horizontal .dx-menu-items-container {
    gap: 2px !important;
    align-items: center !important;
}

#topNavigationMenu .dx-menu-item {
    border-radius: var(--radius-sm) !important;
    padding: 8px 14px !important;
    margin: 0 !important;
    transition: all var(--transition-fast) !important;
    border: 1px solid transparent !important;
}

#topNavigationMenu .dx-menu-item-text {
    color: var(--color-menu-text) !important;
    font-weight: 500 !important;
    font-size: 13px !important;
}

#topNavigationMenu .dx-menu-item:hover {
    background: var(--color-menu-hover) !important;
    border-color: transparent !important;
}

#topNavigationMenu .dx-menu-item.dx-state-selected,
#topNavigationMenu .dx-menu-item.dx-state-focused {
    background: var(--color-menu-active-bg) !important;
    border-color: var(--color-menu-active-border) !important;
}

#topNavigationMenu .dx-menu-item.dx-state-selected .dx-menu-item-text {
    color: var(--color-accent) !important;
    font-weight: 600 !important;
}

.dx-menu-item-link,
.dx-menu-item-link:hover,
.dx-menu-item-link:focus,
.dx-menu-item-link:visited,
.dx-menu-item-link:active {
    color: inherit !important;
    text-decoration: none !important;
    display: flex;
    align-items: center;
}

#topNavigationMenu .dx-menu-item i {
    color: var(--color-text-muted) !important;
    margin-right: 5px !important;
    font-size: 14px !important;
}

#topNavigationMenu .dx-menu-item:hover i,
#topNavigationMenu .dx-menu-item.dx-state-selected i {
    color: var(--color-accent) !important;
}

/* Submenu arrow indicators */
.bz-submenu-arrow {
    font-size: 10px !important;
    margin-left: 6px !important;
    opacity: 0.55;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.dx-menu-item:hover .bz-submenu-arrow {
    opacity: 0.85;
}

.bz-submenu-arrow-right {
    margin-left: auto !important;
    padding-left: 12px;
}

/* Sub-menus */
#topNavigationMenu .dx-submenu {
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 4px !important;
    min-width: 220px !important;
    margin-top: 4px !important;
}

#topNavigationMenu .dx-submenu .dx-menu-item {
    border-radius: var(--radius-sm) !important;
    padding: 8px 12px !important;
    min-width: 100% !important;
}

#topNavigationMenu .dx-submenu .dx-menu-item:hover {
    background: var(--color-menu-hover) !important;
}

/* ---------------------------------------------------------------------------
   MOBILE NAVIGATION DRAWER
   --------------------------------------------------------------------------- */
.bz-mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    z-index: 1190;
    backdrop-filter: blur(2px);
}

.bz-mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.bz-mobile-drawer {
    position: fixed;
    top: 0;
    right: -340px;
    width: 300px;
    height: 100%;
    background: #ffffff;
    box-shadow: -4px 0 24px rgba(15, 23, 42, 0.12);
    z-index: 1201;
    transition: right var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.bz-mobile-drawer.active {
    right: 0;
}

.bz-mobile-drawer__header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bz-mobile-drawer__header h6 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.bz-mobile-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.bz-mobile-close:hover {
    background: var(--color-menu-hover);
}

.bz-mobile-drawer__body {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
}

#mobileNavigationMenu {
    width: 100%;
    border: none !important;
}

#mobileNavigationMenu .dx-menu {
    border: none !important;
}

#mobileNavigationMenu .dx-menu-item {
    border-radius: var(--radius-sm) !important;
    padding: 10px 14px !important;
    border: 1px solid transparent !important;
}

#mobileNavigationMenu .dx-menu-item:hover,
#mobileNavigationMenu .dx-menu-item.dx-state-selected {
    background: var(--color-menu-hover) !important;
}

@media (max-width: 991px) {
    .bz-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .bz-header-bottom {
        display: none;
    }

    .bz-user-chip span {
        display: none;
    }

    .bz-page-header {
        margin-top: var(--header-top-height);
    }
}

/* ---------------------------------------------------------------------------
   PAGE HEADER / BREADCRUMBS
   --------------------------------------------------------------------------- */
.bz-page-header {
    background: transparent;
    margin-top: var(--header-total-height);
    padding: 16px 0 8px;
}

.bz-breadcrumb {
    display: flex;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 4px;
    font-size: 13px;
    color: var(--color-text-secondary);
}

.bz-breadcrumb li {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bz-breadcrumb .separator {
    color: var(--color-text-muted);
    font-size: 11px;
}

.bz-breadcrumb a {
    color: var(--color-text-secondary) !important;
    font-weight: 500;
}

.bz-breadcrumb a:hover {
    color: var(--color-accent) !important;
}

.bz-breadcrumb-current {
    font-weight: 600;
    color: var(--color-text-primary);
}

.bz-help-link {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted) !important;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.bz-help-link:hover {
    background: var(--color-card-bg);
    color: var(--color-accent) !important;
    border-color: var(--border-strong);
}

/* ---------------------------------------------------------------------------
   MAIN CONTENT LAYOUT
   --------------------------------------------------------------------------- */
.bz-main-wrapper {
    min-height: calc(100vh - var(--header-total-height));
    display: flex;
    flex-direction: column;
}

.bz-content-container {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 8px var(--content-padding) 32px;
}

main {
    flex: 1;
    width: 100%;
}

/* Normalize top-level page wrappers so cards align consistently across modules */
.bz-content-container main > .container-fluid,
.bz-content-container main > .container {
    padding-left: 0;
    padding-right: 0;
}

/* ---------------------------------------------------------------------------
   CONTENT CARDS
   --------------------------------------------------------------------------- */
.content-card,
.bz-card,
.form-container {
    background: var(--color-card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}

.bz-card-header,
.form-header {
    padding: 14px 20px;
    background: var(--color-card-muted);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.bz-card-title,
.form-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.bz-card-subtitle {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 2px;
    font-weight: 400;
}

.bz-card-body,
.form-container .dx-form,
.content-card > * {
    padding: 20px;
}

.form-actions {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--color-card-muted);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ---------------------------------------------------------------------------
   BOOTSTRAP CARD OVERRIDES (used by area views)
   --------------------------------------------------------------------------- */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-header {
    background: var(--color-card-muted);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* Standardize top gap above main controls/grids across all cards */
.card > .card-body,
.bz-card > .card-body {
    padding-top: 10px;
}

/* ---------------------------------------------------------------------------
   TABLES & DATAGRID
   --------------------------------------------------------------------------- */
table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-size: 11px;
    font-weight: 600;
    padding: 10px 14px;
    background: var(--color-table-header);
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--border-strong);
}

tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

tbody tr:nth-child(even) {
    background: var(--color-table-stripe);
}

tbody tr:hover {
    background: var(--color-accent-light);
}

/* DevExtreme DataGrid – uniform compact rows (all row types: 32px) */
.dx-datagrid .dx-row > td,
.dx-datagrid .dx-row > th {
    padding: 4px 10px !important;
    line-height: 1.35 !important;
    vertical-align: middle !important;
    height: 32px !important;
}

.dx-datagrid-filter-row .dx-texteditor {
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
}

.dx-datagrid-filter-row .dx-texteditor-input {
    height: 24px !important;
    min-height: 24px !important;
    padding: 2px 8px !important;
    line-height: 1.35 !important;
}

.dx-datagrid-filter-row .dx-editor-cell .dx-editor-with-menu,
.dx-datagrid-filter-row .dx-editor-cell .dx-texteditor-container {
    height: 24px !important;
}

.dx-datagrid-filter-row .dx-filter-menu {
    top: 0 !important;
    bottom: 0 !important;
    height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dx-datagrid-filter-row .dx-filter-menu .dx-menu-items-container {
    height: 32px !important;
}

.dx-datagrid-filter-row .dx-filter-menu .dx-menu-item {
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    padding: 0 4px !important;
    margin: 4px 0 !important;
    border-radius: 4px !important;
}

.dx-datagrid-filter-row .dx-filter-menu .dx-menu-item.dx-state-hover,
.dx-datagrid-filter-row .dx-filter-menu .dx-menu-item:hover {
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    padding: 0 4px !important;
    margin: 4px 0 !important;
}

.dx-datagrid-filter-row .dx-filter-menu .dx-menu-item-content {
    height: 24px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.dx-datagrid-filter-row .dx-filter-menu .dx-menu-item-content .dx-icon {
    margin: 0 !important;
    line-height: 24px !important;
    position: relative !important;
    top: -5px !important;
}

/* ---------------------------------------------------------------------------
   BUTTONS
   Base: structure only. Variants: color only.
   --------------------------------------------------------------------------- */

/* Master – structure (font, height, border, etc.) */
.btn {
    font-weight: 500;
    font-size: .85rem;
    height: 38px;
    min-width: 80px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all var(--transition-fast);
    cursor: pointer;
    line-height: 1.5;
    text-decoration: none;
}

.btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Page/Form variants – color only */
.btn-saveupdate {
    background: var(--btn-success);
    color: #fff;
    border-color: var(--btn-success);
}
.btn-saveupdate:hover,
.btn-saveupdate:active {
    background: var(--btn-success-hover);
    border-color: var(--btn-success-hover);
    color: #fff;
}

.btn-new {
    background: var(--btn-primary);
    color: #fff;
    border-color: var(--btn-primary);
}
.btn-new:hover,
.btn-new:active {
    background: var(--btn-primary-hover);
    border-color: var(--btn-primary-hover);
    color: #fff;
}

.btn-cancel {
    background: var(--btn-secondary);
    color: #fff;
    border-color: var(--btn-secondary);
}
.btn-cancel:hover,
.btn-cancel:active {
    background: var(--btn-secondary-hover);
    border-color: var(--btn-secondary-hover);
    color: #fff;
}

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

.btn-secondary {
    background: var(--btn-secondary);
    color: #fff;
    border-color: var(--btn-secondary);
}
.btn-secondary:hover,
.btn-secondary:active {
    background: var(--btn-secondary-hover);
    border-color: var(--btn-secondary-hover);
    color: #fff;
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
    border-color: var(--color-danger);
}
.btn-danger:hover,
.btn-danger:active {
    background: var(--color-danger-hover);
    border-color: var(--color-danger-hover);
    color: #fff;
}

/* Size modifiers */
.btn-sm {
    height: 32px;
    min-width: auto;
    font-size: 12px;
    padding: 0 10px;
}

.btn-lg {
    height: 44px;
    min-width: 100px;
    font-size: 1rem;
    padding: 0 22px;
}

/* ---------------------------------------------------------------------------
   GRID BUTTONS (compact icon buttons in DataGrid cells)
   Master: structure. Variants: color only.
   --------------------------------------------------------------------------- */
.btn-grid {
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.btn-grid-view {
    background: transparent;
    color: var(--color-info);
    border-color: var(--color-info);
}
.btn-grid-view:hover {
    background: rgba(2, 132, 199, 0.1);
}

.btn-grid-edit {
    background: transparent;
    color: var(--btn-primary);
    border-color: var(--btn-primary);
}
.btn-grid-edit:hover {
    background: rgba(0, 123, 255, 0.1);
}

.btn-grid-print {
    background: transparent;
    color: #7c3aed;
    border-color: #7c3aed;
}
.btn-grid-print:hover {
    background: rgba(124, 58, 237, 0.1);
}

.btn-grid-delete {
    background: transparent;
    color: var(--color-danger);
    border-color: var(--color-danger);
}
.btn-grid-delete:hover {
    background: rgba(220, 38, 38, 0.1);
}

.btn-grid-active {
    background: transparent;
    color: var(--btn-primary);
    border-color: var(--btn-primary);
}
.btn-grid-active:hover {
    background: rgba(0, 123, 255, 0.1);
}

.btn-grid-inactive {
    background: transparent;
    color: var(--color-danger);
    border-color: var(--color-danger);
}
.btn-grid-inactive:hover {
    background: rgba(220, 38, 38, 0.1);
}

.icon-grid-active {
    color: var(--btn-primary);
}

.icon-grid-inactive {
    color: var(--color-danger);
}

/* Legacy outline support for grid (alias to btn-grid variants) */
.btn-outline-primary { background: transparent; color: var(--btn-primary) !important; border: 1px solid var(--btn-primary) !important; }
.btn-outline-primary:hover { background: rgba(0, 123, 255, 0.1) !important; }
.btn-outline-secondary { background: transparent; color: var(--btn-secondary) !important; border: 1px solid var(--btn-secondary) !important; }
.btn-outline-secondary:hover { background: rgba(108, 117, 125, 0.1) !important; }

/* Filter row: selected radio button group – light background, dark text for readability */
.filter-row .btn-check:checked + .btn-outline-secondary {
    background: var(--color-accent-light) !important;
    color: var(--color-accent) !important;
    border-color: var(--color-accent) !important;
}
.filter-row .btn-check:checked + .btn-outline-secondary:hover {
    background: var(--color-menu-active-bg) !important;
    color: var(--color-accent-hover) !important;
    border-color: var(--color-accent-hover) !important;
}

.btn-outline-info { background: transparent; color: var(--color-info) !important; border: 1px solid var(--color-info) !important; }
.btn-outline-info:hover { background: rgba(2, 132, 199, 0.1) !important; }
.btn-outline-danger { background: transparent; color: var(--color-danger) !important; border: 1px solid var(--color-danger) !important; }
.btn-outline-danger:hover { background: rgba(220, 38, 38, 0.1) !important; }

/* Legacy aliases (confirmation modal, test pages) */
.btn-success { background: var(--btn-primary); color: #fff; border-color: var(--btn-primary); }
.btn-success:hover { background: var(--btn-primary-hover); border-color: var(--btn-primary-hover); color: #fff; }
.btn-warning { background: var(--color-warning); color: #fff; border-color: var(--color-warning); }
.btn-warning:hover { background: var(--color-warning-hover); border-color: var(--color-warning-hover); color: #fff; }
.btn-info { background: var(--color-info); color: #fff; border-color: var(--color-info); }
.btn-info:hover { background: #0369a1; border-color: #0369a1; color: #fff; }

/* btn-light for hero sections (CRM, Sales) */
.btn-light {
    background: #fff !important;
    color: var(--color-text-primary) !important;
    border: 1px solid var(--border-color) !important;
}
.btn-light:hover {
    background: var(--color-card-muted) !important;
    border-color: var(--border-strong) !important;
}

/* DevExtreme button alignment */
.dx-button-mode-contained.dx-button-success .dx-button-content {
    background: var(--color-accent) !important;
    color: #fff !important;
    border-radius: var(--radius-sm) !important;
}

/* ---------------------------------------------------------------------------
   BADGES
   --------------------------------------------------------------------------- */
.badge {
    font-weight: 600;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    letter-spacing: 0.2px;
}

.bg-success {
    background-color: #dcfce7 !important;
    color: #166534 !important;
}

.bg-secondary {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
}

.bg-danger {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
}

.bg-warning {
    background-color: #fef3c7 !important;
    color: #92400e !important;
}

.bg-info {
    background-color: #e0f2fe !important;
    color: #075985 !important;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.15px;
}

.status-active {
    background: #ecfdf5;
    color: #065f46;
}

.status-active::before {
    content: '';
    width: 7px;
    height: 7px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-inactive {
    background: #fef2f2;
    color: #991b1b;
}

.status-inactive::before {
    content: '';
    width: 7px;
    height: 7px;
    background-color: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* ---------------------------------------------------------------------------
   FORMS (DevExtreme + Bootstrap)
   --------------------------------------------------------------------------- */
.form-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

.form-control {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    padding: 8px 12px;
    font-size: 14px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    padding: 8px 12px;
    font-size: 14px;
}

.form-select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* ---------------------------------------------------------------------------
   AUDIT SECTION
   --------------------------------------------------------------------------- */
.audit-section {
    background: var(--color-card-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 20px;
}

.audit-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--color-text-muted);
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.audit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.audit-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.audit-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--color-text-muted);
}

.audit-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-primary);
}

/* --- Audit chips (shared view/edit) --- */
.audit-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-top: 16px;
}

.audit-footer-compact {
    gap: 8px;
}

.audit-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

.audit-chip-stacked {
    align-items: flex-start;
    padding: 4px 0;
}

.audit-chip i {
    font-size: 11px;
}

.audit-chip-created i { color: var(--color-success); }
.audit-chip-updated i { color: var(--color-info); }
.audit-chip-deleted i { color: var(--color-danger); }

.audit-chip-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.audit-chip-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--color-text-muted);
    font-weight: 600;
}

.audit-chip-meta {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.audit-chip-date {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.audit-chip strong {
    color: var(--color-text-primary);
    font-weight: 700;
}

.audit-chip-divider {
    width: 1px;
    height: 16px;
    background: var(--border-strong);
    align-self: center;
}

/* ---------------------------------------------------------------------------
   DETAIL VIEW (Read-only modal)
   --------------------------------------------------------------------------- */
.detail-view {
    padding: 8px 4px;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    border: none;
}

.detail-section-title::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: var(--border-color);
    border-radius: 2px;
}

.detail-section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: var(--accent-width, 160px);
    height: 3px;
    background: var(--color-accent);
    border-radius: 3px;
}

.detail-section-title i {
    font-size: 13px;
}

.detail-grid-horizontal {
    display: grid;
    grid-template-columns: 1fr;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    overflow: hidden;
}

.detail-grid-two-col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    overflow: hidden;
}

.detail-grid-box {
    display: grid;
    gap: 0;
    border-radius: var(--radius-md);
}

.detail-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.detail-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.detail-col-full { grid-column: 1 / -1; }
.detail-col-2 { grid-column: span 2; }
.detail-col-3 { grid-column: span 3; }

.detail-item {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    border-top: 1px solid var(--border-color);
    min-height: 42px;
}

.detail-label {
    flex-shrink: 0;
    width: 120px;
    font-size: 11.5px;
    font-weight: 800;
    color: #475569;
    background-color: #f8fafc;
    padding: 10px 14px;
    border-right: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.3;
    display: flex;
    align-items: center;
}

.detail-grid-horizontal .detail-label {
    width: 120px;
}

.detail-value {
    flex-grow: 1;
    font-size: 13.5px;
    font-weight: 400;
    color: #1e293b;
    padding: 10px 14px;
    background-color: #fff;
    line-height: 1.4;
    letter-spacing: 0.1px;
    display: flex;
    align-items: center;
}

.detail-value-doc {
    flex-grow: 1;
    font-size: 13.5px;
    font-weight: 400;
    color: #1e293b;
    padding: 6px -1px;
    background-color: #fff;
    line-height: 1.4;
    letter-spacing: 0.1px;
    display: flex;
    align-items: center;
}

.detail-value-highlight {
    color: #0369a1;
    font-weight: 700;
    font-size: 14px;
}

.detail-value-empty {
    color: var(--color-text-muted);
    font-style: italic;
}

/* ---------------------------------------------------------------------------
   EDIT FORM OVERRIDES
   --------------------------------------------------------------------------- */
.state-edit-form {
    padding: 4px 0;
}

.state-edit-form-dx .dx-form-group-caption {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.1px;
}

.state-edit-form-dx .dx-field-item-label-text {
    font-weight: 600;
    color: #475569;
    font-size: 12.5px;
    letter-spacing: 0.1px;
}

.state-edit-form-dx .dx-texteditor-input {
    font-size: 13.5px;
    color: #1e293b;
}

.state-edit-form-dx .dx-field-item {
    padding: 6px 4px;
}

.state-edit-form-dx .dx-texteditor.dx-editor-outlined {
    border-radius: 8px;
}

.state-edit-form-dx .dx-selectbox .dx-texteditor-input {
    font-size: 13.5px;
}

/* ---------------------------------------------------------------------------
   GLOBAL REUSABLE COMPONENTS
   Metric strip, chips, filter area, grid cell helpers – used site-wide.
   --------------------------------------------------------------------------- */

/* --- Summary strip ------------------------------------------------------------ */
.metric-strip {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    margin-bottom: 14px;
    border-bottom: none;
}

.metric-item {
    position: relative;
    flex: 1 1 0;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 14px 20px 18px;
    border-right: 1px solid #eef0f4;
    white-space: nowrap;
    box-sizing: border-box;
}

.metric-item:last-child {
    border-right: 0;
}

.metric-item::after {
    content: "";
    position: absolute;
    left: 0;
    width: 50%;
    bottom: 0;
    height: 3px;
}

.metric-item::before {
    content: "";
    position: absolute;
    left: 50%;
    width: 50%;
    bottom: 0;
    height: 1px;
    background: #374151;
}

.metric-item.metric-total::after { background: #4268b8; }
.metric-item.metric-active::after { background: #4caf50; }
.metric-item.metric-inactive::after { background: #6b7280; }
.metric-item.metric-overdue::after { background: #e53935; }
.metric-item.metric-duesoon::after { background: #ffb300; }
.metric-item.metric-attachments::after { background: #4268b8; }

.metric-item:first-child::after { border-bottom-left-radius: 9px; }
.metric-item:last-child::before { border-bottom-right-radius: 9px; }

.metric-num {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
}

.metric-item.metric-total .metric-num { color: #4268b8; }
.metric-item.metric-active .metric-num { color: #4caf50; }
.metric-item.metric-inactive .metric-num { color: #6b7280; }
.metric-item.metric-overdue .metric-num { color: #e53935; }
.metric-item.metric-duesoon .metric-num { color: #ffb300; }
.metric-item.metric-attachments .metric-num { color: #4268b8; }

.metric-num-accent {
    font-size: .78rem;
    font-weight: 600;
}

.metric-item.metric-active .metric-num-accent { color: #4caf50; }

.metric-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.metric-dot-red { background: #e53935; }
.metric-dot-orange { background: #ffb300; }
.metric-dot-blue { background: #4268b8; }
.metric-dot-gray { background: #6b7280; }

.metric-label {
    font-size: 1.05rem;
    font-weight: 700;
    color: #374151;
    line-height: 1;
}

.metric-sub {
    font-size: .78rem;
    font-weight: 400;
    color: #94a3b8;
    margin-left: 4px;
    line-height: 1;
}

/* --- Filter area -------------------------------------------------------------- */
.top-filter-box {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.chip {
    border: 1px solid #dce1ea;
    background: #fff;
    color: #374151;
    border-radius: 8px;
    min-height: 34px;
    padding: 6px 14px;
    font-size: .85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.chip:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.chip.active {
    border-color: #bfd7ff;
    background: #edf4ff;
    color: #1d4ed8;
}

.chip-count {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    color: #fff;
}

.bg-c-blue { background: #3b82f6; }
.bg-c-green { background: #16a34a; }
.bg-c-red { background: #ef4444; }
.bg-c-amber { background: #f59e0b; color: #111827; }

/* --- Grid cell helpers -------------------------------------------------------- */
.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-dot-green { background: #16a34a; }
.status-dot-orange { background: #f59e0b; }
.status-dot-red { background: #ef4444; }

.priority-pill {
    border-radius: 999px;
    padding: 2px 9px;
    font-size: .72rem;
    font-weight: 600;
    color: #fff;
    display: inline-flex;
    align-items: center;
    line-height: 1.35;
}

.priority-high { background: #ef4444; }
.priority-medium { background: #f59e0b; }
.priority-low { background: #3b82f6; }

.avatar-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .66rem;
    font-weight: 600;
    color: #fff;
    margin-right: 6px;
}

.grid-cell-title {
    font-weight: 600;
    color: #1f2937;
}

/* --- Responsive --------------------------------------------------------------- */
@media (max-width: 1199px) {
    .metric-strip { flex-wrap: wrap; }
    .metric-item { flex: 1 1 auto; min-width: 140px; }
}

/* ---------------------------------------------------------------------------
   HRM – Employee directory (roster) info screen
   --------------------------------------------------------------------------- */
.employee-directory-page .employee-directory-title-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--color-accent) 0%, #6366f1 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.employee-directory-page .employee-directory-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.employee-directory-page .employee-directory-filters {
    background: var(--color-card-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-xs);
}

.employee-directory-page .employee-directory-filters-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.employee-directory-page .employee-directory-filters .form-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

.employee-directory-page .employee-directory-filters .form-control {
    border-color: var(--border-color);
}

.employee-directory-page .employee-directory-metrics {
    box-shadow: var(--shadow-xs);
}

.employee-directory-page .metric-item[data-metric="custom"] {
    flex-wrap: wrap;
    align-content: center;
}

.employee-directory-page .metric-item[data-metric="custom"] .metric-sub {
    flex-basis: 100%;
    margin-left: 0;
    margin-top: 2px;
}

.employee-grid-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid var(--border-color);
    vertical-align: middle;
}

.employee-grid-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-table-stripe);
    color: var(--color-text-muted);
    border: 1px dashed var(--border-strong);
    font-size: 0.9rem;
}

.employee-grid-name {
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.3;
}

.employee-grid-code {
    font-size: 0.78rem;
    line-height: 1.2;
}

.employee-grid-mailto {
    color: var(--color-accent);
    text-decoration: none;
    word-break: break-word;
}

.employee-grid-mailto:hover {
    text-decoration: underline;
}

.employee-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 0;
}

.employee-status-pill-active { color: var(--color-success); }
.employee-status-pill-inactive { color: var(--color-text-secondary); }

/* ---------------------------------------------------------------------------
   HRM – Employee quick peek: REMOVED – now uses shared qv-* panel
   (see quick-view-panel.css)
   --------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------
   ITEMS PAGE (InventoryManagement/Items/Index)
   --------------------------------------------------------------------------- */
/* --- Page header -------------------------------------------------------------- */
.items-page .items-page-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #1e3c72 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(30, 60, 114, 0.3);
    position: relative;
    overflow: hidden;
}

.items-page .items-page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.items-page .items-page-header h1 {
    color: #fff;
    font-weight: 700;
    font-size: 1.75rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.items-page .items-page-header .header-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.items-page .items-page-header .subtitle {
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
    margin-top: 0.5rem;
    margin-left: 60px;
}

.items-page .header-actions { position: relative; z-index: 1; }

/* --- Quick stats -------------------------------------------------------------- */
.items-page .quick-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.items-page .stat-card {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.items-page .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.items-page .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.items-page .stat-icon-items { background: linear-gradient(135deg, #e3f2fd, #bbdefb); color: #1976d2; }
.items-page .stat-icon-active { background: linear-gradient(135deg, #e8f5e9, #c8e6c9); color: #388e3c; }
.items-page .stat-icon-categories { background: linear-gradient(135deg, #f3e5f5, #e1bee7); color: #7b1fa2; }
.items-page .stat-icon-value { background: linear-gradient(135deg, #fff3e0, #ffe0b2); color: #f57c00; }

.items-page .stat-content h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    line-height: 1;
}

.items-page .stat-content p {
    font-size: 0.85rem;
    color: #78909c;
    margin: 0.25rem 0 0 0;
}

/* --- Grid container ----------------------------------------------------------- */
.items-page .items-grid-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.items-page .grid-toolbar {
    background: linear-gradient(to right, #f8f9fc, #fff);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.items-page .grid-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.items-page .grid-title i { color: #1e3c72; }

/* --- Grid action buttons ------------------------------------------------------ */
.items-page .action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin: 0 2px;
}

.items-page .action-btn-view {
    background: #e3f2fd;
    color: #1976d2;
}

.items-page .action-btn-view:hover {
    background: #1976d2;
    color: white;
    transform: scale(1.1);
}

.items-page .action-btn-edit {
    background: #fff3e0;
    color: #f57c00;
}

.items-page .action-btn-edit:hover {
    background: #f57c00;
    color: white;
    transform: scale(1.1);
}

.items-page .action-btn-delete {
    background: #ffebee;
    color: #d32f2f;
}

.items-page .action-btn-delete:hover {
    background: #d32f2f;
    color: white;
    transform: scale(1.1);
}

/* --- Grid cell presentation --------------------------------------------------- */
.items-page .status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.items-page .status-active {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #2e7d32;
}

.items-page .status-inactive {
    background: linear-gradient(135deg, #fafafa, #eeeeee);
    color: #757575;
}

.items-page .price-cell { font-weight: 600; color: #1e3c72; }

.items-page .gst-badge {
    background: #e8eaf6;
    color: #3f51b5;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.items-page .hsn-code {
    background: #f5f5f5;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #455a64;
}

.items-page .category-pill {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.items-page .main-category { background: #e3f2fd; color: #1565c0; }
.items-page .sub-category { background: #f3e5f5; color: #7b1fa2; }

/* --- DevExtreme grid overrides ------------------------------------------------- */
.items-page #itemsGrid .dx-datagrid-header-panel {
    padding: 0.75rem 1rem;
    background: #f8f9fc;
}

.items-page #itemsGrid .dx-datagrid-headers {
    background: linear-gradient(to bottom, #f8f9fc, #fff);
}

.items-page #itemsGrid .dx-header-row td {
    font-weight: 600;
    color: #37474f;
    padding: 1rem 0.75rem;
}

.items-page #itemsGrid .dx-data-row td {
    padding: 0.75rem;
    vertical-align: middle;
}

.items-page #itemsGrid .dx-data-row:hover td {
    background: #f8f9fc;
}

/* ---------------------------------------------------------------------------
   CUSTOMER EXPERIENCE PAGE (CRM/Customers/Index)
   --------------------------------------------------------------------------- */
.customer-experience .page-hero {
    background: linear-gradient(120deg, var(--bs-primary), #1f7acf 65%, #00b2ff);
    border-radius: 18px;
}

.customer-experience .hero-title {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.customer-experience .hero-subtitle { max-width: 560px; }

.customer-experience .metric-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 20px 22px;
    border-radius: 16px;
    background-color: var(--bs-white);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.customer-experience .metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 32px rgba(31, 122, 207, 0.12);
}

.customer-experience .metric-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 22px;
}

.customer-experience .metric-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bs-gray-600);
}

.customer-experience .metric-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--bs-gray-900);
}

.customer-experience .metric-value.smaller {
    font-size: 1.1rem;
    font-weight: 500;
}

.customer-experience .module-card,
.customer-experience .detail-card,
.customer-experience .timeline-card {
    border-radius: 18px;
    border: none;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.customer-experience .module-card .card-body { padding: 0 0 1.5rem; }

.customer-experience .badge-soft {
    border-radius: 999px;
    font-size: 0.75rem;
    padding: 0.45rem 0.9rem;
}

.badge-soft-primary { color: var(--bs-primary); background-color: rgba(38, 128, 235, 0.12); }
.badge-soft-success { color: #2f9e44; background-color: rgba(47, 158, 68, 0.12); }
.badge-soft-secondary { color: var(--bs-secondary); background-color: rgba(108, 117, 125, 0.14); }
.badge-soft-neutral { color: #495057; background-color: rgba(73, 80, 87, 0.12); }
.badge-soft-info { color: #0c8599; background-color: rgba(12, 133, 153, 0.15); }
.badge-soft-warning { color: #b45309; background-color: rgba(245, 158, 11, 0.15); }

.customer-experience .detail-section { margin-bottom: 1.5rem; }

.customer-experience .detail-section .section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bs-gray-600);
    margin-bottom: 0.5rem;
}

.customer-experience .detail-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
    color: var(--bs-gray-800);
}

.customer-experience .detail-row i {
    width: 18px;
    text-align: center;
    color: var(--bs-primary);
}

.customer-experience .timeline-card .timeline {
    position: relative;
    padding-left: 1rem;
}

.customer-experience .timeline-card .timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(13, 110, 253, 0.15);
}

.customer-experience .timeline-card .timeline-item {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 1.1rem;
}

.customer-experience .timeline-card .timeline-indicator {
    position: absolute;
    left: 0;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bs-primary);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.15);
}

.customer-experience .timeline-card .timeline-content { margin-left: 1rem; }

.customer-experience .empty-state .icon-circle {
    width: 56px;
    height: 56px;
}

.bg-gradient-primary { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.bg-gradient-success { background: linear-gradient(135deg, #2f9e44, #0ca678); }
.bg-gradient-warning { background: linear-gradient(135deg, #f59f00, #f08c00); }
.bg-gradient-info { background: linear-gradient(135deg, #1098ad, #7048e8); }

@media (max-width: 991.98px) {
    .customer-experience .hero-actions { width: 100%; }
}

@media (max-width: 575.98px) {
    .customer-experience .metric-card { padding: 18px; }
}

/* ---------------------------------------------------------------------------
   INVOICE EXPERIENCE PAGE (Sales/Invoices/Index)
   --------------------------------------------------------------------------- */
.invoice-experience .page-hero {
    background: linear-gradient(120deg, var(--bs-primary), #1f7acf 65%, #00b2ff);
    border-radius: 18px;
}

.invoice-experience .hero-title {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.invoice-experience .hero-subtitle { max-width: 520px; }

.invoice-experience .metric-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 20px 22px;
    border-radius: 16px;
    background-color: var(--bs-white);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.invoice-experience .metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 32px rgba(31, 122, 207, 0.12);
}

.invoice-experience .metric-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 22px;
}

.invoice-experience .metric-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bs-gray-600);
}

.invoice-experience .metric-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--bs-gray-900);
}

.invoice-experience .module-card,
.invoice-experience .detail-card,
.invoice-experience .timeline-card {
    border-radius: 18px;
    border: none;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.invoice-experience .badge-soft {
    border-radius: 999px;
    font-size: 0.75rem;
    padding: 0.45rem 0.9rem;
}

.detail-card .section-title {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--bs-gray-600);
    margin-bottom: 0.5rem;
}

.detail-card #invoiceLines {
    border: 1px solid rgba(15,23,42,0.08);
    border-radius: 12px;
    padding: 12px;
    max-height: 220px;
    overflow-y: auto;
}

.detail-card #invoiceLines table {
    width: 100%;
    font-size: 0.9rem;
}

.detail-card #invoiceLines th {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--bs-gray-500);
}

.detail-card .icon-circle,
.timeline-card .icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
}

.invoice-experience .timeline-card .timeline {
    position: relative;
    padding-left: 1.5rem;
}

.invoice-experience .timeline-card .timeline::before {
    content: "";
    position: absolute;
    top: 0.4rem;
    bottom: 0;
    left: 0.6rem;
    width: 2px;
    background: rgba(31, 122, 207, 0.2);
}

.invoice-experience .timeline-card .timeline-item {
    position: relative;
    padding-bottom: 1.4rem;
}

.invoice-experience .timeline-card .timeline-item:last-child { padding-bottom: 0; }

.invoice-experience .timeline-card .timeline-indicator {
    position: absolute;
    left: -0.05rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(38, 128, 235, 0.12);
}

.bg-gradient-danger { background: linear-gradient(135deg, #f03e3e, #c92a2a); }

@media (max-width: 767.98px) {
    .invoice-experience .metric-card { padding: 18px; }
}

/* ---------------------------------------------------------------------------
   FOOTER
   --------------------------------------------------------------------------- */
.bz-footer {
    background: var(--color-card-bg);
    border-top: 1px solid var(--border-color);
    padding: 14px 0;
    margin-top: auto;
}

.bz-footer-container {
    color: var(--color-text-muted);
    font-size: 12px;
}

/* ---------------------------------------------------------------------------
   UTILITIES
   --------------------------------------------------------------------------- */
.text-muted {
    color: var(--color-text-muted) !important;
}

.shadow-card {
    box-shadow: var(--shadow-md) !important;
}

.rounded-card {
    border-radius: var(--radius-lg) !important;
}

/* ---------------------------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------------------------- */
@media (max-width: 767px) {
    :root {
        --content-padding: 16px;
    }

    .bz-card-header,
    .form-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .detail-grid-two-col {
        grid-template-columns: 1fr;
    }

    .detail-grid-two-col .detail-item:nth-child(odd) {
        border-right: none;
    }
}

/* ---------------------------------------------------------------------------
   CUSTOM SCROLLBARS
   --------------------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}
