/* ==========================================================================
   RM VENTURES MULTI-TENANT ENTERPRISE HRMS & PAYROLL CLOUD DESIGN SYSTEM
   Modern, Executive-Grade SaaS Styling (Tailwind / Radix / Linear Inspired)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* ==========================================================================
       Dovetail-Inspired Visual Tokens (Warm Editorial & Midnight Violet)
       ========================================================================== */
    --dovetail-canvas: #FFFDF9;
    --dovetail-warm: #FAF6F0;
    --dovetail-card: #FFFFFF;
    --dovetail-deep: #1A0A44;
    --dovetail-deep-hover: #26095E;
    --dovetail-deep-dark: #120630;
    --dovetail-text-primary: #1A0A44;
    --dovetail-text-secondary: #4A3E72;
    --dovetail-text-tertiary: #7C709E;
    --dovetail-text-inverse: #FFFFFF;
    --dovetail-text-inverse-sec: #D8CEFA;
    --dovetail-text-inverse-muted: #A898E0;
    --dovetail-accent-coral: #FF5C35;
    --dovetail-badge-amber-bg: #FEF3C7;
    --dovetail-badge-amber-text: #92400E;
    --dovetail-badge-amber-border: #FDE68A;
    --dovetail-border-subtle: rgba(26, 10, 68, 0.08);
    --dovetail-border-medium: rgba(26, 10, 68, 0.16);
    --dovetail-border-inverse: rgba(255, 255, 255, 0.12);
    --dovetail-radius-pill: 9999px;
    --dovetail-radius-card: 16px;
    --dovetail-shadow-card: 0 8px 30px rgba(26, 10, 68, 0.05), 0 1px 3px rgba(26, 10, 68, 0.03);
    --dovetail-shadow-hover: 0 16px 40px rgba(26, 10, 68, 0.10), 0 2px 6px rgba(26, 10, 68, 0.04);

    /* Color Tokens - Royal Purplish-Indigo Precision (60-30-10 Design System) */
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: #EEF2FF;
    --primary-border: #C7D2FE;
    
    --indigo: #6366F1;
    --indigo-hover: #4F46E5;
    
    /* Background Canvas (60%) */
    --bg-app: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #ffffff;
    --bg-subtle: #f1f5f9;
    
    /* Pure Crisp Light Sidebar & Shell (30%) */
    --sidebar-bg: #ffffff;
    --sidebar-header: #ffffff;
    --sidebar-surface: #ffffff;
    --sidebar-hover: #f8fafc;
    --sidebar-border: #e2e8f0;
    --sidebar-text: #475569;
    --sidebar-text-active: #4F46E5;
    
    /* Typography */
    --text-main: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
    
    /* Borders & Hairlines */
    --border-light: #e2e8f0;
    --border-subtle: #f1f5f9;
    --border-hover: #cbd5e1;
    
    /* Accents */
    --emerald-bg: #ecfdf5;
    --emerald-text: #065f46;
    --emerald-border: #a7f3d0;
    --emerald: #10b981;
    
    --amber-bg: #fffbeb;
    --amber-text: #92400e;
    --amber-border: #fde68a;
    --amber: #f59e0b;
    
    --rose-bg: #fff1f2;
    --rose-text: #9f1239;
    --rose-border: #fecdd3;
    --rose: #f43f5e;
    
    --cyan-bg: #ecfeff;
    --cyan-text: #155e75;
    --cyan-border: #a5f3fc;
    --cyan: #06b6d4;

    --purple-bg: #f5f3ff;
    --purple-text: #5b21b6;
    --purple-border: #ddd6fe;
    --purple: #8b5cf6;
    
    /* Geometry */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 68px;
    --navbar-height: 64px;
    
    /* Elevation Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(16, 24, 40, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.1), 0 4px 8px -2px rgba(15, 23, 42, 0.05);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.25);
}

/* ==========================================================================
   Base & Resets
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

code, kbd, samp, pre, .font-monospace {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}

/* ==========================================================================
   App Shell & Architecture
   ========================================================================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    overflow-x: hidden;
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */
.app-sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid var(--sidebar-border);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 1px 0 10px rgba(15, 23, 42, 0.04);
    overflow: visible;
}

