/* Arabic Font and RTL Support */
body {
    font-family: 'Tajawal', Arial, sans-serif;
    direction: rtl;
    text-align: right;
}

/* Fix badge text colors for better readability */
.badge-info {
    color: #000 !important;
    background-color: #17a2b8 !important;
}

.badge-danger {
    color: #000 !important;
    background-color: #dc3545 !important;
}

.badge-secondary {
    color: #000 !important;
    background-color: #6c757d !important;
}

.badge-success {
    color: #000 !important;
    background-color: #28a745 !important;
}

.badge-warning {
    color: #000 !important;
    background-color: #ffc107 !important;
}

.badge-primary {
    color: #000 !important;
    background-color: #007bff !important;
}

/* ===== MODERN NAVBAR STYLES ===== */

/* Enhanced Navbar Base */
.modern-navbar {
    background: linear-gradient(135deg, #0d47a1 0%, #1976d2 50%, #42a5f5 100%) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 0.5rem 0;
    min-height: 70px;
    position: relative !important;
    z-index: 9999 !important;
    overflow: visible !important;
}

/* Navbar Container - Ensure dropdowns can overflow */
.modern-navbar .container {
    overflow: visible !important;
}

.modern-navbar .navbar-nav {
    overflow: visible !important;
}

/* Dropdown Navigation Items */
.nav-item.dropdown {
    position: relative !important;
    overflow: visible !important;
}

/* Enhanced Brand Logo */
.brand-enhanced {
    display: flex !important;
    align-items: center;
    padding: 0.5rem 1rem;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.brand-enhanced:hover {
    transform: translateY(-2px);
}

.brand-icon {
    font-size: 2.2rem;
    margin-left: 0.75rem;
    background: linear-gradient(135deg, #ffd54f, #ffb74d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px rgba(255, 213, 79, 0.3));
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.brand-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Modern Navigation Links */
.modern-nav-link {
    display: flex !important;
    align-items: center;
    padding: 0.8rem 1.2rem !important;
    margin: 0 0.2rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none !important;
    white-space: nowrap;
}

.modern-nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    opacity: 0;
    transition: all 0.3s ease;
    border-radius: 12px;
}

.modern-nav-link:hover {
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.modern-nav-link:hover::before {
    opacity: 1;
}

.nav-icon {
    font-size: 1.1rem;
    margin-left: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
}

.modern-nav-link span {
    font-size: 0.95rem;
    font-weight: 500;
}

/* User Menu Styling */
.user-menu {
    padding: 0.5rem 1rem !important;
}

.user-avatar {
    font-size: 1.8rem;
    margin-left: 0.5rem;
    color: #ffffff;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-align: right;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
}

.user-role {
    margin-top: 2px;
}

.user-role .badge {
    font-size: 0.7rem;
    padding: 2px 6px;
}

/* Enhanced Dropdown Menus */
.modern-dropdown-menu {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem 0;
    margin-top: 0.5rem;
    min-width: 300px;
    max-width: 350px;
    position: absolute !important;
    z-index: 99999 !important;
}

.modern-dropdown-item {
    display: flex !important;
    align-items: center;
    padding: 0.8rem 1.5rem !important;
    margin: 0 0.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: none !important;
    color: #2c3e50 !important;
    text-decoration: none !important;
}

.modern-dropdown-item:hover {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    transform: translateX(5px);
    color: #1976d2 !important;
}

.modern-dropdown-item i {
    font-size: 1.1rem;
    margin-left: 0.8rem;
    width: 20px;
    text-align: center;
}

.modern-dropdown-item div {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.modern-dropdown-item strong {
    font-size: 0.95rem;
    font-weight: 600;
    color: inherit;
}

.modern-dropdown-item small {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 2px;
}

/* Dropdown Headers */
.dropdown-header {
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    color: #495057 !important;
    padding: 0.5rem 1.5rem 0.3rem !important;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-header i {
    margin-left: 0.5rem;
    font-size: 1rem;
}

.dropdown-section {
    margin-bottom: 0.5rem;
}

/* ===== NEW MEGA MENU SYSTEM ===== */

/* Mega Menu Base Styling */
.mega-dropdown {
    position: static !important;
}

.mega-dropdown .dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 0 24px 24px !important;
    background: transparent !important;
    box-shadow: none !important;
    z-index: 99999 !important;
}

.mega-menu {
    background: #ffffff !important;
    border-radius: 24px !important;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 8px 25px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #e2e8f0 !important;
    margin: 8px 20px 0 20px !important;
    padding: 0 !important;
    min-width: 500px !important;
    max-width: 750px !important;
    width: fit-content !important;
    overflow: hidden !important;
    animation: megaMenuSlideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

@keyframes megaMenuSlideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced animation state */
.mega-menu-shown {
    animation: megaMenuEnhancedShow 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

@keyframes megaMenuEnhancedShow {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mega Menu Content */
.mega-menu-content {
    padding: 24px 32px 32px 32px !important;
    display: block !important;
    max-width: 100% !important;
}

/* ===== MEGA TABS SYSTEM ===== */

/* Mega Tabs Navigation */
.mega-tabs {
    display: flex !important;
    align-items: center !important;
    background: #f8fafc !important;
    border-bottom: 2px solid #e2e8f0 !important;
    padding: 12px 24px !important;
    gap: 12px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
    border-radius: 24px 24px 0 0 !important;
}

.mega-tabs::-webkit-scrollbar {
    height: 4px !important;
}

.mega-tabs::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, 0.5) !important;
}

.mega-tabs::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.6) !important;
    border-radius: 2px !important;
}

/* Tab Buttons */
.mega-tab {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 20px !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    color: #475569 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    outline: none !important;
}

.mega-tab i {
    font-size: 16px !important;
    color: #64748b !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.mega-tab:hover {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.mega-tab:hover i {
    color: #475569 !important;
}

/* Active Tab */
.mega-tab.active {
    background: #ffffff !important;
    border: 1px solid #3b82f6 !important;
    color: #1e40af !important;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.2), inset 0 0 0 1px rgba(59, 130, 246, 0.1) !important;
}

.mega-tab.active i {
    color: #2563eb !important;
}

.mega-tab.active::after {
    content: '' !important;
    position: absolute !important;
    bottom: -1px !important;
    left: 10% !important;
    right: 10% !important;
    height: 2px !important;
    background: linear-gradient(90deg, transparent, #2563eb, transparent) !important;
}

/* Tab Content Container */
.mega-tab-content {
    padding: 32px 40px !important;
    min-height: 280px !important;
    background: #ffffff !important;
    border-radius: 0 0 24px 24px !important;
}

/* Tab Sections - Hide inactive sections */
.mega-tab-content .mega-section {
    display: none !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

.mega-tab-content .mega-section.active {
    display: block !important;
    animation: fadeIn 0.3s ease-in-out !important;
    column-count: 2 !important;
    column-gap: 24px !important;
    column-rule: 1px solid #e2e8f0 !important;
}

/* Prevent items from breaking across columns */
.mega-tab-content .mega-item {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    display: inline-block !important;
    width: 100% !important;
    margin: 0 0 12px 0 !important;
}

/* Ensure first item in each column starts at the top */
.mega-tab-content .mega-item:first-child {
    margin-top: 0 !important;
}

/* Responsive mega menu columns */
@media (max-width: 768px) {
    .mega-tab-content .mega-section.active {
        column-count: 1 !important;
        column-gap: 0 !important;
        column-rule: none !important;
    }
    
    .mega-menu {
        min-width: 300px !important;
        max-width: calc(100vw - 40px) !important;
        width: calc(100vw - 40px) !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .mega-tab-content .mega-section.active {
        column-count: 2 !important;
    }
    
    .mega-menu {
        max-width: 650px !important;
    }
}

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

/* ===== END MEGA TABS SYSTEM ===== */

/* Section Styling */
.mega-section {
    background: rgba(248, 250, 252, 0.9) !important;
    border-radius: 16px !important;
    padding: 24px !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.mega-section:hover {
    background: rgba(241, 245, 249, 0.95) !important;
    border-color: rgba(203, 213, 225, 0.9) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12) !important;
}

/* Section Headers */
.mega-section-header {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 20px !important;
    padding-bottom: 16px !important;
    border-bottom: 2px solid rgba(59, 130, 246, 0.2) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.mega-section-header i {
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
    color: white !important;
    border-radius: 8px !important;
    margin-left: 12px !important;
    font-size: 14px !important;
}

/* Menu Items - Column Layout Style */
.mega-item {
    display: flex !important;
    align-items: flex-start !important;
    padding: 10px 12px !important;
    margin: 0 !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    color: #374151 !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Removed animation effect for cleaner column layout */

.mega-item:hover {
    color: #1e40af !important;
    background: rgba(59, 130, 246, 0.08) !important;
    border-color: transparent !important;
    transform: translateX(2px) !important;
}



/* Item Icons - Compact for Column Layout */
.mega-item-icon {
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    margin-left: 12px !important;
    font-size: 16px !important;
    flex-shrink: 0 !important;
    transition: all 0.2s ease !important;
}

.mega-item-icon.icon-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
}

.mega-item-icon.icon-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
    color: white !important;
}

.mega-item-icon.icon-info {
    background: linear-gradient(135deg, #06b6d4, #0891b2) !important;
    color: white !important;
}

.mega-item-icon.icon-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: white !important;
}

.mega-item-icon.icon-secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563) !important;
    color: white !important;
}

.mega-item-icon.icon-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: white !important;
}

/* Item Content */
.mega-item-content {
    flex: 1 !important;
    min-width: 0 !important;
}

.mega-item-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    margin-bottom: 2px !important;
    line-height: 1.2 !important;
}

.mega-item-description {
    font-size: 12px !important;
    color: #64748b !important;
    line-height: 1.3 !important;
}

.mega-item:hover .mega-item-title {
    color: #1e40af !important;
}

.mega-item:hover .mega-item-icon {
    transform: scale(1.05) rotate(2deg) !important;
}

/* Divider - Column Layout Compatible */
.mega-divider {
    height: 1px !important;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent) !important;
    margin: 0 0 12px 0 !important;
    border: none !important;
    width: 100% !important;
    display: inline-block !important;
}

/* Divider followed by first item should not add extra spacing */
.mega-divider + .mega-item {
    margin-top: 0 !important;
}

/* Column Headers (optional) */
.mega-column-header {
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: #64748b !important;
    padding: 8px 12px !important;
    margin-bottom: 8px !important;
    letter-spacing: 0.05em !important;
    display: inline-block !important;
    width: 100% !important;
}

/* User Dropdown Enhancements */
.user-dropdown {
    min-width: 320px;
    padding: 1.5rem 0;
}

.user-dropdown .dropdown-header {
    text-align: center;
    padding: 1rem 1.5rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 1rem;
}

.user-avatar-large {
    font-size: 3rem;
    color: #1976d2;
    margin-bottom: 0.5rem;
}

.user-details strong {
    font-size: 1.1rem;
    color: #2c3e50;
}

.user-details small {
    color: #6c757d;
}

/* Custom Mobile Toggler */
.custom-toggler {
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.custom-toggler:focus {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.25);
}

.custom-toggler:hover {
    background: rgba(255,255,255,0.2);
}

/* Responsive Mega Menu Styles */
@media (max-width: 1200px) {
    .mega-menu {
        min-width: 500px !important;
        max-width: calc(100vw - 40px) !important;
        margin: 8px 15px 0 15px !important;
    }
    
    .mega-menu-content {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
        gap: 24px !important;
        padding: 24px !important;
    }
    
    /* Reduce columns for medium screens */
    .mega-tab-content .mega-section.active {
        column-count: 2 !important;
    }
}

@media (max-width: 992px) {
    .mega-menu {
        min-width: 400px !important;
        margin: 8px 10px 0 10px !important;
    }
    
    .mega-menu-content {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
        gap: 20px !important;
        padding: 20px !important;
    }
    
    .mega-section {
        padding: 20px !important;
    }
    
    .mega-item {
        padding: 12px !important;
    }
    
    .mega-item-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 16px !important;
    }
    
    /* Responsive tab adjustments */
    .mega-tabs {
        padding: 10px 16px !important;
        gap: 8px !important;
    }
    
    .mega-tab {
        padding: 8px 16px !important;
        font-size: 13px !important;
    }
    
    .mega-tab i {
        font-size: 14px !important;
    }
}

@media (max-width: 768px) {
    .mega-dropdown .dropdown-menu {
        position: static !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    
    .mega-menu {
        min-width: auto !important;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 0 0 16px 16px !important;
        animation: none !important;
    }
    
    .mega-menu-content {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        padding: 16px !important;
    }
    
    .mega-section {
        padding: 16px !important;
    }
    
    .mega-section-header {
        margin-bottom: 16px !important;
        padding-bottom: 12px !important;
        font-size: 15px !important;
    }
    
    .mega-section-header i {
        width: 24px !important;
        height: 24px !important;
        font-size: 12px !important;
        margin-left: 10px !important;
    }
    
    .mega-item {
        padding: 12px !important;
        margin: 6px 0 !important;
    }
    
    .mega-item-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 14px !important;
        margin-left: 12px !important;
    }
    
    .mega-item-title {
        font-size: 14px !important;
    }
    
    .mega-item-description {
        font-size: 12px !important;
    }
    
    /* Mobile mega tabs */
    .mega-tabs {
        padding: 8px 12px !important;
        gap: 6px !important;
        border-radius: 0 !important;
        background: #f8fafc !important;
        border-bottom: 2px solid #e2e8f0 !important;
    }
    
    .mega-tab {
        padding: 6px 12px !important;
        font-size: 12px !important;
        border-radius: 8px !important;
    }
    
    .mega-tab i {
        font-size: 13px !important;
    }
    
    .mega-tab span {
        display: none !important; /* Hide text on very small screens, show only icons */
    }
    
    .mega-tab-content {
        padding: 20px !important;
        min-height: 250px !important;
    }
    
    /* Single column for mobile */
    .mega-tab-content .mega-section.active {
        column-count: 1 !important;
        column-rule: none !important;
    }
    
    .mega-tab-content .mega-item {
        margin-bottom: 8px !important;
    }
}

/* Show tab text on slightly larger mobile screens */
@media (min-width: 480px) and (max-width: 768px) {
    .mega-tab span {
        display: inline !important;
    }
    
    .mega-tab {
        padding: 8px 14px !important;
    }
}

/* Responsive Navbar Adjustments */
@media (max-width: 991.98px) {
    .modern-navbar {
        padding: 0.3rem 0;
    }
    
    .brand-title {
        font-size: 1.2rem;
    }
    
    .brand-subtitle {
        display: none;
    }
    
    .modern-nav-link {
        margin: 0.2rem 0;
        justify-content: flex-start;
    }
    
    .user-info {
        display: none;
    }
}

/* Tooltip Styling */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 99998;
    margin-bottom: 5px;
    animation: tooltip-appear 0.3s ease;
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    z-index: 99998;
}

