:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --glass: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.1);
    --success: #10b981;
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Outfit', 'Cairo', sans-serif;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
nav.sidebar {
    width: 260px;
    background: rgba(15, 23, 42, 0.9);
    border-right: 1px solid var(--border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    background: linear-gradient(45deg, #818cf8, #c084fc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    list-style: none;
}

.nav-links li {
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-links li:hover,
.nav-links li.active {
    background: var(--glass);
    color: var(--text-main);
}

.nav-links li.active {
    background: var(--primary);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Main Content */
main.content {
    flex: 1;
    padding: 2rem 3rem;
    background: radial-gradient(circle at 50% 0%, #1e293b, #0f172a);
}

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

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    padding: 1.5rem;
}

.stat-title {
    color: var(--text-dim);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

/* Forms & Tables */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

input,
select {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    padding: 0.75rem;
    border-radius: 8px;
    color: white;
    width: 100%;
    margin-bottom: 1rem;
    outline: none;
}

select option {
    background-color: #1e293b;
    color: white;
}

input::placeholder {
    color: #64748b;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-dim);
    font-weight: 500;
}

.hidden {
    display: none;
}

[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] th,
[dir="rtl"] td {
    text-align: right;
}

#print-area {
    display: none;
}

/* Scheduler Styles */
.scheduler-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 12px;
    align-items: center;
}

.timeline-container {
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    margin-top: 20px;
}

.timeline-hours {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
    position: relative;
    min-width: 1200px;
}

.hour-mark {
    flex: 1;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 5px;
}

.employee-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    min-width: 1200px;
}

.emp-name-tag {
    width: 150px;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shift-track {
    flex: 1;
    height: 35px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    position: relative;
}

.shift-bar {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #818cf8);
    border-radius: 6px;
    cursor: ew-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: white;
    user-select: none;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.peak-track {
    height: 10px;
    margin-bottom: 20px;
    position: relative;
    border-radius: 4px;
    background: rgba(239, 68, 68, 0.1);
    min-width: 1200px;
}

.peak-marker {
    position: absolute;
    height: 100%;
    background: var(--error);
    border-radius: 4px;
    opacity: 0.6;
    cursor: pointer;
}

.peak-marker:hover {
    opacity: 1;
}

@media print {
    body> :not(#print-area) {
        display: none !important;
    }

    body {
        background: white !important;
        display: block !important;
    }

    #print-area {
        display: block !important;
        position: static;
        background: white;
        color: black;
        padding: 20px;
        width: 100%;
        direction: rtl;
    }

    #print-area table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 20px;
        color: black;
        background: white;
    }

    #print-area th,
    #print-area td {
        border: 1px solid #333;
        padding: 8px;
        color: black;
        text-align: center;
    }

    #print-area th {
        background: #f1f5f9;
        font-weight: bold;
    }

    #print-area .print-header {
        text-align: center;
        margin-bottom: 20px;
        border-bottom: 2px solid #333;
        padding-bottom: 10px;
    }

    #print-area .print-header h2 {
        margin: 0;
        font-size: 24px;
        font-weight: bold;
    }

    #print-area h3 {
        margin-bottom: 15px;
    }
}