/* Floating Middle Edge Chevron Pin Toggle */
.sidebar-edge-toggle {
    position: absolute;
    top: 50%;
    right: -13px;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1050;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    font-size: 0.75rem;
}

.sidebar-edge-toggle:hover {
    background: #4F46E5;
    color: #ffffff;
    border-color: #4F46E5;
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

/* Collapsed Mini-Sidebar Mode */
body.sidebar-collapsed .app-sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar-header {
    padding: 0 0.5rem;
    justify-content: center !important;
}

body.sidebar-collapsed .sidebar-header .brand-logo {
    justify-content: center !important;
    gap: 0 !important;
    margin: 0 auto !important;
}

body.sidebar-collapsed .brand-meta,
body.sidebar-collapsed .nav-section-title,
body.sidebar-collapsed .sidebar-nav .nav-link span,
body.sidebar-collapsed .user-meta-details,
body.sidebar-collapsed .sidebar-header #sidebarCloseBtn {
    display: none !important;
}

body.sidebar-collapsed .brand-icon-wrapper {
    margin: 0 auto !important;
}

body.sidebar-collapsed .sidebar-nav {
    padding: 1rem 0.35rem;
}

body.sidebar-collapsed .sidebar-nav .nav-link {
    justify-content: center;
    padding: 0.7rem 0;
    border-radius: var(--radius-sm);
    gap: 0;
    position: relative;
}

/* Sleek Floating Flyout Tooltip on Hover when Sidebar is Collapsed */
body.sidebar-collapsed .sidebar-nav .nav-link[title]::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) scale(0.94);
    background: #0f172a;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2), 0 2px 6px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
    z-index: 1080;
}

body.sidebar-collapsed .sidebar-nav .nav-link[title]::before {
    content: '';
    position: absolute;
    left: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
    border-width: 5px 8px 5px 0;
    border-style: solid;
    border-color: transparent #0f172a transparent transparent;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.16s ease, visibility 0.16s;
    z-index: 1080;
}

body.sidebar-collapsed .sidebar-nav .nav-link[title]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
}

body.sidebar-collapsed .sidebar-nav .nav-link[title]:hover::before {
    opacity: 1;
    visibility: visible;
}

body.sidebar-collapsed .brand-logo[title] {
    position: relative;
}

body.sidebar-collapsed .brand-logo[title]::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) scale(0.94);
    background: #1A0A44;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.18);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
    z-index: 1080;
}

body.sidebar-collapsed .brand-logo[title]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
}

body.sidebar-collapsed .sidebar-nav .nav-link i {
    font-size: 1.25rem;
    margin: 0;
}

body.sidebar-collapsed .sidebar-footer {
    padding: 0.75rem 0.35rem;
}

body.sidebar-collapsed .sidebar-user-card {
    justify-content: center;
    padding: 0.25rem 0;
}

/* ==========================================================================
   Sidebar Transitions (Clean desktop collapse & smooth mobile drawer)
   ========================================================================== */
@media (min-width: 992px) {
    .app-sidebar {
        transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

@keyframes peekFadeIn {
    from {
        opacity: 0;
        transform: translateX(-4px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Sidebar Header Brand */
.sidebar-header {
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    background: var(--sidebar-header);
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-header .brand-logo {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: var(--text-main);
}

.brand-icon-wrapper {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.15rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28);
    flex-shrink: 0;
}

.brand-meta {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
    line-height: 1.2;
}

.brand-subtitle-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.brand-subtitle-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background-color: #2563eb;
    border-radius: var(--radius-full);
}

/* Navigation Links Container */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.15rem 0.85rem;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: var(--radius-full);
}

.nav-section-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #94a3b8;
    padding: 0.85rem 0.75rem 0.35rem 0.75rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.58rem 0.95rem;
    color: var(--sidebar-text);
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    transition: all 0.15s ease;
    text-decoration: none;
    border: 1px solid transparent;
}

.sidebar-nav .nav-link i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
    color: #64748b;
    transition: color 0.15s ease, transform 0.15s ease;
}

.sidebar-nav .nav-link:hover {
    background-color: var(--sidebar-hover);
    color: var(--text-main);
    border-color: #f1f5f9;
}

.sidebar-nav .nav-link:hover i {
    color: var(--primary);
    transform: translateX(2px);
}

.sidebar-nav .nav-link.active {
    background: #eef2ff;
    color: var(--primary);
    font-weight: 600;
    border: 1px solid #e0e7ff;
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.12);
}

