/**
 * Vue service [ecr_service] : liste des arrivees.
 * Pensee pour une tablette en salle : cibles tactiles larges, forts contrastes.
 */

.ecr-service {
    --ecr-svc-line: #e2e2e2;
    --ecr-svc-muted: #8a8a8a;
    --ecr-svc-ok: #1f7a3d;
    --ecr-svc-no: #a12a2a;
    font-size: 16px;
    line-height: 1.4;
    max-width: 1000px;
    margin: 0 auto;
}

.ecr-service__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0 16px;
}

.ecr-service__stamp {
    color: var(--ecr-svc-muted);
    font-size: 14px;
}

.ecr-service__refresh {
    border: 1px solid var(--ecr-svc-line);
    background: #fff;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
}

.ecr-service__msg {
    color: var(--ecr-svc-muted);
    padding: 24px 0;
    text-align: center;
}

.ecr-service__msg--error {
    color: var(--ecr-svc-no);
}

.ecr-service__day {
    margin-bottom: 28px;
}

.ecr-service__dayhead {
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid currentColor;
}

.ecr-service__row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 8px;
    border-bottom: 1px solid var(--ecr-svc-line);
}

.ecr-service__row.is-busy {
    opacity: 0.5;
}

/* Reservation non confirmee : ligne grisee. */
.ecr-service__row--pending {
    background: #f6f6f6;
    color: var(--ecr-svc-muted);
}

.ecr-service__row--arrived {
    background: #f2f9f4;
}

.ecr-service__row--no_show {
    background: #fbf3f3;
}

.ecr-service__time {
    font-weight: 700;
    font-size: 18px;
    min-width: 62px;
    font-variant-numeric: tabular-nums;
}

.ecr-service__who {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.ecr-service__who strong {
    font-size: 17px;
}

.ecr-service__phone {
    font-size: 14px;
    color: inherit;
    text-decoration: none;
}

.ecr-service__notes {
    font-size: 13px;
    color: var(--ecr-svc-muted);
    font-style: italic;
}

.ecr-service__covers {
    white-space: nowrap;
    font-size: 15px;
    min-width: 78px;
    text-align: right;
}

.ecr-service__created {
    font-size: 12px;
    color: var(--ecr-svc-muted);
    white-space: nowrap;
}

.ecr-service__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.ecr-service__btn {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    min-height: 44px;
}

.ecr-service__btn--arrived {
    background: var(--ecr-svc-ok);
    color: #fff;
}

.ecr-service__btn--noshow {
    background: #fff;
    color: var(--ecr-svc-no);
    border-color: var(--ecr-svc-no);
}

/* 2.9.0 : doublon possible */
.ecr-service__btn--doublon {
    background: #fff;
    color: #b45309;
    border-color: #b45309;
    font-weight: 600;
}

.ecr-service__btn--undo {
    background: transparent;
    color: var(--ecr-svc-muted);
    border-color: var(--ecr-svc-line);
    font-weight: 400;
    padding: 8px 12px;
    min-height: 0;
}

.ecr-service__badge {
    font-size: 14px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 6px;
}

.ecr-service__badge--arrived {
    color: var(--ecr-svc-ok);
}

.ecr-service__badge--no_show {
    color: var(--ecr-svc-no);
}

@media (max-width: 640px) {
    .ecr-service__row {
        flex-wrap: wrap;
    }

    .ecr-service__who {
        flex: 1 1 60%;
    }

    .ecr-service__covers {
        text-align: left;
        min-width: 0;
    }

    .ecr-service__actions {
        flex: 1 1 100%;
        justify-content: flex-end;
    }
}

/* --- Remerciement apres visite --- */

.ecr-service__btn--thanks {
    background: #fff7ed;
    border-color: #f59e0b;
    color: #b45309;
}

.ecr-service__btn--thanks.is-on {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}

.ecr-service__thanks-done {
    font-size: 13px;
    color: #b45309;
    white-space: nowrap;
}

/* Choix de la langue du remerciement (1.23.0) */
.ecr-service__thanks-wrap {
    position: relative;
    display: inline-flex;
}

.ecr-service__lang-pop {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 30;
    display: flex;
    gap: 6px;
    padding: 6px;
    background: #fff;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

.ecr-service__lang-pop::after {
    content: "";
    position: absolute;
    right: 18px;
    top: 100%;
    border: 6px solid transparent;
    border-top-color: #f59e0b;
}

.ecr-service__lang-btn {
    font: inherit;
    font-size: 14px;
    padding: 8px 14px;
    min-height: 40px;
    background: #fff7ed;
    color: #b45309;
    border: 1px solid #f59e0b;
    border-radius: 4px;
    cursor: pointer;
}

.ecr-service__lang-btn:hover,
.ecr-service__lang-btn:focus {
    background: #f59e0b;
    color: #fff;
}

/* ------------------------------------------------------------------ */
/*  Tag Emma et accordeon de conversation                             */
/* ------------------------------------------------------------------ */

.ecr-service__emma {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid #d08700;
    background: transparent;
    color: inherit;
    border-radius: 999px;
    padding: 2px 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.7;
    cursor: pointer;
}

.ecr-service__emma:hover {
    background: rgba( 208, 135, 0, 0.12 );
}

.ecr-service__emma.is-on {
    background: #d08700;
    color: #fff;
}

.ecr-service__conv {
    display: none;
}

.ecr-service__conv.is-open {
    display: block;
    margin: 0 0 10px;
    padding: 12px 16px;
    border-left: 3px solid #d08700;
    background: rgba( 208, 135, 0, 0.06 );
    font-size: 13px;
    line-height: 1.55;
}

.ecr-service__convmeta {
    margin: 0 0 10px;
    font-size: 12px;
    opacity: 0.65;
}

.ecr-service__turn {
    margin: 0 0 6px;
}

.ecr-service__turn--agent {
    padding-left: 14px;
}

.ecr-service__turn strong {
    margin-right: 6px;
}


/* ==== densite 4a : alignement en colonnes et compactage ==== */

.ecr-service__bar {
    position: sticky; top: 0; z-index: 5;
    background: #fff;
    padding: 8px 0;
    border-bottom: 1px solid var(--ecr-svc-line);
}

.ecr-service__dayhead {
    background: #1a1a1a;
    color: #fff;
    padding: 8px 12px;
    border-bottom: 0;
    font-size: 13px;
    letter-spacing: .03em;
}

.ecr-service__row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 40px auto;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--ecr-svc-line);
}

