/* Custom Dashboard CSS - مطابق للصورة المرجعية */
:root {
    --primary-blue: #2B67F6;
    --secondary-color: #f8f9fa;
    --border-color: #e9ecef;
    --text-color: #1A1D1F;
    --text-light: #6F767E;
    --text-muted: #9A9FA5;
    
    /* Status Colors */
    --yellow-bg: #FEF9C3;
    --yellow-text: #CA8A04;
    --purple-bg: #F3E8FF;
    --purple-text: #7E22CE;
    --green-bg: #DCFCE7;
    --green-text: #16A34A;
    --blue-bg: #DBEAFE;
    --blue-text: #2563EB;
    --red-bg: #FEE2E2;
    --red-text: #DC2626;
}

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

body {
    background-color: #F4F4F4;
    color: var(--text-color);
    direction: rtl;
    font-size: 14px;
}

/* Layout Container */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #FFFFFF;
    box-shadow: 2px 0 4px rgba(0,0,0,0.05);
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

.sidebar.sidebar-hidden {
    transform: translateX(100%);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid #EFEFEF;
    text-align: center;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.logo .full-logo {
    max-height: 40px;
    width: auto;
}

.sidebar-menu {
    padding: 16px 0;
}

.sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid #EFEFEF;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: var(--primary-blue);
    color: white;
}

.sidebar-menu a i {
    margin-left: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: 280px;
    background: #F4F4F4;
    transition: margin-right 0.3s ease;
    width: 100%;
    min-height: 100vh;
}

/* Main Content with hidden sidebar adjustments */
.main-content.sidebar-collapsed {
    margin-right: 0;
}

.main-content.sidebar-collapsed .desktop-menu-toggle {
    display: flex !important;
}

/* Top Header */
.top-header {
    background: #FFFFFF;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #EFEFEF;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    height: 80px;
    position: relative;
    width: 100%;
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    background: #F5F5F5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 16px;
}

.user-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
}

.header-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    order: 2;
    margin: 8px 0;
}

.header-logo .logo-image {
    max-height: 35px;
}

.search-box {
    position: relative;
    order: 3;
    width: 140px;
    max-width: 140px;
    height: 32px;
    flex-shrink: 0;
}

.search-box input {
    width: 100%;
    height: 40px;
    padding: 8px 40px 8px 16px;
    font-size: 14px;
    border-radius: 20px;
    border: 1px solid #E0E0E0;
    background: #F9F9F9;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.search-box input::placeholder {
    color: #999;
    font-size: 14px;
}

.search-box input:focus {
    border-color: #2B67F6;
    background: #FFFFFF;
    box-shadow: 0 0 0 2px rgba(43, 103, 246, 0.1);
}

.search-box i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
}

.mobile-menu-toggle {
    display: block;
    position: absolute;
    top: 12px;
    left: 16px;
    font-size: 18px;
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    color: var(--text-color);
    transition: background-color 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: #F5F5F5;
}

.desktop-menu-toggle {
    display: none;
}

/* Main Navigation */
.main-nav {
    background: #FFFFFF;
    border-bottom: 1px solid #EFEFEF;
    overflow-x: auto;
    width: 100%;
}

.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0 24px;
    gap: 32px;
}

.main-nav a {
    display: flex;
    align-items: center;
    padding: 16px 0;
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.main-nav a.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
}

.main-nav a i {
    margin-left: 8px;
    font-size: 14px;
}

/* Content Wrapper */
.content-wrapper {
    padding: 24px;
    width: 100%;
    box-sizing: border-box;
}

/* Page Header */
.page-header {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 32px 40px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #F1F3F4;
}

.header-content {
    flex: 1;
    text-align: right;
}

.header-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-color);
    font-family: 'Cairo', sans-serif;
}

.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 14px;
    color: var(--text-light);
    gap: 8px;
}

.breadcrumb span {
    font-weight: 500;
}

.breadcrumb i {
    font-size: 12px;
    color: #D1D5DB;
}

.btn-add {
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-family: 'Cairo', sans-serif;
}

.btn-add:hover {
    background: #1E56E0;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(43, 103, 246, 0.3);
}

.btn-add i {
    font-size: 14px;
}

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
    width: 100%;
}

.stat-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 28px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    min-height: 120px;
    border: 1px solid #F1F3F4;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    order: 1;
}

