﻿/* Overlay */
.js-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}

/* Card */
.js-modal {
    background: var(--surface);
    border-radius: 12px;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 30px 70px rgba(0,0,0,.35);
    animation: modalIn .25s ease-out;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Header */
.js-modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Avatar */
.js-modal .client-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-weight: 700;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Inputs */
.js-modal .ui-input {
    width: 100%;
    padding: .7rem .9rem;
    border-radius: 8px;
    border: 1.5px solid #e5e7eb;
    font-size: .95rem;
}

/* Buttons */
.js-modal .ui-button {
    padding: .65rem 1.4rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    border: none;
}

    .js-modal .ui-button.primary {
        background: var(--primary);
        color: white;
    }

    .js-modal .ui-button.secondary {
        background: var(--accent);
        color: white;
    }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

/* Actions */
.js-modal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
}

/* Close */
.js-modal-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    opacity: .6;
}

    .js-modal-close:hover {
        opacity: 1;
    }

@keyframes modalIn {
    from {
        transform: scale(.96);
        opacity: 0
    }

    to {
        transform: scale(1);
        opacity: 1
    }
}

/* =========================
   UI CARD (GLOBAL)
   ========================= */
.ui-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* =========================
   UI INPUT
   ========================= */
.ui-input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    border: 1.5px solid #e5e7eb;
    font-size: 0.95rem;
    font-family: inherit;
    box-sizing: border-box;
    background: #fafafa;
    transition: all 0.2s ease;
}

    .ui-input:focus {
        outline: none;
        border-color: var(--primary);
        background: white;
        box-shadow: 0 0 0 3px rgba(111, 77, 230, 0.12);
    }

/* =========================
   UI BUTTON
   ========================= */
.ui-button {
    padding: 0.65rem 1.4rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

    .ui-button.primary {
        background: var(--primary);
        color: white;
    }

        .ui-button.primary:hover {
            background: var(--primary-dark);
        }

    .ui-button.secondary {
        background: var(--accent);
        color: white;
    }

        .ui-button.secondary:hover {
            filter: brightness(0.95);
        }

    .ui-button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }


/* =========================
   CLIENT MODAL
   ========================= */
.client-modal {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.client-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-weight: 700;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.client-identity h3 {
    margin: 0;
    font-size: 1.1rem;
}

.badge {
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active {
    background: #d1fae5;
    color: #065f46;
}

.badge-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
}

    .form-label.required::after {
        content: " *";
        color: #dc2626;
    }

@media print {
    body * {
        visibility: hidden;
    }

    .qr-section, .qr-section * {
        visibility: visible;
    }

    .qr-section {
        position: absolute;
        top: 0;
        left: 0;
    }
}

.qr-section {
    margin-top: 1rem;
    text-align: center;
}

    .qr-section img {
        border: 1px solid #ddd;
        border-radius: 8px;
        background: white;
        padding: 5px;
    }

.btn-print {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    background: white;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

    .btn-print:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 18px rgba(0,0,0,0.2);
        background: var(--primary);
        color: white;
    }

    .btn-print:active {
        transform: scale(0.96);
    }

    .btn-print .icon {
        font-size: 1rem;
    }

@media print {
    .no-print {
        display: none !important;
    }
}

/* MODAL Client pour afficher Intervention */

.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.interventions-container {
    display: flex;
    flex-direction: column;
}

.interventions-list {
    max-height: calc(3 * 65px + 1rem);
    overflow-y: auto;
    padding-right: 5px;
}

    /* scrollbar clean */
    .interventions-list::-webkit-scrollbar {
        width: 6px;
    }

    .interventions-list::-webkit-scrollbar-thumb {
        background: rgba(0,0,0,0.2);
        border-radius: 10px;
    }

/* items */
.intervention-item {
    background: rgba(0,0,0,0.04);
    padding: 0.6rem;
    min-height: 65px;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

    .intervention-item .muted {
        font-size: 0.8rem;
        color: #666;
    }

    .intervention-item .date {
        font-size: 0.75rem;
        color: #999;
    }

.success-ok-btn {
    margin-top: 12px;
    min-width: 90px;
}

    .success-ok-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 14px rgba(0,0,0,0.2);
    }

    .success-ok-btn:active {
        transform: scale(0.96);
    }