/* نظام إدارة محل خياطة وتفصيل الملابس العمانية الرجالية
-------------------------------------------------- */

/* إعدادات عامة */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #3730a3;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --success-light: #34d399;
    --danger-color: #ef4444;
    --danger-light: #f87171;
    --warning-color: #f59e0b;
    --warning-light: #fbbf24;
    --info-color: #06b6d4;
    --info-light: #22d3ee;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Tajawal', sans-serif;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    overflow-x: hidden;
    line-height: 1.6;
    color: var(--gray-700);
}

/* السايدبار */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

#sidebar {
    width: 220px;
    min-height: 100vh;
    transition: var(--transition);
    box-shadow: var(--shadow-xl);
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, var(--dark-color) 0%, var(--gray-800) 100%);
    /* تعطيل الضبابية التي قد تؤثر على الخلفية */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0 var(--border-radius-xl) var(--border-radius-xl) 0;
}

#sidebar.active {
    margin-right: -220px;
}

#sidebar .sidebar-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 0 var(--border-radius-xl) 0 0;
    position: relative;
    overflow: hidden;
}

#sidebar .sidebar-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

#sidebar ul.components {
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebar ul p {
    color: rgba(255, 255, 255, 0.9);
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#sidebar ul li a {
    padding: 0.875rem 1.25rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    margin: 0.125rem 0;
    position: relative;
    font-weight: 500;
}

#sidebar ul li a i {
    width: 1.25rem;
    margin-left: 0.75rem;
    font-size: 1rem;
    opacity: 0.8;
    transition: var(--transition);
}

#sidebar ul li a:hover {
    color: #fff;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    transform: translateX(-2px);
    box-shadow: var(--shadow-md);
}

#sidebar ul li a:hover i {
    opacity: 1;
    transform: scale(1.1);
}

#sidebar ul li.active > a,
a[aria-expanded="true"] {
    color: #fff;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
    box-shadow: var(--shadow-lg);
    transform: translateX(-2px);
}

#sidebar ul li.active > a::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--warning-color) 0%, var(--warning-light) 100%);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

#sidebar ul ul a {
    font-size: 0.875rem !important;
    padding-right: 2.5rem !important;
    background: rgba(0, 0, 0, 0.2);
    margin: 0.0625rem 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.sidebar-footer {
    border-top: 1px solid #3f4950;
}

/* المحتوى الرئيسي */
#content {
    width: calc(100% - 280px);
    min-height: 100vh;
    transition: var(--transition);
    padding: 2rem;
    background: transparent;
}

/* البطاقات */
.card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    margin-bottom: 1.5rem;
    /* خلفية صلبة لمنع تأثير الزجاج/الضبابية */
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-xl);
    border-color: rgba(255, 255, 255, 0.3);
}

.card-header {
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0 !important;
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, rgba(255, 255, 255, 0.8) 100%);
    position: relative;
}

.card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--info-color) 50%, var(--success-color) 100%);
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
    color: var(--gray-800);
    font-size: 1.125rem;
}

.card-body {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
}

.card-footer {
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg) !important;
    border-top: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, rgba(255, 255, 255, 0.8) 100%);
}

/* بطاقات لوحة التحكم */
.dashboard-card {
    border-radius: var(--border-radius-xl);
    padding: 2rem;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    /* تعطيل الضبابية */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    opacity: 0.3;
}

.dashboard-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.dashboard-card .icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.95);
    position: relative;
    z-index: 2;
    transition: var(--transition);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.dashboard-card:hover .icon {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));
}

.dashboard-card .title {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dashboard-card .count {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-family: 'Courier New', monospace;
}

.dashboard-card.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: 0 8px 32px rgba(79, 70, 229, 0.3);
}

.dashboard-card.success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
}

.dashboard-card.warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.3);
}

.dashboard-card.danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.3);
}

