/* =========================================================
   BTL BARBER — sobriété luxe : fond blanc, bandeau crème,
   traits noirs fins, libellés capitales espacées
   ========================================================= */

:root {
    --bg: #ffffff;            /* fond de page blanc */
    --surface: #e5e2dd;       /* beige (bandeau, cartes) */
    --tile: #ebe7e1;          /* beige-gris du fond produit (bague) */
    --tile-hover: #e2ddd5;
    --ink: #6b655d;           /* texte secondaire */
    --ink-strong: #141414;    /* noir */
    --line: #141414;
    --line-soft: #ddd6cc;
    --brown: #141414;         /* accent = noir (nom conservé pour compatibilité) */
    --danger: #b0261c;
    --ok: #2f5a3a;
    --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-display: var(--font-body);
    --banner-h: 64px;
    color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink-strong);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

a { color: var(--ink-strong); text-underline-offset: 3px; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* Libellés « boutique » : capitales espacées en chasse fixe */
.engrave, .label, .field > label, .tag, .chip, .btn, .banner__link, .week-nav__label, .arrow-btn,
.legend, .table th, .registry__letter, .ui-pop__title, .ui-cal__dow, .pill__sub, .notice strong {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: .14em;
}

h1, h2, h3 {
    font-family: var(--font-mono);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: var(--ink-strong);
    margin: 0 0 .9em;
    line-height: 1.3;
}
h1 { font-size: 1.05rem; text-align: center; margin: 1.2em 0 1.6em; letter-spacing: .22em; }
h2 { font-size: .9rem; }
h3 { font-size: .8rem; }

.engrave { color: var(--ink-strong); }
.muted { color: var(--ink); font-size: .92rem; }
.center { text-align: center; }
.small { font-size: .82rem; }

/* ---------- Bandeau crème fixe ---------- */

.banner {
    position: sticky;
    top: 0;
    z-index: 30;
    padding-top: env(safe-area-inset-top);
    background: var(--surface);
    border-bottom: 1px solid var(--line-soft);
}
.banner__bar {
    max-width: 1100px;
    margin: 0 auto;
    height: var(--banner-h);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 16px;
}
.banner__side { display: flex; align-items: center; }
.banner__side--end { justify-content: flex-end; }

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #000;
    line-height: 1;
    user-select: none;
}
.logo__main { font-family: var(--font-body); font-weight: 600; font-size: 1.75rem; letter-spacing: .02em; }
.logo__sub { font-family: var(--font-body); font-weight: 400; font-size: .58rem; letter-spacing: .32em; margin-top: 4px; padding-left: .32em; }

.banner__account {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-right: -8px;
    color: var(--ink-strong);
}
.banner__account svg { width: 26px; height: 26px; }
.banner__account.is-active svg { stroke-width: 1.8; }

.banner__nav {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 6px 26px;
    flex-wrap: wrap;
    padding: 0 12px 10px;
}
/* Client : chaque lien centré dans sa moitié, symétriques de part et d'autre du logo */
body:not(.is-barber) .banner__nav { display: grid; grid-template-columns: 1fr 1fr; justify-items: center; max-width: 420px; }
.banner__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0 5px;
    font-size: .72rem;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 1px solid transparent;
    transition: color .2s, border-color .2s;
}
.banner__link:hover, .banner__link:focus-visible { color: var(--ink-strong); outline: none; }
.banner__link.is-active { color: var(--ink-strong); border-bottom-color: var(--ink-strong); }
.lbl-short { display: none; }
@media (max-width: 420px) {
    .banner__nav { gap: 6px 18px; }
    .banner__link .lbl-long { display: none; }
    .banner__link .lbl-short { display: inline; }
}
.badge {
    font-style: normal;
    font-family: var(--font-body);
    font-size: .64rem;
    letter-spacing: 0;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    display: inline-grid;
    place-items: center;
}

/* ---------- Contenu ---------- */

.wall {
    flex: 1;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 8px 16px 48px;
}
.is-barber .wall { max-width: 980px; }
.has-actionbar .wall { padding-bottom: 130px; }

