/* Font Import */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700&display=swap');

/* Base Styles */
:root {
    --primary: #4747FF;
    --background: #F6F8FC;
    --card-bg: #FFFFFF;
    --text-primary: #1A1A1A;
    --text-secondary: #6B6B6B;
    --border-color: #E5E7EB;
    --hover-bg: #F3F4F6;
    --sidebar-bg: #0A0F2C;
    --sidebar-hover: #1A1F3F;
    --success: #28C76F;
    --warning: #FF9F43;
    --danger: #EA5455;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 12px rgba(71, 71, 255, 0.1);
}

/* Typography */
body {
    margin: 0;
    padding: 0;
    font-family: 'Rubik', sans-serif;
    background: var(--background);
    min-height: 100vh;
    direction: rtl;
}

/* Layout Structure */
.dashboard-container {
    display: grid;
    grid-template-columns: 1fr 240px;
    min-height: 100vh;
    background: var(--background);
}

/* Sidebar Styling */
.sidebar {
    background: var(--sidebar-bg);
    width: 240px;
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    z-index: 100;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.1);
}

/* Main Content Area */
.main-content {
    margin-right: 240px;
    padding: 32px;
    min-height: 100vh;
    box-sizing: border-box;
}

/* Navigation Brand */
.nav-brand {
    padding: 0 24px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 20px;
    font-weight: 600;
}

.nav-brand i {
    font-size: 24px;
}

/* Navigation Section */
.nav-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px;
}

.nav-section-title {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 16px;
    margin-bottom: 8px;
}

/* Navigation Links */
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
    text-decoration: none;
    position: relative;
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: white;
}

.nav-link.active {
    background: var(--primary);
    color: white;
}

/* Main Content Layout */
.main-content {
    margin-right: 240px;
    padding: 32px;
    min-height: 100vh;
    box-sizing: border-box;
    background: var(--background);
}

/* Responsive Navigation */
@media (max-width: 992px) {
    .dashboard-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        width: 100%;
        height: 60px;
        position: fixed;
        bottom: 0;
        top: auto;
        padding: 0;
        flex-direction: row;
        justify-content: center;
        align-items: center;
    }

    .nav-brand {
        display: none;
    }

    .nav-section {
        flex-direction: row;
        padding: 8px;
        gap: 16px;
        justify-content: center;
    }

    .nav-section-title {
        display: none;
    }

    .nav-link {
        padding: 8px;
        width: auto;
        justify-content: center;
    }

    .nav-link span {
        display: none;
    }

    .main-content {
        margin-right: 0;
        padding: 24px;
        padding-bottom: 80px;
    }
}

/* Fix RTL Specific Issues */
.nav-link {
    text-align: right;
}

.nav-link i {
    margin-left: 12px;
    margin-right: 0;
}

/* Active Link Indicator */
.nav-link.active::before {
    content: '';
    position: absolute;
    right: 0;
    width: 4px;
    height: 24px;
    background: white;
    border-radius: 0 4px 4px 0;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.stat-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-info {
    flex-grow: 1;
}

/* Dashboard Content Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

/* Table Styling */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.status-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.status-table th {
    background: var(--background);
    padding: 12px 16px;
    text-align: right;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

.status-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

/* Status Badges */
.status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.status-badge::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Header Section */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 20px 32px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 32px;
    position: relative;
}

/* Header Content (Right Side) */
.header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Top Actions (Left Side) */
.top-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    position: absolute;
    left: 32px; /* Position from the left */
}

/* New Lead Button */
.new-lead-btn {
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.new-lead-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(71, 71, 255, 0.2);
}

.new-lead-btn i {
    font-size: 16px;
}

/* Notifications Button */
.notifications-btn {
    background: var(--background);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
    cursor: pointer;
}

.notifications-btn:hover {
    background: var(--hover-bg);
}

.notifications-btn .badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: white;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* Activity List */
.activity-list {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 16px;
}

.activity-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

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

/* Typography */
body {
    font-family: 'Rubik', sans-serif;
    line-height: 1.5;
}

