/* Everlast HR System - Main Stylesheet */

:root {
    /* Primary colors as specified in requirements */
    --primary-color: #005d99;
    --secondary-color: #17a74a;
    --tertiary-color: #006e94;
    
    /* System colors */
    --light-bg: #f5f8fa;
    --dark-bg: #1e1e2d;
    --text-color: #181c32;
    --text-muted: #7e8299;
    --border-color: #e4e6ef;
    --card-bg: #ffffff;
    --sidebar-width: 265px;
    --sidebar-collapsed-width: 70px;
    
    /* Status colors */
    --success-color: #17a74a;
    --danger-color: #f1416c;
    --warning-color: #ffc700;
    --info-color: #7239ea;
}

/* Base Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    transition: all 0.3s ease;
}

.dark-mode {
    --light-bg: #151521;
    --card-bg: #1e1e2d;
    --text-color: #ffffff;
    --border-color: #2b2b40;
}

/* Layout */
.page-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: #1f2937;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow-x: hidden;
    overflow-y: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width) !important;
    max-width: var(--sidebar-collapsed-width) !important;
    overflow-x: hidden !important;
    overflow-y: auto;
}

.sidebar.collapsed .sidebar-nav-container {
    overflow-y: auto;
    overflow-x: visible;
}

.content-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: all 0.3s ease;
    padding: 20px;
    width: auto;
}

/* When sidebar is collapsed, move the content regardless of intermediate elements */
.sidebar.collapsed ~ .content-wrapper,
.sidebar.collapsed ~ #content-wrapper {
    margin-left: var(--sidebar-collapsed-width);
}

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    min-height: 80px;
    gap: 0.75rem;
}

.sidebar-nav-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden !important;
    min-height: 0;
    scrollbar-width: thin;
    width: 100%;
}
    scrollbar-color: var(--border-color) transparent;
}

.sidebar-nav-container::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav-container::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.sidebar-nav-container::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.sidebar-nav-container::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.logo-icon {
    width: 40px;
    height: 40px;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
}

.logo-icon .logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.logo-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1.1rem;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
    color: #ffffff;
    font-weight: 600;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #ffffff;
    margin-left: auto;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    color: var(--primary-color);
    background-color: rgba(0, 93, 153, 0.1);
}

.nav-menu {
    padding: 1rem 0;
    list-style: none;
    margin: 0;
    padding-bottom: 1rem;
}


/* Enhanced scrollbar styling for better UX */
.nav-menu {
    scroll-behavior: smooth;
    position: relative;
}

/* Add subtle shadow indicators for scrollable content */
.sidebar-nav-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.sidebar-nav-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.1), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

/* Show scroll indicators when content overflows */
.sidebar-nav-container.scrollable-top::before {
    opacity: 1;
}

.sidebar-nav-container.scrollable-bottom::after {
    opacity: 1;
}

.nav-menu::-webkit-scrollbar {
    width: 6px;
}

.nav-menu::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.nav-menu::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.nav-menu::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.4);
}

.nav-item {
    margin: 0.25rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: none;
    border-radius: 0;
}

.nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: #ffffff;
    background-color: #005d99;
    border-radius: 8px;
    margin: 0 0.75rem;
    padding: 0.75rem 1rem;
}

.nav-icon {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    color: #ffffff;
}

.nav-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-section-header {
    display: block;
    padding: 1.25rem 1.5rem 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: none;
    margin-top: 0.5rem;
    text-align: left;
    line-height: 1.2;
}

.nav-section-title {
    /* Deprecated - kept for backward compatibility */
    margin-left: 0;
}

.sidebar.collapsed .nav-text, 
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-section-header {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: flex-start !important;
    align-items: center;
    padding: 1rem 0.5rem;
    flex-direction: column;
    gap: 0.75rem;
    min-height: auto;
    display: flex !important;
    width: 100%;
}