.frame {
    padding: 22px 20px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    margin-bottom: 9px;
}
.frame--bare { background: none; border: 0; padding: 0; }
.frame--deep { background: var(--tile); border-color: transparent; }
.frame > :last-child { margin-bottom: 0; }

.flash {
    padding: 12px 16px;
    margin: 0 0 16px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-left: 2px solid var(--ink-strong);
    font-size: .92rem;
}
.flash--error { border-left-color: var(--danger); color: var(--danger); }
.flash--success { border-left-color: var(--ok); }

.notice {
    padding: 18px 20px;
    margin-bottom: 18px;
    background: var(--ink-strong);
    color: #f4f0ea;
}
.notice strong { font-weight: 400; font-size: .78rem; }
.notice p { margin: .5em 0 0; line-height: 1.55; }
.notice form { margin-top: 12px; }
.notice .btn { border-color: #f4f0ea; color: #f4f0ea; background: transparent; }
.notice .btn:hover { background: #f4f0ea; color: var(--ink-strong); }
.notice .link-btn { color: inherit; }
.notice--soft { background: var(--surface); color: var(--ink-strong); border: 1px solid var(--line-soft); }
.notice--soft .link-btn { color: var(--ink-strong); }

/* ---------- Installation sur l'écran d'accueil ---------- */

.banner__install {
    appearance: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-left: -8px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink-strong);
    cursor: pointer;
}
.banner__install svg { width: 26px; height: 26px; }

.install-invite {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 40px 14px 16px;
    margin-bottom: 18px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
}
.install-invite p { margin: 0; flex: 1; font-size: .86rem; line-height: 1.45; color: var(--ink); }
.install-invite strong { display: block; margin-bottom: 3px; font-weight: 400; font-size: .7rem; color: var(--ink-strong); }
.install-invite .btn { flex: none; }
.install-invite__close {
    position: absolute; top: 2px; right: 2px;
    width: 36px; height: 36px;
    border: 0; background: none; cursor: pointer;
    font-size: 1.2rem; line-height: 1; color: var(--ink);
}

.install-icon { display: block; width: 72px; height: 72px; margin: 4px auto 18px; border-radius: 16px; border: 1px solid var(--line-soft); }
.install-steps { list-style: none; counter-reset: step; margin: 22px 0; padding: 0; border-top: 1px solid var(--line-soft); }
.install-steps li {
    counter-increment: step;
    display: flex;
    gap: 14px;
    align-items: baseline;
    padding: 14px 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: .92rem;
}
.install-steps li::before {
    content: counter(step, decimal-leading-zero);
    flex: none;
    font-family: var(--font-mono);
    font-size: .72rem;
    letter-spacing: .14em;
    color: var(--ink);
}
.install-steps strong { font-weight: 500; }
.install-glyph { width: 20px; height: 20px; vertical-align: -4px; margin: 0 2px; }

/* ---------- Rectangles (jours, heures) ---------- */

.pill {
    appearance: none;
    font: inherit;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 10px;
    min-height: 64px;
    border: 1px solid transparent;
    border-radius: 0;
    background: var(--tile);
    color: var(--ink-strong);
    text-decoration: none;
    transition: background-color .18s, color .18s;
}
.pill__main { font-family: var(--font-body); font-weight: 500; font-size: 1.08rem; letter-spacing: .04em; text-transform: uppercase; line-height: 1; }
.pill__sub { font-size: .66rem; color: inherit; opacity: .8; }
.pill:hover, .pill:focus-visible, .pill.is-selected { outline: none; background: var(--ink-strong); color: #fff; }
@media (hover: none) {
    .pill:hover:not(.is-selected) { background: var(--tile); color: var(--ink-strong); }
}

/* Jours (barbier) sur une seule ligne */
.week-days { display: flex; gap: 3px; margin: 6px 0 22px; }
.week-days .pill { flex: 1 1 0; min-width: 0; padding: 12px 2px; text-align: center; }
.week-days .pill__sub { white-space: nowrap; }
.week-days .pill__main { font-size: .9rem; }
.week-days .d-short { display: none; }
@media (max-width: 760px) {
    .week-days .d-long { display: none; }
    .week-days .d-short { display: inline; }
}
@media (max-width: 420px) {
    .week-days { gap: 2px; }
    .week-days .pill__main { font-size: .8rem; letter-spacing: 0; }
    .week-days .pill__sub, .week-days .count { font-size: .58rem; }
}

/* Grille des heures : 4 colonnes, dernière rangée centrée */
.hours { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 6px 0 4px; }
.hours .pill { flex: 0 0 calc((100% - 24px) / 4); min-height: 44px; padding: 8px 4px; }
.hours .pill__main { font-size: .92rem; letter-spacing: .02em; text-transform: none; }
@media (max-width: 380px) { .hours { gap: 6px; } .hours .pill { flex-basis: calc((100% - 12px) / 3); } }

.week-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 0 0 12px; min-height: 40px; }
.week-nav > :first-child { justify-self: start; }
.week-nav > :last-child { justify-self: end; }
.week-nav .arrow-btn span, .week-nav__label { white-space: nowrap; }
@media (max-width: 480px) { .week-nav .arrow-btn span { display: none; } }
.week-nav__label { font-size: .72rem; color: var(--ink-strong); }
.arrow-btn {
    appearance: none; border: 0; background: none; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .7rem; color: var(--ink-strong); padding: 8px 2px;
    text-decoration: none;
}
.arrow-btn:hover span { text-decoration: underline; text-underline-offset: 4px; }
.arrow-btn[disabled] { visibility: hidden; }
.arrow-btn svg { width: 18px; height: 18px; stroke-width: 1.4; }

.chips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-bottom: 18px; }
.chip {
    appearance: none; cursor: pointer; font-size: .68rem; text-decoration: none;
    padding: 9px 14px; border: 1px solid var(--line-soft); border-radius: 0;
    background: var(--surface); color: var(--ink-strong);
}
.chip small { font-family: var(--font-body); text-transform: none; letter-spacing: 0; opacity: .75; }
.chip:hover { background: var(--tile-hover); }
.chip.is-selected { background: var(--ink-strong); border-color: var(--ink-strong); color: #fff; }

/* ---------- Emploi du temps client : jours en accordéon ---------- */

.days { display: flex; flex-direction: column; }
.day { border-top: 1px solid var(--line-soft); padding: 26px 0 22px; }
.day:last-child { border-bottom: 1px solid var(--line-soft); }
.day__head {
    appearance: none; border: 0; background: none; font: inherit; color: inherit; cursor: pointer;
    width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0;
}
.day__name { font-family: var(--font-body); font-weight: 700; font-size: 1.7rem; text-transform: uppercase; letter-spacing: .06em; line-height: 1; }
.day__num { font-family: var(--font-body); font-size: .95rem; font-weight: 500; margin-top: 4px; }
.day__month { font-family: var(--font-body); font-size: .95rem; }
.day__toggle { display: grid; place-items: center; width: 36px; height: 28px; margin-top: 6px; color: var(--ink-strong); }
.day__toggle svg { width: 20px; height: 20px; stroke-width: 1.3; transition: transform .2s; }
.day.is-open .day__toggle svg { transform: rotate(180deg); }
.day__body { padding-top: 18px; }
.day__more { display: block; margin: 14px auto 0; }
/* Téléphone : chaque jour = bandeau centré + grille de créneaux comme le barbier */
#legend { display: none; }
@media (max-width: 760px) {
    .h1-desktop { display: none; }
    .days { gap: 14px; }
    .day, .day:last-child { border: 0; padding: 0; }
    .day__head {
        width: min(380px, 100%); margin: 0 auto; padding: 8px 6px 4px; gap: 4px;
    }
    /* Jour dans la typo du titre « Emploi du temps », en plus grand ; mois à la taille de « Barber » sous le logo, collé à la date */
    .day__label { font-family: var(--font-mono); font-weight: 400; font-size: 1.4rem; text-transform: uppercase; letter-spacing: .22em; padding-left: .22em; color: var(--ink-strong); line-height: 1.2; }
    .day__label--month { font-family: var(--font-body); font-size: .58rem; letter-spacing: .32em; padding-left: .32em; margin-top: -4px; }
    .day__line { font-family: var(--font-body); font-weight: 400; font-size: .9rem; text-transform: uppercase; letter-spacing: .14em; padding-left: .14em; line-height: 1.2; }
    .day__toggle { margin-top: 4px; width: 40px; height: 20px; background: var(--surface); }
    .day__toggle svg { width: 14px; height: 14px; stroke-width: 1.5; }
    .day__body { padding-top: 4px; }
    .day .slot.is-selected { background: var(--surface); box-shadow: inset 0 0 0 2px var(--ink-strong); }
    .day .slot:disabled { cursor: default; }
    .day .slot--taken:hover { background: var(--ink-strong); }
    #legend { display: flex; margin-top: 26px; }
    #legend[hidden] { display: none; }
}
.week-sep { text-align: center; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink); margin: 34px 0 6px; }

