/* الخطوط والمتغيرات الأساسية */
:root {
    /* Brand identity palette */
    --primary-color: #2FA9E0; /* Pantone 2985C */
    --primary-hover: #1691D0; /* Pantone 299C */
    --secondary-color: #057590; /* Pantone 3145C */
    --secondary-hover: #283A83; /* Pantone 072C */
    --accent-teal: #3AC0C3; /* Pantone 7479C */
    --accent-green: #48AD48; /* Pantone 802C */
    --accent-lime: #9ECC3B; /* Pantone 375C */
    --background: #F3F4F6; /* keep light app background */
    --background-strong: #15508A; /* Pantone 2736C */
    --background-muted: #A09EA4; /* Pantone 7543C */
    --warning-color: #D97706;
    --danger-color: #DC2626;
    --text-primary: #111827;
    --text-secondary: #374151;
    --white: #FFFFFF;
    --border-color: #D1D5DB;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 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);
    --radius: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* التخطيط العام */
.page {
    display: none;
    min-height: 100vh;
}

    .page.active {
        display: block;
    }

/* صفحة تسجيل الدخول */
.login-form .remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.login-form .remember-me input[type="checkbox"] {
    margin: 0;
}

.login-form .remember-me label {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Login-specific styles moved to login.css */

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 50%;
    color: white;
    margin-bottom: 16px;
}

/* Login-specific logo block moved to login.css */

.login-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

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

.form-group {
    margin-bottom: 24px;
}

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

    .form-group input {
        width: 100%;
        padding: 12px 16px;
        border: 2px solid var(--border-color);
        border-radius: var(--radius);
        font-size: 16px;
        transition: all 0.3s ease;
        background: var(--white);
    }

        .form-group input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

.login-btn {
    width: 100%;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 24px;
}

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

.demo-accounts {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

    .demo-accounts p {
        font-size: 14px;
        color: var(--text-secondary);
        margin-bottom: 16px;
    }

.demo-buttons {
    display: flex;
    gap: 12px;
}

.demo-btn {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .demo-btn.admin {
        border-color: var(--primary-color);
        color: var(--primary-color);
        background: transparent;
    }

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

    .demo-btn.user {
        border-color: var(--secondary-color);
        color: var(--secondary-color);
        background: transparent;
    }

        .demo-btn.user:hover {
            background: var(--secondary-color);
            color: white;
        }

/* الهيدر */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    height: 72px;
}

.header-left h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

    .logout-btn:hover {
        background: var(--background);
        color: var(--text-primary);
    }

/* تخطيط الآدمن */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 72px);
}

.sidebar {
    width: 256px;
    background: var(--white);
    border-left: 1px solid var(--border-color);
    padding: 24px 0;
}

.nav-items {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    border-left: 3px solid transparent;
}

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

    .nav-item.active {
        background: rgba(47, 169, 224, 0.12);
        color: var(--primary-hover);
        border-left-color: var(--primary-hover);
    }

.main-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.content-section {
    display: none;
}

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

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

    .section-header h2 {
        font-size: 24px;
        font-weight: 600;
        color: var(--text-primary);
    }

.add-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    text-decoration:none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

/* بطاقات الأقسام */
.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.section-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

    .section-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
    }

/* Department card themed colors */
.section-card .section-card-banner {
    margin: -24px -24px 16px -24px;
    padding: 16px 20px;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-card .banner-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}
.section-card .banner-sub {
    margin-inline-start: auto;
    opacity: 0.9;
    font-weight: 600;
}

.section-card.dept-color-1 {
    border-top: 4px solid var(--primary-color);
}
.section-card.dept-color-2 {
    border-top: 4px solid var(--primary-hover);
}
.section-card.dept-color-3 {
    border-top: 4px solid var(--secondary-color);
}
.section-card.dept-color-4 {
    border-top: 4px solid var(--secondary-hover);
}
.section-card.dept-color-5 {
    border-top: 4px solid var(--accent-teal);
}
.section-card.dept-color-6 {
    border-top: 4px solid var(--accent-green);
}

.section-card .section-info h3 { display: none; }

.section-card .color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.section-card.dept-color-1 .section-card-banner { background: var(--primary-color); }
.section-card.dept-color-2 .section-card-banner { background: var(--primary-hover); }
.section-card.dept-color-3 .section-card-banner { background: var(--secondary-color); }
.section-card.dept-color-4 .section-card-banner { background: var(--secondary-hover); }
.section-card.dept-color-5 .section-card-banner { background: var(--accent-teal); }
.section-card.dept-color-6 .section-card-banner { background: var(--accent-green); }

