/* Mada Finance - التصميم الاحترافي */
:root {
    /* palette adjustments requested by user */
    --primary-color: #3B82F6;     /* royal blue for buttons */
    --secondary-color: #60A5FA;   /* lighter blue for gradients/accents */
    --success-color: #4ADE80;     /* bright green for income/salary */
    --danger-color: #F87171;      /* red for debts/expenses */
    --warning-color: #f59e0b;
    --dark-color: #0F172A;        /* dark navy background */
    --light-color: #f3f4f6;
    --white: #ffffff;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #f3f4f6; /* reversed for dark theme */
    --shadow: 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);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', 'Cairo', sans-serif;
}

body {
    font-family: 'Tajawal', 'Cairo', sans-serif;
    background-color: var(--dark-color);   /* navy base */
    color: var(--gray-100);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ensure text inside form controls stays dark on white background */
input, select, textarea {
    color: #111827;
}

/* enforce black text on light card/table backgrounds */
.card, .form-card, .salary-form, .quick-add-card, .transactions-table th, .transactions-table td,
.modal-content, .debts-container .card {
    color: #000 !important;
}

/* specifically header row and summary labels */
.transactions-table th {
    color: #000 !important;
}

/* make placeholder text darker too */
input::placeholder {
    color: #6b7280;
}

/* التنبيهات */
.alert-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert {
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s ease;
    min-width: 300px;
    text-align: center;
}

.alert-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.alert-error {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
}

.alert-warning {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
}

.alert-info {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* الشريط العلوي */
.top-navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1001;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    gap: 15px;
}

/* زر فتح القائمة الجانبية - على اليسار */
.sidebar-toggle {
    order: -1;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: auto;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-toggle i {
    color: white;
    font-size: 18px;
    transition: transform 0.3s ease;
}

/* عند فتح القائمة، تدوير الأيقونة */
body.sidebar-open .sidebar-toggle i {
    transform: rotate(90deg);
}

.navbar-brand {
    order: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 22px;
    font-weight: 700;
}

.navbar-brand i {
    font-size: 28px;
}

.top-navbar .nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.top-navbar .nav-links li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.top-navbar .nav-links li a i {
    font-size: 16px;
}

.top-navbar .nav-links li:hover a,
.top-navbar .nav-links li.active a {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* المحتوى الرئيسي */
.main-content {
    margin-right: 0;
    margin-top: 70px;
    padding: 30px;
    min-height: calc(100vh - 70px);
}

.section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: #000; /* black as requested */
    margin-bottom: 30px;
    position: relative;
    padding-right: 15px;
}

.page-title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 30px;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
}

/* لوحة التحكم الجديدة - تصميم احترافي */
.dashboard-cards {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

@media (max-width: 900px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}

/* بطاقة الرصيد الرئيسية */
.main-balance-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 24px;
    padding: 30px;
    color: white;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.main-balance-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.balance-label {
    font-size: 16px;
    font-weight: 500;
    opacity: 0.9;
}

.balance-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.balance-amount {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.currency-small {
    font-size: 20px;
    opacity: 0.8;
}

.balance-stats {
    display: flex;
    gap: 30px;
    position: relative;
    z-index: 1;
}

.balance-stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.balance-stat .stat-label {
    font-size: 13px;
    opacity: 0.8;
}

.balance-stat .stat-value {
    font-size: 18px;
    font-weight: 600;
}

.balance-stat .stat-value.income {
    color: var(--success-color);
}

.balance-stat .stat-value.expense {
    color: var(--danger-color);
}

/* بطاقات الحسابات السريعة */
.accounts-quick-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.account-quick-card {
    border-radius: 24px;
    padding: 20px;
    color: white;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.account-quick-card.cash {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.account-quick-card.bank {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
}

.account-quick-card::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
}

.salary-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.salary-icon {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.salary-label {
    font-size: 15px;
    font-weight: 500;
    color: #000;
}

.salary-amount {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
    color: #fff;
}

.salary-due {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}


/* قسم الحركات الأخيرة */
.recent-section {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.recent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.recent-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recent-header h2 i {
    color: #667eea;
}

.view-all-btn {
    background: #f3f4f6;
    border: none;
    color: #6b7280;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-all-btn:hover {
    background: #667eea;
    color: white;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* البطاقات العامة */
.card {
    background: #1E293B;   /* dark blue cards */
    color: var(--gray-100);
    border-radius: 24px;        /* more rounded corners */
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3); /* softer shadow */
    margin-bottom: 25px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #000;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h3 i {
    color: var(--primary-color);
}

/* النماذج */
.form-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.form-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: #000; /* dark header on white card */
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* تنسيق نموذج الحركات - الصف الأول: نوع ومبلغ */
.transaction-form .form-row {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

/* الصف الأول: نوع الحركة + المبلغ - متوازي */
.transaction-form .single-row {
    grid-template-columns: 1fr 2fr;
}

/* الصف الثاني: الفئة + الحساب + التاريخ - متساوي */
.transaction-form .second-row {
    grid-template-columns: 2fr 1fr 1fr;
}

/* متوافقة مع الشاشات الصغيرة */
@media (max-width: 768px) {
    .transaction-form .form-row {
        grid-template-columns: 1fr;
    }
    
    .transaction-form .single-row,
    .transaction-form .second-row {
        grid-template-columns: 1fr;
    }
}

/* مجموعات الخانات */
.type-group,
.amount-group,
.category-group,
.account-group,
.date-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.type-group label,
.amount-group label,
.category-group label,
.account-group label,
.date-group label {
    font-size: 14px;
    font-weight: 500;
    color: #374151; /* charcoal grey for transaction-form labels */
}

/* تحسين خانة المبلغ */
.amount-group input {
    font-size: 18px;
    font-weight: 700;
    text-align: left;
    direction: ltr;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
}

.amount-group input:focus {
    border-color: var(--primary-color);
    background: white;
}

/* زر الحفظ */
.btn-save {
    width: 100%;
    max-width: 300px;
    margin-top: 10px;
    padding: 14px 24px;
    font-size: 16px;
}

/* الفلاتر - قابلة للطي */
.filters-card {
    margin-bottom: 25px;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 5px 0;
}

.filters-header h3 {
    margin-bottom: 0;
}

.filter-arrow {
    transition: transform 0.3s ease;
    color: var(--gray-500);
}

.filter-arrow.collapsed {
    transform: rotate(-90deg);
}

.filters-content {
    margin-top: 20px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 500px;
    opacity: 1;
}

.filters-content.hidden {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 15px;
    font-weight: 600;
    color: #1e3a8a; /* dark navy for clearer labels */
}

/* inputs should have dark color on white backgrounds */
.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Tajawal', 'Cairo', sans-serif;
    transition: var(--transition);
    background: var(--gray-100);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* الأزرار */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Tajawal', 'Cairo', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--gray-700), var(--gray-900));
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* فلاتر البحث */
.filters-card {
    margin-bottom: 25px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

.filter-group input,
.filter-group select {
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    background: var(--gray-100);
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* قائمة الحركات */
.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--gray-100);
    border-radius: 12px;
    transition: var(--transition);
}

.transaction-item:hover {
    background: var(--gray-200);
}

.transaction-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.transaction-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.transaction-icon.income {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.transaction-icon.expense {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

.transaction-details h4 {
    font-size: 15px;
    font-weight: 600;
    color: #000; /* ensure transaction titles are dark */
    margin-bottom: 4px;
}

.transaction-details p {
    font-size: 13px;
    color: #000; /* dark description text */
}

.transaction-amount {
    text-align: left;
}

.transaction-amount .amount {
    font-size: 16px;
    font-weight: 700;
}

.transaction-amount .amount.income {
    color: var(--success-color);
}

.transaction-amount .amount.expense {
    color: var(--danger-color);
}

.transaction-amount .date {
    font-size: 12px;
    color: var(--gray-500);
}

/* جدول الحركات */
.transactions-table-container {
    overflow-x: auto;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
}

.transactions-table th,
.transactions-table td {
    padding: 14px 16px;
    text-align: right;
    border-bottom: 1px solid var(--gray-200);
}

.transactions-table th {
    background: var(--gray-100);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
}

.transactions-table td {
    font-size: 14px;
    color: var(--gray-900);
}

.transactions-table .type-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.type-badge.income {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.type-badge.expense {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

.transactions-table .actions {
    display: flex;
    gap: 8px;
}

.transactions-table .btn-icon {
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon.delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.btn-icon.delete:hover {
    background: var(--danger-color);
    color: white;
}

/* قسم الراتب - تصميم محسن */
.salary-container {
    display: grid;
    /* form card should be wider than history card for clarity */
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
}

/* visual highlight when salary added */
.salary-history-card.highlight {
    animation: pulse-highlight 1.5s ease-out;
}

@keyframes pulse-highlight {
    0% { box-shadow: 0 0 0 0 rgba(37,99,235,0.5); }
    50% { box-shadow: 0 0 10px 10px rgba(37,99,235,0); }
    100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); }
}

/* make cards stack on mobile but keep history below form */
@media (max-width: 900px) {
    .salary-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1200px) {
    .salary-container {
        grid-template-columns: 1fr 1fr;
    }
    
    .salary-history-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .salary-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* بطاقات الراتب الجديدة */
.salary-setup-card,
.salary-info-card,
.salary-history-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.salary-setup-card:hover,
.salary-info-card:hover,
.salary-history-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* رأس البطاقة المخصص */
.card-header-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.card-header-custom h3 {
    font-size: 16px;
    font-weight: 700;
    color: #000;
    margin: 0;
    flex: 1;
}

.header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.header-icon.setup {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.header-icon.info {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.header-icon.history {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

/* نموذج إعداد الراتب */
.salary-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.salary-form .form-group {
    margin-bottom: 0;
}

.salary-form label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #000; /* make salary form label black for clarity */
    margin-bottom: 8px;
}

.salary-form label i {
    font-size: 14px;
    color: var(--primary-color);
}

.salary-form input,
.salary-form select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Tajawal', sans-serif;
    transition: all 0.3s ease;
    background: #f9fafb;
    color: #111827; /* dark text inside inputs */
}

.salary-form input:focus,
.salary-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.switch-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.switch-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-save-salary {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    margin-top: 10px;
}

/* بطاقة معلومات الراتب */
.salary-current-info {
    text-align: center;
    padding: 25px 15px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 16px;
    color: white;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.salary-current-info::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
}

.salary-amount-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
    position: relative;
    z-index: 1;
}

.salary-amount-display .currency {
    font-size: 24px;
    font-weight: 500;
    opacity: 0.9;
}

.salary-amount-display .amount {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -1px;
}

.salary-label-text {
    display: block;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

/* تفاصيل الراتب */
.salary-details-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f9fafb;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.detail-row:hover {
    background: #f3f4f6;
}

.detail-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 500;
}

.detail-label i {
    font-size: 14px;
    color: var(--primary-color);
}

.detail-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
}

.detail-value.status {
    color: var(--success-color);
}

.btn-add-salary {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* بطاقة سجل الرواتب */
.history-count {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-right: auto;
}

.salary-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding-left: 5px;
    padding-right: 5px;
}

/* Custom scrollbar for salary history */
.salary-history-list::-webkit-scrollbar {
    width: 6px;
}

.salary-history-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.salary-history-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.salary-history-list::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* عناصر سجل الرواتب */
.salary-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.salary-history-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #10b981, #059669);
}

.salary-history-item:hover {
    background: white;
    border-color: #10b981;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.15);
    transform: translateX(3px);
}

/* حالة الراتب معلق */
.salary-history-item.pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
}

.salary-history-item.pending::before {
    background: linear-gradient(180deg, #f59e0b, #d97706);
}

.salary-history-item.pending:hover {
    border-color: #f59e0b;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.15);
}

/* حالة الراتب مرصود */
.salary-history-item.credited {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #10b981;
}

.salary-history-item.credited::before {
    background: linear-gradient(180deg, #10b981, #059669);
}

.salary-history-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.salary-history-info .company-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}

.salary-history-info .company-name i {
    color: #667eea;
    font-size: 14px;
}

.salary-history-info .date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
}

.salary-history-info .date i {
    color: #9ca3af;
    font-size: 12px;
}

.salary-history-info .due-date {
    display: flex;
    align-items: center;
    gap: 6px;
}
    font-size: 12px;
    color: #6b7280;
}

.salary-history-info .due-date i {
    font-size: 11px;
    color: #f59e0b;
}

/* شارة حالة الراتب */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
}

.status-badge.pending {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.status-badge.credited {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
}

.salary-history-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.salary-history-actions .amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--success-color);
    white-space: nowrap;
}

.btn-delete-salary {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.btn-delete-salary:hover {
    background: var(--danger-color);
    color: white;
    transform: scale(1.1);
}

/* رأس السجل */
.salary-history-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}

.salary-history-header .btn-danger {
    padding: 8px 14px;
    font-size: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Empty state محسن */
.salary-history-list .empty-state {
    padding: 40px 20px;
    text-align: center;
}

.salary-history-list .empty-state i {
    font-size: 50px;
    color: #d1d5db;
    margin-bottom: 15px;
}

.salary-history-list .empty-state p {
    font-size: 14px;
    color: #9ca3af;
}

/* تصميم متجاوب للموبايل */
@media (max-width: 768px) {
    .salary-setup-card,
    .salary-info-card,
    .salary-history-card {
        padding: 18px;
        border-radius: 16px;
    }
    
    .card-header-custom {
        margin-bottom: 15px;
        padding-bottom: 12px;
    }
    
    .header-icon {
        width: 38px;
        height: 38px;
        font-size: 16px;
        border-radius: 10px;
    }
    
    .card-header-custom h3 {
        font-size: 14px;
    }
    
    .salary-current-info {
        padding: 20px 12px;
        border-radius: 14px;
    }
    
    .salary-amount-display .amount {
        font-size: 36px;
    }
    
    .salary-amount-display .currency {
        font-size: 20px;
    }
    
    .salary-label-text {
        font-size: 13px;
    }
    
    .detail-row {
        padding: 10px 12px;
    }
    
    .detail-label {
        font-size: 12px;
    }
    
    .detail-value {
        font-size: 13px;
    }
    
    .salary-history-item {
        padding: 14px;
        border-radius: 12px;
    }
    
    .salary-history-info .date {
        font-size: 13px;
    }
    
    .salary-history-info .due-date {
        font-size: 11px;
    }
    
    .salary-history-actions .amount {
        font-size: 16px;
    }
    
    .history-count {
        font-size: 11px;
        padding: 3px 10px;
    }
}

/* الديون */
/* بطاقات الملخص */
.debts-summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

/* collapse summary cards on small screens */
@media (max-width: 768px) {
    .debts-summary-cards {
        grid-template-columns: 1fr;
    }
}

.summary-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.summary-card.owed-to-me-card::before {
    background: linear-gradient(180deg, var(--success-color), #059669);
}

.summary-card.i-owe-card::before {
    background: linear-gradient(180deg, var(--danger-color), #dc2626);
}

.summary-card.net-card::before {
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.summary-icon {
    width: 55px;
    height: 55px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.owed-to-me-card .summary-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.i-owe-card .summary-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

.net-card .summary-icon {
    background: rgba(37, 99, 235, 0.15);
    color: var(--primary-color);
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.summary-label {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

.summary-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
}

.owed-to-me-card .summary-value {
    color: var(--success-color);
}

.i-owe-card .summary-value {
    color: var(--danger-color);
}

.net-card .summary-value {
    color: var(--primary-color);
}

/* نموذج الإضافة السريع */
.quick-add-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border: 2px solid var(--gray-200);
    transition: all 0.3s ease;
}

.quick-add-card:hover {
    border-color: var(--primary-color);
}

.quick-add-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quick-add-card h3 {
    color: #000; /* ensure title is black */
}

.quick-add-card h3 i {
    color: var(--primary-color);
}

.quick-debt-form {
    width: 100%;
}

.quick-form-row {
    display: grid;
    grid-template-columns: 1fr 2fr 2fr 1fr 2fr auto;
    gap: 15px;
    align-items: flex-end;
}

@media (max-width: 768px) {
    .quick-form-row {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    .quick-form-row .btn-quick-add {
        width: 100%;
    }
}

.quick-form-row .form-group {
    margin-bottom: 0;
}

.quick-form-row .btn-quick-add {
    height: 48px;
    padding: 0 25px;
    white-space: nowrap;
}

.debts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

/* في الشاشات الصغيرة: عمود واحد */
@media (max-width: 768px) {
    .debts-container {
        grid-template-columns: 1fr;
    }
    .debt-actions {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        flex-wrap: wrap;
    }
}

/* عكس ترتيب البطاقات: لي على اليمين، علي على اليسار */
.debts-container {
    direction: ltr;
}

.debts-container .debts-card {
    direction: rtl;
}

.debts-container .i-owe {
    order: 1; /* علي على اليسار */
}

.debts-container .owed-to-me {
    order: 2; /* لي على اليمين */
}

.debts-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.debts-card .card-header h3 {
    margin-bottom: 0;
}

.debts-card.owed-to-me {
    border-top: 4px solid var(--success-color);
}

.debts-card.i-owe {
    border-top: 4px solid var(--danger-color);
}

.debts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.debt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--gray-100);
    border-radius: 12px;
    transition: var(--transition);
    flex-wrap: wrap;
    gap: 10px;
}

.debt-item:hover {
    background: var(--gray-200);
}

.debt-info h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.debt-info h4 i {
    font-size: 18px;
    color: var(--gray-600);
}

.debt-info p {
    font-size: 13px;
    color: var(--gray-500);
}

.debt-amount {
    text-align: left;
    min-width: 110px;
}

/* color amounts per card type */
.debts-card.owed-to-me .debt-item .amount {
    color: var(--success-color);
}
.debts-card.i-owe .debt-item .amount {
    color: var(--danger-color);
}

/* buttons */
.btn,
.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
}
.btn:hover,
.btn-primary:hover,
.btn:focus,
.btn-primary:focus {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    color: #fff !important;
}

.debt-amount .amount {
    font-size: 16px;
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}

.debt-amount .date {
    font-size: 12px;
    color: var(--gray-500);
}

.debt-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.debts-summary {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    background: var(--gray-900);
    color: white;
    border-radius: 12px;
    margin-top: 20px;
    font-weight: 600;
}

.debts-summary .total {
    color: var(--warning-color);
    font-size: 18px;
}

/* التقارير - تصميم محسن ومدمج */
.reports-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.reports-container .card {
    padding: 15px;
    margin-bottom: 0;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
}

.reports-container h3 {
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #4b5563;
}

.reports-container h3 i {
    font-size: 14px;
    color: #667eea;
}

/* الإحصائيات الشهرية - مكبرة */
.stats-monthly {
    padding: 20px;
}

.stats-monthly h3 {
    font-size: 15px;
    margin-bottom: 15px;
}

.monthly-stats .month-select {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.monthly-stats .month-select label {
    font-size: 13px;
    margin-bottom: 0;
    white-space: nowrap;
    color: #6b7280;
}

.monthly-stats .month-select input {
    padding: 10px 12px;
    font-size: 14px;
    min-height: auto;
    border-radius: 8px;
    height: 40px;
    width: 100%;
}

.stats-grid {
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.stat-box {
    flex: 1;
    padding: 15px 10px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    min-width: 0;
}

.stat-box i {
    font-size: 20px;
    margin-bottom: 0;
}

.stat-box .label {
    font-size: 12px;
    margin-bottom: 0;
    font-weight: 500;
}

.stat-box .value {
    font-size: 18px;
    font-weight: 700;
}

/* ألوان صناديق الإحصائيات */
.stat-box.income {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success-color);
}

.stat-box.expense {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger-color);
}

.stat-box.balance {
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
}

/* رسم المقارنة */
.comparison-card {
    min-height: auto;
}

.comparison-card .chart-container {
    height: 200px;
}

/* مصروفات الشهر - رسم دائري */
.expenses-chart-card {
    min-height: auto;
}

.expenses-chart-card .chart-container {
    height: 200px;
}

/* شاشات الجوال */
@media (max-width: 768px) {
    .reports-container {
        gap: 15px;
    }
    
    .reports-container .card {
        padding: 15px;
    }
    
    .reports-container h3 {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .chart-container {
        height: 200px;
    }
    
    .stats-monthly {
        padding: 12px 15px;
    }
    
    .monthly-stats .month-select {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .monthly-stats .month-select label {
        font-size: 12px;
    }
    
    .monthly-stats .month-select input {
        width: 100%;
    }
    
    .stats-grid {
        flex-direction: column;
        gap: 10px;
    }
    
    .stat-box {
        flex-direction: row;
        justify-content: space-between;
        padding: 10px 12px;
    }
    
    .stat-box i {
        font-size: 16px;
        margin-bottom: 0;
        margin-left: 10px;
    }
    
    .stat-box .label {
        font-size: 12px;
        flex: 1;
        text-align: right;
    }
    
    .stat-box .value {
        font-size: 15px;
    }
    
    .comparison-card .chart-container {
        height: 180px;
    }
}

/* النافذة المنبثقة */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex !important;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.close {
    position: absolute;
    left: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--gray-500);
    cursor: pointer;
    transition: var(--transition);
}

.close:hover {
    color: var(--danger-color);
}

.modal-content h3 {
    margin-bottom: 25px;
    font-size: 20px;
    color: #000;
}

.modal-content .form-group {
    margin-bottom: 18px;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
}

/* Recent Transactions */
.recent-transactions {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.recent-transactions h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--gray-900);
}

/*_empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    color: var(--gray-300);
}

.empty-state p {
    font-size: 15px;
}

/* Responsive - شاشات الجوال والأجهزة الصغيرة */
@media (max-width: 768px) {
    /* الشريط العلوي */
    .top-navbar {
        padding: 0 10px;
        height: 60px;
        gap: 6px;
    }
    
    .sidebar-toggle {
        width: 38px;
        height: 38px;
        flex-shrink: 0;
    }
    
    .navbar-brand {
        font-size: 16px;
        gap: 6px;
    }
    
    .navbar-brand i {
        font-size: 20px;
    }
    
    .navbar-brand span {
        display: none;
    }
    
    .top-navbar .nav-links {
        display: none;
    }
    
    /* المحتوى الرئيسي */
    .main-content {
        margin-right: 0;
        padding: 12px;
        margin-top: 60px;
        padding-bottom: 85px; /* مساحة للقائمة السفلية */
    }
    
    /* لوحة التحكم */
    .dashboard-cards {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .main-balance-card {
        padding: 18px;
        border-radius: 18px;
    }
    
    .balance-header {
        margin-bottom: 12px;
    }
    
    .balance-label {
        font-size: 14px;
    }
    
    .balance-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
        border-radius: 10px;
    }
    
    .balance-amount {
        font-size: 30px;
        margin-bottom: 18px;
    }
    
    .currency-small {
        font-size: 16px;
    }
    
    .balance-stats {
        gap: 20px;
        flex-wrap: wrap;
    }
    
    .balance-stat .stat-label {
        font-size: 12px;
    }
    
    .balance-stat .stat-value {
        font-size: 15px;
    }
    
    /* بطاقات الحسابات السريعة */
    .accounts-quick-cards {
        gap: 10px;
    }
    
    .account-quick-card {
        padding: 14px;
        border-radius: 16px;
    }
    
    .salary-header {
        margin-bottom: 12px;
    }
    
    .salary-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .salary-label {
        font-size: 13px;
    }
    
    .salary-amount {
        font-size: 22px;
    }
    
    /* القسم الأخير */
    .recent-section {
        padding: 14px;
        border-radius: 14px;
    }
    
    .recent-header {
        margin-bottom: 14px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .recent-header h2 {
        font-size: 15px;
    }
    
    .recent-header h2 i {
        font-size: 14px;
    }
    
    .view-all-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* العناوين */
    .page-title {
        font-size: 20px;
        margin-bottom: 18px;
        padding-right: 12px;
    }
    
    .page-title::before {
        height: 24px;
    }
    
    /* البطاقات */
    .card {
        padding: 14px;
        border-radius: 14px;
        margin-bottom: 18px;
    }
    
    .card h3 {
        font-size: 15px;
        margin-bottom: 14px;
    }
    
    .card h3 i {
        font-size: 14px;
    }
    
    /* النماذج */
    .form-card {
        padding: 14px;
        border-radius: 14px;
    }
    
    .form-card h3 {
        font-size: 16px;
        margin-bottom: 16px;
    }
    
    .transaction-form .form-row {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 14px;
    }
    
    .form-group {
        width: 100%;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 4px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 14px;
        font-size: 15px;
        width: 100%;
        min-height: 48px;
    }
    
    .form-group textarea {
        min-height: 100px;
    }
    
    /* الأزرار */
    .btn {
        padding: 14px 20px;
        font-size: 15px;
        min-height: 48px;
        width: 100%;
        justify-content: center;
    }
    
    .btn-sm {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 40px;
    }
    
    /* الفلاتر */
    .filters-card {
        margin-bottom: 18px;
    }
    
    .filters {
        flex-direction: column;
        gap: 12px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group label {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .filter-group input,
    .filter-group select {
        width: 100%;
        padding: 12px;
        min-height: 48px;
        font-size: 14px;
    }
    
    .filters .btn {
        width: 100%;
        margin-top: 8px;
    }
    
    /* الحركات - جدول */
    .transactions-list-card {
        overflow: hidden;
    }
    
    .transactions-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -14px;
        padding: 0 14px;
    }
    
    .transactions-table {
        font-size: 12px;
        min-width: 600px; /* لضمان scroll أفقي */
    }
    
    .transactions-table th,
    .transactions-table td {
        padding: 10px 8px;
        white-space: nowrap;
    }
    
    .transactions-table th:first-child,
    .transactions-table td:first-child {
        padding-left: 20px;
    }
    
    .transactions-table th:last-child,
    .transactions-table td:last-child {
        padding-right: 20px;
    }
    
    .type-badge {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .transactions-table .actions {
        gap: 4px;
    }
    
    .btn-icon {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    /* عناصر الحركة في القائمة */
    .transaction-item {
        padding: 12px;
        border-radius: 10px;
    }
    
    .transaction-info {
        gap: 10px;
    }
    
    .transaction-icon {
        width: 38px;
        height: 38px;
        font-size: 14px;
        border-radius: 8px;
    }
    
    .transaction-details h4 {
        font-size: 14px;
        margin-bottom: 2px;
    }
    
    .transaction-details p {
        font-size: 11px;
    }
    
    .transaction-amount .amount {
        font-size: 14px;
    }
    
    .transaction-amount .date {
        font-size: 10px;
    }
    
    /* الديون */
    .debts-container {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    
    .debts-card {
        border-radius: 14px;
    }
    
    .debt-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
    }
    
    .debt-info h4 {
        font-size: 14px;
    }
    
    .debt-info p {
        font-size: 12px;
    }
    
    .debt-amount {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .debt-amount .amount {
        font-size: 16px;
    }
    
    .debt-actions {
        width: 100%;
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .debt-actions .btn {
        flex: 1;
        min-width: 70px;
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .debts-summary {
        padding: 14px;
        border-radius: 10px;
        margin-top: 14px;
    }
    
    .debts-summary span:first-child {
        font-size: 13px;
    }
    
    .debts-summary .total {
        font-size: 16px;
    }
    
    /* الراتب */
    .salary-container {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    
    .salary-setup .form-group {
        margin-bottom: 14px;
    }
    
    .switch {
        width: 46px;
        height: 24px;
    }
    
    .slider:before {
        height: 16px;
        width: 16px;
    }
    
    input:checked + .slider:before {
        transform: translateX(22px);
    }
    
    .switch-label {
        font-size: 13px;
    }
    
    .salary-details .detail-item {
        padding: 10px 0;
    }
    
    .detail-item .label {
        font-size: 13px;
    }
    
    .detail-item .value {
        font-size: 14px;
    }
    
    /* التقارير */
    .reports-container {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    
    .chart-card {
        min-height: 280px;
    }
    
    .chart-container {
        height: 220px;
    }
    
    .monthly-stats .month-select {
        margin-bottom: 18px;
    }
    
    .monthly-stats .month-select label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .monthly-stats .month-select input {
        width: 100%;
        padding: 12px;
        min-height: 48px;
        font-size: 14px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-box {
        padding: 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .stat-box i {
        font-size: 20px;
        margin-bottom: 0;
        margin-left: 12px;
    }
    
    .stat-box .label {
        font-size: 13px;
        margin-bottom: 0;
        flex: 1;
    }
    
    .stat-box .value {
        font-size: 18px;
    }
    
    /* النوافذ المنبثقة */
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        margin: 5% auto;
        padding: 16px;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 14px;
    }
    
    .modal-content h3 {
        font-size: 18px;
        margin-bottom: 16px;
        padding-left: 30px;
        color: #000;
    }
    
    .close {
        left: 12px;
        top: 12px;
        font-size: 24px;
    }
    
    .modal-content .form-group {
        margin-bottom: 14px;
    }
    
    .modal-content input,
    .modal-content select,
    .modal-content textarea {
        width: 100%;
        padding: 12px;
        font-size: 15px;
        min-height: 48px;
    }
    
    .modal-content textarea {
        min-height: 80px;
    }
    
    .modal-content .btn {
        width: 100%;
        margin-top: 10px;
    }
    
    /* القائمة الجانبية */
    .sidebar {
        width: 100%;
        max-width: 300px;
        height: calc(100vh - 60px);
        top: 60px;
        border-radius: 0;
    }
    
    .sidebar-header {
        padding: 14px;
    }
    
    .sidebar-header h3 {
        font-size: 15px;
    }
    
    .wallets-list {
        padding: 10px;
    }
    
    .wallet-item {
        padding: 12px;
        border-radius: 10px;
        margin-bottom: 8px;
    }
    
    .wallet-icon {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
    
    .wallet-name {
        font-size: 13px;
    }
    
    .wallet-balance {
        font-size: 11px;
    }
    
    /* القائمة السفلية */
    .mobile-nav {
        display: flex;
        height: 65px;
        padding: 6px 4px;
        gap: 2px;
    }
    
    .mobile-nav-item {
        flex: 1;
        padding: 6px 4px;
        font-size: 10px;
        border-radius: 8px;
    }
    
    .mobile-nav-item i {
        font-size: 18px;
    }
    
    .mobile-nav-item span {
        font-size: 9px;
    }
    
    body {
        padding-bottom: 70px;
    }
    
    /* Alert container */
    .alert-container {
        top: 10px;
        left: 10px;
        right: 10px;
        transform: none;
    }
    
    .alert {
        min-width: auto;
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* شاشات صغيرة جداً */
@media (max-width: 480px) {
    .top-navbar {
        padding: 0 8px;
        height: 56px;
    }
    
    .sidebar-toggle {
        width: 34px;
        height: 34px;
    }
    
    .sidebar-toggle i {
        font-size: 16px;
    }
    
    .navbar-brand {
        font-size: 14px;
    }
    
    .navbar-brand i {
        font-size: 18px;
    }
    
    .main-content {
        margin-top: 56px;
        padding: 10px;
        padding-bottom: 75px;
    }
    
    .balance-amount {
        font-size: 26px;
    }
    
    .balance-stats {
        gap: 15px;
    }
    
    .balance-stat .stat-label {
        font-size: 11px;
    }
    
    .balance-stat .stat-value {
        font-size: 14px;
    }
    
    .salary-amount {
        font-size: 20px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .card {
        padding: 12px;
    }
    
    .card h3 {
        font-size: 14px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }
    
    /* الجدول */
    .transactions-table {
        font-size: 11px;
        min-width: 500px;
    }
    
    .transactions-table th,
    .transactions-table td {
        padding: 8px 6px;
    }
    
    /* الديون */
    .debt-actions {
        flex-direction: column;
    }
    
    .debt-actions .btn {
        width: 100%;
    }
    
    /* التقارير */
    .stat-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .stat-box i {
        margin-left: 0;
        margin-bottom: 4px;
    }
    
    /* القائمة الجانبية */
    .sidebar {
        top: 56px;
        height: calc(100vh - 56px);
    }
    
    /* القائمة السفلية */
    .mobile-nav {
        height: 60px;
    }
    
    .mobile-nav-item i {
        font-size: 16px;
    }
    
    .mobile-nav-item span {
        font-size: 8px;
    }
    
    /* النوافذ المنبثقة */
    .modal-content {
        padding: 14px;
        border-radius: 12px;
    }
    
    .modal-content h3 {
        font-size: 16px;
        color: #000;
    }
    
    /* Alert */
    .alert {
        font-size: 12px;
        padding: 10px 14px;
    }
}

/* شاشات بين 481px و 768px */
@media (min-width: 481px) and (max-width: 768px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .accounts-quick-cards {
        grid-template-columns: 1fr 1fr;
    }
    
    .debts-container {
        grid-template-columns: 1fr;
    }
    
    .reports-container {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* شاشات التابلت */
@media (min-width: 769px) and (max-width: 1024px) {
    .dashboard-cards {
        grid-template-columns: 1fr 1fr;
    }
    
    .accounts-quick-cards {
        grid-template-columns: 1fr;
    }
    
    .debts-container {
        grid-template-columns: 1fr;
    }
    
    .reports-container {
        grid-template-columns: 1fr 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* تحسينات إضافية للجوال */

/* منع النص الطويل من تجاوز حدود الحاوية */
* {
    max-width: 100vw;
    word-wrap: break-word;
}

/* تحسين النصوص الطويلة */
h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* تحسين الجداول على الجوال */
@media (max-width: 768px) {
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* تأثير الـ scroll للجدول */
    .transactions-table-container::-webkit-scrollbar {
        height: 6px;
    }
    
    .transactions-table-container::-webkit-scrollbar-track {
        background: var(--gray-100);
        border-radius: 3px;
    }
    
    .transactions-table-container::-webkit-scrollbar-thumb {
        background: var(--gray-300);
        border-radius: 3px;
    }
    
    .transactions-table-container::-webkit-scrollbar-thumb:hover {
        background: var(--gray-500);
    }
}

/* تحسين عرض النماذج على الجوال */
@media (max-width: 768px) {
    .form-card form {
        display: flex;
        flex-direction: column;
    }
    
    .form-row {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }
    
    .form-group.full-width {
        width: 100%;
    }
}

/* تحسين عرض الفلاتر */
@media (max-width: 768px) {
    .filters-card {
        padding: 14px;
    }
    
    .filters-card h3 {
        margin-bottom: 14px;
    }
}

/* تحسين عرض الديون على الجوال */
@media (max-width: 768px) {
    .debts-card .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .debts-card .card-header .btn {
        width: 100%;
    }
    
    .debts-list {
        max-height: 300px;
    }
}

/* تحسين عرض الراتب على الجوال */
@media (max-width: 768px) {
    .salary-form .form-group {
        width: 100%;
    }
    
    .salary-details {
        gap: 10px;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* تحسين عرض التقارير */
@media (max-width: 768px) {
    .chart-card canvas {
        max-height: 200px;
    }
    
    .monthly-stats {
        padding: 0;
    }
}

/* تحسين عرض النوافذ المنبثقة على الجوال */
@media (max-width: 768px) {
    .modal {
        align-items: flex-start;
        padding-top: 10px;
    }
    
    .modal-content {
        margin-top: 20px;
    }
    
    /* تأثير الـ scroll للنافذة */
    .modal-content {
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .modal-content::-webkit-scrollbar {
        width: 4px;
    }
    
    .modal-content::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .modal-content::-webkit-scrollbar-thumb {
        background: var(--gray-300);
        border-radius: 2px;
    }
}

/* تحسين القائمة السفلية */
@media (max-width: 768px) {
    .mobile-nav {
        backdrop-filter: blur(10px);
        background: rgba(255, 255, 255, 0.95);
    }
    
    /* تأثير الضغط */
    .mobile-nav-item:active {
        background: rgba(37, 99, 235, 0.15);
    }
    
    /* أيقونة الإضافة أكبر قليلاً */
    .mobile-nav-item[data-section="add"] i {
        font-size: 22px;
        color: var(--primary-color);
    }
}

/* تحسين القائمة الجانبية */
@media (max-width: 768px) {
    .sidebar {
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    }
    
    body.sidebar-open .sidebar {
        right: 0;
    }
    
    /* إغلاق القائمة عند النقر خارجها */
    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }
}

/* للشاشات الكبيرة (أكبر من 768px) - إظهار القائمة عند فتحها */
@media (min-width: 769px) {
    body.sidebar-open .sidebar {
        right: 0;
    }
}

/* تحسين عرض البطاقات الرئيسية */
@media (max-width: 768px) {
    .main-balance-card,
    .account-quick-card {
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }
}

/* تحسين عرض empty state */
@media (max-width: 768px) {
    .empty-state {
        padding: 30px 20px;
    }
    
    .empty-state i {
        font-size: 40px;
    }
    
    .empty-state p {
        font-size: 14px;
    }
}

/* تحسين عرض الأزرار في القوائم */
@media (max-width: 768px) {
    .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .btn-group .btn {
        flex: 1;
        min-width: 80px;
    }
}

/* تحسين_selects على الجوال */
@media (max-width: 768px) {
    select {
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        padding-right: 35px;
    }
}

/* تحسين_dates على الجوال */
@media (max-width: 768px) {
    input[type="date"],
    input[type="month"] {
        min-height: 48px;
        padding: 12px;
    }
}

/* تحسين_numbers على الجوال */
@media (max-width: 768px) {
    input[type="number"] {
        min-height: 48px;
        padding: 12px;
    }
    
    /* منع التكبير على iOS */
    input[type="number"]:focus,
    input[type="date"]:focus,
    input[type="month"]:focus,
    select:focus,
    textarea:focus {
        font-size: 16px; /* يمنع التكبير التلقائي على iOS */
    }
}

/* تحسين scroll العام */
@media (max-width: 768px) {
    html {
        scroll-behavior: smooth;
    }
    
    body {
        overflow-x: hidden;
    }
    
    ::-webkit-scrollbar {
        width: 5px;
        height: 5px;
    }
    
    ::-webkit-scrollbar-track {
        background: var(--gray-100);
    }
    
    ::-webkit-scrollbar-thumb {
        background: var(--gray-300);
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: var(--gray-500);
    }
}

/* تحسين الأيقونات على الجوال */
@media (max-width: 768px) {
    .balance-icon,
    .salary-icon,
    .wallet-icon,
    .transaction-icon {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* تحسين النصوص والأرقام */
@media (max-width: 768px) {
    .currency-small {
        font-size: 14px;
    }
    
    .balance-amount {
        letter-spacing: -0.5px;
    }
    
    .stat-value {
        font-weight: 600;
    }
}

/* القائمة الجانبية */
.sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 18px;
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #000;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-header .btn-logout {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-header .btn-logout:hover {
    background: #ef4444;
    color: white;
}

/* قسم إضافة محفظة فرعية - قابل للطي */
.add-sub-wallet-section {
    padding: 0;
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.add-sub-wallet-section .collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.add-sub-wallet-section .collapsible-header:hover {
    background: rgba(102, 126, 234, 0.05);
}

.add-sub-wallet-section .collapsible-header h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-sub-wallet-section .toggle-arrow {
    font-size: 12px;
    color: var(--gray-500);
    transition: transform 0.3s ease;
    transform: rotate(0deg);
}

.add-sub-wallet-section .collapsible-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    padding: 0 15px 15px 15px;
}

/* حالة مفتوح */
.add-sub-wallet-section:not(.collapsed) .collapsible-content {
    max-height: 500px;
    opacity: 1;
}

.add-sub-wallet-section:not(.collapsed) .toggle-arrow {
    transform: rotate(180deg);
}

.sub-wallet-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sub-wallet-input input,
.sub-wallet-select select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Tajawal', sans-serif;
    background: white;
    transition: all 0.3s ease;
}

.sub-wallet-input input:focus,
.sub-wallet-select select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.sub-wallet-form .btn {
    padding: 10px 15px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

@media (max-width: 768px) {
    .add-sub-wallet-section {
        padding: 12px;
    }
    
    .add-sub-wallet-section h4 {
        font-size: 12px;
    }
    
    .sub-wallet-input input,
    .sub-wallet-select select {
        padding: 8px 10px;
        font-size: 12px;
    }
}

.sidebar-header h3 i {
    color: var(--primary-color);
}

.wallets-list {
    padding: 15px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 300px);
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid var(--gray-200);
}

.logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Tajawal', sans-serif;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.logout-btn i {
    font-size: 16px;
}

.wallet-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--gray-100);
}

.wallet-item:hover {
    background: var(--gray-200);
}

.wallet-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.wallet-item.active .wallet-balance {
    color: rgba(255, 255, 255, 0.9);
}

.wallet-item.active .wallet-count {
    color: rgba(255, 255, 255, 0.8);
}

.wallet-item.active .ie-item {
    background: rgba(255, 255, 255, 0.15);
}

.wallet-item.active .ie-item.income {
    color: #a7f3d0;
}

.wallet-item.active .ie-item.expense {
    color: #fecaca;
}

.wallet-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.wallet-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.wallet-item.active .wallet-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.wallet-details {
    flex: 1;
    min-width: 0;
}

.wallet-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wallet-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.wallet-balance {
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 600;
}

.wallet-count {
    font-size: 11px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 4px;
}

.wallet-count i {
    font-size: 10px;
}

.wallet-income-expense {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.ie-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background: var(--gray-200);
}

.ie-item.income {
    color: var(--success-color);
}

.ie-item.expense {
    color: var(--danger-color);
}

.ie-item i {
    font-size: 10px;
}

.wallet-actions {
    display: flex;
    gap: 5px;
}

.wallet-delete-btn {
    padding: 5px 8px;
    border-radius: 6px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.wallet-delete-btn:hover {
    background: var(--danger-color);
    color: white;
}

/* تعديل الهامش عند وجود الشريط الجانبي */
body.has-sidebar .main-content {
    margin-right: 280px;
}

body.has-sidebar .top-navbar {
    right: 280px;
    width: calc(100% - 280px);
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 50vh;
        top: 70px;
    }
    
    body.has-sidebar .main-content,
    body.has-sidebar .top-navbar {
        margin-right: 0;
        right: 0;
        width: 100%;
    }
}

/* القائمة السفلية للجوال */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 8px 5px;
    justify-content: space-around;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--gray-500);
    font-size: 11px;
    gap: 4px;
    padding: 5px 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mobile-nav-item i {
    font-size: 20px;
}

.mobile-nav-item.active {
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
}

.mobile-nav-item:active {
    transform: scale(0.95);
}

/* إظهار القائمة السفلية على الجوال فقط */
@media (max-width: 768px) {
    .mobile-nav {
        display: flex;
    }
    
    body {
        padding-bottom: 70px;
    }
}



/* ��� �������� ������ */
.smart-features-section {
    margin-top: 30px;
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.features-header {
    margin-bottom: 25px;
}

.features-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 12px;
}

.features-header h2 i {
    color: #667eea;
    font-size: 22px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.feature-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #764ba2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    width: 55px;
    height: 55px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    position: relative;
}

.feature-icon i:first-child {
    position: relative;
    z-index: 1;
}

.feature-icon i:last-child {
    position: absolute;
    font-size: 14px;
    bottom: 6px;
    right: 6px;
    z-index: 2;
}

.salary-feature .feature-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.salary-feature:hover {
    border-color: #f59e0b;
}

.debt-feature .feature-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.debt-feature:hover {
    border-color: #8b5cf6;
}

.analytics-feature .feature-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.analytics-feature:hover {
    border-color: #10b981;
}

.security-feature .feature-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.security-feature:hover {
    border-color: #3b82f6;
}

.feature-content h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.feature-content p {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.7;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .smart-features-section {
        margin-top: 20px;
        padding: 16px;
        border-radius: 16px;
    }
    
    .features-header {
        margin-bottom: 16px;
    }
    
    .features-header h2 {
        font-size: 16px;
    }
    
    .features-header h2 i {
        font-size: 18px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .feature-card {
        padding: 16px;
        border-radius: 14px;
    }
    
    .feature-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
        border-radius: 12px;
    }
    
    .feature-icon i:last-child {
        font-size: 11px;
        bottom: 4px;
        right: 4px;
    }
    
    .feature-content h3 {
        font-size: 14px;
    }
    
    .feature-content p {
        font-size: 12px;
        line-height: 1.6;
    }
}

/* =====================
   Custom Confirm Modal
   ===================== */
.custom-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInOverlay 0.25s ease;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.custom-modal-box {
    background: var(--card-bg, #1e2a38);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 36px 32px 28px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
    animation: slideUpModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUpModal {
    from { transform: translateY(40px) scale(0.95); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.custom-modal-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(239,68,68,0.2), rgba(239,68,68,0.05));
    border: 2px solid rgba(239,68,68,0.35);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 26px;
    color: #ef4444;
}

.custom-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900, #f3f4f6);
    margin: 0 0 10px;
}

.custom-modal-message {
    font-size: 14px;
    color: var(--gray-400, #9ca3af);
    margin: 0 0 26px;
    line-height: 1.7;
    white-space: pre-line;
}

.custom-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.custom-modal-btn {
    flex: 1;
    max-width: 160px;
    padding: 11px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.15s, opacity 0.15s;
}

.custom-modal-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.custom-modal-btn.confirm-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

.custom-modal-btn.cancel-btn {
    background: rgba(255,255,255,0.07);
    color: var(--gray-900, #f3f4f6);
    border: 1px solid rgba(255,255,255,0.1);
}
