/* ===== Waves Platform - Main Stylesheet (RTL+LTR) ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #6366f1;
    --primary-light: #4f46e5;
    --primary-dark: #4338ca;
    --primary-glow: rgba(99,102,241,0.1);
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-topbar: rgba(255,255,255,0.85);
    --border: #e2e8f0;
    --border-light: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #2563eb;
    --sidebar-w: 260px;
    --topbar-h: 70px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

html { font-size: 15px; }

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

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-sidebar);
    border-inline-end: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: 1px 0 6px rgba(0,0,0,0.04);
}

/* Language switch button in topbar */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.lang-switch:hover { border-color: var(--primary); color: var(--primary-light); }

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

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-logo i {
    font-size: 24px;
    background: linear-gradient(135deg, #6366f1, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

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

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-glow);
    color: var(--primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--primary);
    border-radius: 3px;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-item-danger:hover {
    color: var(--danger);
    background: rgba(239,68,68,0.1);
}

.nav-badge {
    margin-inline-start: auto;
    background: var(--danger);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 16px;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

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

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-inline-start: var(--sidebar-w);
    min-height: 100vh;
    transition: var(--transition);
}

/* ===== TOPBAR ===== */
.topbar {
    height: var(--topbar-h);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-topbar);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

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

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

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

.topbar-notifications {
    position: relative;
    cursor: pointer;
    padding: 10px;
    border-radius: var(--radius);
    transition: var(--transition);
    color: var(--text-secondary);
}

.topbar-notifications:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.notif-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

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

/* ===== CONTENT AREA ===== */
.content-area {
    padding: 30px;
}

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

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

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
}

