:root {
    --primary-color: #0F172A;     /* Navy Dark */
    --secondary-color: #1E293B;   /* Lighter Navy */
    --accent-color: #cda252;      /* Gold/Bronze */
    --accent-hover: #b08941;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --sidebar-width: 260px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 800;
    color: var(--accent-color);
}

.sidebar-nav {
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 25px;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-right: 4px solid transparent;
}

.nav-item:hover {
    background-color: rgba(255,255,255,0.05);
    color: white;
}

.nav-item.active {
    background-color: var(--secondary-color);
    color: white;
    border-right-color: var(--accent-color);
}

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

/* Topbar */
.topbar {
    background: var(--card-bg);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 40;
}

.welcome-text h1 {
    font-size: 20px;
    color: var(--primary-color);
    margin-bottom: 5px;
}

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

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(205, 162, 82, 0.2);
}

/* Content Area */
.content-area {
    padding: 30px 40px;
}

.page-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.page-section.active-section {
    display: block;
}

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

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-info h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 5px;
}

.stat-info p {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-color);
}

/* Sections & Buttons */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 22px;
    color: var(--primary-color);
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

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

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

.btn-secondary {
    background-color: #f1f5f9;
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Table */
.table-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.tasks-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
}

.tasks-table th {
    background-color: #f8fafc;
    padding: 15px 20px;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.tasks-table td {
    padding: 15px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.tasks-table tbody tr {
    transition: background-color 0.2s ease;
}

.tasks-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Kanban Board */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    align-items: start;
}

.kanban-column {
    background: rgba(241, 245, 249, 0.6);
    border-radius: var(--border-radius);
    padding: 20px;
    min-height: 500px;
    border: 1px dashed var(--border-color);
}

.column-header {
    margin-bottom: 20px;
}

.column-header h3 {
    font-size: 16px;
    color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.badge {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
}

.column-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 400px;
}

/* Task Card */
.task-card {
    background: var(--card-bg);
    padding: 18px;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    border-right: 4px solid var(--info);
    cursor: grab;
    transition: all 0.2s ease;
    position: relative;
}

.task-card:active {
    cursor: grabbing;
}

.task-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.task-card.priority-urgent {
    border-right-color: var(--danger);
}

.task-card h4 {
    font-size: 15px;
    color: var(--primary-color);
    margin-bottom: 10px;
    line-height: 1.4;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 15px;
}

.task-case {
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.task-actions {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    gap: 5px;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    transition: color 0.2s;
}

.action-btn:hover {
    color: var(--primary-color);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    width: 100%;
    max-width: 600px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
}

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

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

.modal-header h2 {
    font-size: 18px;
    color: var(--primary-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: 25px;
}

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

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

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
}

.form-group input, 
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    background-color: #f8fafc;
}

.form-group input:focus, 
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(205, 162, 82, 0.1);
}

/* Status Badges */
.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-new {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.status-progress {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}
.status-delayed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Responsive */
@media (max-width: 1024px) {
    .kanban-board {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
        transition: transform 0.3s;
    }
    .main-content {
        margin-right: 0;
    }
}
