/* ============================================================================
 * Enterprise HRMS & Payroll - Ultra Premium Glassy White & Electric Blue Theme
 * Windows 11 Acrylic Layout & Apple macOS Minimalist Aesthetic
 * ============================================================================ */

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

:root {
    /* Light Mode Tokens */
    --bg-main: #f0f6ff;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-glass-card: rgba(255, 255, 255, 0.94);
    --border-glass: rgba(219, 234, 254, 0.95);
    --shadow-glass: 0 12px 36px -5px rgba(37, 99, 235, 0.1), 0 4px 14px rgba(37, 99, 235, 0.05);
    --text-primary: #0f172a;
    --text-secondary: #1e293b;
    --text-muted: #64748b;
    --accent-primary: #2563eb;
    --accent-secondary: #06b6d4;
    --accent-gradient: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    --card-hover-border: rgba(37, 99, 235, 0.5);
    --sidebar-bg: rgba(255, 255, 255, 0.95);
    --input-bg: rgba(239, 246, 255, 0.9);
    --table-header-bg: rgba(239, 246, 255, 0.95);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    width: 100vw;
}

/* Background Ambient Lighting Blobs */
.bg-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(130px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.35;
    animation: blobFloat 18s ease-in-out infinite alternate;
}

.bg-blob-1 {
    top: -120px;
    left: -100px;
    width: 550px;
    height: 550px;
    background: #2563eb;
}

.bg-blob-2 {
    bottom: -150px;
    right: -100px;
    width: 600px;
    height: 600px;
    background: #06b6d4;
    animation-delay: -9s;
}

@keyframes blobFloat {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -30px) scale(1.08); }
    100% { transform: translate(-30px, 40px) scale(0.95); }
}

/* Glass Card Container */
.glass-card {
    background: var(--bg-glass-card);
    backdrop-filter: blur(22px) saturate(190%);
    -webkit-backdrop-filter: blur(22px) saturate(190%);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    box-shadow: var(--shadow-glass);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    max-width: 100%;
}

.glass-card:hover {
    border-color: var(--card-hover-border);
    box-shadow: 0 16px 48px rgba(37, 99, 235, 0.2);
}

/* App Wrapper Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 2;
    width: 100%;
    overflow-x: hidden;
}

.sidebar {
    width: 270px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(24px);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main Content Area */
.main-content {
    margin-left: 270px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 28px;
    min-width: 0;
    max-width: calc(100% - 270px);
    overflow-x: hidden;
}

/* Brand & Logo */
.brand-logo {
    padding: 22px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-glass);
    letter-spacing: -0.5px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: var(--accent-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

/* Navigation Links */
.nav-menu {
    list-style: none;
    padding: 18px 14px;
    flex: 1;
    overflow-y: auto;
}

.nav-label {
    padding: 14px 16px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.8px;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: rgba(37, 99, 235, 0.12);
    color: var(--accent-primary);
    transform: translateX(3px);
}

.nav-link.active {
    background: var(--accent-gradient);
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.nav-link i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
}

/* Top Navbar Header */
.top-navbar {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    padding: 14px 28px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-glass);
    position: relative;
    z-index: 1050 !important;
    width: 100%;
}

.topnav-title, .topnav-user-name {
    color: var(--text-primary) !important;
    transition: color 0.3s ease;
}

/* Dropdown Menu Theme Adapting Styling */
.dropdown-menu {
    background: var(--bg-glass-card) !important;
    backdrop-filter: blur(22px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(22px) saturate(190%) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-glass) !important;
    padding: 12px !important;
    z-index: 1060 !important;
    margin-top: 10px !important;
}

/* Mega Menu Custom Responsive Layout */
.mega-menu-dropdown {
    width: 550px !important;
    max-width: calc(100vw - 40px) !important;
    left: 0 !important;
    right: auto !important;
}

.dropdown-item {
    color: var(--text-primary) !important;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 9px 14px !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
    display: flex;
    align-items: center;
}

.dropdown-item:hover, .dropdown-item:focus {
    background: rgba(37, 99, 235, 0.12) !important;
    color: var(--accent-primary) !important;
    transform: translateX(3px);
}

.theme-toggle-btn {
    background: var(--bg-glass-card);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.theme-toggle-btn:hover {
    background: var(--accent-primary);
    color: white;
    transform: rotate(15deg);
}

/* User Avatar & Badge */
.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px;
    border-radius: 14px;
    transition: background 0.2s ease;
}

.user-profile-badge:hover {
    background: rgba(37, 99, 235, 0.1);
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid var(--accent-primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Metric Cards */
.metric-card {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: white;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.metric-card:hover .metric-icon {
    transform: scale(1.08) rotate(5deg);
}

.icon-purple { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.icon-blue { background: linear-gradient(135deg, #0284c7, #0369a1); }
.icon-green { background: linear-gradient(135deg, #10b981, #047857); }
.icon-amber { background: linear-gradient(135deg, #f59e0b, #b45309); }
.icon-rose { background: linear-gradient(135deg, #f43f5e, #be123c); }

.metric-val {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 4px;
    letter-spacing: -1px;
}

/* Responsive Table Wrapper */
.table-responsive, .dataTables_wrapper {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

/* Custom DataTables Styling */
.table-glass {
    color: var(--text-primary) !important;
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 6px !important;
}

.table-glass th {
    background: var(--table-header-bg) !important;
    color: var(--text-primary) !important;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-glass) !important;
    padding: 14px 18px !important;
    white-space: nowrap;
}

.table-glass td {
    background: var(--bg-glass-card);
    border-top: 1px solid var(--border-glass) !important;
    border-bottom: 1px solid var(--border-glass) !important;
    padding: 14px 18px !important;
    vertical-align: middle;
    color: var(--text-primary) !important;
    white-space: nowrap;
}

.table-glass tr td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    border-left: 1px solid var(--border-glass);
}

.table-glass tr td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    border-right: 1px solid var(--border-glass);
}

/* Status Badges */
.badge-glass {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-success { background: rgba(16, 185, 129, 0.18); color: #10b981 !important; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-warning { background: rgba(245, 158, 11, 0.18); color: #f59e0b !important; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-danger { background: rgba(244, 63, 94, 0.18); color: #f43f5e !important; border: 1px solid rgba(244, 63, 94, 0.4); }
.badge-info { background: rgba(37, 99, 235, 0.18); color: #2563eb !important; border: 1px solid rgba(37, 99, 235, 0.4); }
.badge-secondary { background: rgba(100, 116, 139, 0.18); color: #64748b !important; border: 1px solid rgba(100, 116, 139, 0.4); }
.badge-dark { background: rgba(30, 41, 59, 0.22); color: #1e293b !important; border: 1px solid rgba(30, 41, 59, 0.4); }

/* Buttons */
.btn-glass {
    background: var(--accent-gradient);
    color: white !important;
    border: none;
    border-radius: 12px;
    padding: 10px 22px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-glass:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.55);
    color: white !important;
}

/* Forms & Professional Inputs */
.form-control, .form-select {
    background-color: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: 12px !important;
    padding: 10px 14px !important;
    transition: all 0.2s ease !important;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25) !important;
}

/* Responsive Mobile Layout */
@media (max-width: 991px) {
    .sidebar {
        margin-left: -270px;
    }
    .sidebar.active {
        margin-left: 0;
    }
    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 16px;
    }
}