.welcome-text {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-top: 4px;
}

/* Utility Classes */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Fix RTL Specific Issues */
.nav-link,
.stat-card,
.status-table th,
.status-table td,
.activity-item {
    text-align: right;
}

/* Additional Utility Classes */
.shadow-hover {
    transition: all 0.2s ease;
}

.shadow-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Additional Navigation Styles */
.nav-section-title {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 16px;
    margin-top: 24px;
    margin-bottom: 8px;
}

.nav-link i,
.nav-link svg {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fix RTL Specific Issues */
.nav-link {
    text-align: right;
}

.nav-link i,
.nav-link svg {
    margin-left: 12px;
    margin-right: 0;
}

/* Active Link Indicator */
.nav-link.active::after {
    content: '';
    position: absolute;
    right: -16px;
    width: 3px;
    height: 20px;
    background: white;
    border-radius: 3px;
}

/* Table Styling */
.transactions-table {
    width: 100%;
    background: var(--card-bg);
    border-radius: 16px;
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: var(--shadow-sm);
    margin: 24px 0;
    overflow: hidden;
}

.transactions-table thead {
    background: var(--background);
}

.transactions-table th {
    padding: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.transactions-table td {
    padding: 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
}

.transactions-table tr:last-child td {
    border-bottom: none;
}

.transactions-table tbody tr:hover {
    background: var(--hover-bg);
}

/* Status Select Styling */
.status-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 140px;
}

.status-select:hover {
    border-color: var(--primary);
}

.status-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(71, 71, 255, 0.1);
}

/* Action Buttons */
.update-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    background: rgba(71, 71, 255, 0.1);
    transition: all 0.2s ease;
    text-decoration: none;
}

.update-btn:hover {
    background: rgba(71, 71, 255, 0.15);
    transform: translateY(-1px);
}

.update-btn i {
    font-size: 14px;
}

/* Phone Link Styling */
.transactions-table td a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.transactions-table td a:hover {
    text-decoration: underline;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    background: var(--card-bg);
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

/* Success/Error Messages */
.success, .error {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.success {
    background: rgba(40, 199, 111, 0.1);
    color: var(--success);
}

.error {
    background: rgba(234, 84, 85, 0.1);
    color: var(--danger);
}

/* Status Colors */
.status-select option[value="new"] {
    color: var(--primary);
}

.status-select option[value="in_progress"] {
    color: var(--warning);
}

.status-select option[value="closed_success"] {
    color: var(--success);
}

.status-select option[value="closed_fail"] {
    color: var(--danger);
}

/* Responsive Table */
@media (max-width: 992px) {
    .transactions-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .transactions-table th,
    .transactions-table td {
        white-space: nowrap;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 15px;
    margin: 0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 16px;
    }

    .top-actions {
        position: relative;
        left: 0;
        width: 100%;
        justify-content: flex-start;
        margin-top: 16px;
    }

    .new-lead-btn {
        padding: 10px 16px;
    }
}

/* Notifications Dropdown */
.notifications-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 32px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 400px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    border: 1px solid var(--border-color);
}

.notifications-dropdown.show {
    display: block;
}

.notifications-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notifications-header h3 {
    margin: 0;
    font-size: 16px;
}

.notification-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: background 0.2s ease;
}

.notification-item:hover {
    background: var(--hover-bg);
}

.notification-item.unread {
    background: var(--background);
}

.notification-content {
    flex: 1;
}

.notification-message {
    margin-bottom: 4px;
    font-size: 14px;
}

.notification-time {
    color: var(--text-secondary);
    font-size: 12px;
}

