/* * نظام إدارة المبيعات - التصميم الجديد (Modern & Compact)
 * تصميم: احترافي، متجاوب، مضغوط
 */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700&display=swap');

:root {
    /* المتغيرات الأساسية - سيتم تجاوزها بواسطة PHP في الهيدر */
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #eff6ff;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;

    /* ألوان النظام */
    --bg-body: #f3f4f6;
    --bg-surface: #ffffff;
    --bg-hover: #f9fafb;

    --text-main: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;

    --border-color: #e5e7eb;

    /* قياسات */
    --header-height: 60px;
    --sidebar-width: 250px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* متغيرات خاصة بالقوائم المنسدلة */
    --select-height: 44px;
    --select-radius: var(--radius-lg);
    --select-padding-x: 0.9rem;
    --select-arrow-size: 32px;
    --select-arrow-bg: color-mix(in srgb, var(--primary-color), white 86%);
    --select-arrow-color: var(--primary-color);
    --select-chip-bg: color-mix(in srgb, var(--primary-color), white 94%);

    /* ظلال ناعمة واحترافية */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-focus: 0 0 0 3px rgba(59, 130, 246, 0.15);
    /* ظل عند التركيز */
}

/* --- الأساسيات (Reset & Base) --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 12px;
    line-height: 1.5;
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

ul {
    list-style: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
    outline: none;
}

/* --- الهيكل العام (Layout) --- */
.wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* --- القائمة الجانبية (Sidebar) --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.sidebar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.sidebar-menu a:hover {
    background-color: var(--bg-hover);
    color: var(--primary-color);
    transform: translateX(-3px);
}

.sidebar-menu a.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 700;
}

.sidebar-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.5rem 0;
}

.logout-link {
    color: var(--danger-color) !important;
}

.logout-link:hover {
    background-color: #fee2e2 !important;
}

/* --- المحتوى الرئيسي (Main Content) --- */
.main-content {
    margin-right: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.container {
    width: 100%;
    max-width: 1400px;
    /* مساحة أوسع للعرض */
    margin: 0 auto;
    padding: 1rem 1.25rem;
    flex: 1;
}

/* --- الهيدر العلوي للموبايل --- */
.mobile-header {
    display: none;
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: var(--shadow-sm);
}

.sidebar-toggle {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.sidebar-toggle:active {
    background: var(--bg-hover);
}

/* --- مكونات الصفحة --- */

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.page-title i {
    color: var(--primary-color);
}

/* Cards */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-main);
}

.card-body {
    padding: 1rem 1.25rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--primary-color), transparent 80%);
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1);
}

.stat-icon.sales {
    background: #eff6ff;
    color: #3b82f6;
}

.stat-icon.customers {
    background: #ecfdf5;
    color: #10b981;
}

.stat-icon.debts {
    background: #fef2f2;
    color: #ef4444;
}

.stat-icon.products {
    background: #fffbeb;
    color: #f59e0b;
}

.stat-info h3 {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.stat-number {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    letter-spacing: -0.5px;
}

/* ==========================================================================
    1. تحسينات الجداول (Tables Improvements) - احترافي
    ========================================================================== 
 */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    background: var(--bg-surface);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* إزالة البوردر القديم إذا وجد في HTML وتوحيده */
.card .table-responsive {
    border: none !important;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    /* للفواصل */
    border-spacing: 0;
    font-size: 0.8rem;
    white-space: nowrap;
}

.data-table thead {
    background-color: #f8fafc;
}

.data-table th {
    padding: 0.7rem 1rem;
    text-align: right;
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    /* شكلي للغات اللاتينية */
    letter-spacing: 0.2px;
}

.data-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
    background: var(--bg-surface);
    transition: background 0.2s;
}