.stat-icon.yellow {
    background: linear-gradient(135deg, #FEF9C3 0%, #FEF3C7 100%);
    color: #CA8A04;
}

.stat-icon.purple {
    background: linear-gradient(135deg, #F3E8FF 0%, #E9D5FF 100%);
    color: #7E22CE;
}

.stat-icon.green {
    background: linear-gradient(135deg, #DCFCE7 0%, #BBF7D0 100%);
    color: #16A34A;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
    color: #2563EB;
}

.stat-content {
    flex: 1;
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    padding-left: 20px;
    order: 2;
}

.stat-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    line-height: 1.3;
    text-align: right;
    font-family: 'Cairo', sans-serif;
}

.stat-value {
    font-family: 'Cairo', sans-serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-color);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.stat-period {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.2;
    text-align: right;
    font-weight: 500;
}

.stat-indicator {
    font-size: 18px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
}

.stat-indicator.up {
    color: #16A34A;
}

.stat-indicator.up::before {
    content: "↗";
    font-size: 16px;
}

.stat-indicator.down {
    color: #DC2626;
}

.stat-indicator.down::before {
    content: "↘";
    font-size: 16px;
}

/* Cards Row */
.card-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
    width: 100%;
}

.card {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
}

/* Activities Card */
.activities-card {
    padding: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #EFEFEF;
    background: transparent;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.view-all {
    color: #6B7280;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.view-all:hover {
    color: var(--primary-blue);
}

.activities-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid #F5F5F5;
    justify-content: flex-end;
}

.activity-item:last-child {
    border-bottom: none;
}

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

.activity-icon.blue {
    background: #DBEAFE;
    color: #2563EB;
}

.activity-icon.green {
    background: #DCFCE7;
    color: #16A34A;
}

.activity-icon.yellow {
    background: #FEF3C7;
    color: #D97706;
}

.activity-icon.red {
    background: #FEE2E2;
    color: #DC2626;
}

.activity-content {
    flex: 1;
    text-align: right;
}

.activity-content h4 {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 6px 0;
    color: var(--text-color);
    line-height: 1.4;
    text-align: right;
}

.activity-content p {
    font-size: 13px;
    color: #9CA3AF;
    margin: 0;
    font-weight: 400;
    text-align: right;
}

/* Chart Card */
.chart-card {
    padding: 24px;
}

.chart-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #EFEFEF;
    background: transparent;
}

.chart-card .card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    order: 2;
}

.month-selector {
    background: #F8F9FA;
    border: 1px solid #E9ECEF;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    order: 1;
    outline: none;
}

.month-selector:hover {
    background: #E9ECEF;
}

.chart-wrapper {
    height: 200px;
    margin-bottom: 16px;
    position: relative;
}

.chart {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(43, 103, 246, 0.1) 0%, transparent 100%);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.chart svg {
    width: 100%;
    height: 100%;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 16px;
    margin-top: 16px;
}

.chart-labels span {
    color: #9CA3AF;
    font-size: 13px;
    font-weight: 400;
}

/* Documents Table */
.documents-wrapper {
    margin-bottom: 24px;
}

.documents-card {
    padding: 0;
}

.documents-card .card-header {
    padding: 24px;
    margin-bottom: 0;
    border-bottom: 1px solid #EFEFEF;
}

.table-responsive {
    overflow-x: auto;
    padding: 0 24px 24px;
}

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

.documents-table th,
.documents-table td {
    text-align: right;
    padding: 16px 12px;
    border-bottom: 1px solid #F5F5F5;
}

.documents-table th {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    background: transparent;
}

.documents-table td {
    font-size: 14px;
    color: var(--text-color);
}

.documents-table tbody tr:hover {
    background: #F9FAFB;
}

.status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.status.completed {
    background: #E7F9F0;
    color: #00C48C;
}

.status.review {
    background: #EBF2FF;
    color: #2E5BFF;
}

.status.pending {
    background: #FFF8E7;
    color: #FFC542;
}

.status.rejected {
    background: #FFE7E7;
    color: #FF4842;
}

.actions {
    display: flex;
    gap: 8px;
}

.actions a {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.2s;
}

.actions .delete-action {
    color: #FF4842;
}

.actions .edit-action {
    color: #2E5BFF;
}

.actions .view-action {
    color: var(--text-color);
}

.actions a:hover {
    background: #F5F5F5;
}

/* Two Column Cards */
.two-column-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    width: 100%;
}

/* Quick Actions */
.actions-card {
    padding: 24px;
    width: 100%;
    box-sizing: border-box;
}

.actions-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #EFEFEF;
    background: transparent;
}

.actions-card .card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.quick-actions {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: repeat(2, 1fr) !important;
    gap: 12px !important;
    justify-content: stretch;
    align-content: stretch;
    height: 200px;
    max-width: 100%;
}

.quick-action-item {
    background: #F8F9FA;
    border-radius: 12px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-align: center;
    border: 1px solid #F1F3F4;
    box-sizing: border-box;
    min-height: 90px;
    width: 100%;
}

.quick-action-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
}

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

.action-icon.green {
    background: #DCFCE7;
    color: #16A34A;
}