/* ---------- Boutons ---------- */

.btn {
    appearance: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 22px;
    border: 1px solid transparent;
    border-radius: 0;
    font-size: .72rem;
    font-weight: 400;
    line-height: 1.3;
    text-decoration: none;
    text-align: center;
    color: var(--ink-strong);
    background: var(--tile);
    transition: background-color .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--ink-strong); color: #fff; }
.btn--primary { background: var(--ink-strong); color: #fff; }
.btn--primary:hover { background: #3a3a3a; border-color: #3a3a3a; }
.btn--danger { color: var(--danger); border-color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: #fff; }
.btn--ghost { border-color: transparent; }
.btn--ghost:hover { border-color: transparent; }
.btn--ghost.btn--danger { border-color: transparent; }
.btn--ghost.btn--danger:hover { border-color: var(--danger); }
.btn--block { width: 100%; }
.btn--sm { padding: 10px 14px; font-size: .66rem; }
.btn[disabled], .btn.is-disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 16px; }
.btn-row > * { flex: 1 1 auto; }
.link-btn { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: var(--ink-strong); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Barre d'action en bas : Annuler à gauche, Valider au milieu */
.actionbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 25;
    padding: 14px 16px max(16px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: 1fr min(220px, 52vw) 1fr;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border-top: 1px solid var(--line-soft);
    transform: translateY(110%);
    transition: transform .25s ease;
    pointer-events: none;
}
.actionbar.is-visible { transform: none; pointer-events: auto; }
.actionbar > :first-child { justify-self: start; }
.actionbar .btn--primary { width: 100%; padding: 16px 12px; }
.actionbar .link-btn { font-size: .85rem; }
.actionbar__info { grid-column: 1 / -1; text-align: center; font-size: .82rem; color: var(--ink); margin-bottom: 10px; }

/* ---------- Formulaires ---------- */

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field > label, .label { font-size: .66rem; color: var(--ink-strong); }
.field .hint { font-size: .8rem; color: var(--ink); }
.req { color: var(--ink); }

input:not([type]), input[type=text], input[type=password], input[type=tel], input[type=date], input[type=time],
input[type=number], input[type=email], input[type=search], select, textarea {
    width: 100%;
    font: inherit;
    font-size: 16px;
    color: var(--ink-strong);
    padding: 12px 14px;
    border: 1px solid var(--line-soft);
    border-radius: 0;
    background: var(--surface);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .15s;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-strong) 50%), linear-gradient(135deg, var(--ink-strong) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink-strong); }
input[type=date] { min-height: 48px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 520px) { .grid-2.stack-sm, .grid-3.stack-sm { grid-template-columns: 1fr; } }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .92rem; }
.check input { appearance: none; -webkit-appearance: none; flex: 0 0 20px; width: 20px; height: 20px; margin: 1px 0 0; border: 1px solid var(--line-soft); border-radius: 0; background: var(--surface); cursor: pointer; display: grid; place-items: center; }
.check input:checked { background: var(--ink-strong); }
.check input:checked::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.check input[type=radio] { border-radius: 50%; }
.check input[type=radio]:checked::after { width: 8px; height: 8px; border: 0; border-radius: 50%; background: #fff; transform: none; }

.radio-pills { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.radio-pills label { position: relative; }
.radio-pills input { position: absolute; opacity: 0; pointer-events: none; }
.radio-pills span {
    display: inline-block; padding: 11px 14px; cursor: pointer;
    border: 1px solid var(--line-soft); background: var(--surface);
    font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .12em; font-size: .66rem; color: var(--ink-strong);
}
.radio-pills span:hover { border-color: var(--ink-strong); }
.radio-pills input:checked + span { background: var(--ink-strong); border-color: var(--ink-strong); color: #fff; }
.radio-pills input:focus-visible + span { outline: 1px solid var(--ink-strong); outline-offset: 2px; }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; cursor: pointer; }
.toggle input { appearance: none; -webkit-appearance: none; flex: 0 0 44px; width: 44px; height: 24px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--surface); position: relative; cursor: pointer; margin: 0; transition: background-color .2s; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink-strong); transition: transform .2s, background-color .2s; }
.toggle input:checked { background: var(--ink-strong); }
.toggle input:checked::after { transform: translateX(20px); background: #fff; }

.photo-picker { display: flex; align-items: center; gap: 14px; }
.photo-picker input[type=file] { font-size: .85rem; max-width: 100%; }

/* ---------- Avatars ---------- */

.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--tile); }
.avatar--lg { width: 84px; height: 84px; }
.avatar--sm { width: 32px; height: 32px; font-size: .72rem !important; }
.avatar--empty { display: inline-grid; place-items: center; font-family: var(--font-mono); letter-spacing: .06em; color: var(--ink-strong); font-size: .85rem; }
.avatar--lg.avatar--empty { font-size: 1.3rem; }

