.cvc-appt-cal-wrapper {
    direction: rtl;
    font-family: inherit;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 24px;
}

.cvc-appt-cal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.cvc-appt-cal-title h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.cvc-appt-cal-title i {
    font-size: 24px;
    color: var(--e-global-color-primary, #4054b2);
}

.cvc-appt-cal-layout {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 24px;
    align-items: start;
}

.cvc-appt-cal-panel-calendar {
    background: #f8f9fc;
    border-radius: 14px;
    padding: 18px;
}

.cvc-appt-cal-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-weight: 700;
    font-size: 17px;
    color: #333;
}

.cvc-appt-cal-nav button {
    background: #fff;
    border: 1px solid #e0e0e0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: #555;
    transition: all 0.2s;
}

.cvc-appt-cal-nav button:hover:not(:disabled) {
    border-color: var(--e-global-color-primary, #4054b2);
    background: #fff;
}

.cvc-appt-cal-nav button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.cvc-appt-cal-weekdays,
.cvc-appt-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    text-align: center;
}

.cvc-appt-cal-weekdays {
    font-size: 12px;
    font-weight: 700;
    color: #888;
    margin-bottom: 8px;
}

.cvc-appt-cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    border: 2px solid transparent;
    position: relative;
    transition: all 0.2s;
    min-height: 42px;
}

.cvc-appt-cal-day.empty {
    cursor: default;
    visibility: hidden;
}

.cvc-appt-cal-day.today:not(.selected) {
    border-color: #ffc107;
    background: #fffbeb;
}

.cvc-appt-cal-day.selected {
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(64, 84, 178, 0.35);
}

.cvc-appt-cal-day.is-holiday {
    color: #c0392b;
    background: #fdedec;
    border-color: #fadbd8;
}

.cvc-appt-cal-day.is-holiday:not(.selected) {
    cursor: default;
}

.cvc-appt-cal-day.is-holiday.selected {
    background-color: #c0392b;
    border-color: #c0392b;
}

.cvc-appt-cal-holiday-tag {
    display: block;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.1;
    margin-top: 1px;
    color: #c0392b;
    opacity: 0.95;
}

.cvc-appt-cal-day.selected .cvc-appt-cal-holiday-tag {
    color: #fff;
}

.cvc-appt-cal-day.is-holiday .cvc-appt-cal-count {
    color: #fff;
}

.cvc-appt-cal-holiday-msg {
    color: #c0392b;
}

.cvc-appt-cal-quick-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.cvc-appt-cal-day.has-appointments:not(.is-holiday)::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--e-global-color-primary, #4054b2);
}

.cvc-appt-cal-day.is-holiday.has-appointments::after {
    content: '';
    position: absolute;
    bottom: 3px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e74c3c;
}

.cvc-appt-cal-day.selected:not(.is-holiday)::after {
    background: #fff;
}

.cvc-appt-cal-day.is-holiday.selected::after {
    background: #fff;
}

.cvc-appt-cal-day .cvc-appt-cal-count {
    font-size: 10px;
    color: #e74c3c;
    font-weight: 700;
    margin-top: 2px;
    line-height: 1;
}

.cvc-appt-cal-day.selected .cvc-appt-cal-count {
    color: #fff;
}

.cvc-appt-cal-today-hint {
    margin-top: 14px;
    font-size: 13px;
    color: #666;
    text-align: center;
}

.cvc-appt-cal-legend {
    margin: 10px 0 0;
    font-size: 12px;
    color: #888;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cvc-appt-cal-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}

.cvc-appt-cal-legend-dot.is-holiday {
    background: #fdedec;
    border: 1px solid #fadbd8;
}

.cvc-appt-cal-panel-list {
    min-height: 320px;
}

.cvc-appt-cal-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.cvc-appt-cal-list-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.cvc-appt-cal-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--e-global-color-primary, #4054b2);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    white-space: nowrap;
}

.cvc-appt-cal-quick-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.cvc-appt-cal-quick-btn i {
    font-size: 14px;
}

.cvc-appt-cal-list-header h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.cvc-appt-cal-list-count {
    font-size: 13px;
    color: #888;
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 20px;
}

.cvc-appt-cal-list-body {
    max-height: 400px;
    overflow-y: auto;
}

.cvc-appt-cal-placeholder,
.cvc-appt-cal-empty,
.cvc-appt-cal-loading {
    text-align: center;
    color: #888;
    padding: 40px 16px;
    font-size: 14px;
}