.action-icon.blue {
    background: #DBEAFE;
    color: #2563EB;
}

.action-icon.purple {
    background: #F3E8FF;
    color: #7C3AED;
}

.action-icon.yellow {
    background: #FEF3C7;
    color: #D97706;
}

.quick-action-item span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.2;
    text-align: center;
}

/* Events Card */
.events-card {
    padding: 24px;
    width: 100%;
    box-sizing: border-box;
}

.events-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #EFEFEF;
    background: transparent;
}

.events-card .card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.events-card .view-all {
    color: #6B7280;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.events-card .view-all:hover {
    color: var(--primary-blue);
}

.events-list {
    list-style: none;
    padding: 0;
    margin: 0;
    height: calc(100% - 80px);
    overflow-y: auto;
}

.event-item {
    display: flex;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid #F5F5F5;
}

.event-item:last-child {
    border-bottom: none;
}

.event-date {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-left: 16px;
    flex-shrink: 0;
}

.event-date.blue {
    background: #DBEAFE;
    color: #2563EB;
}

.event-date.green {
    background: #DCFCE7;
    color: #16A34A;
}

.event-date.yellow {
    background: #FEF3C7;
    color: #D97706;
}

.event-date .day {
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
}

.event-date .month {
    font-size: 12px;
    line-height: 1;
    margin-top: 2px;
}

.event-content {
    flex: 1;
}

.event-content h4 {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 4px;
    color: var(--text-color);
}

.event-content .time,
.event-content .location {
    font-size: 13px;
    color: #9CA3AF;
    margin: 2px 0;
}

/* Mobile Documents List */
.mobile-documents-list {
    display: none;
    padding: 0 24px 24px;
}

.document-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #F5F5F5;
}

.document-info h4 {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 4px;
    color: var(--text-color);
}

.document-number {
    font-size: 12px;
    color: var(--text-light);
}

/* Float Button */
.float-add-btn {
    position: fixed;
    left: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(43, 103, 246, 0.3);
    z-index: 999;
    transition: all 0.2s ease;
}

.float-add-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(43, 103, 246, 0.4);
    color: white;
}