.sidebar.collapsed .sidebar-toggle {
    margin-left: 0;
    margin-top: 0;
    position: static;
    order: 2;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar.collapsed .logo {
    order: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 !important;
    flex-direction: column !important;
    flex: 0 0 auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 36px !important;
}

/* Show only logo icon when collapsed, centered */
.sidebar.collapsed .logo-icon {
    margin-right: 0 !important;
    margin: 0 auto !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    border-radius: 8px;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 1 !important;
    background-color: transparent;
}

.sidebar.collapsed .logo-icon .logo-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 2 !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

.sidebar.collapsed .nav-link {
    padding: 0.75rem;
    justify-content: center;
}

.sidebar.collapsed .nav-section-header {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.6rem;
}

/* Improve collapsed sidebar visuals */
.sidebar.collapsed .nav-icon { margin-right: 0; }
.sidebar.collapsed .nav-link { border-left: 0; background: transparent; }
.sidebar.collapsed .nav-link:hover,
.sidebar.collapsed .nav-link.active { background-color: #005d99; border-radius: 8px; }
.sidebar.collapsed .nav-item.dropdown { 
    position: static !important; 
    overflow: visible !important;
    width: 100%;
}

.sidebar.collapsed .nav-item.dropdown.show {
    position: relative !important;
}

.sidebar.collapsed .nav-item.dropdown .dropdown-menu.sidebar-dropdown {
    left: calc(var(--sidebar-collapsed-width) + 8px) !important;
    top: auto !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
    min-width: 220px !important;
    max-width: 220px !important;
    width: 220px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border-radius: 8px !important;
    background-color: #ffffff !important;
    z-index: 1050 !important;
    position: fixed !important;
    display: block !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateX(-10px) !important;
    transition: all 0.3s ease !important;
    max-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
}

.sidebar.collapsed .nav-item.dropdown.show .dropdown-menu.sidebar-dropdown,
.sidebar.collapsed .nav-item.dropdown:hover .dropdown-menu.sidebar-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    max-height: 500px !important;
    padding: 8px 0 !important;
}
.sidebar.collapsed .sidebar-footer .user-info { display: none; }
.sidebar.collapsed .sidebar-footer { justify-content: center; padding: 0.75rem; }
.sidebar.collapsed .sidebar-footer .logout-icon-btn { margin: 0 auto; }
.sidebar.collapsed .sidebar-logout { width: 100%; display: flex; align-items: center; justify-content: center; margin-left: 0 !important; }
/* Force icon centering for all items when collapsed, including dropdown toggles */
.sidebar.collapsed .nav-link i,
.sidebar.collapsed .nav-icon {
    margin: 0 !important;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.sidebar.collapsed .nav-link.dropdown-toggle {
    justify-content: center !important;
    padding: 0.75rem !important;
}

.sidebar.collapsed .nav-link.dropdown-toggle::after {
    display: none !important;
}

/* Content Header */
.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
}

.content-header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    border: none;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Card Nav Tabs - Override sidebar nav-link styles */
.card .nav-tabs,
.card-header .nav-tabs {
    border-bottom: 1px solid var(--border-color);
    margin: 0;
}

.card .nav-tabs .nav-link,
.card-header .nav-tabs .nav-link {
    color: #6c757d !important;
    background-color: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 0.375rem 0.375rem 0 0 !important;
    padding: 0.75rem 1.25rem !important;
    margin: 0 !important;
    font-weight: 500;
}

.card .nav-tabs .nav-link:hover,
.card-header .nav-tabs .nav-link:hover {
    color: var(--primary-color) !important;
    background-color: transparent !important;
    border-color: #e9ecef #e9ecef var(--border-color) !important;
}

.card .nav-tabs .nav-link.active,
.card-header .nav-tabs .nav-link.active {
    color: var(--primary-color) !important;
    background-color: #fff !important;
    border-color: var(--border-color) var(--border-color) #fff !important;
}

.card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.card-body {
    padding: 1.5rem;
}

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

/* Stats Cards */
.stat-card {
    display: flex;
    align-items: center;
    padding: 1.25rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    background-color: rgba(23, 167, 74, 0.1);
    color: var(--secondary-color);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 0.475rem;
    padding: 0.5rem 1rem;
    transition: all 0.15s ease;
}

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

.btn-primary:hover {
    background-color: #004d80;
    border-color: #004d80;
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #12913d;
    border-color: #12913d;
}

.btn-light {
    background-color: #f5f8fa;
    border-color: #e4e6ef;
    color: #181c32;
}

.btn-light:hover {
    background-color: #e9edf1;
    border-color: #d6d9e1;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    margin-bottom: 0;
}

.table thead th {
    padding: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.02);
}

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

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Status Badges */
.badge {
    padding: 0.4em 0.7em;
    font-weight: 500;
    border-radius: 0.425rem;
}