@keyframes tooltip-appear {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Notification Badge */
.nav-link .badge {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* Active State */
.navbar-nav .nav-link.active,
.navbar-nav .nav-link[aria-expanded="true"] {
    background: rgba(255,255,255,0.15);
    color: #ffffff !important;
}

.navbar-nav .nav-link.active::before,
.navbar-nav .nav-link[aria-expanded="true"]::before {
    opacity: 1;
}

/* Dropdown Divider */
.dropdown-divider {
    margin: 0.8rem 1rem;
    border-top-color: #e9ecef;
}

/* Bootstrap Dropdown Override - Ensure High Z-Index */
.dropdown-menu {
    z-index: 99999 !important;
    position: absolute !important;
}

.navbar .dropdown-menu {
    z-index: 99999 !important;
    position: absolute !important;
}

/* Ensure dropdown parent is positioned */
.dropdown {
    position: relative !important;
}

/* ===== END NAVBAR STYLES ===== */

/* Form Styling */
.form-control, .form-select {
    text-align: right;
    font-family: 'Tajawal', Arial, sans-serif;
}

/* Button Styling */
.btn {
    font-family: 'Tajawal', Arial, sans-serif;
    padding: 0.5rem 1.5rem;
}

/* Card Styling */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    border-radius: 0.5rem;
}

.card-header {
    background-color: #f8f9fa;
    font-weight: 500;
}

/* Table Styling */
.table {
    text-align: right;
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.table th {
    font-weight: 500;
    background-color: #f8f9fa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0.75rem 0.5rem;
    border-bottom: 2px solid #dee2e6;
    border-left: 0;
    border-right: 0;
}

.table td {
    vertical-align: middle;
    padding: 0.75rem 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 0;
    border-right: 0;
}

/* Accounts table specific column widths - evenly distributed */
.table .code-column {
    width: 10%;
    font-family: monospace;
}

.table .name-column {
    width: 22%;
}

.table .type-column {
    width: 12%;
}

.table .subtype-column {
    width: 15%;
}

.table .balance-column {
    width: 14%;
    text-align: right !important;
}

.table .balance-column .currency-amount {
    font-family: 'Tajawal', Arial, sans-serif;
    font-weight: 500;
}

.table .status-column {
    width: 10%;
}

.table .actions-column {
    width: 17%;
}

/* Table responsive improvements */
.table-responsive {
    border-radius: 0.375rem;
    padding: 0;
    margin: 0;
    overflow-x: auto;
    width: 100%;
}

.table-responsive .table {
    margin-bottom: 0;
    min-width: 800px;
}

/* Ensure no spacing between table cells */
.table th,
.table td {
    border-left: none !important;
    border-right: none !important;
    margin: 0;
}

/* Generic actions column styling (fallback for other tables) */
.table:not(.exchange-offices-table) .actions-column .btn-group {
    white-space: nowrap;
    display: flex;
    gap: 2px;
}

.table:not(.exchange-offices-table) .actions-column .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Account name column - allow text wrapping */
.table .name-column {
    word-wrap: break-word;
    white-space: normal;
}

/* Account subtype column - allow text wrapping */
.table .subtype-column {
    word-wrap: break-word;
    white-space: normal;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .table {
        table-layout: auto;
    }
    
    .table .code-column,
    .table .name-column,
    .table .type-column,
    .table .subtype-column,
    .table .balance-column,
    .table .status-column,
    .table .actions-column {
        width: auto !important;
    }
    
    .table .balance-column {
        min-width: 100px;
    }
    
    .table .actions-column {
        min-width: 100px;
    }
}

/* Dashboard Cards */
.dashboard-card {
    transition: transform 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 5rem auto;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Loading Spinner */
.spinner-border {
    width: 1.5rem;
    height: 1.5rem;
}

/* Alert Styling */
.alert {
    border-radius: 0.5rem;
}

/* Badge Styling */
.badge {
    font-weight: 400;
    padding: 0.35em 0.65em;
}

/* Pagination */
.pagination {
    justify-content: center;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
    }
    
    .table {
        font-size: 10pt;
    }
}

/* Enhanced Delete Button Styles */
.delete-account {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.delete-account::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1), rgba(239, 68, 68, 0.1));
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.delete-account:hover::before {
    transform: translateX(0);
}

.delete-account:hover {
    color: #dc2626 !important;
    border-color: #dc2626 !important;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.25) !important;
    transform: translateY(-1px);
}

.delete-account:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2) !important;
}

