        :root {
            --primary: #EB0A1E;
            --primary-hover: #C00818;
            --success: #00A86B;
            --danger: #DC3545;
            --warning: #F59E0B;
            --bg-main: #F5F5F5;
            --bg-card: #FFFFFF;
            --border: #D1D5DB;
            --text-primary: #1A1A1A;
            --text-secondary: #4A4A4A;
            --gray-dark: #2C2C2C;
            --gray-medium: #6B6B6B;
            --gray-light: #E8E8E8;
            --shadow-sm: 0 1px 2px rgba(0,0,0,0.08);
            --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
            --shadow-lg: 0 10px 15px rgba(0,0,0,0.12);
        }

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

        body {
            font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
            background: var(--bg-main);
            color: var(--text-primary);
            line-height: 1.6;
        }

        .test-environment-banner {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 0.75rem;
            padding: 0.55rem 1rem;
            background: linear-gradient(90deg, #1f2937, #374151);
            color: #f9fafb;
            font-size: 0.813rem;
            font-weight: 600;
            letter-spacing: 0.01em;
        }

        .test-environment-banner span {
            color: #d1d5db;
            font-weight: 500;
        }

        .header {
            background: var(--bg-card);
            border-bottom: 1px solid var(--border);
            padding: 1.25rem 2rem;
            box-shadow: var(--shadow-sm);
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .header-content {
            max-width: 1600px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .header h1 {
            font-size: 1.5rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .header-actions {
            display: flex;
            gap: 0.75rem;
            align-items: center;
        }

        .dev-user-switcher {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.4rem 0.75rem;
            background: #F9FAFB;
            border: 1px solid var(--border);
            border-radius: 8px;
        }

        .dev-user-switcher label {
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .dev-user-select {
            border: none;
            background: transparent;
            color: var(--text-primary);
            font: inherit;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            outline: none;
        }

        .status-indicator {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 1rem;
            background: #FEF3C7;
            border-radius: 6px;
            font-size: 0.875rem;
            font-weight: 500;
            color: #92400E;
        }

        .status-indicator.saved {
            background: #D1FAE5;
            color: #065F46;
        }

        .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: currentColor;
            animation: pulse 2s ease-in-out infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }

        .container {
            max-width: 1600px;
            margin: 2rem auto;
            padding: 0 2rem;
        }

        .week-selector {
            background: var(--bg-card);
            border-radius: 12px;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            box-shadow: var(--shadow-sm);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .week-nav {
            display: flex;
            gap: 1rem;
            align-items: center;
        }

        .week-display {
            font-size: 1.125rem;
            font-weight: 600;
            color: var(--text-primary);
            min-width: 280px;
            text-align: center;
        }

        .quick-actions {
            display: flex;
            gap: 0.75rem;
        }

        button {
            padding: 0.625rem 1.25rem;
            border: none;
            border-radius: 6px;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s ease;
            font-family: inherit;
        }

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

        .btn-primary:hover {
            background: var(--primary-hover);
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }

        .btn-secondary {
            background: var(--bg-main);
            color: var(--text-primary);
            border: 1px solid var(--border);
        }

        .btn-secondary:hover {
            background: #E5E7EB;
        }

        .btn-icon {
            padding: 0.625rem;
            background: var(--bg-main);
            color: var(--text-secondary);
            border: 1px solid var(--border);
        }

        .btn-icon:hover {
            background: #E5E7EB;
            color: var(--text-primary);
        }

        .btn-success {
            background: var(--success);
            color: white;
        }

        .btn-success:hover {
            background: #008F5D;
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }

        .timesheet-table {
            background: var(--bg-card);
            border-radius: 12px;
            overflow: hidden;
            box-shadow: var(--shadow-md);
        }

        .table-header {
            display: grid;
            grid-template-columns: 2fr repeat(7, 1fr) 80px;
            background: linear-gradient(135deg, #2C2C2C 0%, #1A1A1A 100%);
            color: white;
            padding: 1rem 1.5rem;
            font-weight: 600;
            font-size: 0.875rem;
            text-transform: uppercase;
            letter-spacing: 0.025em;
        }

        .table-header > div {
            display: flex;
            align-items: center;
        }

        .day-header {
            flex-direction: column;
            align-items: center;
            gap: 0.25rem;
        }

        .day-name {
            font-size: 0.75rem;
            opacity: 0.9;
        }

        .day-date {
            font-size: 0.875rem;
            font-weight: 500;
        }

        .table-body {
            padding: 0.5rem;
        }

        .timesheet-row {
            display: grid;
            grid-template-columns: 2fr repeat(7, 1fr) 80px;
            gap: 0.5rem;
            padding: 0.75rem 1rem;
            align-items: center;
            border-bottom: 1px solid var(--border);
            transition: background 0.15s ease;
            position: relative;
        }

        .timesheet-row.week-mode {
            grid-template-columns: 2fr 1fr 80px;
        }

        .timesheet-row:hover {
            background: #F9FAFB;
        }

        .entry-mode-toggle {
            display: flex;
            gap: 0.5rem;
            align-items: center;
            background: var(--bg-main);
            padding: 0.375rem;
            border-radius: 8px;
            border: 1px solid var(--border);
        }

        .mode-btn {
            padding: 0.5rem 1rem;
            border: none;
            border-radius: 6px;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s ease;
            background: transparent;
            color: var(--text-secondary);
        }

        .mode-btn.active {
            background: var(--primary);
            color: white;
            box-shadow: var(--shadow-sm);
        }

        .mode-btn:hover:not(.active) {
            background: rgba(235, 10, 30, 0.1);
            color: var(--primary);
        }

        .week-hours-input {
            width: 100%;
            padding: 0.625rem;
            border: 1px solid var(--border);
            border-radius: 6px;
            font-size: 0.875rem;
            font-family: 'JetBrains Mono', monospace;
            text-align: center;
            font-weight: 500;
            transition: all 0.15s ease;
        }

        .week-hours-input:focus {
            outline: none;
            border-color: var(--gray-medium);
            box-shadow: 0 0 0 3px rgba(107, 107, 107, 0.1);
        }

        .week-hours-input.has-value {
            background: white;
            border-color: var(--border);
            color: var(--text-primary);
        }

        .hours-container {
            display: contents;
        }

        .hours-container.week-mode {
            display: flex;
            gap: 0.5rem;
            align-items: center;
        }

        .week-mode-label {
            font-size: 0.813rem;
            color: var(--text-secondary);
            white-space: nowrap;
        }

        .project-cell {
            position: relative;
        }

        .project-input {
            width: 100%;
            padding: 0.625rem;
            border: 1px solid var(--border);
            border-radius: 6px;
            font-size: 0.875rem;
            font-family: inherit;
            transition: all 0.15s ease;
        }

        .project-input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(235, 10, 30, 0.1);
        }

        .autocomplete-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            margin-top: 4px;
            background: white;
            border: 1px solid var(--border);
            border-radius: 6px;
            box-shadow: var(--shadow-lg);
            max-height: 240px;
            overflow-y: auto;
            z-index: 50;
            display: none;
        }

        .autocomplete-dropdown.show {
            display: block;
        }

        .autocomplete-item {
            padding: 0.75rem;
            cursor: pointer;
            transition: background 0.1s ease;
            border-bottom: 1px solid var(--border);
        }

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

        .autocomplete-item:hover {
            background: #F3F4F6;
        }

        .autocomplete-item.selected {
            background: #FFF5F5;
        }

        .project-code {
            font-family: 'JetBrains Mono', monospace;
            font-weight: 500;
            color: var(--primary);
            font-size: 0.813rem;
        }

        .project-name {
            font-size: 0.813rem;
            color: var(--text-secondary);
            margin-top: 0.125rem;
        }

        .hours-input {
            width: 100%;
            padding: 0.625rem;
            border: 1px solid var(--border);
            border-radius: 6px;
            font-size: 0.875rem;
            font-family: 'JetBrains Mono', monospace;
            text-align: center;
            font-weight: 500;
            transition: all 0.15s ease;
        }

        .hours-input:focus {
            outline: none;
            border-color: var(--gray-medium);
            box-shadow: 0 0 0 3px rgba(107, 107, 107, 0.1);
        }

        .hours-input.has-value {
            background: white;
            border-color: var(--border);
            color: var(--text-primary);
        }

        .row-total {
            font-family: 'JetBrains Mono', monospace;
            font-weight: 600;
            font-size: 0.938rem;
            text-align: center;
            color: var(--text-primary);
            padding: 0.625rem;
            background: #F9FAFB;
            border-radius: 6px;
        }

        .delete-btn {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            padding: 0.375rem 0.5rem;
            background: #FFFFFF;
            color: var(--text-secondary);
            border: 1px solid var(--border);
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.15s ease;
            font-size: 0.75rem;
            z-index: 2;
        }

        .delete-btn:hover {
            background: #FEE2E2;
            color: var(--danger);
        }

        .add-row-container {
            padding: 1rem 1.5rem;
            border-top: 2px dashed var(--border);
            text-align: center;
        }

        .add-row-btn {
            padding: 0.75rem 1.5rem;
            background: transparent;
            color: var(--primary);
            border: 2px dashed var(--primary);
            border-radius: 6px;
            cursor: pointer;
            font-weight: 500;
            transition: all 0.15s ease;
        }

        .add-row-btn:hover {
            background: #FFF5F5;
            border-style: solid;
        }

        .totals-bar {
            background: linear-gradient(135deg, #E8E8E8 0%, #D1D5DB 100%);
            padding: 1.25rem 1.5rem;
            border-top: 2px solid var(--border);
        }

        .totals-grid {
            display: grid;
            grid-template-columns: 2fr repeat(7, 1fr) 80px;
            gap: 0.5rem;
            align-items: center;
        }

        .totals-label {
            font-weight: 600;
            font-size: 0.938rem;
            color: var(--text-primary);
        }

        .day-total {
            font-family: 'JetBrains Mono', monospace;
            font-weight: 600;
            font-size: 0.938rem;
            text-align: center;
            padding: 0.625rem;
            background: white;
            border-radius: 6px;
            border: 1px solid var(--border);
        }

        .week-total {
            font-family: 'JetBrains Mono', monospace;
            font-weight: 700;
            font-size: 1.125rem;
            text-align: center;
            padding: 0.625rem;
            background: var(--primary);
            color: white;
            border-radius: 6px;
            box-shadow: var(--shadow-md);
        }

        .templates-section {
            background: var(--bg-card);
            border-radius: 12px;
            padding: 1.5rem;
            margin-top: 1.5rem;
            box-shadow: var(--shadow-sm);
        }

        .templates-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }

        .templates-header h3 {
            font-size: 1.125rem;
            font-weight: 600;
        }

        .template-actions {
            display: flex;
            gap: 0.75rem;
        }

        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(4px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1000;
        }

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

        .modal {
            background: var(--bg-card);
            border-radius: 12px;
            padding: 2rem;
            max-width: 500px;
            width: 90%;
            box-shadow: var(--shadow-lg);
        }

        .modal h3 {
            font-size: 1.25rem;
            font-weight: 600;
            margin-bottom: 1.5rem;
        }

        .modal-actions {
            display: flex;
            gap: 0.75rem;
            justify-content: flex-end;
            margin-top: 1.5rem;
        }

        .keyboard-hint {
            position: fixed;
            bottom: 2rem;
            right: 2rem;
            background: var(--text-primary);
            color: white;
            padding: 0.75rem 1.25rem;
            border-radius: 8px;
            font-size: 0.813rem;
            box-shadow: var(--shadow-lg);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .keyboard-hint.show {
            opacity: 0.9;
        }

        .kbd {
            display: inline-block;
            padding: 0.125rem 0.375rem;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 3px;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.75rem;
            margin: 0 0.125rem;
        }

        @media (max-width: 1400px) {
            .table-header,
            .timesheet-row,
            .totals-grid {
                grid-template-columns: 1.5fr repeat(7, 1fr) 80px;
            }
        }

        @media (max-width: 1024px) {
            .container {
                padding: 0 1rem;
            }
        }

        /* ── View toggle ── */
        .view-toggle {
            display: flex;
            gap: 0.25rem;
            background: var(--bg-main);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 0.25rem;
        }
        .view-btn {
            padding: 0.4rem 1rem;
            border: none;
            border-radius: 6px;
            font-size: 0.813rem;
            font-weight: 500;
            cursor: pointer;
            background: transparent;
            color: var(--text-secondary);
            transition: all 0.15s ease;
        }
        .view-btn.active {
            background: var(--primary);
            color: white;
            box-shadow: var(--shadow-sm);
        }

        /* ── Manager dashboard ── */
        #dashboardView { display: none; }

        .dashboard-toolbar {
            background: var(--bg-card);
            border-radius: 12px;
            padding: 1.25rem 1.5rem;
            margin-bottom: 1.5rem;
            box-shadow: var(--shadow-sm);
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 1rem;
        }
        .dashboard-toolbar h2 { font-size: 1.125rem; font-weight: 600; }
        .dashboard-toolbar-right { display: flex; gap: 0.75rem; align-items: center; }

        .summary-chips {
            display: flex;
            gap: 0.75rem;
            flex-wrap: wrap;
            margin-bottom: 1.5rem;
        }
        .chip {
            padding: 0.5rem 1rem;
            border-radius: 20px;
            font-size: 0.813rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }
        .chip-total     { background: #EEF2FF; color: #3730A3; }
        .chip-submitted { background: #FEF3C7; color: #92400E; }
        .chip-approved  { background: #D1FAE5; color: #065F46; }
        .chip-draft     { background: #F3F4F6; color: #374151; }
        .chip-missing   { background: #FEE2E2; color: #991B1B; }

        .dashboard-table {
            background: var(--bg-card);
            border-radius: 12px;
            overflow: hidden;
            box-shadow: var(--shadow-md);
        }
        .dashboard-table-header {
            display: grid;
            grid-template-columns: 2fr 1fr 1fr 160px 100px;
            background: linear-gradient(135deg, #2C2C2C 0%, #1A1A1A 100%);
            color: white;
            padding: 1rem 1.5rem;
            font-weight: 600;
            font-size: 0.813rem;
            text-transform: uppercase;
            letter-spacing: 0.025em;
        }
        .dashboard-row {
            display: grid;
            grid-template-columns: 2fr 1fr 1fr 160px 100px;
            padding: 1rem 1.5rem;
            align-items: center;
            border-bottom: 1px solid var(--border);
            transition: background 0.15s ease;
        }
        .dashboard-row:last-child { border-bottom: none; }
        .dashboard-row:hover { background: #F9FAFB; }

        .employee-name { font-weight: 600; font-size: 0.938rem; }
        .employee-id   { font-size: 0.75rem; color: var(--text-secondary); font-family: 'JetBrains Mono', monospace; }

        .status-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.375rem;
            padding: 0.3rem 0.75rem;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 600;
            width: fit-content;
        }
        .badge-submitted { background: #FEF3C7; color: #92400E; }
        .badge-approved  { background: #D1FAE5; color: #065F46; }
        .badge-rejected  { background: #FEE2E2; color: #991B1B; }
        .badge-draft     { background: #F3F4F6; color: #374151; }
        .badge-missing   { background: #FEE2E2; color: #7F1D1D; }

        .hours-display {
            font-family: 'JetBrains Mono', monospace;
            font-weight: 600;
            font-size: 0.938rem;
        }
        .submitted-at { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.125rem; }

        .btn-view {
            padding: 0.375rem 0.875rem;
            font-size: 0.813rem;
            background: var(--bg-main);
            border: 1px solid var(--border);
            border-radius: 5px;
            cursor: pointer;
            font-weight: 500;
            transition: all 0.15s;
            color: var(--text-primary);
        }
        .btn-view:hover { background: #E5E7EB; }

        /* ── Drill-down modal ── */
        .drilldown-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.5);
            backdrop-filter: blur(4px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 2000;
        }
        .drilldown-overlay.show { display: flex; }

        .drilldown-modal {
            background: var(--bg-card);
            border-radius: 12px;
            width: 90%;
            max-width: 900px;
            max-height: 85vh;
            overflow-y: auto;
            box-shadow: var(--shadow-lg);
            padding: 2rem;
        }
        .drilldown-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 1.5rem;
        }
        .drilldown-header h3 { font-size: 1.25rem; font-weight: 600; }
        .drilldown-meta { font-size: 0.813rem; color: var(--text-secondary); margin-top: 0.25rem; }

        .drilldown-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
        .drilldown-table th {
            background: #F3F4F6;
            padding: 0.625rem 0.75rem;
            text-align: center;
            font-weight: 600;
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.025em;
            color: var(--text-secondary);
        }
        .drilldown-table th:first-child { text-align: left; }
        .drilldown-table td {
            padding: 0.75rem;
            border-bottom: 1px solid var(--border);
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.813rem;
            text-align: center;
        }
        .drilldown-table td:first-child { font-family: 'IBM Plex Sans', sans-serif; font-weight: 500; text-align: left; }
        .drilldown-table tr:last-child td { border-bottom: none; }
        .drilldown-total-row td { font-weight: 700; background: #F9FAFB; border-top: 2px solid var(--border); }

        .close-btn {
            background: none;
            border: none;
            font-size: 1.25rem;
            cursor: pointer;
            color: var(--text-secondary);
            padding: 0.25rem;
            line-height: 1;
        }
        .close-btn:hover { color: var(--text-primary); }
