* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0F7F7A;
    --primary-hover: #0C6A66;
    --primary-light: #3FE0D0;
    --primary-soft: #E6F7F5;
    --text-on-primary: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Text muted utility class */
.text-muted {
    color: #666;
    font-size: 0.875rem;
}

.navbar {
    min-height: 64px;
    height: 72px;
    display: flex;
    flex-wrap: nowrap !important;
    align-items: center;
    background-color: var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0 20px;
    overflow: visible !important;
    position: relative;
    z-index: 1000;
}

/* Navbar should span full width */
.navbar-container {
    max-width: none !important;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-wrap: nowrap !important;
    align-items: center;
    overflow: visible !important;
}

/* Topbar Structure - 3 clear zones */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex: 1;
    padding: 0 1rem; /* Reduced padding for edge alignment */
    gap: 1rem;
}

/* Zone 1: Logo - Far right (RTL) */
.topbar-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-right: auto; /* Force edge in RTL */
}

/* Zone 2: Navigation Links - Center */
.topbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0; /* Allow shrinking if needed */
}

/* Zone 3: Icons + Profile - Far left (RTL) */
.topbar-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto; /* Force edge in RTL */
}

.global-search {
    position: relative;
}

.global-search-icon {
    background: none;
    border: none;
    color: #ffffff;
    opacity: 0.85;
    cursor: pointer;
}

.global-search-icon:hover {
    opacity: 1;
    color: #e0f2f1;
}

.global-search-box {
    position: absolute;
    top: 120%;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.5rem;
    width: 260px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    display: none;
    z-index: 1000;
}

.global-search-box input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 0.85rem;
}

.global-search-results {
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.global-search-results a {
    display: block;
    padding: 0.5rem 0.7rem;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
}

.global-search-results a:hover {
    background: #e0f2f1;
    color: #137d76;
}

.navbar-brand,
.navbar-logo-link {
    display: flex;
    align-items: center;
    height: 100%;
    text-decoration: none;
}

.navbar-logo {
    height: 56px;
    max-height: 56px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* Keep compatibility with old class names */
.nav-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: space-between;
}

.nav-links,
.navbar-menu,
.navbar-links {
    display: flex;
    flex-wrap: nowrap !important;
    gap: 1.5rem;
    align-items: center;
    overflow: visible !important;
    justify-content: center; /* Center navigation links */
}

/* Ensure settings and notifications containers don't wrap in navbar */
.navbar .settings-container,
.navbar .notifications-container,
.navbar .help-container,
.navbar .profile-container {
    display: flex;
    flex-wrap: nowrap !important;
    align-items: center;
    white-space: nowrap;
}

.nav-links a,
.navbar-menu a,
.navbar-links a {
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link-with-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    gap: 6px;
}

.navbar-badge,
.navbar .badge,
.navbar .notification-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background-color: #dc3545;
    color: #ffffff;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 12px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.navbar-badge-red {
    background-color: #dc3545;
}

.navbar-badge-orange {
    background-color: #ff9800;
}

.navbar-badge-blue {
    background-color: var(--primary);
}

.navbar-badge-green {
    background-color: #28a745;
    color: white;
}

/* Responsive badge sizing */
@media (max-width: 768px) {
    .navbar-badge {
        min-width: 16px;
        height: 16px;
        font-size: 10px;
        top: -6px;
        right: -10px;
    }
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: 1rem;
    z-index: 1001;
}

.mobile-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.hamburger-icon {
    display: block;
    font-size: 1.75rem;
    line-height: 1;
}

/* New Mobile Sidebar Menu Styles */
.menu-toggle {
    display: none;
    font-size: 26px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1002;
}

.menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* ===== Mobile Sidebar ===== */
.mobile-sidebar {
    display: none; /* Hidden by default on desktop */
    pointer-events: none; /* Don't block clicks when hidden */
}

@media (max-width: 768px) {
    .mobile-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--primary); /* טורקיז של המערכת */
        padding: 100px 20px 20px;
        box-shadow: -2px 0 10px rgba(0,0,0,0.2);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        display: flex;
        flex-direction: column;
        gap: 0;
        overflow-y: auto;
        pointer-events: none; /* Don't block clicks when closed */
    }

    .mobile-sidebar.active {
        transform: translateX(0);
        pointer-events: auto; /* Allow clicks when open */
    }

    .mobile-sidebar .logout-btn {
        margin-top: auto;
        margin-bottom: 20px;
    }

    /* Mobile Settings Sidebar */
    .mobile-settings-sidebar {
        right: 0;
        background: #ffffff !important;
        color: #333;
        z-index: 1100; /* מעל הסיידבר הראשי */
        transform: translateX(100%);
    }

    .mobile-settings-sidebar.active {
        transform: translateX(0);
        pointer-events: auto;
    }

    .mobile-settings-sidebar a {
        color: #333 !important;
        background: #ffffff !important;
        border-bottom: 1px solid #eee;
    }

    .mobile-settings-sidebar a:hover {
        background: #f5f5f5 !important;
    }
}

/* ===== Backdrop ===== */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
}

#sidebarBackdrop {
    pointer-events: none;
}

#sidebarBackdrop.active {
    pointer-events: auto;
}

/* Dropdown backdrop for mobile */
@media (max-width: 768px) {
    .dropdown-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1999;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .dropdown-backdrop.active {
        display: block;
        opacity: 1;
    }
}