.badge-success {
    background-color: rgba(23, 167, 74, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background-color: rgba(255, 199, 0, 0.1);
    color: var(--warning-color);
}

.badge-danger {
    background-color: rgba(241, 65, 108, 0.1);
    color: var(--danger-color);
}

.badge-info {
    background-color: rgba(114, 57, 234, 0.1);
    color: var(--info-color);
}

/* Forms */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.form-control {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.475rem;
    background-color: var(--card-bg);
    color: var(--text-color);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(0, 93, 153, 0.25);
}

.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group > .form-control {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
    background-color: #f5f8fa;
    border: 1px solid var(--border-color);
    border-radius: 0.475rem;
}

/* Calendar */
#calendar, #mini-calendar {
    max-width: 100%;
    margin: 0 auto;
}

.fc-toolbar-title {
    font-size: 1.25rem !important;
    font-weight: 600;
}

/* Mini Calendar Specific */
#mini-calendar .fc-toolbar-title {
    font-size: 1rem !important;
}

#mini-calendar .fc-daygrid-day {
    min-height: 35px;
}

#mini-calendar .fc-col-header-cell {
    padding: 4px;
}

#mini-calendar .fc-daygrid-day-number {
    font-size: 0.8rem;
    padding: 2px 4px;
}

#mini-calendar .fc-daygrid-event {
    margin-top: 1px;
    margin-bottom: 1px;
}

.fc .fc-button-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.fc .fc-button-primary:hover {
    background-color: #004d80;
    border-color: #004d80;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.fc .fc-button-active {
    background-color: #004d80 !important;
    border-color: #004d80 !important;
}

/* Button specifically for Today to match the image */
.fc .fc-today-button {
    background-color: #5698e8;
    border-color: #5698e8;
    border-radius: 1rem;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

/* Sidebar logout icon button - minimal and aligned */
.logout-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--text-muted);
    background: transparent;
    text-decoration: none;
}
.logout-icon-btn:hover {
    background: rgba(0,0,0,0.05);
    color: #dc3545;
}
.logout-icon-btn i {
    font-size: 16px;
    line-height: 1;
}

.fc .fc-prev-button, .fc .fc-next-button {
    width: 65px;
    height: 40px;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 20px;
    font-weight: bold;
    background-color: #005d99;
}

.fc .fc-prev-button:hover, .fc .fc-next-button:hover {
    background-color: #004d80;
    transform: scale(1.1);
}

.fc-event {
    cursor: pointer;
    border-radius: 0.25rem;
}