.mark-read-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.mark-read-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.view-all {
    color: var(--primary);
    font-size: 14px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.view-all:hover {
    opacity: 0.8;
}

.empty-state {
    color: var(--text-secondary);
    text-align: center;
    padding: 24px 16px;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
    font-size: 15px;
}

/* Card Container */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

/* Logout Button */
.logout-btn {
    background: var(--background);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-right: 8px;
}

.logout-btn:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.logout-btn i {
    font-size: 18px;
}

/* Summary Cards & Stat Icons */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.summary-cards .card {
    padding: 24px;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: var(--border-radius-lg);
    background-color: white;
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    margin: 0 auto 16px auto;
}

/* Specific icon styles */
.stat-icon.balance {
    background-color: #EEF2FF;
}

.stat-icon.balance i {
    color: var(--primary);
}

.stat-icon.credit {
    background-color: #ECFDF5;
}

.stat-icon.credit i {
    color: #059669;
}

.stat-icon.debit {
    background-color: #FEF2F2;
}

.stat-icon.debit i {
    color: #DC2626;
}

.stat-icon i {
    font-size: 20px;
}

.amount {
    font-size: 28px;
    font-weight: 700;
    margin: 16px 0;
}

.amount.credit {
    color: #059669;
}

.amount.debit {
    color: #DC2626;
}

/* Comment Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

textarea.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s ease;
}

textarea.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.2);
}

.btn-primary i {
    font-size: 16px;
}

/* Comment Cell Styles */
.comment-cell {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.comment-input {
    flex: 1;
    min-width: 200px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    resize: vertical;
    min-height: 36px;
    transition: border-color 0.2s ease;
}

.comment-input:focus {
    outline: none;
    border-color: var(--primary);
}

.save-comment-btn {
    padding: 8px;
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: white;
    color: #444;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.save-comment-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.save-comment-btn i {
    font-size: 20px;
    display: block;
}

/* Tooltip for save button */
.save-comment-btn {
    position: relative;
}

.save-comment-btn::after {
    content: 'שמור הערה';
    position: absolute;
    bottom: 100%;
    right: 50%;
    transform: translateX(50%);
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.save-comment-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Adjust table styles */
.transactions-table td {
    vertical-align: top;
    padding: 12px;
}

/* Comment Cell in Leads Table */
.leads-table .comment-cell {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    min-width: 200px;
}

.leads-table .comment-input {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    resize: vertical;
    min-height: 36px;
    transition: all 0.2s ease;
}

.leads-table .comment-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.1);
}

.leads-table .save-comment-btn {
    padding: 8px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    width: 36px;
}

.leads-table .save-comment-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.2);
}

.leads-table .save-comment-btn.success {
    background: var(--success);
}

.leads-table .save-comment-btn i {
    font-size: 14px;
}

/* Adjust table cell padding */
.leads-table td {
    padding: 12px;
    vertical-align: top;
}

/* Make sure the status select and comment area align nicely */
.leads-table .status-select,
.leads-table .comment-input {
    margin: 0;
}

/* Leads Table Styles */
.leads-table {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin: 24px 0;
}

.leads-table table {
    width: 100%;
    border-collapse: collapse;
}

.leads-table th {
    background: var(--background);
    padding: 16px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    font-size: 14px;
    white-space: nowrap;
}

.leads-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.leads-table tr:last-child td {
    border-bottom: none;
}

/* Comment Cell Styles */
.comment-cell {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    min-width: 250px;
}

.comment-input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 42px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.comment-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.comment-input::placeholder {
    color: var(--text-secondary);
}

.save-comment-btn {
    padding: 8px;
    width: 42px;
    height: 42px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.save-comment-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.2);
}

.save-comment-btn:active {
    transform: translateY(0);
}

.save-comment-btn.success {
    background: var(--success);
}

.save-comment-btn i {
    font-size: 16px;
}

/* Status Select Styles */
.status-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* Existing Comment Styles */
.existing-comment {
    min-width: 150px;
    max-width: 250px;
}