/* Mobile Navbar Styles - Side Drawer */
@media (max-width: 768px) {
    /* Hide navbar on mobile - replaced by mobile-nav-container */
    .navbar {
        display: none !important;
    }
    
    .navbar-container {
        display: none !important;
    }
    
    /* Hide hamburger menu and sidebar on mobile */
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .menu-toggle {
        display: none !important;
    }
    
    .mobile-sidebar,
    .sidebar-backdrop {
        display: none !important;
    }
    
    /* Mobile two-row navigation */
    .mobile-nav-container {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        background-color: var(--primary);
        z-index: 1001;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .mobile-nav-row {
        display: flex;
        align-items: center;
        padding: 0.5rem 1rem;
        gap: 0.75rem;
        min-height: 44px;
    }
    
    .mobile-nav-utilities {
        justify-content: flex-start;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .mobile-nav-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
        color: var(--text-on-primary);
        background: none;
        border: none;
        cursor: pointer;
        text-decoration: none;
        position: relative;
        padding: 0;
    }
    
    .mobile-nav-icon:hover {
        background-color: rgba(255, 255, 255, 0.1);
        border-radius: 4px;
    }
    
    .mobile-nav-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        background-color: #dc3545;
        color: #ffffff;
        border-radius: 50%;
        min-width: 16px;
        height: 16px;
        font-size: 10px;
        font-weight: bold;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 3px;
        line-height: 1;
    }
    
    .mobile-nav-links {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.15rem;
        direction: rtl;
        overflow: hidden; /* בלי גלילה */
        justify-content: space-between;
    }
    
    .mobile-nav-link {
        flex: 1;
        min-width: 0;
        padding: 0.5rem 0.25rem;
        font-size: 11px;
        color: var(--text-on-primary);
        text-decoration: none;
        white-space: nowrap;
        border-radius: 4px;
        transition: background-color 0.2s ease;
        text-align: center;
        overflow: visible;
        text-overflow: unset;
        line-height: 1.2;
    }
    
    .mobile-nav-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .mobile-nav-link.active {
        background-color: rgba(255, 255, 255, 0.2);
        font-weight: bold;
    }
    
    /* Split "המשך טיפול" into two lines on mobile */
    .mobile-nav-followup {
        white-space: normal;
        line-height: 1.1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .mobile-nav-followup span {
        display: block;
        line-height: 1.1;
    }
    
    /* Show/hide Dashboard text based on screen size - mobile only */
    .mobile-nav-desktop-text {
        display: none;
    }
    
    .mobile-nav-mobile-text {
        display: inline;
    }
    
    /* Mobile Settings Menu (Bottom Sheet) - Hidden on desktop */
    .mobile-settings-menu {
        display: none !important;
    }
    
    .mobile-settings-menu-backdrop {
        display: none !important;
    }
    
    /* Mobile Settings Menu (Bottom Sheet) - Show only on mobile */
    @media (max-width: 768px) {
        .mobile-settings-menu {
            display: flex !important;
            position: fixed;
            bottom: -100%;
            right: 0;
            left: 0;
            background: #ffffff;
            border-radius: 20px 20px 0 0;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
            z-index: 1100;
            max-height: 80vh;
            flex-direction: column;
            transition: bottom 0.3s ease;
        }
        
        .mobile-settings-menu.active {
            bottom: 0;
        }
        
        .mobile-settings-menu-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem 1.5rem;
            border-bottom: 1px solid #eee;
        }
        
        .mobile-settings-menu-header h3 {
            margin: 0;
            font-size: 1.1rem;
            font-weight: bold;
            color: #333;
        }
        
        .mobile-settings-close {
            background: none;
            border: none;
            font-size: 2rem;
            color: #666;
            cursor: pointer;
            padding: 0;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
        }
        
        .mobile-settings-menu-content {
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            flex: 1;
        }
        
        .mobile-settings-menu-item {
            display: block;
            padding: 1rem 1.5rem;
            color: #333;
            text-decoration: none;
            border-bottom: 1px solid #f0f0f0;
            font-size: 1rem;
            transition: background-color 0.2s ease;
        }
        
        .mobile-settings-menu-item:hover,
        .mobile-settings-menu-item.active {
            background-color: #f8f9fa;
        }
        
        .mobile-settings-menu-item.active {
            color: var(--primary);
            font-weight: bold;
        }
        
        .mobile-settings-menu-divider {
            height: 1px;
            background: #eee;
            margin: 0.5rem 0;
        }
        
        .mobile-settings-logout {
            color: #e74c3c !important;
            font-weight: bold;
        }
        
        .mobile-settings-menu-backdrop {
            display: block !important;
            position: fixed;
            top: 0;
            right: 0;
            left: 0;
            bottom: 0;
            background: rgba(0,0,0,0.5);
            z-index: 1099;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s ease, visibility 0.3s ease;
        }
        
        .mobile-settings-menu-backdrop.active {
            opacity: 1;
            visibility: visible;
        }
    }
    
    /* Hide notification bell on navbar - it's in the menu */
    .navbar-container > .navbar-menu > .notifications-container,
    .navbar-container > .navbar-menu > .help-container {
        display: none;
    }
    
    /* Hide desktop-only elements on mobile - only in navbar */
    .navbar .desktop-only {
        display: none !important;
    }
    
    /* Show mobile-only links on mobile - only in navbar */
    .navbar .mobile-only-link {
        display: block !important;
    }
    
    /* Mobile sidebar desktop-only elements */
    .mobile-sidebar .desktop-only {
        display: none !important;
    }
    
    /* Mobile sidebar mobile-only links */
    .mobile-sidebar .mobile-only-link {
        display: block !important;
    }
    
    /* Hide desktop navbar links on mobile */
    .navbar-links {
        display: none;
    }
    
    /* On mobile, navbar-menu is hidden, mobile-sidebar becomes the sidebar */
    .navbar-menu {
        display: none;
    }
    
    /* Overlay when menu is open - separate element */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.4);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease-out;
        pointer-events: none; /* Don't block clicks when hidden */
    }
    
    .mobile-menu-overlay.active {
        display: block;
        opacity: 1;
        pointer-events: auto; /* Allow clicks when active */
    }
    
    /* Mobile sidebar links styling */
    .mobile-sidebar a,
    .mobile-sidebar button.mobile-only-link {
        display: block;
        width: 100%;
        padding: 1rem 1.25rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        text-align: right;
        white-space: nowrap;
        color: #fff;
        text-decoration: none;
        transition: background-color 0.2s ease;
        font-size: 1rem;
    }
    
    .mobile-sidebar a:hover,
    .mobile-sidebar button.mobile-only-link:hover {
        background-color: rgba(255, 255, 255, 0.15);
    }
    
    /* Badges in mobile sidebar */
    .mobile-sidebar .nav-link-with-badge {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .mobile-sidebar .navbar-badge {
        margin-right: 0.5rem;
    }
    
    .mobile-sidebar .logout-btn {
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        border-bottom: none;
        padding: 1rem 1.25rem;
        margin-top: auto;
        text-align: center;
        font-weight: 600;
    }
    
    /* Hide notifications container in mobile sidebar */
    .mobile-sidebar .notifications-container {
        display: none;
    }
    
    .nav-links a,
    .nav-links .notifications-container,
    .nav-links .logout-btn {
        display: block;
        width: 100%;
        padding: 0.875rem 1.25rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        text-align: right;
        white-space: nowrap;
    }
    
    .nav-links a:last-child,
    .nav-links .logout-btn:last-child {
        border-bottom: none;
    }
    
    .nav-links a:hover {
        background-color: rgba(255, 255, 255, 0.15);
    }
    
    /* Show notifications in mobile menu */
    .nav-links .notifications-container {
        display: block;
        width: 100%;
    }
    
    .nav-links .notifications-icon {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        padding: 0.875rem 1.25rem;
    }
    
    /* Show settings in mobile menu */
    .mobile-sidebar .settings-container {
        display: block !important;
        width: 100%;
        overflow: visible !important;
    }
    
    .mobile-sidebar .settings-icon {
        width: 100%;
        display: flex !important;
        justify-content: flex-end;
        padding: 0.875rem 1.25rem;
        visibility: visible !important;
    }
    
    /* Ensure notifications icon is visible in mobile sidebar if present */
    .mobile-sidebar .notifications-container {
        display: block !important;
        width: 100%;
        overflow: visible !important;
    }
    
    .mobile-sidebar .reminders-icon-link {
        display: flex !important;
        visibility: visible !important;
    }
    
    /* Adjust settings dropdown for mobile */
    .mobile-sidebar .settings-dropdown {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        min-width: 200px;
        max-width: 100% !important;
        border-radius: 12px 12px 0 0;
        max-height: 60vh;
        background-color: #ffffff !important;
        z-index: 2000 !important;
        opacity: 1 !important;
        transform: none !important;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1), 0 -4px 16px rgba(0, 0, 0, 0.08) !important;
    }
    
    .mobile-sidebar .settings-dropdown .settings-dropdown-item {
        color: #333 !important;
        background-color: #ffffff !important;
        opacity: 1 !important;
    }
    
    /* Settings dropdown in navbar on mobile - also fix positioning */
    .navbar .settings-dropdown {
        position: fixed !important;
        top: 72px !important; /* below navbar */
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
        max-width: calc(100% - 20px) !important;
        bottom: auto !important;
        border-radius: 12px;
        max-height: 60vh;
        z-index: 2000 !important;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1), 0 -4px 16px rgba(0, 0, 0, 0.08) !important;
    }
    
    /* Adjust notifications dropdown for mobile */
    .notifications-dropdown {
        position: fixed !important;
        top: 72px !important; /* below navbar */
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
        max-width: calc(100% - 20px) !important;
        bottom: auto !important;
        max-height: 60vh;
        border-radius: 12px;
        z-index: 2000 !important;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1), 0 -4px 16px rgba(0, 0, 0, 0.08) !important;
    }
}

/* Desktop: Keep navbar menu visible */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .menu-toggle {
        display: none !important;
    }
    
    .navbar-menu,
    .navbar-links,
    .nav-links {
        display: flex !important;
        flex-wrap: nowrap !important;
        position: static;
        max-height: none;
        overflow: visible;
    }
    
    .mobile-sidebar {
        display: none !important;
    }
    
    .sidebar-backdrop {
        display: none !important;
    }
    
    /* Show desktop-only elements on desktop - only in navbar */
    .navbar .desktop-only {
        display: flex !important;
    }
    
    /* Hide mobile-only links on desktop - only in navbar */
    .navbar .mobile-only-link {
        display: none !important;
    }
    
    /* Mobile sidebar desktop-only elements on desktop */
    .mobile-sidebar .desktop-only {
        display: flex !important;
    }
    
    /* Mobile sidebar mobile-only links on desktop */
    .mobile-sidebar .mobile-only-link {
        display: none !important;
    }
    
    /* Hide mobile navigation on desktop */
    .mobile-nav-container {
        display: none !important;
    }
    
    /* Hide mobile settings menu on desktop */
    .mobile-settings-menu {
        display: none !important;
    }
    
    .mobile-settings-menu-backdrop {
        display: none !important;
    }
    
    /* Ensure mobile-nav-followup doesn't affect desktop */
    .mobile-nav-followup {
        white-space: normal;
    }
    
    .mobile-nav-followup span {
        display: inline;
    }
}

/* Logout button styling */
.logout-btn {
    background: #e74c3c;
    color: #fff !important;
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.2s ease;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.logout-btn:hover {
    background: #c0392b;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-links a:hover {
    background-color: rgba(255,255,255,0.2);
}

/* Ensure settings dropdown items are not affected by nav-links styles */
.settings-dropdown-item,
.settings-dropdown .settings-dropdown-item,
.settings-container .settings-dropdown-item {
    color: #333 !important;
    background-color: #ffffff !important;
    opacity: 1 !important;
}

/* Ensure link states don't override dropdown item styles */
.settings-dropdown-item:link,
.settings-dropdown-item:visited,
.settings-dropdown-item:active,
.settings-dropdown-item:focus {
    color: #333 !important;
    background-color: #ffffff !important;
    opacity: 1 !important;
    text-decoration: none !important;
}

.settings-dropdown .settings-dropdown-item:hover,
.settings-dropdown-item:hover {
    background-color: #f8f9fa !important;
    color: #333 !important;
    opacity: 1 !important;
}

/* Override nav-links styles for logout button */
.nav-links .logout-btn {
    padding: 6px 14px;
    border-radius: 6px;
}

.nav-links .logout-btn:hover {
    background-color: #c0392b;
    background: #c0392b;
}

/* Notifications */
.notifications-container {
    position: relative;
}

.notifications-icon {
    position: relative;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem;
    color: #fff;
    transition: opacity 0.3s;
}

.notifications-icon:hover {
    opacity: 0.8;
}

.reminders-icon-link {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    opacity: 0.85;
    transition: opacity 0.3s;
}

.reminders-icon-link:hover {
    opacity: 1;
    color: #e0f2f1;
}

.reminders-icon-link svg {
    width: 20px;
    height: 20px;
    display: block;
}

.help-container {
    position: relative;
    margin-left: 0.5rem;
}

.help-icon-link {
    position: relative;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem;
    color: #fff;
    transition: opacity 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-family: inherit;
}

.help-icon-link:hover {
    opacity: 0.8;
}

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

.notifications-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    width: 20px;
    height: 18px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid var(--primary);
    line-height: 1;
}

