:root {
    --primary-blue: #2563eb;
    --primary-blue-hover: #1d4ed8;
    --primary-blue-light: #dbeafe;
    --background: #ffffff;
    --background-secondary: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --background: #0f172a;
    --background-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --sidebar-bg: #020617;
    --sidebar-hover: #0f172a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--sidebar-hover);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.sidebar-menu {
    flex: 1;
    list-style: none;
    padding: 1rem 0;
}

.sidebar-menu li {
    margin: 0.25rem 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0.5rem;
    margin: 0 0.5rem;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--sidebar-hover);
    color: white;
}

.sidebar-menu a i {
    margin-right: 0.75rem;
    width: 1rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--sidebar-hover);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    color: #94a3b8;
}

.user-info i {
    margin-right: 0.5rem;
    font-size: 1.25rem;
}

.logout-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: color 0.2s ease;
}

.logout-btn:hover {
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    background: var(--background);
}

.top-bar {
    background: var(--background);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.top-bar h1 {
    font-size: 1.75rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.add-btn, .theme-toggle {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-btn:hover {
    background: var(--primary-blue-hover);
    transform: translateY(-1px);
}

.theme-toggle {
    padding: 0.75rem;
}

/* Dashboard Grid */
.dashboard-grid {
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--background-secondary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.stat-icon.blue { background: var(--primary-blue); }
.stat-icon.green { background: var(--success); }
.stat-icon.orange { background: var(--warning); }
.stat-icon.red { background: var(--danger); }

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.dashboard-section {
    grid-column: 1 / -1;
    background: var(--background-secondary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.dashboard-section h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.no-data {
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

/* Content Section */
.content-section {
    padding: 2rem;
}

.search-bar {
    position: relative;
    margin-bottom: 1.5rem;
    max-width: 400px;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--background-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.search-bar i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* Tables */
.staff-table-container,
.absence-table-container {
    background: var(--background-secondary);
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    overflow: hidden;
}

.staff-table,
.absence-table {
    width: 100%;
    border-collapse: collapse;
}

.staff-table th,
.absence-table th {
    background: var(--primary-blue);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
}

.staff-table td,
.absence-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.staff-table tr:last-child td,
.absence-table tr:last-child td {
    border-bottom: none;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.active { background: #dcfce7; color: #166534; }
.status-badge.inactive { background: #fef3c7; color: #92400e; }
.status-badge.absent { background: #fee2e2; color: #991b1b; }
.status-badge.pending { background: #fef3c7; color: #92400e; }
.status-badge.approved { background: #dcfce7; color: #166534; }
.status-badge.denied { background: #fee2e2; color: #991b1b; }

.action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    margin: 0 0.25rem;
}

.action-btn:hover {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
}

.action-btn.danger:hover {
    background: #fee2e2;
    color: var(--danger);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--background);
    margin: 5% auto;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem;
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--background-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.submit-btn, .save-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.submit-btn:hover, .save-btn:hover {
    background: var(--primary-blue-hover);
    transform: translateY(-1px);
}

.cancel-btn {
    background: var(--background-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: var(--border);
}

/* Login Page */
.login-page {
    background: linear-gradient(180deg, #f8fafc 0%, var(--primary-blue-light) 60%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

/* Modern two-column login card */
.login-card.modern {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 920px;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255,255,255,0.65), rgba(255,255,255,0.55));
    backdrop-filter: blur(8px) saturate(120%);
    border: 1px solid rgba(37,99,235,0.08);
    box-shadow: 0 10px 30px rgba(16,24,40,0.12);
}

/* Illustration side */
.illustration-side {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    background: linear-gradient(135deg, rgba(37,99,235,0.06), rgba(37,99,235,0.02));
}
.illustration { position: relative; width: 160px; height: 160px; }
.illus-circle {
    position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 30% 30%, rgba(37,99,235,0.15), transparent 40%);
}
.illus-grid {
    position: absolute; inset: 0; background-image: linear-gradient(transparent 49%, rgba(37,99,235,0.03) 50%), linear-gradient(90deg, transparent 49%, rgba(37,99,235,0.03) 50%); background-size: 20px 20px; opacity: 0.9;
}
.illus-text { color: var(--text-secondary); text-align: center; font-size: 0.95rem; max-width: 220px; }

/* Form side */
.form-side { padding: 2rem 2.25rem; display: flex; flex-direction: column; justify-content: center; gap: 0.75rem; }
.login-header h1 { color: var(--primary-blue); font-size: 1.5rem; margin-bottom: 0.25rem; }
.login-header p { color: var(--text-secondary); font-size: 0.95rem; }

/* Tighter form controls */
.login-form .form-group input {
    padding: 0.9rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(16,24,40,0.06);
    background: white;
    transition: transform 120ms ease, box-shadow 120ms ease;
}
.login-form .form-group input:focus { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16,24,40,0.06); border-color: var(--primary-blue); }

/* row with checkbox and forgot link */
.form-row { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:0.5rem; }
.checkbox { display:flex; align-items:center; gap:0.5rem; color:var(--text-secondary); font-size:0.9rem; }
.checkbox input { width:16px; height:16px; accent-color: var(--primary-blue); }

/* divider */
.divider { display:flex; align-items:center; gap:1rem; margin:0.75rem 0; color:var(--text-secondary); font-size:0.85rem; }
.divider::before, .divider::after { content:""; flex:1; height:1px; background:linear-gradient(90deg, transparent, rgba(16,24,40,0.04), transparent); }

/* social buttons */
.socials { display:flex; gap:0.5rem; }
.social-btn {
    flex:1;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:0.5rem;
    padding:0.6rem;
    border-radius:10px;
    border:1px solid rgba(16,24,40,0.06);
    background:transparent;
    cursor:pointer;
    font-weight:600;
    color:var(--text-primary);
}
.social-btn.google { background: #fff; }
.social-btn.discord { background: rgba(88,101,242,0.06); color:#5865F2; border-color: rgba(88,101,242,0.12); }

/* login button */
.login-btn { width:100%; padding:0.9rem; border-radius:10px; font-weight:700; display:flex; align-items:center; justify-content:center; gap:0.6rem; }

/* small theme toggle in footer */
.login-footer { display:flex; align-items:center; justify-content:space-between; margin-top:1rem; color:var(--text-secondary); }
.theme-toggle.small { background: transparent; color: var(--text-secondary); padding:0.4rem; border-radius:8px; border:1px solid transparent; }
.theme-toggle.small:hover { background: rgba(0,0,0,0.04); }

/* Settings */
.settings-container {
    padding: 2rem;
    max-width: 800px;
}

.settings-section {
    background: var(--background-secondary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.setting-item label {
    font-weight: 500;
}

.setting-item select {
    width: 200px;
}

.settings-section.danger {
    border-color: var(--danger);
}

.danger-btn {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.danger-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Filters */
.absence-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.absence-filters select {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--background-secondary);
    color: var(--text-primary);
}

/* Changelog Styles */
.changelog-container {
    max-width: 800px;
    margin: 0 auto;
}

.changelog-intro {
    text-align: center;
    margin-bottom: 3rem;
}

.changelog-intro h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.changelog-intro p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.changelog-timeline {
    position: relative;
    margin-bottom: 3rem;
}

.changelog-timeline::before {
    content: '';
    position: absolute;
    left: 2rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.changelog-entry {
    position: relative;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
    padding-left: 4rem;
}

.changelog-entry::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 0.5rem;
    width: 1rem;
    height: 1rem;
    background: var(--primary-blue);
    border-radius: 50%;
    border: 3px solid var(--background);
    box-shadow: 0 0 0 2px var(--primary-blue);
}

.changelog-date {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.version {
    font-weight: 700;
    color: var(--primary-blue);
    font-size: 1.125rem;
}

.date {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.changelog-content {
    background: var(--background-secondary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.changelog-content h3 {
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.changelog-content h3 i {
    color: var(--primary-blue);
}

.changelog-content ul {
    list-style: none;
    margin-left: 0;
}

.changelog-content li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
}

.changelog-content li::before {
    content: '•';
    color: var(--primary-blue);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.github-section {
    margin-top: 3rem;
}

.github-card {
    background: var(--background-secondary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 2rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.github-icon {
    width: 4rem;
    height: 4rem;
    background: var(--text-primary);
    color: var(--background);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.github-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.github-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.github-actions {
    display: flex;
    gap: 1rem;
}

.github-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    background: var(--text-primary);
    color: var(--background);
}

.github-btn.secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.github-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.github-btn.secondary:hover {
    background: var(--background-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .top-bar {
        padding: 1rem;
    }
    
    .content-section {
        padding: 1rem;
    }
}

/* Responsive adjustments */
@media (max-width: 800px) {
    .login-card.modern { grid-template-columns: 1fr; }
    .illustration-side { order: -1; padding:1.5rem; }
    .form-side { padding:1.5rem; }
}

/* Responsive adjustments for Changelog */
@media (max-width: 768px) {
    .changelog-entry {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding-left: 3rem;
    }
    
    .changelog-timeline::before {
        left: 1rem;
    }
    
    .changelog-entry::before {
        left: 0.5rem;
    }
    
    .github-card {
        flex-direction: column;
        text-align: center;
    }
    
    .github-actions {
        flex-direction: column;
        width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-card,
.dashboard-section,
.settings-section {
    animation: fadeIn 0.5s ease;
}