/* ---------- Mon rendez-vous / récapitulatif ---------- */

.rdv-card { text-align: center; padding: 34px 20px; }
.rdv-card__day { font-family: var(--font-body); font-size: 2rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1; }
.rdv-card__date { font-family: var(--font-body); font-size: 1rem; text-transform: none; letter-spacing: .02em; margin-top: 8px; }
.rdv-card__time { font-family: var(--font-body); font-size: 2.6rem; font-weight: 300; letter-spacing: .02em; margin: 18px 0 6px; text-transform: none; }
.rdv-card__meta { color: var(--ink); }
.rdv-card .engrave { display: block; }
.rdv-card .tag { margin-bottom: 14px; }
.rdv-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; margin-top: 16px; }
.rdv-actions form { display: flex; margin: 0; }
.rdv-actions .btn { width: 100%; padding-left: 10px; padding-right: 10px; }

.summary { display: grid; gap: 4px; text-align: center; margin: 8px 0 20px; background: var(--tile); border-color: transparent; }

/* ---------- Feuille modale ---------- */

.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(20, 20, 20, .38); opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet.is-open { opacity: 1; pointer-events: auto; }
.sheet__panel {
    width: min(560px, 100%);
    max-height: 92vh;
    overflow: auto;
    padding: 26px 20px max(24px, env(safe-area-inset-bottom));
    background: var(--bg);
    transform: translateY(30px);
    transition: transform .25s;
}
.sheet.is-open .sheet__panel { transform: none; }
.sheet__handle { width: 36px; height: 2px; margin: -10px auto 18px; background: var(--line-soft); }
.sheet__title { text-align: center; }
@media (min-width: 700px) {
    .sheet { align-items: center; }
}