.sidebar-nav .nav-link.active i {
    color: var(--primary);
}

/* Sidebar Footer User Info */
.sidebar-footer {
    padding: 1rem 1.15rem;
    background: var(--sidebar-header);
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.user-avatar-pill {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #eef2ff;
    color: var(--primary);
    border: 1px solid #dbeafe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.user-meta-details {
    overflow: hidden;
    line-height: 1.25;
}

.user-name-text {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-badge {
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ==========================================================================
   Main Workspace Area & Navbar
   ========================================================================== */
.app-main {
    flex: 1 1 auto;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-app);
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
}

body.sidebar-collapsed .app-main {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
    max-width: calc(100% - var(--sidebar-collapsed-width));
}

.app-navbar {
    height: var(--navbar-height);
    background: rgba(255, 253, 249, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--dovetail-border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 1px 4px rgba(26, 10, 68, 0.03);
    width: 100%;
    box-sizing: border-box;
}

/* Universal Search Header Widget */
.navbar-search-box {
    position: relative;
    max-width: 420px;
    width: 100%;
}

.navbar-search-box input {
    background: #FAF6F0;
    border: 1px solid rgba(26, 10, 68, 0.12);
    border-radius: var(--radius-full);
    padding: 0.45rem 2.5rem 0.45rem 2.4rem;
    font-size: 0.84rem;
    color: var(--dovetail-text-primary);
    width: 100%;
    transition: all 0.15s ease;
}

.navbar-search-box input:focus {
    background: #ffffff;
    border-color: var(--dovetail-deep);
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 10, 68, 0.08);
}

.navbar-search-box .search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.navbar-search-box .search-kbd {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: #e2e8f0;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 0.1rem 0.4rem;
    pointer-events: none;
}

/* Universal Search Live Dropdown */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: 380px;
    max-height: 420px;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 12px;
    z-index: 1060;
    padding: 0.5rem;
    box-shadow: 0 14px 34px rgba(26, 10, 68, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(26, 10, 68, 0.1);
}
.search-results-dropdown::-webkit-scrollbar {
    width: 5px;
}
.search-results-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.search-category-header {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #7C709E;
    padding: 0.45rem 0.65rem 0.2rem;
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    text-decoration: none;
    color: #1A0A44;
    transition: background 0.15s ease;
    cursor: pointer;
}
.search-result-item:hover, .search-result-item.active {
    background: #FAF6F0;
    color: #1A0A44;
}
.search-result-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #EEF2FF;
    color: #4F46E5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.search-result-title {
    font-size: 0.86rem;
    font-weight: 600;
    color: #1A0A44;
    line-height: 1.25;
}
.search-result-subtitle {
    font-size: 0.75rem;
    color: #7C709E;
    line-height: 1.2;
    margin-top: 2px;
}

/* Mobile Category Sub-Navigation Touch Scroll */
@media (max-width: 991.98px) {
    .category-nav-pills {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        padding-bottom: 4px !important;
        max-width: 100% !important;
    }
    .category-nav-pills::-webkit-scrollbar {
        display: none !important;
    }
    .category-nav-pills .nav-item {
        flex: 0 0 auto !important;
    }
}

/* Tenant Context Badge */
.tenant-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
}

.tenant-pill .tenant-dot {
    width: 7px;
    height: 7px;
    background-color: var(--emerald);
    border-radius: var(--radius-full);
    box-shadow: 0 0 6px var(--emerald);
}

