        :root {
            /* SMART INVENTORY DARK THEME */
            --bg-body: #0f172a;
            --bg-card: #1e293b;
            --bg-input: #020617;
            --text-main: #f1f5f9;
            --text-muted: #94a3b8;
            --accent: #38bdf8;
            /* Sky Blue like Inventory */
            --success: #22c55e;
            --danger: #ef4444;
            --warning: #f59e0b;
            --border: #334155;
            --info: #3b82f6;
            --purple: #8b5cf6;
            /* Legacy/Glass compatibility mappings */
            --bg-glass: #1e293b;
            /* Solid card background */
            --border-glass: #334155;
            --primary: #38bdf8;
            --primary-dark: #0284c7;
            --white: #ffffff;
            --light: #94a3b8;
            --green: #22c55e;
            --red: #ef4444;
            --yellow: #f59e0b;
            --glow-primary: 0 0 20px rgba(56, 189, 248, 0.15);
            /* Legacy mappings for internal classes */
            --card: var(--bg-card);
            --bg: var(--bg-body);
            --accent-light: #38bdf8;
        }

        body {
            background-color: var(--bg-body);
            color: var(--text-main);
            margin: 0;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        /* Animated Logo */
        @keyframes logoEntrance {
            0% {
                opacity: 0;
                transform: scale(0.8) translateY(-20px);
            }

            100% {
                opacity: 1;
                transform: scale(1) translateY(0);
            }
        }

        @keyframes logoBreathe {

            0%,
            100% {
                transform: scale(1);
                filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.3));
            }

            50% {
                transform: scale(1.05);
                filter: drop-shadow(0 0 20px rgba(56, 189, 248, 0.6));
            }
        }

        .login-logo-animated {
            width: 100px;
            height: 100px;
            margin-bottom: 25px;
            animation: logoEntrance 1s ease-out forwards, logoBreathe 4s ease-in-out infinite 1s;
        }

        .input-wrapper {
            position: relative;
            width: 100%;
        }

        .input-icon-right {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--light);
            pointer-events: none;
            /* Let clicks pass through to input */
        }

        /* Dark Theme Table Styles */
        .table {
            color: var(--text-main);
            border-color: var(--border);
            width: 100%;
            margin-bottom: 1rem;
            background-color: transparent;
        }

        .table-bordered {
            border: 1px solid var(--border);
        }

        .table-bordered td,
        .table-bordered th {
            border: 1px solid var(--border);
            white-space: normal;
            word-break: break-word;
            overflow-wrap: anywhere;
        }

        .table thead th {
            border-bottom: 2px solid var(--border);
            background-color: var(--bg-card);
            color: var(--accent);
            vertical-align: middle;
            text-align: center;
            font-weight: 600;
        }

        .table-striped tbody tr:nth-of-type(odd) {
            background-color: rgba(255, 255, 255, 0.03);
        }

        .table-striped tbody tr:nth-of-type(even) {
            background-color: transparent;
        }

        .table-responsive {
            display: block;
            width: 100%;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        /* Sticky Columns for Payroll Table */
        #payrollTableContainer table th:first-child,
        #payrollTableContainer table td:first-child {
            position: sticky;
            left: 0;
            background-color: var(--bg-card);
            z-index: 10;
            border-right: 2px solid var(--border);
            box-shadow: 2px 0 5px rgba(0, 0, 0, 0.5);
        }

        #payrollTableContainer table th:first-child {
            z-index: 11;
            /* Higher than tbody sticky cells */
        }

        /* Payroll Modal Dark Theme Overrides */
        #payrollModal .modal-content {
            background-color: var(--bg-card);
            color: var(--text-main);
            border: 1px solid var(--border);
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
        }

        #payrollModal .modal-header {
            border-bottom: 1px solid var(--border);
            background-color: rgba(0, 0, 0, 0.2);
            padding: 15px 20px;
        }

        #payrollModal .modal-footer {
            border-top: 1px solid var(--border);
            background-color: rgba(0, 0, 0, 0.2);
            padding: 15px 20px;
        }

        #payrollModal .close-modal {
            color: var(--text-muted);
            transition: color 0.2s;
        }

        #payrollModal .close-modal:hover {
            color: var(--danger);
        }

        #payrollModal table {
            color: var(--text-main);
            border-color: var(--border);
        }

        #payrollModal table th {
            background-color: var(--bg-body);
            color: var(--accent);
            border-color: var(--border);
            font-weight: 600;
            text-transform: uppercase;
            font-size: 0.85rem;
            letter-spacing: 0.5px;
        }

        #payrollModal table td {
            border-color: var(--border);
            vertical-align: middle;
        }

        #payrollModal input.form-control {
            background-color: var(--bg-input);
            color: var(--text-main);
            border: 1px solid var(--border);
        }

        #payrollModal input.form-control:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
        }

        /* Ensure date input text doesn't overlap icon */
        input[type="date"]::-webkit-calendar-picker-indicator {
            background: transparent;
            bottom: 0;
            color: transparent;
            cursor: pointer;
            height: auto;
            left: 0;
            position: absolute;
            right: 0;
            top: 0;
            width: auto;
            z-index: 1;
            /* Make it cover the whole input for better touch target */
        }

        .toggle-btn {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            cursor: pointer;
            background: transparent;
            border: none;
            font-size: 13px;
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            border-radius: 4px;
            transition: all 0.2s;
        }

        .toggle-btn:hover {
            color: var(--text-main);
            background: rgba(255, 255, 255, 0.05);
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
        }

        /* GLOBAL FORM STYLES (DARK THEME) */
        input,
        select,
        textarea {
            background: var(--bg-input);
            color: var(--text-main);
            border: 1px solid var(--border);
            border-radius: 4px;
        }

        input:focus,
        select:focus,
        textarea:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
        }

        body {
            background-color: var(--bg-body);
            color: var(--text-main);
            min-height: 100vh;
            font-size: 14px;
            overflow-x: auto;
            overscroll-behavior: none;
            /* Mencegah pull-to-refresh pada mobile */
            touch-action: pan-x pan-y;
            /* Mencegah gesture navigasi tidak sengaja */
        }

        /* ==================== SISTEM UTAMA ==================== */
        .login-info-bar {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            background: linear-gradient(to right, #020617, #0f172a);
            padding: 0 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid var(--border);
            z-index: 1000;
            height: 44px;
            gap: 10px;
        }

        .login-info-left {
            display: flex;
            align-items: center;
            gap: 8px;
            flex: 1;
        }

        .app-title-mini {
            font-size: 11.5px;
            font-weight: 500;
            color: var(--accent-light);
            white-space: nowrap;
        }

        .internal-use-notice {
            color: #f59e0b;
            font-weight: 600;
            font-size: 10.5px;
            text-transform: uppercase;
            background: rgba(245, 158, 11, 0.08);
            padding: 2px 6px;
            border-radius: 3px;
            border: 1px solid rgba(245, 158, 11, 0.2);
            white-space: nowrap;
        }

        .login-info-center {
            display: flex;
            align-items: center;
            gap: 10px;
            flex: 1;
            justify-content: center;
        }

        .datetime {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            background: rgba(255, 255, 255, 0.04);
            padding: 5px 10px;
            border-radius: 4px;
            border: 1px solid var(--border);
            min-width: 140px;
            height: 36px;
        }

        #currentTime {
            font-size: 11.5px;
            font-weight: 600;
            color: var(--white);
            letter-spacing: 0.5px;
            line-height: 1.2;
        }

        #currentDate {
            font-size: 10.5px;
            color: var(--light);
            line-height: 1.2;
        }

        .user-info-header {
            display: flex;
            flex-direction: column;
            align-items: center;
            background: rgba(255, 255, 255, 0.04);
            padding: 5px 10px;
            border-radius: 4px;
            border: 1px solid var(--border);
            min-width: 140px;
            height: 36px;
        }

        .user-details-header {
            display: flex;
            flex-direction: column;
            line-height: 1.2;
            align-items: center;
        }

        .user-name-header {
            font-size: 11px;
            font-weight: 600;
            color: var(--white);
        }

        .user-role-header {
            font-size: 9.5px;
            color: var(--light);
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .level-badge-header {
            font-size: 8.5px;
            padding: 1px 4px;
            border-radius: 3px;
            font-weight: 600;
            text-transform: uppercase;
        }

        .level-super-header {
            background: rgba(239, 68, 68, 0.2);
            color: var(--red);
            border: 1px solid rgba(239, 68, 68, 0.3);
        }

        .level-admin-header {
            background: rgba(245, 158, 11, 0.2);
            color: var(--yellow);
            border: 1px solid rgba(245, 158, 11, 0.3);
        }

        .level-manager-header {
            background: rgba(59, 130, 246, 0.2);
            color: var(--accent-light);
            border: 1px solid rgba(59, 130, 246, 0.3);
        }

        .level-viewer-header {
            background: rgba(148, 163, 184, 0.2);
            color: var(--light);
            border: 1px solid rgba(148, 163, 184, 0.3);
        }

        .level-employee-header, .level-employee {
            background: rgba(34, 197, 94, 0.15);
            color: var(--success);
            border: 1px solid rgba(34, 197, 94, 0.3);
        }

        .login-info-right {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-shrink: 0;
        }

        .header-btn {
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid var(--border);
            color: var(--white);
            padding: 6px 10px;
            border-radius: 5px;
            cursor: pointer;
            font-weight: 500;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            transition: all 0.2s;
            font-size: 11.5px;
            height: 30px;
            white-space: nowrap;
        }

        .header-btn:hover {
            background: rgba(255, 255, 255, 0.09);
            border-color: var(--accent-light);
        }

        #mainSystem {
            width: 100%;
            height: 100vh;
            overflow-x: auto;
            overflow-y: hidden;
            display: flex;
            flex-direction: column;
        }

        .split {
            display: flex;
            width: 100%;
            min-width: 1024px;
            height: calc(100vh - 110px);
            /* Height adjusted to account for header/nav */
            overflow: hidden;
            margin-top: 0;
            /* Aggressively reduced to 0 */
        }

        .left {
            flex: 0 0 240px;
            /* Slightly wider sidebar */
            background: var(--card);
            display: flex;
            flex-direction: column;
            border-right: 1px solid var(--border);
        }

        .right {
            flex: 1;
            min-width: 300px;
            background: var(--bg);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            padding: 0;
            /* REMOVED PADDING COMPLETELY to use full width */
        }

        .main-content {
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            gap: 2px;
            /* Aggressively reduced gap */
            padding-bottom: 5px;
        }

        /* Ensure table container takes remaining space */
        .table-container {
            flex: 1;
            overflow: auto;
            border-radius: 8px;
            border: 1px solid var(--border);
            background: var(--bg-card);
            min-height: 450px;
            /* Force taller table */
            margin-bottom: 0;
        }

        .sidebar {
            flex: 1;
            padding: 16px 12px;
            overflow-y: auto;
            color: var(--white);
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .sidebar-section {
            margin-bottom: 16px;
        }

        .section-title {
            font-size: 11px;
            font-weight: 600;
            color: var(--light);
            margin-bottom: 8px;
            padding-bottom: 6px;
            border-bottom: 1px solid var(--border);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .dept-list {
            max-height: 200px;
            overflow-y: auto;
            border-radius: 5px;
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid var(--border);
        }

        .dept-item {
            display: flex;
            align-items: center;
            padding: 8px 10px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            cursor: pointer;
            transition: all 0.2s;
            color: var(--white);
            font-size: 12px;
            user-select: none;
            min-height: 32px;
        }

        .dept-item:hover {
            background: rgba(255, 255, 255, 0.04);
        }

        .dept-item.active {
            background: rgba(56, 189, 248, 0.15);
            color: var(--accent);
            border-left: 2px solid var(--accent);
        }

        .date-btns {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 5px;
            margin-bottom: 8px;
        }

        .date-btn {
            padding: 7px;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid var(--border);
            border-radius: 5px;
            cursor: pointer;
            text-align: center;
            transition: all 0.2s;
            font-size: 11.5px;
            color: var(--white);
            height: 30px;
        }

        .date-btn:hover {
            background: rgba(255, 255, 255, 0.06);
            border-color: var(--accent);
        }

        .date-btn.active {
            background: rgba(56, 189, 248, 0.15);
            border-color: var(--accent);
            color: var(--accent);
            font-weight: 600;
            box-shadow: 0 0 10px rgba(56, 189, 248, 0.1);
        }

        .main-content {
            flex: 1;
            padding: 16px;
            overflow-y: auto;
            max-height: calc(100vh - 44px);
            background: var(--bg);
        }

        .controls {
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
            margin-bottom: 0;
            padding: 2px 10px;
            /* Reduced vertical padding */
            border-bottom: none;
            min-height: auto;
            /* Allow it to be as small as content */
        }

        .search-filter {
            display: grid;
            grid-template-columns: 1fr auto auto;
            gap: 10px;
            margin: 5px 10px 0 10px;
            /* Reduced top margin to 5px, bottom to 0 */
            padding: 0 8px;
            background: transparent;
            border-radius: 6px;
            align-items: start;
            min-height: auto;
            border: none;
        }

        .search-filter label {
            display: block;
            font-size: 11px;
            font-weight: 600;
            color: var(--light);
            margin-bottom: 2px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            /* Slightly narrower columns */
            gap: 5px;
            /* Tighter gap */
            margin: 0 10px 2px 10px;
            /* Reduced bottom margin */
        }

        .btn {
            padding: 6px 12px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 10px;
            font-weight: 700;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: all 0.2s;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            white-space: nowrap;
            justify-content: center;
            color: #0f172a;
            height: auto;
        }

        .btn:hover {
            transform: translateY(-1px);
            filter: brightness(1.1);
        }

        .btn-primary {
            background: var(--accent);
            color: #0f172a;
            box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
        }

        .btn-success {
            background: var(--success);
            color: #0f172a;
            box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
        }

        .btn-warning {
            background: var(--warning);
            color: #0f172a;
        }

        .btn-danger {
            background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
            color: white !important;
            box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
            border: 1px solid rgba(255, 255, 255, 0.1) !important;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .btn-danger:hover {
            background: linear-gradient(135deg, #f87171 0%, #dc2626 100%) !important;
            box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
            transform: translateY(-2px) scale(1.02);
            filter: brightness(1.2);
        }

        .btn-danger:active {
            transform: translateY(0);
            box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
        }

        .btn-purple {
            background: var(--purple);
            color: white;
        }

        .btn-secondary {
            background: rgba(255, 255, 255, 0.05) !important;
            color: #cbd5e1 !important;
            border: 1px solid rgba(255, 255, 255, 0.1) !important;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .btn-secondary:hover {
            background: rgba(255, 255, 255, 0.15) !important;
            color: white !important;
            border-color: rgba(255, 255, 255, 0.3);
            transform: translateY(-1px);
        }

        /* === INPUTS & FORMS (GLOBAL) === */
        input,
        select,
        textarea {
            width: 100%;
            background: var(--bg-input);
            border: 1px solid var(--border);
            color: white;
            padding: 8px;
            border-radius: 4px;
            outline: none;
            font-size: 11px;
            transition: all 0.2s;
        }

        input:focus,
        select:focus,
        textarea:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.1);
        }

        /* Payroll Badges & Indicators */
        .badge-payroll {
            font-size: 8.5px;
            padding: 1px 5px;
            border-radius: 3px;
            font-weight: 700;
            text-transform: uppercase;
            margin-left: 6px;
            vertical-align: middle;
            border: 1px solid transparent;
        }

        .badge-default {
            background: rgba(148, 163, 184, 0.15);
            color: #94a3b8;
            border-color: rgba(148, 163, 184, 0.2);
        }

        .badge-custom {
            background: rgba(56, 189, 248, 0.15);
            color: #38bdf8;
            border-color: rgba(56, 189, 248, 0.3);
            box-shadow: 0 0 10px rgba(56, 189, 248, 0.1);
        }

        .payroll-hint {
            font-size: 10px;
            color: var(--text-muted);
            font-style: italic;
            margin-top: 2px;
            display: block;
        }

        /* Fix option visibility in dark mode */
        option {
            background-color: var(--bg-card);
            color: var(--text-main);
        }

        .search-input {
            position: relative;
        }

        .search-input input {
            padding-left: 32px;
            /* Space for icon */
            height: 30px;
            /* Reduced from 34px */
            font-size: 12.5px;
        }

        .search-input i {
            position: absolute;
            left: 10px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
            font-size: 12px;
            pointer-events: none;
        }

        .filter-box label {
            display: block;
            margin-bottom: 2px;
            font-weight: 500;
            color: var(--text-muted);
            font-size: 11.5px;
        }

        .filter-select {
            padding: 0 40px 0 8px;
            /* Top/Bottom 0, Right 40px, Left 8px */
            height: 30px;
            /* Reduced from 34px */
            line-height: 28px;
            /* Slightly less than height to account for borders */
            font-size: 12.5px;
            color: var(--text-main);
            background-color: var(--bg-input);
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 10px center;
            background-size: 16px;
            cursor: pointer;
            min-width: 130px;
            appearance: none;
            /* Remove default arrow */
        }

        .stats-grid {
            /* display: grid;  DUPLICATE REMOVED */
            /* grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); DUPLICATE REMOVED */
            /* gap: 10px; DUPLICATE REMOVED */
            /* margin-bottom: 16px; REMOVED */
        }

        .stat-card {
            background: var(--bg-card);
            padding: 8px 10px;
            /* Reduced padding */
            border-radius: 6px;
            display: flex;
            align-items: center;
            border: 1px solid var(--border);
            transition: all 0.2s;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        }

        .stat-card:hover {
            transform: translateY(-2px);
            border-color: var(--accent);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
        }

        .stat-icon {
            width: 38px;
            height: 38px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 10px;
            font-size: 14px;
            color: white;
            font-weight: 600;
            flex-shrink: 0;
        }

        .stat-info h3 {
            font-size: 1.4rem;
            font-weight: 700;
            color: var(--white);
            line-height: 1;
        }

        .stat-info p {
            font-size: 11.5px;
            color: var(--light);
            margin-top: 3px;
        }

        /* === SCROLLBAR STYLE === */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }

        ::-webkit-scrollbar-track {
            background: #0f172a;
        }

        ::-webkit-scrollbar-thumb {
            background: #334155;
            border-radius: 4px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: #475569;
        }

        /* === TABLE STYLES (OPTIMIZED) === */
        /* === PAYROLL SYSTEM SPECIFIC STYLES === */
        #payrollModal .modal-content {
            background: var(--bg-card);
            border: 1px solid var(--border);
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
        }

        /* PAYROLL SYSTEM DARK THEME (SMART INVENTORY STYLE) */
        #payrollModal .modal-header {
            background: rgba(0, 0, 0, 0.2);
            /* Smart Inventory Style */
            color: var(--text-main);
            border-bottom: 1px solid var(--border);
            padding: 15px 20px;
        }

        #payrollModal .modal-body {
            background: var(--bg-body);
            color: var(--text-main);
            padding: 20px;
        }

        #payrollModal .modal-footer {
            background: rgba(0, 0, 0, 0.2);
            /* Smart Inventory Style */
            border-top: 1px solid var(--border);
            padding: 15px 20px;
        }

        /* Container for Scrollable Table */
        #payrollTableContainer {
            width: 100%;
            overflow-x: auto;
            border-radius: 8px;
            border: 1px solid var(--border);
            background: var(--bg-input);
            height: calc(100vh - 280px);
            min-height: 300px;
            position: relative;
            /* Scrollbar styling */
            scrollbar-width: thin;
            scrollbar-color: var(--border) var(--bg-input);
        }

        /* FIX: Ensure table content is readable */
        #payrollModal .table {
            border-collapse: separate;
            border-spacing: 0;
            background: var(--bg-card);
            margin-bottom: 0;
            min-width: max-content;
            /* Ensure table expands to fit content */
        }

        #payrollModal thead th {
            background: #0f172a;
            color: var(--accent);
            font-weight: 700;
            text-transform: uppercase;
            font-size: 0.75rem;
            letter-spacing: 0.5px;
            border-bottom: 2px solid var(--border);
            border-right: 1px solid var(--border);
            padding: 12px 15px;
            white-space: nowrap;
            position: sticky;
            top: 0;
            z-index: 20;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }

        /* Sticky First Column (Name) */
        #payrollModal thead th:first-child,
        #payrollModal tbody td:first-child,
        #payrollModal tfoot td:first-child {
            position: sticky;
            left: 0;
            z-index: 30;
            background: var(--bg-card);
            border-right: 2px solid var(--border);
            box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
        }

        #payrollModal thead th:first-child {
            z-index: 40;
            /* Top-left corner on top */
            background: #0f172a;
        }

        #payrollModal tfoot td:first-child {
            z-index: 30;
            background: var(--bg-card);
        }

        /* Table Cells */
        #payrollModal tbody td {
            border-bottom: 1px solid var(--border);
            border-right: 1px solid var(--border);
            padding: 5px;
            vertical-align: middle;
            color: var(--text-main);
        }

        /* Input Fields */
        .payroll-input {
            background: transparent;
            border: 1px solid transparent;
            color: var(--text-main);
            width: 100%;
            text-align: center;
            font-family: 'Roboto Mono', monospace;
            font-size: 0.9em;
            padding: 6px 4px;
            border-radius: 4px;
            transition: all 0.2s;
        }

        .payroll-input:hover,
        .payroll-input:focus {
            background: var(--bg-input);
            border-color: var(--accent);
            outline: none;
            box-shadow: 0 0 0 1px var(--accent);
        }

        /* Total Columns Highlights */
        .pendapatan-cell {
            background: rgba(59, 130, 246, 0.1) !important;
            color: var(--info) !important;
            font-weight: bold;
            text-align: right;
            padding-right: 15px !important;
        }

        .total-cell {
            background: rgba(34, 197, 94, 0.1) !important;
            color: var(--success) !important;
            font-weight: bold;
            text-align: right;
            padding-right: 15px !important;
            font-size: 1.05em;
        }

        .potongan-cell-input {
            color: var(--danger);
            font-weight: 600;
        }

        /* Footer Totals */
        #payrollModal tfoot td {
            background: var(--bg-card);
            color: var(--text-main);
            font-weight: 700;
            border-top: 2px solid var(--border);
            padding: 12px 10px;
            text-align: right;
            font-size: 0.85em;
            vertical-align: middle;
        }

        #payrollModal tfoot td:first-child {
            text-align: center;
        }

        #payrollModal tfoot #sumPendapatan {
            color: var(--info);
            background: rgba(59, 130, 246, 0.05) !important;
        }

        #payrollModal tfoot #sumTotal {
            color: var(--success);
            background: rgba(34, 197, 94, 0.05) !important;
            font-size: 1.1em;
        }

        table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
        }

        thead {
            position: sticky;
            top: 0;
            z-index: 20;
            /* Higher z-index to stay above sticky columns */
            background: #0f172a;
        }

        thead th {
            color: var(--accent);
            font-size: 11px;
            text-transform: uppercase;
            padding: 8px 10px;
            /* Reduced padding */
            text-align: left;
            border-bottom: 2px solid var(--border);
            white-space: nowrap;
            font-weight: 700;
            letter-spacing: 0.5px;
            height: 36px;
        }

        tbody td {
            padding: 8px 10px;
            font-size: 11.5px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            color: var(--text-muted);
            white-space: normal;
            /* Changed from nowrap to allow wrapping */
            vertical-align: middle;
            min-height: 38px;
        }

        .col-keterangan {
            min-width: 200px;
            max-width: 350px;
            white-space: normal !important;
            line-height: 1.4;
            color: var(--text-main) !important;
        }

        /* Sticky Action Column */
        th:last-child,
        td:last-child {
            position: sticky;
            right: 0;
            background: inherit;
            /* Inherit background from row */
            z-index: 10;
            border-left: 1px solid var(--border);
            box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
        }

        thead th:last-child {
            background: #0f172a;
            /* Match header background */
            z-index: 25;
            /* Higher than regular sticky column to stay on top of header */
        }

        /* Alternating row colors need specific handling for sticky columns */
        tbody tr:nth-child(even) {
            background-color: rgba(30, 41, 59, 0.3);
        }

        tbody tr:nth-child(even) td:last-child {
            background-color: #0b1221;
        }

        /* Approximate the even row color */
        tbody tr:nth-child(odd) td:last-child {
            background-color: #020617;
        }

        /* Match base background */
        tbody tr:hover {
            background-color: rgba(56, 189, 248, 0.05) !important;
        }

        tbody tr:hover td:last-child {
            background-color: #0f172a !important;
        }

        /* Match hover color approx */
        /* Text Truncation for Notes */
        /* Removed legacy .td-notes truncation */

        /* Tooltip for truncated text */
        .td-notes:hover {
            position: relative;
            overflow: visible;
        }

        .td-notes:hover span {
            position: absolute;
            background: #1e293b;
            padding: 5px 10px;
            border: 1px solid var(--accent);
            border-radius: 4px;
            z-index: 50;
            left: 0;
            top: 100%;
            white-space: normal;
            min-width: 200px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
        }

        tbody tr:hover {
            background-color: rgba(56, 189, 248, 0.1);
            transform: translateX(2px);
            cursor: pointer;
        }

        tbody tr:hover td {
            color: var(--text-main);
        }

        .status-badge {
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 600;
            display: inline-block;
            min-width: 60px;
            text-align: center;
            border: 1px solid;
            position: relative;
        }

        .status-present {
            background: rgba(16, 185, 129, 0.12);
            color: var(--green);
            border-color: rgba(16, 185, 129, 0.2);
        }

        .status-present.with-overtime::after {
            content: "L";
            position: absolute;
            top: -5px;
            right: -5px;
            background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
            color: white;
            font-size: 8px;
            font-weight: 800;
            width: 15px;
            height: 15px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 2px solid var(--bg-card);
            box-shadow: 0 3px 6px rgba(234, 88, 12, 0.3);
            z-index: 2;
        }

        .status-permit {
            background: rgba(245, 158, 11, 0.12);
            color: var(--yellow);
            border-color: rgba(245, 158, 11, 0.2);
        }

        .status-sick {
            background: rgba(239, 68, 68, 0.12);
            color: var(--red);
            border-color: rgba(239, 68, 68, 0.2);
        }

        .status-leave {
            background: rgba(59, 130, 246, 0.12);
            color: var(--accent-light);
            border-color: rgba(59, 130, 246, 0.2);
        }

        .status-absent {
            background: rgba(148, 163, 184, 0.12);
            color: var(--light);
            border-color: rgba(148, 163, 184, 0.2);
        }

        .status-holiday {
            background: rgba(236, 72, 153, 0.12);
            color: #f472b6;
            border-color: rgba(236, 72, 153, 0.2);
        }

        .action-buttons {
            display: flex;
            gap: 5px;
        }

        .action-btn {
            width: 32px;
            height: 32px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s;
            border: 1px solid transparent;
            font-size: 13px;
            color: white;
            background: rgba(255, 255, 255, 0.08);
        }

        .action-btn.view {
            background: rgba(56, 189, 248, 0.1) !important;
            color: var(--accent) !important;
            border-color: rgba(56, 189, 248, 0.2) !important;
        }

        .action-btn.delete {
            background: rgba(239, 68, 68, 0.1) !important;
            color: #ef4444 !important;
            border-color: rgba(239, 68, 68, 0.2) !important;
        }

        .action-btn.view:hover {
            background: var(--accent) !important;
            color: white !important;
        }

        .action-btn.delete:hover {
            background: #ef4444 !important;
            color: white !important;
        }

        .action-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        }

        .table-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 12px;
            background: rgba(255, 255, 255, 0.04);
            border-top: 1px solid var(--border);
            min-height: 44px;
        }

        .records-info {
            font-size: 11.5px;
            color: var(--light);
        }

        .pagination {
            display: flex;
            gap: 5px;
        }

        .pagination button {
            padding: 6px 10px;
            border: 1px solid var(--border);
            background: rgba(255, 255, 255, 0.04);
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 11.5px;
            min-width: 28px;
            color: var(--white);
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .pagination button:hover {
            border-color: var(--accent-light);
            background: rgba(59, 130, 246, 0.1);
        }

        .pagination button.active {
            background: var(--accent);
            color: white;
            border-color: var(--accent);
        }

        .empty-state {
            text-align: center;
            padding: 32px 12px;
            color: var(--light);
        }

        .empty-state i {
            font-size: 2.5rem;
            margin-bottom: 12px;
            color: rgba(255, 255, 255, 0.1);
        }

        .empty-state h3 {
            font-size: 1rem;
            margin-bottom: 6px;
            color: var(--accent-light);
            font-weight: 600;
        }

        /* === MODALS (SMART INVENTORY STYLE) === */
        .modal {
            display: none;
            position: fixed;
            z-index: 2000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            backdrop-filter: blur(5px);
            justify-content: center;
            align-items: center;
        }

        .modal-content {
            background: var(--bg-card);
            margin: 0;
            padding: 0;
            border: 1px solid var(--border);
            width: 95%;
            max-width: 600px;
            border-radius: 12px;
            max-height: 90vh;
            overflow: auto;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
            display: flex;
            flex-direction: column;
        }

        .modal-header {
            padding: 15px 20px;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: rgba(0, 0, 0, 0.2);
            margin-bottom: 0;
        }

        .modal-header h2 {
            font-size: 14px;
            font-weight: bold;
            color: var(--accent);
            text-transform: uppercase;
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 0;
        }

        .modal-body {
            padding: 20px;
            overflow-y: auto;
            overflow-x: auto;
        }

        .modal-footer {
            padding: 15px 20px;
            border-top: 1px solid var(--border);
            background: rgba(0, 0, 0, 0.2);
            display: flex;
            justify-content: flex-end;
            gap: 10px;
        }

        .modal-header h3 {
            color: var(--accent-light);
            font-size: 1.1rem;
            font-weight: 600;
        }

        .close-modal {
            font-size: 1.2rem;
            cursor: pointer;
            color: var(--light);
            transition: color 0.2s;
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
        }

        .close-modal:hover {
            color: var(--red);
            background: rgba(239, 68, 68, 0.1);
        }

        .modal-body {
            padding: 0 20px 20px;
        }

        .modal-footer {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            padding: 15px 20px;
            border-top: 1px solid var(--border);
            background: rgba(255, 255, 255, 0.02);
        }

        /* ==================== NOTIFICATION TOAST (UPGRADED) ==================== */
        .notification-container {
            position: fixed;
            bottom: 30px;
            right: 30px;
            z-index: 99999;
            display: flex;
            flex-direction: column-reverse;
            gap: 12px;
            pointer-events: none;
        }

        .notification {
            pointer-events: auto;
            padding: 14px 18px 14px 18px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            gap: 12px;
            font-weight: 500;
            animation: notifSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
            font-size: 13px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
            min-width: 300px;
            max-width: 420px;
            color: var(--text-main);
            background: rgba(15, 23, 42, 0.97);
            border: 1px solid rgba(255, 255, 255, 0.08);
            backdrop-filter: blur(12px);
            position: relative;
            overflow: hidden;
        }

        .notification.dismissing {
            animation: notifSlideOut 0.35s cubic-bezier(0.4, 0, 1, 1) forwards;
        }

        .notification .notif-icon {
            font-size: 16px;
            flex-shrink: 0;
        }

        .notification .notif-message {
            flex: 1;
            line-height: 1.4;
        }

        .notification .notif-close {
            flex-shrink: 0;
            background: none;
            border: none;
            color: rgba(255, 255, 255, 0.3);
            cursor: pointer;
            padding: 4px;
            border-radius: 4px;
            font-size: 12px;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .notification .notif-close:hover {
            color: rgba(255, 255, 255, 0.8);
            background: rgba(255, 255, 255, 0.1);
        }

        /* Progress bar (auto-dismiss indicator) */
        .notification .notif-progress {
            position: absolute;
            bottom: 0;
            left: 0;
            height: 3px;
            border-radius: 0 0 10px 10px;
            animation: notifProgress var(--notif-duration, 4s) linear forwards;
        }

        .notification.success {
            border-left: 4px solid var(--success);
        }

        .notification.success .notif-icon {
            color: var(--success);
        }

        .notification.success .notif-progress {
            background: var(--success);
        }

        .notification.warning {
            border-left: 4px solid var(--warning);
        }

        .notification.warning .notif-icon {
            color: var(--warning);
        }

        .notification.warning .notif-progress {
            background: var(--warning);
        }

        .notification.error {
            border-left: 4px solid var(--danger);
        }

        .notification.error .notif-icon {
            color: var(--danger);
        }

        .notification.error .notif-progress {
            background: var(--danger);
        }

        .notification.info {
            border-left: 4px solid var(--accent);
        }

        .notification.info .notif-icon {
            color: var(--accent);
        }

        .notification.info .notif-progress {
            background: var(--accent);
        }

        @keyframes notifSlideIn {
            from {
                transform: translateX(120%);
                opacity: 0;
            }

            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        @keyframes notifSlideOut {
            from {
                transform: translateX(0);
                opacity: 1;
                max-height: 100px;
                margin-bottom: 0;
            }

            to {
                transform: translateX(120%);
                opacity: 0;
                max-height: 0;
                margin-bottom: -12px;
            }
        }

        @keyframes notifProgress {
            from {
                width: 100%;
            }

            to {
                width: 0%;
            }
        }

        /* ==================== SKELETON SHIMMER LOADING ==================== */
        .skeleton {
            background: rgba(255, 255, 255, 0.04);
            border-radius: 6px;
            position: relative;
            overflow: hidden;
        }

        .skeleton::after {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg,
                    transparent 0%,
                    rgba(255, 255, 255, 0.06) 50%,
                    transparent 100%);
            animation: shimmer 1.5s infinite;
        }

        @keyframes shimmer {
            0% {
                left: -100%;
            }

            100% {
                left: 100%;
            }
        }

        .skeleton-row {
            display: grid;
            grid-template-columns: 1fr 2fr 1fr 1fr 1fr 80px;
            gap: 10px;
            padding: 12px 16px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.03);
        }

        .skeleton-cell {
            height: 14px;
            border-radius: 4px;
        }

        .skeleton-card {
            height: 80px;
            border-radius: 8px;
        }

        /* ==================== ATTENDANCE STREAK BADGE ==================== */
        .streak-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 700;
            background: linear-gradient(135deg, rgba(251, 146, 60, 0.15) 0%, rgba(239, 68, 68, 0.15) 100%);
            color: #fb923c;
            border: 1px solid rgba(251, 146, 60, 0.25);
            animation: streakPulse 2s ease-in-out infinite;
        }

        .streak-badge .streak-fire {
            font-size: 14px;
        }

        @keyframes streakPulse {

            0%,
            100% {
                box-shadow: 0 0 0 0 rgba(251, 146, 60, 0.2);
            }

            50% {
                box-shadow: 0 0 12px 2px rgba(251, 146, 60, 0.15);
            }
        }

        /* ==================== ANIMATED STAT COUNTER ==================== */
        .stat-number {
            font-variant-numeric: tabular-nums;
            transition: opacity 0.3s ease;
        }

        .stat-number.counting {
            opacity: 0.7;
        }

        /* Log Activity Styles */
        .log-item {
            padding: 8px 10px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            font-size: 11.5px;
        }

        .log-time {
            color: var(--light);
            font-size: 10.5px;
            margin-top: 2px;
        }

        .log-user {
            color: var(--accent-light);
            font-weight: 500;
        }

        .log-action {
            color: var(--white);
        }

        ::-webkit-scrollbar {
            width: 6px;
        }

        ::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.02);
            border-radius: 3px;
        }

        ::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.1);
            border-radius: 3px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.15);
        }

        /* Custom Select Styles - DIPERBAIKI */
        .form-control option {
            background: var(--card);
            color: var(--white);
        }

        select.form-control,
        select.form-control-compact {
            color: var(--white);
        }

        select.form-control option,
        select.form-control-compact option {
            background: var(--card);
            color: var(--white);
        }

        /* Button disabled state */
        .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none !important;
            box-shadow: none !important;
        }

        .clocked-btn {
            background: linear-gradient(135deg, var(--gray) 0%, #64748b 100%);
            cursor: default;
        }

        .clocked-btn:hover {
            transform: none !important;
            box-shadow: none !important;
        }

        /* Karyawan view info */
        .karyawan-info-banner {
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(96, 165, 250, 0.1) 100%);
            border: 1px solid rgba(59, 130, 246, 0.2);
            border-radius: 6px;
            padding: 12px 16px;
            margin-bottom: 16px;
            text-align: center;
            font-size: 12px;
            color: var(--accent-light);
        }

        .karyawan-info-banner i {
            margin-right: 6px;
        }

        /* Modal untuk catatan absensi */
        .note-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 2000;
            justify-content: center;
            align-items: center;
            backdrop-filter: blur(4px);
        }

        .note-modal-content {
            background: var(--card);
            border-radius: 10px;
            border: 1px solid var(--border);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
            width: 90%;
            max-width: 400px;
            padding: 20px;
        }

        /* Level indicator */
        .admin-level-badge {
            display: inline-block;
            padding: 3px 8px;
            border-radius: 4px;
            font-size: 10px;
            font-weight: 600;
            margin-left: 8px;
        }

        .level-super {
            background: rgba(239, 68, 68, 0.2);
            color: var(--red);
            border: 1px solid rgba(239, 68, 68, 0.3);
        }

        .level-admin {
            background: rgba(245, 158, 11, 0.2);
            color: var(--yellow);
            border: 1px solid rgba(245, 158, 11, 0.3);
        }

        .level-manager {
            background: rgba(59, 130, 246, 0.2);
            color: var(--accent-light);
            border: 1px solid rgba(59, 130, 246, 0.3);
        }

        .level-viewer {
            background: rgba(148, 163, 184, 0.2);
            color: var(--light);
            border: 1px solid rgba(148, 163, 184, 0.3);
        }

        /* Print styles */
        @media print {

            .login-info-bar,
            .left,
            .controls,
            .search-filter,
            .stats-grid,
            .table-footer,
            .action-buttons,
            .pagination,
            .btn,
            .header-btn {
                display: none !important;
            }

            body {
                background: white !important;
                color: black !important;
            }

            .main-content {
                padding: 0 !important;
                max-height: none !important;
            }

            .table-container {
                max-height: none !important;
                overflow: visible !important;
                border: 1px solid #000 !important;
                box-shadow: none !important;
            }

            table {
                min-width: 100% !important;
                border-collapse: collapse !important;
            }

            th,
            td {
                color: black !important;
                border: 1px solid #000 !important;
            }

            .status-badge {
                border: 1px solid #000 !important;
            }
        }

        /* Backup indicator */
        .backup-indicator {
            position: fixed;
            bottom: 10px;
            right: 10px;
            background: rgba(16, 185, 129, 0.9);
            color: white;
            padding: 5px 10px;
            border-radius: 4px;
            font-size: 10px;
            z-index: 1000;
            animation: fadeInOut 2s ease;
            display: none;
        }

        @keyframes fadeInOut {
            0% {
                opacity: 0;
            }

            20% {
                opacity: 1;
            }

            80% {
                opacity: 1;
            }

            100% {
                opacity: 0;
            }
        }

        /* Restore file input */
        .restore-file-input {
            display: none;
        }

        .file-input-label {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            cursor: pointer;
            width: 100%;
        }

        /* Backup status */
        .backup-status {
            font-size: 10.5px;
            color: var(--light);
            margin-top: 5px;
            padding: 5px;
            background: rgba(255, 255, 255, 0.03);
            border-radius: 4px;
            border: 1px solid var(--border);
        }

        /* Improved UI for employee management */
        .employee-form-section {
            margin-bottom: 20px;
            padding: 15px;
            background: rgba(255, 255, 255, 0.02);
            border-radius: 8px;
            border: 1px solid var(--border);
        }

        .section-title-2 {
            font-size: 13px;
            font-weight: 600;
            color: var(--accent-light);
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .employee-details-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 12px;
            margin-bottom: 15px;
        }

        .form-group-compact {
            margin-bottom: 12px;
        }

        .form-group-compact label {
            display: block;
            margin-bottom: 4px;
            font-weight: 500;
            color: var(--light);
            font-size: 11.5px;
        }

        .form-control-compact {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid var(--border);
            border-radius: 6px;
            font-size: 12.5px;
            background: rgba(255, 255, 255, 0.04);
            color: var(--white);
            height: 36px;
        }

        .permission-item-improved {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 6px 10px;
            background: rgba(255, 255, 255, 0.03);
            border-radius: 6px;
            border: 1px solid rgba(255, 255, 255, 0.07);
            margin-bottom: 5px;
            transition: all 0.2s;
        }

        .permission-item-improved:hover {
            background: rgba(255, 255, 255, 0.05);
            border-color: rgba(255, 255, 255, 0.1);
        }

        .permission-item-improved label {
            font-size: 11.5px;
            color: var(--white);
            cursor: pointer;
            flex: 1;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .permission-item-improved label i {
            color: var(--accent-light);
            font-size: 12px;
            width: 16px;
        }

        .password-strength {
            height: 4px;
            background: var(--border);
            border-radius: 2px;
            margin-top: 5px;
            overflow: hidden;
        }

        .password-strength-bar {
            height: 100%;
            width: 0%;
            background: var(--red);
            transition: width 0.3s ease;
            border-radius: 2px;
        }

        .password-strength-bar.weak {
            background: var(--red);
            width: 33%;
        }

        .password-strength-bar.medium {
            background: var(--yellow);
            width: 66%;
        }

        .password-strength-bar.strong {
            background: var(--green);
            width: 100%;
        }

        .password-hint {
            font-size: 10px;
            color: var(--light);
            margin-top: 3px;
        }

        /* Backup/restore password modal */
        .password-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 2001;
            justify-content: center;
            align-items: center;
            backdrop-filter: blur(8px);
        }

        .password-modal-content {
            background: var(--card);
            border-radius: 12px;
            border: 1px solid var(--border);
            box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
            width: 90%;
            max-width: 420px;
            padding: 24px;
        }

        .password-modal-header {
            text-align: center;
            margin-bottom: 20px;
        }

        .password-modal-header i {
            font-size: 2.5rem;
            color: var(--accent-light);
            margin-bottom: 10px;
        }

        .password-modal-header h3 {
            color: var(--white);
            font-size: 1.2rem;
            margin-bottom: 5px;
        }

        .password-modal-header p {
            color: var(--light);
            font-size: 12px;
        }

        .security-question {
            background: rgba(255, 255, 255, 0.03);
            border-radius: 8px;
            padding: 12px;
            margin-bottom: 15px;
            border: 1px solid var(--border);
        }

        .security-question label {
            font-size: 11px;
            color: var(--light);
            margin-bottom: 5px;
            display: block;
        }

        .security-question input {
            width: 100%;
            padding: 8px 12px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid var(--border);
            border-radius: 6px;
            color: var(--white);
            font-size: 12px;
        }

        .master-password-note {
            background: rgba(245, 158, 11, 0.1);
            border: 1px solid rgba(245, 158, 11, 0.2);
            border-radius: 6px;
            padding: 10px;
            margin-top: 15px;
            font-size: 10.5px;
            color: var(--yellow);
        }

        .master-password-note i {
            margin-right: 5px;
        }

        /* TOGGLE SWITCH - Improved */
        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 54px;
            height: 26px;
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #475569;
            transition: .3s ease;
            border-radius: 20px;
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
        }

        .toggle-slider:before {
            position: absolute;
            content: "";
            height: 20px;
            width: 20px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            transition: .3s ease;
            border-radius: 50%;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }

        input:checked+.toggle-slider {
            background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
        }

        input:checked+.toggle-slider:before {
            transform: translateX(28px);
        }

        input:disabled+.toggle-slider {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .toggle-switch.small {
            width: 40px;
            height: 20px;
        }

        .toggle-switch.small .toggle-slider:before {
            height: 16px;
            width: 16px;
            left: 2px;
            bottom: 2px;
        }

        .toggle-switch.small input:checked+.toggle-slider:before {
            transform: translateX(20px);
        }

        /* Tabs */
        .tabs {
            display: flex;
            border-bottom: 1px solid var(--border);
            margin-bottom: 16px;
        }

        .tab {
            padding: 10px 16px;
            background: transparent;
            border: none;
            color: var(--light);
            font-weight: 500;
            cursor: pointer;
            position: relative;
            transition: all 0.2s;
        }

        .tab:hover {
            color: var(--accent-light);
        }

        .tab.active {
            color: var(--accent-light);
        }

        .tab.active::after {
            content: '';
            position: absolute;
            bottom: -1px;
            left: 0;
            right: 0;
            height: 2px;
            background: var(--accent-light);
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        /* Enhanced table for department management */
        .dept-management-table {
            width: 100%;
            border-collapse: collapse;
        }

        .dept-management-table th {
            background: rgba(255, 255, 255, 0.05);
            padding: 10px 12px;
            text-align: left;
            font-weight: 600;
            font-size: 11.5px;
            color: var(--accent-light);
            border-bottom: 1px solid var(--border);
        }

        .dept-management-table td {
            padding: 10px 12px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            vertical-align: middle;
        }

        .dept-management-table tr:hover {
            background: rgba(255, 255, 255, 0.03);
        }

        .dept-management-table .employee-count {
            font-size: 11px;
            color: var(--light);
        }

        .dept-management-table .admin-count {
            font-size: 10px;
            color: var(--accent-light);
            font-style: italic;
        }

        .dept-management-table .cannot-delete {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 8px;
            background: rgba(148, 163, 184, 0.1);
            border: 1px solid rgba(148, 163, 184, 0.2);
            border-radius: 4px;
            color: var(--light);
            font-size: 10.5px;
            font-weight: 500;
        }

        /* Improved employee table */
        .employee-management-table {
            width: 100%;
            border-collapse: collapse;
        }

        .employee-management-table th {
            background: rgba(255, 255, 255, 0.05);
            padding: 10px 12px;
            text-align: left;
            font-weight: 600;
            font-size: 11.5px;
            color: var(--accent-light);
            border-bottom: 1px solid var(--border);
        }

        .employee-management-table td {
            padding: 10px 12px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            vertical-align: middle;
        }

        /* Password requirements */
        .password-requirements {
            background: rgba(255, 255, 255, 0.03);
            border-radius: 6px;
            padding: 10px;
            margin-top: 5px;
            border: 1px solid var(--border);
        }

        .password-requirements ul {
            margin: 0;
            padding-left: 18px;
            font-size: 10.5px;
            color: var(--light);
        }

        .password-requirements li {
            margin-bottom: 3px;
        }

        .password-requirements .requirement-met {
            color: var(--green);
        }

        .password-requirements .requirement-not-met {
            color: var(--light);
        }

        /* === UI HEADER STYLES (FROM SMART INVENTORY) === */
        .ui-container {
            width: 100%;
            max-width: 1600px;
            margin: 0 auto;
            background: var(--bg-card);
            border-radius: 12px;
            border: 1px solid var(--border);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
            overflow: hidden;
            display: none;
        }

        header {
            background: linear-gradient(to right, #020617, #0f172a);
            padding: 15px 25px;
            border-bottom: 1px solid var(--border);
            position: relative;
            display: block;
            min-width: 1024px;
        }

        .header-top {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0;
            flex-wrap: wrap;
            gap: 10px;
        }

        .logo-section {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .logo-title-container {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
        }

        .logo-section h1 {
            font-size: 22px;
            color: var(--accent);
            font-weight: 900;
            display: flex;
            align-items: center;
            gap: 8px;
            line-height: 1.2;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
            margin: 0;
        }

        .badge-flag {
            display: inline-flex;
            align-items: center;
            background: var(--warning);
            color: #0f172a;
            font-size: 8px;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: 0.3px;
            padding: 2px 10px;
            transform: skewX(-20deg);
            margin-left: 5px;
            box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
            white-space: nowrap;
        }

        .badge-flag span {
            transform: skewX(20deg);
            display: block;
        }

        /* === HEADER RIGHT SECTION (REDESIGNED HORIZONTAL) === */
        .header-right {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 15px;
            width: auto;
            justify-content: flex-end;
        }

        .sync-panel {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 0;
            background: none;
            border: none;
            box-shadow: none;
        }

        .unified-chip {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 0 12px;
            height: 28px;
            border-radius: 6px;
            font-size: 9px;
            font-weight: 700;
            letter-spacing: 0.5px;
            cursor: pointer;
            white-space: nowrap;
            font-family: 'Roboto Mono', monospace;
            transition: all 0.35s ease;
            box-sizing: border-box;
            flex-shrink: 0;
            position: relative;
        }

        .unified-chip:hover {
            filter: brightness(1.25);
            box-shadow: 0 0 12px rgba(255, 255, 255, 0.08);
            transform: translateY(-1px);
        }

        .unified-chip-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            flex-shrink: 0;
            transition: background 0.3s ease, box-shadow 0.3s ease;
        }

        .unified-chip.unified-live {
            border: 1px solid rgba(34, 197, 94, 0.4);
            background: rgba(34, 197, 94, 0.12);
            color: #4ade80;
        }

        .unified-chip.unified-live .unified-chip-dot {
            background: #22c55e;
            box-shadow: 0 0 6px rgba(34, 197, 94, 0.7);
            animation: unified-pulse 2s ease-in-out infinite;
        }

        .unified-chip.unified-online {
            border: 1px solid rgba(245, 158, 11, 0.35);
            background: rgba(245, 158, 11, 0.1);
            color: #fbbf24;
        }

        .unified-chip.unified-online .unified-chip-dot {
            background: #f59e0b;
            box-shadow: 0 0 4px rgba(245, 158, 11, 0.5);
        }

        .unified-chip.unified-offline {
            border: 1px solid rgba(239, 68, 68, 0.35);
            background: rgba(239, 68, 68, 0.1);
            color: #f87171;
        }

        .unified-chip.unified-offline .unified-chip-dot {
            background: #ef4444;
            box-shadow: none;
        }

        .unified-chip.unified-syncing {
            border: 1px solid rgba(59, 130, 246, 0.4);
            background: rgba(59, 130, 246, 0.12);
            color: #60a5fa;
        }

        .unified-chip.unified-syncing .unified-chip-dot {
            background: #3b82f6;
            box-shadow: 0 0 6px rgba(59, 130, 246, 0.6);
            animation: unified-pulse 1s ease-in-out infinite;
        }

        .unified-chip.unified-connecting {
            border: 1px solid rgba(148, 163, 184, 0.25);
            background: rgba(148, 163, 184, 0.08);
            color: #94a3b8;
        }

        .unified-chip.unified-connecting .unified-chip-dot {
            background: #64748b;
            animation: unified-pulse 1.5s ease-in-out infinite;
        }

        @keyframes unified-pulse {

            0%,
            100% {
                opacity: 1;
                transform: scale(1);
            }

            50% {
                opacity: 0.5;
                transform: scale(0.75);
            }
        }

        .chip-time {
            font-size: 8px;
            font-weight: 600;
            opacity: 0.7;
            margin-left: 2px;
            letter-spacing: 0;
        }

        /* ROW 1: USER */
        .user-section {
            padding: 0;
            background: none;
            border: none;
            cursor: pointer;
        }

        .user-section:hover {
            background: none;
            border: none;
        }

        .user-info-compact {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .user-badge-elegant {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 16px;
            border-radius: 30px;
            font-size: 11px;
            font-weight: 700;
            white-space: nowrap;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            backdrop-filter: blur(4px);
            transition: all 0.3s ease;
        }

        .user-badge-elegant.admin {
            background: linear-gradient(135deg, rgba(220, 38, 38, 0.2), rgba(185, 28, 28, 0.2));
            border-color: rgba(220, 38, 38, 0.4);
            color: #fca5a5;
        }

        .user-badge-elegant.manager {
            background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(29, 78, 216, 0.2));
            border-color: rgba(37, 99, 235, 0.4);
            color: #93c5fd;
        }

        .user-badge-elegant.supervisor {
            background: linear-gradient(135deg, rgba(217, 119, 6, 0.2), rgba(180, 83, 9, 0.2));
            border-color: rgba(217, 119, 6, 0.4);
            color: #fcd34d;
        }

        .user-badge-elegant.staff, .user-badge-elegant.employee {
            background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(21, 128, 61, 0.2));
            border-color: rgba(34, 197, 94, 0.4);
            color: #4ade80;
        }

        .user-badge-elegant.user {
            background: linear-gradient(135deg, rgba(5, 150, 105, 0.2), rgba(4, 120, 87, 0.2));
            border-color: rgba(5, 150, 105, 0.4);
            color: #6ee7b7;
        }

        .user-badge-elegant.viewer {
            background: linear-gradient(135deg, rgba(75, 85, 99, 0.2), rgba(55, 65, 81, 0.2));
            border-color: rgba(75, 85, 99, 0.4);
            color: #d1d5db;
        }

        /* NAV ITEM ELEGANT */
        .nav-item-elegant {
            background: transparent;
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: var(--text-muted);
            padding: 8px 12px;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 11px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 6px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            text-decoration: none;
        }

        .nav-item-elegant:hover {
            background: rgba(255, 255, 255, 0.05);
            color: var(--accent);
            border-color: var(--accent);
            box-shadow: 0 0 10px rgba(56, 189, 248, 0.1);
        }

        .nav-item-elegant i {
            font-size: 13px;
            color: var(--accent);
            opacity: 0.8;
        }

        .nav-item-elegant:hover i {
            opacity: 1;
        }

        .logout-btn-elegant {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: #94a3b8;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .logout-btn-elegant:hover {
            background: rgba(239, 68, 68, 0.2);
            color: #ef4444;
            border-color: rgba(239, 68, 68, 0.4);
            transform: scale(1.1);
            box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
        }

        /* NAVIGATION */
        nav {
            display: flex;
            gap: 5px;
            flex-wrap: wrap;
            background: rgba(255, 255, 255, 0.03);
            padding: 5px;
            border-radius: 8px;
            border: 1px solid rgba(255, 255, 255, 0.05);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
            margin-top: 22px;
            position: relative;
        }

        nav a,
        nav .nav-item {
            color: var(--text-muted);
            text-decoration: none;
            font-size: 10px;
            font-weight: 700;
            cursor: pointer;
            padding: 8px 12px;
            border-radius: 6px;
            border: 1px solid transparent;
            text-transform: uppercase;
            transition: all 0.2s;
            white-space: nowrap;
            letter-spacing: 0.5px;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            position: relative;
        }

        nav a:hover,
        nav .nav-item:hover {
            color: white;
            background: rgba(255, 255, 255, 0.1);
            border-color: rgba(255, 255, 255, 0.1);
        }

        nav a.active,
        nav .nav-item.active {
            background: var(--accent);
            color: #0f172a;
            border-color: var(--accent);
            box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
            font-weight: 900;
        }

        nav .nav-item.locked {
            opacity: 0.5;
            cursor: not-allowed;
            background: rgba(0, 0, 0, 0.2);
            border: 1px dashed var(--danger);
            color: var(--danger);
        }

        /* OVERRIDE EXISTING HEADER STYLES IF ANY */
        .header-left,
        .header-center {
            display: none;
        }

        /* Hide old header parts */
        .attendance-status-banner {
            width: 100%;
            padding: 15px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            font-size: 1.1rem;
            font-weight: 600;
            text-align: center;
            margin-bottom: 10px;
        }

        .attendance-status-banner.status-success {
            background: rgba(16, 185, 129, 0.1);
            color: #10b981;
            border: 1px solid rgba(16, 185, 129, 0.2);
        }

        .attendance-status-banner.status-info {
            background: rgba(59, 130, 246, 0.1);
            color: #3b82f6;
            border: 1px solid rgba(59, 130, 246, 0.2);
        }

        /* Mobile Responsive Fixes */
        .table-container {
            width: 100%;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            margin-bottom: 1rem;
            border: 1px solid var(--border);
            border-radius: 6px;
        }

        @media only screen and (max-width: 768px) {
            /* PC layout preserved. Mobile overrides removed to ensure full horizontal scroll like PC. */
            /* Fix modal width on mobile */
            .modal {
                align-items: center; /* Center on mobile */
                justify-content: center;
                padding: 10px;
                overflow: visible; /* MUST be visible so child elements can scroll horizontally */
            }
            .modal-content {
                width: 98%;
                min-width: unset; /* Allow it to be narrow */
                max-width: 480px;
                margin: auto;
                max-height: 95vh;
                display: flex;
                flex-direction: column;
            }
            /* Employee management modal needs full width for table */
            #manageEmployeesModal .modal-content {
                max-width: 98vw;
                width: 98%;
            }
            .modal-body {
                padding: 10px;
                overflow-y: auto; /* Scroll inside modal body */
                overflow-x: auto; /* Allow horizontal scroll for wide tables */
                flex: 1;
            }
            /* Form elements even smaller on mobile */
            .form-group-compact label {
                font-size: 10px !important;
            }
            .form-control-compact {
                height: 30px !important;
                font-size: 11px !important;
                padding: 4px 8px !important;
            }
            .section-title-2 {
                font-size: 11px !important;
                margin-bottom: 6px !important;
            }
        }

        /* === SMART INVENTORY UI PORT === */
        .header-right {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 12px;
            width: auto;
        }

        /* USER & BACKUP COMMON STYLES */
        .user-badge-elegant,
        .backup-status {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 0 8px;
            height: 24px;
            min-width: 130px;
            border-radius: 6px;
            font-size: 9px;
            font-family: 'Roboto Mono', monospace;
            font-weight: 700;
            white-space: nowrap;
            background: transparent;
            border: 1px solid transparent;
            transition: all 0.3s ease;
            cursor: pointer;
            box-sizing: border-box;
            flex-shrink: 0;
            margin: 0;
            /* Override any previous margins */
        }

        /* USER ROLE STYLES */
        .user-badge-elegant.admin {
            color: #f87171;
            background: rgba(248, 113, 113, 0.1);
            border-color: rgba(248, 113, 113, 0.2);
        }

        .user-badge-elegant.manager {
            color: #60a5fa;
            background: rgba(96, 165, 250, 0.1);
            border-color: rgba(96, 165, 250, 0.2);
        }

        .user-badge-elegant.supervisor {
            color: #fbbf24;
            background: rgba(251, 191, 36, 0.1);
            border-color: rgba(251, 191, 36, 0.2);
        }

        .user-badge-elegant.user {
            color: #34d399;
            background: rgba(52, 211, 153, 0.1);
            border-color: rgba(52, 211, 153, 0.2);
        }

        .user-badge-elegant.viewer {
            color: #9ca3af;
            background: rgba(156, 163, 175, 0.1);
            border-color: rgba(156, 163, 175, 0.2);
        }

        .user-badge-elegant:hover {
            filter: brightness(1.2);
            box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
        }

        /* BACKUP STYLES */
        .backup-status.active {
            color: #34d399;
            background: rgba(16, 185, 129, 0.1);
            border-color: rgba(16, 185, 129, 0.2);
        }

        .backup-status.inactive {
            color: #f87171;
            background: rgba(239, 68, 68, 0.1);
            border-color: rgba(239, 68, 68, 0.2);
        }

        @keyframes pulse-green {
            0% {
                box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4);
            }

            70% {
                box-shadow: 0 0 0 6px rgba(52, 211, 153, 0);
            }

            100% {
                box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
            }
        }

        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }

        .backup-status.active {
            animation: pulse-green 2s infinite;
        }

        .backup-status.active i {
            display: inline-block !important;
            animation: spin 2s linear infinite !important;
        }

        /* TIMER BADGE */
        .timer-badge {
            background: transparent;
            padding: 0;
            border: none;
            font-size: 9px;
            font-family: 'Roboto Mono', monospace;
            display: flex;
            align-items: center;
            border-left: 1px solid rgba(255, 255, 255, 0.2);
            padding-left: 6px;
            margin-left: 6px;
            height: 100%;
        }

        /* LOGOUT BUTTON */
        .logout-btn-elegant {
            width: 34px;
            height: 34px;
            border-radius: 50%;
            background: rgba(239, 68, 68, 0.1);
            border: 1px solid rgba(239, 68, 68, 0.3);
            color: var(--danger);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
            flex-shrink: 0;
        }

        .logout-btn-elegant:hover {
            background: rgba(239, 68, 68, 0.2);
            color: #ef4444;
            border-color: rgba(239, 68, 68, 0.4);
            transform: scale(1.1);
            box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
        }

        .logout-btn-elegant i {
            font-size: 13px;
        }

        /* ==================== BATCH 2: NEW FEATURES CSS ==================== */

        /* 1. ANALYTICS GRID LAYOUT */
        .analytics-grid-2col {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 20px;
            margin-bottom: 20px;
        }

        @media (max-width: 768px) {
            .analytics-grid-2col {
                grid-template-columns: 1fr;
            }
        }

        .chart-container {
            background: var(--bg-card);
            padding: 15px;
            border-radius: 12px;
            border: 1px solid var(--border);
            position: relative;
            height: 300px;
        }

        /* 2. PROFILE CARD MODAL */
        .profile-card-header {
            background: linear-gradient(135deg, var(--primary), var(--accent));
            padding: 30px 20px;
            border-radius: 12px 12px 0 0;
            text-align: center;
            color: white;
            position: relative;
        }

        .profile-avatar-xl {
            width: 100px;
            height: 100px;
            background: white;
            border-radius: 50%;
            margin: 0 auto -50px;
            /* Overlap effect */
            border: 4px solid var(--bg-card);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 40px;
            color: var(--primary);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
            overflow: hidden;
        }

        .profile-avatar-xl img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .profile-card-body {
            padding: 60px 20px 20px;
            /* Top padding to accommodate overlapped avatar */
            text-align: center;
        }

        .profile-name {
            font-size: 20px;
            font-weight: 800;
            color: var(--text-main);
            margin-bottom: 5px;
        }

        .profile-role-badge {
            background: rgba(56, 189, 248, 0.1);
            color: var(--accent);
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 700;
            display: inline-block;
            margin-bottom: 20px;
        }

        .profile-stats-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
            margin-top: 20px;
            text-align: left;
        }

        .profile-stat-item {
            background: var(--bg-input);
            padding: 12px;
            border-radius: 8px;
            border: 1px solid var(--border);
        }

        .profile-stat-label {
            font-size: 10px;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .profile-stat-value {
            font-size: 14px;
            font-weight: 700;
            color: var(--text-main);
            margin-top: 2px;
        }

        /* 3. NOTIFICATION DROPDOWN */
        .notification-dropdown {
            position: absolute;
            top: 50px;
            /* Below header */
            right: 20px;
            width: 320px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
            z-index: 2000;
            display: none;
            /* Toggled by JS */
            flex-direction: column;
            overflow: hidden;
            animation: slideDownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .notification-dropdown.active {
            display: flex;
        }

        .notif-header {
            padding: 12px 16px;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: rgba(15, 23, 42, 0.5);
            backdrop-filter: blur(5px);
        }

        .notif-list {
            max-height: 400px;
            overflow-y: auto;
        }

        .notif-item {
            padding: 12px 16px;
            border-bottom: 1px solid var(--border);
            transition: background 0.2s;
            cursor: pointer;
            display: flex;
            gap: 12px;
            align-items: flex-start;
        }

        .notif-item:hover {
            background: rgba(56, 189, 248, 0.05);
            /* var(--accent) very low opacity */
        }

        .notif-item.unread {
            background: rgba(56, 189, 248, 0.1);
            /* var(--accent) low opacity */
            border-left: 3px solid var(--accent);
        }

        .notif-icon-circle {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            font-size: 14px;
        }

        .notif-content {
            flex: 1;
        }

        .notif-title {
            font-size: 13px;
            font-weight: 700;
            color: var(--text-main);
            margin-bottom: 2px;
        }

        .notif-desc {
            font-size: 11px;
            color: var(--text-muted);
            line-height: 1.4;
        }

        .notif-time {
            font-size: 9px;
            color: var(--text-muted);
            margin-top: 4px;
            display: block;
        }

        .notif-empty {
            padding: 40px 20px;
            text-align: center;
            color: var(--text-muted);
            font-size: 13px;
        }

        @keyframes slideDownFade {
            from {
                opacity: 0;
                transform: translateY(-10px) scale(0.98);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        /* 4. LATE INDICATOR (PULSING) */
        .late-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            background: rgba(239, 68, 68, 0.15);
            /* var(--danger) */
            color: var(--danger);
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 10px;
            font-weight: 700;
            border: 1px solid rgba(239, 68, 68, 0.3);
        }

        .late-dot {
            width: 6px;
            height: 6px;
            background: var(--danger);
            border-radius: 50%;
            animation: pulseRed 2s infinite;
        }

        @keyframes pulseRed {
            0% {
                transform: scale(0.95);
                box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
            }

            70% {
                transform: scale(1);
                box-shadow: 0 0 0 4px rgba(239, 68, 68, 0);
            }

            100% {
                transform: scale(0.95);
                box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
            }
        }

        /* 5. LOGIN UX ENHANCEMENTS */
        .btn-loading {
            position: relative;
            color: transparent !important;
            pointer-events: none;
        }

        .btn-loading::after {
            content: "";
            position: absolute;
            width: 16px;
            height: 16px;
            top: 50%;
            left: 50%;
            margin-top: -8px;
            margin-left: -8px;
            border: 2px solid #0f172a;
            /* Dark text color */
            border-top-color: transparent;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

        .toggle-password-btn {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            font-size: 12px;
            padding: 5px;
            outline: none;
            transition: color 0.2s;
        }

        .toggle-password-btn:hover {
            color: var(--text-main);
        }

        .input-group-relative {
            position: relative;
            width: 100%;
        }

        .remember-me-container {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 20px;
            font-size: 12px;
            color: var(--text-muted);
            cursor: pointer;
        }

        .remember-me-checkbox {
            accent-color: var(--accent);
            width: 14px;
            height: 14px;
            cursor: pointer;
        }

        /* Glassmorphism Toast Notifications */
        #notification-container {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 10000;
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: none;
            /* Let clicks pass through */
        }

        .toast-notification {
            pointer-events: auto;
            width: 320px;
            background: rgba(15, 23, 42, 0.85);
            /* Darker glass for better contrast */
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 12px 16px;
            display: flex;
            align-items: flex-start;
            gap: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
            color: var(--text-main);
            transform: translateX(100%);
            /* Start off-screen */
            opacity: 0;
            transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
            position: relative;
            overflow: hidden;
            margin-top: 5px;
        }

        .toast-notification.show {
            transform: translateX(0);
            opacity: 1;
        }

        .toast-icon {
            font-size: 20px;
            flex-shrink: 0;
            margin-top: 2px;
        }

        .toast-success .toast-icon {
            color: var(--success);
        }

        .toast-error .toast-icon {
            color: var(--danger);
        }

        .toast-warning .toast-icon {
            color: var(--warning);
        }

        .toast-info .toast-icon {
            color: var(--info);
        }

        .toast-content {
            flex: 1;
        }

        .toast-message {
            font-size: 13px;
            font-weight: 500;
            line-height: 1.4;
            color: var(--white);
            word-break: break-word;
        }

        .toast-close {
            color: var(--text-muted);
            cursor: pointer;
            transition: color 0.2s;
            font-size: 14px;
            margin-top: 2px;
        }

        .toast-close:hover {
            color: var(--white);
        }

        /* Progress bar */
        .toast-progress {
            position: absolute;
            bottom: 0;
            left: 0;
            height: 3px;

            from {
                opacity: 0;
                transform: translateY(-10px) scale(0.98);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        /* 4. LATE INDICATOR (PULSING) */
        .late-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            background: rgba(239, 68, 68, 0.15);
            /* var(--danger) */
            color: var(--danger);
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 10px;
            font-weight: 700;
            border: 1px solid rgba(239, 68, 68, 0.3);
        }

        .late-dot {
            width: 6px;
            height: 6px;
            background: var(--danger);
            border-radius: 50%;
            animation: pulseRed 2s infinite;
        }

        @keyframes pulseRed {
            0% {
                transform: scale(0.95);
                box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
            }

            70% {
                transform: scale(1);
                box-shadow: 0 0 0 4px rgba(239, 68, 68, 0);
            }

            100% {
                transform: scale(0.95);
                box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
            }
        }

        /* 5. LOGIN UX ENHANCEMENTS */
        .btn-loading {
            position: relative;
            color: transparent !important;
            pointer-events: none;
        }

        .btn-loading::after {
            content: "";
            position: absolute;
            width: 16px;
            height: 16px;
            top: 50%;
            left: 50%;
            margin-top: -8px;
            margin-left: -8px;
            border: 2px solid #0f172a;
            /* Dark text color */
            border-top-color: transparent;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

        .toggle-password-btn {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            font-size: 12px;
            padding: 5px;
            outline: none;
            transition: color 0.2s;
        }

        .toggle-password-btn:hover {
            color: var(--text-main);
        }

        .input-group-relative {
            position: relative;
            width: 100%;
        }

        .remember-me-container {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 20px;
            font-size: 12px;
            color: var(--text-muted);
            cursor: pointer;
        }

        .remember-me-checkbox {
            accent-color: var(--accent);
            width: 14px;
            height: 14px;
            cursor: pointer;
        }

        /* Glassmorphism Toast Notifications */
        #notification-container {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 10000;
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: none;
            /* Let clicks pass through */
        }

        .toast-notification {
            pointer-events: auto;
            width: 320px;
            background: rgba(15, 23, 42, 0.85);
            /* Darker glass for better contrast */
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 12px 16px;
            display: flex;
            align-items: flex-start;
            gap: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
            color: var(--text-main);
            transform: translateX(100%);
            /* Start off-screen */
            opacity: 0;
            transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
            position: relative;
            overflow: hidden;
            margin-top: 5px;
        }

        .toast-notification.show {
            transform: translateX(0);
            opacity: 1;
        }

        .toast-icon {
            font-size: 20px;
            flex-shrink: 0;
            margin-top: 2px;
        }

        .toast-success .toast-icon {
            color: var(--success);
        }

        .toast-error .toast-icon {
            color: var(--danger);
        }

        .toast-warning .toast-icon {
            color: var(--warning);
        }

        .toast-info .toast-icon {
            color: var(--info);
        }

        .toast-content {
            flex: 1;
        }

        .toast-message {
            font-size: 13px;
            font-weight: 500;
            line-height: 1.4;
            color: var(--white);
            word-break: break-word;
        }

        .toast-close {
            color: var(--text-muted);
            cursor: pointer;
            transition: color 0.2s;
            font-size: 14px;
            margin-top: 2px;
        }

        .toast-close:hover {
            color: var(--white);
        }

        /* Progress bar */
        .toast-progress {
            position: absolute;
            bottom: 0;
            left: 0;
            height: 3px;
            background: rgba(255, 255, 255, 0.2);
            width: 100%;
            animation: progress linear forwards;
        }

        @keyframes progress {
            from {
                width: 100%;
            }

            to {
                width: 0%;
            }
        }

        /* ==================== INJECTED UNIFIED CHIP & BACKUP HOVER ==================== */
        .sync-panel {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 0;
            background: none;
            border: none;
            box-shadow: none;
        }

        .unified-chip {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 0 12px;
            height: 28px;
            border-radius: 6px;
            font-size: 9px;
            font-weight: 700;
            letter-spacing: 0.5px;
            cursor: pointer;
            white-space: nowrap;
            font-family: 'Roboto Mono', monospace;
            transition: all 0.35s ease;
            box-sizing: border-box;
            flex-shrink: 0;
            position: relative;
            z-index: 1;
        }

        .unified-chip:hover {
            filter: brightness(1.25);
            box-shadow: 0 0 12px rgba(255, 255, 255, 0.08);
            transform: translateY(-1px);
        }

        .unified-chip-dot {
            position: relative;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            flex-shrink: 0;
            transition: background 0.3s ease, box-shadow 0.3s ease;
        }

        .unified-chip-dot::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 100%;
            height: 100%;
            border-radius: 50%;
            z-index: -1;
            opacity: 0;
        }

        .unified-chip.unified-live {
            border: 1px solid rgba(63, 185, 80, 0.4);
            background: rgba(63, 185, 80, 0.12);
            color: #3fb950;
        }

        .unified-chip.unified-live .unified-chip-dot {
            background: #3fb950;
            box-shadow: 0 0 12px rgba(63, 185, 80, 0.8);
        }

        .unified-chip.unified-live .unified-chip-dot::after {
            background-color: #3fb950;
            animation: premium-pulse-ring 2.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
        }

        .unified-chip.unified-online {
            border: 1px solid rgba(245, 158, 11, 0.35);
            background: rgba(245, 158, 11, 0.1);
            color: #fbbf24;
        }

        .unified-chip.unified-online .unified-chip-dot {
            background: #f59e0b;
            box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
        }

        .unified-chip.unified-online .unified-chip-dot::after {
            background-color: #f59e0b;
        }

        .unified-chip.unified-offline {
            border: 1px solid rgba(239, 68, 68, 0.35);
            background: rgba(239, 68, 68, 0.1);
            color: #f87171;
        }

        .unified-chip.unified-offline .unified-chip-dot {
            background: #ef4444;
            box-shadow: none;
        }

        .unified-chip.unified-syncing {
            border: 1px solid rgba(88, 166, 255, 0.4);
            background: rgba(88, 166, 255, 0.12);
            color: #58a6ff;
        }

        .unified-chip.unified-syncing .unified-chip-dot {
            background: #58a6ff;
            box-shadow: 0 0 12px rgba(88, 166, 255, 0.8);
        }

        .unified-chip.unified-syncing .unified-chip-dot::after {
            background-color: #58a6ff;
            animation: premium-pulse-ring 1.2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
        }

        .unified-chip.unified-connecting {
            border: 1px solid rgba(148, 163, 184, 0.25);
            background: rgba(148, 163, 184, 0.08);
            color: #94a3b8;
        }

        .unified-chip.unified-connecting .unified-chip-dot {
            background: #64748b;
            box-shadow: 0 0 8px rgba(100, 116, 139, 0.5);
        }

        .unified-chip.unified-connecting .unified-chip-dot::after {
            background-color: #64748b;
            animation: premium-pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
        }

        @keyframes premium-pulse-ring {
            0% {
                transform: translate(-50%, -50%) scale(1);
                opacity: 0.8;
            }

            100% {
                transform: translate(-50%, -50%) scale(4.5);
                opacity: 0;
            }
        }

        .chip-time {
            font-size: 8px;
            font-weight: 600;
            opacity: 0.7;
            margin-left: 2px;
            letter-spacing: 0;
        }

        .backup-status:hover {
            filter: brightness(1.2);
            box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
        }

        /* ==================== LOGOUT BUTTON ==================== */
        .logout-btn-elegant {
            width: 28px;
            height: 28px;
            border-radius: 6px;
            background: rgba(239, 68, 68, 0.1);
            border: 1px solid rgba(239, 68, 68, 0.3);
            color: var(--danger);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
            flex-shrink: 0;
        }

        .logout-btn-elegant:hover {
            background: rgba(239, 68, 68, 0.2);
            color: #ef4444;
            border-color: rgba(239, 68, 68, 0.4);
            transform: scale(1.05);
            box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
        }

        .logout-btn-elegant i {
            font-size: 11px;
        }
.badge-flag {
    display: inline-flex;
    align-items: center;
    background: var(--warning);
    color: #0f172a;
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2px 10px;
    transform: skewX(-20deg);
    margin-left: 5px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.badge-flag span {
    transform: skewX(20deg);
    display: block;
}

/* ==================== ISSUE #1 FIX: Responsive Self-Registration Modal ==================== */
#selfRegistrationModal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background-color: rgba(0,0,0,0.8);
    justify-content: flex-start;
    align-items: flex-start;
    padding: 20px 0;
}

#selfRegistrationModal .modal-content {
    max-height: none !important;
    overflow-y: visible;
    margin: auto !important;
    width: 90% !important;
    max-width: 400px !important;
}

/* All screen sizes: ensure buttons are always visible */
#selfRegistrationModal .btn {
    font-size: 13px !important;
    padding: 10px 16px !important;
    min-height: 40px;
    white-space: nowrap;
    overflow: visible;
}

@media screen and (max-width: 480px) {
    #selfRegistrationModal .modal-content {
        width: 95% !important;
        max-width: 360px !important;
        padding: 15px !important;
        margin: 10px auto !important;
    }
    #selfRegistrationModal .modal-content h2 {
        font-size: 16px !important;
        margin-bottom: 12px !important;
    }
    #selfRegistrationModal .form-group-compact {
        margin-bottom: 8px;
    }
    #selfRegistrationModal .form-group-compact label {
        font-size: 11px !important;
        margin-bottom: 3px;
    }
    #selfRegistrationModal .form-control-compact,
    #selfRegistrationModal input[type="text"],
    #selfRegistrationModal input[type="password"],
    #selfRegistrationModal select {
        font-size: 13px !important;
        padding: 8px 10px !important;
        height: auto !important;
        min-height: 36px;
    }
    #selfRegistrationModal .btn {
        font-size: 12px !important;
        padding: 10px 12px !important;
    }
}