/* تأثير الـ Zebra Striping الخفيف جداً اختياري، هنا نستخدم الهوفر القوي */
.data-table tbody tr:hover td {
    background-color: #f8fafc;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* تحسين عرض البيانات داخل الخلايا */
.data-table td small {
    display: block;
    margin-top: 2px;
    font-size: 0.7rem;
}

/* تحسين الأزرار داخل الجداول */
.data-table .btn {
    white-space: nowrap;
    min-width: fit-content;
}

.data-table .action-buttons {
    justify-content: flex-end;
}

/* تحسين الأزرار في صفوف الجداول */
.data-table tbody tr:hover .action-buttons .btn {
    opacity: 1;
}

.data-table tbody tr .action-buttons .btn {
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

/* ==========================================================================
    2. تحسينات الأزرار (Buttons Improvements) - عصري
    ========================================================================== 
 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.4;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn i {
    font-size: 1em;
}

/* تأثير الضغط */
.btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

/* أزرار بأحجام مختلفة */
.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
}

.btn-block {
    width: 100%;
}

/* الألوان المعدلة للأزرار */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: transparent;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--text-main);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
    /* Darker green */
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    /* Darker red */
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

/* ==========================================================================
    3. تحسينات النماذج والبحث (Inputs & Search) - نظيف
    ========================================================================== 
 */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* تنسيق الحقول */
.form-control {
    width: 100%;
    padding: 0.55rem 0.85rem;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-main);
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

/* تأثير التركيز (Focus) */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-focus);
    outline: none;
    background: white;
}

.form-control:hover:not(:focus) {
    border-color: #cbd5e1;
}

/* تحسين حقول البحث */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-box .search-icon {
    position: absolute;
    left: 1rem;
    /* نقل الأيقونة لليسار في RTL */
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.2s ease;
    z-index: 2;
}

.search-box input[type="text"],
.search-box input[type="search"] {
    padding-left: 2.8rem !important;
    padding-right: 1rem !important;
    border-radius: var(--radius-md);
}

.search-box input:focus~.search-icon {
    color: var(--primary-color);
}

/* تحسين حقول التاريخ والوقت لتشبه النصوص */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    appearance: none;
    min-height: 38px;
    /* ارتفاع موحد */
    color: var(--text-secondary);
}

/* ==========================================================================
   تحسينات القوائم المنسدلة (Enhanced Select Dropdowns)
   ========================================================================== */

select.form-control {
    width: 100%;
    min-height: var(--select-height);
    padding: 0.55rem calc(var(--select-padding-x) + 1.4rem) 0.55rem var(--select-padding-x);
    border: 1.5px solid var(--border-color);
    border-radius: var(--select-radius);
    background-color: var(--bg-surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='2.2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8 10l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.85rem center;
    background-size: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease, background-color 0.2s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    outline: none;
}

select.form-control[data-enhanced-select] {
    background-image: none;
    padding-left: calc(var(--select-padding-x) + var(--select-arrow-size) + 0.4rem);
}

select.form-control:hover:not(:disabled):not(:focus) {
    border-color: color-mix(in srgb, var(--primary-color), var(--border-color) 65%);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

select.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12), 0 8px 24px rgba(59, 130, 246, 0.18);
    background-color: #ffffff;
    transform: translateY(-1px);
}

select.form-control:disabled {
    background-color: var(--bg-hover);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.65;
    border-color: var(--border-color);
    box-shadow: none;
}

select.form-control option {
    padding: 0.65rem 0.9rem;
    font-size: 0.82rem;
    color: var(--text-main);
    background: white;
    border: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    line-height: 1.5;
}

select.form-control option:hover {
    background: linear-gradient(90deg,
            color-mix(in srgb, var(--primary-color), white 90%) 0%,
            color-mix(in srgb, var(--primary-color), white 96%) 100%);
    color: var(--primary-color);
    font-weight: 600;
}

