/* ==========================================================================
   Event page: timeline on the left, information panel in tabs on the right.
   Everything is scoped to .ev-page.
   ========================================================================== */
.ev-page {
    color: var(--ev-text);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ev-page .ev-small { font-size: 0.78rem; }
.ev-page .ev-warn { color: #b45309; }
/* A late task (B4 of review #6): red, as everywhere */
.ev-page .ev-late { color: #dc2626; font-weight: 600; }

/* ---- Buttons ------------------------------------------------------------ */
.ev-page .ev-btn {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 36px; padding: 6px 12px; border-radius: 8px;
    border: 1px solid var(--ev-border); background: var(--ev-bg); color: var(--ev-text);
    font-size: 0.85rem; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.ev-page .ev-btn:hover { background: var(--ev-soft); color: var(--ev-text); }
.ev-page .ev-btn-primary { background: var(--ev-accent); border-color: var(--ev-accent); color: #ffffff; }
.ev-page .ev-btn-primary:hover { background: #4338ca; color: #ffffff; }
.ev-page .ev-btn-whatsapp { background: #16a34a; border-color: #16a34a; color: #ffffff; }
.ev-page .ev-btn-whatsapp:hover { background: #15803d; color: #ffffff; }
/* Beside its email (C1 of review #6): outlined, its icon green, never a second filled button */
.ev-page .ev-btn-wa-outline .fa-whatsapp { color: #16a34a; }
.ev-page :is(.ev-btn, .ev-link, .ev-tab, .ev-step, .ev-filter, summary):focus-visible { outline: 2px solid var(--ev-accent); outline-offset: 2px; }

/* ---- Header ------------------------------------------------------------- */
.ev-header {
    background: var(--ev-bg); border: 1px solid var(--ev-border); border-radius: 12px;
    border-top: 4px solid var(--stage-color, #6b7280);
    padding: 14px 18px; display: flex; flex-direction: column; gap: 12px;
}
.ev-header-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.ev-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-width: 0; }
.ev-title h1 { margin: 0; font-size: 1.35rem; font-weight: 700; }
.ev-title h1 a { color: inherit; text-decoration: none; }
.ev-title h1 a:hover { text-decoration: underline; }
.ev-type { font-size: 0.75rem; font-weight: 700; color: var(--chip-ink, #ffffff); background: var(--chip); border-radius: 999px; padding: 3px 10px; }
.ev-meta { font-size: 0.88rem; color: var(--ev-muted); display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
a.ev-meta { color: var(--ev-accent); font-weight: 600; }
.ev-header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ev-header-actions .ev-reach .fa-whatsapp { color: #16a34a; }
/* Its number read and copied on a computer (E9); on a phone, « Appeler » calls it */
.ev-reach-number { font-weight: 500; }
.ev-reach-copy .ev-btn { gap: 6px; }
@media (max-width: 600px) {
    .ev-reach-number, .ev-reach-copy { display: none; }
}
/* Back from « Appeler » (E5): « Vous avez appelé Léa : On s'est parlé · Pas joint » */
.ev-called { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: var(--ev-accent-soft); color: var(--ev-accent-text); font-weight: 600; }
.ev-called[hidden] { display: none; }
.ev-called .ev-called-close { margin-left: auto; }
.ev-called-form { display: contents; }
/* The Client tab's phone and email, corrected there (E4) */
.ev-grid2.ev-contact-fields { margin-top: 6px; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
@media (max-width: 520px) { .ev-grid2.ev-contact-fields { grid-template-columns: minmax(0, 1fr); } }
.ev-panel .ev-change-contact { align-self: flex-start; font-size: 0.82rem; font-weight: 600; margin-top: -4px; }
.ev-panel .ev-field[hidden] { display: none; }
.ev-contact-state { grid-column: 1 / -1; font-size: 0.78rem; color: var(--ev-muted); min-height: 1em; }

/* What comes next, under the stages: its next task, its quote */
.ev-next { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.88rem; color: var(--ev-text); }
.ev-next .ev-link { padding: 0; border: 0; background: none; color: var(--ev-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.ev-next .ev-muted { color: var(--ev-muted); }
/* « À faire : ☐ tâche · Devis : … »: the next task ticked where it is (next_task_controller.js) */
.ev-next-task { display: inline-flex; align-items: center; gap: 6px; }
.ev-check { width: 22px; height: 22px; padding: 0; border: 1px solid var(--ev-line, #d1d5db); border-radius: 5px; background: var(--ev-bg, #fff); color: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.7rem; }
.ev-check:hover, .ev-check:focus-visible { border-color: #16a34a; color: #16a34a; }
.ev-check.ev-check-error { border-color: #dc2626; }
.ev-next-task.done .ev-check { background: #dcfce7; border-color: #16a34a; color: #16a34a; }
.ev-next-task.done .ev-next-task-name { text-decoration: line-through; color: var(--ev-muted); }
.ev-next-sep { color: var(--ev-muted); }
.ev-inline-form { display: inline; margin: 0; }

.ev-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-steps form { margin: 0; }
.ev-step {
    display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px;
    border-radius: 999px; border: 1px solid var(--ev-border); background: var(--ev-bg); color: var(--ev-muted);
    font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.ev-step:hover:not(:disabled) { border-color: var(--stage-color); color: var(--ev-text); }
.ev-step.done { background: var(--ev-accent-soft); border-color: transparent; color: var(--ev-accent-text); }
.ev-step.done::before { content: '✓'; }
.ev-step.current { background: var(--stage-color, var(--ev-accent)); border-color: var(--stage-color, var(--ev-accent)); color: var(--stage-ink, #ffffff); cursor: default; opacity: 1; }
.ev-step.lost { background: #fee2e2; border-color: #fecaca; color: #991b1b; cursor: default; }
/* A phone (C1): its stage, its follow-up and « ⋯ » on one line (« ● Devis envoyé ▾ · À relancer · 3 j · ⋯ »),
   « Passer à : … » under it, instead of the steps; its first message within the first screen */
/* On a computer too (C2 of review #5), under its steps: what is to do; « Passer à : … » there on a phone only */
.ev-steps-phone { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ev-steps-phone-only { display: none; }
.ev-steps-phone form:has(.ev-next-stage) { display: none; }
@media (max-width: 600px) {
    .ev-steps-phone-only { display: flex; }
    .ev-steps-phone form:has(.ev-next-stage) { display: block; }
}
/* « Perdu… » at the end of its stages (C5), « Marquer perdu… » under its stages' list on a phone */
.ev-steps form:has(.ev-step-lost) { margin-left: auto; }
.ev-page .ev-step-lost { color: #b91c1c; border-style: dashed; }
.ev-page .ev-stage-lost { color: #b91c1c; border-top: 1px solid var(--ev-border) !important; }
.ev-steps-phone form { margin: 0; }
.ev-stage-pick, .ev-break { display: none; }
.ev-stage-pick > summary strong { color: var(--ev-text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-stage-pick > summary strong::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; background: var(--stage-color, #6b7280); }
.ev-stage-pick .ev-dropdown-menu button:disabled { opacity: 1; font-weight: 700; cursor: default; }
.ev-page .ev-dropdown-menu a.ev-phone-only { display: none; }
@media (max-width: 600px) {
    .ev-header { padding: 12px 14px; gap: 10px; }
    .ev-steps { display: none; }
    .ev-steps-phone { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
    .ev-steps-phone .ev-btn, .ev-header-actions .ev-dropdown > summary, .ev-header-actions .ev-reach { min-height: 44px; }
    .ev-header-actions { width: 100%; }
    .ev-header-actions .ev-reach { flex: 1 1 28%; justify-content: center; }
    .ev-break { display: block; flex-basis: 100%; height: 0; }
    .ev-stage-pick { display: block; flex: 1 1 0; min-width: 0; }
    .ev-stage-pick > summary { display: flex; width: 100%; min-width: 0; }
    /* « ● Devis envoyé ▾ · À relancer · 4 j · ⋯ »: its stage's name whole (its colour says the follow-up, no bell) */
    .ev-header-actions { gap: 6px; }
    .ev-header-actions .ev-dropdown:not(.ev-follow-up) > summary { padding: 6px 10px; }
    .ev-follow-up .fu-since, .ev-stage-word, .ev-header .ev-follow-up .fu-badge > .fa { display: none; }
    .ev-follow-up .fu-badge { min-height: 44px; padding: 6px 10px; }
    .ev-page .ev-dropdown-menu a.ev-phone-only { display: flex; }
    /* « À faire » and « Devis » a line each, never a « · » left alone at the end of one (C7) */
    .ev-next { flex-direction: column; }
    .ev-next-sep { display: none; }
}

/* Dropdowns (details/summary) */
.ev-dropdown { position: relative; }
.ev-dropdown > summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
    min-height: 36px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--ev-border);
    background: var(--ev-bg); font-size: 0.85rem; font-weight: 600;
}
.ev-dropdown > summary::-webkit-details-marker { display: none; }
.ev-conflicts > summary { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.ev-dropdown-menu {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 240px; max-width: 360px;
    background: var(--ev-bg); border: 1px solid var(--ev-border); border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12); padding: 6px; display: flex; flex-direction: column;
}
.ev-dropdown-right { left: auto; right: 0; }
.ev-dropdown-menu a, .ev-dropdown-menu button {
    display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
    padding: 8px 10px; border-radius: 6px; border: 0; background: none; color: var(--ev-text);
    font-size: 0.85rem; text-decoration: none; cursor: pointer;
}
.ev-dropdown-menu a:hover, .ev-dropdown-menu button:hover { background: var(--ev-soft); }
.ev-dropdown-menu form { margin: 0; }

/* ---- Layout --------------------------------------------------------------- */
.ev-main { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 16px; align-items: start; }
/* A computer (C10): its save line kept in sight at the screen's foot while its panel is longer than the screen (never
   a panel scrolled on its own: its menus and lists would be cut at its edge) */
@media (min-width: 1201px) {
    .ev-main > .ev-side .ev-save { position: sticky; bottom: 0; z-index: 2; }
}
@media (max-width: 1200px) { .ev-main { grid-template-columns: minmax(0, 1fr); } }
/* A phone: the panel (its customer, date, place) before the timeline */
@media (max-width: 768px) { .ev-main > .ev-side { order: -1; } }
/* A phone: the panel folded to its tabs (data-folded, event_page_controller#fold), one touch opening it (E2) */
.ev-side-fold { display: none; }
@media (max-width: 768px) {
    .ev-side[data-folded] .ev-side-body { display: none; }
    .ev-side[data-folded] .ev-tabs { border-bottom: 0; border-radius: 12px; }
    .ev-side[data-folded] .ev-tab.active { background: transparent; color: var(--ev-muted); }
    .ev-side-fold { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; min-height: 36px; }
}

/* ---- Timeline ------------------------------------------------------------- */
.ev-thread { background: var(--ev-bg); border: 1px solid var(--ev-border); border-radius: 12px; display: flex; flex-direction: column; min-width: 0; }
.ev-thread-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--ev-border-soft); }
.ev-filters { display: flex; flex-wrap: wrap; gap: 6px; }
/* A phone: one choice, « Tout le fil ▾ » (C1); its conversations in « ⋯ » */
.ev-filter-pick { display: none; margin: 0; }
@media (max-width: 600px) {
    .ev-filter-pick { display: block; }
    .ev-filter-pick .form-select { min-height: 36px; font-size: 0.85rem; font-weight: 600; width: auto; }
    .ev-thread-bar .ev-filters, .ev-thread-bar .ev-threads { display: none; }
    .ev-thread-bar { padding: 8px 12px; }
}
/* Wherever the timeline is cut (event_page_controller.js#cut, 768 px): on the line of its filters */
.ev-thread-bar .ev-show-older { width: auto; margin: 0 0 0 auto; }
.ev-filter {
    min-height: 32px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--ev-border);
    background: var(--ev-bg); color: var(--ev-muted); font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.ev-filter.active { background: var(--ev-accent); border-color: var(--ev-accent); color: #ffffff; }
.ev-thread-status { font-size: 0.68rem; font-weight: 700; padding: 1px 7px; border-radius: 8px; background: #f3f4f6; color: #6b7280; }
.ev-thread-status.status-todo { background: #fee2e2; color: #991b1b; }
.ev-thread-status.status-waiting { background: #e0f2fe; color: #075985; }
.ev-thread-status.status-done { background: #dcfce7; color: #166534; }

/* Its last exchanges in the page's own scroll, on a computer too (C8 of review #5: never a frame of ≈ 380 px scrolled
   beside the page's): event_page_controller#cut */
.ev-thread-scroll { padding: 14px 16px; overflow: visible; max-height: none; min-height: 0; }
.ev-items > .ev-cut { display: none; }
/* « Voir l'élément précédent »: a link on one line (C1) */
.ev-show-older {
    display: block; width: 100%; min-height: 36px; margin: 0 0 6px; padding: 0; border: 0;
    background: none; color: var(--ev-accent); font-size: 0.82rem; font-weight: 600; cursor: pointer;
    text-decoration: underline; text-underline-offset: 2px;
}
.ev-older { display: block; text-align: center; font-size: 0.82rem; margin-bottom: 10px; }
.ev-notice { font-size: 0.78rem; color: var(--ev-muted); text-align: center; margin: 0 0 8px; }

/* System lines */
.ev-system { display: flex; align-items: center; gap: 10px; padding: 2px 12px; font-size: 0.82rem; color: var(--ev-muted); }
.ev-system > i { width: 16px; text-align: center; }
.ev-system-text { flex: 1; min-width: 0; }
.ev-system time { font-size: 0.75rem; }
.ev-system-text a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
/* Several changes in a row, on one line to unfold (EventTimeline::gatherHistory()) */
.ev-history > details > summary { list-style: none; cursor: pointer; border-radius: 8px; }
.ev-history > details > summary::-webkit-details-marker { display: none; }
.ev-history > details > summary:hover { background: var(--ev-soft); }
.ev-history > details > summary .ev-system-text::after { content: ' ▸'; color: var(--ev-muted); }
.ev-history > details[open] > summary .ev-system-text::after { content: ' ▾'; }
.ev-history-lines { list-style: none; margin: 2px 0 6px 18px; padding: 0 0 0 8px; border-left: 2px solid var(--ev-border-soft); }
/* Stage of a stage change, in its pipeline colour */
.ev-stage { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--ev-text); }
.ev-stage::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--stage); flex: none; }

/* Composer */
.ev-composer { border-top: 1px solid var(--ev-border); background: var(--ev-soft); border-radius: 0 0 12px 12px; padding: 10px 16px 14px; }
.ev-composer .activity-tabs { margin-bottom: 10px; }
.ev-composer .activity-tab-pane.active { display: flex; flex-direction: column; gap: 8px; }
.ev-composer-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.ev-composer-actions form { margin: 0; }
/* WhatsApp's export how-to, folded (C12 of review #6) */
.ev-wa-howto { margin-right: auto; max-width: 70%; }
.ev-wa-howto > summary { cursor: pointer; color: var(--ev-muted); }
.ev-wa-howto[open] > span { display: block; margin-top: 4px; }
.ev-composer-actions .ev-muted { margin-right: auto; }
.ev-composer .email-attachments-list { list-style: none; padding: 0; margin: 4px 0 0; font-size: 0.82rem; }

/* ---- Panel ---------------------------------------------------------------- */
/* Its tabs on top, an icon and its name: Événement · Client · Devis · Tâches */
.ev-side { display: flex; flex-direction: column; background: var(--ev-bg); border: 1px solid var(--ev-border); border-radius: 12px; min-width: 0; }
.ev-tabs { display: flex; gap: 4px; padding: 6px; background: var(--ev-soft); border-bottom: 1px solid var(--ev-border); border-radius: 12px 12px 0 0; }
.ev-tab {
    position: relative; flex: 1 1 0; min-width: 0; min-height: 44px; padding: 4px 6px; border-radius: 10px; border: 0; background: transparent;
    color: var(--ev-muted); font-size: 0.82rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.ev-tab > span:not(.ev-tab-badge):not([data-refresh]) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Its count shown again after a change (data-refresh): no box of its own, its badge laid out as before */
.ev-tab > [data-refresh] { display: contents; }
.ev-tab:hover { color: var(--ev-text); background: var(--ev-bg); }
.ev-tab.active { background: var(--ev-accent-soft); color: var(--ev-accent-text); }
.ev-tab-badge {
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; flex: none;
    font-size: 0.68rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
    background: var(--ev-border); color: var(--ev-text);
}
.ev-tab-badge.danger { background: #dc2626; color: #ffffff; }
/* A phone: its tabs a line of words (C12), never a third row of icons under the composer's and the bottom bar's */
@media (max-width: 480px) {
    .ev-tabs { gap: 2px; padding: 4px; }
    .ev-tab { gap: 4px; font-size: 0.8rem; min-height: 40px; padding: 4px 4px; }
    .ev-tab > .fa { display: none; }
    .ev-tab-badge { min-width: 16px; height: 16px; font-size: 0.66rem; }
}
/* Folded, level with the duration's field beside it (its label's height above, its field's height) */
.ev-period > summary { display: inline-flex; align-items: center; min-height: 38px; margin-top: 22px; font-size: 0.85rem; }
.ev-period[open] > summary { display: none; }

.ev-side-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ev-side-body > form { margin: 0; }
.ev-panel { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.ev-panel[hidden] { display: none; }
.ev-panel > h2 { margin: 0; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ev-muted); font-weight: 700; }
.ev-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ev-label { font-size: 0.75rem; font-weight: 600; color: #4b5563; margin: 0; }
.ea-dark-scheme .ev-label { color: #9ca3af; }
.ev-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
/* Its organisation's own fields (lot 50): a long text the whole row, a yes / no its box left of its words, a number its unit after it */
.ev-custom { margin-top: 10px; align-items: start; }
.ev-custom .ev-custom-wide, .ev-custom .ev-custom-check { grid-column: 1 / -1; }
.ev-custom .ev-custom-check { margin: 0; }
.ev-unit-row { display: flex; align-items: center; gap: 8px; }
.ev-unit-row > .form-control { flex: 1 1 auto; min-width: 0; }
.ev-contact-own { margin: 10px 0 0; font-size: .9rem; }
.ev-contact-own dt { font-weight: 600; font-size: .75rem; color: #4b5563; margin: 6px 0 0; }
.ea-dark-scheme .ev-contact-own dt { color: #9ca3af; }
.ev-contact-own dd { margin: 0; }
.ev-unit { color: var(--bs-secondary-color, #64748b); font-size: .9rem; white-space: nowrap; }
.ev-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
/* A phone: one field a line, but the event tab's short ones side by side (date and time, period and duration,
   guests, adults and children, pizzas and budget: E2) */
@media (max-width: 520px) { .ev-grid2, .ev-grid3 { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 341px) and (max-width: 520px) {
    #ev-panel-event .ev-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #ev-panel-event .ev-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Form controls of the panel and the composer: 14 px, values in full colour,
   examples clearly lighter, as in the mockup */
.ev-page {
    --ev-input-border: #d1d5db;
    --ev-placeholder: #9ca3af;
}
.ea-dark-scheme .ev-page {
    --ev-input-border: rgba(255, 255, 255, 0.16);
    --ev-placeholder: #6b7280;
}
.ev-page :is(.ev-panel, .ev-composer) :is(.form-control, .form-select) {
    font-size: 0.875rem; line-height: 1.4; color: var(--ev-text); font-weight: 400;
    min-height: 38px; padding: 7px 10px; border: 1px solid var(--ev-input-border); border-radius: 8px;
    background-color: var(--ev-bg); box-shadow: none;
}
.ev-page :is(.ev-panel, .ev-composer) .form-select { padding-right: 32px; background-position: right 10px center; }
.ev-page :is(.ev-panel, .ev-composer) textarea.form-control { min-height: 64px; resize: vertical; }
.ev-page :is(.ev-panel, .ev-composer) :is(.form-control, .form-select)::placeholder { color: var(--ev-placeholder); opacity: 1; }
.ev-page :is(.ev-panel, .ev-composer) :is(.form-control, .form-select):focus {
    border-color: var(--ev-accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); outline: 0;
}
.ev-page .ev-panel input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.ev-page .ev-panel input[type="number"]::-webkit-inner-spin-button,
.ev-page .ev-panel input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ev-page .ev-panel input[type="time"]::-webkit-calendar-picker-indicator { opacity: 0.5; }
.ev-page .ev-panel .input-group { flex-wrap: nowrap; }
.ev-page .ev-panel .input-group-text {
    font-size: 0.875rem; padding: 0 10px; min-height: 38px; color: var(--ev-muted); background: var(--ev-soft);
    border: 1px solid var(--ev-input-border); border-right: 0; border-radius: 8px 0 0 8px;
}
.ev-page .ev-panel .input-group > .form-control { border-radius: 0 8px 8px 0; }
/* Autocomplete (contacts, type, venue): the wrapper also has .form-select, but the
   field look belongs to its .ts-control (else the chevron ends up outside the field) */
.ev-page .ev-panel .ts-wrapper.form-select { padding: 0; min-height: 0; background-color: transparent; box-shadow: none; }
.ev-page .ev-panel .ts-wrapper { border: 0; border-radius: 8px; }
.ev-page .ev-panel .ts-wrapper .ts-control {
    font-size: 0.875rem; line-height: 1.4; color: var(--ev-text); min-height: 38px; padding: 7px 10px !important;
    border: 1px solid var(--ev-input-border) !important; border-radius: 8px !important; background: var(--ev-bg); box-shadow: none;
}
.ev-page .ev-panel .ts-wrapper.focus .ts-control { border-color: var(--ev-accent) !important; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); }
.ev-page .ev-panel .ts-wrapper .ts-control input { font-size: 0.875rem; color: var(--ev-text); }
.ev-page .ev-panel .ts-wrapper .ts-control input::placeholder { color: var(--ev-placeholder); opacity: 1; }
/* Date with its clear button inside the field */
.ev-page .ev-panel .input-with-clear { position: relative; display: block; }
.ev-page .ev-panel .input-with-clear .form-control { padding-right: 30px; }
.ev-page .ev-panel .clear-input-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); padding: 4px 8px; font-size: 0.8rem; }
/* Checkboxes (not switches), as in the mockup */
.ev-panel .form-check { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; padding-left: 0; min-height: 28px; font-size: 0.85rem; color: var(--ev-text); }
.ev-panel .form-check .form-check-input {
    float: none; margin: 0; flex: none; width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--ev-input-border); cursor: pointer;
}
.ev-panel .form-check .form-check-input:checked { background-color: var(--ev-accent); border-color: var(--ev-accent); }
.ev-panel .form-check .form-check-input:focus { box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); }
.ev-panel .form-check-label { cursor: pointer; }
/* Filled field: very light green border; empty field: orange (event_page_controller#refreshFill) */
.ev-page { --ev-fill-ok: #a7d9b5; --ev-fill-missing: #f5b27a; }
.ea-dark-scheme .ev-page { --ev-fill-ok: rgba(74, 222, 128, 0.35); --ev-fill-missing: rgba(251, 146, 60, 0.6); }
.ev-page .ev-panel .ev-field.ev-filled :is(.form-control, .form-select):not(:focus),
.ev-page .ev-panel .ev-field.ev-filled .input-group-text,
.ev-page .ev-panel .ev-field.ev-filled .ts-wrapper:not(.focus) .ts-control { border-color: var(--ev-fill-ok) !important; }
.ev-page .ev-panel .ev-field.ev-missing :is(.form-control, .form-select):not(:focus),
.ev-page .ev-panel .ev-field.ev-missing .input-group-text,
.ev-page .ev-panel .ev-field.ev-missing .ts-wrapper:not(.focus) .ts-control { border-color: var(--ev-fill-missing) !important; }
/* Its customer's answer on its quote's page (F1 of review #6), what the event waits on, in sight under its header's row */
.ev-page .ev-answer { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--ev-accent-soft); color: var(--ev-accent-text); font-size: 0.9rem; }
.ev-page .ev-answer .ev-inline-form { display: inline; margin: 0; }
.ev-section { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--ev-border-soft); padding-top: 12px; }
/* The event tab's groups (« Quand », « Où », « Les convives », « Pour l'équipe »: C12 of review #5) */
.ev-section-title { margin: 0; font-size: 0.85rem; font-weight: 700; color: var(--ev-text); }
/* Its day's plan (lot 64; its lines: app.css .bq-plan-*) */
.ev-plan .bq-plan-actions { margin-top: 0; }
.ev-plan-remarks { padding: 8px 12px; border-radius: 8px; background: var(--ev-accent-soft); color: var(--ev-accent-text); font-size: 0.88rem; }
.ev-fill-legend { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--ev-muted); }
.ev-fill-legend[hidden] { display: none; }
.ev-fill-swatch { width: 18px; height: 12px; border: 2px solid var(--ev-fill-missing); border-radius: 4px; flex: none; }
.ev-page .ev-help { margin: -6px 0 0; }

.ev-box { border: 1px solid var(--ev-border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; }
.ev-box-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ev-box a { text-decoration: none; }
.ev-box-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* « Autre proposition », « Nouveau devis » (C8 of review #6): 12 px around, never astride a card */
.ev-page .ev-quotes-new { margin: 12px 0; }
/* Its page opened by its customer (E3 of review #6) */
.ev-page .quote-opened { display: block; color: var(--ev-muted); }
.ev-page .quote-not-opened { color: #b45309; }
.ev-box-actions form { margin: 0; }
/* A quote's next steps, its link copied or sent (Devis tab) */
.quote-actions, .quote-online-link, .quote-ready-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.quote-actions form, .quote-ready-actions form { margin: 0; }
.ev-travel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; margin-bottom: 8px; }
.ev-other-event { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.85rem; text-decoration: none; padding: 4px 0; }
.ev-chip { font-size: 0.7rem; font-weight: 700; border-radius: 999px; padding: 2px 8px; color: var(--chip-ink, #ffffff); background: var(--chip); }
.ev-status { font-size: 0.72rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; background: #f3f4f6; color: #4b5563; }
.ev-status-success { background: #dcfce7; color: #166534; }
.ev-status-warning { background: #fef3c7; color: #92400e; }
.ev-status-danger { background: #fee2e2; color: #991b1b; }
.ev-status-secondary { background: #f3f4f6; color: #4b5563; }

/* Before any save, a quiet line; once saved (.shown), green and kept in sight above the phone's bar (C7) */
.ev-save {
    margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 16px; border-top: 1px solid var(--ev-border); background: var(--ev-bg); border-radius: 0 0 12px 12px;
}
.ev-save.shown { position: sticky; bottom: var(--bq-tabbar-h, 0px); }
.ev-save-state { font-size: 0.82rem; color: var(--ev-muted); }
/* Nothing typed in the Devis and Tâches tabs: « Chaque modification est enregistrée aussitôt. » not said there (E11),
   no empty line under them on a computer (C13 of review #5), a phone's « Replier » kept */
.ev-side:has(#ev-panel-quotes:not([hidden]), #ev-panel-tasks:not([hidden])) .ev-save:not(.shown) .ev-save-state { visibility: hidden; }
@media (min-width: 769px) {
    .ev-side:has(#ev-panel-quotes:not([hidden]), #ev-panel-tasks:not([hidden])) .ev-save:not(.shown) { display: none; }
}
.ev-save.shown .ev-save-state { font-weight: 600; color: #047857; }
.ev-save-state.dirty, .ev-save.shown .ev-save-state.dirty { color: #b45309; font-weight: 600; }
.ev-save-state.dirty::before { content: '● '; }

/* Composer: the email being written answers an email of the timeline */
.ev-page .ev-replying { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; padding: 6px 10px; border-radius: 8px; background: var(--ev-accent-soft); color: var(--ev-accent-text); font-size: 0.82rem; }
.ev-page .ev-replying[hidden] { display: none; }
.ev-page .ev-replying .ev-link { margin-left: auto; }

/* ---- Follow-up (header) ------------------------------------------------- */
.ev-follow-up > summary { padding: 0; border: 0; background: none; min-height: 0; }
.ev-follow-up .fu-badge { min-height: 36px; padding: 6px 12px; border-radius: 8px; font-size: 0.85rem; }
.ev-follow-up .fu-badge .fa, .ev-follow-up .fu-badge .fab { font-size: 0.8rem; }
.ev-page .fu-menu { min-width: 320px; max-width: 360px; gap: 2px; }
.fu-menu .fu-explain { margin: 4px 10px 8px; font-size: 0.82rem; color: var(--ev-muted); }
.fu-menu .fu-section { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--ev-border-soft); }
.fu-menu .fu-heading { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ev-muted); margin: 0; }
.fu-menu .fu-channels { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-dropdown-menu .fu-channels button, .ev-dropdown-menu .fu-plan button.fu-submit {
    width: auto; padding: 5px 10px; border: 1px solid var(--ev-border); border-radius: 8px; font-weight: 600; font-size: 0.82rem;
}
.fu-menu .fu-plan-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-dropdown-menu .fu-plan-chips .fu-chip { width: auto; min-height: 32px; padding: 4px 10px; border: 1px solid var(--ev-border); border-radius: 999px; font-size: 0.8rem; font-weight: 600; justify-content: center; }
.ev-dropdown-menu .fu-plan-chips .fu-chip[aria-pressed="true"] { background: var(--ev-accent); border-color: var(--ev-accent); color: #fff; }
.ev-dropdown-menu .fu-plan button.fu-submit { align-self: flex-start; background: var(--ev-accent); border-color: var(--ev-accent); color: #fff; }
.ev-dropdown-menu .fu-plan button.fu-submit:hover { background: #4338ca; }
/* « Autre date… »: its day, its note, « Noter la date » (C3) */
.fu-menu .fu-other > summary { list-style: none; cursor: pointer; color: var(--ev-accent); font-size: 0.82rem; font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
.fu-menu .fu-other > summary::-webkit-details-marker { display: none; }
.fu-menu .fu-other-form { display: flex; flex-direction: column; gap: 6px; }
.fu-menu .fu-hint { font-size: 0.78rem; color: var(--ev-muted); }
.ev-dropdown-menu button.fu-write, .ev-dropdown-menu a.fu-write { background: var(--ev-accent); color: #fff; font-weight: 600; justify-content: center; margin-bottom: 4px; }
.ev-dropdown-menu button.fu-write:hover, .ev-dropdown-menu a.fu-write:hover { background: #4338ca; color: #fff; }
.ev-composer .fu-choice { margin-right: auto; }

/* The composer's call (EventCallController): its block (admin/call/_call_fields.html.twig, app.css), smaller here */
.ev-composer .bq-call-choice, .ev-composer .bq-call-at { font-size: 0.92em; }
.ev-composer .bq-call-label { font-size: 0.75rem; color: #4b5563; min-width: 7.5em; }
.ea-dark-scheme .ev-composer .bq-call-label { color: #9ca3af; }
/* A phone: the composer's four tabs of the same width, never cut (E8) */
@media (max-width: 600px) {
    .ev-composer .activity-tabs { overflow: visible; }
    .ev-composer .activity-tab { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 0.75rem; justify-content: center; }
}

/* A phone: menus open as a sheet at the bottom of the screen (never off its edge), the page dimmed behind; tapping it closes */
@media (max-width: 600px) {
    .ev-dropdown[open] > summary::before {
        content: ''; position: fixed; inset: 0; z-index: 1040; background: rgba(15, 23, 42, 0.4); cursor: default;
    }
    .ev-page .ev-dropdown-menu, .ev-page .ev-dropdown-right, .ev-page .fu-menu {
        position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 1041;
        min-width: 0; max-width: none; max-height: 85vh; overflow-y: auto;
        border-radius: 14px 14px 0 0; padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    }
    .ev-dropdown-menu a, .ev-dropdown-menu button { min-height: 44px; }
}

/* A stage change's message: "Annuler" in it (EventStageController::undo()) */
.ev-undo { margin: 0 4px 0 0; }
.ev-undo .btn { font-weight: 700; min-height: 32px; }

/* The email's files: « Joindre un fichier » (its file field hidden, focused through it: E11) */
.ev-mail-files { align-items: flex-start; }
.ev-attach { cursor: pointer; }
#ev-mail-files:focus-visible + .ev-attach { outline: 2px solid var(--ev-accent); outline-offset: 2px; }

/* The writing area folded to one line until touched (E3): its note's field one line, its label and button away */
.ev-composer:not(.open) [data-tab-pane="comment"] > .ev-label,
.ev-composer:not(.open) [data-tab-pane="comment"] > .ev-composer-actions { display: none; }
.ev-composer:not(.open) [data-tab-pane="comment"] > textarea { height: 40px; min-height: 40px; resize: none; overflow: hidden; }

/* The email's head on one grey line (C2): « De Pizza Nomade <…> · ↩ Réponse à « … » (…) · Nouvel email » */
.ev-composer .ev-mail-head { margin: 0; padding: 6px 10px; border-radius: 8px; background: var(--ev-bg); border: 1px solid var(--ev-border-soft); font-size: 0.8rem; color: var(--ev-muted); line-height: 1.5; }
.ev-composer .ev-mail-head .email-inline-from { display: inline; background: none; padding: 0; margin: 0; font-size: inherit; color: inherit; }
.ev-composer .ev-mail-head .email-inline-from-value { color: var(--ev-text); }
.ev-page .ev-mail-head .ev-replying { display: inline; margin: 0; padding: 0; background: none; color: inherit; font-size: inherit; }
.ev-page .ev-mail-head .ev-replying[hidden] { display: none; }
.ev-page .ev-mail-head .ev-replying strong { color: var(--ev-text); }
.ev-page .ev-mail-head .ev-link, .ev-page .ev-mail-warning .ev-link { font-size: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
/* « Joindre un fichier » and « Joindre le devis » side by side (C2) */
.ev-mail-attach { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ev-mail-attach form { margin: 0; }
/* « Envoyer » in sight while the message is long (C2), above the phone's bar */
.ev-composer .ev-mail-send { position: sticky; bottom: var(--bq-tabbar-h, 0px); z-index: 5; background: var(--ev-soft); padding: 8px 0; border-top: 1px solid var(--ev-border); box-shadow: 0 -8px 12px -12px rgba(15, 23, 42, .35); }
/* On a phone, one row (C2): « 🔔 Relance : dans 1 semaine ▾ · Envoyer », its choice shrinking before it wraps */
@media (max-width: 767.98px) {
    .ev-composer .ev-mail-send { padding: 6px 0; }
    .ev-composer .ev-mail-send .fu-choice { flex: 1 1 0; min-width: 0; }
    .ev-composer .ev-mail-send .fu-choice select { flex: 1 1 0; min-width: 0; }
    .ev-composer .ev-mail-send .fu-label-long { display: none; }
    .ev-composer .ev-mail-send .fu-label-short { display: inline; }
    .ev-composer .ev-mail-send .fu-choice label > .fa { display: none; }
}

/* No mailbox to send from (E1 of review #5): its whole line, above « Envoyer » */
.ev-mail-nobox { flex-basis: 100%; margin: 0 0 4px; font-size: .85rem; color: #b45309; }
.ev-mail-nobox a { font-weight: 600; }