/* Main Content Body */
.app-content {
    padding: 1.5rem 1.75rem;
    flex: 1 0 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* ==========================================================================
   Executive Cards & Widgets
   ========================================================================== */
.card-stat {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    padding: 1.45rem;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.card-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background 0.2s ease;
}

.card-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.card-stat:hover::before {
    background: linear-gradient(90deg, var(--primary), var(--indigo));
}

.card-stat .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.card-stat .stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-main);
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.card-stat .stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Standard Content Card */
.card-custom {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.75rem;
    transition: box-shadow 0.2s ease;
}

.card-custom .card-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    padding: 1.15rem 1.5rem;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.card-custom .card-body {
    padding: 1.5rem;
}

/* ==========================================================================
   Modern Tables
   ========================================================================== */
.table-custom {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table-custom th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-light);
    border-top: none;
    padding: 0.95rem 1.15rem;
    white-space: nowrap;
}

.table-custom td {
    padding: 1.05rem 1.15rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
    color: var(--text-main);
}

.table-custom tbody tr {
    transition: background-color 0.15s ease;
}

.table-custom tbody tr:hover {
    background-color: #f8fafc;
}

.table-custom tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   Pills & Status Badges
   ========================================================================== */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32em 0.75em;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
}

.badge-active, .badge-present, .badge-approved, .badge-paid, .badge-resolved {
    background-color: var(--emerald-bg);
    color: var(--emerald-text);
    border: 1px solid var(--emerald-border);
}
.badge-active::before, .badge-present::before, .badge-approved::before, .badge-paid::before, .badge-resolved::before {
    background-color: var(--emerald);
}

.badge-suspended, .badge-rejected, .badge-absent, .badge-urgent {
    background-color: var(--rose-bg);
    color: var(--rose-text);
    border: 1px solid var(--rose-border);
}
.badge-suspended::before, .badge-rejected::before, .badge-absent::before, .badge-urgent::before {
    background-color: var(--rose);
}

.badge-pending, .badge-draft, .badge-half_day, .badge-in_progress {
    background-color: var(--amber-bg);
    color: var(--amber-text);
    border: 1px solid var(--amber-border);
}
.badge-pending::before, .badge-draft::before, .badge-half_day::before, .badge-in_progress::before {
    background-color: var(--amber);
}