select.form-control option:checked,
select.form-control option[selected] {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 600;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

select.form-control option:disabled {
    color: var(--text-muted);
    background-color: #f9fafb;
    font-style: italic;
    opacity: 0.6;
    cursor: not-allowed;
}

select.form-control::-ms-expand {
    display: none;
}

select.form-control::-moz-focus-inner {
    border: 0;
}

select.form-control:focus-visible,
select.form-control:focus-within,
select.form-control:active {
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

select.form-control:focus::-webkit-select-focus-ring {
    display: none;
}

/* ==========================================================================
   مكون الحقل المحسّن للقوائم (Select Field Component)
   ========================================================================== */

.select-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    width: 100%;
}

.select-shell {
    position: relative;
    isolation: isolate;
}

.select-shell select.form-control {
    position: relative;
    z-index: 2;
}

.select-shell .select-glow {
    position: absolute;
    inset: 0;
    border-radius: var(--select-radius);
    background: linear-gradient(135deg,
            color-mix(in srgb, var(--primary-color), transparent 85%),
            color-mix(in srgb, var(--primary-color), transparent 95%));
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    z-index: 1;
    filter: blur(0.5px);
}

.select-shell select.form-control:focus + .select-glow,
.select-shell select.form-control:focus-visible + .select-glow {
    opacity: 1;
    transform: scale(1.02);
}

.select-shell .select-chevron {
    position: absolute;
    left: 0.45rem;
    top: 50%;
    width: var(--select-arrow-size);
    height: var(--select-arrow-size);
    transform: translateY(-50%);
    border-radius: var(--radius-md);
    background: var(--select-arrow-bg);
    color: var(--select-arrow-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 3;
    transition: all 0.25s ease;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.2);
}

.select-shell select.form-control:focus ~ .select-chevron {
    background: var(--primary-color);
    color: white;
    transform: translateY(-50%) rotate(180deg);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
}

.select-shell.has-leading-icon select.form-control {
    padding-right: calc(var(--select-padding-x) + var(--select-arrow-size) + 0.35rem);
}

.select-shell .select-leading-icon {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    width: var(--select-arrow-size);
    height: var(--select-arrow-size);
    transform: translateY(-50%);
    border-radius: var(--radius-md);
    background: var(--bg-hover);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 3;
    transition: all 0.25s ease;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
    font-size: 0.9rem;
}

.select-shell select.form-control:focus ~ .select-leading-icon {
    color: var(--primary-color);
    background: var(--primary-light);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.25);
}

.select-field .select-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.select-field .select-placeholder {
    flex: 1;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.select-field .select-value-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--select-chip-bg);
    color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.18);
    opacity: 0;
    transform: translateY(4px);
    transition: all 0.25s ease;
    white-space: nowrap;
}

.select-field.is-filled .select-placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.select-field.is-filled .select-value-chip {
    opacity: 1;
    transform: translateY(0);
}

.select-field.is-filled .select-value-chip::before {
    content: '✓';
    font-size: 0.75rem;
}

.select-field--inline {
    gap: 0.25rem;
}

.select-field--inline .select-shell select.form-control {
    min-height: 36px;
    font-size: 0.78rem;
    padding: 0.35rem calc(var(--select-padding-x) + var(--select-arrow-size)) 0.35rem var(--select-padding-x);
}

.select-field--inline .select-meta {
    display: none;
}

.select-field--inline .select-chevron {
    width: 26px;
    height: 26px;
    left: 0.2rem;
    font-size: 0.72rem;
}

.select-field--compact .select-shell select.form-control {
    min-height: 38px;
    font-size: 0.78rem;
}

/* ==========================================================================
   القوائم المنسدلة المعطلة والمتعددة
   ========================================================================== */

select.form-control[multiple] {
    min-height: 150px;
    padding: 0.6rem;
    background-image: none;
    border-width: 1px;
}