/* Responsive Calendar */
@media (max-width: 768px) {
    .fc .fc-toolbar {
        flex-direction: column;
        gap: 10px;
    }
    
    .fc .fc-toolbar-title {
        font-size: 1rem !important;
    }
    
    .fc .fc-button {
        padding: 0.2rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Notifications */
.notifications-icon {
    position: relative;
}

.notifications-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notifications-dropdown {
    min-width: 320px;
    padding: 0;
}

.notification-title {
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.notification-item {
    display: flex;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.notification-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.notification-icon {
    margin-right: 1rem;
    display: flex;
    align-items: flex-start;
}

.notification-content {
    flex: 1;
}

.notification-text {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.notification-footer {
    padding: 0.75rem 1.25rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        width: var(--sidebar-width);
        transform: translateX(-100%);
        z-index: 1000;
        height: 100vh;
        max-height: 100vh;
    }
    
    .sidebar.mobile-show {
        transform: translateX(0);
    }
    
    .sidebar-nav-container {
        max-height: calc(100vh - 140px);
    }
    
    .leave-balance-widget {
        padding: 0.75rem;
    }
    
    .widget-header {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }
    
    .balance-item {
        padding: 0.4rem 0;
    }
    
    .balance-type {
        font-size: 0.75rem;
    }
    
    .balance-days {
        font-size: 0.75rem;
    }
    
    .content-wrapper {
        margin-left: 0;
    }
    
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.3);
        z-index: 999;
        display: none;
    }
    
    .mobile-overlay.active {
        display: block;
    }
    
    .mobile-header {
        display: flex;
        align-items: center;
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
        background-color: var(--card-bg);
        position: sticky;
        top: 0;
        z-index: 99;
    }
    
    .mobile-menu-toggle {
        background: none;
        border: none;
        color: var(--text-muted);
        font-size: 1.5rem;
        cursor: pointer;
        margin-right: 1rem;
        padding: 0.5rem;
        border-radius: 0.375rem;
        transition: all 0.2s ease;
    }
    
    .mobile-menu-toggle:hover {
        background-color: var(--light-bg);
        color: var(--primary-color);
    }
    
    /* Mobile navigation improvements */
    .sidebar .nav-menu {
        padding: 0.5rem 0;
    }
    
    .sidebar .nav-item {
        margin: 0.125rem 0;
    }
    
    .sidebar .nav-link {
        padding: 0.75rem 1rem;
        margin: 0.125rem 0.5rem;
        border-radius: 0.5rem;
        font-size: 0.9rem;
    }
    
    .sidebar .nav-section-header {
        padding: 0.5rem 1rem;
        margin: 0.5rem 0.5rem 0.25rem 0.5rem;
        font-size: 0.75rem;
        text-align: left;
        display: block;
        color: #000000;
        font-weight: 700;
    }
    
    /* Mobile content improvements */
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
        border-radius: 0.75rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Mobile form improvements */
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Mobile table improvements */
    .table-responsive {
        border-radius: 0.5rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .table th, .table td {
        padding: 0.5rem 0.25rem;
        vertical-align: middle;
    }
    
    /* Mobile button groups */
    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-group-mobile .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Additional Mobile Responsive Breakpoints */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 0.5rem;
    }
    
    .mobile-header {
        padding: 0.5rem 0.75rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .card-header h3, .card-header h4, .card-header h5 {
        font-size: 1.1rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    /* Mobile table improvements */
    .table th, .table td {
        padding: 0.375rem 0.125rem;
        font-size: 0.8rem;
    }
    
    .table th.approval-column,
    .table td.approval-column {
        min-width: 150px;
        width: 150px;
    }
    
    /* Mobile form improvements */
    .form-label {
        font-size: 0.9rem;
        font-weight: 600;
    }
    
    .form-control, .form-select {
        font-size: 16px;
        padding: 0.625rem;
    }
    
    .btn {
        padding: 0.625rem 0.875rem;
        font-size: 0.85rem;
    }
    
    /* Mobile modal improvements */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 0.75rem;
    }
    
    .modal-header {
        padding: 1rem 0.75rem;
    }
    
    .modal-body {
        padding: 0.75rem;
    }
    
    .modal-footer {
        padding: 0.75rem;
    }
    
    /* Mobile navigation dropdown improvements */
    .sidebar .dropdown-menu.sidebar-dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 1000;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
        border: 1px solid rgba(0, 0, 0, 0.15);
        margin: 0;
        padding: 0.5rem 0;
        background: #fff;
        width: 100%;
        max-width: 100%;
        min-width: 200px;
    }
    
    .sidebar .nav-item.dropdown.show .dropdown-menu.sidebar-dropdown {
        max-height: 200px;
    }
    
    /* Mobile stats cards */
    .stats-card {
        margin-bottom: 0.75rem;
    }
    
    .stats-card .card-body {
        padding: 0.75rem;
    }
    
    .stats-number {
        font-size: 1.5rem;
    }
    
    .stats-label {
        font-size: 0.8rem;
    }
    
    /* Mobile calendar improvements */
    .fc-toolbar {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
        gap: 0.25rem;
    }
    
    .fc-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .fc-toolbar-title {
        font-size: 1.1rem !important;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .content-wrapper {
        padding: 0.25rem;
    }
    
    .mobile-header {
        padding: 0.5rem;
    }
    
    .page-title {
        font-size: 1.1rem;
    }
    
    .card {
        margin-bottom: 0.75rem;
    }
    
    .card-header {
        padding: 0.75rem;
    }
    
    .card-body {
        padding: 0.5rem;
    }
    
    .table th, .table td {
        padding: 0.25rem 0.125rem;
        font-size: 0.75rem;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .form-control, .form-select {
        padding: 0.5rem;
        font-size: 16px;
    }
    
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100% - 0.5rem);
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding: 0.5rem;
    }
    
    .stats-number {
        font-size: 1.25rem;
    }
    
    .stats-label {
        font-size: 0.75rem;
    }
    
    .fc-toolbar-title {
        font-size: 1rem !important;
    }
    
    .fc-button {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }
}

@media (min-width: 992px) {
    .mobile-header {
        display: none;
    }
}

/* Table Styles */
.table th.approval-column,
.table td.approval-column {
    min-width: 200px;
    width: 200px;
}

/* Helper Classes */
.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-info { color: var(--info-color) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-light { background-color: var(--light-bg) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.bg-secondary { background-color: var(--secondary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-info { background-color: var(--info-color) !important; }

.font-weight-bold { font-weight: 600 !important; }
.rounded { border-radius: 0.475rem !important; }

/* Avatar Styles for User Display */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #f5f8fa;
    overflow: hidden;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initial {
    font-weight: 600;
    color: #ffffff;
    background-color: var(--primary-color);
}

/* Page Loader */
/* Page Loader Styles */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(245, 248, 250, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.page-loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.page-loader-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.page-loader-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-loader-logo img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.page-loader-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: pageLoaderSpin 1s linear infinite;
    z-index: 1;
    transform-origin: center center;
}

@keyframes pageLoaderSpin {
    0% { 
        transform: translate(-50%, -50%) rotate(0deg); 
    }
    100% { 
        transform: translate(-50%, -50%) rotate(360deg); 
    }
}

/* Hide page loader when content is loaded */
.page-loaded .page-loader {
    display: none;
}

/* Sync Status Indicator removed as requested */

/* Sidebar Dropdown Styles */
.sidebar .nav-item.dropdown {
    position: relative;
    margin-bottom: 0;
}

.sidebar .nav-link.dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 2px 8px;
    position: relative;
    z-index: 10;
}

.sidebar .nav-link.dropdown-toggle:hover {
    background-color: rgba(0, 93, 153, 0.1);
    color: var(--primary-color);
}

.sidebar .nav-link.dropdown-toggle.active {
    background-color: var(--primary-color);
    color: white;
}

/* Dropdown arrow removed - no longer needed */

.sidebar .dropdown-menu.sidebar-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    margin: 4px 8px 0 8px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    min-width: calc(100% - 16px);
}

.sidebar .nav-item.dropdown.show .dropdown-menu.sidebar-dropdown {
    max-height: 300px;
    opacity: 1;
    transform: translateY(0);
}

.sidebar .dropdown-menu.sidebar-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    white-space: nowrap;
}

.sidebar.collapsed .dropdown-menu.sidebar-dropdown .dropdown-item {
    padding: 10px 16px;
    color: #374151 !important;
}

.sidebar.collapsed .dropdown-menu.sidebar-dropdown .dropdown-item:hover {
    background-color: rgba(0, 93, 153, 0.1) !important;
    color: #005d99 !important;
}

.sidebar.collapsed .dropdown-menu.sidebar-dropdown .dropdown-item i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    color: #6c757d;
}

.sidebar.collapsed .dropdown-menu.sidebar-dropdown .dropdown-item:hover i {
    color: #005d99;
}

.sidebar.collapsed .dropdown-menu.sidebar-dropdown .dropdown-divider {
    margin: 8px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar .dropdown-menu.sidebar-dropdown .dropdown-item:hover {
    background-color: rgba(0, 93, 153, 0.1);
    color: var(--primary-color);
}

.sidebar .dropdown-menu.sidebar-dropdown .dropdown-item i {
    width: 20px;
    text-align: center;
    margin-right: 12px;
    font-size: 14px;
}

/* Sidebar content shift animation */
.sidebar .nav-menu {
    transition: all 0.3s ease;
}

.sidebar .nav-item.dropdown.show ~ .nav-item {
    transform: translateY(0);
    transition: transform 0.3s ease;
}

/* Ensure proper spacing for dropdown */
.sidebar .nav-item.dropdown.show {
    margin-bottom: 8px;
}

/* Dark mode support for sidebar dropdowns */
.dark-mode .sidebar .nav-link.dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .sidebar .dropdown-menu.sidebar-dropdown .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .sidebar .dropdown-menu.sidebar-dropdown {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

/* Dark mode scrollbar styling */
.dark-mode .sidebar-nav-container::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
}

.dark-mode .sidebar-nav-container::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

/* Dark mode support for leave balance widget */
.dark-mode .leave-balance-widget {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

.dark-mode .widget-header {
    color: var(--primary-color);
}

.dark-mode .balance-type {
    color: var(--text-color);
}

.dark-mode .balance-remaining {
    color: var(--success-color);
}

.dark-mode .balance-total {
    color: var(--text-muted);
}

.dark-mode .balance-used {
    color: var(--danger-color);
}

.dark-mode .balance-progress {
    background-color: var(--border-color);
}

/* Ensure dropdown doesn't cause horizontal scroll */
.sidebar .nav-menu {
    overflow-x: hidden;
    overflow-y: visible;
    width: 100%;
}

/* Smooth transitions for all nav items */
.sidebar .nav-item {
    transition: all 0.3s ease;
}

/* Dropdown positioning adjustments */
.sidebar .nav-item.dropdown {
    overflow: visible;
}

.sidebar .dropdown-menu.sidebar-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 8px;
    right: 8px;
    width: auto;
    min-width: calc(100% - 16px);
    max-width: calc(100% - 16px);
}

/* Ensure proper z-index stacking */
.sidebar .nav-item.dropdown.show {
    z-index: 1000;
}

.sidebar .nav-item.dropdown.show .dropdown-menu.sidebar-dropdown {
    z-index: 1001;
}

/* Sidebar footer styling for both implementations */
.sb-sidenav-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    flex-shrink: 0;
    background-color: var(--card-bg);
    margin-top: auto;
}

/* Leave Balance Widget */
.leave-balance-widget {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--card-bg);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    margin-top: auto;
}

.widget-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.widget-header i {
    margin-right: 0.5rem;
    font-size: 1rem;
}

.widget-title {
    font-size: 0.9rem;
}

.widget-content {
    font-size: 0.8rem;
}

.balance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.balance-type {
    font-weight: 500;
    color: var(--text-color);
    flex: 1;
}

.balance-days {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.balance-remaining {
    font-weight: 600;
    color: var(--success-color);
}

.balance-total {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.balance-used {
    color: var(--danger-color);
    font-size: 0.75rem;
}

.balance-progress {
    width: 100%;
    height: 4px;
    background-color: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.25rem;
}

.balance-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), var(--warning-color));
    border-radius: 2px;
    transition: width 0.3s ease;
}