.ecr-service__time {
    font-size: 16px;
    font-variant-numeric: tabular-nums;
    margin: 0;
}

.ecr-service__who { min-width: 0; }
.ecr-service__who > * {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ecr-service__phone { font-size: 12px; color: var(--ecr-svc-muted); }

.ecr-service__notes {
    font-size: 12px;
    line-height: 1.45;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ecr-service__covers {
    font-size: 13px;
    color: var(--ecr-svc-muted);
    text-align: right;
    font-variant-numeric: tabular-nums;
    margin: 0;
}

.ecr-service__email,
.ecr-service__created {
    display: block;
    font-size: 12px;
    color: var(--ecr-svc-muted);
}
.ecr-service__email { text-decoration: none; }

.ecr-service__actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
}

.ecr-service__btn {
    padding: 7px 10px;
    font-size: 12px;
    white-space: nowrap;
    min-height: 34px;
}

.ecr-service__row--arrived { background: #f6f6f6; }
.ecr-service__row--arrived .ecr-service__time,
.ecr-service__row--arrived .ecr-service__who { color: var(--ecr-svc-muted); }

@media (max-width: 640px) {
    .ecr-service__row {
        grid-template-columns: 52px minmax(0, 1fr) 40px;
        row-gap: 8px;
        padding: 10px 14px;
    }
    .ecr-service__actions {
        grid-column: 1 / -1;
    }
    .ecr-service__btn {
        padding: 9px 14px;
        font-size: 13px;
        min-height: 40px;
    }
    .ecr-service__time { font-size: 17px; }
}

.ecr-service__covers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1a1a1a;
    color: #fff;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: center;
    justify-self: center;
    flex: 0 0 28px;
    min-width: 28px;
    max-width: 28px;
    box-sizing: border-box;
    padding: 0;
}

.ecr-service__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 4px;
    white-space: normal;
}
.ecr-service__tags:empty { display: none; }
.ecr-service__tag {
    font-size: 11px;
    line-height: 1.6;
    padding: 1px 8px;
    border: 1px solid var(--ecr-svc-line);
    border-radius: 10px;
    color: var(--ecr-svc-muted);
}
.ecr-service__tag--doublon {
    border-color: #b45309;
    background: #fef3c7;
    color: #92400e;
    font-weight: 600;
}
.ecr-service__tag--doublon.is-ok {
    background: transparent;
    color: var(--ecr-svc-muted);
    border-color: var(--ecr-svc-line);
    font-weight: 400;
}
.ecr-service__tag--hotel {
    border-color: #1a1a1a;
    color: #1a1a1a;
}
.ecr-service__tags .ecr-service__emma { margin: 0; }