/* Notifications Dropdown */
.notifications-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    width: 340px;
    max-width: calc(100vw - 2rem);
    max-height: 500px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 4px 16px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    display: none;
    flex-direction: column;
    direction: rtl;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.notifications-dropdown.open {
    display: flex;
}

.notifications-dropdown-header {
    padding: 1rem 1.25rem;
    background-color: #ffffff;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.notifications-dropdown-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
}

.notifications-dropdown-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-mark-all-read {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background-color 0.2s, opacity 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.btn-mark-all-read:hover:not(:disabled) {
    background-color: var(--primary);
    color: var(--text-on-primary);
    border-color: var(--primary);
}

.btn-mark-all-read:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.notifications-dropdown-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: calc(500px - 60px); /* Subtract header height */
}

.notifications-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    color: #999;
    min-height: 200px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(64, 224, 208, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.notifications-loading p {
    margin: 0;
    font-size: 0.875rem;
}

.notifications-list {
    overflow-y: auto;
    max-height: calc(500px - 60px); /* Subtract header height */
    flex: 1;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.3s ease, transform 0.3s ease;
    direction: rtl;
    opacity: 0;
    transform: translateX(-20px);
    background-color: #ffffff;
}

.notification-item.notification-animate {
    opacity: 1;
    transform: translateX(0);
    animation: slideInFade 0.5s ease-out;
}

.notification-item.notification-new {
    background-color: rgba(64, 224, 208, 0.08);
    border-right: 3px solid var(--primary);
}

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

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item:active {
    background-color: #f0f0f0;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:first-child {
    border-top: none;
}

.notification-icon-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    background-color: #f5f5f5;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.notification-item:hover .notification-icon-wrapper {
    background-color: rgba(64, 224, 208, 0.15);
}

.notification-icon {
    font-size: 1.25rem;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #333;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.notification-message {
    font-size: 0.8125rem;
    color: #666;
    line-height: 1.4;
    margin-bottom: 0.375rem;
}

.notification-time {
    font-size: 0.6875rem;
    color: #999;
}

/* Settings Dropdown */
.settings-container {
    position: relative;
    overflow: visible !important;
}

/* Notifications Container */
.notifications-container {
    position: relative;
    overflow: visible !important;
}

.settings-icon,
.settings-link {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
    color: #ffffff;
    opacity: 0.85;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-icon:hover,
.settings-link:hover {
    opacity: 1;
    color: #e0f2f1;
}

.settings-icon svg,
.settings-link svg {
    width: 20px;
    height: 20px;
    display: block;
}

.settings-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    width: 200px;
    min-width: 200px;
    max-width: calc(100vw - 2rem);
    background-color: #ffffff !important;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 4px 16px rgba(0, 0, 0, 0.08);
    z-index: 2000 !important;
    display: none;
    flex-direction: column;
    direction: rtl;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    opacity: 1 !important;
}

.settings-dropdown.open {
    display: flex;
}

.settings-dropdown-item {
    padding: 0.875rem 1.25rem;
    color: #333 !important;
    background-color: #ffffff !important;
    text-decoration: none;
    font-size: 0.9375rem;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    display: block;
    opacity: 1 !important;
    font-weight: 400;
}

.settings-dropdown-item:first-child {
    border-top: none;
}

.settings-dropdown-item:last-child {
    border-bottom: none;
}

.settings-dropdown-item:hover {
    background-color: #f8f9fa !important;
    color: #333 !important;
}

.settings-dropdown-logout {
    color: #e74c3c !important;
    background-color: #ffffff !important;
    font-weight: 600;
    opacity: 1 !important;
}

.settings-dropdown-logout:hover {
    background-color: #ffeaea !important;
    color: #e74c3c !important;
}

/* Logout item in settings dropdown */
.settings-dropdown li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dropdown-menu .logout-item,
.settings-dropdown .logout-item {
    background-color: #dc3545; /* אדום Bootstrap */
    color: #fff !important;
    border-radius: 6px;
    margin: 4px 8px;
    text-align: center;
    font-weight: 600;
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
}

.dropdown-menu .logout-item:hover,
.settings-dropdown .logout-item:hover {
    background-color: #bb2d3b;
    color: #fff !important;
}

.settings-dropdown-divider {
    height: 1px;
    background-color: #e5e5e5;
    margin: 0.25rem 0;
}

/* Profile Avatar Container */
.profile-container {
    position: relative;
    overflow: visible !important;
}

/* Topbar Profile - Aligned to left edge in RTL */
.topbar-profile {
    /* Profile is already in topbar-right, no need for margin-right: auto */
}

.profile-avatar-wrapper {
    position: relative;
    cursor: pointer;
    transition: opacity 0.3s;
}

.profile-avatar-wrapper:hover {
    opacity: 0.8;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: block;
}

.user-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Profile Dropdown (Desktop) */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0; /* Open from right side since avatar is on left */
    width: 200px;
    min-width: 200px;
    max-width: calc(100vw - 2rem);
    background-color: #ffffff !important;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 4px 16px rgba(0, 0, 0, 0.08);
    z-index: 2000 !important;
    display: none;
    flex-direction: column;
    direction: rtl;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    opacity: 1 !important;
}

.profile-dropdown.open {
    display: flex;
}

.profile-dropdown-item {
    padding: 0.875rem 1.25rem;
    color: #333 !important;
    background-color: #ffffff !important;
    text-decoration: none;
    font-size: 0.9375rem;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    display: block;
    opacity: 1 !important;
    font-weight: 400;
}

.profile-dropdown-item:first-child {
    border-top: none;
}

.profile-dropdown-item:last-child {
    border-bottom: none;
}

.profile-dropdown-item:hover {
    background-color: #f8f9fa !important;
    color: #333 !important;
}

.profile-dropdown-item.active {
    background-color: #e6f7f5 !important;
    color: var(--primary) !important;
    font-weight: 600;
}

.profile-dropdown-logout {
    color: #e74c3c !important;
    background-color: #ffffff !important;
    font-weight: 600;
    opacity: 1 !important;
}

.profile-dropdown-logout:hover {
    background-color: #ffeaea !important;
    color: #e74c3c !important;
}

.profile-dropdown-divider {
    height: 1px;
    background-color: #e5e5e5;
    margin: 0.25rem 0;
}

/* Mobile Profile Avatar */
.user-avatar-mobile {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: block;
}

.user-avatar-placeholder-mobile {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.profile-avatar-wrapper-mobile {
    position: relative;
    cursor: pointer;
    transition: opacity 0.3s;
}

.profile-avatar-wrapper-mobile:hover {
    opacity: 0.8;
}

/* Mobile Profile Dropdown */
.profile-dropdown-mobile {
    position: fixed;
    top: auto;
    bottom: 80px;
    left: 1rem;
    right: 1rem;
    width: auto;
    max-width: 300px;
    background-color: #ffffff !important;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 2000 !important;
    display: none;
    flex-direction: column;
    direction: rtl;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.profile-dropdown-mobile.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.profile-dropdown-backdrop-mobile {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-dropdown-backdrop-mobile.active {
    display: block;
    opacity: 1;
}

/* Mobile styles */
@media (max-width: 768px) {
    .profile-container.desktop-only {
        display: none !important;
    }
    
    .profile-container.mobile-only {
        display: flex;
        align-items: center;
    }
    
    /* In mobile, topbar-profile should also push to left */
    .topbar-profile.mobile-only {
        /* Profile positioning handled by topbar-right */
    }
}

@media (min-width: 769px) {
    .profile-container.mobile-only {
        display: none !important;
    }
}

.notifications-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    text-align: center;
    color: #999;
    min-height: 120px;
}

.notifications-empty p {
    font-size: 0.875rem;
    margin: 0;
    color: #999;
}

.main-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Full width pages - for pages with tables */
.page-full-width {
    max-width: 100% !important;
    padding-left: 24px;
    padding-right: 24px;
}

body:has(.page-full-width) .main-content {
    max-width: 100% !important;
    width: 100%;
    padding-left: 24px;
    padding-right: 24px;
}

/* Leads page - full width */
.leads-container {
    width: 100%;
    max-width: none;
}

body:has(.leads-container) .main-content {
    max-width: none;
    width: 100%;
    padding: 2rem;
}

/* Mobile: Adjust main content padding */
@media (max-width: 768px) {
    /* Add padding-top to prevent content from being hidden under fixed mobile nav */
    .main-content,
    main {
        padding-top: 90px !important; /* Space for fixed mobile nav (two rows ~88px) */
    }
    
    .main-content {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-bottom: 1rem;
        margin: 1rem auto;
    }
}

/* Full width for follow-up page to prevent horizontal scroll */
body:has(.styled-table) .main-content {
    max-width: 100%;
    padding: 0 1rem;
}

.flash-messages {
    margin-bottom: 1rem;
}

.flash-message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.flash-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Login Page - Hide navbar */
body:has(.login-container) .navbar {
    display: none;
}

body:has(.login-container) .main-content {
    padding: 0;
    margin: 0;
    max-width: 100%;
}

/* Login Page */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8f8f5 100%);
}

/* Login logo */
.login-logo-wrapper {
    text-align: center;
    margin-bottom: 1.5rem;
    width: 100%;
    animation: fadeInDown 0.6s ease-out;
}