.dashboard-card.info {
    background: linear-gradient(135deg, var(--info-color) 0%, #0891b2 100%);
    box-shadow: 0 8px 32px rgba(6, 182, 212, 0.3);
}

.dashboard-card.secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--gray-600) 100%);
    box-shadow: 0 8px 32px rgba(100, 116, 139, 0.3);
}

/* صفحة تسجيل الدخول */
.login-container {
    background: linear-gradient(135deg, #007bff, #005bb5);
    height: 100vh;
}

.login-card {
    max-width: 400px;
    border-radius: 20px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.login-header {
    background: #232b34;
    padding: 30px 20px;
    text-align: center;
    color: #fff;
}

.login-header h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.login-body {
    padding: 30px;
}

/* الجداول */
.table {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.table thead th {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-50) 100%);
    border: none;
    font-weight: 600;
    color: var(--gray-800);
    padding: 1rem 0.75rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-200);
}

.table tbody td {
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
    transition: var(--transition);
}

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

.table-hover tbody tr:hover {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.05) 0%, rgba(79, 70, 229, 0.02) 100%);
    transform: scale(1.01);
    box-shadow: var(--shadow-sm);
}

.table-responsive {
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

/* النماذج */
.form-control {
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    background: rgba(255, 255, 255, 0.9);
    transition: var(--transition);
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}

.form-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* الأزرار */
.btn {
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--success-light) 0%, var(--success-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

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

.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger-light) 0%, var(--danger-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, var(--warning-light) 0%, var(--warning-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #0891b2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.btn-info:hover {
    background: linear-gradient(135deg, var(--info-light) 0%, var(--info-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* بطاقة الزبون */
.customer-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}

.customer-card .customer-actions {
    position: absolute;
    top: 10px;
    left: 10px;
}

.measurement-card {
    border-right: 4px solid #007bff;
}

/* بطاقة القماش */
.fabric-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}

.fabric-card .fabric-image {
    height: 150px;
    background-size: cover;
    background-position: center;
}

.fabric-card .fabric-code {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
}

.fabric-card .fabric-stock {
    position: absolute;
    top: 10px;
    left: 10px;
}

/* شريط التقدم للمخزون */
.stock-progress {
    height: 8px;
}

/* شارات الحالة */
.badge-pending {
    background-color: #ffc107;
    color: #212529;
}

.badge-in-progress {
    background-color: #17a2b8;
    color: #fff;
}

.badge-ready {
    background-color: #28a745;
    color: #fff;
}

.badge-delivered {
    background-color: #6c757d;
    color: #fff;
}

.badge-cancelled {
    background-color: #dc3545;
    color: #fff;
}

/* الفواتير */
.invoice-header {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.invoice-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.invoice-details {
    margin-bottom: 20px;
}

.invoice-table th {
    background-color: #f8f9fa;
}

.invoice-total {
    font-size: 1.2rem;
    font-weight: bold;
}

/* تحسينات للشاشات المتجاوبة */
/* ===================================== */

/* الشاشات الكبيرة جداً (1400px وأكبر) */
@media (min-width: 1400px) {
    .container-fluid {
        max-width: 1320px;
        margin: 0 auto;
    }
    
    .dashboard-card .icon {
        font-size: 4rem;
    }
    
    .dashboard-card .count {
        font-size: 2.5rem;
    }
    
    .card {
        margin-bottom: 30px;
    }
}

/* الشاشات الكبيرة (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    #sidebar {
        width: 220px;
    }
    
    #content {
        width: calc(100% - 220px);
    }
    
    .dashboard-card .icon {
        font-size: 3.5rem;
    }
}

/* الشاشات المتوسطة (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    #sidebar {
        width: 220px;
    }
    
    #content {
        width: calc(100% - 220px);
    }
    
    .dashboard-card .icon {
        font-size: 3rem;
    }
    
    .dashboard-card .count {
        font-size: 1.8rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
}

/* الشاشات الصغيرة (768px - 991px) - التابلت */
@media (min-width: 768px) and (max-width: 991px) {
    .wrapper {
        flex-direction: column;
    }
    
    #sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    #sidebar.show {
        transform: translateX(0);
    }
    
    #content {
        width: 100%;
        padding: 15px;
    }
    
    .dashboard-card {
        margin-bottom: 20px;
        padding: 15px;
    }
    
    .dashboard-card .icon {
        font-size: 2.5rem;
    }
    
    .dashboard-card .count {
        font-size: 1.5rem;
    }
    
    .card {
        margin-bottom: 15px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin-bottom: 5px;
        border-radius: 5px !important;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .form-control {
        padding: 12px 15px;
        font-size: 16px; /* منع التكبير في iOS */
    }
}

/* الشاشات الصغيرة جداً (576px - 767px) - الهواتف الكبيرة */
@media (min-width: 576px) and (max-width: 767px) {
    .wrapper {
        flex-direction: column;
    }
    
    #sidebar {
        width: 100%;
        min-height: auto;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    }
    
    #sidebar.show {
        transform: translateX(0);
    }
    
    #content {
        width: 100%;
        padding: 10px;
        margin-top: 60px; /* مساحة للهيدر المحمول */
    }
    
    /* هيدر محمول */
    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: #232b34;
        z-index: 1040;
        display: flex;
        align-items: center;
        padding: 0 15px;
        color: white;
    }
    
    .mobile-menu-btn {
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        margin-left: 15px;
    }
    
    .dashboard-card {
        margin-bottom: 15px;
        padding: 20px 15px;
    }
    
    .dashboard-card .icon {
        font-size: 2rem;
    }
    
    .dashboard-card .count {
        font-size: 1.3rem;
    }
    
    .card {
        margin-bottom: 15px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        margin-bottom: 5px;
        border-radius: 5px !important;
        width: 100%;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 8px 4px;
        white-space: nowrap;
    }
    
    .form-control {
        padding: 12px 15px;
        font-size: 16px; /* منع التكبير في iOS */
    }
    
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .login-card {
        margin: 20px;
        max-width: calc(100% - 40px);
    }
}