.toast {
    position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 60;
    transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
    padding: 13px 20px; max-width: 90vw;
    background: var(--ink-strong); color: #fff; font-size: .9rem;
    transition: all .25s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Listes ---------- */

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.list > li + li > .list-item, .list > li.list-item + li.list-item { border-top: 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 14px; border: 1px solid var(--line-soft); background: var(--surface); text-decoration: none; color: inherit; }
.list-item__body { flex: 1; min-width: 0; }
.list-item__title { font-weight: 500; color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item__meta { font-size: .84rem; color: var(--ink); }
.list-item__actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
a.list-item:hover { background: var(--tile); }

.tag { display: inline-block; padding: 3px 8px; font-size: .6rem; letter-spacing: .12em; border: 1px solid var(--line-soft); color: var(--ink-strong); vertical-align: middle; background: var(--surface); }
.tag--warn { border-color: var(--danger); color: var(--danger); }
.tag--ok { border-color: var(--ok); color: var(--ok); }
.tag--brown { background: var(--ink-strong); border-color: var(--ink-strong); color: #fff; }

.tabs { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }

.empty { text-align: center; padding: 34px 14px; color: var(--ink); }
.empty .btn { margin-top: 10px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: .94rem; }
.kv dt { color: var(--ink); }
.kv dd { margin: 0; }

table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--line-soft); }
.table th { font-weight: 400; color: var(--ink); font-size: .62rem; }

/* ---------- Registre client (A, B, C…) ---------- */

.registry__letter { font-size: .95rem; margin: 26px 0 8px; letter-spacing: .1em; }
table.registry { width: 100%; border-collapse: collapse; background: var(--surface); table-layout: fixed; }
.registry td { border: 1px solid #c9c1b6; padding: 11px 12px; vertical-align: middle; font-size: .94rem; }
.registry__name { width: 50%; overflow: hidden; text-overflow: ellipsis; }
.registry__name a { text-decoration: none; }
.registry__name a:hover { text-decoration: underline; }
.registry__name .tag { margin-left: 6px; }
.registry__flag { text-align: left; }
.registry__flag > * { vertical-align: middle; }
.penalty { display: inline-flex; align-items: center; gap: 7px; font-size: .84rem; color: var(--danger); }
.penalty__dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); }
.penalty__remove { display: inline; float: right; }
.penalty__x { appearance: none; border: 0; background: none; cursor: pointer; font-size: 1.25rem; line-height: 1; padding: 0 2px; color: var(--ink); }
.penalty__x:hover { color: var(--danger); }
@media (max-width: 520px) { .registry__name { width: 55%; } .registry td { padding: 10px 8px; } }