.badge-locked, .badge-closed, .badge-cancelled {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.badge-locked::before, .badge-closed::before, .badge-cancelled::before {
    background-color: #64748b;
}

/* Opacity Utility Fallbacks (Guarantees transparent tints rather than solid backgrounds) */
.bg-opacity-10 { --bs-bg-opacity: 0.1 !important; }
.bg-opacity-15 { --bs-bg-opacity: 0.15 !important; }
.bg-opacity-20 { --bs-bg-opacity: 0.2 !important; }
.bg-opacity-25 { --bs-bg-opacity: 0.25 !important; }
.bg-opacity-50 { --bs-bg-opacity: 0.5 !important; }
.border-opacity-25 { --bs-border-opacity: 0.25 !important; }
.border-opacity-50 { --bs-border-opacity: 0.5 !important; }

/* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.86rem;
    padding: 0.52rem 1.15rem;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-primary {
    background: #4F46E5 !important;
    background-color: #4F46E5 !important;
    border-color: #4F46E5 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background: #4338CA !important;
    background-color: #4338CA !important;
    border-color: #4338CA !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
    transform: translateY(-1px);
}

.btn-outline-primary {
    background-color: #ffffff !important;
    background: #ffffff !important;
    border-color: #C7D2FE !important;
    color: #4F46E5 !important;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.05);
}
.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active {
    background-color: #EEF2FF !important;
    background: #EEF2FF !important;
    border-color: #4F46E5 !important;
    color: #4338CA !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.12);
}

/* White / Light / Secondary Buttons - Prevent white-on-white text disappearance */
.btn-white,
.btn-outline-secondary,
.btn-light {
    background-color: #ffffff !important;
    background: #ffffff !important;
    border: 1px solid #E2E8F0 !important;
    color: #334155 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-white:hover, .btn-white:focus, .btn-white:active,
.btn-outline-secondary:hover, .btn-outline-secondary:focus, .btn-outline-secondary:active,
.btn-light:hover, .btn-light:focus, .btn-light:active,
.btn.bg-white:hover, .btn.bg-white:focus, .btn.bg-white:active {
    background-color: #F8FAFC !important;
    background: #F8FAFC !important;
    border-color: #CBD5E1 !important;
    color: #0F172A !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.btn-outline-dark {
    background-color: #ffffff !important;
    background: #ffffff !important;
    border: 1px solid #E2E8F0 !important;
    color: #0F172A !important;
}
.btn-outline-dark:hover, .btn-outline-dark:focus, .btn-outline-dark:active {
    background-color: #0F172A !important;
    background: #0F172A !important;
    border-color: #0F172A !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

.btn-outline-info {
    background-color: #ffffff !important;
    background: #ffffff !important;
    border: 1px solid #C7D2FE !important;
    color: #4F46E5 !important;
}
.btn-outline-info:hover, .btn-outline-info:focus, .btn-outline-info:active {
    background-color: #EEF2FF !important;
    background: #EEF2FF !important;
    border-color: #4F46E5 !important;
    color: #4338CA !important;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

/* Form Controls */
.form-control, .form-select {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.85rem;
    font-size: 0.88rem;
    color: var(--text-main);
    transition: all 0.15s ease;
}

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

/* Modals */
.modal-content {
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--border-light);
    padding: 1.25rem 1.6rem;
    background: #f8fafc;
}

.modal-footer {
    border-top: 1px solid var(--border-light);
    padding: 1.15rem 1.6rem;
    background: #f8fafc;
}

/* ==========================================================================
   Showcase Auth / Login Screen
   ========================================================================== */
.auth-page {
    min-height: 100vh;
    background: radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.12) 0%, rgba(15, 23, 42, 0.04) 70%), #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.08) 0%, transparent 70%);
    top: -150px;
    right: -150px;
    pointer-events: none;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.12), 0 1px 3px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    position: relative;
    z-index: 10;
}

.auth-header {
    padding: 2.5rem 2.25rem 1rem 2.25rem;
    text-align: center;
}

.auth-body {
    padding: 1.25rem 2.25rem 2.5rem 2.25rem;
}

/* Preset Account Buttons on Login */
.demo-preset-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.85rem;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text-main);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    text-align: left;
}

.demo-preset-btn:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: var(--primary);
    transform: translateY(-1px);
}

/* ==========================================================================
   Responsive Shell
   ========================================================================== */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
    }
    .app-navbar {
        padding: 0 1rem;
    }
    .app-content {
        padding: 1.25rem;
    }
}

/* ==========================================================================
   Executive App Footer (Authenticated Layout)
   ========================================================================== */
.app-footer {
    padding: 1rem 2rem;
    background: #ffffff;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: auto;
}

/* ==========================================================================
   Public Landing / Home Page (Clean Modern Light Theme)
   ========================================================================== */
.landing-body {
    background-color: #ffffff;
    color: #0f172a;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow-x: hidden;
}

/* Crisp Translucent Light Header */
.landing-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.landing-nav-link {
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.landing-nav-link:hover {
    color: #0f172a;
    background: #f1f5f9;
}

/* Light Theme Hero Section with Ambient Glow */
.light-hero-section {
    position: relative;
    padding: 5rem 1rem 4rem 1rem;
    background: radial-gradient(ellipse 90% 60% at 50% -10%, rgba(99, 102, 241, 0.12) 0%, rgba(240, 244, 255, 0.7) 45%, #ffffff 85%);
    overflow: hidden;
}

.light-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #4338ca;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 1.5rem;
}

.light-hero-title {
    font-size: clamp(2.4rem, 5vw, 3.85rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.04em;
    color: #0f172a;
    max-width: 860px;
    margin: 0 auto 1.5rem auto;
}

.light-hero-gradient {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 50%, #0284c7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.light-hero-subtitle {
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    color: #475569;
    max-width: 720px;
    margin: 0 auto 2.5rem auto;
    line-height: 1.6;
}

/* Clean Light Metric Cards */
.light-stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.25rem;
    text-align: center;
    box-shadow: 0 4px 14px -3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
    transition: all 0.2s ease;
}

.light-stat-card:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 12px 24px -6px rgba(15, 23, 42, 0.08);
}