.balance-progress-bar.low {
    background: linear-gradient(90deg, var(--danger-color), var(--warning-color));
}

.balance-progress-bar.medium {
    background: linear-gradient(90deg, var(--warning-color), var(--success-color));
}

.balance-progress-bar.high {
    background: var(--success-color);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: #ffffff;
    flex-shrink: 0;
    background-color: #1f2937;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.sidebar-footer-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
}

.sidebar-footer-name {
    color: #ffffff;
    font-size: 0.875rem;
}

.logout-icon-btn {
    color: #ffffff;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-icon-btn:hover {
    color: #ffffff;
    background-color: rgba(0, 93, 153, 0.2);
}

/* Button Group Styling */
.btn-group .btn {
    text-decoration: none !important;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.btn-group .btn:hover {
    background-color: var(--light-bg);
    border-color: var(--primary-color);
    text-decoration: none !important;
}

.btn-group .btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    text-decoration: none !important;
}

.btn-group .btn.active:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none !important;
}

/* Ensure no underlines on any buttons */
.btn, .btn-group .btn, .btn-group a {
    text-decoration: none !important;
}

.btn:hover, .btn-group .btn:hover, .btn-group a:hover {
    text-decoration: none !important;
}

/* Leave Balance Widget Styling */
.leave-balance-widget {
    background-color: var(--card-bg) !important;
    border-top: 1px solid var(--border-color) !important;
    padding: 1rem !important;
    flex-shrink: 0 !important;
    margin-top: auto !important;
    z-index: 10;
}