/* الشاشات الصغيرة جداً (أقل من 576px) - الهواتف الصغيرة */
@media (max-width: 575px) {
    .wrapper {
        flex-direction: column;
    }
    
    #sidebar {
        width: 100%;
        min-height: auto;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    }
    
    #sidebar.show {
        transform: translateX(0);
    }
    
    #content {
        width: 100%;
        padding: 10px 5px;
        margin-top: 60px;
    }
    
    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: #232b34;
        z-index: 1040;
        display: flex;
        align-items: center;
        padding: 0 10px;
        color: white;
    }
    
    .mobile-menu-btn {
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        margin-left: 10px;
    }
    
    .container-fluid {
        padding: 0 10px;
    }
    
    .row {
        margin: 0 -5px;
    }
    
    .col, .col-* {
        padding: 0 5px;
    }
    
    .dashboard-card {
        margin-bottom: 10px;
        padding: 15px 10px;
        text-align: center;
    }
    
    .dashboard-card .icon {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
    
    .dashboard-card .title {
        font-size: 1rem;
        margin-bottom: 5px;
    }
    
    .dashboard-card .count {
        font-size: 1.2rem;
    }
    
    .card {
        margin-bottom: 10px;
    }
    
    .card-body {
        padding: 10px;
    }
    
    .card-header {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        margin-bottom: 3px;
        border-radius: 5px !important;
        width: 100%;
        font-size: 0.8rem;
    }
    
    .table-responsive {
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 6px 3px;
        white-space: nowrap;
    }
    
    .form-control {
        padding: 10px 12px;
        font-size: 16px; /* منع التكبير في iOS */
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }
    
    .modal-dialog {
        margin: 5px;
        max-width: calc(100% - 10px);
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .login-card {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .login-body {
        padding: 20px 15px;
    }
    
    h1, h2, h3 {
        font-size: 1.2rem;
    }
    
    h4, h5, h6 {
        font-size: 1rem;
    }
    
    .page-title h2 {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }
    
    .breadcrumb {
        font-size: 0.8rem;
        padding: 5px 0;
    }
}

/* تحسينات إضافية للشاشات اللمسية */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px; /* الحد الأدنى للمس */
        min-width: 44px;
    }
    
    .table th,
    .table td {
        padding: 12px 8px;
    }
    
    .form-control {
        min-height: 44px;
    }
    
    .card:hover {
        transform: none; /* إزالة التأثير للشاشات اللمسية */
    }
}