.login-logo {
    width: 140px;
    max-width: 160px;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

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

.login-header {
    text-align: center;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 500px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.login-title {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    font-size: 1rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
    font-weight: 400;
    text-align: center;
}

.login-subtitle-badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(64, 224, 208, 0.15), rgba(64, 224, 208, 0.25));
    color: var(--primary);
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid rgba(64, 224, 208, 0.3);
    box-shadow: 0 2px 8px rgba(64, 224, 208, 0.15);
    line-height: 1.4;
    transition: all 0.3s ease;
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease-out 0.4s both;
    transition: transform 0.3s ease;
}

.login-box.shake {
    animation: shake 0.6s ease-in-out;
}

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

.login-box-title {
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 600;
}

/* Login error message */
.login-error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
    border: 1px solid #f5c6cb;
}

/* Login error alert box */
.login-error-alert {
    background-color: #f8d7da;
    color: #721c24;
    padding: 0.875rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    border: 1px solid #f5c6cb;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.login-error-alert .alert-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.login-error-alert .alert-message {
    flex: 1;
    text-align: center;
}

/* Login success message */
.login-success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
    border: 1px solid #c3e6cb;
}

/* Password input wrapper */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input[type="password"],
.password-input-wrapper input[type="text"] {
    padding-right: 2.5rem;
}

