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

:root {
    --font-main: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Background Surfaces (Classic Enterprise Navy & White - Workday/ADP Style) */
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --bg-surface: #ffffff;
    --card-bg: #ffffff;
    --surface: #f8fafc;
    --input-bg: #ffffff;
    --bg-subtle: #f8fafc;
    --bg-hover: #f1f5f9;
    --primary-dark: #172554;
    --text-main: #0f172a;
    
    /* Executive Navy Navigation */
    --header-bg: #0b1e36;
    --sidebar-bg: #081628;
    --sidebar-surface: #0f2642;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --sidebar-border: rgba(255, 255, 255, 0.09);
    
    /* Borders */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-focus: #1e40af;
    
    /* Typography */
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    /* Brand Accent Colors (Executive Corporate Navy & Cobalt) */
    --primary: #1e40af;
    --primary-gradient: linear-gradient(135deg, #0b1e36 0%, #1e40af 100%);
    --primary-hover: #172554;
    --primary-light: #eff6ff;
    --primary-text: #1e40af;
    --primary-glow: rgba(30, 64, 175, 0.22);
    
    --success: #059669;
    --success-gradient: linear-gradient(135deg, #10b981 0%, #047857 100%);
    --success-light: #ecfdf5;
    --success-text: #065f46;
    
    --warning: #d97706;
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
    --warning-light: #fffbeb;
    --warning-text: #92400e;
    
    --danger: #dc2626;
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    --danger-light: #fef2f2;
    --danger-text: #991b1b;
    
    --info: #0284c7;
    --info-gradient: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    --info-light: #f0f9ff;
    --info-text: #0369a1;
    
    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-pill: 9999px;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
    --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 16px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
    --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.09), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
    --shadow-glow: 0 4px 14px 0 rgba(30, 64, 175, 0.28);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    letter-spacing: normal;
}

/* -------------------------------------------------------------
   APP HEADER (Classic Executive Navy Top Bar)
   ------------------------------------------------------------- */
.app-header {
    background: var(--header-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.brand-wrapper,
.header-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

/* Mobile Sidebar Drawer Toggle Button */
.btn-sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    font-size: 1.35rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    line-height: 1;
}

.btn-sidebar-toggle:hover,
.btn-sidebar-toggle:active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.38);
    transform: scale(1.05);
}

/* Desktop Sidebar Collapse (Icons Only Mode) Toggle Button */
.btn-sidebar-collapse {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    line-height: 1;
}

.btn-sidebar-collapse:hover,
.btn-sidebar-collapse:active {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

/* Mobile Sidebar Backdrop Overlay */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 19, 43, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #1e40af 0%, #0284c7 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.35rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-icon:hover {
    transform: scale(1.05);
}