/* ---------- Emploi du temps barbier ---------- */

.day-head { display: flex; justify-content: flex-end; margin: 0 0 16px; }
/* Mêmes rectangles que la configuration : largeur d'une colonne sur 7 (cadre compris), même hauteur */
.slots { display: grid; grid-template-columns: repeat(4, calc((100% - 42px - 24px) / 7)); justify-content: center; gap: 4px; }
.day-close { display: flex; justify-content: center; margin: 20px 0 0; }
.slot, .cfg-slot { min-height: 46px; }
.slot {
    appearance: none; font: inherit; cursor: pointer; text-align: center;
    padding: 4px 2px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    border: 1px solid transparent; border-radius: 0;
    background: var(--tile); color: var(--ink-strong);
    transition: background-color .15s, color .15s;
}
.slot__time { font-family: var(--font-body); font-weight: 500; font-size: .82rem; }
.slot__who { font-size: .66rem; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot:hover { background: var(--tile-hover); }
.slot--taken { background: var(--ink-strong); color: #fff; }
.slot--taken:hover { background: #333; }
.slot--cont { background: #3d3d3d; }
.slot--absent { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.slot--absent:hover { background: #fbeceb; }
.slot--bday { box-shadow: inset 0 0 0 3px #c9a96a; }
.slot--closed { background: transparent; border: 1px dashed #b9b0a4; color: var(--ink); }
.slot--closed .slot__time { font-weight: 400; }
.slot--closed:hover { border-color: #8f877c; color: var(--ink-strong); background: var(--surface); }
.slot--past { opacity: .4; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; font-size: .58rem; color: var(--ink); margin-top: 20px; }
.legend i { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; margin-right: 6px; border: 1px solid transparent; }
.legend .l-free { background: var(--tile); }
.legend .l-taken { background: var(--ink-strong); }
.legend .l-closed { border-style: dashed; border-color: #b9b0a4; }
.legend .l-absent { background: var(--surface); border-color: var(--danger); }

.pill .count { font-size: .7rem; font-family: var(--font-body); letter-spacing: 0; text-transform: none; opacity: .8; }
.pill--off { opacity: .5; }
.pill--off .pill__main { text-decoration: line-through; text-decoration-thickness: 1px; }

/* Configuration : colonnes de la semaine */
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.week-col { display: flex; flex-direction: column; gap: 3px; }
.week-col__head { text-align: center; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--ink-strong); font-size: .66rem; padding: 6px 0; }
.cfg-slot { appearance: none; font: inherit; cursor: pointer; padding: 7px 2px; border-radius: 0; font-size: .82rem; color: var(--ink); background: none; border: 1px dashed #b9b0a4; }
.cfg-slot.is-on { color: #fff; background: var(--ink-strong); border: 1px solid var(--ink-strong); }
.cfg-plus { appearance: none; cursor: pointer; font-size: 1.1rem; color: var(--ink-strong); background: var(--surface); border: 1px solid var(--line-soft); border-radius: 0; padding: 5px 0; }
.cfg-plus:hover { background: var(--tile-hover); }
.cfg-plus[disabled] { opacity: .3; cursor: default; }
@media (max-width: 760px) {
    .week-grid { grid-template-columns: repeat(7, 92px); overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
    .week-col { scroll-snap-align: start; }
    .week-scroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
    .slots { grid-template-columns: repeat(4, minmax(0, 92px)); }
}

.service-form { flex: 1; display: grid; grid-template-columns: 2fr 1fr 1fr auto; align-items: end; gap: 4px; }
@media (max-width: 560px) { .service-form { grid-template-columns: 1fr 1fr; } .service-form .field:first-of-type { grid-column: 1 / -1; } }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-title h2 { margin: 0; }

.search { margin-bottom: 16px; }

details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

@media (max-width: 420px) {
    .pill__main { font-size: .95rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* =========================================================
   Composants : menus déroulants, calendrier, choix d'heure
   ========================================================= */

.ui-select { position: relative; }
.ui-native { position: absolute !important; inset: auto 0 0 0; width: 100% !important; height: 1px !important; opacity: 0; pointer-events: none; padding: 0 !important; border: 0 !important; }

.ui-field {
    appearance: none;
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border: 1px solid var(--line-soft);
    border-radius: 0;
    background: var(--surface);
    font: inherit;
    font-size: 16px;
    color: var(--ink-strong);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s;
}
.ui-field:hover { border-color: #b9b0a4; }
.ui-field:focus-visible, .ui-field[aria-expanded="true"] { outline: none; border-color: var(--ink-strong); }
.ui-field.is-invalid { border-color: var(--danger); }
.ui-field:disabled { opacity: .5; cursor: default; }
.ui-field__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-field__value.is-placeholder { color: var(--ink); }
.ui-chevron { width: 16px; height: 16px; flex: 0 0 16px; color: var(--ink-strong); transition: transform .2s; }
.ui-field[aria-expanded="true"] .ui-chevron { transform: rotate(180deg); }
.ui-icon { width: 18px; height: 18px; flex: 0 0 18px; color: var(--ink-strong); }

/* Fenêtre flottante */
.ui-backdrop { position: fixed; inset: 0; z-index: 69; background: transparent; }
.ui-pop {
    position: fixed;
    z-index: 70;
    max-height: min(360px, 70vh);
    display: flex;
    flex-direction: column;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    box-shadow: 0 12px 30px rgba(20, 20, 20, .12);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .14s, transform .14s;
}
.ui-pop.is-open { opacity: 1; transform: none; }
.ui-pop--sheet {
    left: 0; right: 0; bottom: 0; top: auto;
    max-height: 75vh;
    padding: 20px 14px max(18px, env(safe-area-inset-bottom));
    border: 0;
    background: var(--bg);
    transform: translateY(40px);
    transition: opacity .2s, transform .22s;
}
.ui-pop--sheet.is-open { transform: none; }
.ui-backdrop.is-open { transition: background-color .2s; }
@media (max-width: 600px) { .ui-backdrop.is-open { background: rgba(20, 20, 20, .38); } }
.ui-pop__title { text-align: center; color: var(--ink-strong); font-size: .7rem; margin: -2px 0 12px; }

/* Liste d'options */
.ui-list { overflow-y: auto; outline: none; display: grid; gap: 1px; overscroll-behavior: contain; }
.ui-option { position: relative; padding: 11px 14px 11px 36px; cursor: pointer; color: var(--ink-strong); user-select: none; }
.ui-option:hover, .ui-option.is-active { background: var(--tile); }
.ui-option.is-selected { color: #fff; background: var(--ink-strong); }
.ui-option.is-selected::before { content: ""; position: absolute; left: 15px; top: 50%; width: 5px; height: 10px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-65%) rotate(45deg); }
.ui-option.is-disabled { opacity: .4; cursor: default; }
.ui-pop--sheet .ui-option { padding-top: 14px; padding-bottom: 14px; font-size: 1.02rem; }

/* Calendrier */
.ui-cal { padding: 6px 6px 4px; }
.ui-cal__head { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 4px; margin-bottom: 8px; }
.ui-cal__nav {
    appearance: none; cursor: pointer;
    width: 40px; height: 40px;
    font-size: 1.3rem; line-height: 1; color: var(--ink-strong);
    background: none; border: 1px solid var(--line-soft); border-radius: 0;
}
.ui-cal__nav:hover { background: var(--tile-hover); }
.ui-cal__title {
    appearance: none; border: 0; background: none; cursor: pointer;
    font-family: var(--font-mono); font-size: .76rem;
    text-transform: uppercase; letter-spacing: .14em; color: var(--ink-strong);
    padding: 8px;
}
.ui-cal__title span { color: var(--ink); }
.ui-cal__title:hover:not(.is-static) { text-decoration: underline; text-underline-offset: 4px; }
.ui-cal__title.is-static { cursor: default; }
.ui-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ui-cal__grid--3 { grid-template-columns: repeat(3, 1fr); gap: 4px; }
.ui-cal__dow { text-align: center; font-size: .58rem; color: var(--ink); padding: 4px 0 6px; }
.ui-cal__day, .ui-cal__cell {
    appearance: none; border: 1px solid transparent; cursor: pointer; font: inherit;
    aspect-ratio: 1; border-radius: 0;
    display: grid; place-items: center;
    color: var(--ink-strong); background: none;
    transition: background-color .12s;
}
.ui-cal__cell { aspect-ratio: auto; padding: 14px 4px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; border-color: var(--line-soft); }
.ui-cal__day:hover:not(:disabled), .ui-cal__cell:hover:not(:disabled) { background: var(--tile); }
.ui-cal__day:focus-visible, .ui-cal__cell:focus-visible { outline: 1px solid var(--ink-strong); outline-offset: 1px; }
.ui-cal__day.is-out { color: var(--ink); opacity: .45; }
.ui-cal__day.is-today, .ui-cal__cell.is-today { border-color: var(--ink-strong); }
.ui-cal__day.is-selected, .ui-cal__cell.is-selected { color: #fff; opacity: 1; background: var(--ink-strong); }
.ui-cal__day:disabled, .ui-cal__cell:disabled { opacity: .22; cursor: default; }
.ui-cal__foot { display: flex; justify-content: space-between; gap: 10px; padding: 10px 6px 2px; margin-top: 6px; border-top: 1px solid var(--line-soft); font-size: .88rem; }
.ui-pop--sheet .ui-cal { max-width: 420px; margin: 0 auto; width: 100%; }
