/* Global Font Family - Cairo */
body {
    font-family: 'Cairo', 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Dashboard Styles */
.dashboard-header-modern {
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
    animation: slideInDown 0.6s ease;
}

.dashboard-date {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Stat Cards */
.stat-card-enhanced {
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
}

.stat-card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    z-index: 1;
}

.stat-card-enhanced .card-body {
    position: relative;
    z-index: 2;
}

.stat-expenses { background: linear-gradient(135deg, #e74a3b 0%, #c0392b 100%); }
.stat-income { background: linear-gradient(135deg, #1cc88a 0%, #13855c 100%); }
.stat-savings { background: linear-gradient(135deg, #36b9cc 0%, #258391 100%); }
.stat-rate { background: linear-gradient(135deg, #4e73df 0%, #224abe 100%); }
.stat-daily { background: linear-gradient(135deg, #f6c23e 0%, #dda20a 100%); }
.stat-goals { background: linear-gradient(135deg, #858796 0%, #60616f 100%); }

.stat-icon-enhanced {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-enhanced {
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-enhanced {
    background: white;
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease-in-out;
}

/* Chart Cards */
.chart-card-enhanced {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    overflow: hidden;
    height: 100%;
    transition: transform 0.3s ease;
}

.dashboard-gradient-bg {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
}

.bg-gradient-success { background: linear-gradient(135deg, #1cc88a 0%, #13855c 100%); }
.bg-gradient-info { background: linear-gradient(135deg, #36b9cc 0%, #258391 100%); }
.bg-gradient-warning { background: linear-gradient(135deg, #f6c23e 0%, #dda20a 100%); }
.bg-gradient-primary { background: linear-gradient(135deg, #4e73df 0%, #224abe 100%); }

/* Premium Navbar & Glassmorphism */
.navbar-glass {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-bs-theme="dark"] .navbar-glass {
    background: rgba(33, 37, 41, 0.75) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.navbar-scrolled {
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1) !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* Enhanced Search Bar */
.search-form .input-group {
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    overflow: hidden;
}

.search-form .input-group:focus-within {
    background: white !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    border-color: #3b82f6 !important;
    transform: translateY(-1px);
}

[data-bs-theme="dark"] .search-form .input-group:focus-within {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Premium Dropdowns */
.dropdown-menu-premium {
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.15) !important;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95) !important;
    padding: 0.75rem !important;
    margin-top: 0.75rem !important;
    animation: dropdownShow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1050;
}

#search-results-container {
    display: block;
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    visibility: hidden;
}

#search-results-container.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    visibility: visible;
}

.search-form .spinner-border {
    width: 1rem;
    height: 1rem;
}

.list-group-item-action:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

#search-results-content .dropdown-header {
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.65rem;
}

.bg-warning-subtle {
    background-color: rgba(255, 193, 7, 0.2) !important;
    border-radius: 2px;
}

[data-bs-theme="dark"] .dropdown-menu-premium {
    background: rgba(43, 48, 53, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

@keyframes dropdownShow {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Interactive Elements */
.nav-link-premium {
    position: relative;
    transition: all 0.3s ease;
    border-radius: 0.75rem;
    padding: 0.5rem 0.85rem !important;
}

.nav-link-premium:hover {
    background: rgba(59, 130, 246, 0.08);
    color: #3b82f6 !important;
}

.nav-link-premium::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #3b82f6;
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 2px;
}

.nav-link-premium:hover::after {
    width: 60%;
}

/* Notification Pulse */
.notification-badge-pulse {
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(0.7); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(0.7); opacity: 0.5; }
}

/* Tables */
.table-modern th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.transition-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    z-index: 1;
    position: relative;
}

/* Global Responsive Table Container */
.table-responsive-modern {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 0.75rem;
}

/* Animations */
@keyframes slideInDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
@keyframes slideInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes slideInLeft {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideInRight {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}   
/* Utility Classes */
.text-white-enhanced {
    color: white !important;
}   
.bg-white-enhanced {
    background: white !important;
}
.border-0-enhanced {
    border: none !important;
}
.shadow-enhanced {
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15) !important;
}
.rounded-enhanced {
    border-radius: 1rem !important;
}
.p-4-enhanced {
    padding: 1.5rem !important;
}
.m-3-enhanced {
    margin: 1rem !important;
}
.text-center-enhanced {
    text-align: center !important;
}
.d-flex-enhanced {
    display: flex !important;
}
.align-items-center-enhanced {
    align-items: center !important;
}
.justify-content-center-enhanced {
    justify-content: center !important;
}   
.w-100-enhanced {
    width: 100% !important;
}
.h-100-enhanced {
    height: 100% !important;
}   
.mt-3-enhanced {
    margin-top: 1rem !important;
}
  @media (min-width: 1200px) {
  .col-xl-2 {
    flex: 0 0 auto;
    width: 31.667% !important;
  }
}/* Reports Page Responsive Tweaks */
.report-header {
    row-gap: 0.5rem;
}

.report-filter-form {
    width: 100%;
}

.report-filter-form .report-filter-select {
    flex: 1 1 160px;
    min-width: 0;
}

@media (min-width: 768px) {
    .report-filter-form {
        justify-content: flex-end;
    }

    .report-filter-form .report-filter-select {
        flex: 0 0 auto;
        min-width: 140px;
    }
}

@media (max-width: 575.98px) {
    .report-filter-form .report-filter-select {
        flex-basis: 100%;
    }
}
/* Expenses Page Responsive Tweaks */
.expenses-page-header {
    width: 100%;
}

.expenses-page-title {
    flex: 1 1 260px;
}

.expenses-header-actions {
    flex: 1 1 220px;
}

.expenses-header-actions > * {
    flex: 1 1 160px;
}

@media (min-width: 768px) {
    .expenses-header-actions > * {
        flex: 0 0 auto;
    }
}

@media (min-width: 992px) {
    .expenses-page-title {
        max-width: 60%;
    }
}

@media (max-width: 575.98px) {
    .expenses-header-actions .btn,
    .expenses-header-actions .dropdown,
    .expenses-header-actions a {
        width: 100%;
    }
}

.expenses-stat-grid .stat-card-premium {
    text-align: center;
}

.expenses-stat-grid .stat-card-premium .stat-icon {
    margin: 0 auto 1rem;
}

.expenses-filter-header .badge {
    margin-bottom: 0.25rem;
}

@media (max-width: 767.98px) {
    .expenses-filter-header {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .expenses-filter-header button {
        align-self: stretch;
    }
}

/* Mobile Table Cards System */
@media (max-width: 767.98px) {
    .table-mobile-cards {
        display: block;
        background: transparent;
        border: none;
    }

    .table-mobile-cards thead {
        display: none;
    }

    .table-mobile-cards tbody {
        display: block;
    }

    .table-mobile-cards tr {
        display: block;
        background: #fff;
        border-radius: 0.75rem;
        box-shadow: 0 2px 6px rgba(0,0,0,0.04);
        margin-bottom: 1rem;
        border: 1px solid rgba(0,0,0,0.05);
        overflow: visible;
    }

    .table-mobile-cards td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        text-align: right;
        min-height: 3.5rem;
    }

    .table-mobile-cards td:last-child {
        border-bottom: none;
    }

    .table-mobile-cards td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6c757d;
        margin-right: auto;
        padding-right: 1rem;
        font-size: 0.85rem;
        flex: 1;
        text-align: left;
    }

    /* RTL Support */
    [dir="rtl"] .table-mobile-cards td::before {
        margin-right: 0;
        margin-left: auto;
        padding-right: 0;
        padding-left: 1rem;
        text-align: right;
    }
    
    [dir="rtl"] .table-mobile-cards td {
        text-align: left;
    }
    
    /* Special handling for checkbox cells */
    .table-mobile-cards td.checkbox-cell {
        justify-content: flex-start;
    }
    
    .table-mobile-cards td.checkbox-cell::before {
        flex: 0 0 auto;
        margin-right: 1rem;
    }

    [dir="rtl"] .table-mobile-cards td.checkbox-cell::before {
        margin-left: 1rem;
        margin-right: 0;
    }

    /* Actions Row Styling for Mobile Cards */
    .table-mobile-cards td.actions-cell {
        background-color: #f8f9fa;
        border-top: 1px solid rgba(0,0,0,0.05);
        border-radius: 0 0 0.75rem 0.75rem;
    }
}

/* =========================================
   Mobile Bottom Navigation (PWA Style)
   ========================================= */
.mobile-bottom-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
    padding-bottom: env(safe-area-inset-bottom, 15px);
    z-index: 1040;
}

[data-bs-theme="dark"] .mobile-bottom-nav {
    background: rgba(33, 37, 41, 0.95);
    border-top-color: rgba(255, 255, 255, 0.05);
}

.mobile-bottom-nav .nav-link {
    color: #6c757d;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
    font-size: 0.75rem;
}

.mobile-bottom-nav .nav-link i {
    font-size: 1.25rem;
    margin-bottom: 0.2rem;
    transition: transform 0.2s ease;
}

.mobile-bottom-nav .nav-link.active {
    color: #3b82f6;
    font-weight: 600;
}

.mobile-bottom-nav .nav-link.active i {
    transform: translateY(-2px);
    color: #3b82f6;
}

/* FAB Center Button */
.mobile-bottom-nav .nav-item {
    position: relative;
    top: -20px;
}

.mobile-bottom-nav .fab-btn {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
    color: white !important;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(78, 115, 223, 0.4);
    border: 4px solid #fff;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0 !important;
}

[data-bs-theme="dark"] .mobile-bottom-nav .fab-btn {
    border-color: #2b3035;
}

.mobile-bottom-nav .fab-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #224abe 0%, #4e73df 100%);
}

.mobile-bottom-nav .fab-btn i {
    font-size: 1.5rem !important;
    margin-bottom: 0 !important;
}

/* Adjust body padding for mobile nav */
@media (max-width: 767.98px) {
    body.has-bottom-nav {
        padding-bottom: 85px !important;
    }
}