select.form-control[multiple] option {
    padding: 0.65rem 0.9rem;
    margin: 0.2rem 0;
    border-radius: var(--radius-sm);
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

select.form-control[multiple] option:hover {
    background: color-mix(in srgb, var(--primary-color), white 92%);
    border-left-color: var(--primary-color);
    padding-right: 1.1rem;
}

select.form-control[multiple] option:checked {
    background: linear-gradient(90deg,
            var(--primary-color) 0%,
            var(--primary-dark) 100%);
    color: white;
    border-left-color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   تأثيرات انتقالية متقدمة للقوائم المنسدلة
   ========================================================================== */

select.form-control * {
    outline: none !important;
}

select.form-control:focus,
select.form-control:active,
select.form-control:focus-visible {
    -webkit-tap-highlight-color: transparent;
    -webkit-focus-ring-color: transparent;
    tap-highlight-color: transparent;
}


/* ==========================================================================
   تحسينات خاصة للقوائم المنسدلة المخصصة
   ========================================================================== */

.customer-select-input,
.product-select-input {
    font-size: 0.8rem;
}

.customer-select-input option,
.product-select-input option {
    padding: 0.6rem 0.85rem;
    font-size: 0.8rem;
}

/* ==========================================================================
   تحسينات للقوائم المنسدلة في المودال
   ========================================================================== */

.modal-body select.form-control {
    background-color: white;
    border-color: var(--border-color);
}

.modal-body select.form-control:focus {
    background-color: white;
    border-color: var(--primary-color);
}


/* تأثير على الـ label عند hover على القائمة */
@supports (selector(:has(*))) {
    .form-group:has(select.form-control:hover) label {
        color: var(--primary-color);
        transition: color 0.2s ease;
    }

    .form-group:has(select.form-control:focus) label {
        color: var(--primary-color);
        font-weight: 600;
    }
}

/* تأثير إضافي للقوائم المنسدلة في الكاردات */
.card select.form-control {
    background-color: white;
}

.card select.form-control:focus {
    background-color: white;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color), transparent 85%),
        0 4px 14px rgba(0, 0, 0, 0.12);
}

/* تحسينات للقوائم المنسدلة في الجداول */
.data-table select.form-control {
    font-size: 0.8rem;
    padding: 0.45rem 0.7rem;
    padding-left: 2.1rem;
    background-size: 16px;
    background-position: left 0.65rem center;
}


/* تحسين شريط أدوات الجدول */
.table-toolbar {
    background: #ffffff !important;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

/* --- الشارات (Badges) --- */
.badge {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    line-height: 1;
    letter-spacing: 0.3px;
}

.badge-success {
    background: #dcfce7;
    color: #15803d;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-warning {
    background: #fef3c7;
    color: #b45309;
}

.badge-info {
    background: #e0f2fe;
    color: #0369a1;
}

/* --- التنبيهات (Alerts) --- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    border: 1px solid transparent;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.alert-danger,
.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

/* --- المودال (Modal) --- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.6);
    /* تعتيم أكثر احترافية */
    z-index: 2000;
    backdrop-filter: blur(4px);
    /* تأثير ضبابي للخلفية */
    padding: 1rem;
    overflow-y: auto;
}

.modal-content {
    background: white;
    margin: 2rem auto;
    max-width: 550px;
    width: 100%;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    border: none;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: #ffffff;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.modal-footer,
.form-actions {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: #f9fafb;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

.btn-close {
    background: #f3f4f6;
    border: none;
    color: var(--text-secondary);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-close:hover {
    background: #e5e7eb;
    color: var(--danger-color);
}

/* --- الموبايل (Mobile Responsive) --- */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(100%);
        width: 280px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-right: 0;
        width: 100%;
    }

    .mobile-header {
        display: flex;
    }

    .container {
        padding: 0.75rem;
    }

    /* جداول الموبايل (Card View) بشكل أنيق */
    .data-table thead {
        display: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        margin-bottom: 1rem;
        background: white;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-sm);
        padding: 0;
        overflow: hidden;
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.7rem 0.85rem;
        border-bottom: 1px solid #f3f4f6;
        text-align: left;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-secondary);
        font-size: 0.75rem;
    }

    .table-responsive {
        background: transparent;
        border-radius: 0;
    }
}

