.cvc-my-patients-wrapper {
    font-family: inherit;
    direction: rtl;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.cvc-my-patients-toolbar {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.cvc-my-patients-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.cvc-my-patients-search-wrap .eicon-search {
    position: absolute;
    right: 12px;
    color: #999;
    pointer-events: none;
}

.cvc-my-patients-search {
    width: 100%;
    padding: 10px 40px 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    direction: rtl;
}

.cvc-my-patients-search:focus {
    outline: none;
    border-color: var(--e-global-color-primary, #4054b2);
    box-shadow: 0 0 0 2px rgba(64, 84, 178, 0.15);
}

.cvc-my-patients-loading {
    padding: 40px;
    text-align: center;
    color: #888;
}

.cvc-my-patients-loading::after {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
    border: 2px solid #ddd;
    border-top-color: var(--e-global-color-primary, #4054b2);
    border-radius: 50%;
    animation: cvc-my-patients-spin 0.7s linear infinite;
}

@keyframes cvc-my-patients-spin {
    to { transform: rotate(360deg); }
}

.cvc-patients-table {
    width: 100%;
}

.cvc-patients-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1.5fr 1.2fr;
    padding: 15px 20px;
    font-weight: bold;
    color: #555;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.cvc-patients-row {
    display: grid;
    grid-template-columns: 3fr 1fr 1.5fr 1.2fr;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s;
}

.cvc-patients-row:hover {
    background: #fafbff;
}

.cvc-patients-row .col-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cvc-patient-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #eee;
}

.cvc-patient-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
}

.cvc-patient-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.cvc-patient-meta .name {
    font-weight: 600;
}

.cvc-patient-meta .phone {
    font-size: 12px;
    color: #888;
}

.cvc-patient-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    width: fit-content;
    margin-top: 2px;
}

.cvc-patient-badge.registered {
    background: #e8f5e9;
    color: #2e7d32;
}

.cvc-patient-badge.guest {
    background: #fff3e0;
    color: #ef6c00;
}

.cvc-patients-row .col-visits {
    text-align: center;
}

.cvc-patients-row .col-visits .count {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--e-global-color-primary, #4054b2);
}

.cvc-patients-row .col-visits .label {
    font-size: 11px;
    color: #999;
}

.cvc-patients-row .col-last {
    color: #555;
}

.cvc-btn-view {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.cvc-btn-view:hover {
    background: #f8f9fa;
    border-color: #bbb;
    color: #333;
}

.cvc-no-data {
    padding: 40px;
    text-align: center;
    color: #888;
}

.cvc-alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin: 10px 0;
}

.cvc-alert-warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

/* Pagination (shared with appointments) */
.cvc-my-patients-wrapper .cvc-pagination {
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.cvc-my-patients-wrapper .cvc-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #555;
    text-decoration: none;
    transition: all 0.2s;
}

.cvc-my-patients-wrapper .cvc-pagination .page-numbers.current,
.cvc-my-patients-wrapper .cvc-pagination .page-numbers:hover {
    background: var(--e-global-color-primary, #4054b2);
    color: #fff;
    border-color: var(--e-global-color-primary, #4054b2);
}

.cvc-my-patients-wrapper .cvc-pagination .page-numbers.dots {
    border: none;
    background: transparent;
    color: #888;
    cursor: default;
}

/* Patient detail modal */
.cvc-patient-detail-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 16px;
}

.cvc-patient-detail-modal.active {
    opacity: 1;
    visibility: visible;
}

.cvc-patient-modal-content {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.cvc-patient-detail-modal.active .cvc-patient-modal-content {
    transform: translateY(0);
}

.cvc-patient-modal-header {
    padding: 20px 24px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    background: linear-gradient(135deg, #4054b2, #5c6bc0);
}

.cvc-patient-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.cvc-patient-modal-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    object-fit: cover;
}

.cvc-patient-modal-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

.cvc-patient-modal-name {
    margin: 0;
    font-size: 18px;
    color: #fff;
}

.cvc-patient-modal-phone {
    display: block;
    font-size: 13px;
    opacity: 0.9;
    width: 100%;
}

.cvc-patient-detail-modal .cvc-modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 22px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
}

.cvc-patient-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    background: #fafafa;
    padding: 0 12px;
    gap: 4px;
}