.cvc-appt-cal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 10px;
    border-right: 4px solid var(--e-global-color-primary, #4054b2);
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.cvc-appt-cal-item:hover {
    background: #eef1f8;
    transform: translateX(-2px);
}

.cvc-appt-cal-item-main {
    flex: 1;
    min-width: 0;
}

.cvc-appt-cal-item-time {
    font-weight: 700;
    font-size: 15px;
    color: #333;
}

.cvc-appt-cal-item-patient {
    font-size: 14px;
    color: #555;
    margin-top: 2px;
}

.cvc-appt-cal-item-service {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cvc-appt-cal-badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    font-weight: 600;
}

.cvc-appt-cal-badge-pending { background: #fff3cd; color: #856404; }
.cvc-appt-cal-badge-confirmed,
.cvc-appt-cal-badge-paid,
.cvc-appt-cal-badge-completed,
.cvc-appt-cal-badge-visited { background: #d4edda; color: #155724; }
.cvc-appt-cal-badge-cancelled { background: #f8d7da; color: #721c24; }

jdp-container,
jdp-overlay {
    z-index: 1000001 !important;
}

/* Modal */
.cvc-appt-cal-modal-overlay {
    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: opacity 0.3s, visibility 0.3s;
}

.cvc-appt-cal-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cvc-appt-cal-modal-content {
    background: #fff;
    border-radius: 14px;
    width: 92%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(16px);
    transition: transform 0.3s;
}

.cvc-appt-cal-modal-overlay.active .cvc-appt-cal-modal-content {
    transform: translateY(0);
}

.cvc-appt-cal-modal-header {
    padding: 14px 18px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cvc-appt-cal-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #fff;
}

.cvc-appt-cal-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.cvc-appt-cal-modal-body {
    padding: 18px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.cvc-appt-cal-modal-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cvc-appt-cal-modal-row-full {
    grid-column: 1 / -1;
}

.cvc-appt-cal-modal-row label {
    font-size: 12px;
    color: #888;
}

.cvc-appt-cal-modal-row span,
.cvc-appt-cal-modal-row p {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    margin: 0;
}

.cvc-appt-cal-modal-date-wrap,
.cvc-appt-cal-modal-status-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.cvc-appt-cal-date-input,
.cvc-appt-cal-status-select {
    width: 100%;
    max-width: 220px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    direction: rtl;
}

.cvc-appt-cal-date-input:disabled,
.cvc-appt-cal-status-select:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.cvc-appt-cal-save-msg {
    font-size: 12px;
    color: #2e7d32;
}

.cvc-appt-cal-save-msg.is-error {
    color: #c62828;
}

.cvc-appt-cal-modal-footer {
    padding: 12px 18px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    text-align: left;
}

.cvc-appt-cal-modal-close-btn {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}

.cvc-appt-cal-modal-close-btn:hover {
    background: #5a6268;
}

/* Quick booking modal */
.cvc-appt-cal-quick-modal-content {
    max-width: 560px;
}

.cvc-appt-cal-quick-form-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.cvc-appt-cal-form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cvc-appt-cal-form-row-full {
    grid-column: 1 / -1;
}

.cvc-appt-cal-form-row label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
}

.cvc-appt-cal-field {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    box-sizing: border-box;
}

.cvc-appt-cal-field:focus {
    outline: none;
    border-color: var(--e-global-color-primary, #4054b2);
    box-shadow: 0 0 0 3px rgba(64, 84, 178, 0.12);
}

.cvc-appt-cal-field[readonly] {
    background: #f5f6f8;
    color: #333;
}

.cvc-appt-cal-quick-msg {
    grid-column: 1 / -1;
    margin: 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fdecea;
    color: #c0392b;
    font-size: 13px;
}

.cvc-appt-cal-quick-submit {
    background: var(--e-global-color-primary, #4054b2);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.cvc-appt-cal-quick-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cvc-appt-cal-quick-cancel {
    background: transparent;
    border: 1px solid #ccc;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    margin-left: 8px;
}

.cvc-appt-cal-quick-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.cvc-appt-cal-modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.cvc-alert {
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

.cvc-alert-warning {
    background: #fff3cd;
    color: #856404;
}

@media (max-width: 900px) {
    .cvc-appt-cal-layout {
        grid-template-columns: 1fr;
    }

    .cvc-appt-cal-modal-body {
        grid-template-columns: 1fr;
    }

    .cvc-appt-cal-quick-form-body {
        grid-template-columns: 1fr;
    }

    .cvc-appt-cal-list-header {
        flex-direction: column;
        align-items: stretch;
    }

    .cvc-appt-cal-list-actions {
        justify-content: space-between;
        width: 100%;
    }

    .cvc-appt-cal-quick-btn {
        flex: 1;
        justify-content: center;
    }
}
