/* ============================================
   BMS Payroll System - Modern Dark Theme
   ============================================ */

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

/* ============================================
   CSS Variables / Design Tokens
   ============================================ */
:root {
    /* Colors */
    --bg-primary: #0a0a1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1a1a2e;
    --bg-card: rgba(22, 27, 45, 0.8);
    --bg-card-hover: rgba(30, 35, 55, 0.9);
    --bg-surface: #16213e;
    --bg-input: rgba(15, 18, 30, 0.8);
    
    --accent-primary: #e63946;
    --accent-primary-hover: #ff4757;
    --accent-primary-glow: rgba(230, 57, 70, 0.3);
    --accent-secondary: #a8a8a8;
    --accent-success: #00c853;
    --accent-success-bg: rgba(0, 200, 83, 0.1);
    --accent-warning: #ffab00;
    --accent-warning-bg: rgba(255, 171, 0, 0.1);
    --accent-danger: #ff1744;
    --accent-danger-bg: rgba(255, 23, 68, 0.1);
    --accent-info: #448aff;
    --accent-info-bg: rgba(68, 138, 255, 0.1);
    
    --text-primary: #f0f0f0;
    --text-secondary: #a0a4b8;
    --text-muted: #6b7280;
    --text-accent: #e63946;
    
    --border-color: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(230, 57, 70, 0.3);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(230, 57, 70, 0.15);
    
    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Spacing */
    --sidebar-width: 260px;
    --header-height: 70px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-primary-hover);
}

/* ============================================
   Login Page
   ============================================ */
.login-wrapper {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(230, 57, 70, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 50%, rgba(68, 138, 255, 0.05) 0%, transparent 50%);
    animation: bgPulse 15s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-20px, -10px) scale(1.05); }
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo img {
    height: 60px;
    margin-bottom: 16px;
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 6px;
}

.brand-text {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
}

.brand-text .brand-b {
    color: var(--text-primary);
}