.cvc-patient-tabs button {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 14px 18px;
    font-size: 14px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -1px;
}

.cvc-patient-tabs button.active {
    color: var(--e-global-color-primary, #4054b2);
    border-color: var(--e-global-color-primary, #4054b2);
    font-weight: 600;
}

.cvc-patient-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    min-height: 200px;
}

.cvc-patient-tab-panel {
    display: none;
}

.cvc-patient-tab-panel.active {
    display: block;
}

.cvc-patient-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.cvc-patient-info-item {
    background: #f8f9fc;
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid #eef0f5;
}

.cvc-patient-info-item.full {
    grid-column: 1 / -1;
}

.cvc-patient-info-item label {
    display: block;
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
}

.cvc-patient-info-item span {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.cvc-patient-info-item .highlight {
    color: #2e7d32;
}

.cvc-patient-appointments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cvc-patient-appt-card {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 16px;
    align-items: start;
    transition: box-shadow 0.2s;
}

.cvc-patient-appt-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.cvc-patient-appt-card .appt-main h4 {
    margin: 0 0 6px;
    font-size: 15px;
    color: #333;
}

.cvc-patient-appt-card .appt-meta {
    font-size: 13px;
    color: #666;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.cvc-patient-appt-card .appt-meta i {
    margin-left: 4px;
    color: #999;
}

.cvc-patient-appt-card .appt-side {
    text-align: left;
}

.cvc-patient-appt-card .appt-amount {
    font-weight: 700;
    color: #333;
    font-size: 14px;
}

.cvc-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 6px;
}

.cvc-badge.status-pending { background: #fff3e0; color: #ef6c00; }
.cvc-badge.status-confirmed { background: #e8f5e9; color: #2e7d32; }
.cvc-badge.status-paid { background: #e3f2fd; color: #1565c0; }
.cvc-badge.status-visited { background: #f3e5f5; color: #7b1fa2; }
.cvc-badge.status-completed { background: #e8eaf6; color: #3949ab; }
.cvc-badge.status-cancelled { background: #ffebee; color: #c62828; }

.cvc-patient-chat-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 360px;
    overflow-y: auto;
    padding: 8px 4px;
}

.cvc-chat-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
}

.cvc-chat-bubble.is-me {
    align-self: flex-end;
    background: var(--e-global-color-primary, #4054b2);
    color: #fff;
    border-bottom-left-radius: 4px;
}

.cvc-chat-bubble.is-them {
    align-self: flex-start;
    background: #f0f2f5;
    color: #333;
    border-bottom-right-radius: 4px;
}

.cvc-chat-bubble .cvc-chat-time {
    display: block;
    font-size: 10px;
    margin-top: 6px;
    opacity: 0.75;
}

.cvc-patient-empty-state {
    text-align: center;
    padding: 32px 16px;
    color: #888;
    font-size: 14px;
}

.cvc-patient-empty-state .eicon-info-circle {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
    color: #ccc;
}

.cvc-patient-modal-footer {
    padding: 14px 24px;
    border-top: 1px solid #eee;
    background: #fafafa;
    text-align: left;
}

.cvc-patient-modal-close-btn {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}

.cvc-patient-modal-close-btn:hover {
    background: #5a6268;
}

@media (max-width: 768px) {
    .cvc-patients-header {
        display: none;
    }

    .cvc-patients-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .cvc-patients-row .col-visits,
    .cvc-patients-row .col-last {
        display: flex;
        justify-content: space-between;
        padding: 0 4px;
    }

    .cvc-patients-row .col-visits::before {
        content: 'تعداد نوبت:';
        color: #888;
        font-size: 13px;
    }

    .cvc-patients-row .col-last::before {
        content: 'آخرین مراجعه:';
        color: #888;
        font-size: 13px;
    }

    .cvc-patients-row .col-actions {
        justify-content: flex-end;
        border-top: 1px solid #eee;
        padding-top: 10px;
    }

    .cvc-patient-info-grid {
        grid-template-columns: 1fr;
    }

    .cvc-patient-appt-card {
        grid-template-columns: 1fr;
    }

    .cvc-patient-appt-card .appt-side {
        text-align: right;
    }
}