/* --- أدوات مساعدة (Utilities) --- */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.pt-2 {
    padding-top: 0.5rem;
}

.p-0 {
    padding: 0;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.p-5 {
    padding: 1.25rem;
}

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.align-items-start {
    align-items: flex-start;
}

.justify-content-between {
    justify-content: space-between;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.font-weight-bold {
    font-weight: 700;
}

.font-weight-600 {
    font-weight: 600;
}

.text-muted {
    color: var(--text-muted);
}

.text-danger {
    color: var(--danger-color);
}

.text-success {
    color: var(--success-color);
}

.text-primary {
    color: var(--primary-color);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-warning {
    color: var(--warning-color);
}

.rounded {
    border-radius: var(--radius-md);
}

.w-100 {
    width: 100%;
}

.bg-light {
    background: #f8fafc;
}

.small {
    font-size: 0.8rem;
}

.opacity-50 {
    opacity: 0.5;
}

.border-top {
    border-top: 1px solid var(--border-color);
}

.me-1 {
    margin-left: 0.25rem;
}

/* ==========================================================================
   صفحة سجل العميل (Customer Sales Page) - تصميم محسّن ومضغوط
   ========================================================================== */

/* Profile Header - رأس الصفحة */
.profile-header {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease;
}

.profile-header:hover {
    box-shadow: var(--shadow-md);
}

.profile-header h1 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

.profile-header .text-secondary {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.profile-header .text-secondary i {
    font-size: 0.7rem;
    margin-left: 0.25rem;
}

/* Profile Stats - الإحصائيات */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.stat-box {
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: linear-gradient(to bottom, var(--bg-hover), var(--bg-surface));
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.stat-box:hover {
    background: white;
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.stat-box:hover::before {
    opacity: 1;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Navigation Tabs - التبويبات */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.nav-tabs::-webkit-scrollbar {
    height: 4px;
}

.nav-tabs::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.nav-link {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.nav-link:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

.nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: transparent;
}

.nav-link i {
    font-size: 0.75rem;
}

/* Action Buttons - أزرار الإجراءات */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.action-buttons .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    min-width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 600;
    border: 1px solid transparent;
}

/* تأثير الموجة عند الضغط */
.action-buttons .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.action-buttons .btn:active::before {
    width: 300px;
    height: 300px;
}

/* تحسينات خاصة لكل نوع زر */
.action-buttons .btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: transparent;
}

.action-buttons .btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px) scale(1.05);
}

.action-buttons .btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.action-buttons .btn-secondary {
    background: white;
    color: var(--text-secondary);
    border-color: var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.action-buttons .btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px) scale(1.05);
}

.action-buttons .btn-secondary:active {
    transform: translateY(0) scale(0.98);
}

.action-buttons .btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    border-color: transparent;
}

.action-buttons .btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, var(--success-color) 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px) scale(1.05);
}

.action-buttons .btn-success:active {
    transform: translateY(0) scale(0.98);
}

.action-buttons .btn-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #0891b2 100%);
    color: white;
    border-color: transparent;
}

.action-buttons .btn-info:hover {
    background: linear-gradient(135deg, #0891b2 0%, var(--info-color) 100%);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
    transform: translateY(-2px) scale(1.05);
}

.action-buttons .btn-info:active {
    transform: translateY(0) scale(0.98);
}

.action-buttons .btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    color: white;
    border-color: transparent;
}

.action-buttons .btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, var(--warning-color) 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    transform: translateY(-2px) scale(1.05);
}

.action-buttons .btn-warning:active {
    transform: translateY(0) scale(0.98);
}

.action-buttons .btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
    border-color: transparent;
}

.action-buttons .btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, var(--danger-color) 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px) scale(1.05);
}

.action-buttons .btn-danger:active {
    transform: translateY(0) scale(0.98);
}