.light-stat-num {
    font-size: 2.25rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    color: #0f172a;
    line-height: 1.1;
    margin-bottom: 0.35rem;
}

.light-stat-lbl {
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 600;
}

/* Clean Feature Bento Card */
.clean-feature-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-xl);
    padding: 2.25rem 2rem;
    height: 100%;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
}

.clean-feature-card:hover {
    border-color: #93c5fd;
    transform: translateY(-4px);
    box-shadow: 0 20px 35px -10px rgba(37, 99, 235, 0.1);
}

.clean-feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

/* Clean Tenant Organization Card */
.clean-tenant-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.clean-tenant-card:hover {
    border-color: #4f46e5;
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -6px rgba(79, 70, 229, 0.12);
}

/* Clean Light Landing Footer */
.clean-landing-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 4.5rem 1rem 2.5rem 1rem;
    color: #475569;
}

.clean-landing-footer .footer-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #0f172a;
    margin-bottom: 1.25rem;
}

.clean-landing-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.clean-landing-footer li {
    margin-bottom: 0.65rem;
}

.clean-landing-footer a {
    color: #64748b;
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.15s ease;
}

.clean-landing-footer a:hover {
    color: #2563eb;
}

/* ==========================================================================
   Compatible Universal Footer System & Interactive Showcase
   ========================================================================== */

/* Universal Pulsing Operational Dot */
.status-pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: statusPulse 2s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes statusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Enhanced Executive App Footer (Authenticated Pages) */
.app-footer {
    padding: 0.85rem 2rem;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: auto;
    box-shadow: 0 -1px 4px rgba(15, 23, 42, 0.02);
}

.app-footer .footer-brand-tag {
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.app-footer a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.15s ease;
}

.app-footer a:hover {
    color: #2563eb;
}

/* Interactive Product Stage (Hero Mockup) */
.product-stage {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    box-shadow: 0 25px 60px -15px rgba(37, 99, 235, 0.15), 0 0 0 1px rgba(226, 232, 240, 0.8);
    overflow: hidden;
    margin-top: 2.5rem;
    transition: all 0.3s ease;
}

.product-stage:hover {
    box-shadow: 0 30px 70px -15px rgba(37, 99, 235, 0.22), 0 0 0 1px rgba(191, 219, 254, 0.8);
}

.product-stage-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.product-stage-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-stage-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.product-stage-tab-btn {
    padding: 0.45rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s ease;
    cursor: pointer;
}

.product-stage-tab-btn.active {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #2563eb;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.product-stage-body {
    padding: 1.75rem;
    background: #ffffff;
    min-height: 340px;
}

/* Bento Pill Badges */
.bento-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Security Trust Badges */
.security-trust-badge {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
    transition: all 0.2s ease;
}

.security-trust-badge:hover {
    border-color: #93c5fd;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.08);
}

/* ==========================================================================
   RM VENTURES ENTERPRISE DESIGN SYSTEM ADDITIONS
   Muster Roll, Payroll Variance, and Advanced ESS Components
   ========================================================================== */

/* 1. Attendance Muster Roll Grid */
.muster-container {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.muster-table-wrapper {
    overflow-x: auto;
    position: relative;
    max-height: 680px;
}

.muster-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-size: 0.78rem;
}

.muster-table th,
.muster-table td {
    padding: 0.45rem 0.35rem;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f8fafc;
    vertical-align: middle;
}

.muster-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 2px solid #e2e8f0;
}

.muster-table .sticky-col {
    position: sticky;
    left: 0;
    background: #ffffff;
    z-index: 10;
    text-align: left;
    min-width: 180px;
    max-width: 220px;
    border-right: 2px solid #e2e8f0;
    padding-left: 0.75rem;
}

