/* =============================================================
   HRMS Portal – Premium CSS Theme
   Glassmorphism · Gradients · Dark Mode · Micro-animations
   ============================================================= */

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

/* ─── CSS Variables ──────────────────────────────────────────── */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --secondary: #0ea5e9;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;

    /* Gradients */
    --grad-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --grad-secondary: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    --grad-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --grad-danger: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    --grad-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --grad-dark: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
    --grad-sidebar: linear-gradient(180deg, #0f0c29 0%, #1a1a2e 30%, #16213e 100%);

    /* Light mode */
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 4px 24px rgba(99, 102, 241, 0.08);
    --shadow-lg: 0 20px 60px rgba(99, 102, 241, 0.15);

    /* Glass */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px rgba(99, 102, 241, 0.12);

    --sidebar-width: 260px;
    --header-height: 64px;
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Dark Mode Variables ─────────────────────────────────────── */
[data-theme="dark"] {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #020617;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* ─── Reset & Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* ─── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--grad-sidebar);
    z-index: 1000;
    overflow-y: scroll !important;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    transition: var(--transition);
    border-right: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    scrollbar-width: auto;
    scrollbar-color: #8b5cf6 #0f172a;
}

body.sidebar-collapsed {
    --sidebar-width: 0px;
}
body.sidebar-collapsed .sidebar {
    transform: translateX(-260px);
}

/* High-contrast, easily visible scrollbar for Webkit/Blink browsers */
.sidebar::-webkit-scrollbar {
    width: 10px !important;
    display: block !important;
}
.sidebar::-webkit-scrollbar-track {
    background: #0f172a !important;
    border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.sidebar::-webkit-scrollbar-thumb {
    background: #8b5cf6 !important;
    background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%) !important;
    border-radius: 6px !important;
    border: 2px solid #0f172a !important;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #4f46e5 0%, #7c3aed 100%) !important;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.8) !important;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-decoration: none;
}

.sidebar-brand .brand-icon {
    width: 42px; height: 42px;
    background: var(--grad-primary);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: white;
    box-shadow: 0 4px 12px rgba(99,102,241,0.5);
}

.sidebar-brand .brand-text { font-family: 'Outfit', sans-serif; }
.sidebar-brand .brand-text h6 {
    color: #fff; font-size: 14px; font-weight: 700; letter-spacing: 0.5px;
    line-height: 1.2;
}
.sidebar-brand .brand-text small {
    color: rgba(255,255,255,0.4); font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
}

.sidebar-section-label {
    padding: 16px 20px 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.25);
}

.sidebar-nav { list-style: none; padding: 8px 12px; }
.sidebar-nav .nav-item { margin: 2px 0; }

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.sidebar-nav .nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--grad-primary);
    opacity: 0;
    border-radius: 10px;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar-nav .nav-link:hover, .sidebar-nav .nav-link.active {
    color: #fff;
}

.sidebar-nav .nav-link:hover::before { opacity: 0.15; }
.sidebar-nav .nav-link.active::before { opacity: 1; }