.brand-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.brand-tag-badge {
    background: linear-gradient(135deg, #1e40af 0%, #0284c7 100%);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    letter-spacing: 0.04em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.brand-subtitle {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.user-profile-header {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.btn-quick-edit {
    background: transparent;
    border: none;
    padding: 2px 5px;
    cursor: pointer;
    color: #64748b;
    border-radius: 4px;
    font-size: 0.85rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.btn-quick-edit:hover {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary);
    transform: scale(1.1);
}

.company-tag {
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 0.4rem 0.95rem;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 700;
    color: #f1f5f9;
    box-shadow: var(--shadow-xs);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.company-tag i {
    color: #60a5fa;
    font-size: 0.95rem;
}

.company-tag:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.user-dropdown-container {
    position: relative;
    z-index: 1050;
}

.user-profile-pill {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 0.3rem 0.75rem 0.3rem 0.35rem;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-xs);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.user-profile-pill:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.32);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.user-avatar-circle {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e40af 0%, #0284c7 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
    overflow: hidden;
}

.user-info-box {
    text-align: left;
}

.user-display-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.user-dropdown-caret {
    font-size: 1rem;
    color: #cbd5e1;
    transition: transform 0.2s ease;
    margin-left: 0.15rem;
}

.user-dropdown-container.open .user-dropdown-caret {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 240px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.22), 0 6px 14px -2px rgba(0, 0, 0, 0.08);
    padding: 0;
    overflow: hidden;
    z-index: 1100;
    display: none;
    transform-origin: top right;
    animation: userDropdownFade 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-dropdown-menu.show {
    display: block;
}

@keyframes userDropdownFade {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.user-dropdown-header {
    padding: 0.85rem 1.15rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.user-dropdown-name {
    font-weight: 800;
    font-size: 0.95rem;
    color: #0f172a;
    line-height: 1.3;
}

.user-dropdown-meta {
    font-size: 0.76rem;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 210px;
}

.user-dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 0.25rem 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.15rem;
    font-size: 0.86rem;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.user-dropdown-item i {
    font-size: 1.1rem;
    color: #64748b;
    transition: color 0.15s ease, transform 0.15s ease;
    width: 20px;
    text-align: center;
}

.user-dropdown-item:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.user-dropdown-item:hover i {
    color: var(--primary);
    transform: scale(1.1);
}

.user-dropdown-item.text-danger {
    color: #dc2626;
}

.user-dropdown-item.text-danger:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.user-dropdown-item.text-danger:hover i {
    color: #b91c1c;
}

.btn-logout:hover {
    background-color: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

/* -------------------------------------------------------------
   APP LAYOUT
   ------------------------------------------------------------- */
.app-container {
    display: flex;
    height: calc(100vh - 65px);
    max-height: calc(100vh - 65px);
    overflow: hidden;
}

/* -------------------------------------------------------------
   MODERN HIGH-CONTRAST SIDEBAR
   ------------------------------------------------------------- */
.app-sidebar {
    width: 260px;
    height: 100%;
    overflow-y: auto;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    padding: 1.25rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-shrink: 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.06);
}

.mobile-sidebar-header {
    display: none;
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.1em;
    padding: 1.15rem 0.85rem 0.4rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 0.95rem;
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: 1px solid transparent;
}

.nav-item .nav-icon,
.nav-item svg,
.nav-item i {
    font-size: 1.25rem;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--sidebar-text-active);
    transform: translateX(3px);
}

.nav-item:hover .nav-icon,
.nav-item:hover svg,
.nav-item:hover i {
    color: #cbd5e1;
}

.nav-item.active {
    background: var(--primary-gradient);
    color: #ffffff;
    font-weight: 700;
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.nav-item.active .nav-icon,
.nav-item.active svg,
.nav-item.active i {
    color: #ffffff;
    transform: scale(1.08);
}

/* Parent-Child Submenu Styles (Vertical Accordion) */
.nav-parent-group {
    position: relative;
    display: flex;
    flex-direction: column;
}

.nav-parent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.95rem;
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.nav-parent-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--sidebar-text-active);
}

.nav-parent-item.active-parent {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

.nav-parent-title {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.nav-chevron {
    font-size: 1.1rem;
    color: #64748b;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-parent-group.expanded .nav-chevron {
    transform: rotate(180deg);
    color: #94a3b8;
}

.nav-submenu {
    display: none;
    flex-direction: column;
    gap: 0.2rem;
    padding-left: 0.75rem;
    margin-left: 1.5rem;
    border-left: 2px solid rgba(255, 255, 255, 0.12);
    margin-top: 0.25rem;
    margin-bottom: 0.4rem;
}

.nav-parent-group.expanded .nav-submenu {
    display: flex;
    animation: slideDownSubmenu 0.2s ease-out;
}

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

.nav-submenu .nav-item {
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 500;
}

.nav-submenu .nav-item .nav-icon {
    font-size: 1rem;
    width: 18px;
    height: 18px;
}

/* Horizontal flyouts must be completely hidden in default vertical sidebar mode */
.nav-dropdown-flyout {
    display: none !important;
}

/* -------------------------------------------------------------
   COLLAPSIBLE MINI SIDEBAR (ICONS ONLY MODE)
   ------------------------------------------------------------- */
body.sidebar-collapsed:not(.menu-horizontal) .app-sidebar {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    padding: 1.25rem 0.4rem !important;
    align-items: center !important;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), padding 0.25s ease !important;
}

/* Hide Menu Item Names, Titles, and Chevrons */
body.sidebar-collapsed:not(.menu-horizontal) .nav-item span,
body.sidebar-collapsed:not(.menu-horizontal) .nav-parent-title span,
body.sidebar-collapsed:not(.menu-horizontal) .nav-chevron {
    display: none !important;
}

/* Hide Vertical Accordion Submenu in Mini Mode */
body.sidebar-collapsed:not(.menu-horizontal) .nav-submenu {
    display: none !important;
}

/* Section Titles become subtle dividers in mini mode */
body.sidebar-collapsed:not(.menu-horizontal) .nav-section-title {
    width: 36px !important;
    height: 1px !important;
    margin: 0.85rem auto !important;
    padding: 0 !important;
    background: rgba(255, 255, 255, 0.12) !important;
    color: transparent !important;
    font-size: 0 !important;
    overflow: hidden !important;
    border: none !important;
}

/* Centered square icon nav items */
body.sidebar-collapsed:not(.menu-horizontal) .nav-item,
body.sidebar-collapsed:not(.menu-horizontal) .nav-parent-item {
    width: 48px !important;
    height: 44px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px !important;
    margin: 0.15rem auto !important;
    transform: none !important;
}

body.sidebar-collapsed:not(.menu-horizontal) .nav-parent-title {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
}

body.sidebar-collapsed:not(.menu-horizontal) .nav-item .nav-icon,
body.sidebar-collapsed:not(.menu-horizontal) .nav-parent-item .nav-icon,
body.sidebar-collapsed:not(.menu-horizontal) .nav-item i,
body.sidebar-collapsed:not(.menu-horizontal) .nav-parent-item i {
    font-size: 1.35rem !important;
    width: 24px !important;
    height: 24px !important;
    margin: 0 !important;
}

body.sidebar-collapsed:not(.menu-horizontal) .nav-parent-group {
    position: relative !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
}

/* Floating popout tooltip on hover for single items */
body.sidebar-collapsed:not(.menu-horizontal) .app-sidebar > .nav-item {
    position: relative;
}

body.sidebar-collapsed:not(.menu-horizontal) .app-sidebar > .nav-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #0b1e36;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 2500;
}

body.sidebar-collapsed:not(.menu-horizontal) .app-sidebar > .nav-item:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(2px);
}

/* Flyout submenus on hover/click in collapsed mini-sidebar mode */
body.sidebar-collapsed:not(.menu-horizontal) .nav-dropdown-flyout {
    display: none !important;
    position: absolute;
    left: calc(100% + 6px);
    top: -4px;
    min-width: 220px;
    background: #0b1e36;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.45);
    padding: 0.5rem;
    z-index: 2500;
    flex-direction: column;
    gap: 0.25rem;
}

