/* Appointment Management tab styles — v1.9.1 */

.dap-booking-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: none;
    flex-wrap: wrap;
    padding: 4px;
}

.dap-booking-tab {
    flex: 1;
    min-width: 160px;
    padding: 14px 22px;
    border: 2px solid transparent;
    background: #e2e8f0;
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
    transition: color .2s, background .2s, border-color .2s, box-shadow .2s, transform .15s;
}

.dap-booking-tab:hover {
    color: #0f172a;
    background: #cbd5e1;
    transform: translateY(-1px);
}

.dap-booking-tab.is-active {
    color: #ffffff;
    background: #7c3aed;
    border-color: #6d28d9;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.dap-booking-tab.is-active:hover {
    color: #ffffff;
    background: #6d28d9;
    transform: translateY(-1px);
}

.dap-tab-panel[hidden] {
    display: none !important;
}

.dap-tab-panel.is-active {
    display: block;
}

/* Manage tab */
.dap-mgmt-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .dap-mgmt-actions {
        grid-template-columns: 1fr;
    }
}

.dap-mgmt-action-btn {
    padding: 18px 24px !important;
    font-size: 15px !important;
    min-height: 56px;
}

.dap-mgmt-action-secondary {
    background: #475569 !important;
}

.dap-mgmt-banner {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: 6px;
}

.dap-mgmt-banner strong {
    display: block;
    margin-bottom: 4px;
    color: #92400e;
}

.dap-mgmt-banner p {
    margin: 0;
    color: #78350f;
    font-size: 14px;
}

.dap-mgmt-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
}

.dap-mgmt-verify-row {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .dap-mgmt-verify-row {
        grid-template-columns: 1fr !important;
    }
}

.dap-mgmt-link-btn {
    background: none;
    border: none;
    color: #0f766e;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    padding: 8px 0;
}

.dap-field-error {
    display: block;
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
    min-height: 0;
}

.dap-field-error:not(:empty) {
    min-height: 16px;
}

.dap-mgmt-global-error {
    color: #dc2626;
    font-size: 14px;
    margin: 8px 0;
}

.dap-mgmt-workflow-heading {
    font-size: 28px;
    font-weight: 700;
    color: #7c3aed;
    margin: 0 0 8px;
    line-height: 1.2;
}

.dap-mgmt-workflow-subtitle {
    color: #475569;
    font-size: 15px;
    margin: 0 0 20px;
    line-height: 1.5;
}

.dap-field .dap-field-invalid,
.dap-field input.dap-field-invalid,
.dap-field textarea.dap-field-invalid,
.dap-field select.dap-field-invalid {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 1px #dc2626;
}

@media (max-width: 600px) {
    .dap-booking-tab {
        min-width: 100%;
        border-radius: 10px;
        margin-bottom: 6px;
    }

    .dap-mgmt-workflow-heading {
        font-size: 22px;
    }
}

.dap-mgmt-otp-notice {
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #86efac;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.dap-mgmt-otp-timer {
    font-size: 14px;
    margin-bottom: 16px;
}

.dap-mgmt-details-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.dap-mgmt-detail-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.dap-mgmt-detail-row label {
    font-weight: 600;
    color: #64748b;
    font-size: 13px;
}

.dap-mgmt-detail-row .dap-mgmt-readonly {
    color: #1e293b;
    font-size: 14px;
}

.dap-mgmt-subtitle {
    margin: 16px 0 8px;
    font-size: 14px;
    color: #334155;
}

/* Modals */
.dap-mgmt-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dap-mgmt-modal-overlay[hidden] {
    display: none !important;
}

.dap-mgmt-modal {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0,0,0,.2);
}

.dap-mgmt-modal h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.dap-mgmt-modal p {
    margin: 0 0 16px;
    color: #475569;
    font-size: 14px;
    line-height: 1.5;
}

.dap-mgmt-modal-error {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #fde8e8;
    color: #b42318;
    font-size: 13px;
    font-weight: 600;
}

.dap-mgmt-modal-error[hidden] {
    display: none;
}

.dap-mgmt-reasons {
    border: none;
    margin: 0 0 12px;
    padding: 0;
}

.dap-mgmt-reasons label {
    display: block;
    padding: 8px 0;
    font-size: 14px;
    cursor: pointer;
}

.dap-mgmt-reasons input {
    margin-right: 8px;
}

.dap-mgmt-modal-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.dap-mgmt-modal-success h3 {
    color: #166534;
}

/* Loading spinner / busy states (v1.9.23) */
@keyframes dap-mgmt-spin {
    to { transform: rotate(360deg); }
}

.dap-mgmt-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: dap-mgmt-spin 0.7s linear infinite;
    vertical-align: -0.15em;
    flex-shrink: 0;
}

.dap-mgmt-spinner-lg {
    width: 36px;
    height: 36px;
    border-width: 3px;
    border-color: rgba(124, 58, 237, 0.25);
    border-top-color: #7c3aed;
}

.dap-mgmt-btn-busy {
    opacity: 0.65 !important;
    filter: blur(0.4px);
    pointer-events: none !important;
    cursor: wait !important;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
}

.dap-mgmt-btn-busy .dap-mgmt-spinner {
    width: 16px;
    height: 16px;
}

.dap-mgmt-busy-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    border-radius: 8px;
    backdrop-filter: blur(1px);
}

.dap-mgmt-busy-overlay[hidden] {
    display: none !important;
}

.dap-mgmt-busy-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    text-align: center;
}

.dap-mgmt-busy-inner p {
    margin: 0;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
}

.dap-mgmt {
    position: relative;
}