.sidebar-nav .nav-link .nav-icon {
    font-size: 16px;
    width: 20px; text-align: center;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.sidebar-nav .nav-link .nav-text { position: relative; z-index: 1; flex: 1; }

.sidebar-nav .nav-link .nav-badge {
    position: relative; z-index: 1;
    background: var(--danger);
    color: white;
    font-size: 10px; font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    line-height: 1;
}

.sidebar-sub-link {
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}
.sidebar-sub-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}
.sidebar-sub-link.active {
    color: #ffffff !important;
    background: var(--grad-primary, linear-gradient(135deg, #6366f1, #a855f7)) !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

/* ─── Main Content ────────────────────────────────────────────── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

/* ─── Top Header ──────────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 999;
    box-shadow: 0 4px 24px rgba(0,0,0,0.04);
}

.topbar-left { display: flex; align-items: center; gap: 12px; }

.sidebar-toggle {
    width: 36px; height: 36px;
    border: none;
    background: var(--bg-card);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    font-size: 18px;
}
.sidebar-toggle:hover { background: var(--primary); color: white; }

.topbar-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }

.topbar-right { display: flex; align-items: center; gap: 8px; }

.topbar-btn {
    width: 38px; height: 38px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 16px;
    position: relative;
    transition: var(--transition);
    text-decoration: none;
}
.topbar-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }

.notification-badge {
    position: absolute;
    top: -4px; right: -4px;
    width: 18px; height: 18px;
    background: var(--danger);
    border-radius: 50%;
    font-size: 10px; font-weight: 700;
    color: white;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--bg-main);
}

.user-avatar {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--grad-primary);
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}
.user-avatar:hover { border-color: var(--primary); transform: scale(1.05); }

/* ─── Page Content ────────────────────────────────────────────── */
.page-content { padding: 24px; }

.page-header {
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 26px; font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.page-header p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ─── Cards ───────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.card-header {
    padding: 20px 24px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
}

.card-title {
    font-size: 15px; font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.card-body { padding: 20px 24px; }

/* ─── KPI Stat Cards ──────────────────────────────────────────── */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 120px; height: 120px;
    border-radius: 50%;
    opacity: 0.08;
    background: var(--grad-primary);
}

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

.stat-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: white;
    flex-shrink: 0;
}

.stat-icon.purple { background: var(--grad-primary); box-shadow: 0 8px 20px rgba(99,102,241,0.35); }
.stat-icon.blue { background: var(--grad-secondary); box-shadow: 0 8px 20px rgba(14,165,233,0.35); }
.stat-icon.green { background: var(--grad-success); box-shadow: 0 8px 20px rgba(16,185,129,0.35); }
.stat-icon.orange { background: var(--grad-warning); box-shadow: 0 8px 20px rgba(245,158,11,0.35); }
.stat-icon.red { background: var(--grad-danger); box-shadow: 0 8px 20px rgba(239,68,68,0.35); }

.stat-info { flex: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text-primary); font-family: 'Outfit', sans-serif; line-height: 1.2; }
.stat-change {
    font-size: 12px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 20px;
    margin-top: 4px;
}
.stat-change.up { background: rgba(16,185,129,0.1); color: var(--success); }
.stat-change.down { background: rgba(239,68,68,0.1); color: var(--danger); }

/* ─── Glassmorphism Card ──────────────────────────────────────── */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--glass-shadow);
}

/* ─── Gradient Banners ────────────────────────────────────────── */
.gradient-banner {
    background: var(--grad-primary);
    border-radius: var(--border-radius);
    padding: 32px;
    color: white;
    position: relative;
    overflow: hidden;
}
.gradient-banner::before {
    content: '';
    position: absolute;
    top: -40%; right: -10%;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
    border-radius: 10px;
    font-weight: 600;
    font-size: 13.5px;
    padding: 9px 20px;
    transition: var(--transition);
    border: none;
    display: inline-flex; align-items: center; gap: 6px;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: var(--grad-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99,102,241,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(99,102,241,0.5); color: white; }

.btn-secondary {
    background: var(--grad-secondary);
    color: white;
    box-shadow: 0 4px 15px rgba(14,165,233,0.35);
}
.btn-secondary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(14,165,233,0.5); color: white; }

.btn-success {
    background: var(--grad-success);
    color: white;
    box-shadow: 0 4px 15px rgba(16,185,129,0.3);
}
.btn-success:hover { transform: translateY(-2px); color: white; }

.btn-danger {
    background: var(--grad-danger);
    color: white;
    box-shadow: 0 4px 15px rgba(239,68,68,0.3);
}
.btn-danger:hover { transform: translateY(-2px); color: white; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: rgba(99,102,241,0.05); }

.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }

/* ─── Badges ──────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.3px;
}
.badge-primary { background: rgba(99,102,241,0.12); color: var(--primary); }
.badge-success { background: rgba(16,185,129,0.12); color: var(--success); }
.badge-danger { background: rgba(239,68,68,0.12); color: var(--danger); }
.badge-warning { background: rgba(245,158,11,0.12); color: var(--warning); }
.badge-info { background: rgba(6,182,212,0.12); color: var(--info); }
.badge-secondary { background: rgba(100,116,139,0.12); color: var(--text-secondary); }

/* ─── Tables & Bootstrap Compatibility ────────────────────────── */
.table-wrapper, .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--border-radius);
    width: 100%;
}

.data-table,
.table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 13.5px;
    margin-bottom: 0;
    color: var(--text-primary);
}

.data-table thead th,
.table thead th,
.table th {
    background: rgba(99,102,241,0.05) !important;
    color: var(--text-muted) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 12px 18px !important;
    border-bottom: 1px solid var(--border) !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
}