.delete-account:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none !important;
}

.delete-account.btn-success {
    color: #059669 !important;
    border-color: #059669 !important;
}

.delete-account.btn-success:hover {
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.25) !important;
}

/* Loading state for delete button */
.delete-account:disabled .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Delete confirmation dialog enhancement */
.delete-confirm-dialog {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Enhanced action buttons group */
.actions-column .btn-group {
    gap: 4px;
}

.actions-column .btn {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.actions-column .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.actions-column .btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Ensure delete button is properly visible */
.btn-outline-danger.delete-account {
    color: #dc2626;
    border-color: #dc2626;
    background-color: transparent;
}

.btn-outline-danger.delete-account:hover {
    color: #fff;
    background-color: #dc2626;
    border-color: #dc2626;
}

/* Responsive adjustments for generic action buttons */
@media (max-width: 768px) {
    .table:not(.exchange-offices-table) .actions-column .btn-group {
        flex-wrap: wrap;
        gap: 2px;
    }
    
    .table:not(.exchange-offices-table) .actions-column .btn {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .table:not(.exchange-offices-table) .actions-column .btn i {
        font-size: 0.8rem;
    }
} 

/* Enhanced action buttons group */
.actions-column .btn-group {
    gap: 4px;
}

.actions-column .btn {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.actions-column .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.actions-column .btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Exchange Offices Table Specific Enhancements */
.exchange-offices-table {
    min-width: 1000px; /* Ensure minimum width for proper display */
}

.exchange-offices-table .actions-column {
    width: 250px; /* Increased from 200px to accommodate 6 buttons */
    min-width: 250px;
    max-width: 250px;
    white-space: nowrap;
}

.exchange-offices-table .actions-column .btn-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px; /* Reduced gap slightly */
    justify-content: flex-start;
    width: 100%;
    overflow: visible; /* Ensure buttons are not clipped */
}

.exchange-offices-table .actions-column .btn {
    font-size: 0.7rem; /* Slightly smaller font */
    padding: 0.2rem 0.35rem; /* Reduced padding */
    flex-shrink: 0;
    min-width: 30px; /* Reduced minimum width */
    height: 30px; /* Reduced height slightly */
    display: flex;
    align-items: center;
    justify-content: center;
}

.exchange-offices-table .actions-column .btn i {
    font-size: 0.8rem;
    margin: 0;
}

/* Code column improvements */
.exchange-offices-table .code-column {
    width: 80px;
    min-width: 80px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Name column improvements */
.exchange-offices-table .name-column {
    width: 200px;
    min-width: 180px;
    word-wrap: break-word;
    white-space: normal;
}

/* Balance column improvements */
.exchange-offices-table .balance-column {
    width: 140px;
    min-width: 120px;
    text-align: left !important; /* RTL: left means right visually */
}

/* Status column improvements */
.exchange-offices-table .status-column {
    width: 80px;
    min-width: 80px;
    text-align: center;
}

/* Improved table responsive wrapper */
.exchange-offices-responsive {
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
}

.exchange-offices-responsive::-webkit-scrollbar {
    height: 8px;
}

.exchange-offices-responsive::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 4px;
}

.exchange-offices-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.exchange-offices-responsive::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Mobile responsive adjustments for exchange offices table */
@media (max-width: 768px) {
    .exchange-offices-table .actions-column {
        width: 180px; /* Increased for mobile */
        min-width: 180px;
    }
    
    .exchange-offices-table .actions-column .btn-group {
        flex-direction: column;
        gap: 2px;
        align-items: stretch;
        overflow: visible;
    }
    
    .exchange-offices-table .actions-column .btn {
        font-size: 0.65rem;
        padding: 0.15rem 0.25rem;
        min-width: 26px;
        height: 26px;
        width: 100%;
        margin-bottom: 1px;
    }
    
    .exchange-offices-table .actions-column .btn i {
        font-size: 0.7rem;
    }
    
    /* Make table more compact on mobile */
    .exchange-offices-table .name-column {
        width: 150px;
        min-width: 120px;
    }
    
    .exchange-offices-table .balance-column {
        width: 100px;
        min-width: 90px;
    }
    
    .exchange-offices-table .code-column {
        width: 60px;
        min-width: 60px;
    }
}

/* Tablet responsive adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .exchange-offices-table {
        min-width: 950px; /* Increased min-width */
    }
    
    .exchange-offices-table .actions-column {
        width: 220px; /* Increased for tablet */
        min-width: 220px;
    }
    
    .exchange-offices-table .actions-column .btn {
        font-size: 0.65rem;
        padding: 0.18rem 0.3rem;
        min-width: 28px;
        height: 28px;
    }
}

/* Dropdown improvements for action buttons */
.exchange-offices-table .actions-column .dropdown-menu {
    min-width: 160px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border: 1px solid #e2e8f0;
    padding: 8px 0;
}

.exchange-offices-table .actions-column .dropdown-item {
    padding: 8px 16px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.exchange-offices-table .actions-column .dropdown-item:hover {
    background-color: #f8fafc;
    color: #1e40af;
}

.exchange-offices-table .actions-column .dropdown-item i {
    width: 16px;
    text-align: center;
} 

/* Exchange offices delete button fix */
.exchange-offices-table .delete-office {
    cursor: pointer !important;
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
}

.exchange-offices-table .delete-office:hover {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #fff !important;
}

.exchange-offices-table .delete-office:active {
    transform: scale(0.95);
}

.exchange-offices-table .delete-office:disabled {
    cursor: not-allowed !important;
    opacity: 0.65;
}

/* Ensure button group doesn't block clicks */
.exchange-offices-table .btn-group {
    position: relative;
    z-index: 5;
}

/* Fix potential overlapping issues */
.exchange-offices-table td.actions-column {
    position: relative;
    z-index: 1;
}

/* Ensure icons inside buttons are not blocking clicks */
.exchange-offices-table .btn i {
    pointer-events: none;
} 