.password-toggle {
    position: absolute;
    left: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.password-toggle:hover {
    opacity: 1;
}

.password-toggle:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.eye-icon {
    user-select: none;
    pointer-events: none;
}

.toggle-password svg {
    width: 18px;
    height: 18px;
    cursor: pointer;
    color: #64748b; /* אפור בוגר */
}

.toggle-password svg:hover {
    color: #0f766e; /* טורקיז מותג */
}

/* Login Header Card */
.login-header-card {
    max-width: 420px;
    margin: 40px auto 20px;
    background: #ffffff;
    padding: 24px 28px;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    text-align: center;
}

.login-logo-wrap {
    display: inline-block;
    padding: 14px 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    margin-bottom: 16px;
}

.login-header-card .login-logo {
    max-height: 60px;
    display: block;
}

.login-header-card h1 {
    margin: 0;
    font-size: 24px;
    color: #0f766e;
}

.login-header-card p {
    margin-top: 6px;
    font-size: 14px;
    color: #475569;
}

/* Forgot password link */
.forgot-password-link {
    display: block;
    text-align: left;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-password-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Login back link */
.login-back-link {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.login-back-link a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.login-back-link a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Form help text */
.form-help-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #666;
    text-align: right;
}

/* Password strength indicator */
.password-strength-indicator {
    display: block;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: right;
    transition: all 0.3s ease;
}

.password-strength-indicator.strength-weak {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.password-strength-indicator.strength-medium {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.password-strength-indicator.strength-strong {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.password-strength-indicator .strength-text {
    display: inline-block;
}

/* Password match indicator */
.password-match-indicator {
    display: block;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: right;
    transition: all 0.3s ease;
}

.password-match-indicator.match-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.password-match-indicator .match-text {
    display: inline-block;
}

/* Login submit button */
.login-submit-btn {
    width: 100%;
    position: relative;
    min-height: 44px;
    transition: all 0.3s ease;
}

.login-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loading-text {
    display: inline-block;
    margin-left: 0.5rem;
}

.btn-spinner {
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

/* Spinner for primary buttons */
.btn-primary .spinner {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
}

/* When button is disabled (submitting), spinner should be white on primary background */
.btn-primary:disabled .spinner {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Login footer */
.login-footer {
    text-align: center;
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.6s ease-out 0.6s both;
}

.login-footer-text {
    font-size: 0.875rem;
    color: #666;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.8;
}

.login-footer-text .lock-icon {
    font-size: 1rem;
    opacity: 0.7;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive login page */
@media (max-width: 768px) {
    .login-container {
        min-height: 100vh;
        padding: 1rem 0.75rem;
    }
    
    .login-logo {
        width: 120px;
        max-width: 140px;
    }
    
    .login-logo-wrapper {
        margin-bottom: 1.25rem;
    }
    
    .login-header {
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .login-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .login-subtitle {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .login-subtitle-badge {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .login-box {
        padding: 2rem 1.5rem;
        max-width: 100%;
    }
    
    .login-box-title {
        font-size: 1.3rem;
    }
    
    .login-footer-text {
        font-size: 0.8rem;
        line-height: 1.4;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 0.5rem;
    }
    
    .login-logo {
        width: 100px;
        max-width: 120px;
    }
    
    .login-logo-wrapper {
        margin-bottom: 1rem;
    }
    
    .login-title {
        font-size: 1.3rem;
    }
    
    .login-subtitle {
        font-size: 0.85rem;
    }
    
    .login-subtitle-badge {
        padding: 8px 12px;
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    .login-box {
        padding: 1.5rem 1rem;
    }
    
    .login-box-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .login-footer-text {
        font-size: 0.75rem;
    }
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(64, 224, 208, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group select {
    cursor: pointer;
}

/* Search Box */
.search-box {
    max-width: 300px;
    position: relative;
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(64, 224, 208, 0.1);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-on-primary);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
    color: white;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
    color: #212529;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-actions .btn {
    flex: 1;
}

.error-message {
    color: #721c24;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
    text-align: right;
    font-weight: 500;
}

/* Dashboard */
.dashboard-container h1 {
    margin-bottom: 2rem;
    color: #333;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h2 {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.stat-card .title {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.stat-card .value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
    line-height: 1.2;
}

/* Make stat-card clickable like kpi-card */
.stat-card.kpi-card-clickable {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card.kpi-card-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    background-color: #f8f9fa;
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary);
}

/* Clients and Leads Pages */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    color: #333;
}

.table-container {
    width: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* General table vertical alignment */
.table td,
.table th {
    vertical-align: middle;
}

.table-container table {
    width: 100%;
    max-width: 100%;
}

/* Leads table container - no horizontal scroll */
.leads-container .table-container {
    overflow-x: hidden;
    width: 100%;
    max-width: none;
}

/* Remove horizontal scroll for styled-table (follow-up page) */
.table-container:has(.styled-table) {
    overflow-x: hidden !important;
    width: 100%;
}

/* Fallback for browsers that don't support :has() - apply to all table-containers with styled-table */
.table-container .styled-table {
    width: 100%;
    max-width: 100%;
    table-layout: auto;
}

/* Desktop: no horizontal scroll for data-table only */
@media (min-width: 1024px) {
    /* data-table uses fixed layout, so no scroll needed */
    .data-table {
        table-layout: fixed;
    }
    
    .table-container .data-table {
        /* This will be overridden by the rule below for styled-table */
    }
    
    /* styled-table uses auto layout, allow scroll if needed */
    .styled-table {
        table-layout: auto;
    }
    
    .table-container .styled-table ~ * {
        /* Allow overflow for styled-table containers */
    }
}

.data-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background-color: var(--primary);
    color: var(--text-on-primary);
}

.data-table th,
.data-table td {
    padding: 8px 6px;
    text-align: right;
    border-bottom: 1px solid #eee;
}

/* Column widths for data-table */
.data-table th:nth-child(1),
.data-table td:nth-child(1) {
    /* שם מלא */
    max-width: 140px;
    width: 140px;
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    /* טלפון */
    max-width: 120px;
    width: 120px;
}

.data-table th:nth-child(3),
.data-table td:nth-child(3) {
    /* אימייל */
    max-width: 180px;
    width: 180px;
}

.data-table th:nth-child(4),
.data-table td:nth-child(4) {
    /* סטטוס */
    max-width: 120px;
    width: 120px;
}

.data-table th:nth-child(5),
.data-table td:nth-child(5) {
    /* ת. חזרה */
    max-width: 120px;
    width: 120px;
}

.data-table th:nth-child(6),
.data-table td:nth-child(6) {
    /* מקור */
    max-width: 120px;
    width: 120px;
}

.data-table th:nth-child(7),
.data-table td:nth-child(7) {
    /* תאריך יצירה */
    max-width: 120px;
    width: 120px;
}

/* Leads table - percentage-based column widths */
.leads-container .data-table {
    width: 100%;
    table-layout: fixed;
}

.leads-container .data-table th:nth-child(1),
.leads-container .data-table td:nth-child(1) {
    /* שם מלא */
    width: 15%;
    max-width: none;
}

.leads-container .data-table th:nth-child(2),
.leads-container .data-table td:nth-child(2) {
    /* טלפון */
    width: 12%;
    max-width: none;
}

.leads-container .data-table th:nth-child(3),
.leads-container .data-table td:nth-child(3) {
    /* אימייל */
    width: 22%;
    max-width: none;
}

.leads-container .data-table th:nth-child(4),
.leads-container .data-table td:nth-child(4) {
    /* סטטוס */
    width: 10%;
    max-width: none;
}

.leads-container .data-table th:nth-child(5),
.leads-container .data-table td:nth-child(5) {
    /* ת. חזרה */
    width: 13%;
    max-width: none;
}

.leads-container .data-table th:nth-child(6),
.leads-container .data-table td:nth-child(6) {
    /* מקור */
    width: 9%;
    max-width: none;
}

/* ===================================================================== */
/* Global Column Resize Handle Styles - Applied to all tables */
/* ===================================================================== */
.data-table th,
.styled-table th,
.treatments-table th,
table th {
    position: relative;
    user-select: none;
}

/* Disable resize handle for status column and no-resize columns */
.data-table th.status-col .resize-handle,
.styled-table th.status-col .resize-handle,
.treatments-table th.status-col .resize-handle,
table th.status-col .resize-handle,
.data-table th.no-resize .resize-handle,
.styled-table th.no-resize .resize-handle,
.treatments-table th.no-resize .resize-handle,
table th.no-resize .resize-handle {
    cursor: default;
    pointer-events: none;
    opacity: 0.3;
}

/* Resize handle styling */
.data-table th .resize-handle,
.styled-table th .resize-handle,
.treatments-table th .resize-handle,
table th .resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    background-color: transparent;
    z-index: 10;
    transition: background-color 0.2s;
}

.data-table th .resize-handle:hover,
.styled-table th .resize-handle:hover,
.treatments-table th .resize-handle:hover,
table th .resize-handle:hover {
    background-color: #007bff;
}

.data-table th .resize-handle.resizing,
.styled-table th .resize-handle.resizing,
.treatments-table th .resize-handle.resizing,
table th .resize-handle.resizing {
    background-color: #0056b3;
}

.data-table.resizing,
.styled-table.resizing,
.treatments-table.resizing,
table.resizing {
    user-select: none;
}

.leads-container .data-table th:nth-child(7),
.leads-container .data-table td:nth-child(7) {
    /* תאריך יצירה */
    width: 9%;
    max-width: none;
}

.leads-container .data-table th:nth-child(8),
.leads-container .data-table td:nth-child(8) {
    /* פעולות */
    width: 10%;
    max-width: none;
}

/* Text overflow handling */
.data-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Treatments Table - Custom Styling */
.treatments-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 14px;
}

.treatments-table thead {
    background-color: var(--primary);
    color: var(--text-on-primary);
}

.treatments-table th,
.treatments-table td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

/* Allow text overflow for specific columns */
.treatments-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* רוחבים ייעודיים לפי עמודות */
.treatments-table th:nth-child(1),
.treatments-table td:nth-child(1) { width: 40px; }   /* checkbox */

.treatments-table th:nth-child(2),
.treatments-table td:nth-child(2) { width: 100px; }  /* תאריך */

.treatments-table th:nth-child(3),
.treatments-table td:nth-child(3) { width: 160px; }  /* לקוח */

.treatments-table th:nth-child(4),
.treatments-table td:nth-child(4) { width: 140px; }  /* סוג טיפול (קטגוריה) */

.treatments-table th:nth-child(5),
.treatments-table td:nth-child(5) { width: 120px; }  /* סוג טיפול */

.treatments-table th:nth-child(6),
.treatments-table td:nth-child(6) { width: 120px; }  /* סוג פגישה */

.treatments-table th:nth-child(7),
.treatments-table td:nth-child(7) { width: 300px; }  /* תבנית תזכורת */

.treatments-table th:nth-child(8),
.treatments-table td:nth-child(8) { width: 100px; }  /* סטטוס */

.treatments-table th:nth-child(9),
.treatments-table td:nth-child(9) { width: 90px; }   /* משך */

.treatments-table th:nth-child(10),
.treatments-table td:nth-child(10) { width: 90px; }   /* מחיר */

.treatments-table th:nth-child(11),
.treatments-table td:nth-child(11) { width: 200px; }  /* פעולות */

.treatments-table th:nth-child(12),
.treatments-table td:nth-child(12) { 
    width: 70px;
    text-align: center;
}

.treatments-table tbody tr:hover {
    background-color: #f9f9f9;
}

/* Leads table - ensure proper spacing and no overlaps */
.leads-container .data-table td {
    padding: 8px 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leads-container .data-table th {
    padding: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Allow wrapping for specific cells that need it */
.data-table td .status-badge-container {
    white-space: normal;
    overflow: visible;
}

/* Phone cell should not be cut off */
.data-table td.phone-col,
.data-table td.phone-col .phone-cell {
    white-space: nowrap;
    overflow: visible;
}

.data-table tbody tr:hover {
    background-color: #f9f9f9;
}

/* Alias for styled-table */
.styled-table {
    width: 100%;
    max-width: 100%;
    table-layout: auto;
    border-collapse: collapse;
    font-size: 14px;
}

.styled-table thead {
    background-color: var(--primary);
    color: var(--text-on-primary);
}

.styled-table th,
.styled-table td {
    padding: 8px 10px;
    text-align: right;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

/* Minimum widths for critical columns in styled-table */
.styled-table th.name-col,
.styled-table td.name-col {
    min-width: 180px;
}

.styled-table th.phone-col,
.styled-table td.phone-col {
    min-width: 160px;
}

.styled-table th.email-col,
.styled-table td.email-col {
    min-width: 200px;
}

.styled-table th.status-col,
.styled-table td.status-col {
    min-width: 140px;
}

.styled-table th.actions-col,
.styled-table td.actions-col {
    min-width: 120px;
}

/* Text overflow handling - only for non-critical columns */
.styled-table td:not(.name-col):not(.phone-col):not(.email-col):not(.status-col):not(.actions-col) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Allow wrapping for specific cells that need it */
.styled-table td .status-badge-container {
    white-space: normal;
    overflow: visible;
}

/* Phone cell should not be cut off */
.styled-table td.phone-col,
.styled-table td.phone-col .phone-cell {
    white-space: nowrap;
    overflow: visible;
}

/* Name, email, status columns should not be cut off */
.styled-table td.name-col,
.styled-table td.email-col,
.styled-table td.status-col {
    white-space: nowrap;
    overflow: visible;
}

/* Actions column should never be cut off */
.styled-table td.actions-col {
    white-space: nowrap;
    overflow: visible;
    min-width: 120px;
}

.styled-table td.actions-col .btn {
    white-space: nowrap;
    flex-shrink: 0;
}

.styled-table tbody tr:hover {
    background-color: #f9f9f9;
}

/* Page title */
.page-title {
    color: #333;
    margin-bottom: 2rem;
    font-size: 2rem;
}

/* Status badges - Force white text everywhere */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-on-primary) !important;
    text-align: center;
    white-space: nowrap;
}

/* Ensure white text inside status badges, even in links or spans */
.status-badge,
.status-badge a,
.status-badge span,
.status-badge * {
    color: var(--text-on-primary) !important;
}

/* Override any default link colors in status badges */
.status-badge a:link,
.status-badge a:visited,
.status-badge a:hover,
.status-badge a:active {
    color: #ffffff !important;
    text-decoration: none;
}

.status-badge-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* עיצוב ייעודי לסטטוס "מספר שגוי" */
.status-badge.wrong-number {
    background-color: #6c757d !important; /* אפור כהה */
    color: #ffffff !important;
    cursor: default;
}

.status-badge.wrong-number,
.status-badge.wrong-number a,
.status-badge.wrong-number span {
    color: #ffffff !important;
}

.status-badge.wrong-number:hover {
    background-color: #6c757d !important; /* ללא שינוי ב-hover */
    opacity: 1;
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #ffffff !important;
    text-align: center;
    white-space: nowrap;
    margin-right: 0.5rem;
}

.badge,
.badge a,
.badge span {
    color: #ffffff !important;
}

.badge-primary {
    background-color: var(--primary);
    color: var(--text-on-primary) !important;
}

.badge-primary,
.badge-primary a,
.badge-primary span {
    color: #ffffff !important;
}

.badge.bg-warning {
    background-color: #ffc107;
}

.badge.bg-info {
    background-color: #17a2b8;
}

.badge.bg-success {
    background-color: #28a745;
}

.badge.bg-secondary {
    background-color: #6c757d;
}

.badge.bg-danger {
    background-color: #dc3545;
}

/* Popup */
.popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.popup-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.popup-close {
    position: absolute;
    left: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: #999;
    cursor: pointer;
}

.popup-close:hover {
    color: #333;
}

.popup-content h2 {
    margin-bottom: 1rem;
    color: var(--primary);
}

/* Help Modal Specific Styles */
.help-modal-content {
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.help-modal-content h2 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

/* Help Tabs Container */
.help-tabs-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.help-tabs-header {
    flex-shrink: 0;
    border-bottom: 2px solid #eee;
    background-color: #f9f9f9;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.help-tabs-header::-webkit-scrollbar {
    height: 4px;
}

.help-tabs-header::-webkit-scrollbar-track {
    background: transparent;
}

.help-tabs-header::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 2px;
}

.help-tab-button {
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}

.help-tab-button:hover {
    background-color: #f0f0f0;
    color: var(--primary-hover);
}

.help-tab-button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background-color: white;
    font-weight: 600;
}

.help-tabs-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
    text-align: right;
    direction: rtl;
}

.help-tab-pane {
    display: none;
}

.help-tab-pane.active {
    display: block;
}

.help-section {
    margin-bottom: 2rem;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h3 {
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.help-section p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

.help-section ul {
    list-style-type: none;
    padding-right: 0;
    margin: 0;
}

.help-section li {
    padding: 0.5rem 0;
    padding-right: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.help-section li:before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
    position: absolute;
    right: 0;
}

.help-section li strong {
    color: var(--primary);
    font-weight: 600;
}

/* Help Action Buttons */
.help-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.help-action-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #137d76;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    cursor: pointer;
    white-space: nowrap;
}

.help-action-btn:hover {
    background: #0fb9b1;
    text-decoration: none;
}

.help-action-btn:active {
    transform: scale(0.98);
}

/* Mobile adjustments for help modal */
@media (max-width: 768px) {
    .help-modal-content {
        max-width: 95%;
        padding: 1rem;
        margin: 2% auto;
        max-height: 90vh;
    }
    
    .help-modal-content h2 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .help-tab-button {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
    
    .help-tabs-content {
        padding: 1rem 0.75rem;
    }
    
    .help-section h3 {
        font-size: 1.1rem;
    }
    
    .help-section li {
        font-size: 0.95rem;
        padding-right: 1.25rem;
    }
    
    .help-actions {
        margin-top: 1.25rem;
        padding-top: 1.25rem;
        flex-direction: column;
    }
    
    .help-action-btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* Onboarding Modal Styles */
.onboarding-modal-content {
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.onboarding-header {
    padding: 2rem 2rem 1rem 2rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.onboarding-header h2 {
    margin: 0;
    color: var(--primary);
    font-size: 1.5rem;
}

.onboarding-step-indicator {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

.onboarding-step-indicator span {
    color: var(--primary);
    font-weight: 600;
    font-size: 1.25rem;
}

.onboarding-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    text-align: right;
    direction: rtl;
}

.onboarding-step {
    display: none;
}

.onboarding-step.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

.onboarding-step h3 {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.onboarding-step ul {
    list-style-type: none;
    padding-right: 0;
    margin: 0;
}

.onboarding-step li {
    padding: 0.75rem 0;
    padding-right: 1.5rem;
    position: relative;
    line-height: 1.8;
    font-size: 1rem;
    color: #333;
}

.onboarding-step li:before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
    font-size: 1.5rem;
    position: absolute;
    right: 0;
    top: 0.5rem;
}

.onboarding-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background-color: #f9f9f9;
}

.onboarding-footer-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.onboarding-btn-skip {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    text-decoration: underline;
}

.onboarding-btn-skip:hover {
    color: #333;
}

.btn-link {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.btn-link:hover {
    color: #333;
}

/* Mobile adjustments for onboarding modal */
@media (max-width: 768px) {
    .onboarding-modal-content {
        max-width: 95%;
        max-height: 90vh;
    }
    
    .onboarding-header {
        padding: 1.5rem 1rem 1rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .onboarding-header h2 {
        font-size: 1.25rem;
    }
    
    .onboarding-content {
        padding: 1.5rem 1rem;
    }
    
    .onboarding-step h3 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .onboarding-step li {
        font-size: 0.95rem;
        padding-right: 1.25rem;
    }
    
    .onboarding-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .onboarding-footer-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .onboarding-btn-back {
        width: 100%;
    }
    
    .onboarding-btn-next {
        flex: 1;
    }
}

/* Client Profile Page */
.client-profile-container {
    background-color: #f5f5f5;
}

/* Mobile: Adjust client profile container */
@media (max-width: 768px) {
    .client-profile-container {
        padding: 0;
    }
    
    .tabs-container {
        border-radius: 0;
        margin-top: 0;
    }
    
    .tabs-header {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--primary) transparent;
        flex-wrap: nowrap;
        padding: 0;
        border-bottom: 2px solid #eee;
    }
    
    .tabs-header::-webkit-scrollbar {
        height: 4px;
    }
    
    .tabs-header::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .tabs-header::-webkit-scrollbar-thumb {
        background-color: var(--primary);
        border-radius: 2px;
    }
    
    .tab-button {
        padding: 0.875rem 1.25rem;
        font-size: 0.875rem;
        white-space: nowrap;
        flex-shrink: 0;
        min-width: fit-content;
        border-bottom: 3px solid transparent;
    }
    
    .tab-button.active {
        border-bottom-color: var(--primary);
    }
    
    /* Compact tabs content on mobile */
    .tabs-content {
        padding: 1rem 0.75rem;
    }
    
    /* Buttons in tabs - full width and touch-friendly */
    .notes-header .btn,
    .tabs-content .btn {
        width: 100%;
        padding: 0.875rem 1.25rem;
        font-size: 0.9375rem;
        min-height: 44px;
        margin-bottom: 0.75rem;
    }
    
    /* Table containers in tabs - better mobile handling */
    .tabs-content .table-container {
        margin: 0 -0.75rem;
        border-radius: 0;
        overflow-x: auto;
    }
    
    .tabs-content .data-table {
        font-size: 0.875rem;
    }
    
    .tabs-content .data-table th,
    .tabs-content .data-table td {
        padding: 0.5rem 0.375rem;
    }
    
    /* Alternative: Dropdown selector for tabs (hidden by default, can be enabled) */
    .tabs-dropdown-selector {
        display: none;
        width: 100%;
        padding: 0.75rem;
        margin-bottom: 1rem;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 1rem;
        background-color: white;
    }
}

.profile-header {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
}

.profile-info-box {
    flex: 1;
    min-width: 300px;
}

.profile-info-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

/* Mobile: Stack profile info vertically */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .profile-info-box {
        width: 100%;
        min-width: 100%;
    }
    
    /* Remove grid layout, use vertical stack */
    .profile-info-row {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .profile-info-row:last-child {
        margin-bottom: 0;
    }
    
    .profile-info-item {
        width: 100%;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid #eee;
        display: flex;
        flex-direction: column;
    }
    
    .profile-info-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .profile-info-item label {
        display: block;
        margin-bottom: 0.375rem;
        font-weight: 600;
        color: #666;
        font-size: 0.875rem;
    }
    
    .profile-info-item span,
    .profile-info-item select {
        display: block;
        width: 100%;
        margin-top: 0;
        font-size: 0.9375rem;
    }
    
    /* Phone number and actions - align nicely */
    .profile-info-item #customerPhoneNumber {
        display: inline-block;
        margin-bottom: 0.5rem;
    }
    
    .profile-info-item .phone-actions {
        display: flex;
        gap: 0.75rem;
        margin-top: 0.5rem;
        margin-right: 0;
        align-items: center;
    }
    
    .phone-action-btn,
    .whatsapp-action-btn {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        text-decoration: none;
        transition: transform 0.2s ease;
    }
    
    .phone-action-btn:hover,
    .whatsapp-action-btn:hover {
        transform: scale(1.05);
    }
    
    /* Action buttons - full width and touch-friendly */
    .profile-actions {
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1rem;
    }
    
    .profile-actions .btn {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .profile-actions .btn-primary {
        background-color: var(--primary);
        color: var(--text-on-primary);
    }
    
    .profile-actions .btn-primary:hover {
        background-color: var(--primary-hover);
    }
}

.profile-info-row:last-child {
    margin-bottom: 0;
}

.profile-info-item {
    display: flex;
    flex-direction: column;
}

.profile-info-item label {
    font-weight: 600;
    color: #666;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.profile-info-item span {
    color: #333;
    font-size: 1rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    background-color: #e3f2fd;
    color: #ffffff !important;
    font-weight: 500;
}

/* Override any blue link colors in status badges */
.status-badge,
.status-badge a,
.status-badge span,
.status-badge * {
    color: #ffffff !important;
}

.profile-actions {
    display: flex;
    gap: 1rem;
}

/* Tabs */
.tabs-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.tabs-header {
    display: flex;
    border-bottom: 2px solid #eee;
    background-color: #f9f9f9;
}

.tab-button {
    padding: 1rem 2rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    font-family: inherit;
}

.tab-button:hover {
    background-color: #f0f0f0;
    color: var(--primary-hover);
}

.tab-button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background-color: white;
    font-weight: 600;
}

.tabs-content {
    padding: 2rem;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.tab-placeholder {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
    font-size: 1.1rem;
}

.tab-placeholder p {
    margin: 0;
}

/* Table links */
.data-table tbody tr {
    transition: background-color 0.2s;
}

.table-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.table-link:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

/* Name column links - unified styling across all tables */
.name-col a,
.styled-table .name-col a,
.data-table .name-col a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.name-col a:hover,
.styled-table .name-col a:hover,
.data-table .name-col a:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

/* Override any default link colors in name column */
.name-col a:link,
.name-col a:visited,
.name-col a:active,
.styled-table .name-col a:link,
.styled-table .name-col a:visited,
.styled-table .name-col a:active,
.data-table .name-col a:link,
.data-table .name-col a:visited,
.data-table .name-col a:active {
    color: var(--primary);
}

/* Status Select */
.status-select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
    min-width: 150px;
}

.status-select-inline {
    padding: 0.4rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
    cursor: pointer;
    min-width: 120px;
    width: 100%;
}

.status-select-inline:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Notes Tab */
.notes-header {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.notes-header .btn {
    width: auto;
}

/* Mobile: Full width buttons in notes header */
@media (max-width: 768px) {
    .notes-header {
        margin-bottom: 1rem;
        justify-content: stretch;
    }
    
    .notes-header .btn {
        width: 100%;
        min-height: 44px;
        padding: 0.875rem 1.25rem;
    }
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.notes-loading,
.notes-empty,
.notes-error {
    text-align: center;
    padding: 2rem;
    color: #999;
}

.notes-error {
    color: #721c24;
}

.note-item {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}

.note-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.note-text {
    color: #333;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.note-date {
    color: #666;
    font-size: 0.875rem;
    text-align: left;
}

/* Small buttons for table actions */
.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Preview Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 1200px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.modal-content .close {
    position: absolute;
    left: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    z-index: 2001;
}

.modal-content .close:hover {
    color: #333;
}

#previewContainer {
    margin-top: 2rem;
    text-align: center;
}

#previewContainer img,
#previewContainer iframe {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
}

/* Dashboard Styles */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.dashboard-loading {
    color: #666;
    font-size: 1.1rem;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.kpi-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
    text-decoration: none;
    color: inherit;
}

.kpi-card-clickable {
    cursor: pointer;
}

.kpi-card-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    background-color: #f8f9fa;
}

.kpi-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
    line-height: 1.2;
}

.dashboard-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary);
}

/* Tasks Styles */
.tasks-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Full width for containers when page-full-width is applied */
.page-full-width.tasks-container,
.page-full-width.clients-container,
.page-full-width.users-container,
.page-full-width.reminders-container {
    max-width: 100% !important;
    width: 100%;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.status-done {
    background-color: #28a745;
    color: #ffffff !important;
}

.status-done,
.status-done a,
.status-done span {
    color: #ffffff !important;
}

.status-open {
    background-color: var(--primary);
    color: var(--text-on-primary) !important;
}

.status-open,
.status-open a,
.status-open span {
    color: #ffffff !important;
}

.task-overdue {
    background-color: #ffe5e5;
}

.task-soon {
    background-color: #fff7cc;
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    width: calc(100% - 40px);
    pointer-events: none;
}

@media (max-width: 768px) {
    .toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }
    
    .toast {
        padding: 14px 18px;
        min-width: auto;
        border-radius: 10px;
    }
    
    .toast-icon {
        font-size: 18px;
    }
    
    .toast-message,
    .toast-content {
        font-size: 13px;
    }
}

.toast {
    background: white;
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 100%;
    pointer-events: auto;
    animation: slideInRight 0.3s ease-out;
    position: relative;
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    font-weight: 500;
}

/* Success Toast - Green background */
.toast.success {
    background: #22c55e;
    color: white;
}

/* Error Toast - Red background */
.toast.error {
    background: #ef4444;
    color: white;
}

/* Warning Toast - Orange background */
.toast.warning {
    background: #f59e0b;
    color: white;
}

/* Info Toast - Blue background */
.toast.info {
    background: #3b82f6;
    color: white;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
    color: white;
    font-weight: bold;
}

.toast-message,
.toast-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: white;
    word-wrap: break-word;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s, opacity 0.2s;
    opacity: 0.9;
}

.toast-close:hover {
    color: white;
    opacity: 1;
}

.toast.fade-out {
    opacity: 0;
    transform: translateX(100%);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Phone cell styling - unified across all pages */
.phone-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.phone-number {
    direction: ltr;
    flex-shrink: 0;
}

.phone-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
}

.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    border-radius: 50%;
    text-decoration: none;
    font-size: 14px;
    transition: transform 0.15s ease, opacity 0.15s ease;
    flex-shrink: 0;
}

.action-icon.phone {
    background: #3498db;
    color: #fff;
}

.action-icon.whatsapp {
    background: #25D366;
    color: #fff;
}

.action-icon:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

/* Phone column - prevent text overflow */
.data-table td.phone-col,
.styled-table td.phone-col {
    overflow: visible !important;
    max-width: 160px;
    min-width: 150px;
    white-space: nowrap;
}

.data-table td.phone-col *,
.styled-table td.phone-col * {
    text-overflow: clip;
}

/* Followup date input styling */
.followup-date-input {
    width: 120px !important;
    max-width: 120px;
    font-size: 13px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Ensure action buttons and icons stay inline */
.data-table td .btn,
.styled-table td .btn,
.data-table td .action-icon,
.styled-table td .action-icon {
    display: inline-block;
    white-space: nowrap;
    vertical-align: middle;
}

/* Responsive phone actions */
@media (max-width: 768px) {
    .action-icon {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .phone-actions {
        gap: 4px;
    }
    
    /* Mobile: allow horizontal scroll for tables */
    .table-container {
        overflow-x: auto;
    }
    
    /* Mobile: reset table layout to auto for better responsiveness */
    .data-table,
    .styled-table {
        table-layout: auto;
        min-width: 800px;
    }
    
    .data-table th,
    .data-table td,
    .styled-table th,
    .styled-table td {
        min-width: 100px;
        max-width: none;
        width: auto;
    }
    
    /* Mobile: Keep leads table fixed layout but allow scroll */
    .leads-container .table-container {
        overflow-x: auto;
    }
    
    .leads-container .data-table {
        table-layout: fixed;
        min-width: 100%;
    }
}

/* Alert System (Toast Notifications) */
#alert-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
    width: 100%;
    pointer-events: none;
    direction: rtl;
}

.alert-card {
    background-color: white;
    color: #333;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 300px;
    max-width: 400px;
    pointer-events: auto;
    animation: slideInLeft 0.3s ease-out;
    position: relative;
    overflow: hidden;
    border-right: 4px solid;
}

.alert-card::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: currentColor;
}

.alert-card.success {
    border-right-color: #28a745;
    background-color: #d4edda;
    color: #155724;
}

.alert-card.info {
    border-right-color: var(--primary);
    background-color: #d1ecf1;
    color: #0c5460;
}

.alert-card.warning {
    border-right-color: #ff9800;
    background-color: #fff3cd;
    color: #856404;
}

.alert-card.error {
    border-right-color: #dc3545;
    background-color: #f8d7da;
    color: #721c24;
}

.alert-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.alert-title {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.4;
    flex: 1;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
    flex-shrink: 0;
    line-height: 1;
    font-weight: bold;
}

.alert-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

.alert-message {
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
    color: inherit;
    opacity: 0.9;
}

.alert-card.fade-out {
    animation: slideOutLeft 0.3s ease-out forwards;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

/* RTL Support - Ensure proper alignment */
[dir="rtl"] #alert-container {
    left: 20px;
    right: auto;
}

[dir="ltr"] #alert-container {
    left: auto;
    right: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #alert-container {
        left: 10px;
        bottom: 10px;
        max-width: calc(100vw - 20px);
    }
    
    .alert-card {
        min-width: 280px;
        max-width: calc(100vw - 20px);
    }
}

/* Mobile Card Layout Styles */
.cards-container {
    display: none;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.card-item {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s, transform 0.2s;
}

.card-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
}

.card-title a {
    color: var(--primary);
    text-decoration: none;
}

.card-title a:hover {
    text-decoration: underline;
}

/* Mobile-only turquoise header for client cards */
@media (max-width: 768px) {
    /* Ensure card-item clips overflow for rounded corners when it has mobile-card-header */
    .card-item:has(.mobile-card-header) {
        overflow: hidden;
    }
    
    /* Remove card-header padding/margin when it contains mobile-card-header */
    .card-header:has(.mobile-card-header) {
        padding: 0;
        margin: 0;
        border-bottom: none;
        display: block;
    }
    
    /* Full-width turquoise header bar - extends to card edges */
    .mobile-card-header {
        background-color: var(--primary);
        color: white;
        padding: 12px 1.25rem;
        font-weight: 600;
        border-top-left-radius: 12px;
        border-top-right-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        flex-wrap: wrap;
        /* Negative margins extend header to card edges (card-item has 1.25rem padding) */
        margin: -1.25rem -1.25rem 1rem -1.25rem;
        box-sizing: border-box;
    }
    
    .mobile-card-header .card-title {
        color: white;
        font-weight: 600;
        margin: 0;
        flex: 1;
        font-size: 1.125rem;
    }
    
    .mobile-card-header .card-title a {
        color: white !important;
        text-decoration: none;
    }
    
    .mobile-card-header .card-title a:hover {
        color: white !important;
        text-decoration: underline;
        opacity: 0.9;
    }
    
    /* Ensure all child elements in mobile-card-header are white */
    .mobile-card-header * {
        color: white !important;
    }
    
    /* Status badges in mobile-card-header should have white text */
    .mobile-card-header .status-badge {
        color: white !important;
        background-color: rgba(255, 255, 255, 0.2) !important;
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    /* Spans and other text elements */
    .mobile-card-header > span {
        color: white;
        font-size: 0.875rem;
    }
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.card-label {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
    min-width: 80px;
}

.card-value {
    font-size: 0.9375rem;
    color: #333;
    flex: 1;
    text-align: right;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.card-actions .btn {
    flex: 1;
    min-width: 100px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.card-phone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.card-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Hide tables on mobile, show cards */
/* Mobile: Hide tables and show cards - ONLY for pages with class 'has-mobile-cards' */
/* This applies to: clients/list, tasks/list, leads/list, treatments */
/* Pages WITHOUT this class (packages, profile tabs) will show tables normally on mobile */
@media (max-width: 768px) {
    /* Hide table-container on mobile for pages that have mobile cards */
    .has-mobile-cards .table-container,
    .treatments-page .desktop-only {
        display: none !important;
    }
    
    /* Show cards-container on mobile for pages that have mobile cards */
    .has-mobile-cards .cards-container,
    .treatments-page .mobile-only {
        display: flex !important;
    }
    
    /* Hide desktop tables and show mobile cards for packages, notes, and files */
    .desktop-table {
        display: none !important;
    }
    
    .mobile-cards {
        display: flex !important;
        flex-direction: column;
        gap: 1rem;
        margin-top: 1rem;
    }
}

/* Desktop: Show tables and hide cards - ONLY for pages with class 'has-mobile-cards' */
@media (min-width: 769px) {
    /* Show table-container on desktop */
    .has-mobile-cards .table-container,
    .treatments-page .desktop-only {
        display: block !important;
    }
    
    /* Hide cards-container on desktop */
    .has-mobile-cards .cards-container,
    .treatments-page .mobile-only {
        display: none !important;
    }
    
    /* Show desktop tables and hide mobile cards */
    .desktop-table {
        display: block !important;
    }
    
    .mobile-cards {
        display: none !important;
    }
}

/* Task card specific styles */
.task-card {
    position: relative;
}

.task-card-overdue {
    border-right: 4px solid #dc3545;
}

.task-card-soon {
    border-right: 4px solid #ffc107;
}

.task-card input[type="checkbox"] {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 20px;
    height: 20px;
    z-index: 1;
}

.task-card-content {
    padding-right: 2rem;
}

/* Continuation/Follow-up card specific */
.followup-card .card-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.followup-card .card-value {
    width: 100%;
}

/* =========================
   Help Page Layout
========================= */

.help-page-container {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.help-sidebar {
    width: 260px;
    background: #f4f8f8;
    border-radius: 12px;
    padding: 1.5rem 1rem;
    height: fit-content;
    position: sticky;
    top: 90px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.help-sidebar h3 {
    margin-bottom: 1rem;
    color: #137d76;
    font-size: 1.1rem;
}

.help-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-sidebar li {
    margin-bottom: 0.5rem;
}

.help-sidebar a {
    text-decoration: none;
    color: #333;
    padding: 0.4rem 0.6rem;
    display: block;
    border-radius: 6px;
    transition: background 0.2s;
}

.help-sidebar a:hover {
    background: #e0f2f1;
    color: #137d76;
}

.help-sidebar a.active {
    background: #137d76;
    color: #ffffff;
    font-weight: bold;
}

/* Content */

.help-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.help-content section {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.help-header {
    margin-bottom: 1.5rem;
}

.help-header h2 {
    margin: 0;
    color: #137d76;
    font-size: 1.6rem;
}

.help-breadcrumb {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 0.3rem;
}

.help-breadcrumb a {
    color: #137d76;
    text-decoration: none;
}

.help-breadcrumb a:hover {
    text-decoration: underline;
}

.help-breadcrumb span {
    margin: 0 0.25rem;
}

.help-search {
    position: relative;
    max-width: 360px;
    margin-bottom: 1rem;
}

.help-search input {
    width: 100%;
    max-width: 360px;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 0.9rem;
}

.help-search input:focus {
    outline: none;
    border-color: #137d76;
    box-shadow: 0 0 0 2px rgba(19,125,118,0.15);
}

.help-search-results {
    position: absolute;
    top: 110%;
    right: 0;
    left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 10;
    display: none;
    max-height: 260px;
    overflow-y: auto;
}

.help-search-results a {
    display: block;
    padding: 0.6rem 0.8rem;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.help-search-results a:hover {
    background: #e0f2f1;
    color: #137d76;
}

mark {
    background: #ffeb3b;
    padding: 0 2px;
    border-radius: 3px;
}

.help-content h3 {
    color: #137d76;
    margin-bottom: 1rem;
}

.help-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.help-content p {
    line-height: 1.6;
    color: #444;
}

.help-content section > *:first-child {
    margin-top: 0;
}

.help-content section p {
    margin-bottom: 0.8rem;
}

/* CTA buttons inside help */

.help-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.help-action-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #137d76;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
}

.help-action-btn:hover {
    background: #0fb9b1;
}

/* Mobile */

@media (max-width: 900px) {
    .help-page-container {
        flex-direction: column;
    }

    .help-sidebar {
        width: 100%;
        position: static;
    }
}

/* Topbar Icon Styling - Unified for all icons */
.topbar-icon {
    color: #ffffff;
    opacity: 0.85;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar-icon:hover {
    opacity: 1;
    color: #e0f2f1;
}

.topbar-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* Help Icon Styling */
.topbar-icon.help-icon {
    color: #ffffff;
    opacity: 0.85;
}

.topbar-icon.help-icon:hover {
    opacity: 1;
    color: #e0f2f1;
}

/* Profile field editable styles */
.field-value.editable {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.edit-icon {
    cursor: pointer;
    color: #888;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease;
}

.edit-icon:hover {
    color: #137d76;
}

.edit-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* Profile inline edit styles */
.profile-edit-input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    flex: 1;
}

.profile-edit-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(15, 127, 122, 0.1);
}

.field-value .save-btn,
.field-value .cancel-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.field-value .save-btn {
    background-color: var(--primary);
    color: white;
}

.field-value .save-btn:hover {
    background-color: var(--primary-hover);
}

.field-value .cancel-btn {
    background-color: #6c757d;
    color: white;
}

.field-value .cancel-btn:hover {
    background-color: #5a6268;
}

/* Profile success message */
.profile-success-msg {
    background: #e6f7f1;
    color: #137d76;
    border: 1px solid #b6e6d8;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Profile security section */
.profile-security {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-security h4 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

/* Password change modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    width: 320px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-content h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.2rem;
}

.modal-input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
}

.modal-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(15, 127, 122, 0.1);
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.modal-actions .btn {
    flex: 1;
}

/* Action icons */
.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #137d76;
    opacity: 0.85;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.action-icon:hover {
    opacity: 1;
    color: #0fb9b1;
}

.action-icon svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 768px) {
    .action-icon,
    .topbar-icon {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    .action-icon svg,
    .topbar-icon svg {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 18px;
        height: 18px;
    }
}

/* Subscription Page Styles */
.subscription-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    padding: 2rem;
    margin-bottom: 2rem;
}

.subscription-card {
    margin-bottom: 2rem;
}

/* Subscription Header - consistent across all sections */
.subscription-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.subscription-header .section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.subscription-header .section-title {
    margin: 0;
    flex: 1;
}

/* 1. מצב מנוי נוכחי */
.subscription-plan-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.subscription-plan-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.subscription-plan-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    width: fit-content;
}

.subscription-plan-text {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

.subscription-plan-actions {
    margin-top: 0.5rem;
}

/* 2. סטטיסטיקות - כרטיסים אחידים בלי צבעים צעקניים */
.subscription-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.subscription-stat-card {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid var(--primary);
}

.subscription-stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.subscription-stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: #333;
}

.subscription-stat-value-small {
    font-size: 1.5rem;
}

/* 3. אמצעי תשלום - שורה נקייה */
.subscription-payment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.subscription-payment-details {
    flex: 1;
    min-width: 250px;
    color: #333;
    font-size: 1rem;
}

.subscription-payment-expiry {
    display: block;
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

/* 4. היסטוריית חיובים - טבלה רגילה */
.subscription-billing-empty {
    text-align: center;
    padding: 2rem;
}

/* Status colors - using brand colors where appropriate */
.subscription-status-paid {
    color: var(--primary);
    font-weight: 600;
}

.subscription-status-failed {
    color: #dc3545;
    font-weight: 600;
}

.subscription-status-pending {
    color: #666;
    font-weight: 600;
}

.subscription-status-default {
    color: #666;
}

.subscription-link-primary {
    color: var(--primary);
    text-decoration: none;
}

.subscription-link-primary:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Table alignment utilities */
.subscription-table-text-left {
    text-align: left;
}

.subscription-table-text-center {
    text-align: center;
}

/* ============================================
   GLOBAL SPACING FIXES - Reduce excessive top spacing
   ============================================ */

/* 1. Reduce top padding of main content wrapper */
.main-content,
.content-wrapper,
.page-container,
.container-fluid {
    padding-top: 8px !important;
    margin-top: 0 !important;
}

/* Override mobile padding-top (reduce but keep some space for mobile nav) */
@media (max-width: 768px) {
    .main-content,
    main {
        padding-top: 20px !important;
    }
}

/* 2. Normalize page titles (h1) */
.page-header,
h1.page-title,
.page-title,
.page-header h1 {
    margin-top: 0 !important;
    margin-bottom: 8px !important;
}

/* 3. Tighten spacing between filters and table */
.table-filters,
.filters-row,
.filters-bar,
.filters {
    margin-bottom: 6px !important;
}

/* 4. Remove extra spacing before tables */
table,
.table-wrapper,
.table-responsive,
.table-container {
    margin-top: 0 !important;
}

/* ============================================
   COMPACT TABLE HEADER AND FILTERS LAYOUT
   ============================================ */

/* Compact header container wrapping title + buttons + filters */
.table-header-compact {
    margin-top: 8px;
    margin-bottom: 12px;
}

.table-header-compact h1,
.table-header-compact h2 {
    margin-bottom: 6px;
}

/* Compact filters row */
.table-filters {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

/* Limit search input width globally */
.table-filters input[type="search"],
.table-filters input[type="text"],
.table-search-input,
.table-filters .filter-input {
    max-width: 260px;
    width: 260px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.table-search-input:focus,
.table-filters .filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(64, 224, 208, 0.1);
}

/* Limit select dropdown width */
.table-filters select,
.filter-select {
    max-width: 180px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
}

/* Table counter styling */
.table-counter {
    color: #666;
    font-size: 0.95rem;
    white-space: nowrap;
    margin: 0;
}

/* Remove any min-height or large margins above tables */
.table-view-wrapper,
.table-container {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Mobile responsive styles for compact table header */
@media (max-width: 768px) {
    .table-filters {
        padding: 8px;
        gap: 8px;
    }
    
    .table-filters input[type="search"],
    .table-filters input[type="text"],
    .table-search-input,
    .table-filters .filter-input {
        min-width: 100%;
        width: 100%;
        max-width: 100%;
        flex: 1 1 100%;
    }
    
    .table-filters select,
    .filter-select {
        min-width: calc(50% - 4px);
        flex: 1 1 calc(50% - 4px);
        max-width: calc(50% - 4px);
    }
}

@media (max-width: 480px) {
    .table-filters select,
    .filter-select {
        min-width: 100%;
        flex: 1 1 100%;
        max-width: 100%;
    }
}