.table thead.table-light th {
    background: var(--bg-muted, #f8fafc) !important;
}

.data-table tbody tr,
.table tbody tr {
    border-bottom: 1px solid var(--border) !important;
    transition: background 0.15s ease;
}

.data-table tbody tr:hover,
.table tbody tr:hover,
.table-hover tbody tr:hover {
    background: rgba(99,102,241,0.03) !important;
}

.data-table tbody td,
.table tbody td,
.table td {
    padding: 14px 18px !important;
    color: var(--text-primary) !important;
    vertical-align: middle !important;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid var(--border) !important;
}

.table-sm th,
.table-sm td {
    padding: 8px 12px !important;
}

.data-table tbody tr:last-child,
.table tbody tr:last-child {
    border-bottom: none !important;
}

/* ─── Dropdowns & Action Menus ────────────────────────────────── */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    z-index: 1050 !important;
    display: none !important;
    min-width: 170px !important;
    padding: 6px 0 !important;
    margin: 4px 0 0 !important;
    font-size: 13px !important;
    color: var(--text-primary) !important;
    text-align: left !important;
    list-style: none !important;
    background-color: var(--bg-card, #ffffff) !important;
    background-clip: padding-box !important;
    border: 1px solid var(--border, #e2e8f0) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}

.dropdown-menu.show {
    display: block !important;
}

.dropdown-menu.dropdown-menu-end {
    right: 0 !important;
    left: auto !important;
}

.dropdown-menu.dropdown-menu-start {
    left: 0 !important;
    right: auto !important;
}

ul.dropdown-menu,
ol.dropdown-menu {
    list-style: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
    margin-bottom: 0 !important;
}

.dropdown-menu li {
    list-style: none !important;
    list-style-type: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 16px;
    clear: both;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
    text-align: inherit;
    text-decoration: none !important;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(99, 102, 241, 0.08);
    color: var(--primary);
}

.dropdown-item.text-danger:hover {
    background-color: rgba(239, 68, 68, 0.08);
    color: var(--danger);
}

.dropdown-divider {
    height: 0;
    margin: 6px 0;
    overflow: hidden;
    border-top: 1px solid var(--border);
}

.dropdown-menu form {
    margin: 0;
    padding: 0;
}

.dropdown-menu form button.dropdown-item {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    text-align: left;
    display: flex;
    align-items: center;
}

/* ─── Button Groups ───────────────────────────────────────────── */
.btn-group {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
}

.btn-group > .btn {
    position: relative;
    flex: 1 1 auto;
    border-radius: 0;
}

.btn-group > .btn:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.btn-group > .btn:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.btn-group-sm > .btn {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-light {
    background: var(--bg-muted, #f1f5f9);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-light:hover {
    background: rgba(99,102,241,0.08);
    color: var(--primary);
}

/* ─── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block; margin-bottom: 6px;
    font-size: 13px; font-weight: 600;
    color: var(--text-secondary);
}

.form-control, .form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    outline: none;
    appearance: none;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.input-group {
    display: flex;
    gap: 0;
}
.input-group .form-control { border-radius: 10px 0 0 10px; }
.input-group .input-group-btn { border-radius: 0 10px 10px 0; }

/* ─── Kanban Board ────────────────────────────────────────────── */
.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: 400px;
}

.kanban-col {
    flex: 0 0 280px;
    background: rgba(99,102,241,0.04);
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    padding: 16px;
}

.kanban-col-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}
.kanban-col-header h6 { font-size: 13px; font-weight: 700; color: var(--text-primary); margin: 0; }
.kanban-col-count {
    background: var(--primary);
    color: white;
    font-size: 11px; font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}

.kanban-card {
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 14px;
    margin-bottom: 10px;
    cursor: grab;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.kanban-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.kanban-card h6 { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }
.kanban-card p { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }

/* ─── Timeline / Attendance ───────────────────────────────────── */
.timeline { position: relative; }
.timeline::before {
    content: '';
    position: absolute;
    left: 20px; top: 0; bottom: 0;
    width: 2px;
    background: var(--grad-primary);
    opacity: 0.3;
}
.timeline-item {
    display: flex;
    gap: 16px;
    padding-bottom: 20px;
    position: relative;
}
.timeline-dot {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--grad-primary);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 16px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}
.timeline-content { flex: 1; padding-top: 8px; }

/* ─── Attendance Clock Widget ─────────────────────────────────── */
.clock-widget {
    background: var(--grad-primary);
    border-radius: var(--border-radius);
    padding: 32px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}
.clock-time {
    font-family: 'Outfit', sans-serif;
    font-size: 52px; font-weight: 800;
    letter-spacing: 2px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.clock-date { font-size: 14px; opacity: 0.75; margin-bottom: 24px; }
.clock-status {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.15);
    padding: 6px 16px; border-radius: 20px;
    font-size: 13px; font-weight: 600; margin-bottom: 20px;
}
.clock-status .dot {
    width: 8px; height: 8px; border-radius: 50%;
    animation: pulse 1.5s infinite;
}
.dot.working { background: #4ade80; }
.dot.paused { background: #fbbf24; }
.dot.clocked-out { background: #94a3b8; }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.8); }
}

/* ─── Invoice Template ────────────────────────────────────────── */
.invoice-page {
    background: white;
    max-width: 860px;
    margin: 0 auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.invoice-header {
    background: var(--grad-primary);
    padding: 40px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.invoice-company-name { font-family: 'Outfit', sans-serif; font-size: 24px; font-weight: 800; }
.invoice-type-badge {
    background: rgba(255,255,255,0.2);
    padding: 6px 20px; border-radius: 6px;
    font-size: 13px; font-weight: 700;
    letter-spacing: 2px; text-transform: uppercase;
}
.invoice-body { padding: 40px; }
.invoice-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.invoice-meta-label { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.8px; }
.invoice-meta-value { font-size: 15px; font-weight: 600; color: #1e293b; margin-top: 4px; }
.invoice-table { width: 100%; border-collapse: collapse; margin-bottom: 32px; }
.invoice-table thead th {
    background: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-size: 11px; font-weight: 700;
    letter-spacing: 0.8px; text-transform: uppercase;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}
.invoice-table tbody td { padding: 14px 16px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.invoice-totals { display: grid; grid-template-columns: 1fr 260px; gap: 32px; }
.invoice-total-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 14px; color: #475569; }
.invoice-total-row.total-final {
    border-top: 2px solid #e2e8f0;
    margin-top: 8px; padding-top: 12px;
    font-size: 18px; font-weight: 800; color: #1e293b;
}
.invoice-footer { background: #f8fafc; padding: 24px 40px; border-top: 1px solid #e2e8f0; font-size: 12px; color: #94a3b8; }

/* ─── Calendar ────────────────────────────────────────────────── */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.calendar-day-header {
    text-align: center;
    padding: 8px;
    font-size: 11px; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase;
}
.calendar-cell {
    min-height: 80px;
    border-radius: 8px;
    padding: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: var(--transition);
    position: relative;
}
.calendar-cell:hover { border-color: var(--primary); background: rgba(99,102,241,0.03); }
.calendar-cell.today { border-color: var(--primary); background: rgba(99,102,241,0.06); }
.calendar-cell.today .cell-day { background: var(--primary); color: white; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.calendar-cell.other-month { opacity: 0.35; }
.calendar-cell.holiday { background: rgba(239,68,68,0.05); border-color: rgba(239,68,68,0.2); }
.cell-day { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.cell-event { font-size: 10px; padding: 2px 6px; border-radius: 4px; margin-top: 2px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Progress Bars ───────────────────────────────────────────── */
.progress-bar { height: 6px; background: var(--border); border-radius: 10px; overflow: hidden; }
.progress-fill {
    height: 100%; border-radius: 10px;
    background: var(--grad-primary);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Login Page ──────────────────────────────────────────────── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    background: #0f172a;
    position: relative;
    overflow: hidden;
}
.auth-bg-left {
    flex: 1;
    background: var(--grad-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}
.auth-bg-left::before {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: rgba(99,102,241,0.15);
    top: -100px; left: -100px;
}
.auth-bg-left::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(168,85,247,0.1);
    bottom: -50px; right: -50px;
}
.auth-form-panel {
    width: 480px;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
}
.auth-box { width: 100%; }
.auth-logo {
    width: 52px; height: 52px;
    background: var(--grad-primary);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: white;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(99,102,241,0.5);
}
.auth-title {
    font-family: 'Outfit', sans-serif;
    font-size: 28px; font-weight: 800; color: white;
    margin-bottom: 8px;
}
.auth-subtitle { font-size: 14px; color: rgba(255,255,255,0.4); margin-bottom: 32px; }
.auth-form .form-control {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
    color: white;
}
.auth-form .form-control:focus {
    background: rgba(255,255,255,0.08);
    border-color: var(--primary);
}
.auth-form .form-control::placeholder { color: rgba(255,255,255,0.25); }
.auth-form .form-label { color: rgba(255,255,255,0.6); }

/* ─── Alert / Toast ───────────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 80px; right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex; align-items: center; gap: 12px;
    box-shadow: var(--shadow-lg);
    font-size: 13.5px; font-weight: 500;
    animation: slideInRight 0.3s ease;
    min-width: 280px;
}
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ─── Dark Mode Toggle ────────────────────────────────────────── */
.theme-toggle {
    width: 44px; height: 24px;
    background: var(--border);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
}
.theme-toggle.active { background: var(--primary); }
.theme-toggle-knob {
    position: absolute;
    top: 2px; left: 2px;
    width: 20px; height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.theme-toggle.active .theme-toggle-knob { transform: translateX(20px); }

/* ─── Payslip Print Styles ────────────────────────────────────── */
.payslip-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
}
.payslip-header {
    background: var(--grad-primary);
    padding: 32px 40px;
    color: white;
    display: flex; justify-content: space-between; align-items: center;
}
.payslip-body { padding: 32px 40px; }
.payslip-section-title {
    font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(99,102,241,0.15);
}
.payslip-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13px; border-bottom: 1px solid #f1f5f9; }
.payslip-row:last-child { border-bottom: none; }
.payslip-net { background: #f8fafc; padding: 20px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
.payslip-net .net-label { font-size: 14px; font-weight: 600; color: #64748b; }
.payslip-net .net-amount { font-size: 28px; font-weight: 800; color: var(--primary); }

@media print {
    @page {
        margin: 0;
    }
    .topbar, .sidebar, .topbar-btn, .btn-primary, .no-print { display: none !important; }
    .main-wrapper { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
}

/* ─── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
    :root { --sidebar-width: 0px; }
    .sidebar { transform: translateX(-260px); width: 260px; }
    .sidebar.open { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
}

@media (max-width: 768px) {
    .auth-bg-left { display: none; }
    .auth-form-panel { width: 100%; }
    .invoice-meta { grid-template-columns: 1fr; }
    .invoice-totals { grid-template-columns: 1fr; }
    .stat-value { font-size: 22px; }
}

/* ─── Utility ─────────────────────────────────────────────────── */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }
.font-outfit { font-family: 'Outfit', sans-serif !important; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 768px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ─── Grid System & Rows ───────────────────────────────────────── */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -8px;
    margin-left: -8px;
}
.row > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: 8px;
    padding-left: 8px;
}
.g-1 { margin-right: -4px; margin-left: -4px; }
.g-1 > * { padding-right: 4px; padding-left: 4px; }
.g-2 { margin-right: -6px; margin-left: -6px; }
.g-2 > * { padding-right: 6px; padding-left: 6px; }
.g-3 { margin-right: -8px; margin-left: -8px; }
.g-3 > * { padding-right: 8px; padding-left: 8px; }
.g-4 { margin-right: -12px; margin-left: -12px; }
.g-4 > * { padding-right: 12px; padding-left: 12px; }

/* Enforce columns and prevent 100% collapse on wide screens */
.col-12 { flex: 0 0 100% !important; width: 100% !important; max-width: 100% !important; }
.col-6 { flex: 0 0 50% !important; width: 50% !important; max-width: 50% !important; }
.col-4 { flex: 0 0 33.333333% !important; width: 33.333333% !important; max-width: 33.333333% !important; }
.col-3 { flex: 0 0 25% !important; width: 25% !important; max-width: 25% !important; }
.col-2 { flex: 0 0 16.666667% !important; width: 16.666667% !important; max-width: 16.666667% !important; }

@media (min-width: 576px) {
    .col-sm-12 { flex: 0 0 100% !important; width: 100% !important; max-width: 100% !important; }
    .col-sm-6 { flex: 0 0 50% !important; width: 50% !important; max-width: 50% !important; }
    .col-sm-4 { flex: 0 0 33.333333% !important; width: 33.333333% !important; max-width: 33.333333% !important; }
    .col-sm-3 { flex: 0 0 25% !important; width: 25% !important; max-width: 25% !important; }
}

@media (min-width: 768px) {
    .col-md-2 { flex: 0 0 16.666667% !important; width: 16.666667% !important; max-width: 16.666667% !important; }
    .col-md-3 { flex: 0 0 25% !important; width: 25% !important; max-width: 25% !important; }
    .col-md-4 { flex: 0 0 33.333333% !important; width: 33.333333% !important; max-width: 33.333333% !important; }
    .col-md-5 { flex: 0 0 41.666667% !important; width: 41.666667% !important; max-width: 41.666667% !important; }
    .col-md-6 { flex: 0 0 50% !important; width: 50% !important; max-width: 50% !important; }
    .col-md-7 { flex: 0 0 58.333333% !important; width: 58.333333% !important; max-width: 58.333333% !important; }
    .col-md-8 { flex: 0 0 66.666667% !important; width: 66.666667% !important; max-width: 66.666667% !important; }
    .col-md-9 { flex: 0 0 75% !important; width: 75% !important; max-width: 75% !important; }
    .col-md-10 { flex: 0 0 83.333333% !important; width: 83.333333% !important; max-width: 83.333333% !important; }
    .col-md-12 { flex: 0 0 100% !important; width: 100% !important; max-width: 100% !important; }
}

@media (min-width: 992px) {
    .col-lg-2 { flex: 0 0 16.666667% !important; width: 16.666667% !important; max-width: 16.666667% !important; }
    .col-lg-3 { flex: 0 0 25% !important; width: 25% !important; max-width: 25% !important; }
    .col-lg-4 { flex: 0 0 33.333333% !important; width: 33.333333% !important; max-width: 33.333333% !important; }
    .col-lg-6 { flex: 0 0 50% !important; width: 50% !important; max-width: 50% !important; }
    .col-lg-8 { flex: 0 0 66.666667% !important; width: 66.666667% !important; max-width: 66.666667% !important; }
    .col-lg-12 { flex: 0 0 100% !important; width: 100% !important; max-width: 100% !important; }
}

@media (min-width: 1200px) {
    .col-xl-2 { flex: 0 0 16.666667% !important; width: 16.666667% !important; max-width: 16.666667% !important; }
    .col-xl-3 { flex: 0 0 25% !important; width: 25% !important; max-width: 25% !important; }
    .col-xl-4 { flex: 0 0 33.333333% !important; width: 33.333333% !important; max-width: 33.333333% !important; }
    .col-xl-6 { flex: 0 0 50% !important; width: 50% !important; max-width: 50% !important; }
    .col-xl-12 { flex: 0 0 100% !important; width: 100% !important; max-width: 100% !important; }
}

/* Metric / KPI Cards Top Row - Always Horizontal in a Single Row */
.row.g-3.mb-4 {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
}

.row.g-3.mb-4 > [class*="col-"] {
    flex: 1 1 200px !important;
    max-width: 100% !important;
    width: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ─── 3-Block Form Layout (Single Row Horizontal) ──────────────── */
.filter-3-blocks, .form-3-blocks {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
    margin-bottom: 24px !important;
    align-items: stretch !important;
}

@media (max-width: 768px) {
    .filter-3-blocks, .form-3-blocks {
        grid-template-columns: 1fr !important;
    }
}

.filter-block {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.filter-block:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.08);
}

.filter-block-header {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px dashed var(--border, #e2e8f0);
    padding-bottom: 8px;
}

.filter-block-body {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
    flex: 1;
}

.filter-block-body > div,
.filter-block-body > .form-group {
    flex: 1;
    min-width: 110px;
}

.filter-block-body label,
.filter-block-body .form-label {
    font-size: 11.5px;
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
    color: var(--text-secondary, #64748b);
}

.filter-block-body .form-control,
.filter-block-body .form-select {
    width: 100%;
    border-radius: 8px;
    font-size: 13px;
    padding: 7px 12px;
}

.filter-block-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: 4px;
}

.filter-block-actions .btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
}
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; }
.p-1 { padding: 4px; } .p-2 { padding: 8px; } .p-3 { padding: 16px; } .p-4 { padding: 24px; }
.rounded { border-radius: var(--border-radius-sm); } .rounded-lg { border-radius: var(--border-radius); }
.w-100 { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* ─── Floating Scroll Buttons ────────────────────────────────────── */
.scroll-widget-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    transform: translateY(10px);
}
.scroll-widget-container.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.scroll-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--grad-primary, linear-gradient(135deg, #6366f1 0%, #a855f7 100%));
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.scroll-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}
.scroll-btn:active {
    transform: scale(0.95);
}

/* Utilities */
.d-none {
    display: none !important;
}
.d-block {
    display: block !important;
}
.d-flex {
    display: flex !important;
}