.stat-card.purple::before { background: linear-gradient(90deg, #6366f1, #a78bfa); }
.stat-card.green::before { background: linear-gradient(90deg, #22c55e, #4ade80); }
.stat-card.blue::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-card.orange::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card.red::before { background: linear-gradient(90deg, #ef4444, #f87171); }

.stat-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.purple { background: rgba(99,102,241,0.1); color: #6366f1; }
.stat-icon.green { background: rgba(22,163,74,0.1); color: #16a34a; }
.stat-icon.blue { background: rgba(37,99,235,0.1); color: #2563eb; }
.stat-icon.orange { background: rgba(217,119,6,0.1); color: #d97706; }
.stat-icon.red { background: rgba(220,38,38,0.1); color: #dc2626; }

.stat-change {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}

.stat-change.up { background: #dcfce7; color: #166534; }
.stat-change.down { background: #fee2e2; color: #991b1b; }

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

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

/* ===== CARD ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

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

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    color: var(--primary);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== TABLE ===== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

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

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

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--bg-card-hover);
}

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

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

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

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

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

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

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

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

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99,102,241,0.4);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    box-shadow: 0 4px 12px rgba(34,197,94,0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

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

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

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

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

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

/* ===== BADGES / STATUS ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-progress {
    background: #dbeafe;
    color: #1e40af;
}

.status-review {
    background: #f3e8ff;
    color: #6b21a8;
}

.status-completed {
    background: #dcfce7;
    color: #166534;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.priority-low {
    background: #f1f5f9;
    color: #64748b;
}

.priority-medium {
    background: #dbeafe;
    color: #1e40af;
}

.priority-high {
    background: #fef3c7;
    color: #92400e;
}

.priority-urgent {
    background: #fee2e2;
    color: #991b1b;
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary), #a78bfa);
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

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

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

.modal {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

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

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

.modal-title {
    font-size: 16px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

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

/* ===== ALERTS ===== */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    animation: fadeIn 0.3s ease;
}

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

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* ===== COMMENTS ===== */
.comments-list {
    max-height: 500px;
    overflow-y: auto;
    padding: 16px 0;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    transition: var(--transition);
}

.comment-item:hover {
    background: var(--bg-card-hover);
}

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

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.comment-author {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.comment-role {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.comment-role.manager {
    background: #ede9fe;
    color: #5b21b6;
}

.comment-role.client {
    background: #dcfce7;
    color: #166534;
}

.comment-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-right: auto;
}

.comment-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.comment-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.comment-attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.comment-attachment:hover {
    background: var(--bg-card-hover);
    color: var(--primary-light);
}

.comment-form {
    display: flex;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.comment-input-wrap {
    flex: 1;
    position: relative;
}

.comment-input-wrap textarea {
    width: 100%;
    padding: 12px 16px;
    padding-left: 100px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    resize: none;
    height: 48px;
    outline: none;
    transition: var(--transition);
}

.comment-input-wrap textarea:focus {
    border-color: var(--primary);
    height: 80px;
}

.comment-actions {
    position: absolute;
    left: 8px;
    bottom: 8px;
    display: flex;
    gap: 4px;
}

/* ===== FILE UPLOAD ===== */
.file-upload-area {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.file-upload-area:hover, .file-upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-glow);
}

.file-upload-area i {
    font-size: 40px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.file-upload-area p {
    color: var(--text-secondary);
    font-size: 14px;
}

.file-upload-area span {
    color: var(--primary);
    font-weight: 600;
}

.file-list {
    list-style: none;
    margin-top: 16px;
}

.file-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 13px;
}

.file-list-item i {
    color: var(--primary);
    font-size: 18px;
}

.file-list-item .file-name {
    flex: 1;
    color: var(--text-secondary);
}

.file-list-item .file-size {
    color: var(--text-muted);
    font-size: 12px;
}

.file-list-item .file-remove {
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.file-list-item .file-remove:hover {
    color: var(--danger);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 50px;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-secondary);
    font-size: 18px;
    margin-bottom: 8px;
}

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

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

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.pagination a {
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.pagination a:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

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

/* ===== TASK CARD ===== */
.task-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    transition: var(--transition);
    cursor: pointer;
}

.task-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    box-shadow: var(--shadow);
}

.task-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.task-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.task-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.task-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.task-meta-item i {
    font-size: 12px;
}

/* ===== GRID LAYOUTS ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* ===== SEARCH & FILTER ===== */
.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.search-input {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-input input {
    width: 100%;
    padding: 10px 16px;
    padding-right: 40px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.search-input input:focus {
    border-color: var(--primary);
}

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

.filter-select {
    padding: 10px 16px;
    padding-left: 36px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    min-width: 150px;
    cursor: pointer;
}

/* ===== NOTIFICATION ITEM ===== */
.notif-item {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.notif-item:hover {
    background: var(--bg-card-hover);
}

.notif-item.unread {
    background: rgba(99,102,241,0.05);
}

.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.notif-icon.info { background: #dbeafe; color: #2563eb; }
.notif-icon.success { background: #dcfce7; color: #16a34a; }
.notif-icon.warning { background: #fef3c7; color: #d97706; }
.notif-icon.task { background: #ede9fe; color: #6366f1; }

.notif-content { flex: 1; }

.notif-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

.notif-time {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-secondary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f8fafc 100%);
}

.login-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 50px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

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

/* Login page dual logos */
.login-logos-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 4px;
}
.login-logo-img {
    height: 52px;
    width: auto;
    object-fit: contain;
    opacity: 0.9;
    transition: var(--transition);
}
.login-logo-img:hover { opacity: 1; }
.login-logos-divider {
    width: 1px;
    height: 40px;
    background: #e2e8f0;
    flex-shrink: 0;
}

.login-logo h1 {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.login-logo p {
    color: #64748b;
    font-size: 15px;
}

/* Sidebar logo image */
.sidebar-logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
    opacity: 0.9;
    transition: var(--transition);
}
.sidebar-logo:hover .sidebar-logo-img { opacity: 1; }

/* Project logos in dashboard header */
.project-logos {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-group label {
    display: block;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

.login-form .form-control {
    padding: 14px 18px;
}

.login-btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    margin-top: 8px;
}

/* ===== DETAILS / TASK VIEW ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.detail-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 16px 0;
}

.detail-item {
    padding: 12px 0;
}

.detail-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    min-width: 300px;
    animation: toastIn 0.3s ease;
    box-shadow: var(--shadow);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

.toast-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* New status classes */
.status-new { background: #ede9fe; color: #5b21b6; }
.status-delivered { background: #dbeafe; color: #1e40af; }
.status-review { background: #f3e8ff; color: #6b21a8; }
.status-revision { background: #fef3c7; color: #92400e; }
.status-archived { background: #f1f5f9; color: #64748b; }

/* Kanban Board */
.kanban-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 16px; }
.kanban-column { min-width: 280px; flex: 1; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.kanban-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.kanban-header h3 { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.kanban-count { background: var(--bg-input); padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.kanban-body { padding: 12px; min-height: 200px; }
.kanban-card { background: var(--bg-card-hover); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; cursor: pointer; transition: var(--transition); }
.kanban-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.kanban-card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.kanban-card-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--text-muted); }

/* View toggle buttons */
.view-toggle { display: flex; gap: 4px; }
.view-toggle button { padding: 7px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); cursor: pointer; font-size: 13px; transition: var(--transition); }
.view-toggle button.active, .view-toggle button:hover { background: var(--primary-glow); color: var(--primary-light); border-color: var(--primary); }

/* Cards view grid */
.tasks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

@media (max-width: 768px) {
    [dir=rtl] .sidebar { transform: translateX(100%); }
    [dir=rtl] .sidebar.open { transform: translateX(0); }
    [dir=ltr] .sidebar { transform: translateX(-100%); }
    [dir=ltr] .sidebar.open { transform: translateX(0); }

    .sidebar-close {
        display: block;
    }

    .main-content {
        margin-inline-start: 0;
    }

    .menu-toggle {
        display: block;
    }

    .content-area {
        padding: 20px 16px;
    }

    .topbar {
        padding: 0 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .detail-info {
        grid-template-columns: 1fr;
    }

    .card-header {
        padding: 16px;
    }

    .card-body {
        padding: 16px;
    }

    .login-card {
        padding: 30px 24px;
    }

    .stat-value {
        font-size: 24px;
    }

    .table td, .table th {
        padding: 10px 12px;
    }

    .modal {
        max-width: 100%;
        margin: 10px;
    }

    .topbar-user span {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .comment-form {
        flex-direction: column;
    }
}

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

    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-select {
        min-width: auto;
    }

    .btn-group {
        flex-direction: column;
    }
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary-light); }
.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; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-100 { width: 100%; }
.fw-bold { font-weight: 700; }
.fs-sm { font-size: 13px; }

/* ===== OVERLAY FOR MOBILE ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}