body.sidebar-collapsed:not(.menu-horizontal) .nav-parent-group:hover .nav-dropdown-flyout,
body.sidebar-collapsed:not(.menu-horizontal) .nav-dropdown-flyout.show {
    display: flex !important;
    animation: miniFlyoutFade 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body.sidebar-collapsed:not(.menu-horizontal) .nav-dropdown-flyout .flyout-header-title {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.4rem 0.65rem 0.25rem !important;
    font-size: 0.8rem !important;
    font-weight: 800 !important;
    color: #60a5fa !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
}

body.sidebar-collapsed:not(.menu-horizontal) .nav-dropdown-flyout .flyout-header-divider {
    height: 1px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    margin: 0.2rem 0.4rem 0.4rem !important;
}

body.sidebar-collapsed:not(.menu-horizontal) .nav-dropdown-flyout .nav-item {
    width: 100% !important;
    height: auto !important;
    justify-content: flex-start !important;
    padding: 0.6rem 0.85rem !important;
    border-radius: 6px !important;
    gap: 0.65rem !important;
    margin: 0 !important;
}

body.sidebar-collapsed:not(.menu-horizontal) .nav-dropdown-flyout .nav-item span {
    display: inline !important;
    font-size: 0.84rem !important;
    color: #e2e8f0 !important;
}

body.sidebar-collapsed:not(.menu-horizontal) .nav-dropdown-flyout .nav-item .nav-icon {
    font-size: 1.1rem !important;
}

body.sidebar-collapsed:not(.menu-horizontal) .nav-dropdown-flyout .nav-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

body.sidebar-collapsed:not(.menu-horizontal) .nav-dropdown-flyout .nav-item.active {
    background: var(--primary-gradient) !important;
}

/* -------------------------------------------------------------
   HORIZONTAL MENU MODE (FLIP NAVIGATION ORIENTATION)
   ------------------------------------------------------------- */
body.menu-horizontal .app-container {
    flex-direction: column;
}

body.menu-horizontal .app-sidebar {
    width: 100%;
    height: auto;
    min-height: 52px;
    max-height: 52px;
    flex-direction: row;
    align-items: center;
    overflow: visible;
    white-space: nowrap;
    border-right: none;
    border-bottom: 1px solid var(--sidebar-border);
    padding: 0.35rem 1.25rem;
    gap: 0.4rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    background-color: var(--sidebar-bg);
    z-index: 900;
}

body.menu-horizontal .nav-section-title {
    display: inline-flex;
    align-items: center;
    padding: 0 0.5rem;
    font-size: 0.65rem;
    color: #94a3b8;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    margin: 0 0.25rem;
    height: 20px;
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

body.menu-horizontal .nav-section-title:first-child {
    border-left: none;
    margin-left: 0;
    padding-left: 0;
}

body.menu-horizontal .nav-item {
    padding: 0.45rem 0.85rem;
    font-size: 0.84rem;
    flex-shrink: 0;
    gap: 0.5rem;
    border-radius: var(--radius-sm);
    transform: none !important;
}

body.menu-horizontal .nav-item .nav-icon,
body.menu-horizontal .nav-item svg,
body.menu-horizontal .nav-item i {
    font-size: 1.05rem;
    width: 18px;
    height: 18px;
}

/* Horizontal Submenu Flyout Dropdowns */
body.menu-horizontal .nav-parent-group {
    display: inline-flex;
    align-items: center;
    position: relative;
    flex-direction: row;
}

body.menu-horizontal .nav-parent-item {
    padding: 0.45rem 0.85rem;
    font-size: 0.84rem;
    flex-shrink: 0;
    gap: 0.45rem;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
}

body.menu-horizontal .nav-parent-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

body.menu-horizontal .nav-parent-item.active-parent {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-weight: 700;
}

body.menu-horizontal .nav-parent-title {
    gap: 0.5rem;
}

body.menu-horizontal .nav-chevron {
    font-size: 0.95rem;
    margin-left: 0.15rem;
}

body.menu-horizontal .nav-submenu {
    display: none !important;
}

body.menu-horizontal .nav-dropdown-flyout {
    display: none !important;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.2), 0 6px 12px -3px rgba(0, 0, 0, 0.1);
    padding: 0.4rem;
    z-index: 950;
    flex-direction: column;
    gap: 0.2rem;
}

body.menu-horizontal .nav-dropdown-flyout.show {
    display: flex !important;
    animation: flyoutFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body.menu-horizontal .nav-dropdown-flyout .nav-item {
    color: #1e293b;
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid transparent;
    width: 100%;
}

body.menu-horizontal .nav-dropdown-flyout .nav-item .nav-icon {
    color: #64748b;
    font-size: 1.05rem;
}

body.menu-horizontal .nav-dropdown-flyout .nav-item:hover {
    background: #f1f5f9;
    color: var(--primary);
    transform: none;
}

body.menu-horizontal .nav-dropdown-flyout .nav-item:hover .nav-icon {
    color: var(--primary);
}

body.menu-horizontal .nav-dropdown-flyout .nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    border: 1px solid rgba(30, 64, 175, 0.2);
    box-shadow: none;
}

body.menu-horizontal .nav-dropdown-flyout .nav-item.active .nav-icon {
    color: var(--primary);
}

body.menu-horizontal .app-content {
    height: calc(100vh - 65px - 52px);
    max-height: calc(100vh - 65px - 52px);
}

body.menu-horizontal .card-scrollable {
    height: calc(100vh - 215px);
    max-height: calc(100vh - 215px);
}

/* -------------------------------------------------------------
   MAIN CONTENT & CARD-ONLY SCROLLING
   ------------------------------------------------------------- */
.app-content {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    padding: 1.25rem 1.75rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
}

.page-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Specific Card-Only Scroll Container */
.card-scrollable {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 0 !important;
    padding: 1.15rem 1.35rem !important;
    overflow: hidden !important;
    height: calc(100vh - 165px);
    max-height: calc(100vh - 165px);
}

.card-scrollable .filter-toolbar {
    flex-shrink: 0;
    margin-bottom: 0.75rem;
}

.card-scrollable .table-responsive {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: #ffffff;
}

.card-scrollable .table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8fafc;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.page-title {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.035em;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* -------------------------------------------------------------
   FILTER & ACTION TOOLBARS
   ------------------------------------------------------------- */
.filter-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 380px;
}

.search-input-wrapper i {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 1.05rem;
    pointer-events: none;
}

.search-input-wrapper input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    background: #ffffff;
    font-size: 0.88rem;
    font-family: var(--font-main);
    color: var(--text-primary);
    box-shadow: var(--shadow-xs);
    transition: all 0.2s ease;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* -------------------------------------------------------------
   CARDS & CONTAINERS
   ------------------------------------------------------------- */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.75rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

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

/* -------------------------------------------------------------
   METRICS GRID & STAT CARDS
   ------------------------------------------------------------- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5px;
    background: var(--primary-gradient);
    opacity: 0.8;
    transition: height 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.metric-card:hover::before {
    height: 5px;
}

.metric-card-indigo::before { background: linear-gradient(135deg, #4f46e5, #6366f1); }
.metric-card-amber::before { background: linear-gradient(135deg, #f59e0b, #d97706); }
.metric-card-emerald::before { background: linear-gradient(135deg, #10b981, #059669); }
.metric-card-cyan::before { background: linear-gradient(135deg, #06b6d4, #0284c7); }

.metric-icon-box {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.bg-indigo-soft { background: #eef2ff; }
.text-indigo { color: #4f46e5; }
.bg-amber-soft { background: #fffbeb; }
.text-amber { color: #d97706; }
.bg-emerald-soft { background: #ecfdf5; }
.text-emerald { color: #059669; }
.bg-cyan-soft { background: #f0f9ff; }
.text-cyan { color: #0284c7; }

.metric-body {
    flex: 1;
}

.metric-val {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.metric-lbl {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-top: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-trend {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* -------------------------------------------------------------
   BUTTONS
   ------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    text-decoration: none;
    letter-spacing: -0.01em;
    font-family: var(--font-main);
}

.btn:active {
    transform: scale(0.98);
}

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

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-secondary {
    background-color: #ffffff;
    border-color: var(--border-color);
    color: var(--text-secondary);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: var(--text-primary);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-success {
    background: var(--success-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    color: #ffffff;
}

/* Action Button Groups */
.action-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-action-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    max-width: 34px;
    padding: 0;
    border-radius: 8px;
    font-size: 1.05rem;
    cursor: pointer;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
    background: #ffffff;
}