.muster-table th.sticky-col {
    z-index: 30;
    background: #f8fafc;
}

.muster-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.72rem;
    font-family: var(--font-monospace, monospace);
    transition: transform 0.1s ease;
}

.muster-badge:hover {
    transform: scale(1.15);
}

.muster-p {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.muster-a {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.muster-l {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.muster-wo {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.muster-h {
    background: #f5f3ff;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}

/* 2. Pre-Payroll Checklist & MoM Variance */
.checklist-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 1.15rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.checklist-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: #cbd5e1;
}

.checklist-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.variance-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.variance-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-monospace, monospace);
}

.variance-badge.up {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.variance-badge.down {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.variance-badge.neutral {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* 3. ESS Dashboard Cards */
.ess-salary-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    color: #ffffff;
    box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.2);
    position: relative;
    overflow: hidden;
}

.ess-salary-hero::after {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.ess-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.ess-kpi-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: #cbd5e1;
    transform: translateY(-1px);
}



/* ==========================================================================
   4. UNIVERSAL MULTI-SCREEN RESPONSIVE DESIGN SYSTEM
   Supports Mobile (320px+), Tablet (768px+), Laptop (1024px+), 4K (1920px+)
   ========================================================================== */

/* Universal Responsive Table Wrapper */
.table-responsive,
.muster-table-wrapper {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin;
}

.table-responsive table {
    min-width: 720px;
}

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1035;
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* ==========================================================================
   Universal Multi-Screen Responsive Engine
   ========================================================================== */

/* Universal Responsive Table & Card Wrappers */
.table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

.table-responsive::-webkit-scrollbar {
    height: 7px;
    width: 6px;
}
.table-responsive::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Breakpoint: Medium Laptops & Compact Desktops (< 1200px) */
@media (max-width: 1199.98px) {
    .app-content {
        padding: 1.25rem 1.25rem !important;
    }
    .navbar-search-box {
        max-width: 300px;
    }
}

/* Breakpoint: Tablets & Landscape Phablets (< 992px) */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%) !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        width: 280px !important;
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        z-index: 1045 !important;
        box-shadow: none !important;
        overflow: hidden !important;
        transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.24s, opacity 0.2s !important;
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35) !important;
    }

    body.sidebar-open .sidebar-backdrop {
        display: block !important;
        opacity: 1 !important;
    }

    .app-main {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .app-navbar {
        padding: 0 1rem !important;
    }

    .app-content {
        padding: 1.25rem 1rem !important;
    }

    .navbar-search-box {
        max-width: 240px;
    }

    .app-footer {
        padding: 1rem !important;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .card-stat {
        padding: 1.15rem;
    }

    .card-stat .stat-value {
        font-size: 1.55rem;
    }
}

/* Breakpoint: Mobile Phones & Portrait Tablets (< 768px) */
@media (max-width: 767.98px) {
    .app-navbar {
        padding: 0 0.75rem !important;
        height: 58px;
    }

    .navbar-search-box {
        display: none !important;
    }

    .app-content {
        padding: 1rem 0.75rem !important;
    }

    .tenant-pill {
        padding: 0.25rem 0.6rem;
        font-size: 0.75rem;
    }

    .tenant-pill span:not(.tenant-dot) {
        max-width: 130px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .card-stat {
        padding: 1rem;
    }

    .card-stat .stat-value {
        font-size: 1.4rem;
    }

    /* Category Sub-Navigation Scrollable Pills on Mobile */
    .category-nav-pills {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
        width: 100%;
    }
    .category-nav-pills::-webkit-scrollbar {
        display: none;
    }
    .category-nav-pills .nav-item {
        flex-shrink: 0;
    }

    /* Universal responsive flex header stacks */
    .page-header-responsive,
    .app-content > div > .d-flex.justify-content-between.align-items-center.mb-4,
    .app-content > div > .d-flex.justify-content-between.align-items-center.mb-3 {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.85rem !important;
    }

    .page-header-responsive > div:last-child,
    .app-content > div > .d-flex.justify-content-between.align-items-center.mb-4 > div:last-child,
    .app-content > div > .d-flex.justify-content-between.align-items-center.mb-3 > div:last-child,
    .w-100-mobile {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 0.5rem !important;
    }

    .page-header-responsive > div:last-child .btn,
    .app-content > div > .d-flex.justify-content-between.align-items-center.mb-4 > div:last-child .btn,
    .app-content > div > .d-flex.justify-content-between.align-items-center.mb-3 > div:last-child .btn,
    .page-header-responsive > div:last-child form,
    .app-content > div > .d-flex.justify-content-between.align-items-center.mb-4 > div:last-child form {
        flex: 1 1 auto;
        justify-content: center;
        text-align: center;
    }

    /* Table Mobile Touch Scroll */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-md);
        margin-bottom: 0.5rem;
    }
    .table-custom th, .table-custom td {
        font-size: 0.82rem;
        padding: 0.6rem 0.65rem;
    }
}