.brand-text .brand-ms {
    color: var(--accent-primary);
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    transition: all var(--transition-normal);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
    background: rgba(15, 18, 30, 1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a0a4b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

select.form-control option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .form-control {
    padding-left: 44px;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

/* Password Toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 48px;
}

.input-icon-wrapper .password-toggle {
    right: 14px;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.password-toggle:hover {
    color: var(--accent-primary);
    background: rgba(230, 57, 70, 0.1);
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.92);
}

.password-toggle .eye-icon {
    display: block;
}

.input-icon-wrapper .form-control {
    padding-left: 44px;
    padding-right: 48px;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #c0392b 100%);
    color: white;
    box-shadow: 0 4px 15px var(--accent-primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(230, 57, 70, 0.4);
    color: white;
}

.btn-primary:active {
    transform: translateY(0);
}

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

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    color: var(--text-primary);
}

.btn-success {
    background: linear-gradient(135deg, #00c853 0%, #00a844 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 200, 83, 0.3);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ff1744 0%, #d50000 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 23, 68, 0.3);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn-group {
    display: flex;
    gap: 8px;
}

/* ============================================
   App Layout
   ============================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal);
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header img {
    height: 36px;
}

.sidebar-brand {
    font-size: 20px;
    font-weight: 800;
}

.sidebar-brand .brand-red {
    color: var(--accent-primary);
}

.sidebar-label {
    padding: 20px 20px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
    position: relative;
}

.nav-item:hover {
    background: rgba(230, 57, 70, 0.08);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(230, 57, 70, 0.12);
    color: var(--accent-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--accent-primary);
    border-radius: 3px;
}

.nav-item .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 18px;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--accent-primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-color);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.03);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent-primary) 0%, #c0392b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-avatar-lg {
    width: 48px;
    height: 48px;
    font-size: 18px;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Header */
.top-header {
    height: var(--header-height);
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.header-breadcrumb a {
    color: var(--text-muted);
}

.header-breadcrumb a:hover {
    color: var(--accent-primary);
}

.header-breadcrumb .sep {
    color: var(--text-muted);
    opacity: 0.5;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-time {
    font-size: 14px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.header-date {
    font-size: 13px;
    color: var(--text-muted);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 32px;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-light);
}

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

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   Stat Cards
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-color, var(--accent-primary));
    opacity: 0.8;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-light);
}

.stat-card.stat-red { --stat-color: #e63946; }
.stat-card.stat-green { --stat-color: #00c853; }
.stat-card.stat-blue { --stat-color: #448aff; }
.stat-card.stat-orange { --stat-color: #ffab00; }
.stat-card.stat-purple { --stat-color: #7c4dff; }
.stat-card.stat-cyan { --stat-color: #00e5ff; }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
    background: rgba(230, 57, 70, 0.1);
    color: var(--stat-color, var(--accent-primary));
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -1px;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    padding: 3px 8px;
    border-radius: 4px;
}

.stat-change.up {
    color: var(--accent-success);
    background: var(--accent-success-bg);
}

.stat-change.down {
    color: var(--accent-danger);
    background: var(--accent-danger-bg);
}

/* ============================================
   Clock Widget
   ============================================ */
.clock-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.clock-widget::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, var(--accent-primary-glow) 0%, transparent 70%);
    opacity: 0.3;
}

.clock-display {
    font-size: 64px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -2px;
    font-variant-numeric: tabular-nums;
    margin-bottom: 4px;
    position: relative;
}

.clock-date {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.clock-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 32px;
}

.clock-status.clocked-in {
    background: var(--accent-success-bg);
    color: var(--accent-success);
    border: 1px solid rgba(0, 200, 83, 0.2);
}

.clock-status.clocked-out {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.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.4; }
}

.clock-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    position: relative;
}

.btn-clock {
    padding: 16px 48px;
    font-size: 16px;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-clock-in {
    background: linear-gradient(135deg, #00c853 0%, #00a844 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(0, 200, 83, 0.3);
}

.btn-clock-in:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 200, 83, 0.4);
}

.btn-clock-out {
    background: linear-gradient(135deg, #ff1744 0%, #d50000 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(255, 23, 68, 0.3);
}

.btn-clock-out:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 23, 68, 0.4);
}

.clock-session-info {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    gap: 48px;
}

.session-stat {
    text-align: center;
}

.session-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.session-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

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

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    padding: 14px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 20px;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.badge-success {
    background: var(--accent-success-bg);
    color: var(--accent-success);
    border: 1px solid rgba(0, 200, 83, 0.15);
}

.badge-warning {
    background: var(--accent-warning-bg);
    color: var(--accent-warning);
    border: 1px solid rgba(255, 171, 0, 0.15);
}

.badge-danger {
    background: var(--accent-danger-bg);
    color: var(--accent-danger);
    border: 1px solid rgba(255, 23, 68, 0.15);
}

.badge-info {
    background: var(--accent-info-bg);
    color: var(--accent-info);
    border: 1px solid rgba(68, 138, 255, 0.15);
}

.badge-neutral {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* ============================================
   Weekly Chart
   ============================================ */
.weekly-chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 180px;
    padding: 20px 0;
}

.chart-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar {
    width: 100%;
    max-width: 40px;
    background: linear-gradient(180deg, var(--accent-primary) 0%, rgba(230, 57, 70, 0.3) 100%);
    border-radius: 6px 6px 0 0;
    transition: all var(--transition-normal);
    min-height: 4px;
    position: relative;
}

.chart-bar:hover {
    background: linear-gradient(180deg, var(--accent-primary-hover) 0%, rgba(230, 57, 70, 0.5) 100%);
    box-shadow: 0 0 15px var(--accent-primary-glow);
}

.chart-bar-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.chart-bar-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    font-weight: 500;
}

.chart-bar.today .chart-bar-label {
    color: var(--accent-primary);
    font-weight: 600;
}

/* ============================================
   Alert / Flash Messages
   ============================================ */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
    border: 1px solid transparent;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: var(--accent-success-bg);
    color: var(--accent-success);
    border-color: rgba(0, 200, 83, 0.15);
}

.alert-error, .alert-danger {
    background: var(--accent-danger-bg);
    color: var(--accent-danger);
    border-color: rgba(255, 23, 68, 0.15);
}

.alert-warning {
    background: var(--accent-warning-bg);
    color: var(--accent-warning);
    border-color: rgba(255, 171, 0, 0.15);
}

.alert-info {
    background: var(--accent-info-bg);
    color: var(--accent-info);
    border-color: rgba(68, 138, 255, 0.15);
}

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

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ============================================
   Grid Layouts
   ============================================ */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    margin-bottom: 24px;
}

/* ============================================
   Employee List / Activity Items
   ============================================ */
.employee-list {
    display: flex;
    flex-direction: column;
}