.ecr-service__row--cancelled {
    opacity: 0.5;
    text-decoration: line-through;
}

.ecr-service__badge--cancelled {
    background: #f3f3f3;
    color: #8a8a8a;
    text-decoration: none;
}

/* Reservations d'evenement : bloc a part (1.25.0) */
.ecr-service__day--event {
    border-left: 4px solid #7c3aed;
    padding-left: 10px;
}

/* 2.5.0 : tables sans reservation */
.ecr-service__walkin {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--ecr-svc-line);
}
.ecr-service__walkin-title { font-weight: 600; margin-right: 4px; }
.ecr-service__walkin-step {
    width: 44px;
    height: 44px;
    font-size: 22px;
    line-height: 1;
    border: 1px solid var(--ecr-svc-line);
    border-radius: 6px;
    background: #fff;
    color: inherit;
    cursor: pointer;
}
.ecr-service__walkin-count { min-width: 32px; text-align: center; font-size: 20px; font-weight: 600; }
.ecr-service__walkin-room { margin-left: auto; font-size: 14px; color: var(--ecr-svc-muted); }
.ecr-service__walkin-room.is-over { color: var(--ecr-svc-no); font-weight: 600; }
.ecr-service__walkin-freed { font-size: 13px; color: var(--ecr-svc-muted); }
.ecr-service__row--walkin.is-freed { opacity: .55; }

/* 2.6.0 : numero de table */
.ecr-service__time {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.ecr-service__table {
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    min-width: 44px;
    max-width: 52px;
    min-height: 28px;
    padding: 3px 6px;
    border: 1px solid #1a1a1a;
    border-radius: 6px;
    background: #fff;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
.ecr-service__table.is-empty {
    border-style: dashed;
    border-color: #bdbdbd;
    color: var(--ecr-svc-muted);
    font-weight: 400;
}
.ecr-service__table.is-conflict {
    border-color: #d97706;
    background: #fff7ed;
    color: #b45309;
}
.ecr-service__table-input {
    width: 52px;
    min-height: 28px;
    font-size: 14px;
    padding: 3px 4px;
    border: 2px solid #1a1a1a;
    border-radius: 6px;
    box-sizing: border-box;
}
.ecr-service__walkin-table {
    width: 72px;
    height: 44px;
    font-size: 16px;
    padding: 0 8px;
    border: 1px solid var(--ecr-svc-line);
    border-radius: 6px;
    box-sizing: border-box;
}

/* 2.12.0 : demandes a rappeler (assistante virtuelle) */
.ecr-service__rappels {
    margin: 10px 0;
    padding: 10px 12px;
    border: 2px solid #d97706;
    border-radius: 10px;
    background: rgba(217, 119, 6, 0.08);
}
.ecr-service__rappels[hidden] { display: none; }
.ecr-service__rappels-title { font-weight: 700; color: #b45309; margin-bottom: 6px; }
.ecr-service__rappel {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 10px;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid var(--ecr-svc-line);
}
.ecr-service__rappels-title + .ecr-service__rappel { border-top: 0; }
.ecr-service__rappel-who { font-weight: 600; }
.ecr-service__rappel-who a { color: inherit; }
.ecr-service__rappel-msg { grid-column: 1; white-space: pre-line; }
.ecr-service__rappel .ecr-service__btn { grid-column: 2; grid-row: 1 / span 2; }