.btn-action-icon i {
    font-size: 1.05rem;
    line-height: 1;
}

.btn-action-icon.btn-edit {
    color: #1e40af;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.btn-action-icon.btn-edit:hover {
    background: #1e40af;
    color: #ffffff;
    border-color: #1e40af;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.25);
    transform: translateY(-1px);
}

.btn-quick-edit {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.35rem;
    vertical-align: middle;
}

.btn-quick-edit:hover {
    color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.15);
}

.btn-action-icon.btn-edit {
    color: #2563eb;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.btn-action-icon.btn-edit:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
    transform: translateY(-1px);
}

.btn-action-icon.btn-salary {
    color: #4f46e5;
    background: #eef2ff;
    border-color: #c7d2fe;
}

.btn-action-icon.btn-salary:hover {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.25);
    transform: translateY(-1px);
}

.btn-action-icon.btn-payslip {
    color: #059669;
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.btn-action-icon.btn-payslip:hover {
    background: #059669;
    color: #ffffff;
    border-color: #059669;
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.25);
    transform: translateY(-1px);
}

.btn-action-icon.btn-offer {
    color: #0284c7;
    background: #f0f9ff;
    border-color: #bae6fd;
}

.btn-action-icon.btn-offer:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.25);
    transform: translateY(-1px);
}

.btn-action-icon.btn-relieve {
    color: #d97706;
    background: #fffbeb;
    border-color: #fde68a;
}

.btn-action-icon.btn-relieve:hover {
    background: #d97706;
    color: #ffffff;
    border-color: #d97706;
    box-shadow: 0 3px 10px rgba(217, 119, 6, 0.25);
    transform: translateY(-1px);
}

.btn-action-icon.btn-deactivate {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
}

.btn-action-icon.btn-deactivate:hover {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.25);
    transform: translateY(-1px);
}

/* -------------------------------------------------------------
   FORMS & INPUTS
   ------------------------------------------------------------- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.45rem;
}

.form-label i {
    color: var(--primary);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.95rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    font-size: 0.9rem;
    font-family: var(--font-main);
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-xs);
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='18' height='18' fill='%2364748b'%3E%3Cpath d='M12 16L6 10H18L12 16Z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 18px;
    padding-right: 2.5rem;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

/* -------------------------------------------------------------
   TABLES
   ------------------------------------------------------------- */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
}

.table {
    width: 100%;
    min-width: 880px;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.86rem;
    background: #ffffff;
}

.table th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 800;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: middle;
}

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

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

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

/* Pinned / Sticky Actions Column */
.table th.col-actions,
.table td.col-actions {
    position: sticky;
    right: 0;
    background: #ffffff;
    z-index: 6;
    text-align: right;
    white-space: nowrap;
    box-shadow: -4px 0 10px rgba(15, 23, 42, 0.06);
    padding-right: 1.15rem;
    width: 1%;
}

.table thead th.col-actions {
    background: #f8fafc;
    z-index: 16;
}

.table tbody tr:hover td.col-actions {
    background: #f8fafc;
}

/* Table Specific Components */
.emp-profile-cell {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.emp-avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.82rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.emp-name-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.92rem;
}

.emp-meta-contact {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.emp-meta-contact i {
    font-size: 0.8rem;
    color: #94a3b8;
}

.code-pill {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 700;
    color: #334155;
    letter-spacing: 0.02em;
    white-space: nowrap;
    display: inline-block;
}

.desig-text {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* Status Indicator Pills */
.status-indicator-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.28rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.status-active {
    background-color: var(--success-light);
    color: var(--success-text);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-active .status-dot {
    background-color: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.status-inactive {
    background-color: var(--danger-light);
    color: var(--danger-text);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-inactive .status-dot {
    background-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

/* -------------------------------------------------------------
   BADGES & TAGS
   ------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-pill);
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
}

.badge-success {
    background-color: var(--success-light);
    color: var(--success-text);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background-color: var(--warning-light);
    color: var(--warning-text);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-danger {
    background-color: var(--danger-light);
    color: var(--danger-text);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-info {
    background-color: var(--info-light);
    color: var(--info-text);
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.badge-primary {
    background-color: var(--primary-light);
    color: var(--primary-text);
    border: 1px solid rgba(79, 70, 229, 0.2);
}

.badge-secondary {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.badge-dept {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* -------------------------------------------------------------
   MODAL SYSTEM
   ------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 19, 43, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    padding: 1.5rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-dialog,
.modal-content {
    background: #ffffff;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.3);
    border: 1px solid var(--border-color);
    animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 1.35rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.modal-close {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.modal-close:hover {
    background: var(--danger-light);
    color: var(--danger-text);
}

.modal-body {
    padding: 1.75rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* -------------------------------------------------------------
   SWEETALERT CUSTOM STYLING (PaySphere Brand Theme)
   ------------------------------------------------------------- */
div:where(.swal2-container) .swal2-popup {
    font-family: var(--font-main) !important;
    border-radius: var(--radius-xl) !important;
    padding: 2.25rem !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.3) !important;
}

div:where(.swal2-container) .swal2-title {
    font-weight: 800 !important;
    letter-spacing: -0.025em !important;
    color: var(--text-primary) !important;
    font-size: 1.35rem !important;
}

div:where(.swal2-container) .swal2-html-container {
    color: var(--text-secondary) !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
}

div:where(.swal2-container) button.swal2-styled {
    border-radius: var(--radius-md) !important;
    font-weight: 700 !important;
    font-family: var(--font-main) !important;
    padding: 0.65rem 1.5rem !important;
    font-size: 0.9rem !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all 0.2s ease !important;
}

/* -------------------------------------------------------------
   TOASTS & ALERTS
   ------------------------------------------------------------- */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    animation: toastSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* -------------------------------------------------------------
   AUTH SCREEN (Aura Mesh / Frosted Glass)
   ------------------------------------------------------------- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.22) 0%, transparent 45%),
                radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.22) 0%, transparent 45%),
                #0b132b;
    position: relative;
    overflow: hidden;
}