.comment-text {
    font-size: 13px;
    line-height: 1.5;
    padding: 8px 12px;
    background: var(--background);
    border-radius: 8px;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

.sale-comment {
    background: var(--primary-light);
    border-right: 3px solid var(--primary);
}

.no-comment {
    color: var(--text-secondary);
    font-size: 13px;
    font-style: italic;
}

/* Table Header Styles */
.leads-table th {
    font-size: 14px;
    font-weight: 600;
    padding: 12px;
    text-align: right;
    background: var(--background);
    position: sticky;
    top: 0;
    z-index: 1;
}

/* כשהכפתור במצב טעינה */
.save-comment-btn.loading i {
    animation: spin 1s linear infinite;
}

/* כשהשמירה הצליחה */
.save-comment-btn.success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

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

/* Login Page Styles */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e9f2 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-box {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    font-size: 32px;
    color: var(--primary);
    margin: 0 0 8px 0;
}

.login-header p {
    color: var(--text-secondary);
    margin: 0;
}

.login-form .form-group {
    margin-bottom: 24px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
}

.login-form label i {
    margin-left: 8px;
    color: var(--primary);
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e4e9f2;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
}

.login-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
    outline: none;
}

.password-input-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

.toggle-password:hover {
    color: var(--primary);
}

.login-button {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.2);
}

.login-button:active {
    transform: translateY(0);
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-error {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .login-box {
        padding: 24px;
    }
    
    .login-header h1 {
        font-size: 28px;
    }
}

/* Create Lead Form Styles */
.create-lead-form {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    padding: 32px;
    max-width: 800px;
    margin: 24px auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 24px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.page-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.page-header .subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group label i {
    color: var(--primary);
    font-size: 16px;
    width: 20px;
}

.form-group .required {
    color: var(--danger);
    margin-right: 4px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: var(--background);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
    outline: none;
    background: white;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 44px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.2);
}

.btn-secondary {
    background: var(--background);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--hover-bg);
}

.alert {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.alert i {
    font-size: 18px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .create-lead-form {
        padding: 24px;
        margin: 16px;
    }
    
    .page-header {
        padding: 16px;
        margin: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* View Details Button Styles */
.stat-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    margin-top: 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    background: var(--primary-light);
    text-decoration: none;
    transition: all 0.2s ease;
}

.stat-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.2);
}

.stat-link:active {
    transform: translateY(0);
}

.stat-link i {
    font-size: 14px;
}

/* עדכון הכרטיסייה כדי לתמוך בכפתור החדש */
.stat-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-info {
    flex-grow: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stat-link {
        width: 100%;
        justify-content: center;
    }
}

/* Notes Section Styles */
.comment-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notes-actions {
    display: flex;
    gap: 8px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-btn {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    background: none;
}

.note-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.note-text {
    white-space: pre-wrap;
}

.empty-notes {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

/* Reminder Modal Styles */
.reminder-modal .modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: none;
    max-width: 500px;
    margin: 2rem auto;
}

.reminder-modal .modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.reminder-modal .modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.reminder-modal .modal-body {
    padding: 1.5rem;
}

.reminder-modal .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.reminder-modal .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: var(--background);
}

.reminder-modal .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(71, 71, 255, 0.1);
    outline: none;
    background: white;
}

.reminder-modal textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.reminder-modal .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    background-color: var(--background);
    cursor: pointer;
    transition: all 0.2s ease;
}

.reminder-modal .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(71, 71, 255, 0.1);
    outline: none;
    background: white;
}

.reminder-modal .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.reminder-modal .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.reminder-modal .btn-secondary {
    background: var(--background);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.reminder-modal .btn-secondary:hover {
    background: var(--hover-bg);
}

.reminder-modal .btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

.reminder-modal .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(71, 71, 255, 0.2);
}

.reminder-modal .btn-primary:active {
    transform: translateY(0);
}

/* RTL Specific Adjustments */
.reminder-modal .modal-header .btn-close {
    margin: -0.5rem auto -0.5rem -0.5rem;
}

.reminder-modal .form-select {
    background-position: left 0.75rem center;
}

/* Responsive Adjustments */
@media (max-width: 576px) {
    .reminder-modal .modal-content {
        margin: 1rem;
    }
    
    .reminder-modal .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .reminder-modal .btn {
        width: 100%;
    }
}