.leave-balance-widget .small {
    color: var(--text-muted) !important;
    font-weight: 600 !important;
}

.leave-balance-widget .badge {
    font-size: 0.75rem !important;
    padding: 0.25rem 0.5rem !important;
}

.leave-balance-widget .spinner-border-sm {
    width: 1rem !important;
    height: 1rem !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .sidebar .dropdown-menu.sidebar-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        margin: 0;
        border-radius: 0;
        background-color: transparent;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .sidebar .nav-item.dropdown.show .dropdown-menu.sidebar-dropdown {
        max-height: 200px;
    }
    
    .sidebar .nav-item.dropdown.show {
        margin-bottom: 0;
    }
}

/* ========================================
   ENHANCED EMPLOYEE SIDEBAR STYLING
   ======================================== */

/* Enhanced Employee Sidebar Styling */
.sb-sidenav {
    background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 50%, #1d4ed8 100%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    border-right: none;
}

.sb-sidenav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.875rem 1.5rem;
    margin: 0.25rem 0.75rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.sb-sidenav .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.sb-sidenav .nav-link:hover::before {
    left: 100%;
}

.sb-sidenav .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.sb-sidenav .nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border-left: 4px solid #fbbf24;
}

.sb-sidenav .nav-link i {
    width: 20px;
    text-align: center;
    margin-right: 12px;
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.sb-sidenav .nav-link:hover i {
    transform: scale(1.1);
}

.sb-sidenav .nav-link.active i {
    color: #fbbf24;
}

/* Enhanced Leave Balance Widget for Employees */
.leave-balance-widget {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    margin: 1rem 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.leave-balance-widget:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.leave-balance-widget .small {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.leave-balance-widget .small i {
    margin-right: 8px;
    color: #fbbf24;
}

.leave-balance-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.leave-balance-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(3px);
}

.leave-balance-item:last-child {
    margin-bottom: 0;
}

.leave-balance-item .d-flex {
    align-items: center;
    justify-content: space-between;
}

.leave-balance-item .badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    font-weight: 600;
}

.leave-balance-item .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.8rem;
    font-weight: 500;
}

.leave-balance-item .fw-bold {
    color: white !important;
    font-size: 0.9rem;
}

/* Enhanced Footer for Employees */
.sb-sidenav-footer {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    padding: 1.25rem;
    text-align: center;
    flex-shrink: 0;
    margin-top: auto;
    backdrop-filter: blur(10px);
}

.sb-sidenav-footer .small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: block;
}

.sb-sidenav-footer .fw-bold {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Sidebar section headings */
.sb-sidenav-menu-heading {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 1.5rem 0.5rem;
    margin: 1rem 0.75rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sb-sidenav-menu-heading:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0.5rem;
}

/* Loading state for leave balance */
.leave-balance-widget .spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
    color: #fbbf24;
}

/* Empty state for leave balance */
.leave-balance-widget .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 0.8rem;
}

/* Responsive adjustments for employee sidebar */
@media (max-width: 768px) {
    .sb-sidenav .nav-link {
        margin: 0.125rem 0.5rem;
        padding: 0.75rem 1rem;
    }
    
    .leave-balance-widget {
        margin: 0.75rem 0.5rem;
        padding: 1rem;
    }
}