/* تحسينات للوضع الأفقي على الهواتف */
@media (max-width: 767px) and (orientation: landscape) {
    .mobile-header {
        height: 50px;
    }
    
    #content {
        margin-top: 50px;
    }
    
    .dashboard-card {
        padding: 10px;
    }
    
    .dashboard-card .icon {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }
    
    .dashboard-card .count {
        font-size: 1.1rem;
    }
}

/* إخفاء عناصر غير ضرورية على الشاشات الصغيرة */
@media (max-width: 767px) {
    .d-none-mobile {
        display: none !important;
    }
    
    .table .btn-group .btn {
        padding: 5px 8px;
        font-size: 0.75rem;
    }
    
    .table .btn-group .btn i {
        font-size: 0.8rem;
    }
    
    /* تحسين عرض الجداول على الهواتف */
    .table-mobile-stack {
        display: block;
    }
    
    .table-mobile-stack thead {
        display: none;
    }
    
    .table-mobile-stack tbody,
    .table-mobile-stack tr,
    .table-mobile-stack td {
        display: block;
        width: 100%;
    }
    
    .table-mobile-stack tr {
        border: 1px solid #ddd;
        margin-bottom: 10px;
        border-radius: 5px;
        padding: 10px;
        background: white;
    }
    
    .table-mobile-stack td {
        border: none;
        padding: 5px 0;
        text-align: right;
    }
    
    .table-mobile-stack td:before {
        content: attr(data-label) ": ";
        font-weight: bold;
        color: #333;
    }
}

/* تحسينات إضافية للواجهة */
.page-title {
    margin-bottom: 2rem;
}

.page-title h2 {
    color: var(--gray-800);
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.breadcrumb {
    background: rgba(255, 255, 255, 0.8);
    /* إزالة الضبابية لإبقاء بقية الصفحة واضحة */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-sm);
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.breadcrumb-item a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--gray-600);
    font-weight: 600;
}

/* تحسين الشارات */
.badge {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* تحسين التنبيهات */
.alert {
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-left: 4px solid var(--success-color);
    color: #065f46;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    border-left: 4px solid var(--danger-color);
    color: #991b1b;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-left: 4px solid var(--warning-color);
    color: #92400e;
}

.alert-info {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(6, 182, 212, 0.05) 100%);
    border-left: 4px solid var(--info-color);
    color: #155e75;
}

/* تحسين المودالات */
.modal-content {
    border: none;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #ffffff;
}

.modal-header {
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, rgba(255, 255, 255, 0.8) 100%);
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, rgba(255, 255, 255, 0.8) 100%);
    border-radius: 0 0 var(--border-radius-xl) var(--border-radius-xl);
}

/* تحسين الدروب داون */
.dropdown-menu {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #ffffff;
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    transition: var(--transition);
    font-weight: 500;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    transform: translateX(4px);
}

/* تأثيرات الحركة */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* للطباعة */
@media print {
    body * {
        visibility: hidden;
    }
    
    .print-section, .print-section * {
        visibility: visible;
    }
    
    .print-section {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    
    .no-print {
        display: none !important;
    }
    
    #sidebar,
    .mobile-header,
    .btn,
    .dropdown {
        display: none !important;
    }
    
    #content {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}