.section-card.dept-color-1 .section-stats .stat svg,
.section-card.dept-color-2 .section-stats .stat svg,
.section-card.dept-color-3 .section-stats .stat svg,
.section-card.dept-color-4 .section-stats .stat svg,
.section-card.dept-color-5 .section-stats .stat svg,
.section-card.dept-color-6 .section-stats .stat svg {
    color: var(--text-secondary);
}

.section-card.dept-color-1 .color-dot { background: var(--primary-color); }
.section-card.dept-color-2 .color-dot { background: var(--primary-hover); }
.section-card.dept-color-3 .color-dot { background: var(--secondary-color); }
.section-card.dept-color-4 .color-dot { background: var(--secondary-hover); }
.section-card.dept-color-5 .color-dot { background: var(--accent-teal); }
.section-card.dept-color-6 .color-dot { background: var(--accent-green); }

.section-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.section-info p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.section-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
}

.section-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.edit-btn, .delete-btn {
    padding: 8px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-btn {
    background: rgba(4, 120, 87, 0.15);
    color: var(--secondary-color);
    font-weight: 500;
}

    .edit-btn:hover {
        background: var(--secondary-color);
        color: white;
    }

.delete-btn {
    background: rgba(220, 38, 38, 0.15);
    color: var(--danger-color);
    font-weight: 500;
}

    .delete-btn:hover {
        background: var(--danger-color);
        color: white;
    }

/* بطاقات المهام */
.tasks-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.task-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

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

    .task-card.completed {
        opacity: 0.7;
        background: rgba(4, 120, 87, 0.1);
        border-color: var(--secondary-color);
    }

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

    .task-header h3 {
        font-size: 18px;
        font-weight: 600;
        color: var(--text-primary);
    }

.priority {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

    .priority.high {
        background: rgba(220, 38, 38, 0.15);
        color: var(--danger-color);
        font-weight: 600;
    }

    .priority.medium {
        background: rgba(217, 119, 6, 0.15);
        color: var(--warning-color);
        font-weight: 600;
    }

    .priority.low {
        background: rgba(4, 120, 87, 0.15);
        color: var(--secondary-color);
        font-weight: 600;
    }

.task-description {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.task-info {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.section-tag {
    background: rgba(47, 169, 224, 0.15);
    color: var(--primary-hover);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

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

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

.task-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

    .task-actions .edit-btn,
    .task-actions .delete-btn {
        padding: 8px 16px;
        font-size: 14px;
        border-radius: var(--radius);
    }

/* جدول المستخدمين */
.users-table {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 2fr 1.5fr 1fr 1.5fr;
    background: var(--background);
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

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

.table-body {
    display: flex;
    flex-direction: column;
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1.5fr 1fr 1.5fr;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease;
}

    .table-row:hover {
        background: var(--background);
    }

    .table-row:last-child {
        border-bottom: none;
    }

.td {
    display: flex;
    align-items: center;
    font-size: 14px;
}

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

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1E40AF, #047857);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.role-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

    .role-badge.admin {
        background: rgba(220, 38, 38, 0.15);
        color: var(--danger-color);
        font-weight: 600;
    }

    .role-badge.user {
        background: rgba(30, 64, 175, 0.15);
        color: var(--primary-color);
        font-weight: 600;
    }

.td .edit-btn,
.td .delete-btn {
    padding: 6px 12px;
    font-size: 12px;
    margin-left: 8px;
}

/* صفحة المستخدم العادي */
.user-dashboard {
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 24px;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: rgba(30, 64, 175, 0.15);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .stat-icon.completed {
        background: rgba(4, 120, 87, 0.15);
        color: var(--secondary-color);
    }

    .stat-icon.urgent {
        background: rgba(220, 38, 38, 0.15);
        color: var(--danger-color);
    }

.stat-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

.tasks-section h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.user-tasks {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.user-task-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    gap: 16px;
    transition: all 0.3s ease;
}

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

    .user-task-card.completed {
        opacity: 0.7;
        background: rgba(4, 120, 87, 0.1);
    }

.task-checkbox {
    flex-shrink: 0;
    margin-top: 4px;
}

    .task-checkbox input[type="checkbox"] {
        display: none;
    }

    .task-checkbox label {
        display: block;
        width: 20px;
        height: 20px;
        border: 2px solid var(--border-color);
        border-radius: 4px;
        cursor: pointer;
        position: relative;
        transition: all 0.3s ease;
    }

    .task-checkbox input[type="checkbox"]:checked + label {
        background: var(--secondary-color);
        border-color: var(--secondary-color);
    }

        .task-checkbox input[type="checkbox"]:checked + label::after {
            content: '';
            position: absolute;
            left: 6px;
            top: 2px;
            width: 6px;
            height: 10px;
            border: solid white;
            border-width: 0 2px 2px 0;
            transform: rotate(45deg);
        }

.task-content {
    flex: 1;
}

    .task-content h3 {
        font-size: 16px;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 8px;
    }

    .task-content p {
        color: var(--text-secondary);
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 12px;
    }

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

.due-date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

    .due-date.completed {
        color: var(--secondary-color);
    }

/* النوافذ المنبثقة */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

    .modal.active {
        display: flex;
    }

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideInUp 0.3s ease-out;
}

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

    .modal-header h3 {
        font-size: 18px;
        font-weight: 600;
        color: var(--text-primary);
    }

.close-btn {
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

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

.modal-body {
    padding: 24px;
}

/* التصميم المتجاوب */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 16px 0;
        border-left: none;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-items {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 16px;
    }

    .nav-item {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

        .nav-item.active {
            border-left: none;
            border-bottom-color: var(--primary-color);
        }

    .main-content {
        padding: 20px;
    }

    .section-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .sections-grid {
        grid-template-columns: 1fr;
    }

    .table-header,
    .table-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .table-header {
        display: none;
    }

    .table-row {
        border: 1px solid var(--border-color);
        border-radius: var(--radius);
        margin-bottom: 16px;
        padding: 16px;
    }

    .td {
        justify-content: space-between;
        padding: 4px 0;
    }

        .td::before {
            content: attr(data-label);
            font-weight: 600;
            color: var(--text-primary);
        }

/* أنماط الأولوية والإشعارات */
.task-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.status-badge, .priority-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.completed {
    background: #D1FAE5;
    color: #065F46;
}

.status-badge.in-progress {
    background: #FEF3C7;
    color: #92400E;
}

.status-badge.pending {
    background: #E5E7EB;
    color: #374151;
}

.priority-badge.critical {
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FCA5A5;
}

.priority-badge.high {
    background: #FED7AA;
    color: #EA580C;
    border: 1px solid #FDBA74;
}

.priority-badge.medium {
    background: #FEF3C7;
    color: #D97706;
    border: 1px solid #FCD34D;
}

.priority-badge.low {
    background: #E5E7EB;
    color: #6B7280;
    border: 1px solid #D1D5DB;
}

/* تحسينات إضافية للمهام */
.task-card {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

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

.task-card.priority-critical {
    border-left-color: #DC2626;
}

.task-card.priority-high {
    border-left-color: #EA580C;
}

.task-card.priority-medium {
    border-left-color: #D97706;
}

.task-card.priority-low {
    border-left-color: #6B7280;
}

/* أنماط التعليقات والمرفقات */
.task-comments, .task-attachments {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.comments-header, .attachments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.comments-list, .attachments-list {
    max-height: 300px;
    overflow-y: auto;
}

.comment-item, .attachment-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.comment-item:hover, .attachment-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.comment-content, .attachment-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comment-text {
    color: #333;
    line-height: 1.5;
    white-space: pre-wrap;
}

.comment-actions, .attachment-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.attachment-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.attachment-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
}

.attachment-info {
    flex: 1;
}

.attachment-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.attachment-meta {
    color: #6c757d;
    font-size: 12px;
}

/* تحسينات للهواتف المحمولة */
@media (max-width: 768px) {
    .comment-actions, .attachment-actions {
        flex-direction: column;
    }
    
    .attachment-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .attachment-icon {
        align-self: flex-start;
    }
}

/* أنماط البحث والفلترة */
.search-filter-section {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-row {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.search-group {
    flex: 2;
    min-width: 200px;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-group .form-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
}

.filter-group .form-check-input {
    margin: 0;
}

/* أنماط الجدول الجديد */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    text-align: center;
    vertical-align: middle;
    padding: 12px 8px;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    padding: 12px 8px;
    border-bottom: 1px solid #dee2e6;
}

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

.table tbody tr.table-success:hover {
    background-color: #d1e7dd;
}

.task-title h6 {
    font-weight: 600;
    color: #212529;
    margin-bottom: 4px;
    line-height: 1.3;
}

.task-title small {
    color: #6c757d;
    font-size: 0.8rem;
    line-height: 1.4;
}

.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    white-space: nowrap;
}

.btn-group .btn {
    border-radius: 0.375rem;
    margin-left: 2px;
    white-space: nowrap;
}

.btn-group .btn:first-child {
    margin-left: 0;
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 768px) {
    .table-responsive {
        border-radius: 0;
        box-shadow: none;
    }
    
    .table {
        margin-bottom: 0;
    }
    
    .table th,
    .table td {
        border-left: none;
        border-right: none;
    }
    
    .table th:first-child,
    .table td:first-child {
        border-left: 1px solid #dee2e6;
    }
    
    .table th:last-child,
    .table td:last-child {
        border-right: 1px solid #dee2e6;
    }
}

/* أنماط صف التفاصيل */
tr[id^="details-"] {
    background-color: #f8f9fa;
}

tr[id^="details-"] .border-top {
    border-top: 2px solid #dee2e6 !important;
}

tr[id^="details-"] .p-3 {
    background-color: white;
    margin: 0 10px;
    border-radius: 0 0 8px 8px;
}

/* تحسينات للهواتف المحمولة */
@media (max-width: 1200px) {
    .table th,
    .table td {
        padding: 8px 6px;
    }
}

@media (max-width: 992px) {
    .table th,
    .table td {
        padding: 6px 4px;
    }
    
    .task-title h6 {
        font-size: 0.9rem;
    }
    
    .task-title small {
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 8px 4px;
    }
    
    .btn-group .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .task-title h6 {
        font-size: 0.9rem;
    }
    
    .task-title small {
        font-size: 0.7rem;
    }
    
    .badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }
    
    .btn-group {
        flex-wrap: wrap;
        gap: 2px;
    }
    
    .btn-group .btn {
        flex: 1;
        min-width: 60px;
    }
}

@media (max-width: 576px) {
    .table th,
    .table td {
        padding: 6px 2px;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 2px;
    }
    
    .btn-group .btn {
        margin-left: 0;
        margin-bottom: 2px;
        width: 100%;
    }
    
    .task-title h6 {
        font-size: 0.85rem;
    }
    
    .task-title small {
        font-size: 0.65rem;
    }
    
    .badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* تحسين عرض المعلومات الإضافية للهواتف */
    .d-md-none .d-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .d-md-none .d-flex .badge,
    .d-md-none .d-flex small {
        font-size: 0.6rem;
    }
}

@media (max-width: 480px) {
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .btn-group .btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .task-title h6 {
        font-size: 0.8rem;
    }
    
    .task-title small {
        font-size: 0.6rem;
    }
    
    .badge {
        font-size: 0.55rem;
        padding: 0.15rem 0.3rem;
    }
}

/* أنماط Pagination */
.pagination-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.pagination-info {
    color: #6c757d;
    font-size: 14px;
}

.pagination-nav {
    display: flex;
    gap: 5px;
    align-items: center;
}

.page-link {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    color: #007bff;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
    min-width: 40px;
    text-align: center;
}

.page-link:hover {
    background: #e9ecef;
    color: #0056b3;
    border-color: #adb5bd;
}

.page-link.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.page-link.active:hover {
    background: #0056b3;
    border-color: #0056b3;
}

/* تحسينات للهواتف المحمولة */
@media (max-width: 768px) {
    .search-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-group, .filter-group {
        min-width: auto;
    }
    
    .pagination-section {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .pagination-nav {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .page-link {
        min-width: 35px;
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* تحسينات إضافية للفلاتر */
    .card-body {
        padding: 1rem;
    }
    
    .form-label {
        font-size: 0.9rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
    }
    
    .form-control,
    .form-select {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        margin-bottom: 0.5rem;
        width: 100%;
    }
    
    .btn-group .btn:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 576px) {
    .card-body {
        padding: 0.75rem;
    }
    
    .form-label {
        font-size: 0.85rem;
    }
    
    .form-control,
    .form-select {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }
    
    .btn-group .btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }
}

    .stats-cards {
        grid-template-columns: 1fr;
    }

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

    .header-left h1 {
        font-size: 18px;
    }

    .user-info {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px;
        margin: 16px;
    }

    .demo-buttons {
        flex-direction: column;
    }

    .task-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .task-actions {
        justify-content: flex-start;
    }
}