/* Mobile Responsive Enhancements */
@media (max-width: 576px) {
    .sidebar {
        transform: translateX(100%);
        z-index: 1002;
        width: 100%;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0;
        width: 100%;
    }
    
    .top-header {
        padding: 12px 16px;
        height: auto;
        min-height: 60px;
        flex-direction: column;
        gap: 12px;
    }
    
    .user-info {
        order: 1;
        align-self: flex-start;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .user-name {
        font-size: 14px;
    }
    
    .header-logo {
        order: 2;
        margin: 8px 0;
    }
    
    .header-logo .logo-image {
        max-height: 35px;
    }
    
    .search-box {
        order: 3;
        width: 140px;
        max-width: 140px;
        height: 32px;
    }
    
    .search-box input {
        height: 32px;
        font-size: 12px;
        padding: 6px 30px 6px 8px;
        border-radius: 16px;
    }
    
    .search-box input::placeholder {
        font-size: 12px;
    }
    
    .search-box i {
        font-size: 12px;
        right: 10px;
    }
    
    .page-header {
        padding: 20px 16px;
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .header-content h2 {
        font-size: 20px;
    }
    
    .breadcrumb {
        font-size: 12px;
        justify-content: center;
    }
    
    .btn-add {
        padding: 12px 20px;
        font-size: 14px;
        align-self: stretch;
        justify-content: center;
    }
    
    .main-nav {
        overflow-x: auto;
        scrollbar-width: thin;
    }
    
    .main-nav::-webkit-scrollbar {
        height: 2px;
    }
    
    .main-nav::-webkit-scrollbar-thumb {
        background: #ddd;
        border-radius: 1px;
    }
    
    .main-nav ul {
        padding: 0 12px;
        gap: 16px;
        min-width: max-content;
    }
    
    .main-nav a {
        font-size: 11px;
        padding: 12px 0;
        white-space: nowrap;
    }
    
    .main-nav a i {
        font-size: 10px;
        margin-left: 4px;
    }
    
    .content-wrapper {
        padding: 16px 12px;
    }
    
    .stats-cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 24px;
        width: 100%;
    }
    
    .stat-card {
        width: 176.6px;
        height: 91.3px;
        border-radius: 9.61px;
        padding: 12px 10px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        box-sizing: border-box;
        min-height: auto;
    }
    
    .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
        border-radius: 8px;
        flex-shrink: 0;
        order: 1;
    }
    
    .stat-content {
        flex: 1;
        padding-left: 8px;
        order: 2;
    }
    
    .stat-value {
        font-size: 18px;
        line-height: 1.1;
        margin-bottom: 4px;
    }
    
    .stat-title {
        font-size: 11px;
        line-height: 1.2;
        margin-bottom: 4px;
    }
    
    .stat-period {
        font-size: 10px;
        line-height: 1.1;
    }
    
    .stat-indicator {
        font-size: 12px;
        margin-left: 2px;
    }
    
    .stat-indicator.up::before,
    .stat-indicator.down::before {
        font-size: 10px;
    }
    
    .card-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .two-column-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .quick-action-item {
        width: auto;
        height: 80px;
        padding: 12px;
    }
    
    .desktop-menu-toggle {
        display: none !important;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .sidebar {
        transform: translateX(100%);
        z-index: 1002;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0;
        width: 100%;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .top-header {
        padding: 14px 20px;
        height: 70px;
    }
    
    .header-logo .logo-image {
        max-height: 40px;
    }
    
    .search-box {
        width: 250px;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .content-wrapper {
        padding: 20px 16px;
    }
    
    .desktop-menu-toggle {
        display: none !important;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .sidebar {
        transform: translateX(100%);
        z-index: 1002;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0;
        width: 100%;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .card-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .two-column-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .content-wrapper {
        padding: 24px 20px;
    }
    
    .desktop-menu-toggle {
        display: none !important;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .mobile-menu-toggle {
        display: none;
    }
    
    .desktop-menu-toggle {
        display: none;
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        background: #FFFFFF;
        color: var(--text-color);
        border: 1px solid #E9ECEF;
        border-radius: 8px;
        width: 40px;
        height: 40px;
        font-size: 16px;
        cursor: pointer;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        transition: all 0.3s ease;
        align-items: center;
        justify-content: center;
        z-index: 1001;
        order: 1;
        margin-left: 12px;
    }
    
    .desktop-menu-toggle:hover {
        background: #F8F9FA;
        color: var(--primary-blue);
        border-color: var(--primary-blue);
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
    
    .main-content.sidebar-collapsed .desktop-menu-toggle {
        display: flex;
    }
    
    .user-info {
        order: 3;
    }
    
    .header-logo {
        display: none;
    }
    
    .search-box {
        order: 2;
        width: 300px;
        max-width: 300px;
        height: 40px;
    }
    
    .search-box input {
        height: 40px;
        padding: 8px 40px 8px 16px;
        font-size: 14px;
        border-radius: 20px;
    }
    
    .search-box input::placeholder {
        font-size: 14px;
    }
    
    .search-box i {
        font-size: 16px;
        right: 16px;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        height: 180px;
    }
    
    .quick-action-item {
        min-height: 80px;
        padding: 14px;
    }
    
    .stats-cards {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }
}

/* Menu Toggle & Overlay */
.menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    background: white;
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.close-sidebar {
    background: none;
    border: none;
    position: absolute;
    top: 16px;
    left: 16px;
    font-size: 18px;
    color: var(--text-light);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    z-index: 1001;
}

.close-sidebar:hover {
    background: #F5F5F5;
    color: var(--text-color);
}

/* Mobile Menu Show State */
@media (max-width: 991.98px) {
    .sidebar-overlay.show {
        display: block;
    }
}

/* Ensure proper RTL layout on all screen sizes */
html[dir="rtl"] * {
    text-align: right;
}

html[dir="rtl"] .main-nav ul {
    justify-content: flex-start;
}

html[dir="rtl"] .top-header {
    flex-direction: row;
}

/* Additional mobile responsive enhancements for documents table */
@media (max-width: 576px) {
    .table-responsive {
        display: none;
    }
    
    .mobile-documents-list {
        display: block;
    }
    
    .card-header h3 {
        font-size: 16px;
    }
    
    .activity-content h4,
    .event-content h4,
    .document-info h4 {
        font-size: 13px;
    }
    
    .activity-content p,
    .event-content .time,
    .event-content .location {
        font-size: 12px;
    }
    
    .chart-wrapper {
        height: 150px;
    }
    
    .float-add-btn {
        width: 48px;
        height: 48px;
        bottom: 16px;
        left: 16px;
    }
}

/* Extra small screens adjustments */
@media (max-width: 360px) {
    .stats-cards {
        gap: 8px;
    }
    
    .stat-card {
        width: calc(50% - 4px);
        height: 85px;
        padding: 10px 8px;
    }
    
    .stat-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .stat-title {
        font-size: 10px;
    }
    
    .stat-period {
        font-size: 9px;
    }
    
    .search-box {
        width: 100px;
        max-width: 100px;
        height: 28px;
    }
    
    .search-box input {
        height: 28px;
        font-size: 10px;
        padding: 0 25px 0 6px;
        line-height: 28px;
    }
    
    .search-box input::placeholder {
        font-size: 10px;
    }
    
    .search-box i {
        font-size: 10px;
        right: 8px;
    }
} 