.auth-backdrop-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}

.auth-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-xl);
    padding: 1.85rem 2.25rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35);
    position: relative;
    z-index: 10;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.15rem;
}

.auth-brand-icon {
    margin: 0 auto 0.5rem;
    width: 50px;
    height: 50px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.25);
    transition: transform 0.2s ease;
}

.auth-brand-icon:hover {
    transform: scale(1.05);
}

.auth-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1.2;
    margin: 0;
}

.auth-title span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    margin-bottom: 0;
    font-weight: 500;
}

/* Red Error Message Banner above username */
.auth-error-msg {
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.95rem;
    line-height: 1.4;
    animation: authErrorFade 0.2s ease;
}

.auth-error-msg i {
    font-size: 1.15rem;
    color: #dc2626;
    flex-shrink: 0;
}

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

.auth-form .form-group {
    margin-bottom: 0.95rem;
}

.auth-form .form-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.35rem;
}

/* Integrated Icon inside Input Box */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 13px;
    font-size: 1.15rem;
    color: #94a3b8;
    pointer-events: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.input-with-icon .form-control {
    padding-left: 40px !important;
    width: 100%;
    height: 44px;
    font-size: 0.9rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-with-icon .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-with-icon:focus-within .input-icon {
    color: var(--primary);
    transform: scale(1.08);
}

/* Centered Sign In button */
.auth-btn-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 1.15rem;
}

.btn-block {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.auth-form .btn-primary {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.72rem 1.25rem;
    font-size: 0.92rem;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.35);
    transition: all 0.2s ease;
    text-align: center;
}

.auth-form .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.45);
}

.demo-login-box {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.demo-login-label {
    text-align: center;
    margin-bottom: 0.85rem;
}

.demo-login-label span {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: #ffffff;
    padding: 0 0.5rem;
}

.quick-login-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
}

.btn-quick {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: var(--font-main);
}

.btn-quick i {
    font-size: 0.95rem;
    color: var(--primary);
}

.btn-quick:hover {
    background: var(--primary-light);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-xs);
}

/* -------------------------------------------------------------
   PAYSLIP & PRINT AREA
   ------------------------------------------------------------- */
.payslip-container {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    box-shadow: var(--shadow-sm);
}

.payslip-header {
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
}

.payslip-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #1e293b;
    margin: 0.35rem 0;
}

.payslip-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.payslip-table td, .payslip-table th {
    padding: 0.65rem 0.95rem;
    border: 1px solid #e2e8f0;
}

.net-pay-banner {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
    border-radius: var(--radius-md);
    padding: 1.25rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
}

.net-pay-amount {
    font-size: 1.85rem;
    font-weight: 800;
    color: #065f46;
}

/* -------------------------------------------------------------
   TOM SELECT AUTO-SEARCHABLE DROPDOWNS
   ------------------------------------------------------------- */
.ts-wrapper {
    font-family: var(--font-main);
    width: 100%;
}

.ts-wrapper.form-control {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    height: auto;
}

.ts-control {
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    padding: 0.55rem 0.85rem !important;
    font-size: 0.88rem !important;
    font-family: var(--font-main) !important;
    color: var(--text-primary) !important;
    background: #ffffff !important;
    box-shadow: var(--shadow-xs) !important;
    min-height: 40px !important;
    display: flex !important;
    align-items: center !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer;
}

.ts-wrapper.focus .ts-control {
    border-color: var(--border-focus) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
    outline: none !important;
}

.ts-wrapper.disabled .ts-control {
    background-color: #f1f5f9 !important;
    opacity: 0.7;
    cursor: not-allowed;
}

.ts-control > input {
    font-family: var(--font-main) !important;
    font-size: 0.88rem !important;
    color: var(--text-primary) !important;
}

.ts-control .item {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
}

.ts-dropdown {
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12), 0 4px 10px rgba(15, 23, 42, 0.06) !important;
    background: #ffffff !important;
    font-family: var(--font-main) !important;
    margin-top: 5px !important;
    overflow: hidden !important;
    z-index: 10000 !important;
    animation: tsDropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.ts-dropdown .dropdown-input-wrap {
    padding: 0.55rem 0.65rem !important;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

.ts-dropdown .dropdown-input {
    width: 100% !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.45rem 0.75rem !important;
    font-size: 0.84rem !important;
    font-family: var(--font-main) !important;
    background: #ffffff !important;
    outline: none !important;
    transition: all 0.2s ease;
}

.ts-dropdown .dropdown-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15) !important;
}

.ts-dropdown-content {
    max-height: 240px !important;
    padding: 0.35rem 0 !important;
    overflow-y: auto !important;
}

.ts-dropdown .option {
    padding: 0.55rem 0.95rem !important;
    font-size: 0.86rem !important;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    transition: background 0.12s ease, color 0.12s ease;
    cursor: pointer;
}

.ts-dropdown .option.active {
    background-color: #f1f5f9 !important;
    color: var(--primary) !important;
    font-weight: 600;
}

.ts-dropdown .option.selected {
    background-color: var(--primary-light) !important;
    color: var(--primary) !important;
    font-weight: 700;
}