/* تحسين الأيقونات داخل أزرار الإجراءات */
.action-buttons .btn i {
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.action-buttons .btn:hover i {
    transform: scale(1.15);
}

/* تأثير التوهج الخفيف */
.action-buttons .btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    opacity: 0;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.action-buttons .btn-primary:hover::after {
    opacity: 1;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.action-buttons .btn-success:hover::after {
    opacity: 1;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.action-buttons .btn-info:hover::after {
    opacity: 1;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
}

.action-buttons .btn-warning:hover::after {
    opacity: 1;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
}

.action-buttons .btn-danger:hover::after {
    opacity: 1;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

/* تحسين الأزرار عند التعطيل */
.action-buttons .btn:disabled,
.action-buttons .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    transform: none !important;
}

/* تحسين التباعد بين الأزرار في مجموعات */
.action-buttons .btn+.btn {
    margin-right: 0;
}

/* تأثير الإضاءة عند التركيز */
.action-buttons .btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.action-buttons .btn-primary:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3), 0 4px 12px rgba(59, 130, 246, 0.4);
}

.action-buttons .btn-success:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3), 0 4px 12px rgba(16, 185, 129, 0.4);
}

.action-buttons .btn-info:focus {
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.3), 0 4px 12px rgba(6, 182, 212, 0.4);
}

.action-buttons .btn-warning:focus {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3), 0 4px 12px rgba(245, 158, 11, 0.4);
}

.action-buttons .btn-danger:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3), 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* تحسين الأزرار في الجداول - تأثيرات إضافية */
.data-table .action-buttons {
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.data-table tr:hover .action-buttons {
    opacity: 1;
}

/* تحسين الأزرار الصغيرة جداً */
.action-buttons .btn.btn-icon-only {
    padding: 0.5rem;
    min-width: 36px;
    width: 36px;
    height: 36px;
}

.action-buttons .btn.btn-icon-only i {
    margin: 0;
}

/* Form Row - صفوف النماذج */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Button Outlines */
.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

/* Badge Improvements */
.badge {
    padding: 0.25rem 0.6rem;
    font-size: 0.7rem;
    border-radius: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    line-height: 1.2;
}

/* Modal Body */
.modal-body {
    padding: 1rem 1.25rem;
}

/* Page Container */
.page-container {
    width: 100%;
}

/* تحسينات إضافية للجداول في صفحة سجل العميل */
.customer-sales-table .data-table th {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
}

.customer-sales-table .data-table td {
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
}

.customer-sales-table .data-table td small {
    font-size: 0.7rem;
}

/* تحسينات إضافية للاستجابة */
@media (max-width: 991px) {
    .page-header {
        margin-bottom: 1rem;
    }

    .page-title {
        font-size: 1.1rem;
    }

    .card-header h2 {
        font-size: 0.9rem;
    }

    .btn {
        font-size: 0.75rem;
        padding: 0.45rem 0.85rem;
    }

    .btn-sm {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
}

/* تحسينات الموبايل لصفحة سجل العميل */
@media (max-width: 991px) {
    .profile-header {
        padding: 0.85rem 1rem;
    }

    .profile-header h1 {
        font-size: 1rem;
    }

    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
    }

    .stat-box {
        padding: 0.6rem 0.4rem;
    }

    .stat-value {
        font-size: 1rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .nav-link {
        padding: 0.5rem 0.85rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .action-buttons {
        justify-content: flex-start;
        width: 100%;
        gap: 0.4rem;
    }

    .action-buttons .btn {
        flex: 0 0 auto;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

@media (max-width: 576px) {
    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-value {
        font-size: 0.9rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .nav-link {
        padding: 0.45rem 0.7rem;
        font-size: 0.7rem;
    }

    .profile-header {
        padding: 0.75rem;
    }

    .profile-header h1 {
        font-size: 0.95rem;
    }

    .action-buttons .btn span {
        display: none !important;
    }

    .action-buttons .btn {
        padding: 0.4rem;
        min-width: 36px;
        height: 36px;
        font-size: 0.7rem;
    }

    .action-buttons .btn i {
        font-size: 0.8rem;
    }

    .action-buttons .btn:hover {
        transform: translateY(-1px) scale(1.03);
    }
}

/* ==========================================================================
   Pagination - تصميم محسّن لعرض النتائج وأزرار التنقل
   ========================================================================== */

.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    margin-top: 0;
}

/* معلومات النتائج - تحسين التصميم */
.pagination-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.5rem 0.85rem;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.pagination-info::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--info-color));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pagination-info:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-color: var(--primary-color);
}

.pagination-info:hover::before {
    opacity: 1;
}

.pagination-info i {
    flex-shrink: 0;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.pagination-info span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    line-height: 1.5;
}

.pagination-info strong {
    font-weight: 700;
    color: var(--primary-color);
    background: var(--primary-light);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    min-width: 24px;
    text-align: center;
    display: inline-block;
    box-shadow: 0 1px 2px rgba(59, 130, 246, 0.1);
}

.pagination-info strong:first-of-type {
    color: var(--success-color);
    background: #ecfdf5;
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.1);
}

.pagination-info strong:last-of-type {
    color: var(--info-color);
    background: #e0f2fe;
    box-shadow: 0 1px 2px rgba(6, 182, 212, 0.1);
}

/* أزرار التنقل */
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pagination-btn:hover:not(.disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--bg-hover);
}