/* Breakpoint: Small Mobile Phones (< 576px) */
@media (max-width: 575.98px) {
    .app-content {
        padding: 0.75rem 0.5rem !important;
    }

    .app-footer {
        padding: 0.85rem !important;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .card-custom .card-header {
        padding: 0.85rem 1rem !important;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }

    .card-custom .card-body {
        padding: 1rem 0.85rem !important;
    }

    .ess-salary-hero {
        padding: 1.25rem 1rem !important;
    }

    .ess-salary-hero .display-5 {
        font-size: 1.65rem !important;
    }

    #liveClockDisplay {
        font-size: 2rem !important;
    }

    .mobile-w-100 {
        width: 100% !important;
    }
}

/* Breakpoint: Large Screens and 4K Displays (>= 1600px) */
@media (min-width: 1600px) {
    .app-content {
        padding: 2.5rem 3rem !important;
        max-width: 1920px;
        margin: 0 auto;
        width: 100%;
    }

    .card-stat .stat-value {
        font-size: 2.15rem;
    }
}

/* ==========================================================================
   Zero-CLS Floating Toast Notification Stack
   ========================================================================== */
#toastNotificationStack {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 1095;
    pointer-events: none;
    max-width: 440px;
    width: 100%;
}

#toastNotificationStack .toast {
    pointer-events: auto;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    overflow: hidden;
    animation: toastNotificationSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

@keyframes toastNotificationSlide {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 575.98px) {
    #toastNotificationStack {
        top: 0.75rem;
        left: 0.75rem;
        right: 0.75rem;
        max-width: calc(100vw - 1.5rem);
        width: auto;
    }
}

/* ==========================================================================
   Modern Enterprise Sub-Navigation Bar
   ========================================================================== */
.category-subnav-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.subnav-scroll-track {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
    background: #ffffff;
    border: 1px solid var(--sidebar-border);
    border-radius: 12px;
    padding: 0.35rem 0.45rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    max-width: 100%;
    min-width: 0;
}

.subnav-scroll-track::-webkit-scrollbar {
    display: none;
}

.subnav-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.72rem;
    font-size: 0.80rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s ease-in-out;
    border: 1px solid transparent;
}

.subnav-pill:hover {
    color: var(--text-main);
    background: #f8fafc;
}

.subnav-pill.active {
    color: #ffffff !important;
    background: #4F46E5 !important;
    border-color: #4338CA !important;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.32);
}

.min-w-0 {
    min-width: 0 !important;
}

.tenant-org-name {
    max-width: 180px;
}

@media (max-width: 767.98px) {
    .tenant-org-name {
        max-width: 110px !important;
    }
}

@media (max-width: 575.98px) {
    .tenant-org-name {
        display: none !important;
    }
    .app-navbar .dropdown-toggle::after {
        display: none !important;
    }
    .app-navbar .dropdown .btn-primary.dropdown-toggle {
        width: 34px !important;
        height: 34px !important;
        padding: 0 !important;
        min-width: 34px !important;
        border-radius: 9px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}