.ts-dropdown .no-results {
    padding: 0.75rem 1rem !important;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

/* -------------------------------------------------------------
   PRINT MEDIA STYLES FOR HIKE LETTERS & PAYSLIPS
   ------------------------------------------------------------- */
@media print {
    /* Hide everything by default */
    body > * {
        display: none !important;
    }

    /* Show only the modal overlay when a print area is inside it */
    #modalOverlay {
        display: block !important;
        position: static !important;
        background: none !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Show modal dialog */
    #modalOverlay #modalDialog {
        display: block !important;
        box-shadow: none !important;
        border: none !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        position: static !important;
        transform: none !important;
    }

    /* Hide modal chrome — only content matters */
    .modal-header,
    .modal-footer,
    .modal-close,
    .btn {
        display: none !important;
    }

    /* Modal body fills page */
    #modalBody {
        display: block !important;
        padding: 0 !important;
        overflow: visible !important;
        max-height: none !important;
    }

    /* Print area styling — clean white page */
    #hikeLetterPrintArea,
    #offerLetterPrintArea,
    #relievingLetterPrintArea,
    #printablePayslip,
    .payslip-print-area {
        display: block !important;
        box-shadow: none !important;
        border: none !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 2rem !important;
        margin: 0 !important;
        page-break-inside: avoid;
    }

    html, body {
        background: #ffffff !important;
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* -------------------------------------------------------------
   TAXABILITY & CTC PACKAGE STYLING
   ------------------------------------------------------------- */
.badge-taxable {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-partially-exempt {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-exempt {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-deductible {
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.preset-chip {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.preset-chip:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.slab-table {
    width: 100%;
    font-size: 0.78rem;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.slab-table th {
    background: #f8fafc;
    padding: 0.4rem 0.6rem;
    text-align: left;
    font-weight: 700;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

.slab-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid #f1f5f9;
}

/* -------------------------------------------------------------
   EXECUTIVE CORPORATE DOCUMENTS & TEMPLATES (PAYSLIP, OFFER, RELIEVING)
   ------------------------------------------------------------- */
.doc-paper {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2.5rem;
    max-width: 820px;
    margin: 0 auto;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1e293b;
    line-height: 1.55;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.doc-paper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #1e40af, #3b82f6, #06b6d4, #10b981);
}

.doc-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 5rem;
    font-weight: 900;
    color: rgba(15, 23, 42, 0.025);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    z-index: 0;
}

.doc-content {
    position: relative;
    z-index: 1;
}

.doc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1.5rem;
    gap: 1.5rem;
}

.doc-brand-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.doc-brand-subtitle {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
    line-height: 1.4;
}

.doc-badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.doc-badge-status.blue {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.doc-badge-status.green {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.doc-badge-status.amber {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.doc-meta-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-bottom: 1.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.doc-meta-table td {
    padding: 0.55rem 0.85rem;
    border: 1px solid #e2e8f0;
}

.doc-meta-label {
    font-weight: 700;
    color: #475569;
    background: #f1f5f9;
    font-size: 0.78rem;
    width: 18%;
}

.doc-meta-val {
    color: #0f172a;
    font-weight: 600;
    width: 32%;
}

.doc-ledger-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.doc-ledger-card {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.doc-ledger-card-header {
    background: #f1f5f9;
    padding: 0.6rem 0.85rem;
    font-weight: 800;
    font-size: 0.82rem;
    color: #1e293b;
    border-bottom: 1px solid #cbd5e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.doc-ledger-card-header.earnings {
    background: #f0fdf4;
    color: #166534;
    border-bottom-color: #bbf7d0;
}

.doc-ledger-card-header.deductions {
    background: #fef2f2;
    color: #991b1b;
    border-bottom-color: #fecaca;
}

.doc-ledger-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    border-bottom: 1px solid #f1f5f9;
}

.doc-ledger-row:last-child {
    border-bottom: none;
}

.doc-ledger-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 800;
    background: #f8fafc;
    border-top: 2px solid #cbd5e1;
}

.doc-net-pay-banner {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%);
    color: #ffffff;
    border-radius: 10px;
    padding: 1.15rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 14px rgba(6, 78, 59, 0.2);
}

.doc-net-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: #a7f3d0;
}

.doc-net-val {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #ffffff;
}

.doc-net-words {
    font-size: 0.78rem;
    color: #d1fae5;
    margin-top: 0.25rem;
    font-style: italic;
}

.doc-annexure-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-bottom: 1.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.doc-annexure-table th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.74rem;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid #cbd5e1;
    text-align: left;
}

.doc-annexure-table td {
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.doc-seal-badge {
    border: 2px solid #059669;
    color: #059669;
    font-weight: 800;
    font-size: 0.68rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #ecfdf5;
}

.doc-seal-badge.gold {
    border-color: #d97706;
    color: #b45309;
    background: #fffbeb;
}

.doc-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* -------------------------------------------------------------
   PRINT STYLES FOR CRISP A4 PDF GENERATION
   ------------------------------------------------------------- */
@media print {
    body * {
        visibility: hidden !important;
    }
    
    #modalDialog,
    #printablePayslip,
    #offerLetterPrintArea,
    #relievingLetterPrintArea,
    .doc-paper,
    .doc-paper * {
        visibility: visible !important;
    }
    
    .doc-paper {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 1.5rem !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
    
    .doc-paper::before {
        display: none !important;
    }
    
    .modal-overlay {
        position: static !important;
        background: transparent !important;
        padding: 0 !important;
    }
    
    .modal-dialog {
        box-shadow: none !important;
        border: none !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .modal-header,
    .modal-footer,
    .doc-toolbar,
    .no-print,
    .app-header,
    .app-sidebar,
    .toast-container {
        display: none !important;
    }
}

/* =============================================================
   COMPREHENSIVE RESPONSIVE DESIGN & MOBILE OPTIMIZATION
   ============================================================= */

/* TABLETS & SMALL LAPTOPS (<= 1100px) */
@media (max-width: 1100px) {
    .app-header {
        padding: 0.75rem 1.25rem;
    }
    
    .app-content {
        padding: 1.25rem 1.25rem;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
}

/* Mobile Table Horizontal Swipe Hint */
.table-scroll-hint {
    display: none;
}

/* TABLET & MOBILE DRAWER TRANSITION BREAKPOINT (<= 992px) */
@media (max-width: 992px) {
    /* Hide Desktop Collapse Toggle */
    .btn-sidebar-collapse {
        display: none !important;
    }

    /* Un-pin Sticky Actions Column on Tablet/Mobile so it never blocks data */
    .table th.col-actions,
    .table td.col-actions {
        position: static !important;
        box-shadow: none !important;
        background: inherit !important;
    }

    /* Show Mobile Hamburger Toggle */
    .btn-sidebar-toggle {
        display: inline-flex !important;
    }

    /* Enable Backdrop */
    .sidebar-backdrop {
        display: block !important;
    }

    /* Mobile Sidebar Drawer Header */
    .mobile-sidebar-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 0 0.25rem 1rem 0.25rem;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .mobile-sidebar-brand {
        display: flex;
        align-items: center;
        gap: 0.6rem;
    }

    .mobile-sidebar-close {
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: #ffffff;
        width: 34px;
        height: 34px;
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .mobile-sidebar-close:hover,
    .mobile-sidebar-close:active {
        background: rgba(220, 38, 38, 0.25);
        border-color: rgba(220, 38, 38, 0.5);
        color: #fca5a5;
    }

    /* Transform Sidebar into Off-Canvas Drawer (Both in Vertical and Horizontal mode) */
    .app-sidebar,
    body.menu-horizontal .app-sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 290px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        z-index: 2000 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease !important;
        box-shadow: 12px 0 35px rgba(0, 0, 0, 0.4) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        flex-direction: column !important;
        align-items: stretch !important;
        white-space: normal !important;
        border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
        border-bottom: none !important;
        padding: 1.5rem 1rem !important;
        background-color: var(--sidebar-bg) !important;
    }

    .app-sidebar.open,
    body.menu-horizontal .app-sidebar.open {
        transform: translateX(0) !important;
    }

    /* Reset Horizontal Menu overrides when inside drawer */
    body.menu-horizontal .nav-section-title {
        border-left: none !important;
        padding: 1.15rem 0.85rem 0.4rem !important;
        height: auto !important;
        margin: 0 !important;
    }

    body.menu-horizontal .nav-item {
        width: 100% !important;
        padding: 0.7rem 0.95rem !important;
        font-size: 0.9rem !important;
    }

    body.menu-horizontal .nav-parent-group {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }

    body.menu-horizontal .nav-parent-item {
        width: 100% !important;
        padding: 0.65rem 0.95rem !important;
        justify-content: space-between !important;
    }

    body.menu-horizontal .nav-parent-group.expanded .nav-submenu {
        display: flex !important;
    }

    body.menu-horizontal .nav-dropdown-flyout {
        display: none !important;
    }

    /* Enable Natural Mobile Touch Scrolling */
    html, body {
        height: auto !important;
        min-height: 100vh !important;
        max-height: none !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    body.sidebar-open {
        overflow: hidden !important;
    }

    .app-container,
    body.menu-horizontal .app-container {
        display: block !important;
        height: auto !important;
        max-height: none !important;
        min-height: calc(100vh - 65px) !important;
        overflow: visible !important;
    }

    .app-content,
    body.menu-horizontal .app-content {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 1.25rem 1rem !important;
        width: 100% !important;
    }

    .card-scrollable,
    body.menu-horizontal .card-scrollable {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    /* Responsive Grid Auto-Collapse for Tablet */
    div[style*="grid-template-columns: 2fr 1fr"],
    div[style*="grid-template-columns: 1fr 2fr"],
    div[style*="grid-template-columns: 2.2fr 1.2fr 1fr"],
    div[style*="grid-template-columns: 1.15fr 0.85fr"] {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    div[style*="grid-template-columns: repeat(4, 1fr)"],
    div[style*="grid-template-columns:repeat(4,1fr)"],
    div[style*="grid-template-columns: repeat(4,1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
}

/* SMARTPHONES & PORTRAIT TABLETS (<= 768px) */
@media (max-width: 768px) {
    /* Compact Top Header */
    .app-header {
        padding: 0.6rem 0.85rem !important;
    }

    .brand-icon {
        width: 34px !important;
        height: 34px !important;
    }

    .brand-icon svg {
        width: 22px !important;
        height: 22px !important;
    }

    .brand-title {
        font-size: 1.12rem !important;
    }

    .brand-subtitle {
        display: none !important;
    }

    .company-tag {
        display: none !important;
    }

    .user-info-box {
        display: none !important;
    }

    .user-profile-pill {
        padding: 0.2rem 0.4rem 0.2rem 0.2rem !important;
        gap: 0.35rem !important;
    }

    .user-avatar-circle {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        font-size: 0.75rem !important;
    }

    /* Page Header Stack */
    .page-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.85rem !important;
        margin-bottom: 1rem !important;
    }

    .page-header > div:first-child {
        width: 100% !important;
    }

    .page-header .btn,
    .page-header button {
        width: 100% !important;
        justify-content: center !important;
    }

    .page-title {
        font-size: 1.35rem !important;
    }

    .page-subtitle {
        font-size: 0.82rem !important;
    }

    /* Metrics & Stat Cards */
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        margin-bottom: 1.25rem !important;
    }

    .metric-card {
        padding: 0.95rem 0.85rem !important;
        gap: 0.75rem !important;
        border-radius: var(--radius-md) !important;
    }

    .metric-icon-box {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.25rem !important;
        border-radius: var(--radius-sm) !important;
    }

    .metric-val {
        font-size: 1.35rem !important;
    }

    .metric-lbl {
        font-size: 0.72rem !important;
    }

    .metric-trend {
        display: none !important;
    }

    /* Universal Inline Grid Collapsing on Mobile */
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 0.85rem !important;
    }

    /* Filter & Search Toolbars */
    .filter-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
        margin-bottom: 1rem !important;
    }

    .filter-toolbar > * {
        width: 100% !important;
    }

    .search-input-wrapper {
        width: 100% !important;
        max-width: 100% !important;
    }

    .search-input-wrapper input {
        width: 100% !important;
    }

    .filter-group,
    .filter-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }

    .filter-group select,
    .filter-group input,
    .filter-actions .btn,
    .filter-actions button {
        flex: 1 1 auto !important;
        justify-content: center !important;
    }

    /* Table Horizontal Touch-Scrolling Container */
    .table-responsive {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border: 1px solid var(--border-color) !important;
        border-radius: var(--radius-md) !important;
        margin-bottom: 1rem !important;
        display: block !important;
        background: #ffffff;
    }

    /* Un-pin sticky actions so it never covers table data on mobile */
    .table th.col-actions,
    .table td.col-actions {
        position: static !important;
        box-shadow: none !important;
        background: inherit !important;
    }

    /* Comfortable, spacious touch-friendly table */
    .table-responsive table,
    .table {
        min-width: 1060px !important;
        width: 100% !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    .table th {
        padding: 0.85rem 1rem !important;
        font-size: 0.84rem !important;
        font-weight: 800 !important;
        white-space: nowrap !important;
        letter-spacing: 0.04em !important;
        background: #f8fafc !important;
    }

    .table td {
        padding: 0.85rem 1rem !important;
        font-size: 0.92rem !important;
        white-space: nowrap !important;
        vertical-align: middle !important;
    }

    /* Larger, crisp employee text and cards on mobile */
    .emp-profile-cell {
        gap: 0.85rem !important;
    }

    .emp-name-title {
        font-size: 1rem !important;
        font-weight: 800 !important;
    }

    .emp-meta-contact {
        font-size: 0.84rem !important;
        margin-top: 0.25rem !important;
        gap: 0.5rem !important;
    }

    .emp-avatar-circle {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        font-size: 0.9rem !important;
    }

    .code-pill {
        font-size: 0.88rem !important;
        padding: 0.28rem 0.65rem !important;
    }

    .badge-dept {
        font-size: 0.84rem !important;
        padding: 0.28rem 0.65rem !important;
    }

    .desig-text {
        font-size: 0.88rem !important;
        font-weight: 600 !important;
    }

    .status-indicator-pill {
        font-size: 0.84rem !important;
        padding: 0.28rem 0.75rem !important;
    }

    /* Touch-Friendly Action Buttons */
    .btn-action-icon {
        width: 38px !important;
        height: 38px !important;
        font-size: 1.18rem !important;
        border-radius: 9px !important;
        margin: 0 2px !important;
    }

    /* Table Horizontal Swipe Hint */
    .table-scroll-hint {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.82rem;
        font-weight: 600;
        color: var(--primary);
        background: #eff6ff;
        padding: 0.55rem 0.95rem;
        border-radius: 8px;
        margin-bottom: 0.75rem;
        border: 1px solid rgba(30, 64, 175, 0.18);
    }

    /* Cards */
    .card {
        padding: 1.15rem 1rem !important;
        border-radius: var(--radius-md) !important;
        margin-bottom: 1rem !important;
    }

    /* Modals & Dialogs (Bottom Sheet Feel on Mobile) */
    .modal-overlay {
        padding: 0.5rem !important;
        align-items: flex-end !important;
    }

    .modal-dialog,
    .modal-content {
        max-width: 100% !important;
        width: 100% !important;
        max-height: 93vh !important;
        border-radius: 20px 20px 0 0 !important;
        margin: 0 !important;
    }

    .modal-header {
        padding: 1rem 1.25rem !important;
    }

    .modal-title {
        font-size: 1.1rem !important;
    }

    .modal-body {
        padding: 1rem 1.25rem !important;
        max-height: calc(93vh - 125px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .modal-footer {
        padding: 0.85rem 1.25rem !important;
        flex-direction: column-reverse !important;
        gap: 0.5rem !important;
    }

    .modal-footer .btn,
    .modal-footer button {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Form Fields on Mobile (Font size >= 16px to prevent iOS auto-zoom) */
    .form-row,
    .form-grid {
        flex-direction: column !important;
        display: flex !important;
        gap: 0.75rem !important;
    }

    .form-group {
        width: 100% !important;
        margin-bottom: 0.75rem !important;
    }

    .form-control,
    .form-select,
    .input-with-icon input,
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important;
        padding: 0.65rem 0.85rem !important;
    }

    /* Document & Payslip Viewer on Mobile */
    .doc-paper {
        padding: 1rem 0.85rem !important;
        width: 100% !important;
        font-size: 0.82rem !important;
    }

    .doc-toolbar {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .doc-toolbar .btn {
        flex: 1 1 45% !important;
        font-size: 0.82rem !important;
        padding: 0.5rem !important;
    }

    /* User Profile Dropdown Position */
    .user-dropdown-menu {
        right: -8px !important;
        min-width: 210px !important;
    }
}

/* EXTRA SMALL SMARTPHONES (<= 480px) */
@media (max-width: 480px) {
    /* Auth Card Full Width */
    .auth-wrapper {
        padding: 1rem 0.75rem !important;
    }

    .auth-card {
        padding: 1.5rem 1.15rem !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: var(--radius-lg) !important;
    }

    .auth-title {
        font-size: 1.45rem !important;
    }

    .auth-subtitle {
        font-size: 0.8rem !important;
    }

    /* Stat Cards Compact 2-column or 1-column */
    .metrics-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
    }

    .metric-card {
        padding: 0.75rem 0.65rem !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.45rem !important;
    }

    .metric-icon-box {
        width: 34px !important;
        height: 34px !important;
        font-size: 1.1rem !important;
    }

    .metric-val {
        font-size: 1.25rem !important;
    }

    .metric-lbl {
        font-size: 0.7rem !important;
    }

    /* Action Buttons in Cards */
    .btn-group,
    .action-buttons {
        flex-direction: column !important;
        width: 100% !important;
    }

    .btn-group .btn,
    .action-buttons .btn {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Toast Notifications */
    .toast-container {
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
    }

    .toast {
        width: 100% !important;
        max-width: 100% !important;
    }
}