.pagination-btn i {
    font-size: 0.75rem;
}

/* أرقام الصفحات */
.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.pagination-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pagination-number:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

.pagination-number.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
    font-weight: 700;
    transform: scale(1.05);
}

.pagination-number.active:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: scale(1.05) translateY(-1px);
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

/* تحسينات الموبايل */
@media (max-width: 991px) {
    .pagination-wrapper {
        flex-direction: column;
        align-items: stretch;
        padding: 0.85rem 1rem;
        gap: 0.75rem;
    }

    .pagination-info {
        width: 100%;
        justify-content: center;
        padding: 0.6rem 0.75rem;
        font-size: 0.75rem;
    }

    .pagination-info strong {
        font-size: 0.8rem;
        padding: 0.12rem 0.4rem;
        min-width: 20px;
    }

    .pagination-controls {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .pagination-btn {
        padding: 0.45rem 0.7rem;
        font-size: 0.75rem;
    }

    .pagination-number {
        min-width: 32px;
        height: 32px;
        font-size: 0.75rem;
        padding: 0 0.4rem;
    }

    .pagination-ellipsis {
        min-width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .pagination-wrapper {
        padding: 0.75rem;
        gap: 0.6rem;
    }

    .pagination-info {
        font-size: 0.7rem;
        padding: 0.5rem 0.6rem;
        flex-direction: column;
        text-align: center;
        gap: 0.3rem;
    }

    .pagination-info span {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination-info strong {
        font-size: 0.75rem;
        padding: 0.1rem 0.35rem;
    }

    .pagination-controls {
        gap: 0.3rem;
    }

    .pagination-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
        gap: 0.3rem;
    }

    .pagination-btn span {
        display: none;
    }

    .pagination-btn i {
        margin: 0;
    }

    .pagination-numbers {
        gap: 0.25rem;
    }

    .pagination-number {
        min-width: 28px;
        height: 28px;
        font-size: 0.7rem;
        padding: 0 0.3rem;
    }

    .pagination-ellipsis {
        min-width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
}

/* ==========================================================================
   System Name Field - تحسينات حقل اسم النظام في صفحة الإعدادات
   ========================================================================== */

/* تحسينات إضافية للشريط العلوي عند تغيير اسم النظام */
.sidebar-brand {
    transition: all 0.3s ease;
}

.sidebar-brand:hover {
    transform: translateX(-2px);
}

.sidebar-brand span {
    transition: color 0.3s ease;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* تأثيرات إضافية عند تحديث اسم النظام */
@keyframes nameUpdate {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.sidebar-brand.updated {
    animation: nameUpdate 0.5s ease;
}