.employee-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.activity-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.activity-icon.login { background: var(--accent-info-bg); color: var(--accent-info); }
.activity-icon.clock_in { background: var(--accent-success-bg); color: var(--accent-success); }
.activity-icon.clock_out { background: var(--accent-warning-bg); color: var(--accent-warning); }
.activity-icon.logout { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.activity-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.pagination a:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.pagination .active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 48px 20px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 14px;
}

/* ============================================
   Filters Bar
   ============================================ */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.filter-group .form-control {
    padding: 8px 12px;
    font-size: 13px;
    min-width: 160px;
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* ============================================
   Today's Log List
   ============================================ */
.log-timeline {
    position: relative;
    padding-left: 28px;
}

.log-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.log-entry {
    position: relative;
    padding: 12px 0;
    margin-bottom: 4px;
}

.log-entry::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 18px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 2px solid var(--bg-card);
}

.log-entry.completed::before {
    background: var(--accent-success);
}

.log-entry.active::before {
    background: var(--accent-warning);
    animation: pulse 2s ease-in-out infinite;
}

.log-time {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.log-detail {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .content-area {
        padding: 20px 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .clock-display {
        font-size: 48px;
    }
    
    .clock-session-info {
        gap: 24px;
    }
    
    .clock-buttons {
        flex-direction: column;
    }
    
    .btn-clock {
        padding: 14px 32px;
    }
    
    .login-card {
        padding: 32px 24px;
    }

    .top-header {
        padding: 0 16px;
    }

    .header-date {
        display: none;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .data-table th, .data-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* ============================================
   Utilities
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--accent-success); }
.text-danger { color: var(--accent-danger); }
.text-warning { color: var(--accent-warning); }
.text-primary { color: var(--accent-primary); }
.text-info { color: var(--accent-info); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   Loading Spinner
   ============================================ */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Tooltip
   ============================================ */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    z-index: 999;
}

/* ============================================
   Google OAuth & Settings Styles
   ============================================ */

/* Google Sign-In Button */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    background: #ffffff;
    color: #3c4043;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 15px;
    font-weight: 600;
    border: 1px solid #dadce0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-google::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(66, 133, 244, 0);
    transition: background var(--transition-normal);
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #4285F4;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.2);
    transform: translateY(-2px);
    color: #3c4043;
}

.btn-google:hover::before {
    background: rgba(66, 133, 244, 0.04);
}

.btn-google:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.15);
}

.btn-google .google-icon-svg {
    flex-shrink: 0;
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.1), transparent);
}

.auth-divider span {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 28px;
    transition: all var(--transition-normal);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.toggle-switch input:checked + .toggle-slider {
    background: rgba(0, 200, 83, 0.2);
    border-color: rgba(0, 200, 83, 0.4);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
    background: #00c853;
    box-shadow: 0 2px 8px rgba(0, 200, 83, 0.4);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.15);
}

/* Settings Page Styles */
.settings-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.settings-icon.google-icon {
    background: rgba(66, 133, 244, 0.1);
    border: 1px solid rgba(66, 133, 244, 0.15);
}

.settings-section {
    padding: 4px 0;
}

.settings-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 8px 0;
}

.settings-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.settings-description {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.settings-divider {
    height: 1px;
    background: var(--border-color);
    margin: 24px 0;
}

.settings-input {
    max-width: 600px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.5;
}

.redirect-uri-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.redirect-uri-row .form-control {
    flex: 1;
}

.redirect-uri-row .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.settings-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-top: 8px;
}

.settings-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 20px;
}

.settings-status.status-active {
    color: #00c853;
    background: rgba(0, 200, 83, 0.08);
    border: 1px solid rgba(0, 200, 83, 0.2);
}

.settings-status.status-inactive {
    color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.status-active .status-dot {
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Setup Guide */
.setup-guide {
    background: rgba(68, 138, 255, 0.05);
    border: 1px solid rgba(68, 138, 255, 0.12);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
}

.setup-guide-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-primary);
}

.setup-steps {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setup-steps li {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.setup-steps li a {
    color: #448aff;
    font-weight: 500;
}

.setup-steps li a:hover {
    color: #82b1ff;
    text-decoration: underline;
}

.setup-steps li code {
    background: rgba(255,255,255,0.06);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--accent-warning);
    word-break: break-all;
}

.setup-steps li strong {
    color: var(--text-primary);
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .sidebar, .top-header, .btn, .filters-bar {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card {
        border: 1px solid #ddd;
        background: white;
    }
    
    .data-table th, .data-table td {
        color: black;
        border-color: #ddd;
    }
}