/* LANDSCAPE FIX: Make modal scrollable and all content visible */
@media screen and (orientation: landscape) {
    #selfRegistrationModal {
        padding: 10px 0;
    }
    #selfRegistrationModal .modal-content {
        max-width: 500px !important;
        padding: 12px 20px !important;
        margin: 10px auto !important;
    }
    #selfRegistrationModal .modal-content h2 {
        font-size: 14px !important;
        margin-bottom: 8px !important;
        word-break: break-word;
        white-space: normal;
        line-height: 1.3;
    }
    #selfRegistrationModal .form-group-compact {
        margin-bottom: 6px;
    }
    #selfRegistrationModal .form-group-compact label {
        font-size: 10px !important;
        margin-bottom: 2px;
    }
    #selfRegistrationModal .form-control-compact,
    #selfRegistrationModal input[type="text"],
    #selfRegistrationModal input[type="password"],
    #selfRegistrationModal select {
        font-size: 12px !important;
        padding: 6px 8px !important;
        min-height: 32px;
    }
    #selfRegistrationModal .btn {
        font-size: 12px !important;
        padding: 8px 12px !important;
        min-height: 36px;
    }
}

/* ==================== F2 FIX: Employee Table - Same Layout on All Devices ==================== */
/* Override the 480px max-width constraint on mobile for the employee management modal */
#manageEmployeesModal .modal-content {
    max-width: 95vw !important;
    width: 95% !important;
}

/* Allow horizontal scroll inside the modal body so the table can scroll */
#manageEmployeesModal .modal-body {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* Table container also scrollable */
#employeeListContainer {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Table maintains minimum width so layout never collapses on small screens */
.employee-management-table {
    min-width: 800px !important;
}

/* Action buttons: always in one horizontal row, no wrapping */
.emp-action-btns {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    align-items: center;
}

/* Action buttons: consistent styling */
.emp-action-btns .action-btn {
    padding: 4px 8px !important;
    font-size: 11px !important;
    min-width: 30px;
    min-height: 30px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    touch-action: pan-x pan-y; /* Allow scroll gesture even when touching buttons */
}

/* ALL buttons/interactive elements inside employee table must allow touch scroll */
#manageEmployeesModal button,
#manageEmployeesModal .action-btn,
#manageEmployeesModal .btn,
#manageEmployeesModal a,
.employee-management-table button,
.employee-management-table .action-btn,
.emp-table-scroll button,
.emp-table-scroll .action-btn {
    touch-action: pan-x pan-y !important;
}

